summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-02-16 19:50:48 +0000
committerKeith Whitwell <keithw@vmware.com>2009-02-16 19:50:48 +0000
commit59d54334c96f44ed1d8bf660dc96221362a77d04 (patch)
treee9ab34e568256bcdc2a88602c47072ab769211e8
parent7c8836e9ef49d938aa55a1c385b95c6371c301f1 (diff)
parentc5c383596ddb26cd75e4b355918ad16915283b59 (diff)
Merge branch 'master' into gallium-texture-transfer
Conflicts: src/mesa/state_tracker/st_cb_accum.c src/mesa/state_tracker/st_cb_drawpixels.c
-rw-r--r--Makefile13
-rw-r--r--SConstruct4
-rwxr-xr-xautogen.sh2
-rw-r--r--configs/autoconf.in22
-rw-r--r--configs/default9
-rw-r--r--configs/linux-cell5
-rw-r--r--configs/linux-dri17
-rw-r--r--configure.ac181
-rw-r--r--docs/README.directfb3
-rw-r--r--docs/cell.html22
-rw-r--r--docs/relnotes-7.5.html56
-rw-r--r--docs/relnotes.html5
-rw-r--r--include/GL/glut.h22
-rw-r--r--progs/SConscript2
-rw-r--r--progs/demos/Makefile6
-rw-r--r--progs/demos/engine.c2
-rw-r--r--progs/demos/streaming_rect.c3
-rw-r--r--progs/demos/texdown.c5
-rw-r--r--progs/glsl/multitex.c88
-rw-r--r--progs/glsl/multitex.vert10
-rw-r--r--progs/redbook/SConscript91
-rw-r--r--progs/samples/Makefile2
-rw-r--r--progs/samples/SConscript58
-rw-r--r--progs/samples/blendeq.c7
-rw-r--r--progs/samples/blendxor.c9
-rw-r--r--progs/tests/bufferobj.c36
-rw-r--r--progs/tests/fbotest1.c15
-rw-r--r--progs/tests/fbotexture.c380
-rw-r--r--progs/tests/shader_api.c8
-rw-r--r--progs/util/extfuncs.h15
-rw-r--r--progs/xdemos/glxgears.c74
-rw-r--r--progs/xdemos/glxpixmap.c1
-rw-r--r--progs/xdemos/overlay.c3
-rw-r--r--scons/gallium.py31
-rw-r--r--scons/generic.py32
-rw-r--r--src/egl/Makefile7
-rw-r--r--src/egl/drivers/Makefile6
-rw-r--r--src/egl/drivers/demo/Makefile4
-rw-r--r--src/egl/drivers/dri/Makefile2
-rw-r--r--src/egl/drivers/glx/Makefile2
-rw-r--r--src/egl/drivers/xdri/Makefile2
-rw-r--r--src/egl/main/Makefile4
-rw-r--r--src/gallium/Makefile2
-rw-r--r--src/gallium/SConscript1
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_vbuf.c5
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos.c2
-rw-r--r--src/gallium/auxiliary/gallivm/tgsitollvm.cpp4
-rw-r--r--src/gallium/auxiliary/indices/Makefile16
-rw-r--r--src/gallium/auxiliary/indices/SConscript17
-rw-r--r--src/gallium/auxiliary/indices/u_indices.c253
-rw-r--r--src/gallium/auxiliary/indices/u_indices.h83
-rw-r--r--src/gallium/auxiliary/indices/u_indices_gen.c5129
-rw-r--r--src/gallium/auxiliary/indices/u_indices_gen.py319
-rw-r--r--src/gallium/auxiliary/indices/u_indices_priv.h43
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c37
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h32
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr.h5
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c4
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_build.c20
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump.c4
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump_c.c4
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c4
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ppc.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c9
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_sse2.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_text.c2
-rw-r--r--src/gallium/auxiliary/util/u_linear.c17
-rw-r--r--src/gallium/auxiliary/util/u_linear.h9
-rw-r--r--src/gallium/drivers/cell/ppu/cell_draw_arrays.c6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_gen_fragment.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_shader.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c81
-rw-r--r--src/gallium/drivers/cell/spu/Makefile5
-rw-r--r--src/gallium/drivers/cell/spu/spu_per_fragment_op.c2
-rw-r--r--src/gallium/drivers/cell/spu/spu_tri.c179
-rw-r--r--src/gallium/drivers/i915simple/i915_fpc_translate.c2
-rw-r--r--src/gallium/drivers/i965simple/brw_vs_emit.c2
-rw-r--r--src/gallium/drivers/nouveau/nouveau_bo.h53
-rw-r--r--src/gallium/drivers/nouveau/nouveau_channel.h40
-rw-r--r--src/gallium/drivers/nouveau/nouveau_class.h8006
-rw-r--r--src/gallium/drivers/nouveau/nouveau_device.h30
-rw-r--r--src/gallium/drivers/nouveau/nouveau_grobj.h35
-rw-r--r--src/gallium/drivers/nouveau/nouveau_notifier.h43
-rw-r--r--src/gallium/drivers/nouveau/nouveau_pushbuf.h32
-rw-r--r--src/gallium/drivers/nouveau/nouveau_resource.h37
-rw-r--r--src/gallium/drivers/nouveau/nouveau_stateobj.h5
-rw-r--r--src/gallium/drivers/nouveau/nouveau_winsys.h4
-rw-r--r--src/gallium/drivers/nv04/Makefile1
-rw-r--r--src/gallium/drivers/nv04/nv04_miptree.c26
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.c13
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.h2
-rw-r--r--src/gallium/drivers/nv04/nv04_surface.c18
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.c448
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.h29
-rw-r--r--src/gallium/drivers/nv10/nv10_miptree.c26
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.c12
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.h2
-rw-r--r--src/gallium/drivers/nv10/nv10_surface.c18
-rw-r--r--src/gallium/drivers/nv20/nv20_miptree.c57
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.c12
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.h2
-rw-r--r--src/gallium/drivers/nv20/nv20_surface.c18
-rw-r--r--src/gallium/drivers/nv20/nv20_vertprog.c2
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c68
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.c27
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.h2
-rw-r--r--src/gallium/drivers/nv30/nv30_surface.c21
-rw-r--r--src/gallium/drivers/nv30/nv30_vertprog.c2
-rw-r--r--src/gallium/drivers/nv40/nv40_miptree.c65
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.c29
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.h2
-rw-r--r--src/gallium/drivers/nv40/nv40_surface.c21
-rw-r--r--src/gallium/drivers/nv40/nv40_vertprog.c2
-rw-r--r--src/gallium/drivers/nv50/nv50_clear.c28
-rw-r--r--src/gallium/drivers/nv50/nv50_context.c2
-rw-r--r--src/gallium/drivers/nv50/nv50_context.h9
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c34
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c23
-rw-r--r--src/gallium/drivers/nv50/nv50_query.c25
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c24
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.h1
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c12
-rw-r--r--src/gallium/drivers/nv50/nv50_surface.c152
-rw-r--r--src/gallium/drivers/nv50/nv50_tex.c6
-rw-r--r--src/gallium/drivers/nv50/nv50_vbo.c81
-rw-r--r--src/gallium/drivers/r300/Makefile22
-rw-r--r--src/gallium/drivers/r300/SConscript17
-rw-r--r--src/gallium/drivers/r300/r300_chipset.c348
-rw-r--r--src/gallium/drivers/r300/r300_chipset.h79
-rw-r--r--src/gallium/drivers/r300/r300_clear.c33
-rw-r--r--src/gallium/drivers/r300/r300_clear.h27
-rw-r--r--src/gallium/drivers/r300/r300_context.c142
-rw-r--r--src/gallium/drivers/r300/r300_context.h252
-rw-r--r--src/gallium/drivers/r300/r300_cs.h123
-rw-r--r--src/gallium/drivers/r300/r300_cs_inlines.h50
-rw-r--r--src/gallium/drivers/r300/r300_emit.c266
-rw-r--r--src/gallium/drivers/r300/r300_emit.h59
-rw-r--r--src/gallium/drivers/r300/r300_flush.c42
-rw-r--r--src/gallium/drivers/r300/r300_flush.h33
-rw-r--r--src/gallium/drivers/r300/r300_reg.h3250
-rw-r--r--src/gallium/drivers/r300/r300_screen.c282
-rw-r--r--src/gallium/drivers/r300/r300_screen.h52
-rw-r--r--src/gallium/drivers/r300/r300_state.c852
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c134
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.h33
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.c53
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.h83
-rw-r--r--src/gallium/drivers/r300/r300_surface.c327
-rw-r--r--src/gallium/drivers/r300/r300_surface.h59
-rw-r--r--src/gallium/drivers/r300/r300_swtcl_emit.c164
-rw-r--r--src/gallium/drivers/r300/r300_texture.c193
-rw-r--r--src/gallium/drivers/r300/r300_texture.h34
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h94
-rw-r--r--src/gallium/drivers/softpipe/Makefile2
-rw-r--r--src/gallium/drivers/softpipe/SConscript2
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h31
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c10
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_exec.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_sse.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_headers.h95
-rw-r--r--src/gallium/drivers/softpipe/sp_quad.h81
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_alpha_test.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_bufloop.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_colormask.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_coverage.c9
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_earlyz.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_occlusion.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_output.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_pipe.c (renamed from src/gallium/drivers/softpipe/sp_quad.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_pipe.h74
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stencil.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stipple.c27
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c38
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c2
-rw-r--r--src/gallium/include/pipe/p_context.h1
-rw-r--r--src/gallium/include/pipe/p_screen.h6
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h10
-rw-r--r--src/gallium/include/pipe/p_state.h1
-rw-r--r--src/gallium/state_trackers/Makefile2
-rw-r--r--src/gallium/state_trackers/egl/Makefile3
-rw-r--r--src/gallium/state_trackers/egl/egl_surface.c4
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.c2
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.h2
-rw-r--r--src/gallium/state_trackers/g3dvl/Makefile2
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_basic_csc.c10
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_context.c2
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c10
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_surface.c10
-rw-r--r--src/gallium/state_trackers/glx/xlib/SConscript3
-rw-r--r--src/gallium/state_trackers/wgl/icd/stw_icd.c243
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_pixelformat.c8
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_quirks.c5
-rw-r--r--src/gallium/winsys/drm/Makefile16
-rw-r--r--src/gallium/winsys/drm/Makefile.template14
-rw-r--r--src/gallium/winsys/drm/intel/Makefile4
-rw-r--r--src/gallium/winsys/drm/intel/common/Makefile23
-rw-r--r--src/gallium/winsys/drm/intel/common/Makefile.template64
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c429
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h69
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_context.c107
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_context.h40
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_device.c296
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_device.h72
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c949
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h138
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h102
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c268
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c377
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h115
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c161
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c968
-rw-r--r--src/gallium/winsys/drm/intel/dri/Makefile33
-rw-r--r--src/gallium/winsys/drm/intel/dri/SConscript41
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h24
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_context.c337
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_context.h164
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_lock.c102
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_screen.c703
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_screen.h122
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c260
-rw-r--r--src/gallium/winsys/drm/intel/dri/server/i830_common.h255
-rw-r--r--src/gallium/winsys/drm/intel/dri/server/i830_dri.h62
-rw-r--r--src/gallium/winsys/drm/intel/egl/Makefile13
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_api.c10
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_api.h14
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_context.c83
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_device.c48
-rw-r--r--src/gallium/winsys/drm/intel/gem/Makefile3
-rw-r--r--src/gallium/winsys/drm/intel/gem/Makefile.template6
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_api.c12
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_api.h14
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.c44
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.h17
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.c42
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.h11
-rw-r--r--src/gallium/winsys/drm/nouveau/common/Makefile18
-rw-r--r--src/gallium/winsys/drm/nouveau/common/Makefile.template6
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_bo.c504
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_channel.c126
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_context.c120
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_context.h47
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_device.c159
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_dma.c219
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_dma.h143
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h313
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_fence.c217
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c107
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_local.h96
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c137
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c270
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_resource.c116
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c54
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c64
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h9
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nv04_surface.c466
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nv50_surface.c194
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/Makefile3
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h2
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c2
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c5
-rw-r--r--src/gallium/winsys/drm/radeon/Makefile32
-rw-r--r--src/gallium/winsys/drm/radeon/SConscript29
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_buffer.c239
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_buffer.h54
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_context.c272
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_context.h70
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_r300.c96
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_r300.h34
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_screen.c288
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_screen.h41
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c (renamed from src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c)81
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h37
-rw-r--r--src/gallium/winsys/egl_xlib/Makefile2
-rw-r--r--src/gallium/winsys/g3dvl/nouveau/Makefile4
-rw-r--r--src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c2
-rw-r--r--src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c5
-rw-r--r--src/gallium/winsys/xlib/Makefile10
-rw-r--r--src/gallium/winsys/xlib/xlib_brw_screen.c2
-rw-r--r--src/glew/Makefile3
-rw-r--r--src/glut/glx/SConscript1
-rw-r--r--src/glut/glx/glut.def6
-rw-r--r--src/glut/glx/glutint.h38
-rw-r--r--src/glut/glx/win32_glx.c2
-rw-r--r--src/glx/x11/dri2.c2
-rw-r--r--src/glx/x11/dri2_glx.c125
-rw-r--r--src/glx/x11/dri_glx.c2
-rw-r--r--src/glx/x11/glxclient.h3
-rw-r--r--src/glx/x11/glxcmds.c24
-rw-r--r--src/glx/x11/glxextensions.c2
-rw-r--r--src/mesa/Makefile7
-rw-r--r--src/mesa/drivers/allegro/amesa.c2
-rw-r--r--src/mesa/drivers/dri/Makefile2
-rw-r--r--src/mesa/drivers/dri/common/extension_helper.h190
-rw-r--r--src/mesa/drivers/dri/common/utils.c15
-rw-r--r--src/mesa/drivers/dri/common/utils.h3
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_xmesa.c10
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_context.c2
-rw-r--r--src/mesa/drivers/dri/i810/i810context.c8
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c6
-rw-r--r--src/mesa/drivers/dri/i915/Makefile8
-rw-r--r--src/mesa/drivers/dri/i915/i830_context.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.c13
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c62
l---------src/mesa/drivers/dri/i915/intel_clear.c1
l---------src/mesa/drivers/dri/i915/intel_depthstencil.c1
l---------src/mesa/drivers/dri/i915/intel_extensions.c1
l---------[-rw-r--r--]src/mesa/drivers/dri/i915/intel_state.c298
l---------src/mesa/drivers/dri/i915/intel_swapbuffers.c1
-rw-r--r--src/mesa/drivers/dri/i965/Makefile5
-rw-r--r--src/mesa/drivers/dri/i965/brw_cc.c67
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.c40
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c36
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h51
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c15
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c28
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c24
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c123
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h18
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c53
-rw-r--r--src/mesa/drivers/dri/i965/brw_fallback.c14
-rw-r--r--src/mesa/drivers/dri/i965/brw_metaops.c583
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c26
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c14
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_state.c87
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c10
-rw-r--r--src/mesa/drivers/dri/i965/brw_structs.h4
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c14
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_constval.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c88
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c73
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c153
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.h5
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_fp.c82
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c153
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_pass0.c50
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_pass1.c25
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_pass2.c28
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_state.c13
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c11
l---------src/mesa/drivers/dri/i965/intel_clear.c1
l---------src/mesa/drivers/dri/i965/intel_depthstencil.c1
l---------src/mesa/drivers/dri/i965/intel_extensions.c1
l---------[-rw-r--r--]src/mesa/drivers/dri/i965/intel_state.c226
l---------src/mesa/drivers/dri/i965/intel_swapbuffers.c1
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.c474
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.h7
-rw-r--r--src/mesa/drivers/dri/intel/intel_clear.c376
-rw-r--r--src/mesa/drivers/dri/intel/intel_clear.h (renamed from src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h)27
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c179
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h2
-rw-r--r--src/mesa/drivers/dri/intel/intel_decode.c47
-rw-r--r--src/mesa/drivers/dri/intel/intel_depthstencil.c261
-rw-r--r--src/mesa/drivers/dri/intel/intel_depthstencil.h15
-rw-r--r--src/mesa/drivers/dri/intel/intel_extensions.c185
-rw-r--r--src/mesa/drivers/dri/intel/intel_extensions.h (renamed from src/gallium/winsys/drm/intel/dri/intel_reg.h)35
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c179
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.h86
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel.h2
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_bitmap.c1
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c20
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c119
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.h9
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c17
-rw-r--r--src/mesa/drivers/dri/intel/intel_state.c233
-rw-r--r--src/mesa/drivers/dri/intel/intel_swapbuffers.c248
-rw-r--r--src/mesa/drivers/dri/intel/intel_swapbuffers.h (renamed from src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h)31
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_format.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c6
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.c7
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c6
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.c6
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c16
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.c8
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.c41
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c10
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c31
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c13
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h84
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c16
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c41
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c19
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c8
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_maos_arrays.c1
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c12
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_context.c2
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c17
-rw-r--r--src/mesa/drivers/dri/sis/sis_alloc.c8
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c8
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.c6
-rw-r--r--src/mesa/drivers/dri/sis/sis_tris.c2
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c84
-rw-r--r--src/mesa/drivers/dri/swrast/swrast_priv.h10
-rw-r--r--src/mesa/drivers/dri/swrast/swrast_span.c72
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c12
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_dd.c8
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c19
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.c2
-rw-r--r--src/mesa/drivers/dri/trident/trident_vb.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c6
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c4
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c2
-rw-r--r--src/mesa/drivers/glide/fxapi.c4
-rw-r--r--src/mesa/drivers/glide/fxdd.c7
-rw-r--r--src/mesa/drivers/glslcompiler/glslcompiler.c2
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dglcontext.c1
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c1
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c1
-rw-r--r--src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c1
-rw-r--r--src/mesa/drivers/x11/fakeglx.c45
-rw-r--r--src/mesa/drivers/x11/xm_api.c4
-rw-r--r--src/mesa/glapi/ARB_framebuffer_object.xml269
-rw-r--r--src/mesa/glapi/Makefile1
-rw-r--r--src/mesa/glapi/dispatch.h427
-rw-r--r--src/mesa/glapi/gl_API.xml3
-rw-r--r--src/mesa/glapi/glapioffsets.h422
-rw-r--r--src/mesa/glapi/glapitable.h419
-rw-r--r--src/mesa/glapi/glapitemp.h280
-rw-r--r--src/mesa/glapi/glprocs.h1048
-rw-r--r--src/mesa/main/api_exec.c7
-rw-r--r--src/mesa/main/arrayobj.c108
-rw-r--r--src/mesa/main/attrib.c37
-rw-r--r--src/mesa/main/buffers.c20
-rw-r--r--src/mesa/main/clip.c1
-rw-r--r--src/mesa/main/config.h8
-rw-r--r--src/mesa/main/context.c39
-rw-r--r--src/mesa/main/dd.h6
-rw-r--r--src/mesa/main/debug.c103
-rw-r--r--src/mesa/main/debug.h3
-rw-r--r--src/mesa/main/depthstencil.c8
-rw-r--r--src/mesa/main/dlist.c72
-rw-r--r--src/mesa/main/dlist.h2
-rw-r--r--src/mesa/main/enable.c18
-rw-r--r--src/mesa/main/enums.c5704
-rw-r--r--src/mesa/main/extensions.c54
-rw-r--r--src/mesa/main/fbobject.c511
-rw-r--r--src/mesa/main/fbobject.h5
-rw-r--r--src/mesa/main/framebuffer.c84
-rw-r--r--src/mesa/main/get.c96
-rw-r--r--src/mesa/main/get_gen.py60
-rw-r--r--src/mesa/main/getstring.c11
-rw-r--r--src/mesa/main/hint.c4
-rw-r--r--src/mesa/main/imports.c13
-rw-r--r--src/mesa/main/imports.h3
-rw-r--r--src/mesa/main/matrix.c1
-rw-r--r--src/mesa/main/mfeatures.h1
-rw-r--r--src/mesa/main/mtypes.h132
-rw-r--r--src/mesa/main/multisample.c5
-rw-r--r--src/mesa/main/pixel.c2
-rw-r--r--src/mesa/main/renderbuffer.c7
-rw-r--r--src/mesa/main/state.c66
-rw-r--r--src/mesa/main/stencil.c104
-rw-r--r--src/mesa/main/texcompress.c102
-rw-r--r--src/mesa/main/texenv.c1142
-rw-r--r--src/mesa/main/texenvprogram.c174
-rw-r--r--src/mesa/main/texenvprogram.h2
-rw-r--r--src/mesa/main/texformat.c52
-rw-r--r--src/mesa/main/texformat_tmp.h34
-rw-r--r--src/mesa/main/texgen.c2
-rw-r--r--src/mesa/main/teximage.c229
-rw-r--r--src/mesa/main/texobj.c27
-rw-r--r--src/mesa/main/texparam.c1097
-rw-r--r--src/mesa/main/texrender.c54
-rw-r--r--src/mesa/main/texstate.c205
-rw-r--r--src/mesa/main/texstore.c63
-rw-r--r--src/mesa/main/varray.c86
-rw-r--r--src/mesa/main/version.h8
-rw-r--r--src/mesa/math/m_matrix.c21
-rw-r--r--src/mesa/math/m_matrix.h3
-rw-r--r--src/mesa/math/m_xform.c102
-rw-r--r--src/mesa/math/m_xform.h19
-rw-r--r--src/mesa/math/mathmod.h41
-rw-r--r--src/mesa/shader/arbprogparse.c3
-rw-r--r--src/mesa/shader/arbprogram.c4
-rw-r--r--src/mesa/shader/nvprogram.c4
-rw-r--r--src/mesa/shader/prog_instruction.h2
-rw-r--r--src/mesa/shader/prog_print.c453
-rw-r--r--src/mesa/shader/prog_print.h9
-rw-r--r--src/mesa/shader/prog_statevars.c10
-rw-r--r--src/mesa/shader/shader_api.c274
-rw-r--r--src/mesa/shader/slang/slang_codegen.c2
-rw-r--r--src/mesa/shader/slang/slang_compile.c8
-rw-r--r--src/mesa/shader/slang/slang_emit.c4
-rw-r--r--src/mesa/shader/slang/slang_emit.h4
-rw-r--r--src/mesa/shader/slang/slang_link.c32
-rw-r--r--src/mesa/shader/slang/slang_log.c4
-rw-r--r--src/mesa/shader/slang/slang_preprocess.c3
-rw-r--r--src/mesa/shader/slang/slang_vartable.c59
-rw-r--r--src/mesa/sources303
-rw-r--r--src/mesa/sources.mak35
-rw-r--r--src/mesa/sparc/glapi_sparc.S53
-rw-r--r--src/mesa/state_tracker/st_atom.c4
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c6
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c34
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c4
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c4
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c4
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c10
-rw-r--r--src/mesa/state_tracker/st_cb_feedback.c4
-rw-r--r--src/mesa/state_tracker/st_cb_program.c12
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.c4
-rw-r--r--src/mesa/state_tracker/st_cb_rasterpos.c4
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
-rw-r--r--src/mesa/state_tracker/st_context.c6
-rw-r--r--src/mesa/state_tracker/st_context.h4
-rw-r--r--src/mesa/state_tracker/st_draw.c6
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c2
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c2
-rw-r--r--src/mesa/state_tracker/st_program.c6
-rw-r--r--src/mesa/swrast/s_accum.c8
-rw-r--r--src/mesa/swrast/s_bitmap.c9
-rw-r--r--src/mesa/swrast/s_blit.c5
-rw-r--r--src/mesa/swrast/s_buffers.c6
-rw-r--r--src/mesa/swrast/s_context.h52
-rw-r--r--src/mesa/swrast/s_copypix.c4
-rw-r--r--src/mesa/swrast/s_drawpix.c12
-rw-r--r--src/mesa/swrast/s_fog.c4
-rw-r--r--src/mesa/swrast/s_fragprog.c75
-rw-r--r--src/mesa/swrast/s_imaging.c20
-rw-r--r--src/mesa/swrast/s_readpix.c12
-rw-r--r--src/mesa/swrast/s_span.c4
-rw-r--r--src/mesa/swrast/s_stencil.c6
-rw-r--r--src/mesa/swrast/s_texcombine.c172
-rw-r--r--src/mesa/swrast/s_texfilter.c99
-rw-r--r--src/mesa/swrast/s_texstore.c15
-rw-r--r--src/mesa/swrast/s_triangle.c11
-rw-r--r--src/mesa/tnl/t_context.c19
-rw-r--r--src/mesa/tnl/t_draw.c31
-rw-r--r--src/mesa/tnl/t_rasterpos.c8
-rw-r--r--src/mesa/tnl/t_vertex.c45
-rw-r--r--src/mesa/vbo/vbo_context.c6
-rw-r--r--src/mesa/vbo/vbo_exec_api.c1
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c14
-rw-r--r--src/mesa/vbo/vbo_save.h2
-rw-r--r--src/mesa/vbo/vbo_save_api.c6
-rw-r--r--src/mesa/vbo/vbo_save_draw.c19
-rw-r--r--src/mesa/vbo/vbo_split_copy.c1
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S1996
-rw-r--r--src/mesa/x86/glapi_x86.S127
554 files changed, 29935 insertions, 30435 deletions
diff --git a/Makefile b/Makefile
index 875f93bd4a..c79fb1cb28 100644
--- a/Makefile
+++ b/Makefile
@@ -45,10 +45,6 @@ install:
done
-# DirectFBGL module installation
-linux-directfb-install:
- cd src/mesa/drivers/directfb && $(MAKE) install
-
.PHONY: default doxygen clean realclean install linux-directfb-install
# If there's no current configuration file
@@ -182,10 +178,11 @@ ultrix-gcc:
# Rules for making release tarballs
-DIRECTORY = Mesa-7.4
-LIB_NAME = MesaLib-7.4
-DEMO_NAME = MesaDemos-7.4
-GLUT_NAME = MesaGLUT-7.4
+VERSION=7.5-devel
+DIRECTORY = Mesa-$(VERSION)
+LIB_NAME = MesaLib-$(VERSION)
+DEMO_NAME = MesaDemos-$(VERSION)
+GLUT_NAME = MesaGLUT-$(VERSION)
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
diff --git a/SConstruct b/SConstruct
index 88cdffa504..a22b9483da 100644
--- a/SConstruct
+++ b/SConstruct
@@ -46,9 +46,9 @@ common.AddOptions(opts)
opts.Add(ListOption('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python']))
opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers,
- ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace']))
+ ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300']))
opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys,
- ['xlib', 'intel', 'gdi']))
+ ['xlib', 'intel', 'gdi', 'amd']))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
diff --git a/autogen.sh b/autogen.sh
index 19e5b55fcf..c76bf8b07b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -11,6 +11,8 @@ if test "x$SRCDIR" != "x$ORIGDIR"; then
exit 1
fi
+MAKEFLAGS=""
+
autoreconf -v --install || exit 1
"$srcdir"/configure "$@"
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 4a89716ab6..b352974a4c 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -22,8 +22,8 @@ LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
# Assembler
-ASM_SOURCES = @ASM_SOURCES@
-ASM_API = @ASM_API@
+MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
+GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
@@ -50,16 +50,32 @@ GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
+# Globs used to install the lib and all symlinks
+GL_LIB_GLOB = @GL_LIB_GLOB@
+GLU_LIB_GLOB = @GLU_LIB_GLOB@
+GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
+GLW_LIB_GLOB = @GLW_LIB_GLOB@
+OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
+
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
+GALLIUM_DIRS = @GALLIUM_DIRS@
+GALLIUM_AUXILIARY_DIRS = @GALLIUM_AUXILIARY_DIRS@
+GALLIUM_DRIVER_DIRS = @GALLIUM_DRIVER_DIRS@
+GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
+GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@
+GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
+GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
+GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
+
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = @PROGRAM_DIRS@
# Driver specific build vars
-DRI_DIRS = @DRI_DIRS@
+DRI_DIRS = @DRI_DIRS@
WINDOW_SYSTEM = @WINDOW_SYSTEM@
USING_EGL = @USING_EGL@
diff --git a/configs/default b/configs/default
index 40f3a2a02d..a90d46f18e 100644
--- a/configs/default
+++ b/configs/default
@@ -81,7 +81,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
LIB_DIR = lib
SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw
GLU_DIRS = sgi
-DRIVER_DIRS =
+DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl xdemos
@@ -89,11 +89,14 @@ PROGRAM_DIRS = demos redbook samples glsl xdemos
EGL_DRIVERS_DIRS = demo
# Gallium directories and
-GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util
+GALLIUM_DIRS = auxiliary drivers state_trackers
+GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
-GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv04 nv10 nv20 nv30 nv40 nv50 failover trace
+GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple failover trace
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = xlib egl_xlib
+GALLIUM_WINSYS_DRM_DIRS =
+GALLIUM_STATE_TRACKERS_DIRS = glx
# Library dependencies
diff --git a/configs/linux-cell b/configs/linux-cell
index df08d262bd..d58a7a6ec7 100644
--- a/configs/linux-cell
+++ b/configs/linux-cell
@@ -28,13 +28,16 @@ SDK = /opt/cell/sdk/usr
CFLAGS = $(OPT_FLAGS) -Wall -Winline -Wmissing-prototypes \
-fPIC -m32 -std=c99 -mabi=altivec -maltivec \
-I. -I$(SDK)/include \
- -DGALLIUM_CELL -DUSE_XSHM -D_BSD_SOURCE
+ -DGALLIUM_CELL -DUSE_XSHM -D_BSD_SOURCE -D_SVID_SOURCE
CXXFLAGS = $(CFLAGS)
# Omitting glw here:
SRC_DIRS = gallium mesa gallium/winsys glu glut/glx glew
+# Build no traditional Mesa drivers:
+DRIVER_DIRS =
+
MKDEP_OPTIONS = -fdepend -Y
diff --git a/configs/linux-dri b/configs/linux-dri
index c667a386f3..c5e30d3060 100644
--- a/configs/linux-dri
+++ b/configs/linux-dri
@@ -57,16 +57,11 @@ PROGRAM_DIRS := egl $(PROGRAM_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = demo glx
-DRIVER_DIRS =
+DRIVER_DIRS = dri
WINDOW_SYSTEM = dri
-GALLIUM_WINSYS_DIRS = drm
+GALLIUM_WINSYS_DIRS = drm
+GALLIUM_WINSYS_DRM_DIRS = intel
+GALLIUM_STATE_TRACKERS_DIRS = egl
-# gamma are missing because they have not been converted to use the new
-# interface.
-
-# XXX: need to figure out a way for gallium and non-gallium builds to
-# coexist:
-#
-
-#DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
-# savage sis tdfx trident unichrome ffb
+DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
+ savage sis tdfx trident unichrome ffb
diff --git a/configure.ac b/configure.ac
index 33c107266a..2d48ccf63a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,10 +46,14 @@ esac
MKDEP_OPTIONS=-fdepend
dnl Ask gcc where it's keeping its secret headers
if test "x$GCC" = xyes; then
- GCC_INCLUDES=`$CC -print-file-name=include`
- if test "x$GCC_INCLUDES" != x; then
- MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
- fi
+ for dir in include include-fixed; do
+ GCC_INCLUDES=`$CC -print-file-name=$dir`
+ if test "x$GCC_INCLUDES" != x && \
+ test "$GCC_INCLUDES" != "$dir" && \
+ test -d "$GCC_INCLUDES"; then
+ MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
+ fi
+ done
fi
AC_SUBST([MKDEP_OPTIONS])
@@ -221,24 +225,40 @@ dnl
dnl library names
dnl
if test "$enable_static" = yes; then
- GL_LIB_NAME='lib$(GL_LIB).a'
- GLU_LIB_NAME='lib$(GLU_LIB).a'
- GLUT_LIB_NAME='lib$(GLUT_LIB).a'
- GLW_LIB_NAME='lib$(GLW_LIB).a'
- OSMESA_LIB_NAME='lib$(OSMESA_LIB).a'
+ LIB_EXTENSION='a'
else
- GL_LIB_NAME='lib$(GL_LIB).so'
- GLU_LIB_NAME='lib$(GLU_LIB).so'
- GLUT_LIB_NAME='lib$(GLUT_LIB).so'
- GLW_LIB_NAME='lib$(GLW_LIB).so'
- OSMESA_LIB_NAME='lib$(OSMESA_LIB).so'
+ case "$host_os" in
+ darwin* )
+ LIB_EXTENSION='dylib' ;;
+ * )
+ LIB_EXTENSION='so' ;;
+ esac
fi
+
+GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
+GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
+GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
+GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
+OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
+
+GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
+GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
+GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
+GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
+OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
+
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
AC_SUBST([GLUT_LIB_NAME])
AC_SUBST([GLW_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
+AC_SUBST([GL_LIB_GLOB])
+AC_SUBST([GLU_LIB_GLOB])
+AC_SUBST([GLUT_LIB_GLOB])
+AC_SUBST([GLW_LIB_GLOB])
+AC_SUBST([OSMESA_LIB_GLOB])
+
dnl
dnl Arch/platform-specific settings
dnl
@@ -250,8 +270,8 @@ AC_ARG_ENABLE([asm],
)
asm_arch=""
ASM_FLAGS=""
-ASM_SOURCES=""
-ASM_API=""
+MESA_ASM_SOURCES=""
+GLAPI_ASM_SOURCES=""
AC_MSG_CHECKING([whether to enable assembly])
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
@@ -292,19 +312,19 @@ if test "x$enable_asm" = xyes; then
case "$asm_arch" in
x86)
ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
- ASM_SOURCES='$(X86_SOURCES)'
- ASM_API='$(X86_API)'
+ MESA_ASM_SOURCES='$(X86_SOURCES)'
+ GLAPI_ASM_SOURCES='$(X86_API)'
AC_MSG_RESULT([yes, x86])
;;
x86_64)
ASM_FLAGS="-DUSE_X86_64_ASM"
- ASM_SOURCES='$(X86-64_SOURCES)'
- ASM_API='$(X86-64_API)'
+ MESA_ASM_SOURCES='$(X86-64_SOURCES)'
+ GLAPI_ASM_SOURCES='$(X86-64_API)'
AC_MSG_RESULT([yes, x86_64])
;;
ppc)
ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
- ASM_SOURCES='$(PPC_SOURCES)'
+ MESA_ASM_SOURCES='$(PPC_SOURCES)'
AC_MSG_RESULT([yes, ppc])
;;
*)
@@ -313,8 +333,8 @@ if test "x$enable_asm" = xyes; then
esac
fi
AC_SUBST([ASM_FLAGS])
-AC_SUBST([ASM_SOURCES])
-AC_SUBST([ASM_API])
+AC_SUBST([MESA_ASM_SOURCES])
+AC_SUBST([GLAPI_ASM_SOURCES])
dnl PIC code macro
MESA_PIC_FLAGS
@@ -389,9 +409,16 @@ esac
dnl
dnl Driver specific build directories
dnl
-SRC_DIRS="mesa"
+SRC_DIRS="mesa egl glew"
GLU_DIRS="sgi"
WINDOW_SYSTEM=""
+GALLIUM_DIRS="auxiliary drivers state_trackers"
+GALLIUM_WINSYS_DIRS=""
+GALLIUM_WINSYS_DRM_DIRS=""
+GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
+GALLIUM_DRIVER_DIRS="softpipe failover trace"
+GALLIUM_STATE_TRACKERS_DIRS=""
+
case "$mesa_driver" in
xlib)
DRIVER_DIRS="x11"
@@ -400,6 +427,7 @@ dri)
SRC_DIRS="glx/x11 $SRC_DIRS"
DRIVER_DIRS="dri"
WINDOW_SYSTEM="dri"
+ GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
;;
osmesa)
DRIVER_DIRS="osmesa"
@@ -409,6 +437,12 @@ AC_SUBST([SRC_DIRS])
AC_SUBST([GLU_DIRS])
AC_SUBST([DRIVER_DIRS])
AC_SUBST([WINDOW_SYSTEM])
+AC_SUBST([GALLIUM_DIRS])
+AC_SUBST([GALLIUM_WINSYS_DIRS])
+AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
+AC_SUBST([GALLIUM_DRIVER_DIRS])
+AC_SUBST([GALLIUM_AUXILIARY_DIRS])
+AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
dnl
dnl User supplied program configuration
@@ -656,10 +690,10 @@ if test "$mesa_driver" = dri; then
case "$host_os" in
linux*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
- DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
if test "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
+ DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
case "$host_cpu" in
x86_64)
@@ -1029,6 +1063,90 @@ fi
AC_SUBST([APP_LIB_DEPS])
AC_SUBST([PROGRAM_DIRS])
+dnl
+dnl Gallium configuration
+dnl
+AC_ARG_ENABLE([gallium],
+ [AS_HELP_STRING([--disable-gallium],
+ [build gallium @<:@default=enabled@:>@])],
+ [enable_gallium="$enableval"],
+ [enable_gallium=yes])
+if test "x$enable_gallium" = xyes; then
+ SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
+fi
+
+dnl
+dnl Gallium state trackers configuration
+dnl
+AC_ARG_WITH([state-trackers],
+ [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
+ [comma delimited state_trackers list, e.g.
+ "egl,glx" @<:@default=auto@:>@])],
+ [with_state_trackers="$withval"],
+ [with_state_trackers=yes])
+
+case "$with_state_trackers" in
+no)
+ GALLIUM_STATE_TRACKERS_DIRS=""
+ ;;
+yes)
+ # look at what else is built
+ case "$mesa_driver" in
+ dri)
+ GALLIUM_STATE_TRACKERS_DIRS=egl
+ ;;
+ esac
+ ;;
+*)
+ # verify the requested state tracker exist
+ state_trackers=`IFS=', '; echo $with_state_trackers`
+ for tracker in $state_trackers; do
+ test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
+ AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
+ done
+ GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
+ ;;
+esac
+
+dnl
+dnl Gallium Intel configuration
+dnl
+AC_ARG_ENABLE([gallium-intel],
+ [AS_HELP_STRING([--disable-gallium-intel],
+ [build gallium intel @<:@default=enabled@:>@])],
+ [enable_gallium_intel="$enableval"],
+ [enable_gallium_intel=yes])
+if test "x$enable_gallium_intel" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
+ GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS i915simple i965simple"
+fi
+
+dnl
+dnl Gallium Radeon configuration
+dnl
+AC_ARG_ENABLE([gallium-radeon],
+ [AS_HELP_STRING([--enable-gallium-radeon],
+ [build gallium radeon @<:@default=disabled@:>@])],
+ [enable_gallium_radeon="$enableval"],
+ [enable_gallium_radeon=no])
+if test "x$enable_gallium_radeon" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
+ GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS r300"
+fi
+
+dnl
+dnl Gallium Radeon configuration
+dnl
+AC_ARG_ENABLE([gallium-nouveau],
+ [AS_HELP_STRING([--enable-gallium-nouveau],
+ [build gallium nouveau @<:@default=disabled@:>@])],
+ [enable_gallium_nouveau="$enableval"],
+ [enable_gallium_nouveau=no])
+if test "x$enable_gallium_nouveau" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
+ GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS nv04 nv10 nv20 nv30 nv40 nv50"
+fi
+
dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS"
@@ -1076,6 +1194,19 @@ fi
fi
echo " Use XCB: $enable_xcb"
+echo ""
+if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
+ echo " Gallium: yes"
+ echo " Gallium dirs: $GALLIUM_DIRS"
+ echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
+ echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
+ echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
+ echo " Driver dirs: $GALLIUM_DRIVER_DIRS"
+ echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
+else
+ echo " Gallium: no"
+fi
+
dnl Libraries
echo ""
echo " Shared libs: $enable_shared"
diff --git a/docs/README.directfb b/docs/README.directfb
index e3bada4888..d66ca8d3ca 100644
--- a/docs/README.directfb
+++ b/docs/README.directfb
@@ -22,7 +22,8 @@ Installation
to install OpenGL libraries and
- make linux-directfb-install
+ cd src/mesa/drivers/directfb ; make install
to install DirectFBGL module in the proper location.
+ Actually, that last command may not be needed. Please provide feedback.
diff --git a/docs/cell.html b/docs/cell.html
index 7fbbba7c7e..49b62cac7b 100644
--- a/docs/cell.html
+++ b/docs/cell.html
@@ -30,13 +30,9 @@ The second phase is now underway.
<H2>Source Code</H2>
<p>
-The latest Cell driver source code is on the <code>gallium-0.2</code> branch
-of the Mesa git repository.
-After you've cloned the repository, check out the branch with:
+The latest Cell driver source code is on the master branch of the Mesa
+git repository.
</p>
-<pre>
- git-checkout -b gallium-0.2 origin/gallium-0.2
-</pre>
<p>
To build the driver you'll need the IBM Cell SDK (version 2.1 or 3.0).
To use the driver you'll need a Cell system, such as a PS3 running Linux,
@@ -50,17 +46,19 @@ special changes.
<p>
To compile the code, run <code>make linux-cell</code>.
-To build in debug mode, run <code>make linux-cell-debug</code>.
+Or to build in debug mode, run <code>make linux-cell-debug</code>.
</p>
<p>
-To use the library, make sure <code>LD_LIBRARY_PATH</code> points the Mesa/lib/
-directory that contains <code>libGL.so</code>.
-</p>
+To use the library, make sure your current directory is the top of the
+Mesa tree, then set <code>LD_LIBRARY_PATH</code> like this:
+<pre>
+ export LD_LIBRARY_PATH=$PWD/lib/gallium:$PWD/lib/
+</pre>
<p>
-Verify that the Cell driver is being used by running <code>glxinfo</code>
-and looking for:
+Verify that the Cell driver is being used by running
+<code>progs/xdemos/glxinfo</code> and looking for:
<pre>
OpenGL renderer string: Gallium 0.2, Cell on Xlib
</pre>
diff --git a/docs/relnotes-7.5.html b/docs/relnotes-7.5.html
new file mode 100644
index 0000000000..621bd4afac
--- /dev/null
+++ b/docs/relnotes-7.5.html
@@ -0,0 +1,56 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 7.5 Release Notes / date TBD</H1>
+
+<p>
+Mesa 7.5 is a new development release.
+</p>
+<p>
+Mesa 7.5 implements the OpenGL 2.1 API, but the version reported by
+glGetString(GL_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 2.1.
+</p>
+<p>
+See the <a href="install.html">Compiling/Installing page</a> for prerequisites
+for DRI ardware acceleration.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+tbd
+</pre>
+
+
+<h2>New features</h2>
+<ul>
+<li>GL_ARB_framebuffer_object extension (software drivers, i965 driver)
+<li>Reworked two-sided stencil support.
+This allows a driver to support all three variations of two-sided stencil
+including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
+<li>GL_EXT_vertex_array_bgra extension (software drivers, i965 driver)
+<li>GL_NV_texture_env_combine4 extension (software drivers, i965/i915 drivers)
+<li>GL_EXT_texture_swizzle extension (software drivers, i965 driver)
+</ul>
+
+
+<h2>Bug fixes</h2>
+<ul>
+</ul>
+
+<h2>Changes</h2>
+<ul>
+<li>Remove support for GL_SGIX_shadow, GL_SGIX_shadow_ambient and
+GL_SGIX_depth_texture extensions. Superseded by the ARB versions.
+</ul>
+
+</body>
+</html>
diff --git a/docs/relnotes.html b/docs/relnotes.html
index 61c6a20c29..c5ed109390 100644
--- a/docs/relnotes.html
+++ b/docs/relnotes.html
@@ -10,8 +10,8 @@
<p>
Mesa uses an even/odd version number scheme like the Linux kernel.
-Odd numbered versions (such as 6.5) designate new developmental releases.
-Even numbered versions (such as 6.4) designate stable releases.
+Odd numbered versions (such as 7.5) designate new developmental releases.
+Even numbered versions (such as 7.4) designate stable releases.
</p>
@@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
+<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
diff --git a/include/GL/glut.h b/include/GL/glut.h
index 022378fb9d..9fdb9cfdfa 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -74,23 +74,9 @@ extern "C" {
# define __cdecl
# define GLUT_DEFINED___CDECL
# endif
-# ifndef _CRTIMP
-# ifdef _NTSDK
- /* Definition compatible with NT SDK */
-# define _CRTIMP
-# else
- /* Current definition */
-# ifdef _DLL
-# define _CRTIMP __declspec(dllimport)
-# else
-# define _CRTIMP
-# endif
-# endif
-# define GLUT_DEFINED__CRTIMP
-# endif
-# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
-# endif
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+#include <stdlib.h>
+#endif
/* GLUT callback calling convention for Win32. */
# define GLUTCALLBACK __cdecl
@@ -122,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
-# define GLUTAPI __attribute__((visibility("default")))
+# define GLUTAPI extern __attribute__((visibility("default")))
#else
diff --git a/progs/SConscript b/progs/SConscript
index 631923a38f..6484c761fc 100644
--- a/progs/SConscript
+++ b/progs/SConscript
@@ -1,6 +1,8 @@
SConscript([
'util/SConscript',
'demos/SConscript',
+ 'redbook/SConscript',
+ 'samples/SConscript',
'trivial/SConscript',
'vp/SConscript',
])
diff --git a/progs/demos/Makefile b/progs/demos/Makefile
index e636cbd9ad..32c6072123 100644
--- a/progs/demos/Makefile
+++ b/progs/demos/Makefile
@@ -5,12 +5,6 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
-OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
-
-OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
-
-OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
-
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
diff --git a/progs/demos/engine.c b/progs/demos/engine.c
index 5b9b5baa7b..14fd1e6862 100644
--- a/progs/demos/engine.c
+++ b/progs/demos/engine.c
@@ -554,7 +554,7 @@ SquareWithHole(float squareSize, float holeRadius)
for (i = 0; i <= 360; i += 5) {
const float x1 = holeRadius * cos(DEG_TO_RAD(i));
const float y1 = holeRadius * sin(DEG_TO_RAD(i));
- float x2, y2;
+ float x2 = 0.0F, y2 = 0.0F;
if (i > 315 || i <= 45) {
x2 = squareSize;
y2 = squareSize * tan(DEG_TO_RAD(i));
diff --git a/progs/demos/streaming_rect.c b/progs/demos/streaming_rect.c
index 4d4656e722..294f9c3060 100644
--- a/progs/demos/streaming_rect.c
+++ b/progs/demos/streaming_rect.c
@@ -47,7 +47,10 @@ static void Idle( void )
}
/*static int max( int a, int b ) { return a > b ? a : b; }*/
+
+#ifndef min
static int min( int a, int b ) { return a < b ? a : b; }
+#endif
static void DrawObject()
{
diff --git a/progs/demos/texdown.c b/progs/demos/texdown.c
index 5fecd9a148..7e46045832 100644
--- a/progs/demos/texdown.c
+++ b/progs/demos/texdown.c
@@ -154,11 +154,6 @@ static unsigned long align(unsigned long value, unsigned long a)
return (value + a - 1) & ~(a-1);
}
-static int MIN2(int a, int b)
-{
- return a < b ? a : b;
-}
-
static void
MeasureDownloadRate(void)
{
diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c
index 096d40f64d..b4be463787 100644
--- a/progs/glsl/multitex.c
+++ b/progs/glsl/multitex.c
@@ -47,9 +47,12 @@ static const char *TexFiles[2] =
static GLuint Program;
-static GLfloat Xrot = -90.0, Yrot = .0, Zrot = 0.0;
+static GLfloat Xrot = 0.0, Yrot = .0, Zrot = 0.0;
static GLfloat EyeDist = 10;
static GLboolean Anim = GL_TRUE;
+static GLboolean UseArrays = GL_TRUE;
+
+static GLint VertCoord_attr = -1, TexCoord0_attr = -1, TexCoord1_attr = -1;
/* value[0] = tex unit */
@@ -60,32 +63,62 @@ static struct uniform_info Uniforms[] = {
};
+static const GLfloat Tex0Coords[4][2] = {
+ { 0.0, 0.0 }, { 2.0, 0.0 }, { 2.0, 2.0 }, { 0.0, 2.0 }
+};
+
+static const GLfloat Tex1Coords[4][2] = {
+ { 0.0, 0.0 }, { 1.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 1.0 }
+};
+
+static const GLfloat VertCoords[4][2] = {
+ { -3.0, -3.0 }, { 3.0, -3.0 }, { 3.0, 3.0 }, { -3.0, 3.0 }
+};
+
+
static void
-DrawPolygon(GLfloat size)
+DrawPolygonArray(void)
{
- glPushMatrix();
- glRotatef(90, 1, 0, 0);
- glNormal3f(0, 0, 1);
- glBegin(GL_POLYGON);
+ if (VertCoord_attr >= 0) {
+ glVertexAttribPointer_func(VertCoord_attr, 2, GL_FLOAT, GL_FALSE,
+ 0, VertCoords);
+ glEnableVertexAttribArray_func(VertCoord_attr);
+ }
+ else {
+ glVertexPointer(2, GL_FLOAT, 0, VertCoords);
+ glEnable(GL_VERTEX_ARRAY);
+ }
- glMultiTexCoord2f(GL_TEXTURE0, 0, 0);
- glMultiTexCoord2f(GL_TEXTURE1, 0, 0);
- glVertex2f(-size, -size);
+ glVertexAttribPointer_func(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE,
+ 0, Tex0Coords);
+ glEnableVertexAttribArray_func(TexCoord0_attr);
- glMultiTexCoord2f(GL_TEXTURE0, 2, 0);
- glMultiTexCoord2f(GL_TEXTURE1, 1, 0);
- glVertex2f( size, -size);
+ glVertexAttribPointer_func(TexCoord1_attr, 2, GL_FLOAT, GL_FALSE,
+ 0, Tex1Coords);
+ glEnableVertexAttribArray_func(TexCoord1_attr);
- glMultiTexCoord2f(GL_TEXTURE0, 2, 2);
- glMultiTexCoord2f(GL_TEXTURE1, 1, 1);
- glVertex2f( size, size);
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+}
- glMultiTexCoord2f(GL_TEXTURE0, 0, 2);
- glMultiTexCoord2f(GL_TEXTURE1, 0, 1);
- glVertex2f(-size, size);
+
+static void
+DrawPolygonVert(void)
+{
+ GLuint i;
+
+ glBegin(GL_TRIANGLE_FAN);
+
+ for (i = 0; i < 4; i++) {
+ glVertexAttrib2fv_func(TexCoord0_attr, Tex0Coords[i]);
+ glVertexAttrib2fv_func(TexCoord1_attr, Tex1Coords[i]);
+
+ if (VertCoord_attr >= 0)
+ glVertexAttrib2fv_func(VertCoord_attr, VertCoords[i]);
+ else
+ glVertex2fv(VertCoords[i]);
+ }
glEnd();
- glPopMatrix();
}
@@ -100,7 +133,10 @@ draw(void)
glRotatef(Yrot, 0, 1, 0);
glRotatef(Xrot, 1, 0, 0);
- DrawPolygon(3.0);
+ if (UseArrays)
+ DrawPolygonArray();
+ else
+ DrawPolygonVert();
glPopMatrix();
@@ -123,8 +159,11 @@ key(unsigned char k, int x, int y)
(void) x;
(void) y;
switch (k) {
- case ' ':
case 'a':
+ UseArrays = !UseArrays;
+ printf("Arrays: %d\n", UseArrays);
+ break;
+ case ' ':
Anim = !Anim;
if (Anim)
glutIdleFunc(idle);
@@ -232,6 +271,13 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile,
InitUniforms(program, uniforms);
+ TexCoord0_attr = glGetAttribLocation_func(program, "TexCoord0");
+ TexCoord1_attr = glGetAttribLocation_func(program, "TexCoord1");
+ VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
+ printf("TexCoord0_attr = %d\n", TexCoord0_attr);
+ printf("TexCoord1_attr = %d\n", TexCoord1_attr);
+ printf("VertCoord_attr = %d\n", VertCoord_attr);
+
return program;
}
diff --git a/progs/glsl/multitex.vert b/progs/glsl/multitex.vert
index 5518ca1ddd..4fae3b73fb 100644
--- a/progs/glsl/multitex.vert
+++ b/progs/glsl/multitex.vert
@@ -2,9 +2,13 @@
// Brian Paul
+attribute vec4 TexCoord0, TexCoord1;
+attribute vec4 VertCoord;
+
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_MultiTexCoord1;
- gl_Position = ftransform();
+ gl_TexCoord[0] = TexCoord0;
+ gl_TexCoord[1] = TexCoord1;
+ // note: may use gl_Vertex or VertCoord here for testing:
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
diff --git a/progs/redbook/SConscript b/progs/redbook/SConscript
new file mode 100644
index 0000000000..242cb6647f
--- /dev/null
+++ b/progs/redbook/SConscript
@@ -0,0 +1,91 @@
+Import('*')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+ '../util',
+])
+
+env.Prepend(LIBS = [
+ util,
+ '$GLUT_LIB'
+])
+
+if env['platform'] == 'windows':
+ env.Append(CPPDEFINES = ['NOMINMAX'])
+ env.Prepend(LIBS = ['winmm'])
+
+progs = [
+ 'aaindex',
+ 'aapoly',
+ 'aargb',
+ 'accanti',
+ 'accpersp',
+ 'alpha3D',
+ 'alpha',
+ 'anti',
+ 'bezcurve',
+ 'bezmesh',
+ 'checker',
+ 'clip',
+ 'colormat',
+ 'cube',
+ 'depthcue',
+ 'dof',
+ 'double',
+ 'drawf',
+ 'feedback',
+ 'fog',
+ 'fogindex',
+ 'font',
+ 'hello',
+ 'image',
+ 'light',
+ 'lines',
+ 'list',
+ 'material',
+ 'mipmap',
+ 'model',
+ 'movelight',
+ 'nurbs',
+ 'pickdepth',
+ 'picksquare',
+ 'plane',
+ 'planet',
+ 'polyoff',
+ 'polys',
+ 'quadric',
+ 'robot',
+ 'sccolorlight',
+ 'scenebamb',
+ 'scene',
+ 'sceneflat',
+ 'select',
+ 'smooth',
+ 'stencil',
+ 'stroke',
+ 'surface',
+ 'teaambient',
+ 'teapots',
+ 'tess',
+ 'tesswind',
+ 'texbind',
+ 'texgen',
+ 'texprox',
+ 'texsub',
+ 'texturesurf',
+ 'torus',
+ 'trim',
+ 'unproject',
+ 'varray',
+ 'wrap',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
diff --git a/progs/samples/Makefile b/progs/samples/Makefile
index 63dca07d2e..b300e38b9c 100644
--- a/progs/samples/Makefile
+++ b/progs/samples/Makefile
@@ -7,7 +7,7 @@ INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
font line logo nurb olympic overlay point prim quad select \
diff --git a/progs/samples/SConscript b/progs/samples/SConscript
new file mode 100644
index 0000000000..7a8a0d62d8
--- /dev/null
+++ b/progs/samples/SConscript
@@ -0,0 +1,58 @@
+Import('*')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+ '../util',
+])
+
+env.Prepend(LIBS = [
+ util,
+ '$GLUT_LIB'
+])
+
+if env['platform'] == 'windows':
+ env.Append(CPPDEFINES = ['NOMINMAX'])
+ env.Prepend(LIBS = ['winmm'])
+
+progs = [
+ 'accum',
+ 'bitmap1',
+ 'bitmap2',
+ 'blendeq',
+ 'blendxor',
+ 'copy',
+ 'cursor',
+ 'depth',
+ 'eval',
+ 'fog',
+ 'font',
+ 'line',
+ 'logo',
+ 'nurb',
+ #'oglinfo',
+ 'olympic',
+ 'overlay',
+ 'point',
+ 'prim',
+ 'quad',
+ 'rgbtoppm',
+ 'select',
+ 'shape',
+ 'sphere',
+ 'star',
+ 'stencil',
+ 'stretch',
+ 'texture',
+ 'tri',
+ 'wave',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
diff --git a/progs/samples/blendeq.c b/progs/samples/blendeq.c
index d5143ecdf5..cd0474c5ce 100644
--- a/progs/samples/blendeq.c
+++ b/progs/samples/blendeq.c
@@ -11,10 +11,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLenum doubleBuffer;
@@ -274,6 +271,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
/* Make sure blend_logic_op extension is there. */
s = (char *) glGetString(GL_EXTENSIONS);
version = (char*) glGetString(GL_VERSION);
diff --git a/progs/samples/blendxor.c b/progs/samples/blendxor.c
index 5bc4aa9bea..057143651f 100644
--- a/progs/samples/blendxor.c
+++ b/progs/samples/blendxor.c
@@ -10,13 +10,8 @@
#include <unistd.h>
#endif
#include <stdlib.h>
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#define GL_GLEXT_LEGACY
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
-#include <GL/glext.h>
GLenum doubleBuffer;
@@ -176,6 +171,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
/* Make sure blend_logic_op extension is there. */
s = (char *) glGetString(GL_EXTENSIONS);
version = (char*) glGetString(GL_VERSION);
diff --git a/progs/tests/bufferobj.c b/progs/tests/bufferobj.c
index 50ab5cdfa8..d1a85392e1 100644
--- a/progs/tests/bufferobj.c
+++ b/progs/tests/bufferobj.c
@@ -22,6 +22,8 @@ struct object
GLuint NumVerts;
GLuint VertexOffset;
GLuint ColorOffset;
+ GLuint VertexStride;
+ GLuint ColorStride;
GLuint NumElements;
};
@@ -46,7 +48,7 @@ static void CheckError(int line)
static void DrawObject( const struct object *obj )
{
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
- glVertexPointer(3, GL_FLOAT, 0, (void *) obj->VertexOffset);
+ glVertexPointer(3, GL_FLOAT, obj->VertexStride, (void *) obj->VertexOffset);
glEnable(GL_VERTEX_ARRAY);
/* test push/pop attrib */
@@ -60,7 +62,7 @@ static void DrawObject( const struct object *obj )
glPopClientAttrib();
}
#endif
- glColorPointer(3, GL_FLOAT, 0, (void *) obj->ColorOffset);
+ glColorPointer(3, GL_FLOAT, obj->ColorStride, (void *) obj->ColorOffset);
glEnable(GL_COLOR_ARRAY);
if (obj->NumElements > 0) {
@@ -241,6 +243,8 @@ static void MakeObject1(struct object *obj)
obj->NumVerts = 4;
obj->VertexOffset = 0;
obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
+ obj->VertexStride = 0;
+ obj->ColorStride = 0;
obj->NumElements = 0;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
@@ -255,24 +259,28 @@ static void MakeObject1(struct object *obj)
static void MakeObject2(struct object *obj)
{
- GLfloat *v, *c;
+ GLfloat *v;
+ int start = 40; /* bytes, to test non-zero array offsets */
glGenBuffersARB(1, &obj->BufferID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB);
v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
- /* Make triangle */
- v[0] = -1; v[1] = -1; v[2] = 0;
- v[3] = 1; v[4] = -1; v[5] = 0;
- v[6] = 0; v[7] = 1; v[8] = 0;
- c = v + 9;
- c[0] = 0; c[1] = 1; c[2] = 0;
- c[3] = 0; c[4] = 1; c[5] = 0;
- c[6] = 1; c[7] = 1; c[8] = 0;
+ v += start / sizeof(GLfloat);
+
+ /* Make triangle: interleaved colors, then positions */
+ /* R G B X Y Z */
+ v[0] = 0; v[1] = 1; v[2] = 0; v[3] = -1; v[4] = -1; v[5] = 0;
+ v[6] = 0; v[7] = 1; v[8] = 0; v[9] = 1; v[10] = -1; v[11] = 0;
+ v[12] = 1; v[13] = 1; v[14] = 0; v[15] = 0; v[16] = 1; v[17] = 0;
+
obj->NumVerts = 3;
- obj->VertexOffset = 0;
- obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
+ obj->VertexOffset = start + 3 * sizeof(GLfloat);
+ obj->ColorOffset = start;
+ obj->VertexStride = 6 * sizeof(GLfloat);
+ obj->ColorStride = 6 * sizeof(GLfloat);
+
obj->NumElements = 0;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
@@ -300,6 +308,8 @@ static void MakeObject3(struct object *obj)
obj->NumVerts = 4;
obj->VertexOffset = 0;
obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
+ obj->VertexStride = 0;
+ obj->ColorStride = 0;
bytes = obj->NumVerts * (3 + 3) * sizeof(GLfloat);
diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c
index 8f4569ff3b..ab2757c3c3 100644
--- a/progs/tests/fbotest1.c
+++ b/progs/tests/fbotest1.c
@@ -122,6 +122,7 @@ Key( unsigned char key, int x, int y )
static void
Init( void )
{
+ GLboolean ARB_fbo = glutExtensionSupported("GL_ARB_framebuffer_object");
GLint i;
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
@@ -133,16 +134,20 @@ Init( void )
glGenFramebuffersEXT(1, &MyFB);
assert(MyFB);
assert(!glIsFramebufferEXT(MyFB));
- glDeleteFramebuffersEXT(1, &MyFB);
- assert(!glIsFramebufferEXT(MyFB));
+ if (!ARB_fbo) {
+ glDeleteFramebuffersEXT(1, &MyFB);
+ assert(!glIsFramebufferEXT(MyFB));
+ }
/* Note, continue to use MyFB below */
glGenRenderbuffersEXT(1, &MyRB);
assert(MyRB);
assert(!glIsRenderbufferEXT(MyRB));
- glDeleteRenderbuffersEXT(1, &MyRB);
- assert(!glIsRenderbufferEXT(MyRB));
- MyRB = 42; /* an arbitrary ID */
+ if (!ARB_fbo) {
+ glDeleteRenderbuffersEXT(1, &MyRB);
+ assert(!glIsRenderbufferEXT(MyRB));
+ MyRB = 42; /* an arbitrary ID */
+ }
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
assert(glIsFramebufferEXT(MyFB));
diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c
index 88d0549c80..1f7c45fc79 100644
--- a/progs/tests/fbotexture.c
+++ b/progs/tests/fbotexture.c
@@ -32,11 +32,13 @@ static int TexWidth = 512, TexHeight = 512;
static GLuint MyFB;
static GLuint TexObj;
-static GLuint DepthRB, StencilRB;
+static GLuint DepthRB = 0, StencilRB = 0;
static GLboolean Anim = GL_FALSE;
static GLfloat Rot = 0.0;
static GLboolean UsePackedDepthStencil = GL_FALSE;
-static GLuint TextureLevel = 1; /* which texture level to render to */
+static GLboolean UsePackedDepthStencilBoth = GL_FALSE;
+static GLboolean Use_ARB_fbo = GL_FALSE;
+static GLuint TextureLevel = 0; /* which texture level to render to */
static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
static GLboolean Cull = GL_FALSE;
static GLboolean Wireframe = GL_FALSE;
@@ -248,8 +250,7 @@ CleanUp(void)
glDeleteRenderbuffersEXT(1, &DepthRB);
#endif
#if STENCIL
- if (!UsePackedDepthStencil)
- glDeleteRenderbuffersEXT(1, &StencilRB);
+ glDeleteRenderbuffersEXT(1, &StencilRB);
#endif
glDeleteFramebuffersEXT(1, &MyFB);
@@ -294,140 +295,294 @@ Key(unsigned char key, int x, int y)
}
-static void
-Usage(void)
+/**
+ * Attach depth and stencil renderbuffer(s) to the given framebuffer object.
+ * \param tryDepthStencil if true, try to use a combined depth+stencil buffer
+ * \param bindDepthStencil if true, and tryDepthStencil is true, bind with
+ * the GL_DEPTH_STENCIL_ATTACHMENT target.
+ * \return GL_TRUE for success, GL_FALSE for failure
+ */
+static GLboolean
+AttachDepthAndStencilBuffers(GLuint fbo,
+ GLsizei width, GLsizei height,
+ GLboolean tryDepthStencil,
+ GLboolean bindDepthStencil,
+ GLuint *depthRbOut, GLuint *stencilRbOut)
{
- printf("Usage:\n");
- printf(" a Toggle animation\n");
- printf(" s/s Step/rotate\n");
- printf(" c Toggle back-face culling\n");
- printf(" w Toggle wireframe mode (front-face only)\n");
- printf(" Esc Exit\n");
-}
+ GLenum status;
+ *depthRbOut = *stencilRbOut = 0;
-static void
-Init(int argc, char *argv[])
-{
- static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
- GLint i;
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
- if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
- printf("GL_EXT_framebuffer_object not found!\n");
- exit(0);
- }
+ if (tryDepthStencil) {
+ GLuint rb;
- if (argc > 1 && strcmp(argv[1], "-ds") == 0) {
- if (!glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
- printf("GL_EXT_packed_depth_stencil not found!\n");
- exit(0);
+ glGenRenderbuffersEXT(1, &rb);
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
+ GL_DEPTH24_STENCIL8_EXT,
+ width, height);
+ if (glGetError())
+ return GL_FALSE;
+
+ if (bindDepthStencil) {
+ /* attach to both depth and stencil at once */
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+ GL_DEPTH_STENCIL_ATTACHMENT,
+ GL_RENDERBUFFER_EXT, rb);
+ if (glGetError())
+ return GL_FALSE;
+ }
+ else {
+ /* attach to depth attachment point */
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+ GL_DEPTH_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, rb);
+ if (glGetError())
+ return GL_FALSE;
+
+ /* and attach to stencil attachment point */
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+ GL_STENCIL_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, rb);
+ if (glGetError())
+ return GL_FALSE;
}
- UsePackedDepthStencil = GL_TRUE;
- printf("Using GL_EXT_packed_depth_stencil\n");
+
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
+ return GL_FALSE;
+
+ *depthRbOut = *stencilRbOut = rb;
+ return GL_TRUE;
}
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ /* just depth renderbuffer */
+ {
+ GLuint rb;
- /* gen framebuffer id, delete it, do some assertions, just for testing */
- glGenFramebuffersEXT(1, &MyFB);
- assert(MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- glDeleteFramebuffersEXT(1, &MyFB);
- assert(!glIsFramebufferEXT(MyFB));
- /* Note, continue to use MyFB below */
+ glGenRenderbuffersEXT(1, &rb);
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
+ GL_DEPTH_COMPONENT,
+ width, height);
+ if (glGetError())
+ return GL_FALSE;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
- assert(glIsFramebufferEXT(MyFB));
- glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
- assert(i == MyFB);
+ /* attach to depth attachment point */
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+ GL_DEPTH_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, rb);
+ if (glGetError())
+ return GL_FALSE;
- /* Make texture object/image */
- glGenTextures(1, &TexObj);
- glBindTexture(TexTarget, TexObj);
- /* make two image levels */
- glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- TexWidth = TexWidth >> TextureLevel;
- TexHeight = TexHeight >> TextureLevel;
-
- glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
- glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
+ return GL_FALSE;
- CheckError(__LINE__);
+ *depthRbOut = rb;
+ }
+
+ /* just stencil renderbuffer */
+ {
+ GLuint rb;
+
+ glGenRenderbuffersEXT(1, &rb);
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
+ GL_STENCIL_INDEX,
+ width, height);
+ if (glGetError())
+ return GL_FALSE;
+
+ /* attach to depth attachment point */
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+ GL_STENCIL_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, rb);
+ if (glGetError())
+ return GL_FALSE;
+
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
+ return GL_FALSE;
+
+ *stencilRbOut = rb;
+ }
+
+ return GL_TRUE;
+}
+
+
+static void
+ParseArgs(int argc, char *argv[])
+{
+ GLint i;
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-ds") == 0) {
+ if (!glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
+ printf("GL_EXT_packed_depth_stencil not found!\n");
+ exit(0);
+ }
+ UsePackedDepthStencil = GL_TRUE;
+ printf("Using GL_EXT_packed_depth_stencil\n");
+ }
+ else if (strcmp(argv[i], "-ds2") == 0) {
+ if (!glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
+ printf("GL_EXT_packed_depth_stencil not found!\n");
+ exit(0);
+ }
+ if (!glutExtensionSupported("GL_ARB_framebuffer_object")) {
+ printf("GL_ARB_framebuffer_object not found!\n");
+ exit(0);
+ }
+ UsePackedDepthStencilBoth = GL_TRUE;
+ printf("Using GL_EXT_packed_depth_stencil and GL_DEPTH_STENCIL attachment point\n");
+ }
+ else if (strcmp(argv[i], "-arb") == 0) {
+ if (!glutExtensionSupported("GL_ARB_framebuffer_object")) {
+ printf("Sorry, GL_ARB_framebuffer object not supported!\n");
+ }
+ else {
+ Use_ARB_fbo = GL_TRUE;
+ }
+ }
+ else {
+ printf("Unknown option: %s\n", argv[i]);
+ }
+ }
+}
+
+
+/*
+ * Make FBO to render into given texture.
+ */
+static GLuint
+MakeFBO_RenderTexture(GLuint TexObj)
+{
+ GLuint fb;
+ GLint sizeFudge = 0;
+ glGenFramebuffersEXT(1, &fb);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
/* Render color to texture */
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
TexTarget, TexObj, TextureLevel);
+ if (Use_ARB_fbo) {
+ /* use a smaller depth buffer to see what happens */
+ sizeFudge = 90;
+ }
-#if DEPTH
- /* make depth renderbuffer */
- glGenRenderbuffersEXT(1, &DepthRB);
- assert(DepthRB);
- assert(!glIsRenderbufferEXT(DepthRB));
- glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
- assert(glIsRenderbufferEXT(DepthRB));
- if (UsePackedDepthStencil)
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT,
- TexWidth, TexHeight);
- else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
- TexWidth, TexHeight);
- CheckError(__LINE__);
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
- CheckError(__LINE__);
- printf("Depth renderbuffer size = %d bits\n", i);
- assert(i > 0);
+ /* Setup depth and stencil buffers */
+ {
+ GLboolean b;
+ b = AttachDepthAndStencilBuffers(fb,
+ TexWidth - sizeFudge,
+ TexHeight - sizeFudge,
+ UsePackedDepthStencil,
+ UsePackedDepthStencilBoth,
+ &DepthRB, &StencilRB);
+ if (!b) {
+ /* try !UsePackedDepthStencil */
+ b = AttachDepthAndStencilBuffers(fb,
+ TexWidth - sizeFudge,
+ TexHeight - sizeFudge,
+ !UsePackedDepthStencil,
+ UsePackedDepthStencilBoth,
+ &DepthRB, &StencilRB);
+ }
+ if (!b) {
+ printf("Unable to create/attach depth and stencil renderbuffers "
+ " to FBO!\n");
+ exit(1);
+ }
+ }
- /* attach DepthRB to MyFB */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, DepthRB);
-#endif
+ /* queries */
+ {
+ GLint bits, w, h;
- CheckError(__LINE__);
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
+ glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
+ GL_RENDERBUFFER_WIDTH_EXT, &w);
+ glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
+ GL_RENDERBUFFER_HEIGHT_EXT, &h);
+ printf("Color/Texture size: %d x %d\n", TexWidth, TexHeight);
+ printf("Depth buffer size: %d x %d\n", w, h);
+
+ glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
+ GL_RENDERBUFFER_DEPTH_SIZE_EXT, &bits);
+ printf("Depth renderbuffer size = %d bits\n", bits);
-#if STENCIL
- if (UsePackedDepthStencil) {
- /* DepthRb is a combined depth/stencil renderbuffer */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
- GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, DepthRB);
- }
- else {
- /* make stencil renderbuffer */
- glGenRenderbuffersEXT(1, &StencilRB);
- assert(StencilRB);
- assert(!glIsRenderbufferEXT(StencilRB));
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
- assert(glIsRenderbufferEXT(StencilRB));
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
- TexWidth, TexHeight);
- /* attach StencilRB to MyFB */
- glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
- GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, StencilRB);
+ glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
+ GL_RENDERBUFFER_STENCIL_SIZE_EXT, &bits);
+ printf("Stencil renderbuffer size = %d bits\n", bits);
}
- glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT,
- GL_RENDERBUFFER_STENCIL_SIZE_EXT, &i);
- CheckError(__LINE__);
- printf("Stencil renderbuffer size = %d bits\n", i);
- assert(i > 0);
-#endif
- CheckError(__LINE__);
-
- /* bind regular framebuffer */
+ /* bind the regular framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ return fb;
+}
+
+
+static void
+Init(void)
+{
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
/* lighting */
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
+ {
+ static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
+ }
+
+ /*
+ * Make texture object/image (we'll render into this texture)
+ */
+ {
+ glGenTextures(1, &TexObj);
+ glBindTexture(TexTarget, TexObj);
+
+ /* make two image levels */
+ glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ TexWidth = TexWidth >> TextureLevel;
+ TexHeight = TexHeight >> TextureLevel;
+
+ glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ }
+
+ MyFB = MakeFBO_RenderTexture(TexObj);
+}
+
+
+static void
+Usage(void)
+{
+ printf("Usage:\n");
+ printf(" -ds Use combined depth/stencil renderbuffer\n");
+ printf(" -arb Try GL_ARB_framebuffer_object's mismatched buffer sizes\n");
+ printf(" -ds2 Tye GL_ARB_framebuffer_object's GL_DEPTH_STENCIL_ATTACHMENT\n");
+ printf("Keys:\n");
+ printf(" a Toggle animation\n");
+ printf(" s/s Step/rotate\n");
+ printf(" c Toggle back-face culling\n");
+ printf(" w Toggle wireframe mode (front-face only)\n");
+ printf(" Esc Exit\n");
}
@@ -444,8 +599,11 @@ main(int argc, char *argv[])
glutDisplayFunc(Display);
if (Anim)
glutIdleFunc(Idle);
- Init(argc, argv);
+
+ ParseArgs(argc, argv);
+ Init();
Usage();
+
glutMainLoop();
return 0;
}
diff --git a/progs/tests/shader_api.c b/progs/tests/shader_api.c
index 598f029a97..679f9137c8 100644
--- a/progs/tests/shader_api.c
+++ b/progs/tests/shader_api.c
@@ -113,7 +113,8 @@ static void test_uniform_size_type1(const char *glslType, GLenum glType, const c
GLenum type;
GLint size;
- printf(" Running subtest %s\n", glslType); fflush(stdout);
+ printf(" Running subtest %s\n", glslType);
+ fflush(stdout);
sprintf(buffer, "#version 120\nuniform %s m[60];\nvoid main() { gl_Position[0] = m[59]%s; }\n",
glslType, el);
@@ -169,7 +170,8 @@ static void test_attrib_size_type1(const char *glslType, GLenum glType, const ch
GLenum type;
GLint size;
- printf(" Running subtest %s\n", glslType); fflush(stdout);
+ printf(" Running subtest %s\n", glslType);
+ fflush(stdout);
sprintf(buffer, "#version 120\nattribute %s m;\nvoid main() { gl_Position[0] = m%s; }\n",
glslType, el);
@@ -302,8 +304,6 @@ static void test_uniform_multiple_samplers(void)
assert_no_error();
program = make_program(NULL, "uniform sampler2D s[2];\nvoid main() { gl_FragColor = texture2D(s[1], vec2(0.0, 0.0)); }\n");
location = glGetUniformLocation(program, "s[0]");
- if (location == -1) /* Mesa doesn't currently support indexing */
- location = glGetUniformLocation(program, "s");
assert(location != -1);
assert_no_error();
glUniform1iv(location, 2, values);
diff --git a/progs/util/extfuncs.h b/progs/util/extfuncs.h
index cf6b29d0e3..070414e294 100644
--- a/progs/util/extfuncs.h
+++ b/progs/util/extfuncs.h
@@ -46,6 +46,13 @@ static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f_func = NULL;
static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL;
static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL;
static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL;
+static PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv_func = NULL;
+static PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv_func = NULL;
+static PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv_func = NULL;
+static PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv_func = NULL;
+static PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer_func = NULL;
+static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_func = NULL;
+static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_func = NULL;
/* OpenGL 2.1 */
static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL;
@@ -126,6 +133,14 @@ GetExtensionFuncs(void)
glVertexAttrib2f_func = (PFNGLVERTEXATTRIB2FPROC) glutGetProcAddress("glVertexAttrib2f");
glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f");
glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f");
+ glVertexAttrib1fv_func = (PFNGLVERTEXATTRIB1FVPROC) glutGetProcAddress("glVertexAttrib1fv");
+ glVertexAttrib2fv_func = (PFNGLVERTEXATTRIB2FVPROC) glutGetProcAddress("glVertexAttrib2fv");
+ glVertexAttrib3fv_func = (PFNGLVERTEXATTRIB3FVPROC) glutGetProcAddress("glVertexAttrib3fv");
+ glVertexAttrib4fv_func = (PFNGLVERTEXATTRIB4FVPROC) glutGetProcAddress("glVertexAttrib4fv");
+
+ glVertexAttribPointer_func = (PFNGLVERTEXATTRIBPOINTERPROC) glutGetProcAddress("glVertexAttribPointer");
+ glEnableVertexAttribArray_func = (PFNGLENABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glEnableVertexAttribArray");
+ glDisableVertexAttribArray_func = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glDisableVertexAttribArray");
/* OpenGL 2.1 */
glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv");
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index 8db717f1aa..2dc157a890 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -39,6 +39,9 @@
#include <GL/gl.h>
#include <GL/glx.h>
+static int is_glx_extension_supported(Display *dpy, const char *query);
+
+static void query_vsync(Display *dpy);
#define BENCHMARK
@@ -561,12 +564,82 @@ make_window( Display *dpy, const char *name,
/**
+ * Determine whether or not a GLX extension is supported.
+ */
+int
+is_glx_extension_supported(Display *dpy, const char *query)
+{
+ const int scrnum = DefaultScreen(dpy);
+ const char *glx_extensions = NULL;
+ const size_t len = strlen(query);
+ const char *ptr;
+
+ if (glx_extensions == NULL) {
+ glx_extensions = glXQueryExtensionsString(dpy, scrnum);
+ }
+
+ ptr = strstr(glx_extensions, query);
+ return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0')));
+}
+
+
+/**
+ * Attempt to determine whether or not the display is synched to vblank.
+ */
+void
+query_vsync(Display *dpy)
+{
+ int interval = 0;
+
+
+#ifdef GLX_MESA_swap_control
+ if ((interval <= 0)
+ && is_glx_extension_supported(dpy, "GLX_MESA_swap_control")) {
+ PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA =
+ (PFNGLXGETSWAPINTERVALMESAPROC)
+ glXGetProcAddressARB((const GLubyte *) "glXGetSwapIntervalMESA");
+
+ interval = (*pglXGetSwapIntervalMESA)();
+ }
+#endif
+
+
+#ifdef GLX_SGI_video_sync
+ if ((interval <= 0)
+ && is_glx_extension_supported(dpy, "GLX_SGI_video_sync")) {
+ PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI =
+ (PFNGLXGETVIDEOSYNCSGIPROC)
+ glXGetProcAddressARB((const GLubyte *) "glXGetVideoSyncSGI");
+ unsigned count;
+
+ if ((*pglXGetVideoSyncSGI)(& count) == 0) {
+ interval = (int) count;
+ }
+ }
+#endif
+
+
+ if (interval > 0) {
+ printf("Running synchronized to the vertical refresh. The framerate should be\n");
+ if (interval == 1) {
+ printf("approximately the same as the monitor refresh rate.\n");
+ } else if (interval > 1) {
+ printf("approximately 1/%d the monitor refresh rate.\n",
+ interval);
+ }
+ }
+}
+
+/**
* Handle one X event.
* \return NOP, EXIT or DRAW
*/
static int
handle_event(Display *dpy, Window win, XEvent *event)
{
+ (void) dpy;
+ (void) win;
+
switch (event->type) {
case Expose:
return DRAW;
@@ -686,6 +759,7 @@ main(int argc, char *argv[])
make_window(dpy, "glxgears", x, y, winWidth, winHeight, &win, &ctx);
XMapWindow(dpy, win);
glXMakeCurrent(dpy, win, ctx);
+ query_vsync(dpy);
if (printInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
diff --git a/progs/xdemos/glxpixmap.c b/progs/xdemos/glxpixmap.c
index 9db4df2c8b..e1abd22cee 100644
--- a/progs/xdemos/glxpixmap.c
+++ b/progs/xdemos/glxpixmap.c
@@ -178,6 +178,7 @@ int main( int argc, char *argv[] )
glColor3f( 0.0, 1.0, 1.0 );
glRectf( -0.75, -0.75, 0.75, 0.75 );
glFlush();
+ glXWaitGL();
XMapWindow( dpy, win );
diff --git a/progs/xdemos/overlay.c b/progs/xdemos/overlay.c
index 4c425b64d4..758f85c449 100644
--- a/progs/xdemos/overlay.c
+++ b/progs/xdemos/overlay.c
@@ -165,7 +165,8 @@ MakeOverlayWindow(Display *dpy)
/* XXX setup the colormap entries! */
}
else {
- printf("Error: couldn't get an overlay visual!\n");
+ printf("Couldn't get an overlay visual.\n");
+ printf("Your hardware probably doesn't support framebuffer overlay planes.\n");
exit(1);
}
}
diff --git a/scons/gallium.py b/scons/gallium.py
index 065c53c54b..d20d02ca20 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -163,6 +163,25 @@ def createInstallMethods(env):
env.AddMethod(install_shared_library, 'InstallSharedLibrary')
+def num_jobs():
+ try:
+ return int(os.environ['NUMBER_OF_PROCESSORS'])
+ except (ValueError, KeyError):
+ pass
+
+ try:
+ return os.sysconf('SC_NPROCESSORS_ONLN')
+ except (ValueError, OSError, AttributeError):
+ pass
+
+ try:
+ return int(os.popen2("sysctl -n hw.ncpu")[1].read())
+ except ValueError:
+ pass
+
+ return 1
+
+
def generate(env):
"""Common environment generation code"""
@@ -207,6 +226,10 @@ def generate(env):
env.SConsignFile(os.path.join(build_dir, '.sconsign'))
env.CacheDir('build/cache')
+ # Parallel build
+ if env.GetOption('num_jobs') <= 1:
+ env.SetOption('num_jobs', num_jobs())
+
# C preprocessor options
cppdefines = []
if debug:
@@ -324,6 +347,7 @@ def generate(env):
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
+ '/GL-', # disable whole program optimization
]
else:
cflags += [
@@ -414,10 +438,15 @@ def generate(env):
linkflags += ['-m32']
if env['machine'] == 'x86_64':
linkflags += ['-m64']
- if platform == 'winddk':
+ if platform == 'windows' and msvc:
# See also:
# - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
linkflags += [
+ '/fixed:no',
+ '/incremental:no',
+ ]
+ if platform == 'winddk':
+ linkflags += [
'/merge:_PAGE=PAGE',
'/merge:_TEXT=.text',
'/section:INIT,d',
diff --git a/scons/generic.py b/scons/generic.py
index 05f7356b76..7592222fd6 100644
--- a/scons/generic.py
+++ b/scons/generic.py
@@ -206,6 +206,25 @@ _bool_map = {
}
+def num_jobs():
+ try:
+ return int(os.environ['NUMBER_OF_PROCESSORS'])
+ except (ValueError, KeyError):
+ pass
+
+ try:
+ return os.sysconf('SC_NPROCESSORS_ONLN')
+ except (ValueError, OSError, AttributeError):
+ pass
+
+ try:
+ return int(os.popen2("sysctl -n hw.ncpu")[1].read())
+ except ValueError:
+ pass
+
+ return 1
+
+
def generate(env):
"""Common environment generation code"""
@@ -266,6 +285,10 @@ def generate(env):
# different scons versions building the same source file
env.SConsignFile(os.path.join(env['build'], '.sconsign'))
+ # Parallel build
+ if env.GetOption('num_jobs') <= 1:
+ env.SetOption('num_jobs', num_jobs())
+
# Summary
print
print ' platform=%s' % env['platform']
@@ -274,6 +297,7 @@ def generate(env):
print ' debug=%s' % ['no', 'yes'][env['debug']]
print ' profile=%s' % ['no', 'yes'][env['profile']]
print ' build=%s' % env['build']
+ print ' %s jobs' % env.GetOption('num_jobs')
print
# Load tool chain
@@ -401,6 +425,7 @@ def generate(env):
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
+ '/GL-', # disable whole program optimization
]
else:
ccflags += [
@@ -492,10 +517,15 @@ def generate(env):
linkflags += ['-m32']
if env['machine'] == 'x86_64':
linkflags += ['-m64']
- if platform == 'winddk':
+ if platform == 'windows' and msvc:
# See also:
# - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
linkflags += [
+ '/fixed:no',
+ '/incremental:no',
+ ]
+ if platform == 'winddk':
+ linkflags += [
'/merge:_PAGE=PAGE',
'/merge:_TEXT=.text',
'/section:INIT,d',
diff --git a/src/egl/Makefile b/src/egl/Makefile
index 024453f8bb..5b09e178c6 100644
--- a/src/egl/Makefile
+++ b/src/egl/Makefile
@@ -1,6 +1,7 @@
# src/egl/Makefile
TOP = ../..
+include $(TOP)/configs/current
SUBDIRS = main drivers
@@ -15,6 +16,12 @@ subdirs:
fi \
done
+install:
+ @for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE) install) || exit 1 ; \
+ fi \
+ done
clean:
-@for dir in $(SUBDIRS) ; do \
diff --git a/src/egl/drivers/Makefile b/src/egl/drivers/Makefile
index f0538f563f..dde4ee2255 100644
--- a/src/egl/drivers/Makefile
+++ b/src/egl/drivers/Makefile
@@ -16,6 +16,12 @@ subdirs:
fi \
done
+install:
+ @ for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir ; $(MAKE) install) || exit 1 ; \
+ fi \
+ done
clean:
@for dir in $(SUBDIRS) ; do \
diff --git a/src/egl/drivers/demo/Makefile b/src/egl/drivers/demo/Makefile
index 6ca25aa5d6..d908cdb4b2 100644
--- a/src/egl/drivers/demo/Makefile
+++ b/src/egl/drivers/demo/Makefile
@@ -25,7 +25,9 @@ $(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS)
-ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \
$(OBJECTS)
-
+install:
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/demodriver.so $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
-rm -f *.o
diff --git a/src/egl/drivers/dri/Makefile b/src/egl/drivers/dri/Makefile
index d7eba653b2..be2f9b6bea 100644
--- a/src/egl/drivers/dri/Makefile
+++ b/src/egl/drivers/dri/Makefile
@@ -48,6 +48,8 @@ $(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS)
-major 1 -minor 0 \
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) $(LIBS)
+install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libEGLdri.so $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
-rm -f *.o
diff --git a/src/egl/drivers/glx/Makefile b/src/egl/drivers/glx/Makefile
index 3cd5276513..090a230ca3 100644
--- a/src/egl/drivers/glx/Makefile
+++ b/src/egl/drivers/glx/Makefile
@@ -56,6 +56,8 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS)
-install $(TOP)/$(LIB_DIR) \
$(OBJECTS) $(DRM_LIB) $(MISC_LIBS)
+install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
rm -f *.o
diff --git a/src/egl/drivers/xdri/Makefile b/src/egl/drivers/xdri/Makefile
index a721b997e6..db4b710002 100644
--- a/src/egl/drivers/xdri/Makefile
+++ b/src/egl/drivers/xdri/Makefile
@@ -52,6 +52,8 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS)
-install $(TOP)/$(LIB_DIR) \
$(OBJECTS) $(DRM_LIB) $(MISC_LIBS)
+install: $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
rm -f *.o
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
index 8ea60c0199..89b4a200bc 100644
--- a/src/egl/main/Makefile
+++ b/src/egl/main/Makefile
@@ -65,7 +65,9 @@ $(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS)
-major 1 -minor 0 \
-install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) $(LIBS)
-
+install:
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libEGL.so* $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
-rm -f *.o *.so*
diff --git a/src/gallium/Makefile b/src/gallium/Makefile
index c7b594d084..875314f6c3 100644
--- a/src/gallium/Makefile
+++ b/src/gallium/Makefile
@@ -2,7 +2,7 @@ TOP = ../..
include $(TOP)/configs/current
-SUBDIRS = auxiliary drivers state_trackers
+SUBDIRS = $(GALLIUM_DIRS)
# Note winsys/ needs to be built after src/mesa
diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index 85baf51a7f..0c632ac2b8 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -21,6 +21,7 @@ SConscript([
'auxiliary/translate/SConscript',
'auxiliary/draw/SConscript',
'auxiliary/pipebuffer/SConscript',
+ 'auxiliary/indices/SConscript',
])
for driver in env['drivers']:
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 41910c6165..e68c824c86 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -256,7 +256,7 @@ pstip_transform_inst(struct tgsi_transform_context *ctx,
struct tgsi_full_immediate immed;
uint size = 4;
immed = tgsi_default_full_immediate();
- immed.Immediate.Size = 1 + size; /* one for the token itself */
+ immed.Immediate.NrTokens = 1 + size; /* one for the token itself */
immed.u.Pointer = (void *) value;
ctx->emit_immediate(ctx, &immed);
}
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index 5ead25efff..9153bc2f86 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
@@ -394,13 +394,14 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf )
/* even number */
vbuf->max_vertices = vbuf->max_vertices & ~1;
+ if(vbuf->max_vertices >= UNDEFINED_VERTEX_ID)
+ vbuf->max_vertices = UNDEFINED_VERTEX_ID - 1;
+
/* Must always succeed -- driver gives us a
* 'max_vertex_buffer_bytes' which it guarantees it can allocate,
* and it will flush itself if necessary to do so. If this does
* fail, we are basically without usable hardware.
*/
- assert(vbuf->max_vertices < UNDEFINED_VERTEX_ID);
-
vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render,
(ushort) vbuf->vertex_size,
(ushort) vbuf->max_vertices);
diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c
index 6817f29c2a..0c693a4a65 100644
--- a/src/gallium/auxiliary/draw/draw_vs_aos.c
+++ b/src/gallium/auxiliary/draw/draw_vs_aos.c
@@ -1870,7 +1870,7 @@ static boolean note_immediate( struct aos_compilation *cp,
unsigned pos = cp->num_immediates++;
unsigned j;
- for (j = 0; j < imm->Immediate.Size; j++) {
+ for (j = 0; j < imm->Immediate.NrTokens - 1; j++) {
cp->vaos->machine->immediate[pos][j] = imm->u.ImmediateFloat32[j].Float;
}
diff --git a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
index 6b18a68fe6..5b08200d14 100644
--- a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
+++ b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
@@ -160,7 +160,7 @@ translate_immediate(Storage *storage,
{
float vec[4];
int i;
- for (i = 0; i < imm->Immediate.Size - 1; ++i) {
+ for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) {
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
vec[i] = imm->u.ImmediateFloat32[i].Float;
@@ -179,7 +179,7 @@ translate_immediateir(StorageSoa *storage,
{
float vec[4];
int i;
- for (i = 0; i < imm->Immediate.Size - 1; ++i) {
+ for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) {
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
vec[i] = imm->u.ImmediateFloat32[i].Float;
diff --git a/src/gallium/auxiliary/indices/Makefile b/src/gallium/auxiliary/indices/Makefile
new file mode 100644
index 0000000000..8fa61d265e
--- /dev/null
+++ b/src/gallium/auxiliary/indices/Makefile
@@ -0,0 +1,16 @@
+TOP = ../../../..
+include $(TOP)/configs/current
+
+LIBNAME = indices
+
+C_SOURCES = \
+ u_indices_gen.c
+
+include ../../Makefile.template
+
+u_indices_gen.c: u_indices_gen.py
+ python $< > $@
+
+
+symlinks:
+
diff --git a/src/gallium/auxiliary/indices/SConscript b/src/gallium/auxiliary/indices/SConscript
new file mode 100644
index 0000000000..65a43a9f64
--- /dev/null
+++ b/src/gallium/auxiliary/indices/SConscript
@@ -0,0 +1,17 @@
+Import('*')
+
+env.CodeGenerate(
+ target = 'u_indices_gen.c',
+ script = 'u_indices_gen.py',
+ source = [],
+ command = 'python $SCRIPT > $TARGET'
+)
+
+indices = env.ConvenienceLibrary(
+ target = 'indices',
+ source = [
+# 'u_indices.c',
+ 'u_indices_gen.c',
+ ])
+
+auxiliaries.insert(0, indices)
diff --git a/src/gallium/auxiliary/indices/u_indices.c b/src/gallium/auxiliary/indices/u_indices.c
new file mode 100644
index 0000000000..0cf7d88653
--- /dev/null
+++ b/src/gallium/auxiliary/indices/u_indices.c
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * 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
+ * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "u_indices.h"
+#include "u_indices_priv.h"
+
+static void translate_memcpy_ushort( const void *in,
+ unsigned nr,
+ void *out )
+{
+ memcpy(out, in, nr*sizeof(short));
+}
+
+static void translate_memcpy_uint( const void *in,
+ unsigned nr,
+ void *out )
+{
+ memcpy(out, in, nr*sizeof(int));
+}
+
+
+int u_index_translator( unsigned hw_mask,
+ unsigned prim,
+ unsigned in_index_size,
+ unsigned nr,
+ unsigned in_pv,
+ unsigned out_pv,
+ unsigned *out_prim,
+ unsigned *out_index_size,
+ unsigned *out_nr,
+ u_translate_func *out_translate )
+{
+ unsigned in_idx;
+ unsigned out_idx;
+ int ret = U_TRANSLATE_NORMAL;
+
+ u_index_init();
+
+ in_idx = in_size_idx(in_index_size);
+ *out_index_size = (in_index_size == 4) ? 4 : 2;
+ out_idx = out_size_idx(*out_index_size);
+
+ if ((hw_mask & (1<<prim)) &&
+ in_index_size == *out_index_size &&
+ in_pv == out_pv)
+ {
+ if (in_index_size == 4)
+ *out_translate = translate_memcpy_uint;
+ else
+ *out_translate = translate_memcpy_ushort;
+
+ *out_prim = prim;
+ *out_nr = nr;
+
+ return U_TRANSLATE_MEMCPY;
+ }
+ else {
+ switch (prim) {
+ case PIPE_PRIM_POINTS:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_POINTS;
+ *out_nr = nr;
+ break;
+
+ case PIPE_PRIM_LINES:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = nr;
+ break;
+
+ case PIPE_PRIM_LINE_STRIP:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = (nr - 1) * 2;
+ break;
+
+ case PIPE_PRIM_LINE_LOOP:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = nr * 2;
+ break;
+
+ case PIPE_PRIM_TRIANGLES:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = nr;
+ break;
+
+ case PIPE_PRIM_TRIANGLE_STRIP:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ break;
+
+ case PIPE_PRIM_TRIANGLE_FAN:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ break;
+
+ case PIPE_PRIM_QUADS:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr / 4) * 6;
+ break;
+
+ case PIPE_PRIM_QUAD_STRIP:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ break;
+
+ case PIPE_PRIM_POLYGON:
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ break;
+
+ default:
+ assert(0);
+ *out_translate = translate[in_idx][out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_POINTS;
+ *out_nr = nr;
+ return U_TRANSLATE_ERROR;
+ }
+ }
+
+ return ret;
+}
+
+
+
+
+
+int u_index_generator( unsigned hw_mask,
+ unsigned prim,
+ unsigned start,
+ unsigned nr,
+ unsigned in_pv,
+ unsigned out_pv,
+ unsigned *out_prim,
+ unsigned *out_index_size,
+ unsigned *out_nr,
+ u_generate_func *out_generate )
+
+{
+ unsigned out_idx;
+
+ u_index_init();
+
+ *out_index_size = ((start + nr) > 0xfffe) ? 4 : 2;
+ out_idx = out_size_idx(*out_index_size);
+
+ if ((hw_mask & (1<<prim)) &&
+ (in_pv == out_pv)) {
+
+ *out_generate = generate[out_idx][in_pv][out_pv][PIPE_PRIM_POINTS];
+ *out_prim = prim;
+ *out_nr = nr;
+ return U_GENERATE_LINEAR;
+ }
+ else {
+ switch (prim) {
+ case PIPE_PRIM_POINTS:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_POINTS;
+ *out_nr = nr;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_LINES:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = nr;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_LINE_STRIP:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = (nr - 1) * 2;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_LINE_LOOP:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_LINES;
+ *out_nr = nr * 2;
+ return U_GENERATE_ONE_OFF;
+
+ case PIPE_PRIM_TRIANGLES:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = nr;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_TRIANGLE_STRIP:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_TRIANGLE_FAN:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_QUADS:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr / 4) * 6;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_QUAD_STRIP:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ return U_GENERATE_REUSABLE;
+
+ case PIPE_PRIM_POLYGON:
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_TRIANGLES;
+ *out_nr = (nr - 2) * 3;
+ return U_GENERATE_REUSABLE;
+
+ default:
+ assert(0);
+ *out_generate = generate[out_idx][in_pv][out_pv][prim];
+ *out_prim = PIPE_PRIM_POINTS;
+ *out_nr = nr;
+ return U_TRANSLATE_ERROR;
+ }
+ }
+}
diff --git a/src/gallium/auxiliary/indices/u_indices.h b/src/gallium/auxiliary/indices/u_indices.h
new file mode 100644
index 0000000000..abf5a3037d
--- /dev/null
+++ b/src/gallium/auxiliary/indices/u_indices.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * 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.
+ */
+
+#ifndef U_INDICES_H
+#define U_INDICES_H
+
+#include "pipe/p_compiler.h"
+
+#define PV_FIRST 0
+#define PV_LAST 1
+#define PV_COUNT 2
+
+typedef void (*u_translate_func)( const void *in,
+ unsigned nr,
+ void *out );
+
+typedef void (*u_generate_func)( unsigned nr,
+ void *out );
+
+
+/* Return codes describe the translate/generate operation. Caller may
+ * be able to reuse translated indices under some circumstances.
+ */
+#define U_TRANSLATE_ERROR -1
+#define U_TRANSLATE_NORMAL 1
+#define U_TRANSLATE_MEMCPY 2
+#define U_GENERATE_LINEAR 3
+#define U_GENERATE_REUSABLE 4
+#define U_GENERATE_ONE_OFF 5
+
+
+void u_index_init( void );
+
+int u_index_translator( unsigned hw_mask,
+ unsigned prim,
+ unsigned in_index_size,
+ unsigned nr,
+ unsigned in_pv, /* API */
+ unsigned out_pv, /* hardware */
+ unsigned *out_prim,
+ unsigned *out_index_size,
+ unsigned *out_nr,
+ u_translate_func *out_translate );
+
+/* Note that even when generating it is necessary to know what the
+ * API's PV is, as the indices generated will depend on whether it is
+ * the same as hardware or not, and in the case of triangle strips,
+ * whether it is first or last.
+ */
+int u_index_generator( unsigned hw_mask,
+ unsigned prim,
+ unsigned start,
+ unsigned nr,
+ unsigned in_pv, /* API */
+ unsigned out_pv, /* hardware */
+ unsigned *out_prim,
+ unsigned *out_index_size,
+ unsigned *out_nr,
+ u_generate_func *out_generate );
+
+
+#endif
diff --git a/src/gallium/auxiliary/indices/u_indices_gen.c b/src/gallium/auxiliary/indices/u_indices_gen.c
new file mode 100644
index 0000000000..4c05b3eedb
--- /dev/null
+++ b/src/gallium/auxiliary/indices/u_indices_gen.c
@@ -0,0 +1,5129 @@
+/* File automatically generated by indices.py */
+
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * 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
+ * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+
+/**
+ * @file
+ * Functions to translate and generate index lists
+ */
+
+#include "indices/u_indices.h"
+#include "indices/u_indices_priv.h"
+#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
+#include "pipe/p_defines.h"
+#include "util/u_memory.h"
+
+
+static unsigned out_size_idx( unsigned index_size )
+{
+ switch (index_size) {
+ case 4: return OUT_UINT;
+ case 2: return OUT_USHORT;
+ default: assert(0); return OUT_USHORT;
+ }
+}
+
+static unsigned in_size_idx( unsigned index_size )
+{
+ switch (index_size) {
+ case 4: return IN_UINT;
+ case 2: return IN_USHORT;
+ case 1: return IN_UBYTE;
+ default: assert(0); return IN_UBYTE;
+ }
+}
+
+
+static u_translate_func translate[IN_COUNT][OUT_COUNT][PV_COUNT][PV_COUNT][PRIM_COUNT];
+static u_generate_func generate[OUT_COUNT][PV_COUNT][PV_COUNT][PRIM_COUNT];
+
+
+
+static void generate_points_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)(i);
+ }
+}
+static void generate_lines_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)(i);
+ (out+i)[1] = (ushort)(i+1);
+ }
+}
+static void generate_linestrip_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(i+1);
+ }
+}
+static void generate_lineloop_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(i+1);
+ }
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(0);
+}
+static void generate_tris_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)(i);
+ (out+i)[1] = (ushort)(i+1);
+ (out+i)[2] = (ushort)(i+2);
+ }
+}
+static void generate_tristrip_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(i+1+(i&1));
+ (out+j)[2] = (ushort)(i+2-(i&1));
+ }
+}
+static void generate_trifan_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i+1);
+ (out+j)[2] = (ushort)(i+2);
+ }
+}
+static void generate_quads_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)(i+0);
+ (out+j+0)[1] = (ushort)(i+1);
+ (out+j+0)[2] = (ushort)(i+3);
+ (out+j+3)[0] = (ushort)(i+1);
+ (out+j+3)[1] = (ushort)(i+2);
+ (out+j+3)[2] = (ushort)(i+3);
+ }
+}
+static void generate_quadstrip_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)(i+2);
+ (out+j+0)[1] = (ushort)(i+0);
+ (out+j+0)[2] = (ushort)(i+3);
+ (out+j+3)[0] = (ushort)(i+0);
+ (out+j+3)[1] = (ushort)(i+1);
+ (out+j+3)[2] = (ushort)(i+3);
+ }
+}
+static void generate_polygon_ushort_first2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i+1);
+ (out+j)[2] = (ushort)(i+2);
+ }
+}
+static void generate_points_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)(i);
+ }
+}
+static void generate_lines_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)(i+1);
+ (out+i)[1] = (ushort)(i);
+ }
+}
+static void generate_linestrip_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i);
+ }
+}
+static void generate_lineloop_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i);
+ }
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i);
+}
+static void generate_tris_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)(i+1);
+ (out+i)[1] = (ushort)(i+2);
+ (out+i)[2] = (ushort)(i);
+ }
+}
+static void generate_tristrip_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+1+(i&1));
+ (out+j)[1] = (ushort)(i+2-(i&1));
+ (out+j)[2] = (ushort)(i);
+ }
+}
+static void generate_trifan_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i+2);
+ (out+j)[2] = (ushort)(0);
+ }
+}
+static void generate_quads_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)(i+1);
+ (out+j+0)[1] = (ushort)(i+3);
+ (out+j+0)[2] = (ushort)(i+0);
+ (out+j+3)[0] = (ushort)(i+2);
+ (out+j+3)[1] = (ushort)(i+3);
+ (out+j+3)[2] = (ushort)(i+1);
+ }
+}
+static void generate_quadstrip_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)(i+0);
+ (out+j+0)[1] = (ushort)(i+3);
+ (out+j+0)[2] = (ushort)(i+2);
+ (out+j+3)[0] = (ushort)(i+1);
+ (out+j+3)[1] = (ushort)(i+3);
+ (out+j+3)[2] = (ushort)(i+0);
+ }
+}
+static void generate_polygon_ushort_first2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i+2);
+ (out+j)[2] = (ushort)(0);
+ }
+}
+static void generate_points_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)(i);
+ }
+}
+static void generate_lines_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)(i+1);
+ (out+i)[1] = (ushort)(i);
+ }
+}
+static void generate_linestrip_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i);
+ }
+}
+static void generate_lineloop_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i);
+ }
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i);
+}
+static void generate_tris_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)(i+2);
+ (out+i)[1] = (ushort)(i);
+ (out+i)[2] = (ushort)(i+1);
+ }
+}
+static void generate_tristrip_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+2);
+ (out+j)[1] = (ushort)(i+(i&1));
+ (out+j)[2] = (ushort)(i+1-(i&1));
+ }
+}
+static void generate_trifan_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+2);
+ (out+j)[1] = (ushort)(0);
+ (out+j)[2] = (ushort)(i+1);
+ }
+}
+static void generate_quads_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)(i+3);
+ (out+j+0)[1] = (ushort)(i+0);
+ (out+j+0)[2] = (ushort)(i+1);
+ (out+j+3)[0] = (ushort)(i+3);
+ (out+j+3)[1] = (ushort)(i+1);
+ (out+j+3)[2] = (ushort)(i+2);
+ }
+}
+static void generate_quadstrip_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)(i+3);
+ (out+j+0)[1] = (ushort)(i+2);
+ (out+j+0)[2] = (ushort)(i+0);
+ (out+j+3)[0] = (ushort)(i+3);
+ (out+j+3)[1] = (ushort)(i+0);
+ (out+j+3)[2] = (ushort)(i+1);
+ }
+}
+static void generate_polygon_ushort_last2first(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i+1);
+ (out+j)[2] = (ushort)(i+2);
+ }
+}
+static void generate_points_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)(i);
+ }
+}
+static void generate_lines_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)(i);
+ (out+i)[1] = (ushort)(i+1);
+ }
+}
+static void generate_linestrip_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(i+1);
+ }
+}
+static void generate_lineloop_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(i+1);
+ }
+ (out+j)[0] = (ushort)(i);
+ (out+j)[1] = (ushort)(0);
+}
+static void generate_tris_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)(i);
+ (out+i)[1] = (ushort)(i+1);
+ (out+i)[2] = (ushort)(i+2);
+ }
+}
+static void generate_tristrip_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+(i&1));
+ (out+j)[1] = (ushort)(i+1-(i&1));
+ (out+j)[2] = (ushort)(i+2);
+ }
+}
+static void generate_trifan_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(0);
+ (out+j)[1] = (ushort)(i+1);
+ (out+j)[2] = (ushort)(i+2);
+ }
+}
+static void generate_quads_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)(i+0);
+ (out+j+0)[1] = (ushort)(i+1);
+ (out+j+0)[2] = (ushort)(i+3);
+ (out+j+3)[0] = (ushort)(i+1);
+ (out+j+3)[1] = (ushort)(i+2);
+ (out+j+3)[2] = (ushort)(i+3);
+ }
+}
+static void generate_quadstrip_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)(i+2);
+ (out+j+0)[1] = (ushort)(i+0);
+ (out+j+0)[2] = (ushort)(i+3);
+ (out+j+3)[0] = (ushort)(i+0);
+ (out+j+3)[1] = (ushort)(i+1);
+ (out+j+3)[2] = (ushort)(i+3);
+ }
+}
+static void generate_polygon_ushort_last2last(
+ unsigned nr,
+ void *_out )
+{
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)(i+1);
+ (out+j)[1] = (ushort)(i+2);
+ (out+j)[2] = (ushort)(0);
+ }
+}
+static void generate_points_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)(i);
+ }
+}
+static void generate_lines_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)(i);
+ (out+i)[1] = (uint)(i+1);
+ }
+}
+static void generate_linestrip_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(i+1);
+ }
+}
+static void generate_lineloop_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(i+1);
+ }
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(0);
+}
+static void generate_tris_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)(i);
+ (out+i)[1] = (uint)(i+1);
+ (out+i)[2] = (uint)(i+2);
+ }
+}
+static void generate_tristrip_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(i+1+(i&1));
+ (out+j)[2] = (uint)(i+2-(i&1));
+ }
+}
+static void generate_trifan_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i+1);
+ (out+j)[2] = (uint)(i+2);
+ }
+}
+static void generate_quads_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)(i+0);
+ (out+j+0)[1] = (uint)(i+1);
+ (out+j+0)[2] = (uint)(i+3);
+ (out+j+3)[0] = (uint)(i+1);
+ (out+j+3)[1] = (uint)(i+2);
+ (out+j+3)[2] = (uint)(i+3);
+ }
+}
+static void generate_quadstrip_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)(i+2);
+ (out+j+0)[1] = (uint)(i+0);
+ (out+j+0)[2] = (uint)(i+3);
+ (out+j+3)[0] = (uint)(i+0);
+ (out+j+3)[1] = (uint)(i+1);
+ (out+j+3)[2] = (uint)(i+3);
+ }
+}
+static void generate_polygon_uint_first2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i+1);
+ (out+j)[2] = (uint)(i+2);
+ }
+}
+static void generate_points_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)(i);
+ }
+}
+static void generate_lines_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)(i+1);
+ (out+i)[1] = (uint)(i);
+ }
+}
+static void generate_linestrip_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i);
+ }
+}
+static void generate_lineloop_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i);
+ }
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i);
+}
+static void generate_tris_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)(i+1);
+ (out+i)[1] = (uint)(i+2);
+ (out+i)[2] = (uint)(i);
+ }
+}
+static void generate_tristrip_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+1+(i&1));
+ (out+j)[1] = (uint)(i+2-(i&1));
+ (out+j)[2] = (uint)(i);
+ }
+}
+static void generate_trifan_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i+2);
+ (out+j)[2] = (uint)(0);
+ }
+}
+static void generate_quads_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)(i+1);
+ (out+j+0)[1] = (uint)(i+3);
+ (out+j+0)[2] = (uint)(i+0);
+ (out+j+3)[0] = (uint)(i+2);
+ (out+j+3)[1] = (uint)(i+3);
+ (out+j+3)[2] = (uint)(i+1);
+ }
+}
+static void generate_quadstrip_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)(i+0);
+ (out+j+0)[1] = (uint)(i+3);
+ (out+j+0)[2] = (uint)(i+2);
+ (out+j+3)[0] = (uint)(i+1);
+ (out+j+3)[1] = (uint)(i+3);
+ (out+j+3)[2] = (uint)(i+0);
+ }
+}
+static void generate_polygon_uint_first2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i+2);
+ (out+j)[2] = (uint)(0);
+ }
+}
+static void generate_points_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)(i);
+ }
+}
+static void generate_lines_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)(i+1);
+ (out+i)[1] = (uint)(i);
+ }
+}
+static void generate_linestrip_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i);
+ }
+}
+static void generate_lineloop_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i);
+ }
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i);
+}
+static void generate_tris_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)(i+2);
+ (out+i)[1] = (uint)(i);
+ (out+i)[2] = (uint)(i+1);
+ }
+}
+static void generate_tristrip_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+2);
+ (out+j)[1] = (uint)(i+(i&1));
+ (out+j)[2] = (uint)(i+1-(i&1));
+ }
+}
+static void generate_trifan_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+2);
+ (out+j)[1] = (uint)(0);
+ (out+j)[2] = (uint)(i+1);
+ }
+}
+static void generate_quads_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)(i+3);
+ (out+j+0)[1] = (uint)(i+0);
+ (out+j+0)[2] = (uint)(i+1);
+ (out+j+3)[0] = (uint)(i+3);
+ (out+j+3)[1] = (uint)(i+1);
+ (out+j+3)[2] = (uint)(i+2);
+ }
+}
+static void generate_quadstrip_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)(i+3);
+ (out+j+0)[1] = (uint)(i+2);
+ (out+j+0)[2] = (uint)(i+0);
+ (out+j+3)[0] = (uint)(i+3);
+ (out+j+3)[1] = (uint)(i+0);
+ (out+j+3)[2] = (uint)(i+1);
+ }
+}
+static void generate_polygon_uint_last2first(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i+1);
+ (out+j)[2] = (uint)(i+2);
+ }
+}
+static void generate_points_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)(i);
+ }
+}
+static void generate_lines_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)(i);
+ (out+i)[1] = (uint)(i+1);
+ }
+}
+static void generate_linestrip_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(i+1);
+ }
+}
+static void generate_lineloop_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(i+1);
+ }
+ (out+j)[0] = (uint)(i);
+ (out+j)[1] = (uint)(0);
+}
+static void generate_tris_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)(i);
+ (out+i)[1] = (uint)(i+1);
+ (out+i)[2] = (uint)(i+2);
+ }
+}
+static void generate_tristrip_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+(i&1));
+ (out+j)[1] = (uint)(i+1-(i&1));
+ (out+j)[2] = (uint)(i+2);
+ }
+}
+static void generate_trifan_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(0);
+ (out+j)[1] = (uint)(i+1);
+ (out+j)[2] = (uint)(i+2);
+ }
+}
+static void generate_quads_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)(i+0);
+ (out+j+0)[1] = (uint)(i+1);
+ (out+j+0)[2] = (uint)(i+3);
+ (out+j+3)[0] = (uint)(i+1);
+ (out+j+3)[1] = (uint)(i+2);
+ (out+j+3)[2] = (uint)(i+3);
+ }
+}
+static void generate_quadstrip_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)(i+2);
+ (out+j+0)[1] = (uint)(i+0);
+ (out+j+0)[2] = (uint)(i+3);
+ (out+j+3)[0] = (uint)(i+0);
+ (out+j+3)[1] = (uint)(i+1);
+ (out+j+3)[2] = (uint)(i+3);
+ }
+}
+static void generate_polygon_uint_last2last(
+ unsigned nr,
+ void *_out )
+{
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)(i+1);
+ (out+j)[1] = (uint)(i+2);
+ (out+j)[2] = (uint)(0);
+ }
+}
+static void translate_points_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1+(i&1)];
+ (out+j)[2] = (ushort)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_ubyte2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i+2];
+ (out+i)[2] = (ushort)in[i];
+ }
+}
+static void translate_tristrip_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1+(i&1)];
+ (out+j)[1] = (ushort)in[i+2-(i&1)];
+ (out+j)[2] = (ushort)in[i];
+ }
+}
+static void translate_trifan_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_quads_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+1];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+2];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quadstrip_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+2];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+0];
+ }
+}
+static void translate_polygon_ubyte2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+2];
+ (out+i)[1] = (ushort)in[i];
+ (out+i)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_tristrip_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[i+(i&1)];
+ (out+j)[2] = (ushort)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[0];
+ (out+j)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quads_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+1];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quadstrip_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+2];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+0];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_polygon_ubyte2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+(i&1)];
+ (out+j)[1] = (ushort)in[i+1-(i&1)];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_trifan_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_ubyte2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1+(i&1)];
+ (out+j)[2] = (uint)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_ubyte2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i+2];
+ (out+i)[2] = (uint)in[i];
+ }
+}
+static void translate_tristrip_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1+(i&1)];
+ (out+j)[1] = (uint)in[i+2-(i&1)];
+ (out+j)[2] = (uint)in[i];
+ }
+}
+static void translate_trifan_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_quads_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+1];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+2];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quadstrip_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+2];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+0];
+ }
+}
+static void translate_polygon_ubyte2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_points_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+2];
+ (out+i)[1] = (uint)in[i];
+ (out+i)[2] = (uint)in[i+1];
+ }
+}
+static void translate_tristrip_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[i+(i&1)];
+ (out+j)[2] = (uint)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[0];
+ (out+j)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quads_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+1];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quadstrip_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+2];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+0];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_polygon_ubyte2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+(i&1)];
+ (out+j)[1] = (uint)in[i+1-(i&1)];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_trifan_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_ubyte2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ubyte*in = (const ubyte*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_points_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1+(i&1)];
+ (out+j)[2] = (ushort)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_ushort2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i+2];
+ (out+i)[2] = (ushort)in[i];
+ }
+}
+static void translate_tristrip_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1+(i&1)];
+ (out+j)[1] = (ushort)in[i+2-(i&1)];
+ (out+j)[2] = (ushort)in[i];
+ }
+}
+static void translate_trifan_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_quads_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+1];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+2];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quadstrip_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+2];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+0];
+ }
+}
+static void translate_polygon_ushort2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+2];
+ (out+i)[1] = (ushort)in[i];
+ (out+i)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_tristrip_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[i+(i&1)];
+ (out+j)[2] = (ushort)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[0];
+ (out+j)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quads_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+1];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quadstrip_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+2];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+0];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_polygon_ushort2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+(i&1)];
+ (out+j)[1] = (ushort)in[i+1-(i&1)];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_trifan_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_ushort2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1+(i&1)];
+ (out+j)[2] = (uint)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_ushort2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i+2];
+ (out+i)[2] = (uint)in[i];
+ }
+}
+static void translate_tristrip_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1+(i&1)];
+ (out+j)[1] = (uint)in[i+2-(i&1)];
+ (out+j)[2] = (uint)in[i];
+ }
+}
+static void translate_trifan_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_quads_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+1];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+2];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quadstrip_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+2];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+0];
+ }
+}
+static void translate_polygon_ushort2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_points_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+2];
+ (out+i)[1] = (uint)in[i];
+ (out+i)[2] = (uint)in[i+1];
+ }
+}
+static void translate_tristrip_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[i+(i&1)];
+ (out+j)[2] = (uint)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[0];
+ (out+j)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quads_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+1];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quadstrip_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+2];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+0];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_polygon_ushort2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+(i&1)];
+ (out+j)[1] = (uint)in[i+1-(i&1)];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_trifan_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_ushort2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const ushort*in = (const ushort*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_points_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1+(i&1)];
+ (out+j)[2] = (ushort)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_uint2ushort_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i+2];
+ (out+i)[2] = (ushort)in[i];
+ }
+}
+static void translate_tristrip_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1+(i&1)];
+ (out+j)[1] = (ushort)in[i+2-(i&1)];
+ (out+j)[2] = (ushort)in[i];
+ }
+}
+static void translate_trifan_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_quads_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+1];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+2];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quadstrip_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+3];
+ (out+j+0)[2] = (ushort)in[i+2];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+3];
+ (out+j+3)[2] = (ushort)in[i+0];
+ }
+}
+static void translate_polygon_uint2ushort_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i+1];
+ (out+i)[1] = (ushort)in[i];
+ }
+}
+static void translate_linestrip_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+}
+static void translate_lineloop_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i];
+ }
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i];
+}
+static void translate_tris_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i+2];
+ (out+i)[1] = (ushort)in[i];
+ (out+i)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_tristrip_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[i+(i&1)];
+ (out+j)[2] = (ushort)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+2];
+ (out+j)[1] = (ushort)in[0];
+ (out+j)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_quads_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+1];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quadstrip_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+3];
+ (out+j+0)[1] = (ushort)in[i+2];
+ (out+j+0)[2] = (ushort)in[i+0];
+ (out+j+3)[0] = (ushort)in[i+3];
+ (out+j+3)[1] = (ushort)in[i+0];
+ (out+j+3)[2] = (ushort)in[i+1];
+ }
+}
+static void translate_polygon_uint2ushort_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_points_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (ushort)in[i];
+ }
+}
+static void translate_lines_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_linestrip_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+}
+static void translate_lineloop_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[i+1];
+ }
+ (out+j)[0] = (ushort)in[i];
+ (out+j)[1] = (ushort)in[0];
+}
+static void translate_tris_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (ushort)in[i];
+ (out+i)[1] = (ushort)in[i+1];
+ (out+i)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_tristrip_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+(i&1)];
+ (out+j)[1] = (ushort)in[i+1-(i&1)];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_trifan_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[0];
+ (out+j)[1] = (ushort)in[i+1];
+ (out+j)[2] = (ushort)in[i+2];
+ }
+}
+static void translate_quads_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (ushort)in[i+0];
+ (out+j+0)[1] = (ushort)in[i+1];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+1];
+ (out+j+3)[1] = (ushort)in[i+2];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_quadstrip_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (ushort)in[i+2];
+ (out+j+0)[1] = (ushort)in[i+0];
+ (out+j+0)[2] = (ushort)in[i+3];
+ (out+j+3)[0] = (ushort)in[i+0];
+ (out+j+3)[1] = (ushort)in[i+1];
+ (out+j+3)[2] = (ushort)in[i+3];
+ }
+}
+static void translate_polygon_uint2ushort_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ ushort *out = (ushort*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (ushort)in[i+1];
+ (out+j)[1] = (ushort)in[i+2];
+ (out+j)[2] = (ushort)in[0];
+ }
+}
+static void translate_points_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1+(i&1)];
+ (out+j)[2] = (uint)in[i+2-(i&1)];
+ }
+}
+static void translate_trifan_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_uint2uint_first2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i+2];
+ (out+i)[2] = (uint)in[i];
+ }
+}
+static void translate_tristrip_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1+(i&1)];
+ (out+j)[1] = (uint)in[i+2-(i&1)];
+ (out+j)[2] = (uint)in[i];
+ }
+}
+static void translate_trifan_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_quads_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+1];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+2];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quadstrip_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+3];
+ (out+j+0)[2] = (uint)in[i+2];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+3];
+ (out+j+3)[2] = (uint)in[i+0];
+ }
+}
+static void translate_polygon_uint2uint_first2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+static void translate_points_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i+1];
+ (out+i)[1] = (uint)in[i];
+ }
+}
+static void translate_linestrip_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+}
+static void translate_lineloop_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i];
+ }
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i];
+}
+static void translate_tris_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i+2];
+ (out+i)[1] = (uint)in[i];
+ (out+i)[2] = (uint)in[i+1];
+ }
+}
+static void translate_tristrip_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[i+(i&1)];
+ (out+j)[2] = (uint)in[i+1-(i&1)];
+ }
+}
+static void translate_trifan_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+2];
+ (out+j)[1] = (uint)in[0];
+ (out+j)[2] = (uint)in[i+1];
+ }
+}
+static void translate_quads_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+1];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quadstrip_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+3];
+ (out+j+0)[1] = (uint)in[i+2];
+ (out+j+0)[2] = (uint)in[i+0];
+ (out+j+3)[0] = (uint)in[i+3];
+ (out+j+3)[1] = (uint)in[i+0];
+ (out+j+3)[2] = (uint)in[i+1];
+ }
+}
+static void translate_polygon_uint2uint_last2first(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_points_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i++) {
+ (out+i)[0] = (uint)in[i];
+ }
+}
+static void translate_lines_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=2) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ }
+}
+static void translate_linestrip_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+}
+static void translate_lineloop_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr - 2; j+=2, i++) {
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[i+1];
+ }
+ (out+j)[0] = (uint)in[i];
+ (out+j)[1] = (uint)in[0];
+}
+static void translate_tris_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (i = 0; i < nr; i+=3) {
+ (out+i)[0] = (uint)in[i];
+ (out+i)[1] = (uint)in[i+1];
+ (out+i)[2] = (uint)in[i+2];
+ }
+}
+static void translate_tristrip_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+(i&1)];
+ (out+j)[1] = (uint)in[i+1-(i&1)];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_trifan_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[0];
+ (out+j)[1] = (uint)in[i+1];
+ (out+j)[2] = (uint)in[i+2];
+ }
+}
+static void translate_quads_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=4) {
+ (out+j+0)[0] = (uint)in[i+0];
+ (out+j+0)[1] = (uint)in[i+1];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+1];
+ (out+j+3)[1] = (uint)in[i+2];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_quadstrip_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=6, i+=2) {
+ (out+j+0)[0] = (uint)in[i+2];
+ (out+j+0)[1] = (uint)in[i+0];
+ (out+j+0)[2] = (uint)in[i+3];
+ (out+j+3)[0] = (uint)in[i+0];
+ (out+j+3)[1] = (uint)in[i+1];
+ (out+j+3)[2] = (uint)in[i+3];
+ }
+}
+static void translate_polygon_uint2uint_last2last(
+ const void * _in,
+ unsigned nr,
+ void *_out )
+{
+ const uint*in = (const uint*)_in;
+ uint *out = (uint*)_out;
+ unsigned i, j;
+ (void)j;
+ for (j = i = 0; j < nr; j+=3, i++) {
+ (out+j)[0] = (uint)in[i+1];
+ (out+j)[1] = (uint)in[i+2];
+ (out+j)[2] = (uint)in[0];
+ }
+}
+void u_index_init( void )
+{
+ static int firsttime = 1;
+ if (!firsttime) return;
+ firsttime = 0;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = generate_points_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = generate_lines_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = generate_tris_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = generate_quads_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = generate_polygon_ushort_first2first;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = generate_points_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = generate_lines_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = generate_tris_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = generate_quads_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort_first2last;
+generate[OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = generate_polygon_ushort_first2last;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = generate_points_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = generate_lines_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = generate_tris_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = generate_quads_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = generate_polygon_ushort_last2first;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = generate_points_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = generate_lines_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = generate_tris_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = generate_quads_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort_last2last;
+generate[OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = generate_polygon_ushort_last2last;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = generate_points_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = generate_lines_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = generate_tris_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = generate_quads_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = generate_polygon_uint_first2first;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = generate_points_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = generate_lines_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = generate_tris_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = generate_quads_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint_first2last;
+generate[OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = generate_polygon_uint_first2last;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = generate_points_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = generate_lines_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = generate_tris_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = generate_quads_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = generate_polygon_uint_last2first;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = generate_points_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = generate_lines_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = generate_linestrip_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = generate_lineloop_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = generate_tris_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = generate_quads_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint_last2last;
+generate[OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = generate_polygon_uint_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort_first2first;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort_first2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort_last2first;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint_first2first;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint_first2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint_last2first;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint_last2last;
+translate[IN_UBYTE][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort_first2first;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort_first2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort_last2first;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort_last2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint_first2first;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint_first2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint_last2first;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint_last2last;
+translate[IN_USHORT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint_last2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort_first2first;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort_first2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort_last2first;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort_last2last;
+translate[IN_UINT][OUT_USHORT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort_last2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint_first2first;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_FIRST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint_first2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POINTS] = translate_points_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINES] = translate_lines_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUADS] = translate_quads_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_FIRST][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint_last2first;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POINTS] = translate_points_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINES] = translate_lines_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_STRIP] = translate_linestrip_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_LINE_LOOP] = translate_lineloop_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUADS] = translate_quads_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint_last2last;
+translate[IN_UINT][OUT_UINT][PV_LAST][PV_LAST][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint_last2last;
+}
+#include "indices/u_indices.c"
diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py
new file mode 100644
index 0000000000..0dc58d0cd0
--- /dev/null
+++ b/src/gallium/auxiliary/indices/u_indices_gen.py
@@ -0,0 +1,319 @@
+#!/usr/bin/env python
+copyright = '''
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * 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
+ * VMWARE 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.
+ */
+'''
+
+GENERATE, UBYTE, USHORT, UINT = 'generate', 'ubyte', 'ushort', 'uint'
+FIRST, LAST = 'first', 'last'
+
+INTYPES = (GENERATE, UBYTE, USHORT, UINT)
+OUTTYPES = (USHORT, UINT)
+PVS=(FIRST, LAST)
+PRIMS=('points',
+ 'lines',
+ 'linestrip',
+ 'lineloop',
+ 'tris',
+ 'trifan',
+ 'tristrip',
+ 'quads',
+ 'quadstrip',
+ 'polygon')
+
+LONGPRIMS=('PIPE_PRIM_POINTS',
+ 'PIPE_PRIM_LINES',
+ 'PIPE_PRIM_LINE_STRIP',
+ 'PIPE_PRIM_LINE_LOOP',
+ 'PIPE_PRIM_TRIANGLES',
+ 'PIPE_PRIM_TRIANGLE_FAN',
+ 'PIPE_PRIM_TRIANGLE_STRIP',
+ 'PIPE_PRIM_QUADS',
+ 'PIPE_PRIM_QUAD_STRIP',
+ 'PIPE_PRIM_POLYGON')
+
+longprim = dict(zip(PRIMS, LONGPRIMS))
+intype_idx = dict(ubyte='IN_UBYTE', ushort='IN_USHORT', uint='IN_UINT')
+outtype_idx = dict(ushort='OUT_USHORT', uint='OUT_UINT')
+pv_idx = dict(first='PV_FIRST', last='PV_LAST')
+
+
+def prolog():
+ print '''/* File automatically generated by indices.py */'''
+ print copyright
+ print r'''
+
+/**
+ * @file
+ * Functions to translate and generate index lists
+ */
+
+#include "indices/u_indices.h"
+#include "indices/u_indices_priv.h"
+#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
+#include "pipe/p_defines.h"
+#include "util/u_memory.h"
+
+
+static unsigned out_size_idx( unsigned index_size )
+{
+ switch (index_size) {
+ case 4: return OUT_UINT;
+ case 2: return OUT_USHORT;
+ default: assert(0); return OUT_USHORT;
+ }
+}
+
+static unsigned in_size_idx( unsigned index_size )
+{
+ switch (index_size) {
+ case 4: return IN_UINT;
+ case 2: return IN_USHORT;
+ case 1: return IN_UBYTE;
+ default: assert(0); return IN_UBYTE;
+ }
+}
+
+
+static u_translate_func translate[IN_COUNT][OUT_COUNT][PV_COUNT][PV_COUNT][PRIM_COUNT];
+static u_generate_func generate[OUT_COUNT][PV_COUNT][PV_COUNT][PRIM_COUNT];
+
+
+'''
+
+def vert( intype, outtype, v0 ):
+ if intype == GENERATE:
+ return '(' + outtype + ')(' + v0 + ')'
+ else:
+ return '(' + outtype + ')in[' + v0 + ']'
+
+def point( intype, outtype, ptr, v0 ):
+ print ' (' + ptr + ')[0] = ' + vert( intype, outtype, v0 ) + ';'
+
+def line( intype, outtype, ptr, v0, v1 ):
+ print ' (' + ptr + ')[0] = ' + vert( intype, outtype, v0 ) + ';'
+ print ' (' + ptr + ')[1] = ' + vert( intype, outtype, v1 ) + ';'
+
+def tri( intype, outtype, ptr, v0, v1, v2 ):
+ print ' (' + ptr + ')[0] = ' + vert( intype, outtype, v0 ) + ';'
+ print ' (' + ptr + ')[1] = ' + vert( intype, outtype, v1 ) + ';'
+ print ' (' + ptr + ')[2] = ' + vert( intype, outtype, v2 ) + ';'
+
+def do_point( intype, outtype, ptr, v0 ):
+ point( intype, outtype, ptr, v0 )
+
+def do_line( intype, outtype, ptr, v0, v1, inpv, outpv ):
+ if inpv == outpv:
+ line( intype, outtype, ptr, v0, v1 )
+ else:
+ line( intype, outtype, ptr, v1, v0 )
+
+def do_tri( intype, outtype, ptr, v0, v1, v2, inpv, outpv ):
+ if inpv == outpv:
+ tri( intype, outtype, ptr, v0, v1, v2 )
+ else:
+ if inpv == FIRST:
+ tri( intype, outtype, ptr, v1, v2, v0 )
+ else:
+ tri( intype, outtype, ptr, v2, v0, v1 )
+
+def do_quad( intype, outtype, ptr, v0, v1, v2, v3, inpv, outpv ):
+ do_tri( intype, outtype, ptr+'+0', v0, v1, v3, inpv, outpv );
+ do_tri( intype, outtype, ptr+'+3', v1, v2, v3, inpv, outpv );
+
+def name(intype, outtype, inpv, outpv, prim):
+ if intype == GENERATE:
+ return 'generate_' + prim + '_' + outtype + '_' + inpv + '2' + outpv
+ else:
+ return 'translate_' + prim + '_' + intype + '2' + outtype + '_' + inpv + '2' + outpv
+
+def preamble(intype, outtype, inpv, outpv, prim):
+ print 'static void ' + name( intype, outtype, inpv, outpv, prim ) + '('
+ if intype != GENERATE:
+ print ' const void * _in,'
+ print ' unsigned nr,'
+ print ' void *_out )'
+ print '{'
+ if intype != GENERATE:
+ print ' const ' + intype + '*in = (const ' + intype + '*)_in;'
+ print ' ' + outtype + ' *out = (' + outtype + '*)_out;'
+ print ' unsigned i, j;'
+ print ' (void)j;'
+
+def postamble():
+ print '}'
+
+
+def points(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='points')
+ print ' for (i = 0; i < nr; i++) { '
+ do_point( intype, outtype, 'out+i', 'i' );
+ print ' }'
+ postamble()
+
+def lines(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='lines')
+ print ' for (i = 0; i < nr; i+=2) { '
+ do_line( intype, outtype, 'out+i', 'i', 'i+1', inpv, outpv );
+ print ' }'
+ postamble()
+
+def linestrip(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='linestrip')
+ print ' for (j = i = 0; j < nr; j+=2, i++) { '
+ do_line( intype, outtype, 'out+j', 'i', 'i+1', inpv, outpv );
+ print ' }'
+ postamble()
+
+def lineloop(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='lineloop')
+ print ' for (j = i = 0; j < nr - 2; j+=2, i++) { '
+ do_line( intype, outtype, 'out+j', 'i', 'i+1', inpv, outpv );
+ print ' }'
+ do_line( intype, outtype, 'out+j', 'i', '0', inpv, outpv );
+ postamble()
+
+def tris(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='tris')
+ print ' for (i = 0; i < nr; i+=3) { '
+ do_tri( intype, outtype, 'out+i', 'i', 'i+1', 'i+2', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+def tristrip(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='tristrip')
+ print ' for (j = i = 0; j < nr; j+=3, i++) { '
+ if inpv == FIRST:
+ do_tri( intype, outtype, 'out+j', 'i', 'i+1+(i&1)', 'i+2-(i&1)', inpv, outpv );
+ else:
+ do_tri( intype, outtype, 'out+j', 'i+(i&1)', 'i+1-(i&1)', 'i+2', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+def trifan(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='trifan')
+ print ' for (j = i = 0; j < nr; j+=3, i++) { '
+ do_tri( intype, outtype, 'out+j', '0', 'i+1', 'i+2', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+
+def polygon(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='polygon')
+ print ' for (j = i = 0; j < nr; j+=3, i++) { '
+ if inpv == FIRST:
+ do_tri( intype, outtype, 'out+j', '0', 'i+1', 'i+2', inpv, outpv );
+ else:
+ do_tri( intype, outtype, 'out+j', 'i+1', 'i+2', '0', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+def quads(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='quads')
+ print ' for (j = i = 0; j < nr; j+=6, i+=4) { '
+ do_quad( intype, outtype, 'out+j', 'i+0', 'i+1', 'i+2', 'i+3', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+def quadstrip(intype, outtype, inpv, outpv):
+ preamble(intype, outtype, inpv, outpv, prim='quadstrip')
+ print ' for (j = i = 0; j < nr; j+=6, i+=2) { '
+ do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3', inpv, outpv );
+ print ' }'
+ postamble()
+
+
+def emit_funcs():
+ for intype in INTYPES:
+ for outtype in OUTTYPES:
+ for inpv in (FIRST, LAST):
+ for outpv in (FIRST, LAST):
+ points(intype, outtype, inpv, outpv)
+ lines(intype, outtype, inpv, outpv)
+ linestrip(intype, outtype, inpv, outpv)
+ lineloop(intype, outtype, inpv, outpv)
+ tris(intype, outtype, inpv, outpv)
+ tristrip(intype, outtype, inpv, outpv)
+ trifan(intype, outtype, inpv, outpv)
+ quads(intype, outtype, inpv, outpv)
+ quadstrip(intype, outtype, inpv, outpv)
+ polygon(intype, outtype, inpv, outpv)
+
+def init(intype, outtype, inpv, outpv, prim):
+ if intype == GENERATE:
+ print ('generate[' +
+ outtype_idx[outtype] +
+ '][' + pv_idx[inpv] +
+ '][' + pv_idx[outpv] +
+ '][' + longprim[prim] +
+ '] = ' + name( intype, outtype, inpv, outpv, prim ) + ';')
+ else:
+ print ('translate[' +
+ intype_idx[intype] +
+ '][' + outtype_idx[outtype] +
+ '][' + pv_idx[inpv] +
+ '][' + pv_idx[outpv] +
+ '][' + longprim[prim] +
+ '] = ' + name( intype, outtype, inpv, outpv, prim ) + ';')
+
+
+def emit_all_inits():
+ for intype in INTYPES:
+ for outtype in OUTTYPES:
+ for inpv in PVS:
+ for outpv in PVS:
+ for prim in PRIMS:
+ init(intype, outtype, inpv, outpv, prim)
+
+def emit_init():
+ print 'void u_index_init( void )'
+ print '{'
+ print ' static int firsttime = 1;'
+ print ' if (!firsttime) return;'
+ print ' firsttime = 0;'
+ emit_all_inits()
+ print '}'
+
+
+
+
+def epilog():
+ print '#include "indices/u_indices.c"'
+
+
+def main():
+ prolog()
+ emit_funcs()
+ emit_init()
+ epilog()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/src/gallium/auxiliary/indices/u_indices_priv.h b/src/gallium/auxiliary/indices/u_indices_priv.h
new file mode 100644
index 0000000000..9c3298c24d
--- /dev/null
+++ b/src/gallium/auxiliary/indices/u_indices_priv.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * 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.
+ */
+
+#ifndef U_INDICES_PRIV_H
+#define U_INDICES_PRIV_H
+
+#include "pipe/p_compiler.h"
+#include "u_indices.h"
+
+#define IN_UBYTE 0
+#define IN_USHORT 1
+#define IN_UINT 2
+#define IN_COUNT 3
+
+#define OUT_USHORT 0
+#define OUT_UINT 1
+#define OUT_COUNT 2
+
+
+#define PRIM_COUNT (PIPE_PRIM_POLYGON + 1)
+
+#endif
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 61afdfe82a..f9e6226436 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -44,7 +44,6 @@
#include "pipe/p_compiler.h"
#include "pipe/p_error.h"
#include "pipe/p_debug.h"
-#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_thread.h"
#include "util/u_memory.h"
#include "util/u_double_list.h"
@@ -64,7 +63,7 @@ struct fenced_buffer_list
{
pipe_mutex mutex;
- struct pipe_winsys *winsys;
+ struct pb_fence_ops *ops;
size_t numDelayed;
@@ -140,12 +139,12 @@ static INLINE void
_fenced_buffer_remove(struct fenced_buffer_list *fenced_list,
struct fenced_buffer *fenced_buf)
{
- struct pipe_winsys *winsys = fenced_list->winsys;
+ struct pb_fence_ops *ops = fenced_list->ops;
assert(fenced_buf->fence);
assert(fenced_buf->list == fenced_list);
- winsys->fence_reference(winsys, &fenced_buf->fence, NULL);
+ ops->fence_reference(ops, &fenced_buf->fence, NULL);
fenced_buf->flags &= ~PIPE_BUFFER_USAGE_GPU_READ_WRITE;
assert(fenced_buf->head.prev);
@@ -168,7 +167,7 @@ static INLINE enum pipe_error
_fenced_buffer_finish(struct fenced_buffer *fenced_buf)
{
struct fenced_buffer_list *fenced_list = fenced_buf->list;
- struct pipe_winsys *winsys = fenced_list->winsys;
+ struct pb_fence_ops *ops = fenced_list->ops;
#if 0
debug_warning("waiting for GPU");
@@ -176,7 +175,7 @@ _fenced_buffer_finish(struct fenced_buffer *fenced_buf)
assert(fenced_buf->fence);
if(fenced_buf->fence) {
- if(winsys->fence_finish(winsys, fenced_buf->fence, 0) != 0) {
+ if(ops->fence_finish(ops, fenced_buf->fence, 0) != 0) {
return PIPE_ERROR;
}
/* Remove from the fenced list */
@@ -196,7 +195,7 @@ static void
_fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list,
int wait)
{
- struct pipe_winsys *winsys = fenced_list->winsys;
+ struct pb_fence_ops *ops = fenced_list->ops;
struct list_head *curr, *next;
struct fenced_buffer *fenced_buf;
struct pipe_fence_handle *prev_fence = NULL;
@@ -209,15 +208,15 @@ _fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list,
if(fenced_buf->fence != prev_fence) {
int signaled;
if (wait)
- signaled = winsys->fence_finish(winsys, fenced_buf->fence, 0);
+ signaled = ops->fence_finish(ops, fenced_buf->fence, 0);
else
- signaled = winsys->fence_signalled(winsys, fenced_buf->fence, 0);
+ signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
if (signaled != 0)
break;
prev_fence = fenced_buf->fence;
}
else {
- assert(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0);
+ assert(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0);
}
_fenced_buffer_remove(fenced_list, fenced_buf);
@@ -237,14 +236,14 @@ fenced_buffer_destroy(struct pb_buffer *buf)
pipe_mutex_lock(fenced_list->mutex);
assert(fenced_buf->base.base.refcount == 0);
if (fenced_buf->fence) {
- struct pipe_winsys *winsys = fenced_list->winsys;
- if(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0) {
+ struct pb_fence_ops *ops = fenced_list->ops;
+ if(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0) {
struct list_head *curr, *prev;
curr = &fenced_buf->head;
prev = curr->prev;
do {
fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
- assert(winsys->fence_signalled(winsys, fenced_buf->fence, 0) == 0);
+ assert(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0);
_fenced_buffer_remove(fenced_list, fenced_buf);
curr = prev;
prev = curr->prev;
@@ -366,11 +365,11 @@ fenced_buffer_fence(struct pb_buffer *buf,
{
struct fenced_buffer *fenced_buf;
struct fenced_buffer_list *fenced_list;
- struct pipe_winsys *winsys;
+ struct pb_fence_ops *ops;
fenced_buf = fenced_buffer(buf);
fenced_list = fenced_buf->list;
- winsys = fenced_list->winsys;
+ ops = fenced_list->ops;
if(fence == fenced_buf->fence) {
/* Nothing to do */
@@ -384,7 +383,7 @@ fenced_buffer_fence(struct pb_buffer *buf,
if (fenced_buf->fence)
_fenced_buffer_remove(fenced_list, fenced_buf);
if (fence) {
- winsys->fence_reference(winsys, &fenced_buf->fence, fence);
+ ops->fence_reference(ops, &fenced_buf->fence, fence);
fenced_buf->flags |= fenced_buf->validation_flags;
_fenced_buffer_add(fenced_buf);
}
@@ -447,7 +446,7 @@ fenced_buffer_create(struct fenced_buffer_list *fenced_list,
struct fenced_buffer_list *
-fenced_buffer_list_create(struct pipe_winsys *winsys)
+fenced_buffer_list_create(struct pb_fence_ops *ops)
{
struct fenced_buffer_list *fenced_list;
@@ -455,7 +454,7 @@ fenced_buffer_list_create(struct pipe_winsys *winsys)
if (!fenced_list)
return NULL;
- fenced_list->winsys = winsys;
+ fenced_list->ops = ops;
LIST_INITHEAD(&fenced_list->delayed);
@@ -494,6 +493,8 @@ fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
pipe_mutex_unlock(fenced_list->mutex);
+ fenced_list->ops->destroy(fenced_list->ops);
+
FREE(fenced_list);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h
index b15c676194..d1c9d4c17d 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h
@@ -59,7 +59,6 @@ extern "C" {
#endif
-struct pipe_winsys;
struct pipe_buffer;
struct pipe_fence_handle;
@@ -70,13 +69,42 @@ struct pipe_fence_handle;
struct fenced_buffer_list;
+struct pb_fence_ops
+{
+ void (*destroy)( struct pb_fence_ops *ops );
+
+ /** Set ptr = fence, with reference counting */
+ void (*fence_reference)( struct pb_fence_ops *ops,
+ struct pipe_fence_handle **ptr,
+ struct pipe_fence_handle *fence );
+
+ /**
+ * Checks whether the fence has been signalled.
+ * \param flags driver-specific meaning
+ * \return zero on success.
+ */
+ int (*fence_signalled)( struct pb_fence_ops *ops,
+ struct pipe_fence_handle *fence,
+ unsigned flag );
+
+ /**
+ * Wait for the fence to finish.
+ * \param flags driver-specific meaning
+ * \return zero on success.
+ */
+ int (*fence_finish)( struct pb_fence_ops *ops,
+ struct pipe_fence_handle *fence,
+ unsigned flag );
+};
+
+
/**
* Create a fenced buffer list.
*
* See also fenced_bufmgr_create for a more convenient way to use this.
*/
struct fenced_buffer_list *
-fenced_buffer_list_create(struct pipe_winsys *winsys);
+fenced_buffer_list_create(struct pb_fence_ops *ops);
/**
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
index 0a8264a924..fec8db91c7 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
@@ -61,7 +61,6 @@ extern "C" {
struct pb_desc;
struct pipe_buffer;
-struct pipe_winsys;
/**
@@ -163,6 +162,8 @@ pb_cache_manager_create(struct pb_manager *provider,
unsigned usecs);
+struct pb_fence_ops;
+
/**
* Fenced buffer manager.
*
@@ -174,7 +175,7 @@ pb_cache_manager_create(struct pb_manager *provider,
*/
struct pb_manager *
fenced_bufmgr_create(struct pb_manager *provider,
- struct pipe_winsys *winsys);
+ struct pb_fence_ops *ops);
struct pb_manager *
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
index 513ed28ca6..47e9fee533 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
@@ -122,7 +122,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
struct pb_manager *
fenced_bufmgr_create(struct pb_manager *provider,
- struct pipe_winsys *winsys)
+ struct pb_fence_ops *ops)
{
struct fenced_pb_manager *fenced_mgr;
@@ -138,7 +138,7 @@ fenced_bufmgr_create(struct pb_manager *provider,
fenced_mgr->base.flush = fenced_bufmgr_flush;
fenced_mgr->provider = provider;
- fenced_mgr->fenced_list = fenced_buffer_list_create(winsys);
+ fenced_mgr->fenced_list = fenced_buffer_list_create(ops);
if(!fenced_mgr->fenced_list) {
FREE(fenced_mgr);
return NULL;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index fd02c2c87c..17886540cf 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -114,7 +114,7 @@ tgsi_default_declaration( void )
struct tgsi_declaration declaration;
declaration.Type = TGSI_TOKEN_TYPE_DECLARATION;
- declaration.Size = 1;
+ declaration.NrTokens = 1;
declaration.File = TGSI_FILE_NULL;
declaration.UsageMask = TGSI_WRITEMASK_XYZW;
declaration.Interpolate = TGSI_INTERPOLATE_CONSTANT;
@@ -160,9 +160,9 @@ declaration_grow(
struct tgsi_declaration *declaration,
struct tgsi_header *header )
{
- assert( declaration->Size < 0xFF );
+ assert( declaration->NrTokens < 0xFF );
- declaration->Size++;
+ declaration->NrTokens++;
header_bodysize_grow( header );
}
@@ -308,7 +308,7 @@ tgsi_default_immediate( void )
struct tgsi_immediate immediate;
immediate.Type = TGSI_TOKEN_TYPE_IMMEDIATE;
- immediate.Size = 1;
+ immediate.NrTokens = 1;
immediate.DataType = TGSI_IMM_FLOAT32;
immediate.Padding = 0;
immediate.Extended = 0;
@@ -345,9 +345,9 @@ immediate_grow(
struct tgsi_immediate *immediate,
struct tgsi_header *header )
{
- assert( immediate->Size < 0xFF );
+ assert( immediate->NrTokens < 0xFF );
- immediate->Size++;
+ immediate->NrTokens++;
header_bodysize_grow( header );
}
@@ -384,7 +384,7 @@ tgsi_build_full_immediate(
*immediate = tgsi_build_immediate( header );
- for( i = 0; i < full_imm->Immediate.Size - 1; i++ ) {
+ for( i = 0; i < full_imm->Immediate.NrTokens - 1; i++ ) {
struct tgsi_immediate_float32 *if32;
if( maxsize <= size )
@@ -411,7 +411,7 @@ tgsi_default_instruction( void )
struct tgsi_instruction instruction;
instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION;
- instruction.Size = 1;
+ instruction.NrTokens = 1;
instruction.Opcode = TGSI_OPCODE_MOV;
instruction.Saturate = TGSI_SAT_NONE;
instruction.NumDstRegs = 1;
@@ -453,9 +453,9 @@ instruction_grow(
struct tgsi_instruction *instruction,
struct tgsi_header *header )
{
- assert (instruction->Size < 0xFF);
+ assert (instruction->NrTokens < 0xFF);
- instruction->Size++;
+ instruction->NrTokens++;
header_bodysize_grow( header );
}
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index 2ed8c2bf07..ab2b1f2c58 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -285,7 +285,7 @@ iter_immediate(
ENM( imm->Immediate.DataType, immediate_type_names );
TXT( " { " );
- for (i = 0; i < imm->Immediate.Size - 1; i++) {
+ for (i = 0; i < imm->Immediate.NrTokens - 1; i++) {
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
FLT( imm->u.ImmediateFloat32[i].Float );
@@ -294,7 +294,7 @@ iter_immediate(
assert( 0 );
}
- if (i < imm->Immediate.Size - 2)
+ if (i < imm->Immediate.NrTokens - 2)
TXT( ", " );
}
TXT( " }" );
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump_c.c b/src/gallium/auxiliary/tgsi/tgsi_dump_c.c
index c575b6c3e1..2ecf1e2f14 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump_c.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump_c.c
@@ -283,7 +283,7 @@ dump_immediate_verbose(
UIX( imm->Immediate.Padding );
}
- for( i = 0; i < imm->Immediate.Size - 1; i++ ) {
+ for( i = 0; i < imm->Immediate.NrTokens - 1; i++ ) {
EOL();
switch( imm->Immediate.DataType ) {
case TGSI_IMM_FLOAT32:
@@ -675,7 +675,7 @@ tgsi_dump_c(
ENM( parse.FullToken.Token.Type, TGSI_TOKEN_TYPES );
if( ignored ) {
TXT( "\nSize : " );
- UID( parse.FullToken.Token.Size );
+ UID( parse.FullToken.Token.NrTokens );
if( deflt || parse.FullToken.Token.Extended ) {
TXT( "\nExtended : " );
UID( parse.FullToken.Token.Extended );
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index a182e679da..ab641efb60 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -202,7 +202,7 @@ tgsi_exec_machine_bind_shader(
case TGSI_TOKEN_TYPE_IMMEDIATE:
{
- uint size = parse.FullToken.FullImmediate.Immediate.Size - 1;
+ uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
assert( size % 4 == 0 );
assert( mach->ImmLimit + size / 4 <= TGSI_EXEC_NUM_IMMEDIATES );
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index 2cd56e413a..d374b16f9a 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -155,8 +155,8 @@ tgsi_parse_token(
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
imm->u.Pointer = MALLOC(
- sizeof( struct tgsi_immediate_float32 ) * (imm->Immediate.Size - 1) );
- for( i = 0; i < imm->Immediate.Size - 1; i++ ) {
+ sizeof( struct tgsi_immediate_float32 ) * (imm->Immediate.NrTokens - 1) );
+ for( i = 0; i < imm->Immediate.NrTokens - 1; i++ ) {
next_token( ctx, (struct tgsi_immediate_float32 *) &imm->u.ImmediateFloat32[i] );
}
break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
index 1a4db47501..f365030e52 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c
@@ -1327,7 +1327,7 @@ tgsi_emit_ppc(const struct tgsi_token *tokens,
case TGSI_TOKEN_TYPE_IMMEDIATE:
/* splat each immediate component into a float[4] vector for SoA */
{
- const uint size = parse.FullToken.FullImmediate.Immediate.Size - 1;
+ const uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
uint i;
assert(size <= 4);
assert(num_immediates < TGSI_EXEC_NUM_IMMEDIATES);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index d02205a63e..c535788819 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -151,7 +151,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:
- info->immediate_count++;
+ {
+ uint reg = info->immediate_count++;
+ uint file = TGSI_FILE_IMMEDIATE;
+
+ info->file_mask[file] |= (1 << reg);
+ info->file_count[file]++;
+ info->file_max[file] = MAX2(info->file_max[file], (int)reg);
+ }
break;
default:
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
index cac44af7f4..481ba89c5e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c
@@ -2671,7 +2671,7 @@ tgsi_emit_sse2(
case TGSI_TOKEN_TYPE_IMMEDIATE:
/* simply copy the immediate values into the next immediates[] slot */
{
- const uint size = parse.FullToken.FullImmediate.Immediate.Size - 1;
+ const uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
uint i;
assert(size <= 4);
assert(num_immediates < TGSI_EXEC_NUM_IMMEDIATES);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index 9454563361..1e822fbbea 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -1023,7 +1023,7 @@ static boolean parse_immediate( struct translate_ctx *ctx )
ctx->cur++;
imm = tgsi_default_full_immediate();
- imm.Immediate.Size += 4;
+ imm.Immediate.NrTokens += 4;
imm.Immediate.DataType = TGSI_IMM_FLOAT32;
imm.u.Pointer = values;
diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c
index a76704ffc7..e999cefe74 100644
--- a/src/gallium/auxiliary/util/u_linear.c
+++ b/src/gallium/auxiliary/util/u_linear.c
@@ -3,13 +3,13 @@
#include "u_linear.h"
void
-pipe_linear_to_tile(size_t src_stride, void *src_ptr,
+pipe_linear_to_tile(size_t src_stride, const void *src_ptr,
struct pipe_tile_info *t, void *dst_ptr)
{
int x, y, z;
char *ptr;
size_t bytes = t->cols * t->block.size;
-
+ char *dst_ptr2 = (char *) dst_ptr;
assert(pipe_linear_check_tile(t));
@@ -19,20 +19,21 @@ pipe_linear_to_tile(size_t src_stride, void *src_ptr,
/* this inner loop could be replace with SSE magic */
ptr = (char*)src_ptr + src_stride * t->rows * y + bytes * x;
for (z = 0; z < t->rows; z++) {
- memcpy(dst_ptr, ptr, bytes);
- dst_ptr += bytes;
+ memcpy(dst_ptr2, ptr, bytes);
+ dst_ptr2 += bytes;
ptr += src_stride;
}
}
}
}
-void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr,
+void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr,
size_t dst_stride, void *dst_ptr)
{
int x, y, z;
char *ptr;
size_t bytes = t->cols * t->block.size;
+ const char *src_ptr2 = (const char *) src_ptr;
/* lets read lineary from the tiled buffer */
for (y = 0; y < t->tiles_y; y++) {
@@ -40,8 +41,8 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr,
/* this inner loop could be replace with SSE magic */
ptr = (char*)dst_ptr + dst_stride * t->rows * y + bytes * x;
for (z = 0; z < t->rows; z++) {
- memcpy(ptr, src_ptr, bytes);
- src_ptr += bytes;
+ memcpy(ptr, src_ptr2, bytes);
+ src_ptr2 += bytes;
ptr += dst_stride;
}
}
@@ -50,7 +51,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr,
void
pipe_linear_fill_info(struct pipe_tile_info *t,
- struct pipe_format_block *block,
+ const struct pipe_format_block *block,
unsigned tile_width, unsigned tile_height,
unsigned tiles_x, unsigned tiles_y)
{
diff --git a/src/gallium/auxiliary/util/u_linear.h b/src/gallium/auxiliary/util/u_linear.h
index e337cfd770..1589f029bc 100644
--- a/src/gallium/auxiliary/util/u_linear.h
+++ b/src/gallium/auxiliary/util/u_linear.h
@@ -3,6 +3,7 @@
#define U_LINEAR_H
#include "pipe/p_format.h"
+
struct pipe_tile_info
{
unsigned size;
@@ -23,10 +24,10 @@ struct pipe_tile_info
struct pipe_format_block block;
};
-void pipe_linear_to_tile(size_t src_stride, void *src_ptr,
+void pipe_linear_to_tile(size_t src_stride, const void *src_ptr,
struct pipe_tile_info *t, void *dst_ptr);
-void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr,
+void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr,
size_t dst_stride, void *dst_ptr);
/**
@@ -39,11 +40,11 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr,
* @tiles_y number of tiles in y axis
*/
void pipe_linear_fill_info(struct pipe_tile_info *t,
- struct pipe_format_block *block,
+ const struct pipe_format_block *block,
unsigned tile_width, unsigned tile_height,
unsigned tiles_x, unsigned tiles_y);
-static INLINE boolean pipe_linear_check_tile(struct pipe_tile_info *t)
+static INLINE boolean pipe_linear_check_tile(const struct pipe_tile_info *t)
{
if (t->tile.size != t->block.size * t->cols * t->rows)
return FALSE;
diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
index 67949b73dd..644496db40 100644
--- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
+++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
@@ -51,7 +51,7 @@ cell_map_constant_buffers(struct cell_context *sp)
struct pipe_winsys *ws = sp->pipe.winsys;
uint i;
for (i = 0; i < 2; i++) {
- if (sp->constants[i].size) {
+ if (sp->constants[i].buffer && sp->constants[i].buffer->size) {
sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
cell_flush_buffer_range(sp, sp->mapped_constants[i],
@@ -61,7 +61,7 @@ cell_map_constant_buffers(struct cell_context *sp)
draw_set_mapped_constant_buffer(sp->draw,
sp->mapped_constants[PIPE_SHADER_VERTEX],
- sp->constants[PIPE_SHADER_VERTEX].size);
+ sp->constants[PIPE_SHADER_VERTEX].buffer->size);
}
static void
@@ -70,7 +70,7 @@ cell_unmap_constant_buffers(struct cell_context *sp)
struct pipe_winsys *ws = sp->pipe.winsys;
uint i;
for (i = 0; i < 2; i++) {
- if (sp->constants[i].size)
+ if (sp->constants[i].buffer && sp->constants[i].buffer->size)
ws->buffer_unmap(ws, sp->constants[i].buffer);
sp->mapped_constants[i] = NULL;
}
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
index 9bdc71b676..66d4b3b6a3 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -161,7 +161,7 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa,
if ((dsa->alpha.func != PIPE_FUNC_NEVER) &&
(dsa->alpha.func != PIPE_FUNC_ALWAYS)) {
/* load/splat the alpha reference float value */
- spe_load_float(f, ref_reg, dsa->alpha.ref);
+ spe_load_float(f, ref_reg, dsa->alpha.ref_value);
}
/* emit code to do the alpha comparison, updating 'mask' */
diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c
index 39b85faeb8..ff529fe22c 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_emit.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c
@@ -239,7 +239,7 @@ cell_emit_state(struct cell_context *cell)
if (cell->dirty & (CELL_NEW_FS_CONSTANTS)) {
const uint shader = PIPE_SHADER_FRAGMENT;
- const uint num_const = cell->constants[shader].size / sizeof(float);
+ const uint num_const = cell->constants[shader].buffer->size / sizeof(float);
uint i, j;
float *buf = cell_batch_alloc16(cell, ROUNDUP16(32 + num_const * sizeof(float)));
uint32_t *ibuf = (uint32_t *) buf;
diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c
index 990f23e170..bf517ea563 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_shader.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c
@@ -186,7 +186,6 @@ cell_set_constant_buffer(struct pipe_context *pipe,
const struct pipe_constant_buffer *buf)
{
struct cell_context *cell = cell_context(pipe);
- struct pipe_winsys *ws = pipe->winsys;
assert(shader < PIPE_SHADER_TYPES);
assert(index == 0);
@@ -197,7 +196,6 @@ cell_set_constant_buffer(struct pipe_context *pipe,
pipe_buffer_reference(pipe->screen,
&cell->constants[shader].buffer,
buf->buffer);
- cell->constants[shader].size = buf->size;
if (shader == PIPE_SHADER_VERTEX)
cell->dirty |= CELL_NEW_VS_CONSTANTS;
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index 4f16e2c6af..9ba995ab7d 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -307,9 +307,8 @@ cell_twiddle_texture(struct pipe_screen *screen,
const uint texHeight = ct->base.height[level];
const uint bufWidth = align(texWidth, TILE_SIZE);
const uint bufHeight = align(texHeight, TILE_SIZE);
- const void *map = pipe_buffer_map(screen, surface->buffer,
- PIPE_BUFFER_USAGE_CPU_READ);
- const uint *src = (const uint *) ((const ubyte *) map + surface->offset);
+ const void *map = screen->surface_map(screen, surface, PIPE_BUFFER_USAGE_CPU_READ);
+ const uint *src = (const uint *) map;
switch (ct->base.format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
@@ -324,12 +323,12 @@ cell_twiddle_texture(struct pipe_screen *screen,
/* allocate buffer for tiled data now */
struct pipe_winsys *ws = screen->winsys;
uint bytes = bufWidth * bufHeight * 4 * numFaces;
- ct->tiled_buffer[level] = ws->buffer_create(ws, 16,
- PIPE_BUFFER_USAGE_PIXEL,
- bytes);
+ ct->tiled_buffer[level] =
+ ws->buffer_create(ws, 16, PIPE_BUFFER_USAGE_PIXEL, bytes);
/* and map it */
- ct->tiled_mapped[level] = ws->buffer_map(ws, ct->tiled_buffer[level],
- PIPE_BUFFER_USAGE_GPU_READ);
+ ct->tiled_mapped[level] =
+ ws->buffer_map(ws, ct->tiled_buffer[level],
+ PIPE_BUFFER_USAGE_GPU_READ);
}
dst = (uint *) ((ubyte *) ct->tiled_mapped[level] + offset);
@@ -338,11 +337,11 @@ cell_twiddle_texture(struct pipe_screen *screen,
}
break;
default:
- printf("Cell: twiddle unsupported texture format %s\n", pf_name(ct->base.format));
- ;
+ printf("Cell: twiddle unsupported texture format %s\n",
+ pf_name(ct->base.format));
}
- pipe_buffer_unmap(screen, surface->buffer);
+ screen->surface_unmap(screen, surface);
}
@@ -357,8 +356,7 @@ cell_untwiddle_texture(struct pipe_screen *screen,
const uint level = surface->level;
const uint texWidth = ct->base.width[level];
const uint texHeight = ct->base.height[level];
- const void *map = pipe_buffer_map(screen, surface->buffer,
- PIPE_BUFFER_USAGE_CPU_READ);
+ const void *map = screen->surface_map(screen, surface, PIPE_BUFFER_USAGE_CPU_READ);
const uint *src = (const uint *) ((const ubyte *) map + surface->offset);
switch (ct->base.format) {
@@ -384,11 +382,12 @@ cell_untwiddle_texture(struct pipe_screen *screen,
default:
{
ct->untiled_data[level] = NULL;
- printf("Cell: untwiddle unsupported texture format %s\n", pf_name(ct->base.format));
+ printf("Cell: untwiddle unsupported texture format %s\n",
+ pf_name(ct->base.format));
}
}
- pipe_buffer_unmap(screen, surface->buffer);
+ screen->surface_unmap(screen, surface);
}
@@ -398,15 +397,13 @@ cell_get_tex_surface(struct pipe_screen *screen,
unsigned face, unsigned level, unsigned zslice,
unsigned usage)
{
- struct pipe_winsys *ws = screen->winsys;
struct cell_texture *ct = cell_texture(pt);
struct pipe_surface *ps;
- ps = ws->surface_alloc(ws);
+ ps = CALLOC_STRUCT(pipe_surface);
if (ps) {
- assert(ps->refcount);
- assert(ps->winsys);
- pipe_buffer_reference(screen, &ps->buffer, ct->buffer);
+ ps->refcount = 1;
+ pipe_texture_reference(&ps->texture, pt);
ps->format = pt->format;
ps->block = pt->block;
ps->width = pt->width[level];
@@ -425,9 +422,9 @@ cell_get_tex_surface(struct pipe_screen *screen,
ps->zslice = zslice;
if (pt->target == PIPE_TEXTURE_CUBE || pt->target == PIPE_TEXTURE_3D) {
- ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) *
- ps->nblocksy *
- ps->stride;
+ ps->offset += ((pt->target == PIPE_TEXTURE_CUBE) ? face : zslice) *
+ ps->nblocksy *
+ ps->stride;
}
else {
assert(face == 0);
@@ -449,18 +446,27 @@ cell_tex_surface_release(struct pipe_screen *screen,
{
struct cell_texture *ct = cell_texture((*s)->texture);
const uint level = (*s)->level;
+ struct pipe_surface *surf = *s;
- if (((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level]))
+ if ((surf->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level]))
{
align_free(ct->untiled_data[level]);
ct->untiled_data[level] = NULL;
}
- /* XXX if done rendering to teximage, re-tile */
+ if ((ct->base.tex_usage & PIPE_TEXTURE_USAGE_SAMPLER) &&
+ (surf->usage & PIPE_BUFFER_USAGE_CPU_WRITE)) {
+ /* convert from linear to tiled layout */
+ cell_twiddle_texture(screen, surf);
+ }
- pipe_texture_reference(&(*s)->texture, NULL);
+ /* XXX if done rendering to teximage, re-tile */
- screen->winsys->surface_release(screen->winsys, s);
+ if (--surf->refcount == 0) {
+ pipe_texture_reference(&surf->texture, NULL);
+ FREE(surf);
+ }
+ *s = NULL;
}
@@ -475,17 +481,20 @@ cell_surface_map(struct pipe_screen *screen,
assert(ct);
+#if 0
if (flags & ~surface->usage) {
assert(0);
return NULL;
}
+#endif
- map = pipe_buffer_map( screen, surface->buffer, flags );
- if (map == NULL)
+ map = pipe_buffer_map( screen, ct->buffer, flags );
+ if (map == NULL) {
return NULL;
- else
- {
- if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) {
+ }
+ else {
+ if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) &&
+ (ct->untiled_data[level])) {
return (void *) ((ubyte *) ct->untiled_data[level] + surface->offset);
}
else {
@@ -503,13 +512,7 @@ cell_surface_unmap(struct pipe_screen *screen,
assert(ct);
- if ((ct->base.tex_usage & PIPE_TEXTURE_USAGE_SAMPLER) &&
- (surface->usage & PIPE_BUFFER_USAGE_CPU_WRITE)) {
- /* convert from linear to tiled layout */
- cell_twiddle_texture(screen, surface);
- }
-
- pipe_buffer_unmap( screen, surface->buffer );
+ pipe_buffer_unmap( screen, ct->buffer );
}
diff --git a/src/gallium/drivers/cell/spu/Makefile b/src/gallium/drivers/cell/spu/Makefile
index 116453b79c..3cc52301da 100644
--- a/src/gallium/drivers/cell/spu/Makefile
+++ b/src/gallium/drivers/cell/spu/Makefile
@@ -33,9 +33,10 @@ OLD_SOURCES = \
spu_vertex_shader.c
-SPU_OBJECTS = $(SOURCES:.c=.o) \
+SPU_OBJECTS = $(SOURCES:.c=.o)
+
+SPU_ASM_OUT = $(SOURCES:.c=.s)
-SPU_ASM_OUT = $(SOURCES:.c=.s) \
INCLUDE_DIRS = \
-I$(TOP)/src/mesa \
diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
index 683664e8a4..eba9f95cf1 100644
--- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
+++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
@@ -85,7 +85,7 @@ spu_fallback_fragment_ops(uint x, uint y,
* Do alpha test
*/
if (spu.depth_stencil_alpha.alpha.enabled) {
- vector float ref = spu_splats(spu.depth_stencil_alpha.alpha.ref);
+ vector float ref = spu_splats(spu.depth_stencil_alpha.alpha.ref_value);
vector unsigned int amask;
switch (spu.depth_stencil_alpha.alpha.func) {
diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c
index 0d9fcb9997..d727268475 100644
--- a/src/gallium/drivers/cell/spu/spu_tri.c
+++ b/src/gallium/drivers/cell/spu/spu_tri.c
@@ -29,7 +29,6 @@
* Triangle rendering within a tile.
*/
-#include <transpose_matrix4x4.h>
#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
#include "util/u_math.h"
@@ -71,6 +70,12 @@ struct vertex_header {
#define MASK_ALL 0xf
+#define CHAN0 0
+#define CHAN1 1
+#define CHAN2 2
+#define CHAN3 3
+
+
#define DEBUG_VERTS 0
/**
@@ -144,99 +149,97 @@ struct setup_stage {
static struct setup_stage setup;
-/**
- * Evaluate attribute coefficients (plane equations) to compute
- * attribute values for the four fragments in a quad.
- * Eg: four colors will be computed (in AoS format).
- */
-static INLINE void
-eval_coeff(uint slot, float x, float y, vector float w, vector float result[4])
+static INLINE vector float
+splatx(vector float v)
{
- switch (spu.vertex_info.attrib[slot].interp_mode) {
- case INTERP_CONSTANT:
- result[QUAD_TOP_LEFT] =
- result[QUAD_TOP_RIGHT] =
- result[QUAD_BOTTOM_LEFT] =
- result[QUAD_BOTTOM_RIGHT] = setup.coef[slot].a0;
- break;
- case INTERP_LINEAR:
- {
- vector float dadx = setup.coef[slot].dadx;
- vector float dady = setup.coef[slot].dady;
- vector float topLeft =
- spu_add(setup.coef[slot].a0,
- spu_add(spu_mul(spu_splats(x), dadx),
- spu_mul(spu_splats(y), dady)));
-
- result[QUAD_TOP_LEFT] = topLeft;
- result[QUAD_TOP_RIGHT] = spu_add(topLeft, dadx);
- result[QUAD_BOTTOM_LEFT] = spu_add(topLeft, dady);
- result[QUAD_BOTTOM_RIGHT] = spu_add(spu_add(topLeft, dadx), dady);
- }
- break;
- case INTERP_PERSPECTIVE:
- {
- vector float dadx = setup.coef[slot].dadx;
- vector float dady = setup.coef[slot].dady;
- vector float topLeft =
- spu_add(setup.coef[slot].a0,
- spu_add(spu_mul(spu_splats(x), dadx),
- spu_mul(spu_splats(y), dady)));
-
- vector float wInv = spu_re(w); /* 1.0 / w */
-
- result[QUAD_TOP_LEFT] = spu_mul(topLeft, wInv);
- result[QUAD_TOP_RIGHT] = spu_mul(spu_add(topLeft, dadx), wInv);
- result[QUAD_BOTTOM_LEFT] = spu_mul(spu_add(topLeft, dady), wInv);
- result[QUAD_BOTTOM_RIGHT] = spu_mul(spu_add(spu_add(topLeft, dadx), dady), wInv);
- }
- break;
- case INTERP_POS:
- case INTERP_NONE:
- break;
- default:
- ASSERT(0);
- }
+ return spu_splats(spu_extract(v, CHAN0));
}
-
-/**
- * As above, but return 4 vectors in SOA format.
- * XXX this will all be re-written someday.
- */
-static INLINE void
-eval_coeff_soa(uint slot, float x, float y, vector float w, vector float result[4])
+static INLINE vector float
+splaty(vector float v)
{
- eval_coeff(slot, x, y, w, result);
- _transpose_matrix4x4(result, result);
+ return spu_splats(spu_extract(v, CHAN1));
}
+static INLINE vector float
+splatz(vector float v)
+{
+ return spu_splats(spu_extract(v, CHAN2));
+}
-/** Evalute coefficients to get Z for four pixels in a quad */
static INLINE vector float
-eval_z(float x, float y)
+splatw(vector float v)
{
- const uint slot = 0;
- const float dzdx = spu_extract(setup.coef[slot].dadx, 2);
- const float dzdy = spu_extract(setup.coef[slot].dady, 2);
- const float topLeft = spu_extract(setup.coef[slot].a0, 2) + x * dzdx + y * dzdy;
- const vector float topLeftv = spu_splats(topLeft);
- const vector float derivs = (vector float) { 0.0, dzdx, dzdy, dzdx + dzdy };
- return spu_add(topLeftv, derivs);
+ return spu_splats(spu_extract(v, CHAN3));
}
-/** Evalute coefficients to get W for four pixels in a quad */
-static INLINE vector float
-eval_w(float x, float y)
+/**
+ * Setup fragment shader inputs by evaluating triangle's vertex
+ * attribute coefficient info.
+ * \param x quad x pos
+ * \param y quad y pos
+ * \param fragZ returns quad Z values
+ * \param fragInputs returns fragment program inputs
+ * Note: this code could be incorporated into the fragment program
+ * itself to avoid the loop and switch.
+ */
+static void
+eval_inputs(float x, float y, vector float *fragZ, vector float fragInputs[])
{
- const uint slot = 0;
- const float dwdx = spu_extract(setup.coef[slot].dadx, 3);
- const float dwdy = spu_extract(setup.coef[slot].dady, 3);
- const float topLeft = spu_extract(setup.coef[slot].a0, 3) + x * dwdx + y * dwdy;
- const vector float topLeftv = spu_splats(topLeft);
- const vector float derivs = (vector float) { 0.0, dwdx, dwdy, dwdx + dwdy };
- return spu_add(topLeftv, derivs);
+ static const vector float deltaX = (const vector float) {0, 1, 0, 1};
+ static const vector float deltaY = (const vector float) {0, 0, 1, 1};
+
+ const uint posSlot = 0;
+ const vector float pos = setup.coef[posSlot].a0;
+ const vector float dposdx = setup.coef[posSlot].dadx;
+ const vector float dposdy = setup.coef[posSlot].dady;
+ const vector float fragX = spu_splats(x) + deltaX;
+ const vector float fragY = spu_splats(y) + deltaY;
+ vector float fragW, wInv;
+ uint i;
+
+ *fragZ = splatz(pos) + fragX * splatz(dposdx) + fragY * splatz(dposdy);
+ fragW = splatw(pos) + fragX * splatw(dposdx) + fragY * splatw(dposdy);
+ wInv = spu_re(fragW); /* 1 / w */
+
+ /* loop over fragment program inputs */
+ for (i = 0; i < spu.vertex_info.num_attribs; i++) {
+ uint attr = i + 1;
+ enum interp_mode interp = spu.vertex_info.attrib[attr].interp_mode;
+
+ /* constant term */
+ vector float a0 = setup.coef[attr].a0;
+ vector float r0 = splatx(a0);
+ vector float r1 = splaty(a0);
+ vector float r2 = splatz(a0);
+ vector float r3 = splatw(a0);
+
+ if (interp == INTERP_LINEAR || interp == INTERP_PERSPECTIVE) {
+ /* linear term */
+ vector float dadx = setup.coef[attr].dadx;
+ vector float dady = setup.coef[attr].dady;
+ /* Use SPU intrinsics here to get slightly better code.
+ * originally: r0 += fragX * splatx(dadx) + fragY * splatx(dady);
+ */
+ r0 = spu_madd(fragX, splatx(dadx), spu_madd(fragY, splatx(dady), r0));
+ r1 = spu_madd(fragX, splaty(dadx), spu_madd(fragY, splaty(dady), r1));
+ r2 = spu_madd(fragX, splatz(dadx), spu_madd(fragY, splatz(dady), r2));
+ r3 = spu_madd(fragX, splatw(dadx), spu_madd(fragY, splatw(dady), r3));
+ if (interp == INTERP_PERSPECTIVE) {
+ /* perspective term */
+ r0 *= wInv;
+ r1 *= wInv;
+ r2 *= wInv;
+ r3 *= wInv;
+ }
+ }
+ fragInputs[CHAN0] = r0;
+ fragInputs[CHAN1] = r1;
+ fragInputs[CHAN2] = r2;
+ fragInputs[CHAN3] = r3;
+ fragInputs += 4;
+ }
}
@@ -262,19 +265,11 @@ emit_quad( int x, int y, mask_t mask)
* Run fragment shader, execute per-fragment ops, update fb/tile.
*/
vector float inputs[4*4], outputs[2*4];
- vector float fragZ = eval_z((float) x, (float) y);
- vector float fragW = eval_w((float) x, (float) y);
vector unsigned int kill_mask;
+ vector float fragZ;
+
+ eval_inputs((float) x, (float) y, &fragZ, inputs);
- /* setup inputs */
-#if 0
- eval_coeff_soa(1, (float) x, (float) y, fragW, inputs);
-#else
- uint i;
- for (i = 0; i < spu.vertex_info.num_attribs; i++) {
- eval_coeff_soa(i+1, (float) x, (float) y, fragW, inputs + i * 4);
- }
-#endif
ASSERT(spu.fragment_program);
ASSERT(spu.fragment_ops);
diff --git a/src/gallium/drivers/i915simple/i915_fpc_translate.c b/src/gallium/drivers/i915simple/i915_fpc_translate.c
index 43d62c5176..d92bdc1bc6 100644
--- a/src/gallium/drivers/i915simple/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915simple/i915_fpc_translate.c
@@ -964,7 +964,7 @@ i915_translate_instructions(struct i915_fp_compile *p,
= &parse.FullToken.FullImmediate;
const uint pos = p->num_immediates++;
uint j;
- for (j = 0; j < imm->Immediate.Size; j++) {
+ for (j = 0; j < imm->Immediate.NrTokens - 1; j++) {
p->immediates[pos][j] = imm->u.ImmediateFloat32[j].Float;
}
}
diff --git a/src/gallium/drivers/i965simple/brw_vs_emit.c b/src/gallium/drivers/i965simple/brw_vs_emit.c
index 34dbc0624d..e03d653482 100644
--- a/src/gallium/drivers/i965simple/brw_vs_emit.c
+++ b/src/gallium/drivers/i965simple/brw_vs_emit.c
@@ -1293,7 +1293,7 @@ void brw_vs_emit(struct brw_vs_compile *c)
break;
case TGSI_TOKEN_TYPE_IMMEDIATE: {
struct tgsi_full_immediate *imm = &parse.FullToken.FullImmediate;
- /*assert(imm->Immediate.Size == 4);*/
+ assert(imm->Immediate.NrTokens == 4 + 1);
c->prog_data.imm_buf[c->prog_data.num_imm][0] = imm->u.ImmediateFloat32[0].Float;
c->prog_data.imm_buf[c->prog_data.num_imm][1] = imm->u.ImmediateFloat32[1].Float;
c->prog_data.imm_buf[c->prog_data.num_imm][2] = imm->u.ImmediateFloat32[2].Float;
diff --git a/src/gallium/drivers/nouveau/nouveau_bo.h b/src/gallium/drivers/nouveau/nouveau_bo.h
deleted file mode 100644
index 65b138283c..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_bo.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_BO_H__
-#define __NOUVEAU_BO_H__
-
-/* Relocation/Buffer type flags */
-#define NOUVEAU_BO_VRAM (1 << 0)
-#define NOUVEAU_BO_GART (1 << 1)
-#define NOUVEAU_BO_RD (1 << 2)
-#define NOUVEAU_BO_WR (1 << 3)
-#define NOUVEAU_BO_RDWR (NOUVEAU_BO_RD | NOUVEAU_BO_WR)
-#define NOUVEAU_BO_MAP (1 << 4)
-#define NOUVEAU_BO_PIN (1 << 5)
-#define NOUVEAU_BO_LOW (1 << 6)
-#define NOUVEAU_BO_HIGH (1 << 7)
-#define NOUVEAU_BO_OR (1 << 8)
-#define NOUVEAU_BO_LOCAL (1 << 9)
-#define NOUVEAU_BO_TILED (1 << 10)
-#define NOUVEAU_BO_ZTILE (1 << 11)
-#define NOUVEAU_BO_DUMMY (1 << 31)
-
-struct nouveau_bo {
- struct nouveau_device *device;
- uint64_t handle;
-
- uint64_t size;
- void *map;
-
- uint32_t flags;
- uint64_t offset;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_channel.h b/src/gallium/drivers/nouveau/nouveau_channel.h
deleted file mode 100644
index cd99a676bd..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_channel.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_CHANNEL_H__
-#define __NOUVEAU_CHANNEL_H__
-
-struct nouveau_channel {
- struct nouveau_device *device;
- int id;
-
- struct nouveau_pushbuf *pushbuf;
-
- struct nouveau_grobj *nullobj;
- struct nouveau_grobj *vram;
- struct nouveau_grobj *gart;
-
- void *user_private;
- void (*hang_notify)(struct nouveau_channel *);
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_class.h b/src/gallium/drivers/nouveau/nouveau_class.h
deleted file mode 100644
index 3df3d7b2b8..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_class.h
+++ /dev/null
@@ -1,8006 +0,0 @@
-/*************************************************************************
-
- Autogenerated file, do not edit !
-
-**************************************************************************
-
- Copyright (C) 2006-2008 :
- Dmitry Baryshkov,
- Laurent Carlier,
- Matthieu Castet,
- Dawid Gajownik,
- Jeremy Kolb,
- Stephane Loeuillet,
- Patrice Mandin,
- Stephane Marchesin,
- Serge Martin,
- Sylvain Munaut,
- Simon Raffeiner,
- Ben Skeggs,
- Erik Waling,
- koala_br,
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 NOUVEAU_REG_H
-#define NOUVEAU_REG_H 1
-
-
-#define NV01_ROOT 0x00000001
-
-
-
-#define NV01_CONTEXT_DMA 0x00000002
-
-
-
-#define NV01_DEVICE 0x00000003
-
-
-
-#define NV01_TIMER 0x00000004
-
-#define NV01_TIMER_SYNCHRONIZE 0x00000100
-#define NV01_TIMER_STOP_ALARM 0x00000104
-#define NV01_TIMER_DMA_NOTIFY 0x00000180
-#define NV01_TIMER_TIME(x) (0x00000300+((x)*4))
-#define NV01_TIMER_TIME__SIZE 0x00000002
-#define NV01_TIMER_ALARM_NOTIFY 0x00000308
-
-
-#define NV_IMAGE_STENCIL 0x00000010
-
-#define NV_IMAGE_STENCIL_NOTIFY 0x00000104
-#define NV_IMAGE_STENCIL_DMA_NOTIFY 0x00000180
-#define NV_IMAGE_STENCIL_IMAGE_OUTPUT 0x00000200
-#define NV_IMAGE_STENCIL_IMAGE_INPUT(x) (0x00000204+((x)*4))
-#define NV_IMAGE_STENCIL_IMAGE_INPUT__SIZE 0x00000002
-
-
-#define NV_IMAGE_BLEND_AND 0x00000011
-
-#define NV_IMAGE_BLEND_AND_NOP 0x00000100
-#define NV_IMAGE_BLEND_AND_NOTIFY 0x00000104
-#define NV_IMAGE_BLEND_AND_DMA_NOTIFY 0x00000180
-#define NV_IMAGE_BLEND_AND_IMAGE_OUTPUT 0x00000200
-#define NV_IMAGE_BLEND_AND_BETA_INPUT 0x00000204
-#define NV_IMAGE_BLEND_AND_IMAGE_INPUT 0x00000208
-
-
-#define NV01_CONTEXT_BETA1 0x00000012
-
-#define NV01_CONTEXT_BETA1_NOP 0x00000100
-#define NV01_CONTEXT_BETA1_NOTIFY 0x00000104
-#define NV01_CONTEXT_BETA1_DMA_NOTIFY 0x00000180
-#define NV01_CONTEXT_BETA1_BETA_1D31 0x00000300
-
-
-#define NV_IMAGE_ROP_AND 0x00000013
-
-#define NV_IMAGE_ROP_AND_NOTIFY 0x00000104
-#define NV_IMAGE_ROP_AND_DMA_NOTIFY 0x00000180
-#define NV_IMAGE_ROP_AND_IMAGE_OUTPUT 0x00000200
-#define NV_IMAGE_ROP_AND_ROP_INPUT 0x00000204
-#define NV_IMAGE_ROP_AND_IMAGE_INPUT(x) (0x00000208+((x)*4))
-#define NV_IMAGE_ROP_AND_IMAGE_INPUT__SIZE 0x00000002
-
-
-#define NV_IMAGE_COLOR_KEY 0x00000015
-
-
-
-#define NV01_CONTEXT_COLOR_KEY 0x00000017
-
-#define NV01_CONTEXT_COLOR_KEY_NOP 0x00000100
-#define NV01_CONTEXT_COLOR_KEY_NOTIFY 0x00000104
-#define NV01_CONTEXT_COLOR_KEY_DMA_NOTIFY 0x00000180
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT 0x00000300
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16A8Y8 0x00000001
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X24Y8 0x00000002
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16A1R5G5B5 0x00000003
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X17R5G5B5 0x00000004
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_A8R8G8B8 0x00000005
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X8R8G8B8 0x00000006
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_A16Y16 0x00000007
-#define NV01_CONTEXT_COLOR_KEY_COLOR_FORMAT_X16Y16 0x00000008
-#define NV01_CONTEXT_COLOR_KEY_COLOR 0x00000304
-
-
-#define NV01_CONTEXT_PATTERN 0x00000018
-
-#define NV01_CONTEXT_PATTERN_NOP 0x00000100
-#define NV01_CONTEXT_PATTERN_NOTIFY 0x00000104
-#define NV01_CONTEXT_PATTERN_DMA_NOTIFY 0x00000180
-#define NV01_CONTEXT_PATTERN_COLOR_FORMAT 0x00000300
-#define NV01_CONTEXT_PATTERN_MONOCHROME_FORMAT 0x00000304
-#define NV01_CONTEXT_PATTERN_SHAPE 0x00000308
-#define NV01_CONTEXT_PATTERN_COLOR(x) (0x00000310+((x)*4))
-#define NV01_CONTEXT_PATTERN_COLOR__SIZE 0x00000002
-#define NV01_CONTEXT_PATTERN_PATTERN(x) (0x00000318+((x)*4))
-#define NV01_CONTEXT_PATTERN_PATTERN__SIZE 0x00000002
-
-
-#define NV01_CONTEXT_CLIP_RECTANGLE 0x00000019
-
-#define NV01_CONTEXT_CLIP_RECTANGLE_NOP 0x00000100
-#define NV01_CONTEXT_CLIP_RECTANGLE_NOTIFY 0x00000104
-#define NV01_CONTEXT_CLIP_RECTANGLE_DMA_NOTIFY 0x00000180
-#define NV01_CONTEXT_CLIP_RECTANGLE_POINT 0x00000300
-#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_X_SHIFT 0
-#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_X_MASK 0x0000ffff
-#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_Y_SHIFT 16
-#define NV01_CONTEXT_CLIP_RECTANGLE_POINT_Y_MASK 0xffff0000
-#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE 0x00000304
-#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_W_SHIFT 0
-#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_W_MASK 0x0000ffff
-#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_H_SHIFT 16
-#define NV01_CONTEXT_CLIP_RECTANGLE_SIZE_H_MASK 0xffff0000
-
-
-#define NV01_RENDER_SOLID_LINE 0x0000001c
-
-#define NV01_RENDER_SOLID_LINE_NOP 0x00000100
-#define NV01_RENDER_SOLID_LINE_NOTIFY 0x00000104
-#define NV01_RENDER_SOLID_LINE_PATCH 0x0000010c
-#define NV01_RENDER_SOLID_LINE_DMA_NOTIFY 0x00000180
-#define NV01_RENDER_SOLID_LINE_CLIP_RECTANGLE 0x00000184
-#define NV01_RENDER_SOLID_LINE_PATTERN 0x00000188
-#define NV01_RENDER_SOLID_LINE_ROP 0x0000018c
-#define NV01_RENDER_SOLID_LINE_BETA1 0x00000190
-#define NV01_RENDER_SOLID_LINE_SURFACE 0x00000194
-#define NV01_RENDER_SOLID_LINE_OPERATION 0x000002fc
-#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY_AND 0x00000000
-#define NV01_RENDER_SOLID_LINE_OPERATION_ROP_AND 0x00000001
-#define NV01_RENDER_SOLID_LINE_OPERATION_BLEND_AND 0x00000002
-#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY 0x00000003
-#define NV01_RENDER_SOLID_LINE_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV01_RENDER_SOLID_LINE_OPERATION_BLEND_PREMULT 0x00000005
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT 0x00000300
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16A8Y8 0x00000001
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X24Y8 0x00000002
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16A1R5G5B5 0x00000003
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X17R5G5B5 0x00000004
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_A8R8G8B8 0x00000005
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X8R8G8B8 0x00000006
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_A16Y16 0x00000007
-#define NV01_RENDER_SOLID_LINE_COLOR_FORMAT_X16Y16 0x00000008
-#define NV01_RENDER_SOLID_LINE_COLOR 0x00000304
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0(x) (0x00000400+((x)*8))
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0_X_SHIFT 0
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0_Y_SHIFT 16
-#define NV01_RENDER_SOLID_LINE_LINE_POINT0_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1(x) (0x00000404+((x)*8))
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1_X_SHIFT 0
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1_Y_SHIFT 16
-#define NV01_RENDER_SOLID_LINE_LINE_POINT1_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_X(x) (0x00000480+((x)*16))
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_X__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_Y(x) (0x00000484+((x)*16))
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT0_Y__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_X(x) (0x00000488+((x)*16))
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_X__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_Y(x) (0x0000048c+((x)*16))
-#define NV01_RENDER_SOLID_LINE_LINE32_POINT1_Y__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_POLYLINE(x) (0x00000500+((x)*4))
-#define NV01_RENDER_SOLID_LINE_POLYLINE__SIZE 0x00000020
-#define NV01_RENDER_SOLID_LINE_POLYLINE_X_SHIFT 0
-#define NV01_RENDER_SOLID_LINE_POLYLINE_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_LINE_POLYLINE_Y_SHIFT 16
-#define NV01_RENDER_SOLID_LINE_POLYLINE_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_X(x) (0x00000580+((x)*8))
-#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_X__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_Y(x) (0x00000584+((x)*8))
-#define NV01_RENDER_SOLID_LINE_POLYLINE32_POINT_Y__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_COLOR(x) (0x00000600+((x)*8))
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_COLOR__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT(x) (0x00000604+((x)*8))
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT__SIZE 0x00000010
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_X_SHIFT 0
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_Y_SHIFT 16
-#define NV01_RENDER_SOLID_LINE_CPOLYLINE_POINT_Y_MASK 0xffff0000
-
-
-#define NV01_RENDER_SOLID_TRIANGLE 0x0000001d
-
-#define NV01_RENDER_SOLID_TRIANGLE_NOP 0x00000100
-#define NV01_RENDER_SOLID_TRIANGLE_NOTIFY 0x00000104
-#define NV01_RENDER_SOLID_TRIANGLE_PATCH 0x0000010c
-#define NV01_RENDER_SOLID_TRIANGLE_DMA_NOTIFY 0x00000180
-#define NV01_RENDER_SOLID_TRIANGLE_CLIP_RECTANGLE 0x00000184
-#define NV01_RENDER_SOLID_TRIANGLE_PATTERN 0x00000188
-#define NV01_RENDER_SOLID_TRIANGLE_ROP 0x0000018c
-#define NV01_RENDER_SOLID_TRIANGLE_BETA1 0x00000190
-#define NV01_RENDER_SOLID_TRIANGLE_SURFACE 0x00000194
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION 0x000002fc
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY_AND 0x00000000
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_ROP_AND 0x00000001
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_BLEND_AND 0x00000002
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY 0x00000003
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV01_RENDER_SOLID_TRIANGLE_OPERATION_BLEND_PREMULT 0x00000005
-#define NV01_RENDER_SOLID_TRIANGLE_COLOR_FORMAT 0x00000300
-#define NV01_RENDER_SOLID_TRIANGLE_COLOR 0x00000304
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0 0x00000310
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT0_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1 0x00000314
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT1_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2 0x00000318
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE_POINT2_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT0_X 0x00000320
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT0_Y 0x00000324
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT1_X 0x00000328
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT1_Y 0x0000032c
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT2_X 0x00000330
-#define NV01_RENDER_SOLID_TRIANGLE_TRIANGLE32_POINT2_Y 0x00000334
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH(x) (0x00000400+((x)*4))
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH__SIZE 0x00000020
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_X(x) (0x00000480+((x)*8))
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_X__SIZE 0x00000010
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_Y(x) (0x00000484+((x)*8))
-#define NV01_RENDER_SOLID_TRIANGLE_TRIMESH32_POINT_Y__SIZE 0x00000010
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_COLOR(x) (0x00000500+((x)*16))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_COLOR__SIZE 0x00000008
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0(x) (0x00000504+((x)*16))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0__SIZE 0x00000008
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT0_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1(x) (0x00000508+((x)*16))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1__SIZE 0x00000008
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT1_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2(x) (0x0000050c+((x)*16))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2__SIZE 0x00000008
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIANGLE_POINT2_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_COLOR(x) (0x00000580+((x)*8))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_COLOR__SIZE 0x00000010
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT(x) (0x00000584+((x)*8))
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT__SIZE 0x00000010
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_X_SHIFT 0
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_Y_SHIFT 16
-#define NV01_RENDER_SOLID_TRIANGLE_CTRIMESH_POINT_Y_MASK 0xffff0000
-
-
-#define NV01_RENDER_SOLID_RECTANGLE 0x0000001e
-
-#define NV01_RENDER_SOLID_RECTANGLE_NOP 0x00000100
-#define NV01_RENDER_SOLID_RECTANGLE_NOTIFY 0x00000104
-#define NV01_RENDER_SOLID_RECTANGLE_PATCH 0x0000010c
-#define NV01_RENDER_SOLID_RECTANGLE_DMA_NOTIFY 0x00000180
-#define NV01_RENDER_SOLID_RECTANGLE_CLIP_RECTANGLE 0x00000184
-#define NV01_RENDER_SOLID_RECTANGLE_PATTERN 0x00000188
-#define NV01_RENDER_SOLID_RECTANGLE_ROP 0x0000018c
-#define NV01_RENDER_SOLID_RECTANGLE_BETA1 0x00000190
-#define NV01_RENDER_SOLID_RECTANGLE_SURFACE 0x00000194
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION 0x000002fc
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY_AND 0x00000000
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_ROP_AND 0x00000001
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_BLEND_AND 0x00000002
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY 0x00000003
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV01_RENDER_SOLID_RECTANGLE_OPERATION_BLEND_PREMULT 0x00000005
-#define NV01_RENDER_SOLID_RECTANGLE_COLOR_FORMAT 0x00000300
-#define NV01_RENDER_SOLID_RECTANGLE_COLOR 0x00000304
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT(x) (0x00000400+((x)*8))
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT__SIZE 0x00000010
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_X_SHIFT 0
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_X_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_Y_SHIFT 16
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_POINT_Y_MASK 0xffff0000
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE(x) (0x00000404+((x)*8))
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE__SIZE 0x00000010
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_W_SHIFT 0
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_W_MASK 0x0000ffff
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_H_SHIFT 16
-#define NV01_RENDER_SOLID_RECTANGLE_RECTANGLE_SIZE_H_MASK 0xffff0000
-
-
-#define NV01_IMAGE_BLIT 0x0000001f
-
-#define NV01_IMAGE_BLIT_NOP 0x00000100
-#define NV01_IMAGE_BLIT_NOTIFY 0x00000104
-#define NV01_IMAGE_BLIT_PATCH 0x0000010c
-#define NV01_IMAGE_BLIT_DMA_NOTIFY 0x00000180
-#define NV01_IMAGE_BLIT_COLOR_KEY 0x00000184
-#define NV01_IMAGE_BLIT_CLIP_RECTANGLE 0x00000188
-#define NV01_IMAGE_BLIT_PATTERN 0x0000018c
-#define NV01_IMAGE_BLIT_ROP 0x00000190
-#define NV01_IMAGE_BLIT_BETA1 0x00000194
-#define NV01_IMAGE_BLIT_SURFACE 0x0000019c
-#define NV01_IMAGE_BLIT_OPERATION 0x000002fc
-#define NV01_IMAGE_BLIT_IMAGE_INPUT 0x00000204
-#define NV01_IMAGE_BLIT_POINT_IN 0x00000300
-#define NV01_IMAGE_BLIT_POINT_IN_X_SHIFT 0
-#define NV01_IMAGE_BLIT_POINT_IN_X_MASK 0x0000ffff
-#define NV01_IMAGE_BLIT_POINT_IN_Y_SHIFT 16
-#define NV01_IMAGE_BLIT_POINT_IN_Y_MASK 0xffff0000
-#define NV01_IMAGE_BLIT_POINT_OUT 0x00000304
-#define NV01_IMAGE_BLIT_POINT_OUT_X_SHIFT 0
-#define NV01_IMAGE_BLIT_POINT_OUT_X_MASK 0x0000ffff
-#define NV01_IMAGE_BLIT_POINT_OUT_Y_SHIFT 16
-#define NV01_IMAGE_BLIT_POINT_OUT_Y_MASK 0xffff0000
-#define NV01_IMAGE_BLIT_SIZE 0x00000308
-#define NV01_IMAGE_BLIT_SIZE_W_SHIFT 0
-#define NV01_IMAGE_BLIT_SIZE_W_MASK 0x0000ffff
-#define NV01_IMAGE_BLIT_SIZE_H_SHIFT 16
-#define NV01_IMAGE_BLIT_SIZE_H_MASK 0xffff0000
-
-
-#define NV01_IMAGE_FROM_CPU 0x00000021
-
-#define NV01_IMAGE_FROM_CPU_NOP 0x00000100
-#define NV01_IMAGE_FROM_CPU_NOTIFY 0x00000104
-#define NV01_IMAGE_FROM_CPU_PATCH 0x0000010c
-#define NV01_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180
-#define NV01_IMAGE_FROM_CPU_COLOR_KEY 0x00000184
-#define NV01_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x00000188
-#define NV01_IMAGE_FROM_CPU_PATTERN 0x0000018c
-#define NV01_IMAGE_FROM_CPU_ROP 0x00000190
-#define NV01_IMAGE_FROM_CPU_BETA1 0x00000194
-#define NV01_IMAGE_FROM_CPU_SURFACE 0x00000198
-#define NV01_IMAGE_FROM_CPU_OPERATION 0x000002fc
-#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY_AND 0x00000000
-#define NV01_IMAGE_FROM_CPU_OPERATION_ROP_AND 0x00000001
-#define NV01_IMAGE_FROM_CPU_OPERATION_BLEND_AND 0x00000002
-#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY 0x00000003
-#define NV01_IMAGE_FROM_CPU_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV01_IMAGE_FROM_CPU_OPERATION_BLEND_PREMULT 0x00000005
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT 0x00000300
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_Y8 0x00000001
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_A1R5G5B5 0x00000002
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_X1R5G5B5 0x00000003
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_A8R8G8B8 0x00000004
-#define NV01_IMAGE_FROM_CPU_COLOR_FORMAT_X8R8G8B8 0x00000005
-#define NV01_IMAGE_FROM_CPU_POINT 0x00000304
-#define NV01_IMAGE_FROM_CPU_POINT_X_SHIFT 0
-#define NV01_IMAGE_FROM_CPU_POINT_X_MASK 0x0000ffff
-#define NV01_IMAGE_FROM_CPU_POINT_Y_SHIFT 16
-#define NV01_IMAGE_FROM_CPU_POINT_Y_MASK 0xffff0000
-#define NV01_IMAGE_FROM_CPU_SIZE_OUT 0x00000308
-#define NV01_IMAGE_FROM_CPU_SIZE_OUT_W_SHIFT 0
-#define NV01_IMAGE_FROM_CPU_SIZE_OUT_W_MASK 0x0000ffff
-#define NV01_IMAGE_FROM_CPU_SIZE_OUT_H_SHIFT 16
-#define NV01_IMAGE_FROM_CPU_SIZE_OUT_H_MASK 0xffff0000
-#define NV01_IMAGE_FROM_CPU_SIZE_IN 0x0000030c
-#define NV01_IMAGE_FROM_CPU_SIZE_IN_W_SHIFT 0
-#define NV01_IMAGE_FROM_CPU_SIZE_IN_W_MASK 0x0000ffff
-#define NV01_IMAGE_FROM_CPU_SIZE_IN_H_SHIFT 16
-#define NV01_IMAGE_FROM_CPU_SIZE_IN_H_MASK 0xffff0000
-#define NV01_IMAGE_FROM_CPU_COLOR(x) (0x00000400+((x)*4))
-#define NV01_IMAGE_FROM_CPU_COLOR__SIZE 0x00000020
-
-
-#define NV01_NULL 0x00000030
-
-
-
-#define NV03_STRETCHED_IMAGE_FROM_CPU 0x00000036
-
-#define NV03_STRETCHED_IMAGE_FROM_CPU_NOP 0x00000100
-#define NV03_STRETCHED_IMAGE_FROM_CPU_NOTIFY 0x00000104
-#define NV03_STRETCHED_IMAGE_FROM_CPU_PATCH 0x0000010c
-#define NV03_STRETCHED_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180
-#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR_KEY 0x00000184
-#define NV03_STRETCHED_IMAGE_FROM_CPU_PATTERN 0x00000188
-#define NV03_STRETCHED_IMAGE_FROM_CPU_ROP 0x0000018c
-#define NV03_STRETCHED_IMAGE_FROM_CPU_BETA1 0x00000190
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SURFACE 0x00000194
-#define NV03_STRETCHED_IMAGE_FROM_CPU_OPERATION 0x000002fc
-#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR_FORMAT 0x00000300
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN 0x00000304
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_W_SHIFT 0
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_W_MASK 0x0000ffff
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_H_SHIFT 16
-#define NV03_STRETCHED_IMAGE_FROM_CPU_SIZE_IN_H_MASK 0xffff0000
-#define NV03_STRETCHED_IMAGE_FROM_CPU_DX_DU 0x00000308
-#define NV03_STRETCHED_IMAGE_FROM_CPU_DY_DV 0x0000030c
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT 0x00000310
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_X_SHIFT 0
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_X_MASK 0x0000ffff
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_Y_SHIFT 16
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_POINT_Y_MASK 0xffff0000
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE 0x00000314
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_W_SHIFT 0
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_W_MASK 0x0000ffff
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_H_SHIFT 16
-#define NV03_STRETCHED_IMAGE_FROM_CPU_CLIP_SIZE_H_MASK 0xffff0000
-#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4 0x00000318
-#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_X_SHIFT 0
-#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_X_MASK 0x0000ffff
-#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_Y_SHIFT 16
-#define NV03_STRETCHED_IMAGE_FROM_CPU_POINT12D4_Y_MASK 0xffff0000
-#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR(x) (0x00000400+((x)*4))
-#define NV03_STRETCHED_IMAGE_FROM_CPU_COLOR__SIZE 0x00000020
-
-
-#define NV03_SCALED_IMAGE_FROM_MEMORY 0x00000037
-
-#define NV03_SCALED_IMAGE_FROM_MEMORY_NOP 0x00000100
-#define NV03_SCALED_IMAGE_FROM_MEMORY_NOTIFY 0x00000104
-#define NV03_SCALED_IMAGE_FROM_MEMORY_DMA_NOTIFY 0x00000180
-#define NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE 0x00000184
-#define NV03_SCALED_IMAGE_FROM_MEMORY_PATTERN 0x00000188
-#define NV03_SCALED_IMAGE_FROM_MEMORY_ROP 0x0000018c
-#define NV03_SCALED_IMAGE_FROM_MEMORY_BETA1 0x00000190
-#define NV03_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000194
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT 0x00000300
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5 0x00000001
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X1R5G5B5 0x00000002
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8 0x00000003
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8 0x00000004
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_V8YB8U8YA8 0x00000005
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_YB8V8YA8U8 0x00000006
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5 0x00000007
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8 0x00000008
-#define NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8 0x00000009
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_AND 0x00000000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_ROP_AND 0x00000001
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_AND 0x00000002
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY 0x00000003
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV03_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_PREMULT 0x00000005
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT 0x00000308
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_MASK 0xffff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_MASK 0xffff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT 0x00000310
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_X_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_X_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_Y_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_POINT_Y_MASK 0xffff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE 0x00000314
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_W_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_W_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_H_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_OUT_SIZE_H_MASK 0xffff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_DELTA_DU_DX 0x00000318
-#define NV03_SCALED_IMAGE_FROM_MEMORY_DELTA_DV_DY 0x0000031c
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE 0x00000400
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_W_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_W_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_H_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_SIZE_H_MASK 0xffff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT 0x00000404
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_PITCH_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_PITCH_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_MASK 0x00ff0000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_CENTER 0x00010000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_ORIGIN_CORNER 0x00020000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_INTERPOLATOR_SHIFT 24
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_FORMAT_INTERPOLATOR_MASK 0xff000000
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_OFFSET 0x00000408
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT 0x0000040c
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_U_SHIFT 0
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_U_MASK 0x0000ffff
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_V_SHIFT 16
-#define NV03_SCALED_IMAGE_FROM_MEMORY_IMAGE_IN_POINT_V_MASK 0xffff0000
-
-
-#define NV04_DVD_SUBPICTURE 0x00000038
-
-#define NV04_DVD_SUBPICTURE_NOP 0x00000100
-#define NV04_DVD_SUBPICTURE_NOTIFY 0x00000104
-#define NV04_DVD_SUBPICTURE_WAIT_FOR_IDLE 0x00000108
-#define NV04_DVD_SUBPICTURE_DMA_NOTIFY 0x00000180
-#define NV04_DVD_SUBPICTURE_DMA_OVERLAY 0x00000184
-#define NV04_DVD_SUBPICTURE_DMA_IMAGEIN 0x00000188
-#define NV04_DVD_SUBPICTURE_DMA_IMAGEOUT 0x0000018c
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT 0x00000300
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_X_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_X_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_Y_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_POINT_Y_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE 0x00000304
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_W_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_W_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_H_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_SIZE_H_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT 0x00000308
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_PITCH_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_PITCH_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_COLOR_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_FORMAT_COLOR_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_IMAGEOUT_OFFSET 0x0000030c
-#define NV04_DVD_SUBPICTURE_IMAGEIN_DELTA_DU_DX 0x00000310
-#define NV04_DVD_SUBPICTURE_IMAGEIN_DELTA_DV_DY 0x00000314
-#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE 0x00000318
-#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_W_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_W_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_H_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEIN_SIZE_H_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT 0x0000031c
-#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_PITCH_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_PITCH_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_COLOR_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEIN_FORMAT_COLOR_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_IMAGEIN_OFFSET 0x00000320
-#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT 0x00000324
-#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_U_SHIFT 0
-#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_U_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_V_SHIFT 16
-#define NV04_DVD_SUBPICTURE_IMAGEIN_POINT_V_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_OVERLAY_DELTA_DU_DX 0x00000328
-#define NV04_DVD_SUBPICTURE_OVERLAY_DELTA_DV_DY 0x0000032c
-#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE 0x00000330
-#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_W_SHIFT 0
-#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_W_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_H_SHIFT 16
-#define NV04_DVD_SUBPICTURE_OVERLAY_SIZE_H_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT 0x00000334
-#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_PITCH_SHIFT 0
-#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_PITCH_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_COLOR_SHIFT 16
-#define NV04_DVD_SUBPICTURE_OVERLAY_FORMAT_COLOR_MASK 0xffff0000
-#define NV04_DVD_SUBPICTURE_OVERLAY_OFFSET 0x00000338
-#define NV04_DVD_SUBPICTURE_OVERLAY_POINT 0x0000033c
-#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_U_SHIFT 0
-#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_U_MASK 0x0000ffff
-#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_V_SHIFT 16
-#define NV04_DVD_SUBPICTURE_OVERLAY_POINT_V_MASK 0xffff0000
-
-
-#define NV04_MEMORY_TO_MEMORY_FORMAT 0x00000039
-
-#define NV04_MEMORY_TO_MEMORY_FORMAT_NOP 0x00000100
-#define NV04_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104
-#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY 0x00000180
-#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN 0x00000184
-#define NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_OUT 0x00000188
-#define NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c
-#define NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_OUT 0x00000310
-#define NV04_MEMORY_TO_MEMORY_FORMAT_PITCH_IN 0x00000314
-#define NV04_MEMORY_TO_MEMORY_FORMAT_PITCH_OUT 0x00000318
-#define NV04_MEMORY_TO_MEMORY_FORMAT_LINE_LENGTH_IN 0x0000031c
-#define NV04_MEMORY_TO_MEMORY_FORMAT_LINE_COUNT 0x00000320
-#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT 0x00000324
-#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_INPUT_INC_SHIFT 0
-#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_INPUT_INC_MASK 0x0000000f
-#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_OUTPUT_INC_SHIFT 8
-#define NV04_MEMORY_TO_MEMORY_FORMAT_FORMAT_OUTPUT_INC_MASK 0x00000f00
-#define NV04_MEMORY_TO_MEMORY_FORMAT_BUF_NOTIFY 0x00000328
-
-
-#define NV01_MEMORY_LOCAL_BANKED 0x0000003d
-
-
-
-#define NV01_MAPPING_SYSTEM 0x0000003e
-
-
-
-#define NV03_MEMORY_LOCAL_CURSOR 0x0000003f
-
-
-
-#define NV01_MEMORY_LOCAL_LINEAR 0x00000040
-
-
-
-#define NV01_MAPPING_LOCAL 0x00000041
-
-
-
-#define NV04_CONTEXT_SURFACES_2D 0x00000042
-
-#define NV04_CONTEXT_SURFACES_2D_NOP 0x00000100
-#define NV04_CONTEXT_SURFACES_2D_NOTIFY 0x00000104
-#define NV04_CONTEXT_SURFACES_2D_PM_TRIGGER 0x00000140
-#define NV04_CONTEXT_SURFACES_2D_DMA_NOTIFY 0x00000180
-#define NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE 0x00000184
-#define NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_DESTIN 0x00000188
-#define NV04_CONTEXT_SURFACES_2D_FORMAT 0x00000300
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y8 0x00000001
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1R5G5B5_Z1R5G5B5 0x00000002
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1R5G5B5_X1R5G5B5 0x00000003
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5 0x00000004
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y16 0x00000005
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X8R8G8B8_Z8R8G8B8 0x00000006
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X8R8G8B8_X8R8G8B8 0x00000007
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1A7R8G8B8_Z1A7R8G8B8 0x00000008
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_X1A7R8G8B8_X1A7R8G8B8 0x00000009
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8 0x0000000a
-#define NV04_CONTEXT_SURFACES_2D_FORMAT_Y32 0x0000000b
-#define NV04_CONTEXT_SURFACES_2D_PITCH 0x00000304
-#define NV04_CONTEXT_SURFACES_2D_PITCH_SOURCE_SHIFT 0
-#define NV04_CONTEXT_SURFACES_2D_PITCH_SOURCE_MASK 0x0000ffff
-#define NV04_CONTEXT_SURFACES_2D_PITCH_DESTIN_SHIFT 16
-#define NV04_CONTEXT_SURFACES_2D_PITCH_DESTIN_MASK 0xffff0000
-#define NV04_CONTEXT_SURFACES_2D_OFFSET_SOURCE 0x00000308
-#define NV04_CONTEXT_SURFACES_2D_OFFSET_DESTIN 0x0000030c
-
-
-#define NV03_CONTEXT_ROP 0x00000043
-
-#define NV03_CONTEXT_ROP_NOP 0x00000100
-#define NV03_CONTEXT_ROP_NOTIFY 0x00000104
-#define NV03_CONTEXT_ROP_DMA_NOTIFY 0x00000180
-#define NV03_CONTEXT_ROP_ROP 0x00000300
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_SHIFT 0
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_MASK 0x0000000f
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_CLEAR 0x00000000
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NOR 0x00000001
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND_INVERTED 0x00000002
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_COPY_INVERTED 0x00000003
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND_REVERSE 0x00000004
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_INVERT 0x00000005
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_XOR 0x00000006
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NAND 0x00000007
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_AND 0x00000008
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_EQUI 0x00000009
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_NOOP 0x0000000a
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR_INVERTED 0x0000000b
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_COPY 0x0000000c
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR_REVERSE 0x0000000d
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_OR 0x0000000e
-#define NV03_CONTEXT_ROP_ROP_DST_LOGIC_OP_SET 0x0000000f
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_SHIFT 4
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_MASK 0x000000f0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_CLEAR 0x00000000
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NOR 0x00000010
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND_INVERTED 0x00000020
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_COPY_INVERTED 0x00000030
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND_REVERSE 0x00000040
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_INVERT 0x00000050
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_XOR 0x00000060
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NAND 0x00000070
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_AND 0x00000080
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_EQUI 0x00000090
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_NOOP 0x000000a0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR_INVERTED 0x000000b0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_COPY 0x000000c0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR_REVERSE 0x000000d0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_OR 0x000000e0
-#define NV03_CONTEXT_ROP_ROP_SRC_LOGIC_OP_SET 0x000000f0
-
-
-#define NV04_IMAGE_PATTERN 0x00000044
-
-#define NV04_IMAGE_PATTERN_NOP 0x00000100
-#define NV04_IMAGE_PATTERN_NOTIFY 0x00000104
-#define NV04_IMAGE_PATTERN_DMA_NOTIFY 0x00000180
-#define NV04_IMAGE_PATTERN_COLOR_FORMAT 0x00000300
-#define NV04_IMAGE_PATTERN_COLOR_FORMAT_A16R5G6B5 0x00000001
-#define NV04_IMAGE_PATTERN_COLOR_FORMAT_X16A1R5G5B5 0x00000002
-#define NV04_IMAGE_PATTERN_COLOR_FORMAT_A8R8G8B8 0x00000003
-#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT 0x00000304
-#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT_CGA6 0x00000001
-#define NV04_IMAGE_PATTERN_MONOCHROME_FORMAT_LE 0x00000002
-#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE 0x00000308
-#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_8X8 0x00000000
-#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_64X1 0x00000001
-#define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE_1X64 0x00000002
-#define NV04_IMAGE_PATTERN_PATTERN_SELECT 0x0000030c
-#define NV04_IMAGE_PATTERN_PATTERN_SELECT_MONO 0x00000001
-#define NV04_IMAGE_PATTERN_PATTERN_SELECT_COLOR 0x00000002
-#define NV04_IMAGE_PATTERN_MONOCHROME_COLOR0 0x00000310
-#define NV04_IMAGE_PATTERN_MONOCHROME_COLOR1 0x00000314
-#define NV04_IMAGE_PATTERN_MONOCHROME_PATTERN0 0x00000318
-#define NV04_IMAGE_PATTERN_MONOCHROME_PATTERN1 0x0000031c
-#define NV04_IMAGE_PATTERN_PATTERN_Y8(x) (0x00000400+((x)*4))
-#define NV04_IMAGE_PATTERN_PATTERN_Y8__SIZE 0x00000010
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y0_SHIFT 0
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y0_MASK 0x000000ff
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y1_SHIFT 8
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y1_MASK 0x0000ff00
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y2_SHIFT 16
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y2_MASK 0x00ff0000
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y3_SHIFT 24
-#define NV04_IMAGE_PATTERN_PATTERN_Y8_Y3_MASK 0xff000000
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5(x) (0x00000500+((x)*4))
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5__SIZE 0x00000020
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B0_SHIFT 0
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B0_MASK 0x0000001f
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G0_SHIFT 5
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G0_MASK 0x000007e0
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R0_SHIFT 11
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R0_MASK 0x0000f800
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B1_SHIFT 16
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_B1_MASK 0x001f0000
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G1_SHIFT 21
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_G1_MASK 0x07e00000
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R1_SHIFT 27
-#define NV04_IMAGE_PATTERN_PATTERN_R5G6B5_R1_MASK 0xf8000000
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5(x) (0x00000600+((x)*4))
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5__SIZE 0x00000020
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B0_SHIFT 0
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B0_MASK 0x0000001f
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G0_SHIFT 5
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G0_MASK 0x000003e0
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R0_SHIFT 10
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R0_MASK 0x00007c00
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B1_SHIFT 16
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_B1_MASK 0x001f0000
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G1_SHIFT 21
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_G1_MASK 0x03e00000
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R1_SHIFT 26
-#define NV04_IMAGE_PATTERN_PATTERN_X1R5G5B5_R1_MASK 0x7c000000
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8(x) (0x00000700+((x)*4))
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8__SIZE 0x00000040
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_B_SHIFT 0
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_B_MASK 0x000000ff
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_G_SHIFT 8
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_G_MASK 0x0000ff00
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_R_SHIFT 16
-#define NV04_IMAGE_PATTERN_PATTERN_X8R8G8B8_R_MASK 0x00ff0000
-
-
-#define NV03_VIDEO_LUT_CURSOR_DAC 0x00000046
-
-#define NV03_VIDEO_LUT_CURSOR_DAC_SYNCHRONIZE 0x00000100
-#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_IMAGE 0x00000104
-#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_CURSOR 0x00000108
-#define NV03_VIDEO_LUT_CURSOR_DAC_STOP_DAC 0x0000010c
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_NOTIFY 0x00000180
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_IMAGE(x) (0x00000184+((x)*4))
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_IMAGE__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_LUT(x) (0x0000018c+((x)*4))
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_LUT__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_CURSOR(x) (0x00000194+((x)*4))
-#define NV03_VIDEO_LUT_CURSOR_DAC_DMA_CURSOR__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_GET 0x000002fc
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_OFFSET(x) (0x00000300+((x)*8))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_OFFSET__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT(x) (0x00000304+((x)*8))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_PITCH_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_PITCH_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_COLOR_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_COLOR_MASK 0x0fff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_NOTIFY_SHIFT 28
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_IMAGE_FORMAT_NOTIFY_MASK 0xf0000000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_OFFSET(x) (0x00000340+((x)*12))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_OFFSET__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT(x) (0x00000344+((x)*12))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_X_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_X_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_Y_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_Y_MASK 0xffff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_FORMAT(x) (0x00000348+((x)*12))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_FORMAT__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A 0x00000358
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_X_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_X_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_Y_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_CURSOR_POINT_OUT_A_Y_MASK 0xffff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE(x) (0x00000380+((x)*16))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_W_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_W_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_H_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_IMAGE_SIZE_H_MASK 0xffff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC(x) (0x00000384+((x)*16))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_START_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_START_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_WIDTH_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_WIDTH_MASK 0x0fff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_POLARITY_SHIFT 28
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_HSYNC_POLARITY_MASK 0xf0000000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC(x) (0x00000388+((x)*16))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_START_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_START_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_WIDTH_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_WIDTH_MASK 0x0fff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_POLARITY_SHIFT 28
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_VSYNC_POLARITY_MASK 0xf0000000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE(x) (0x0000038c+((x)*16))
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE__SIZE 0x00000002
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_WIDTH_SHIFT 0
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_WIDTH_MASK 0x0000ffff
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_HEIGHT_SHIFT 16
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_HEIGHT_MASK 0x0fff0000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_NOTIFY_SHIFT 28
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_DAC_TOTAL_SIZE_NOTIFY_MASK 0xf0000000
-#define NV03_VIDEO_LUT_CURSOR_DAC_SET_PIXEL_CLOCK 0x000003a0
-
-
-#define NV03_DX3_TEXTURED_TRIANGLE 0x00000048
-
-#define NV03_DX3_TEXTURED_TRIANGLE_NOP 0x00000100
-#define NV03_DX3_TEXTURED_TRIANGLE_NOTIFY 0x00000104
-#define NV03_DX3_TEXTURED_TRIANGLE_PATCH 0x0000010c
-#define NV03_DX3_TEXTURED_TRIANGLE_DMA_NOTIFY 0x00000180
-#define NV03_DX3_TEXTURED_TRIANGLE_DMA_TEXTURE 0x00000184
-#define NV03_DX3_TEXTURED_TRIANGLE_CLIP_RECTANGLE 0x00000188
-#define NV03_DX3_TEXTURED_TRIANGLE_SURFACE 0x0000018c
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_OFFSET 0x00000304
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT 0x00000308
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_MASK_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_MASK_MASK 0x0000ffff
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_ENABLE_SHIFT 16
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_KEY_ENABLE_MASK 0x000f0000
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_SHIFT 20
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_COLOR_MASK 0x00f00000
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MIN_SHIFT 24
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MIN_MASK 0x0f000000
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MAX_SHIFT 28
-#define NV03_DX3_TEXTURED_TRIANGLE_TEXTURE_FORMAT_SIZE_MAX_MASK 0xf0000000
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER 0x0000030c
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_X_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_X_MASK 0x0000001f
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_Y_SHIFT 8
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SPREAD_Y_MASK 0x00001f00
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SIZE_ADJUST_SHIFT 16
-#define NV03_DX3_TEXTURED_TRIANGLE_FILTER_SIZE_ADJUST_MASK 0x00ff0000
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR 0x00000310
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_B_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_B_MASK 0x000000ff
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_G_SHIFT 8
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_G_MASK 0x0000ff00
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_R_SHIFT 16
-#define NV03_DX3_TEXTURED_TRIANGLE_FOG_COLOR_R_MASK 0x00ff0000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT 0x00000314
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_INTERPOLATOR_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_INTERPOLATOR_MASK 0x0000000f
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_U_SHIFT 4
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_U_MASK 0x00000030
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_V_SHIFT 6
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_WRAP_V_MASK 0x000000c0
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SOURCE_COLOR_SHIFT 8
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SOURCE_COLOR_MASK 0x00000f00
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_CULLING_SHIFT 12
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_CULLING_MASK 0x00007000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_PERSPECTIVE_ENABLE (1 << 15)
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_FUNC_SHIFT 16
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_FUNC_MASK 0x000f0000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_WRITE_ENABLE_SHIFT 20
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_Z_WRITE_ENABLE_MASK 0x00f00000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_COLOR_WRITE_ENABLE_SHIFT 24
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_COLOR_WRITE_ENABLE_MASK 0x07000000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_ROP_SHIFT 27
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_ROP_MASK 0x18000000
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_BETA (1 << 29)
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_DST_BLEND (1 << 30)
-#define NV03_DX3_TEXTURED_TRIANGLE_CONTROL_OUT_SRC_BLEND (1 << 31)
-#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL 0x00000318
-#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_REF_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_REF_MASK 0x000000ff
-#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_FUNC_SHIFT 8
-#define NV03_DX3_TEXTURED_TRIANGLE_ALPHA_CONTROL_ALPHA_FUNC_MASK 0xffffff00
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR(x) (0x00001000+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I0_SHIFT 0
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I0_MASK 0x0000000f
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I1_SHIFT 4
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I1_MASK 0x000000f0
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I2_SHIFT 8
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I2_MASK 0x00000f00
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I3_SHIFT 12
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I3_MASK 0x0000f000
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I4_SHIFT 16
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I4_MASK 0x000f0000
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I5_SHIFT 20
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_I5_MASK 0x00f00000
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_FOG_SHIFT 24
-#define NV03_DX3_TEXTURED_TRIANGLE_SPECULAR_FOG_MASK 0xff000000
-#define NV03_DX3_TEXTURED_TRIANGLE_COLOR(x) (0x00001004+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_COLOR__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_X(x) (0x00001008+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_X__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_Y(x) (0x0000100c+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_Y__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_Z(x) (0x00001010+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_Z__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_M(x) (0x00001014+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_M__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_U(x) (0x00001018+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_U__SIZE 0x00000040
-#define NV03_DX3_TEXTURED_TRIANGLE_V(x) (0x0000101c+((x)*32))
-#define NV03_DX3_TEXTURED_TRIANGLE_V__SIZE 0x00000040
-
-
-#define NV04_GDI_RECTANGLE_TEXT 0x0000004a
-
-#define NV04_GDI_RECTANGLE_TEXT_NOP 0x00000100
-#define NV04_GDI_RECTANGLE_TEXT_NOTIFY 0x00000104
-#define NV04_GDI_RECTANGLE_TEXT_PATCH 0x0000010c
-#define NV04_GDI_RECTANGLE_TEXT_PM_TRIGGER 0x00000140
-#define NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY 0x00000180
-#define NV04_GDI_RECTANGLE_TEXT_DMA_FONTS 0x00000184
-#define NV04_GDI_RECTANGLE_TEXT_PATTERN 0x00000188
-#define NV04_GDI_RECTANGLE_TEXT_ROP 0x0000018c
-#define NV04_GDI_RECTANGLE_TEXT_BETA1 0x00000190
-#define NV04_GDI_RECTANGLE_TEXT_BETA4 0x00000194
-#define NV04_GDI_RECTANGLE_TEXT_SURFACE 0x00000198
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION 0x000002fc
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY_AND 0x00000000
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_ROP_AND 0x00000001
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_BLEND_AND 0x00000002
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY 0x00000003
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV04_GDI_RECTANGLE_TEXT_OPERATION_BLEND_PREMULT 0x00000005
-#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT 0x00000300
-#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5 0x00000001
-#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_X16A1R5G5B5 0x00000002
-#define NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8 0x00000003
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT 0x00000304
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_CGA6 0x00000001
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE 0x00000002
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_A 0x000003fc
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(x) (0x00000400+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT__SIZE 0x00000020
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE(x) (0x00000404+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE__SIZE 0x00000020
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0 0x000005f4
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1 0x000005f8
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_B_POINT1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_B 0x000005fc
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0(x) (0x00000600+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0__SIZE 0x00000020
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1(x) (0x00000604+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1__SIZE 0x00000020
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0 0x000007ec
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1 0x000007f0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_C 0x000007f4
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_C 0x000007f8
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_W_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_W_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_H_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_C_H_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_POINT_C 0x000007fc
-#define NV04_GDI_RECTANGLE_TEXT_POINT_C_X_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_POINT_C_X_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_POINT_C_Y_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_POINT_C_Y_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C(x) (0x00000800+((x)*4))
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C__SIZE 0x00000080
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0 0x00000be4
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1 0x00000be8
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_COLOR0_E 0x00000bec
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_E 0x00000bf0
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E 0x00000bf4
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E 0x00000bf8
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_POINT_E 0x00000bfc
-#define NV04_GDI_RECTANGLE_TEXT_POINT_E_X_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_POINT_E_X_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_POINT_E_Y_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_POINT_E_Y_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E(x) (0x00000c00+((x)*4))
-#define NV04_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E__SIZE 0x00000080
-#define NV04_GDI_RECTANGLE_TEXT_FONT_F 0x00000ff0
-#define NV04_GDI_RECTANGLE_TEXT_FONT_F_OFFSET_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_FONT_F_OFFSET_MASK 0x0fffffff
-#define NV04_GDI_RECTANGLE_TEXT_FONT_F_PITCH_SHIFT 28
-#define NV04_GDI_RECTANGLE_TEXT_FONT_F_PITCH_MASK 0xf0000000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0 0x00000ff4
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1 0x00000ff8
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_F_POINT1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_F 0x00000ffc
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F(x) (0x00001000+((x)*4))
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F__SIZE 0x00000100
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_INDEX_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_INDEX_MASK 0x000000ff
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_X_SHIFT 8
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_X_MASK 0x000fff00
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_Y_SHIFT 20
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_F_Y_MASK 0xfff00000
-#define NV04_GDI_RECTANGLE_TEXT_FONT_G 0x000017f0
-#define NV04_GDI_RECTANGLE_TEXT_FONT_G_OFFSET_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_FONT_G_OFFSET_MASK 0x0fffffff
-#define NV04_GDI_RECTANGLE_TEXT_FONT_G_PITCH_SHIFT 28
-#define NV04_GDI_RECTANGLE_TEXT_FONT_G_PITCH_MASK 0xf0000000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0 0x000017f4
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_L_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_L_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_T_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT0_T_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1 0x000017f8
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_R_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_R_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_B_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CLIP_G_POINT1_B_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_COLOR1_G 0x000017fc
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT(x) (0x00001800+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT__SIZE 0x00000100
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_X_SHIFT 0
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_X_MASK 0x0000ffff
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_Y_SHIFT 16
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_POINT_Y_MASK 0xffff0000
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_INDEX(x) (0x00001804+((x)*8))
-#define NV04_GDI_RECTANGLE_TEXT_CHARACTER_COLOR1_G_INDEX__SIZE 0x00000100
-
-
-#define NV03_GDI_RECTANGLE_TEXT 0x0000004b
-
-#define NV03_GDI_RECTANGLE_TEXT_NOP 0x00000100
-#define NV03_GDI_RECTANGLE_TEXT_NOTIFY 0x00000104
-#define NV03_GDI_RECTANGLE_TEXT_DMA_NOTIFY 0x00000180
-#define NV03_GDI_RECTANGLE_TEXT_PATTERN 0x00000184
-#define NV03_GDI_RECTANGLE_TEXT_ROP 0x00000188
-#define NV03_GDI_RECTANGLE_TEXT_BETA1 0x0000018c
-#define NV03_GDI_RECTANGLE_TEXT_SURFACE 0x00000190
-#define NV03_GDI_RECTANGLE_TEXT_OPERATION 0x000002fc
-#define NV03_GDI_RECTANGLE_TEXT_COLOR_FORMAT 0x00000300
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT 0x00000304
-#define NV03_GDI_RECTANGLE_TEXT_COLOR1_A 0x000003fc
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT 0x00000400
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_Y_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT_X_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE 0x00000404
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_H_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_SIZE_W_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B 0x000007f4
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_L_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_L_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_T_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT0_B_T_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B 0x000007f8
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_R_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_R_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_B_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_POINT1_B_B_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_COLOR1_B 0x000007fc
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0 0x00000800
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_L_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_0_T_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1 0x00000804
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_R_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIPPED_RECTANGLE_POINT_1_B_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0 0x00000bec
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_L_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT0_T_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1 0x00000bf0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_R_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_C_POINT1_B_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_COLOR1_C 0x00000bf4
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_C 0x00000bf8
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_W_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_W_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_H_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_C_H_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_POINT_C 0x00000bfc
-#define NV03_GDI_RECTANGLE_TEXT_POINT_C_X_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_POINT_C_X_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_POINT_C_Y_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_POINT_C_Y_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C(x) (0x00000c00+((x)*4))
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_C__SIZE 0x00000020
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0 0x00000fe8
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_L_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_L_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_T_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT0_T_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1 0x00000fec
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_R_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_R_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_B_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_D_POINT1_B_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_COLOR1_D 0x00000ff0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D 0x00000ff4
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_W_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_W_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_H_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_D_H_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D 0x00000ff8
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_W_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_W_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_H_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_D_H_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_POINT_D 0x00000ffc
-#define NV03_GDI_RECTANGLE_TEXT_POINT_D_X_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_POINT_D_X_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_POINT_D_Y_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_POINT_D_Y_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_D(x) (0x00001000+((x)*4))
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR1_D__SIZE 0x00000020
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0 0x000013e4
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_L_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT0_T_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1 0x000013e8
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_R_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_CLIP_E_POINT1_B_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_COLOR0_E 0x000013ec
-#define NV03_GDI_RECTANGLE_TEXT_COLOR1_E 0x000013f0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E 0x000013f4
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_W_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_IN_E_H_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E 0x000013f8
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_W_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_SIZE_OUT_E_H_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_POINT_E 0x000013fc
-#define NV03_GDI_RECTANGLE_TEXT_POINT_E_X_SHIFT 0
-#define NV03_GDI_RECTANGLE_TEXT_POINT_E_X_MASK 0x0000ffff
-#define NV03_GDI_RECTANGLE_TEXT_POINT_E_Y_SHIFT 16
-#define NV03_GDI_RECTANGLE_TEXT_POINT_E_Y_MASK 0xffff0000
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E(x) (0x00001400+((x)*4))
-#define NV03_GDI_RECTANGLE_TEXT_MONOCHROME_COLOR01_E__SIZE 0x00000020
-
-
-#define NV04_SWIZZLED_SURFACE 0x00000052
-
-#define NV04_SWIZZLED_SURFACE_NOP 0x00000100
-#define NV04_SWIZZLED_SURFACE_NOTIFY 0x00000104
-#define NV04_SWIZZLED_SURFACE_DMA_NOTIFY 0x00000180
-#define NV04_SWIZZLED_SURFACE_DMA_IMAGE 0x00000184
-#define NV04_SWIZZLED_SURFACE_FORMAT 0x00000300
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_SHIFT 0
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_MASK 0x000000ff
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8 0x00000001
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1R5G5B5_Z1R5G5B5 0x00000002
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1R5G5B5_X1R5G5B5 0x00000003
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_R5G6B5 0x00000004
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y16 0x00000005
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X8R8G8B8_Z8R8G8B8 0x00000006
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X8R8G8B8_X8R8G8B8 0x00000007
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1A7R8G8B8_Z1A7R8G8B8 0x00000008
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_X1A7R8G8B8_X1A7R8G8B8 0x00000009
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_A8R8G8B8 0x0000000a
-#define NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y32 0x0000000b
-#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT 16
-#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_MASK 0x00ff0000
-#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT 24
-#define NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_MASK 0xff000000
-#define NV04_SWIZZLED_SURFACE_OFFSET 0x00000304
-
-
-#define NV04_CONTEXT_SURFACES_3D 0x00000053
-
-#define NV04_CONTEXT_SURFACES_3D_NOP 0x00000100
-#define NV04_CONTEXT_SURFACES_3D_NOTIFY 0x00000104
-#define NV04_CONTEXT_SURFACES_3D_DMA_NOTIFY 0x00000180
-#define NV04_CONTEXT_SURFACES_3D_DMA_COLOR 0x00000184
-#define NV04_CONTEXT_SURFACES_3D_DMA_ZETA 0x00000188
-#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL 0x000002f8
-#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_X_SHIFT 0
-#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_X_MASK 0x0000ffff
-#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_W_SHIFT 16
-#define NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL_W_MASK 0xffff0000
-#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL 0x000002fc
-#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_Y_SHIFT 0
-#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_Y_MASK 0x0000ffff
-#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_H_SHIFT 16
-#define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL_H_MASK 0xffff0000
-#define NV04_CONTEXT_SURFACES_3D_FORMAT 0x00000300
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_SHIFT 0
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_MASK 0x000000ff
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1R5G5B5_Z1R5G5B5 0x00000001
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1R5G5B5_X1R5G5B5 0x00000002
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5 0x00000003
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_Z8R8G8B8 0x00000004
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8 0x00000005
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1A7R8G8B8_Z1A7R8G8B8 0x00000006
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X1A7R8G8B8_X1A7R8G8B8 0x00000007
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8 0x00000008
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_SHIFT 8
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_MASK 0x0000ff00
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_PITCH 0x00000100
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_SWIZZLE 0x00000200
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_U_SHIFT 16
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_U_MASK 0x00ff0000
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_V_SHIFT 24
-#define NV04_CONTEXT_SURFACES_3D_FORMAT_BASE_SIZE_V_MASK 0xff000000
-#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE 0x00000304
-#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_W_SHIFT 0
-#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_W_MASK 0x0000ffff
-#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_H_SHIFT 16
-#define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE_H_MASK 0xffff0000
-#define NV04_CONTEXT_SURFACES_3D_PITCH 0x00000308
-#define NV04_CONTEXT_SURFACES_3D_PITCH_COLOR_SHIFT 0
-#define NV04_CONTEXT_SURFACES_3D_PITCH_COLOR_MASK 0x0000ffff
-#define NV04_CONTEXT_SURFACES_3D_PITCH_ZETA_SHIFT 16
-#define NV04_CONTEXT_SURFACES_3D_PITCH_ZETA_MASK 0xffff0000
-#define NV04_CONTEXT_SURFACES_3D_OFFSET_COLOR 0x0000030c
-#define NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA 0x00000310
-
-
-#define NV04_DX5_TEXTURED_TRIANGLE 0x00000054
-
-#define NV04_DX5_TEXTURED_TRIANGLE_NOP 0x00000100
-#define NV04_DX5_TEXTURED_TRIANGLE_NOTIFY 0x00000104
-#define NV04_DX5_TEXTURED_TRIANGLE_DMA_NOTIFY 0x00000180
-#define NV04_DX5_TEXTURED_TRIANGLE_DMA_A 0x00000184
-#define NV04_DX5_TEXTURED_TRIANGLE_DMA_B 0x00000188
-#define NV04_DX5_TEXTURED_TRIANGLE_SURFACE 0x0000018c
-#define NV04_DX5_TEXTURED_TRIANGLE_COLORKEY 0x00000300
-#define NV04_DX5_TEXTURED_TRIANGLE_OFFSET 0x00000304
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT 0x00000308
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_DMA_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_DMA_MASK 0x00000003
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_KEY_MATCH_SHIFT 2
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_KEY_MATCH_MASK 0x0000000c
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_SHIFT 4
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_MASK 0x00000030
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_CENTER 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_ZOH_CORNER 0x00000020
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_SHIFT 6
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_MASK 0x000000c0
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_CENTER 0x00000040
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ORIGIN_FOH_CORNER 0x00000080
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_MASK 0x00000f00
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8 0x00000100
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5 0x00000200
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_X1R5G5B5 0x00000300
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4 0x00000400
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5 0x00000500
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8 0x00000600
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_COLOR_X8R8G8B8 0x00000700
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_MIPMAP_LEVELS_SHIFT 12
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_MIPMAP_LEVELS_MASK 0x0000f000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_U_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_U_MASK 0x000f0000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_V_SHIFT 20
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_BASE_SIZE_V_MASK 0x00f00000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_MASK 0x07000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_REPEAT 0x01000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_MIRRORED_REPEAT 0x02000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP_TO_EDGE 0x03000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP_TO_BORDER 0x04000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_CLAMP 0x05000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_WRAPU (1 << 27)
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_SHIFT 28
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_MASK 0x70000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_REPEAT 0x10000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_MIRRORED_REPEAT 0x20000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP_TO_EDGE 0x30000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP_TO_BORDER 0x40000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_CLAMP 0x50000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FORMAT_WRAPV (1 << 31)
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER 0x0000030c
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_X_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_X_MASK 0x000000ff
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_Y_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_KERNEL_SIZE_Y_MASK 0x00007f00
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_DITHER_ENABLE (1 << 15)
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_LODBIAS_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MIPMAP_LODBIAS_MASK 0x00ff0000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_MASK 0x07000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST 0x01000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR 0x02000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x03000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x04000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x05000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x06000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_ANISOTROPIC_MINIFY_ENABLE (1 << 27)
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_SHIFT 28
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_MASK 0x70000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_NEAREST 0x10000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_MAGNIFY_LINEAR 0x20000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FILTER_ANISOTROPIC_MAGNIFY_ENABLE (1 << 31)
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND 0x00000310
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_MAP_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_MAP_MASK 0x0000000f
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_MASK_BIT_SHIFT 4
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_MASK_BIT_MASK 0x00000030
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_SHIFT 6
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_MASK 0x000000c0
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_FLAT 0x00000040
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_GOURAUD 0x00000080
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_PHONG 0x000000c0
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_MASK 0x00000f00
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE_SHIFT 12
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE_MASK 0x0000f000
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE_MASK 0x000f0000
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_ALPHA_ENABLE_SHIFT 20
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_ALPHA_ENABLE_MASK 0x00f00000
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SRC_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_SRC_MASK 0x0f000000
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_DST_SHIFT 28
-#define NV04_DX5_TEXTURED_TRIANGLE_BLEND_DST_MASK 0xf0000000
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL 0x00000314
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_REF_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_REF_MASK 0x000000ff
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_FUNC_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_FUNC_MASK 0x00000f00
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_TEST_ENABLE (1 << 12)
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ORIGIN (1 << 13)
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE_SHIFT 14
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE_MASK 0x0000c000
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FUNC_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FUNC_MASK 0x000f0000
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_SHIFT 20
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_MASK 0x00300000
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_DITHER_ENABLE (1 << 22)
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_PERSPECTIVE_ENABLE (1 << 23)
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_WRITE_ENABLE_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_WRITE_ENABLE_MASK 0x3f000000
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FORMAT_SHIFT 30
-#define NV04_DX5_TEXTURED_TRIANGLE_CONTROL_Z_FORMAT_MASK 0xc0000000
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR 0x00000318
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_B_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_B_MASK 0x000000ff
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_G_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_G_MASK 0x0000ff00
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_R_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_R_MASK 0x00ff0000
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_A_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_FOGCOLOR_A_MASK 0xff000000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(x) (0x00000400+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SY(x) (0x00000404+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SY__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SZ(x) (0x00000408+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SZ__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_RHW(x) (0x0000040c+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_RHW__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR(x) (0x00000410+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_B_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_B_MASK 0x000000ff
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_G_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_G_MASK 0x0000ff00
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_R_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_R_MASK 0x00ff0000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_A_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_COLOR_A_MASK 0xff000000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR(x) (0x00000414+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_B_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_B_MASK 0x000000ff
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_G_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_G_MASK 0x0000ff00
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_R_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_R_MASK 0x00ff0000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_FOG_SHIFT 24
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SPECULAR_FOG_MASK 0xff000000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TU(x) (0x00000418+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TU__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TV(x) (0x0000041c+((x)*32))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_TV__SIZE 0x00000010
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE(x) (0x00000600+((x)*4))
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE__SIZE 0x00000040
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I0_SHIFT 0
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I0_MASK 0x0000000f
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I1_SHIFT 4
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I1_MASK 0x000000f0
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I2_SHIFT 8
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I2_MASK 0x00000f00
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I3_SHIFT 12
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I3_MASK 0x0000f000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I4_SHIFT 16
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I4_MASK 0x000f0000
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I5_SHIFT 20
-#define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_DRAWPRIMITIVE_I5_MASK 0x00f00000
-
-
-#define NV04_DX6_MULTITEX_TRIANGLE 0x00000055
-
-#define NV04_DX6_MULTITEX_TRIANGLE_NOP 0x00000100
-#define NV04_DX6_MULTITEX_TRIANGLE_NOTIFY 0x00000104
-#define NV04_DX6_MULTITEX_TRIANGLE_DMA_NOTIFY 0x00000180
-#define NV04_DX6_MULTITEX_TRIANGLE_DMA_A 0x00000184
-#define NV04_DX6_MULTITEX_TRIANGLE_DMA_B 0x00000188
-#define NV04_DX6_MULTITEX_TRIANGLE_SURFACE 0x0000018c
-#define NV04_DX6_MULTITEX_TRIANGLE_OFFSET(x) (0x00000308+((x)*4))
-#define NV04_DX6_MULTITEX_TRIANGLE_OFFSET__SIZE 0x00000002
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT(x) (0x00000310+((x)*4))
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT__SIZE 0x00000002
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_DMA_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_DMA_MASK 0x0000000f
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_ZOH_SHIFT 4
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_ZOH_MASK 0x00000030
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_FOH_SHIFT 6
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ORIGIN_FOH_MASK 0x000000c0
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_COLOR_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_COLOR_MASK 0x00000f00
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_MIPMAP_LEVELS_SHIFT 12
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_MIPMAP_LEVELS_MASK 0x0000f000
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_U_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_U_MASK 0x000f0000
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_V_SHIFT 20
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_BASE_SIZE_V_MASK 0x00f00000
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSU_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSU_MASK 0x07000000
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_WRAPU (1 << 27)
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSV_SHIFT 28
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_ADDRESSV_MASK 0x70000000
-#define NV04_DX6_MULTITEX_TRIANGLE_FORMAT_WRAPV (1 << 31)
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER(x) (0x00000318+((x)*4))
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER__SIZE 0x00000002
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_X_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_X_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_Y_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_KERNEL_SIZE_Y_MASK 0x00007f00
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_DITHER_ENABLE (1 << 15)
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_LODBIAS_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MIPMAP_LODBIAS_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MINIFY_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MINIFY_MASK 0x07000000
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_ANISOTROPIC_MINIFY_ENABLE (1 << 27)
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MAGNIFY_SHIFT 28
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_MAGNIFY_MASK 0x70000000
-#define NV04_DX6_MULTITEX_TRIANGLE_FILTER_ANISOTROPIC_MAGNIFY_ENABLE (1 << 31)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA 0x00000320
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE0 (1 << 0)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA0 (1 << 1)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT0_SHIFT 2
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT0_MASK 0x000000fc
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE1 (1 << 8)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA1 (1 << 9)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT1_SHIFT 10
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT1_MASK 0x0000fc00
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE2 (1 << 16)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA2 (1 << 17)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT2_SHIFT 18
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT2_MASK 0x00fc0000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_INVERSE3 (1 << 24)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ALPHA3 (1 << 25)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT3_SHIFT 26
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_ARGUMENT3_MASK 0x1c000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_OPERATION_SHIFT 29
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA_OPERATION_MASK 0xe0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR 0x00000324
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE0 (1 << 0)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA0 (1 << 1)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT0_SHIFT 2
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT0_MASK 0x000000fc
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE1 (1 << 8)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA1 (1 << 9)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT1_SHIFT 10
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT1_MASK 0x0000fc00
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE2 (1 << 16)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA2 (1 << 17)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT2_SHIFT 18
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT2_MASK 0x00fc0000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_INVERSE3 (1 << 24)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ALPHA3 (1 << 25)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT3_SHIFT 26
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_ARGUMENT3_MASK 0x1c000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_OPERATION_SHIFT 29
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR_OPERATION_MASK 0xe0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA 0x0000032c
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE0 (1 << 0)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA0 (1 << 1)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT0_SHIFT 2
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT0_MASK 0x000000fc
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE1 (1 << 8)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA1 (1 << 9)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT1_SHIFT 10
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT1_MASK 0x0000fc00
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE2 (1 << 16)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA2 (1 << 17)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT2_SHIFT 18
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT2_MASK 0x00fc0000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_INVERSE3 (1 << 24)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ALPHA3 (1 << 25)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT3_SHIFT 26
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_ARGUMENT3_MASK 0x1c000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_OPERATION_SHIFT 29
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA_OPERATION_MASK 0xe0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR 0x00000330
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE0 (1 << 0)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA0 (1 << 1)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT0_SHIFT 2
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT0_MASK 0x000000fc
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE1 (1 << 8)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA1 (1 << 9)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT1_SHIFT 10
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT1_MASK 0x0000fc00
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE2 (1 << 16)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA2 (1 << 17)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT2_SHIFT 18
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT2_MASK 0x00fc0000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_INVERSE3 (1 << 24)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ALPHA3 (1 << 25)
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT3_SHIFT 26
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_ARGUMENT3_MASK 0x1c000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_OPERATION_SHIFT 29
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR_OPERATION_MASK 0xe0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR 0x00000334
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_B_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_B_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_G_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_G_MASK 0x0000ff00
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_R_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_R_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_A_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR_A_MASK 0xff000000
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND 0x00000338
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_MASK_BIT_SHIFT 4
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_MASK_BIT_MASK 0x00000030
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_SHIFT 6
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_MASK 0x000000c0
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE_MASK 0x00000f00
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE_SHIFT 12
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE_MASK 0x0000f000
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE_MASK 0x000f0000
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_ALPHA_ENABLE_SHIFT 20
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_ALPHA_ENABLE_MASK 0x00f00000
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SRC_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_SRC_MASK 0x0f000000
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_DST_SHIFT 28
-#define NV04_DX6_MULTITEX_TRIANGLE_BLEND_DST_MASK 0xf0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0 0x0000033c
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_REF_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_REF_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_FUNC_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_FUNC_MASK 0x00000f00
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_TEST_ENABLE (1 << 12)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ORIGIN (1 << 13)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_ENABLE_SHIFT 14
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_ENABLE_MASK 0x0000c000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FUNC_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FUNC_MASK 0x000f0000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_CULL_MODE_SHIFT 20
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_CULL_MODE_MASK 0x00300000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_DITHER_ENABLE (1 << 22)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_PERSPECTIVE_ENABLE (1 << 23)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_WRITE_ENABLE (1 << 24)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_STENCIL_WRITE_ENABLE (1 << 25)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_ALPHA_WRITE_ENABLE (1 << 26)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_RED_WRITE_ENABLE (1 << 27)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_GREEN_WRITE_ENABLE (1 << 28)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_BLUE_WRITE_ENABLE (1 << 29)
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FORMAT_SHIFT 30
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0_Z_FORMAT_MASK 0xc0000000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1 0x00000340
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_TEST_ENABLE_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_TEST_ENABLE_MASK 0x0000000f
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_FUNC_SHIFT 4
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_FUNC_MASK 0x000000f0
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_REF_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_REF_MASK 0x0000ff00
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_READ_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_READ_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_WRITE_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1_STENCIL_MASK_WRITE_MASK 0xff000000
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2 0x00000344
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_FAIL_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_FAIL_MASK 0x0000000f
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZFAIL_SHIFT 4
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZFAIL_MASK 0x000000f0
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZPASS_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2_STENCIL_OP_ZPASS_MASK 0x00000f00
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR 0x00000348
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_B_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_B_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_G_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_G_MASK 0x0000ff00
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_R_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_R_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_A_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_FOGCOLOR_A_MASK 0xff000000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SX(x) (0x00000400+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SX__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SY(x) (0x00000404+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SY__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SZ(x) (0x00000408+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SZ__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_RHW(x) (0x0000040c+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_RHW__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR(x) (0x00000410+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_B_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_B_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_G_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_G_MASK 0x0000ff00
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_R_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_R_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_A_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_COLOR_A_MASK 0xff000000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR(x) (0x00000414+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_B_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_B_MASK 0x000000ff
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_G_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_G_MASK 0x0000ff00
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_R_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_R_MASK 0x00ff0000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_FOG_SHIFT 24
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_SPECULAR_FOG_MASK 0xff000000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU0(x) (0x00000418+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU0__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV0(x) (0x0000041c+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV0__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU1(x) (0x00000420+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TU1__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV1(x) (0x00000424+((x)*40))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_TV1__SIZE 0x00000008
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE(x) (0x00000540+((x)*4))
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE__SIZE 0x00000030
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I0_SHIFT 0
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I0_MASK 0x0000000f
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I1_SHIFT 4
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I1_MASK 0x000000f0
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I2_SHIFT 8
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I2_MASK 0x00000f00
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I3_SHIFT 12
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I3_MASK 0x0000f000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I4_SHIFT 16
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I4_MASK 0x000f0000
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I5_SHIFT 20
-#define NV04_DX6_MULTITEX_TRIANGLE_TLMTVERTEX_DRAWPRIMITIVE_I5_MASK 0x00f00000
-
-
-#define NV10_DX5_TEXTURED_TRIANGLE 0x00000094
-
-
-
-#define NV10TCL 0x00000056
-
-#define NV10TCL_NOP 0x00000100
-#define NV10TCL_NOTIFY 0x00000104
-#define NV10TCL_DMA_NOTIFY 0x00000180
-#define NV10TCL_DMA_IN_MEMORY0 0x00000184
-#define NV10TCL_DMA_IN_MEMORY1 0x00000188
-#define NV10TCL_DMA_VTXBUF0 0x0000018c
-#define NV10TCL_DMA_IN_MEMORY2 0x00000194
-#define NV10TCL_DMA_IN_MEMORY3 0x00000198
-#define NV10TCL_RT_HORIZ 0x00000200
-#define NV10TCL_RT_HORIZ_X_SHIFT 0
-#define NV10TCL_RT_HORIZ_X_MASK 0x0000ffff
-#define NV10TCL_RT_HORIZ_W_SHIFT 16
-#define NV10TCL_RT_HORIZ_W_MASK 0xffff0000
-#define NV10TCL_RT_VERT 0x00000204
-#define NV10TCL_RT_VERT_Y_SHIFT 0
-#define NV10TCL_RT_VERT_Y_MASK 0x0000ffff
-#define NV10TCL_RT_VERT_H_SHIFT 16
-#define NV10TCL_RT_VERT_H_MASK 0xffff0000
-#define NV10TCL_RT_FORMAT 0x00000208
-#define NV10TCL_RT_FORMAT_TYPE_SHIFT 8
-#define NV10TCL_RT_FORMAT_TYPE_MASK 0x00000f00
-#define NV10TCL_RT_FORMAT_TYPE_LINEAR 0x00000100
-#define NV10TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200
-#define NV10TCL_RT_FORMAT_COLOR_SHIFT 0
-#define NV10TCL_RT_FORMAT_COLOR_MASK 0x0000001f
-#define NV10TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003
-#define NV10TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005
-#define NV10TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008
-#define NV10TCL_RT_FORMAT_COLOR_B8 0x00000009
-#define NV10TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d
-#define NV10TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f
-#define NV10TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010
-#define NV10TCL_RT_PITCH 0x0000020c
-#define NV10TCL_RT_PITCH_COLOR_PITCH_SHIFT 0
-#define NV10TCL_RT_PITCH_COLOR_PITCH_MASK 0x0000ffff
-#define NV10TCL_RT_PITCH_ZETA_PITCH_SHIFT 16
-#define NV10TCL_RT_PITCH_ZETA_PITCH_MASK 0xffff0000
-#define NV10TCL_COLOR_OFFSET 0x00000210
-#define NV10TCL_ZETA_OFFSET 0x00000214
-#define NV10TCL_TX_OFFSET(x) (0x00000218+((x)*4))
-#define NV10TCL_TX_OFFSET__SIZE 0x00000002
-#define NV10TCL_TX_FORMAT(x) (0x00000220+((x)*4))
-#define NV10TCL_TX_FORMAT__SIZE 0x00000002
-#define NV10TCL_TX_FORMAT_DMA0 (1 << 0)
-#define NV10TCL_TX_FORMAT_DMA1 (1 << 1)
-#define NV10TCL_TX_FORMAT_CUBE_MAP (1 << 2)
-#define NV10TCL_TX_FORMAT_FORMAT_SHIFT 7
-#define NV10TCL_TX_FORMAT_FORMAT_MASK 0x00000780
-#define NV10TCL_TX_FORMAT_FORMAT_L8 0x00000000
-#define NV10TCL_TX_FORMAT_FORMAT_A8 0x00000080
-#define NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000100
-#define NV10TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000180
-#define NV10TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000200
-#define NV10TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000280
-#define NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000300
-#define NV10TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000380
-#define NV10TCL_TX_FORMAT_FORMAT_INDEX8 0x00000580
-#define NV10TCL_TX_FORMAT_FORMAT_DXT1 0x00000600
-#define NV10TCL_TX_FORMAT_FORMAT_DXT3 0x00000700
-#define NV10TCL_TX_FORMAT_FORMAT_DXT5 0x00000780
-#define NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00000800
-#define NV10TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00000880
-#define NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00000900
-#define NV10TCL_TX_FORMAT_FORMAT_L8_RECT 0x00000980
-#define NV10TCL_TX_FORMAT_FORMAT_A8L8 0x00000d00
-#define NV10TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00000d80
-#define NV10TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00000e80
-#define NV10TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00000f00
-#define NV10TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00001000
-#define NV10TCL_TX_FORMAT_FORMAT_DSDT 0x00001400
-#define NV10TCL_TX_FORMAT_FORMAT_A16 0x00001900
-#define NV10TCL_TX_FORMAT_FORMAT_HILO16 0x00001980
-#define NV10TCL_TX_FORMAT_FORMAT_A16_RECT 0x00001a80
-#define NV10TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00001b00
-#define NV10TCL_TX_FORMAT_FORMAT_HILO8 0x00002200
-#define NV10TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00002280
-#define NV10TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00002300
-#define NV10TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00002380
-#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00002500
-#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00002580
-#define NV10TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00002600
-#define NV10TCL_TX_FORMAT_NPOT (1 << 11)
-#define NV10TCL_TX_FORMAT_MIPMAP (1 << 15)
-#define NV10TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 16
-#define NV10TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x000f0000
-#define NV10TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 20
-#define NV10TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x00f00000
-#define NV10TCL_TX_FORMAT_WRAP_S_SHIFT 24
-#define NV10TCL_TX_FORMAT_WRAP_S_MASK 0x0f000000
-#define NV10TCL_TX_FORMAT_WRAP_S_REPEAT 0x01000000
-#define NV10TCL_TX_FORMAT_WRAP_S_MIRRORED_REPEAT 0x02000000
-#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_EDGE 0x03000000
-#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP_TO_BORDER 0x04000000
-#define NV10TCL_TX_FORMAT_WRAP_S_CLAMP 0x05000000
-#define NV10TCL_TX_FORMAT_WRAP_T_SHIFT 28
-#define NV10TCL_TX_FORMAT_WRAP_T_MASK 0xf0000000
-#define NV10TCL_TX_FORMAT_WRAP_T_REPEAT 0x10000000
-#define NV10TCL_TX_FORMAT_WRAP_T_MIRRORED_REPEAT 0x20000000
-#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP_TO_EDGE 0x30000000
-#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP_TO_BORDER 0x40000000
-#define NV10TCL_TX_FORMAT_WRAP_T_CLAMP 0x50000000
-#define NV10TCL_TX_ENABLE(x) (0x00000228+((x)*4))
-#define NV10TCL_TX_ENABLE__SIZE 0x00000002
-#define NV10TCL_TX_ENABLE_ANISOTROPY_SHIFT 4
-#define NV10TCL_TX_ENABLE_ANISOTROPY_MASK 0x00000030
-#define NV10TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14
-#define NV10TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000
-#define NV10TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26
-#define NV10TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000
-#define NV10TCL_TX_ENABLE_ENABLE (1 << 30)
-#define NV10TCL_TX_NPOT_PITCH(x) (0x00000230+((x)*4))
-#define NV10TCL_TX_NPOT_PITCH__SIZE 0x00000002
-#define NV10TCL_TX_NPOT_PITCH_PITCH_SHIFT 16
-#define NV10TCL_TX_NPOT_PITCH_PITCH_MASK 0xffff0000
-#define NV10TCL_TX_NPOT_SIZE(x) (0x00000240+((x)*4))
-#define NV10TCL_TX_NPOT_SIZE__SIZE 0x00000002
-#define NV10TCL_TX_NPOT_SIZE_H_SHIFT 0
-#define NV10TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff
-#define NV10TCL_TX_NPOT_SIZE_W_SHIFT 16
-#define NV10TCL_TX_NPOT_SIZE_W_MASK 0xffff0000
-#define NV10TCL_TX_FILTER(x) (0x00000248+((x)*4))
-#define NV10TCL_TX_FILTER__SIZE 0x00000002
-#define NV10TCL_TX_FILTER_LOD_BIAS_SHIFT 8
-#define NV10TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00
-#define NV10TCL_TX_FILTER_MINIFY_SHIFT 24
-#define NV10TCL_TX_FILTER_MINIFY_MASK 0x0f000000
-#define NV10TCL_TX_FILTER_MINIFY_NEAREST 0x01000000
-#define NV10TCL_TX_FILTER_MINIFY_LINEAR 0x02000000
-#define NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x03000000
-#define NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x04000000
-#define NV10TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x05000000
-#define NV10TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x06000000
-#define NV10TCL_TX_FILTER_MAGNIFY_SHIFT 28
-#define NV10TCL_TX_FILTER_MAGNIFY_MASK 0xf0000000
-#define NV10TCL_TX_FILTER_MAGNIFY_NEAREST 0x10000000
-#define NV10TCL_TX_FILTER_MAGNIFY_LINEAR 0x20000000
-#define NV10TCL_TX_PALETTE_OFFSET(x) (0x00000250+((x)*4))
-#define NV10TCL_TX_PALETTE_OFFSET__SIZE 0x00000002
-#define NV10TCL_RC_IN_ALPHA(x) (0x00000260+((x)*4))
-#define NV10TCL_RC_IN_ALPHA__SIZE 0x00000002
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV10TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4)
-#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000
-#define NV10TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV10TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12)
-#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000
-#define NV10TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV10TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV10TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20)
-#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000
-#define NV10TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV10TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV10TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28)
-#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000
-#define NV10TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV10TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV10TCL_RC_IN_RGB(x) (0x00000268+((x)*4))
-#define NV10TCL_RC_IN_RGB__SIZE 0x00000002
-#define NV10TCL_RC_IN_RGB_D_INPUT_SHIFT 0
-#define NV10TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f
-#define NV10TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV10TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV10TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003
-#define NV10TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV10TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV10TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c
-#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d
-#define NV10TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV10TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4)
-#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV10TCL_RC_IN_RGB_D_MAPPING_SHIFT 5
-#define NV10TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0
-#define NV10TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV10TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV10TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV10TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV10TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV10TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV10TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV10TCL_RC_IN_RGB_C_INPUT_SHIFT 8
-#define NV10TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00
-#define NV10TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300
-#define NV10TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12)
-#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_SHIFT 13
-#define NV10TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV10TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV10TCL_RC_IN_RGB_B_INPUT_SHIFT 16
-#define NV10TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000
-#define NV10TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV10TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV10TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000
-#define NV10TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV10TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV10TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000
-#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000
-#define NV10TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV10TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20)
-#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_SHIFT 21
-#define NV10TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV10TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV10TCL_RC_IN_RGB_A_INPUT_SHIFT 24
-#define NV10TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV10TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28)
-#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_SHIFT 29
-#define NV10TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV10TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV10TCL_RC_COLOR(x) (0x00000270+((x)*4))
-#define NV10TCL_RC_COLOR__SIZE 0x00000002
-#define NV10TCL_RC_COLOR_B_SHIFT 0
-#define NV10TCL_RC_COLOR_B_MASK 0x000000ff
-#define NV10TCL_RC_COLOR_G_SHIFT 8
-#define NV10TCL_RC_COLOR_G_MASK 0x0000ff00
-#define NV10TCL_RC_COLOR_R_SHIFT 16
-#define NV10TCL_RC_COLOR_R_MASK 0x00ff0000
-#define NV10TCL_RC_COLOR_A_SHIFT 24
-#define NV10TCL_RC_COLOR_A_MASK 0xff000000
-#define NV10TCL_RC_OUT_ALPHA(x) (0x00000278+((x)*4))
-#define NV10TCL_RC_OUT_ALPHA__SIZE 0x00000002
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV10TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV10TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12)
-#define NV10TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13)
-#define NV10TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14)
-#define NV10TCL_RC_OUT_ALPHA_BIAS (1 << 15)
-#define NV10TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV10TCL_RC_OUT_ALPHA_SCALE_SHIFT 17
-#define NV10TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000
-#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV10TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV10TCL_RC_OUT_RGB(x) (0x00000280+((x)*4))
-#define NV10TCL_RC_OUT_RGB__SIZE 0x00000002
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV10TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV10TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12)
-#define NV10TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13)
-#define NV10TCL_RC_OUT_RGB_MUX_SUM (1 << 14)
-#define NV10TCL_RC_OUT_RGB_BIAS (1 << 15)
-#define NV10TCL_RC_OUT_RGB_BIAS_NONE 0x00000000
-#define NV10TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV10TCL_RC_OUT_RGB_SCALE_SHIFT 17
-#define NV10TCL_RC_OUT_RGB_SCALE_MASK 0x00000000
-#define NV10TCL_RC_OUT_RGB_SCALE_NONE 0x00000000
-#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV10TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV10TCL_RC_OUT_RGB_OPERATION_SHIFT 27
-#define NV10TCL_RC_OUT_RGB_OPERATION_MASK 0x38000000
-#define NV10TCL_RC_FINAL0 0x00000288
-#define NV10TCL_RC_FINAL0_D_INPUT_SHIFT 0
-#define NV10TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f
-#define NV10TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV10TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV10TCL_RC_FINAL0_D_INPUT_FOG 0x00000003
-#define NV10TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV10TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV10TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV10TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV10TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c
-#define NV10TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d
-#define NV10TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV10TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4)
-#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV10TCL_RC_FINAL0_D_MAPPING_SHIFT 5
-#define NV10TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0
-#define NV10TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV10TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV10TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV10TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV10TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV10TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV10TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV10TCL_RC_FINAL0_C_INPUT_SHIFT 8
-#define NV10TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00
-#define NV10TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_FINAL0_C_INPUT_FOG 0x00000300
-#define NV10TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12)
-#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV10TCL_RC_FINAL0_C_MAPPING_SHIFT 13
-#define NV10TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000
-#define NV10TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV10TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV10TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV10TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV10TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV10TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV10TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV10TCL_RC_FINAL0_B_INPUT_SHIFT 16
-#define NV10TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000
-#define NV10TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV10TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV10TCL_RC_FINAL0_B_INPUT_FOG 0x00030000
-#define NV10TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV10TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV10TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV10TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV10TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000
-#define NV10TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000
-#define NV10TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV10TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20)
-#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV10TCL_RC_FINAL0_B_MAPPING_SHIFT 21
-#define NV10TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000
-#define NV10TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV10TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV10TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV10TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV10TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV10TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV10TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV10TCL_RC_FINAL0_A_INPUT_SHIFT 24
-#define NV10TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000
-#define NV10TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV10TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV10TCL_RC_FINAL0_A_INPUT_FOG 0x03000000
-#define NV10TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV10TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV10TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV10TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV10TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000
-#define NV10TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000
-#define NV10TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV10TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28)
-#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_SHIFT 29
-#define NV10TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV10TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV10TCL_RC_FINAL1 0x0000028c
-#define NV10TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7)
-#define NV10TCL_RC_FINAL1_G_INPUT_SHIFT 8
-#define NV10TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00
-#define NV10TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV10TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV10TCL_RC_FINAL1_G_INPUT_FOG 0x00000300
-#define NV10TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV10TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV10TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800
-#define NV10TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900
-#define NV10TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00
-#define NV10TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00
-#define NV10TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV10TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12)
-#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV10TCL_RC_FINAL1_G_MAPPING_SHIFT 13
-#define NV10TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000
-#define NV10TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV10TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV10TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV10TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV10TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV10TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV10TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV10TCL_RC_FINAL1_F_INPUT_SHIFT 16
-#define NV10TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000
-#define NV10TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV10TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV10TCL_RC_FINAL1_F_INPUT_FOG 0x00030000
-#define NV10TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV10TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV10TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000
-#define NV10TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000
-#define NV10TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000
-#define NV10TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000
-#define NV10TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV10TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20)
-#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV10TCL_RC_FINAL1_F_MAPPING_SHIFT 21
-#define NV10TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000
-#define NV10TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV10TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV10TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV10TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV10TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV10TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV10TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV10TCL_RC_FINAL1_E_INPUT_SHIFT 24
-#define NV10TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000
-#define NV10TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000
-#define NV10TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV10TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV10TCL_RC_FINAL1_E_INPUT_FOG 0x03000000
-#define NV10TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV10TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV10TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000
-#define NV10TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000
-#define NV10TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000
-#define NV10TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000
-#define NV10TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV10TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28)
-#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000
-#define NV10TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_SHIFT 29
-#define NV10TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV10TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV10TCL_LIGHT_MODEL 0x00000294
-#define NV10TCL_LIGHT_MODEL_COLOR_CONTROL (1 << 1)
-#define NV10TCL_LIGHT_MODEL_LOCAL_VIEWER (1 << 16)
-#define NV10TCL_COLOR_MATERIAL_ENABLE 0x00000298
-#define NV10TCL_COLOR_MATERIAL_ENABLE_SPECULAR (1 << 0)
-#define NV10TCL_COLOR_MATERIAL_ENABLE_DIFFUSE (1 << 1)
-#define NV10TCL_COLOR_MATERIAL_ENABLE_AMBIENT (1 << 2)
-#define NV10TCL_COLOR_MATERIAL_ENABLE_EMISSION (1 << 3)
-#define NV10TCL_FOG_MODE 0x0000029c
-#define NV10TCL_FOG_MODE_EXP 0x00000800
-#define NV10TCL_FOG_MODE_EXP_2 0x00000802
-#define NV10TCL_FOG_MODE_EXP2 0x00000803
-#define NV10TCL_FOG_MODE_LINEAR 0x00000804
-#define NV10TCL_FOG_MODE_LINEAR_2 0x00002601
-#define NV10TCL_FOG_COORD_DIST 0x000002a0
-#define NV10TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000
-#define NV10TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001
-#define NV10TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002
-#define NV10TCL_FOG_COORD_DIST_COORD_FOG 0x00000003
-#define NV10TCL_FOG_ENABLE 0x000002a4
-#define NV10TCL_FOG_COLOR 0x000002a8
-#define NV10TCL_FOG_COLOR_R_SHIFT 0
-#define NV10TCL_FOG_COLOR_R_MASK 0x000000ff
-#define NV10TCL_FOG_COLOR_G_SHIFT 8
-#define NV10TCL_FOG_COLOR_G_MASK 0x0000ff00
-#define NV10TCL_FOG_COLOR_B_SHIFT 16
-#define NV10TCL_FOG_COLOR_B_MASK 0x00ff0000
-#define NV10TCL_FOG_COLOR_A_SHIFT 24
-#define NV10TCL_FOG_COLOR_A_MASK 0xff000000
-#define NV10TCL_VIEWPORT_CLIP_MODE 0x000002b4
-#define NV10TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*4))
-#define NV10TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_L_SHIFT 0
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_L_MASK 0x000007ff
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_LEFT_ENABLE (1 << 11)
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_R_SHIFT 16
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_R_MASK 0x07ff0000
-#define NV10TCL_VIEWPORT_CLIP_HORIZ_CLIP_RIGHT_ENABLE (1 << 27)
-#define NV10TCL_VIEWPORT_CLIP_VERT(x) (0x000002e0+((x)*4))
-#define NV10TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_T_SHIFT 0
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_T_MASK 0x000007ff
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_TOP_ENABLE (1 << 11)
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_B_SHIFT 16
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_B_MASK 0x07ff0000
-#define NV10TCL_VIEWPORT_CLIP_VERT_CLIP_BOTTOM_ENABLE (1 << 27)
-#define NV10TCL_ALPHA_FUNC_ENABLE 0x00000300
-#define NV10TCL_BLEND_FUNC_ENABLE 0x00000304
-#define NV10TCL_CULL_FACE_ENABLE 0x00000308
-#define NV10TCL_DEPTH_TEST_ENABLE 0x0000030c
-#define NV10TCL_DITHER_ENABLE 0x00000310
-#define NV10TCL_LIGHTING_ENABLE 0x00000314
-#define NV10TCL_POINT_PARAMETERS_ENABLE 0x00000318
-#define NV10TCL_POINT_SMOOTH_ENABLE 0x0000031c
-#define NV10TCL_LINE_SMOOTH_ENABLE 0x00000320
-#define NV10TCL_POLYGON_SMOOTH_ENABLE 0x00000324
-#define NV10TCL_VERTEX_WEIGHT_ENABLE 0x00000328
-#define NV10TCL_STENCIL_ENABLE 0x0000032c
-#define NV10TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000330
-#define NV10TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000334
-#define NV10TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000338
-#define NV10TCL_ALPHA_FUNC_FUNC 0x0000033c
-#define NV10TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200
-#define NV10TCL_ALPHA_FUNC_FUNC_LESS 0x00000201
-#define NV10TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202
-#define NV10TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203
-#define NV10TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV10TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV10TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV10TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206
-#define NV10TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207
-#define NV10TCL_ALPHA_FUNC_REF 0x00000340
-#define NV10TCL_BLEND_FUNC_SRC 0x00000344
-#define NV10TCL_BLEND_FUNC_SRC_ZERO 0x00000000
-#define NV10TCL_BLEND_FUNC_SRC_ONE 0x00000001
-#define NV10TCL_BLEND_FUNC_SRC_SRC_COLOR 0x00000300
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV10TCL_BLEND_FUNC_SRC_SRC_ALPHA 0x00000302
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV10TCL_BLEND_FUNC_SRC_DST_ALPHA 0x00000304
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV10TCL_BLEND_FUNC_SRC_DST_COLOR 0x00000306
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_COLOR 0x00000307
-#define NV10TCL_BLEND_FUNC_SRC_SRC_ALPHA_SATURATE 0x00000308
-#define NV10TCL_BLEND_FUNC_SRC_CONSTANT_COLOR 0x00008001
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV10TCL_BLEND_FUNC_SRC_CONSTANT_ALPHA 0x00008003
-#define NV10TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV10TCL_BLEND_FUNC_DST 0x00000348
-#define NV10TCL_BLEND_FUNC_DST_ZERO 0x00000000
-#define NV10TCL_BLEND_FUNC_DST_ONE 0x00000001
-#define NV10TCL_BLEND_FUNC_DST_SRC_COLOR 0x00000300
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV10TCL_BLEND_FUNC_DST_SRC_ALPHA 0x00000302
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV10TCL_BLEND_FUNC_DST_DST_ALPHA 0x00000304
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV10TCL_BLEND_FUNC_DST_DST_COLOR 0x00000306
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_DST_COLOR 0x00000307
-#define NV10TCL_BLEND_FUNC_DST_SRC_ALPHA_SATURATE 0x00000308
-#define NV10TCL_BLEND_FUNC_DST_CONSTANT_COLOR 0x00008001
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV10TCL_BLEND_FUNC_DST_CONSTANT_ALPHA 0x00008003
-#define NV10TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV10TCL_BLEND_COLOR 0x0000034c
-#define NV10TCL_BLEND_COLOR_B_SHIFT 0
-#define NV10TCL_BLEND_COLOR_B_MASK 0x000000ff
-#define NV10TCL_BLEND_COLOR_G_SHIFT 8
-#define NV10TCL_BLEND_COLOR_G_MASK 0x0000ff00
-#define NV10TCL_BLEND_COLOR_R_SHIFT 16
-#define NV10TCL_BLEND_COLOR_R_MASK 0x00ff0000
-#define NV10TCL_BLEND_COLOR_A_SHIFT 24
-#define NV10TCL_BLEND_COLOR_A_MASK 0xff000000
-#define NV10TCL_BLEND_EQUATION 0x00000350
-#define NV10TCL_BLEND_EQUATION_FUNC_ADD 0x00008006
-#define NV10TCL_BLEND_EQUATION_MIN 0x00008007
-#define NV10TCL_BLEND_EQUATION_MAX 0x00008008
-#define NV10TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a
-#define NV10TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV10TCL_DEPTH_FUNC 0x00000354
-#define NV10TCL_DEPTH_FUNC_NEVER 0x00000200
-#define NV10TCL_DEPTH_FUNC_LESS 0x00000201
-#define NV10TCL_DEPTH_FUNC_EQUAL 0x00000202
-#define NV10TCL_DEPTH_FUNC_LEQUAL 0x00000203
-#define NV10TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV10TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV10TCL_DEPTH_FUNC_NOTEQUAL 0x00000205
-#define NV10TCL_DEPTH_FUNC_GEQUAL 0x00000206
-#define NV10TCL_DEPTH_FUNC_ALWAYS 0x00000207
-#define NV10TCL_COLOR_MASK 0x00000358
-#define NV10TCL_COLOR_MASK_B (1 << 0)
-#define NV10TCL_COLOR_MASK_G (1 << 8)
-#define NV10TCL_COLOR_MASK_R (1 << 16)
-#define NV10TCL_COLOR_MASK_A (1 << 24)
-#define NV10TCL_DEPTH_WRITE_ENABLE 0x0000035c
-#define NV10TCL_STENCIL_MASK 0x00000360
-#define NV10TCL_STENCIL_FUNC_FUNC 0x00000364
-#define NV10TCL_STENCIL_FUNC_FUNC_NEVER 0x00000200
-#define NV10TCL_STENCIL_FUNC_FUNC_LESS 0x00000201
-#define NV10TCL_STENCIL_FUNC_FUNC_EQUAL 0x00000202
-#define NV10TCL_STENCIL_FUNC_FUNC_LEQUAL 0x00000203
-#define NV10TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204
-#define NV10TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204
-#define NV10TCL_STENCIL_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV10TCL_STENCIL_FUNC_FUNC_GEQUAL 0x00000206
-#define NV10TCL_STENCIL_FUNC_FUNC_ALWAYS 0x00000207
-#define NV10TCL_STENCIL_FUNC_REF 0x00000368
-#define NV10TCL_STENCIL_FUNC_MASK 0x0000036c
-#define NV10TCL_STENCIL_OP_FAIL 0x00000370
-#define NV10TCL_STENCIL_OP_FAIL_ZERO 0x00000000
-#define NV10TCL_STENCIL_OP_FAIL_INVERT 0x0000150a
-#define NV10TCL_STENCIL_OP_FAIL_KEEP 0x00001e00
-#define NV10TCL_STENCIL_OP_FAIL_REPLACE 0x00001e01
-#define NV10TCL_STENCIL_OP_FAIL_INCR 0x00001e02
-#define NV10TCL_STENCIL_OP_FAIL_DECR 0x00001e03
-#define NV10TCL_STENCIL_OP_FAIL_INCR_WRAP 0x00008507
-#define NV10TCL_STENCIL_OP_FAIL_DECR_WRAP 0x00008508
-#define NV10TCL_STENCIL_OP_ZFAIL 0x00000374
-#define NV10TCL_STENCIL_OP_ZFAIL_ZERO 0x00000000
-#define NV10TCL_STENCIL_OP_ZFAIL_INVERT 0x0000150a
-#define NV10TCL_STENCIL_OP_ZFAIL_KEEP 0x00001e00
-#define NV10TCL_STENCIL_OP_ZFAIL_REPLACE 0x00001e01
-#define NV10TCL_STENCIL_OP_ZFAIL_INCR 0x00001e02
-#define NV10TCL_STENCIL_OP_ZFAIL_DECR 0x00001e03
-#define NV10TCL_STENCIL_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV10TCL_STENCIL_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV10TCL_STENCIL_OP_ZPASS 0x00000378
-#define NV10TCL_STENCIL_OP_ZPASS_ZERO 0x00000000
-#define NV10TCL_STENCIL_OP_ZPASS_INVERT 0x0000150a
-#define NV10TCL_STENCIL_OP_ZPASS_KEEP 0x00001e00
-#define NV10TCL_STENCIL_OP_ZPASS_REPLACE 0x00001e01
-#define NV10TCL_STENCIL_OP_ZPASS_INCR 0x00001e02
-#define NV10TCL_STENCIL_OP_ZPASS_DECR 0x00001e03
-#define NV10TCL_STENCIL_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV10TCL_STENCIL_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV10TCL_SHADE_MODEL 0x0000037c
-#define NV10TCL_SHADE_MODEL_FLAT 0x00001d00
-#define NV10TCL_SHADE_MODEL_SMOOTH 0x00001d01
-#define NV10TCL_LINE_WIDTH 0x00000380
-#define NV10TCL_POLYGON_OFFSET_FACTOR 0x00000384
-#define NV10TCL_POLYGON_OFFSET_UNITS 0x00000388
-#define NV10TCL_POLYGON_MODE_FRONT 0x0000038c
-#define NV10TCL_POLYGON_MODE_FRONT_POINT 0x00001b00
-#define NV10TCL_POLYGON_MODE_FRONT_LINE 0x00001b01
-#define NV10TCL_POLYGON_MODE_FRONT_FILL 0x00001b02
-#define NV10TCL_POLYGON_MODE_BACK 0x00000390
-#define NV10TCL_POLYGON_MODE_BACK_POINT 0x00001b00
-#define NV10TCL_POLYGON_MODE_BACK_LINE 0x00001b01
-#define NV10TCL_POLYGON_MODE_BACK_FILL 0x00001b02
-#define NV10TCL_DEPTH_RANGE_NEAR 0x00000394
-#define NV10TCL_DEPTH_RANGE_FAR 0x00000398
-#define NV10TCL_CULL_FACE 0x0000039c
-#define NV10TCL_CULL_FACE_FRONT 0x00000404
-#define NV10TCL_CULL_FACE_BACK 0x00000405
-#define NV10TCL_CULL_FACE_FRONT_AND_BACK 0x00000408
-#define NV10TCL_FRONT_FACE 0x000003a0
-#define NV10TCL_FRONT_FACE_CW 0x00000900
-#define NV10TCL_FRONT_FACE_CCW 0x00000901
-#define NV10TCL_NORMALIZE_ENABLE 0x000003a4
-#define NV10TCL_COLOR_MATERIAL_R 0x000003a8
-#define NV10TCL_COLOR_MATERIAL_G 0x000003ac
-#define NV10TCL_COLOR_MATERIAL_B 0x000003b0
-#define NV10TCL_COLOR_MATERIAL_A 0x000003b4
-#define NV10TCL_COLOR_CONTROL 0x000003b8
-#define NV10TCL_ENABLED_LIGHTS 0x000003bc
-#define NV10TCL_ENABLED_LIGHTS_LIGHT0 (1 << 0)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT1 (1 << 2)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT2 (1 << 4)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT3 (1 << 6)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT4 (1 << 8)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT5 (1 << 10)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT6 (1 << 12)
-#define NV10TCL_ENABLED_LIGHTS_LIGHT7 (1 << 14)
-#define NV10TCL_TX_GEN_S(x) (0x000003c0+((x)*16))
-#define NV10TCL_TX_GEN_S__SIZE 0x00000002
-#define NV10TCL_TX_GEN_S_FALSE 0x00000000
-#define NV10TCL_TX_GEN_S_EYE_LINEAR 0x00002400
-#define NV10TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401
-#define NV10TCL_TX_GEN_S_SPHERE_MAP 0x00002402
-#define NV10TCL_TX_GEN_S_NORMAL_MAP 0x00008511
-#define NV10TCL_TX_GEN_S_REFLECTION_MAP 0x00008512
-#define NV10TCL_TX_GEN_T(x) (0x000003c4+((x)*16))
-#define NV10TCL_TX_GEN_T__SIZE 0x00000002
-#define NV10TCL_TX_GEN_T_FALSE 0x00000000
-#define NV10TCL_TX_GEN_T_EYE_LINEAR 0x00002400
-#define NV10TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401
-#define NV10TCL_TX_GEN_T_SPHERE_MAP 0x00002402
-#define NV10TCL_TX_GEN_T_NORMAL_MAP 0x00008511
-#define NV10TCL_TX_GEN_T_REFLECTION_MAP 0x00008512
-#define NV10TCL_TX_GEN_R(x) (0x000003c8+((x)*16))
-#define NV10TCL_TX_GEN_R__SIZE 0x00000002
-#define NV10TCL_TX_GEN_R_FALSE 0x00000000
-#define NV10TCL_TX_GEN_R_EYE_LINEAR 0x00002400
-#define NV10TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401
-#define NV10TCL_TX_GEN_R_SPHERE_MAP 0x00002402
-#define NV10TCL_TX_GEN_R_NORMAL_MAP 0x00008511
-#define NV10TCL_TX_GEN_R_REFLECTION_MAP 0x00008512
-#define NV10TCL_TX_GEN_Q(x) (0x000003cc+((x)*16))
-#define NV10TCL_TX_GEN_Q__SIZE 0x00000002
-#define NV10TCL_TX_GEN_Q_FALSE 0x00000000
-#define NV10TCL_TX_GEN_Q_EYE_LINEAR 0x00002400
-#define NV10TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401
-#define NV10TCL_TX_GEN_Q_SPHERE_MAP 0x00002402
-#define NV10TCL_TX_GEN_Q_NORMAL_MAP 0x00008511
-#define NV10TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512
-#define NV10TCL_TX_MATRIX_ENABLE(x) (0x000003e0+((x)*4))
-#define NV10TCL_TX_MATRIX_ENABLE__SIZE 0x00000002
-#define NV10TCL_VIEW_MATRIX_ENABLE 0x000003e8
-#define NV10TCL_VIEW_MATRIX_ENABLE_MODELVIEW1 (1 << 0)
-#define NV10TCL_VIEW_MATRIX_ENABLE_MODELVIEW0 (1 << 1)
-#define NV10TCL_VIEW_MATRIX_ENABLE_PROJECTION (1 << 2)
-#define NV10TCL_POINT_SIZE 0x000003ec
-#define NV10TCL_MODELVIEW0_MATRIX(x) (0x00000400+((x)*4))
-#define NV10TCL_MODELVIEW0_MATRIX__SIZE 0x00000010
-#define NV10TCL_MODELVIEW1_MATRIX(x) (0x00000440+((x)*4))
-#define NV10TCL_MODELVIEW1_MATRIX__SIZE 0x00000010
-#define NV10TCL_INVERSE_MODELVIEW0_MATRIX(x) (0x00000480+((x)*4))
-#define NV10TCL_INVERSE_MODELVIEW0_MATRIX__SIZE 0x00000010
-#define NV10TCL_INVERSE_MODELVIEW1_MATRIX(x) (0x000004c0+((x)*4))
-#define NV10TCL_INVERSE_MODELVIEW1_MATRIX__SIZE 0x00000010
-#define NV10TCL_PROJECTION_MATRIX(x) (0x00000500+((x)*4))
-#define NV10TCL_PROJECTION_MATRIX__SIZE 0x00000010
-#define NV10TCL_TX0_MATRIX(x) (0x00000540+((x)*4))
-#define NV10TCL_TX0_MATRIX__SIZE 0x00000010
-#define NV10TCL_TX1_MATRIX(x) (0x00000580+((x)*4))
-#define NV10TCL_TX1_MATRIX__SIZE 0x00000010
-#define NV10TCL_CLIP_PLANE_A(x) (0x00000600+((x)*16))
-#define NV10TCL_CLIP_PLANE_A__SIZE 0x00000008
-#define NV10TCL_CLIP_PLANE_B(x) (0x00000604+((x)*16))
-#define NV10TCL_CLIP_PLANE_B__SIZE 0x00000008
-#define NV10TCL_CLIP_PLANE_C(x) (0x00000608+((x)*16))
-#define NV10TCL_CLIP_PLANE_C__SIZE 0x00000008
-#define NV10TCL_CLIP_PLANE_D(x) (0x0000060c+((x)*16))
-#define NV10TCL_CLIP_PLANE_D__SIZE 0x00000008
-#define NV10TCL_FOG_EQUATION_CONSTANT 0x00000680
-#define NV10TCL_FOG_EQUATION_LINEAR 0x00000684
-#define NV10TCL_FOG_EQUATION_QUADRATIC 0x00000688
-#define NV10TCL_FRONT_MATERIAL_SHININESS(x) (0x000006a0+((x)*4))
-#define NV10TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006
-#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000006c4
-#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000006c8
-#define NV10TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000006cc
-#define NV10TCL_VIEWPORT_SCALE_X 0x000006e8
-#define NV10TCL_VIEWPORT_SCALE_Y 0x000006ec
-#define NV10TCL_VIEWPORT_SCALE_Z 0x000006f0
-#define NV10TCL_VIEWPORT_SCALE_W 0x000006f4
-#define NV10TCL_POINT_PARAMETER(x) (0x000006f8+((x)*4))
-#define NV10TCL_POINT_PARAMETER__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00000800+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00000804+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00000808+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000080c+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00000810+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00000814+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00000818+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000081c+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00000820+((x)*128))
-#define NV10TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008
-#define NV10TCL_LIGHT_HALF_VECTOR_X(x) (0x00000828+((x)*128))
-#define NV10TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008
-#define NV10TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000082c+((x)*128))
-#define NV10TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008
-#define NV10TCL_LIGHT_HALF_VECTOR_Z(x) (0x00000830+((x)*128))
-#define NV10TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008
-#define NV10TCL_LIGHT_DIRECTION_X(x) (0x00000834+((x)*128))
-#define NV10TCL_LIGHT_DIRECTION_X__SIZE 0x00000008
-#define NV10TCL_LIGHT_DIRECTION_Y(x) (0x00000838+((x)*128))
-#define NV10TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008
-#define NV10TCL_LIGHT_DIRECTION_Z(x) (0x0000083c+((x)*128))
-#define NV10TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_CUTOFF_A(x) (0x00000840+((x)*128))
-#define NV10TCL_LIGHT_SPOT_CUTOFF_A__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_CUTOFF_B(x) (0x00000844+((x)*128))
-#define NV10TCL_LIGHT_SPOT_CUTOFF_B__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_CUTOFF_C(x) (0x00000848+((x)*128))
-#define NV10TCL_LIGHT_SPOT_CUTOFF_C__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_DIR_X(x) (0x0000084c+((x)*128))
-#define NV10TCL_LIGHT_SPOT_DIR_X__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_DIR_Y(x) (0x00000850+((x)*128))
-#define NV10TCL_LIGHT_SPOT_DIR_Y__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_DIR_Z(x) (0x00000854+((x)*128))
-#define NV10TCL_LIGHT_SPOT_DIR_Z__SIZE 0x00000008
-#define NV10TCL_LIGHT_SPOT_CUTOFF_D(x) (0x00000858+((x)*128))
-#define NV10TCL_LIGHT_SPOT_CUTOFF_D__SIZE 0x00000008
-#define NV10TCL_LIGHT_POSITION_X(x) (0x0000085c+((x)*128))
-#define NV10TCL_LIGHT_POSITION_X__SIZE 0x00000008
-#define NV10TCL_LIGHT_POSITION_Y(x) (0x00000860+((x)*128))
-#define NV10TCL_LIGHT_POSITION_Y__SIZE 0x00000008
-#define NV10TCL_LIGHT_POSITION_Z(x) (0x00000864+((x)*128))
-#define NV10TCL_LIGHT_POSITION_Z__SIZE 0x00000008
-#define NV10TCL_LIGHT_ATTENUATION_CONSTANT(x) (0x00000868+((x)*128))
-#define NV10TCL_LIGHT_ATTENUATION_CONSTANT__SIZE 0x00000008
-#define NV10TCL_LIGHT_ATTENUATION_LINEAR(x) (0x0000086c+((x)*128))
-#define NV10TCL_LIGHT_ATTENUATION_LINEAR__SIZE 0x00000008
-#define NV10TCL_LIGHT_ATTENUATION_QUADRATIC(x) (0x00000870+((x)*128))
-#define NV10TCL_LIGHT_ATTENUATION_QUADRATIC__SIZE 0x00000008
-#define NV10TCL_VERTEX_POS_3F_X 0x00000c00
-#define NV10TCL_VERTEX_POS_3F_Y 0x00000c04
-#define NV10TCL_VERTEX_POS_3F_Z 0x00000c08
-#define NV10TCL_VERTEX_POS_4F_X 0x00000c18
-#define NV10TCL_VERTEX_POS_4F_Y 0x00000c1c
-#define NV10TCL_VERTEX_POS_4F_Z 0x00000c20
-#define NV10TCL_VERTEX_POS_4F_W 0x00000c24
-#define NV10TCL_VERTEX_NOR_3F_X 0x00000c30
-#define NV10TCL_VERTEX_NOR_3F_Y 0x00000c34
-#define NV10TCL_VERTEX_NOR_3F_Z 0x00000c38
-#define NV10TCL_VERTEX_NOR_3I_XY 0x00000c40
-#define NV10TCL_VERTEX_NOR_3I_XY_X_SHIFT 0
-#define NV10TCL_VERTEX_NOR_3I_XY_X_MASK 0x0000ffff
-#define NV10TCL_VERTEX_NOR_3I_XY_Y_SHIFT 16
-#define NV10TCL_VERTEX_NOR_3I_XY_Y_MASK 0xffff0000
-#define NV10TCL_VERTEX_NOR_3I_Z 0x00000c44
-#define NV10TCL_VERTEX_NOR_3I_Z_Z_SHIFT 0
-#define NV10TCL_VERTEX_NOR_3I_Z_Z_MASK 0x0000ffff
-#define NV10TCL_VERTEX_COL_4F_R 0x00000c50
-#define NV10TCL_VERTEX_COL_4F_G 0x00000c54
-#define NV10TCL_VERTEX_COL_4F_B 0x00000c58
-#define NV10TCL_VERTEX_COL_4F_A 0x00000c5c
-#define NV10TCL_VERTEX_COL_3F_R 0x00000c60
-#define NV10TCL_VERTEX_COL_3F_G 0x00000c64
-#define NV10TCL_VERTEX_COL_3F_B 0x00000c68
-#define NV10TCL_VERTEX_COL_4I 0x00000c6c
-#define NV10TCL_VERTEX_COL_4I_R_SHIFT 0
-#define NV10TCL_VERTEX_COL_4I_R_MASK 0x000000ff
-#define NV10TCL_VERTEX_COL_4I_G_SHIFT 8
-#define NV10TCL_VERTEX_COL_4I_G_MASK 0x0000ff00
-#define NV10TCL_VERTEX_COL_4I_B_SHIFT 16
-#define NV10TCL_VERTEX_COL_4I_B_MASK 0x00ff0000
-#define NV10TCL_VERTEX_COL_4I_A_SHIFT 24
-#define NV10TCL_VERTEX_COL_4I_A_MASK 0xff000000
-#define NV10TCL_VERTEX_COL2_3F_R 0x00000c80
-#define NV10TCL_VERTEX_COL2_3F_G 0x00000c84
-#define NV10TCL_VERTEX_COL2_3F_B 0x00000c88
-#define NV10TCL_VERTEX_COL2_3I 0x00000c8c
-#define NV10TCL_VERTEX_COL2_3I_R_SHIFT 0
-#define NV10TCL_VERTEX_COL2_3I_R_MASK 0x000000ff
-#define NV10TCL_VERTEX_COL2_3I_G_SHIFT 8
-#define NV10TCL_VERTEX_COL2_3I_G_MASK 0x0000ff00
-#define NV10TCL_VERTEX_COL2_3I_B_SHIFT 16
-#define NV10TCL_VERTEX_COL2_3I_B_MASK 0x00ff0000
-#define NV10TCL_VERTEX_TX0_2F_S 0x00000c90
-#define NV10TCL_VERTEX_TX0_2F_T 0x00000c94
-#define NV10TCL_VERTEX_TX0_2I 0x00000c98
-#define NV10TCL_VERTEX_TX0_2I_S_SHIFT 0
-#define NV10TCL_VERTEX_TX0_2I_S_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX0_2I_T_SHIFT 16
-#define NV10TCL_VERTEX_TX0_2I_T_MASK 0xffff0000
-#define NV10TCL_VERTEX_TX0_4F_S 0x00000ca0
-#define NV10TCL_VERTEX_TX0_4F_T 0x00000ca4
-#define NV10TCL_VERTEX_TX0_4F_R 0x00000ca8
-#define NV10TCL_VERTEX_TX0_4F_Q 0x00000cac
-#define NV10TCL_VERTEX_TX0_4I_ST 0x00000cb0
-#define NV10TCL_VERTEX_TX0_4I_ST_S_SHIFT 0
-#define NV10TCL_VERTEX_TX0_4I_ST_S_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX0_4I_ST_T_SHIFT 16
-#define NV10TCL_VERTEX_TX0_4I_ST_T_MASK 0xffff0000
-#define NV10TCL_VERTEX_TX0_4I_RQ 0x00000cb4
-#define NV10TCL_VERTEX_TX0_4I_RQ_R_SHIFT 0
-#define NV10TCL_VERTEX_TX0_4I_RQ_R_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX0_4I_RQ_Q_SHIFT 16
-#define NV10TCL_VERTEX_TX0_4I_RQ_Q_MASK 0xffff0000
-#define NV10TCL_VERTEX_TX1_2F_S 0x00000cb8
-#define NV10TCL_VERTEX_TX1_2F_T 0x00000cbc
-#define NV10TCL_VERTEX_TX1_2I 0x00000cc0
-#define NV10TCL_VERTEX_TX1_2I_S_SHIFT 0
-#define NV10TCL_VERTEX_TX1_2I_S_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX1_2I_T_SHIFT 16
-#define NV10TCL_VERTEX_TX1_2I_T_MASK 0xffff0000
-#define NV10TCL_VERTEX_TX1_4F_S 0x00000cc8
-#define NV10TCL_VERTEX_TX1_4F_T 0x00000ccc
-#define NV10TCL_VERTEX_TX1_4F_R 0x00000cd0
-#define NV10TCL_VERTEX_TX1_4F_Q 0x00000cd4
-#define NV10TCL_VERTEX_TX1_4I_ST 0x00000cd8
-#define NV10TCL_VERTEX_TX1_4I_ST_S_SHIFT 0
-#define NV10TCL_VERTEX_TX1_4I_ST_S_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX1_4I_ST_T_SHIFT 16
-#define NV10TCL_VERTEX_TX1_4I_ST_T_MASK 0xffff0000
-#define NV10TCL_VERTEX_TX1_4I_RQ 0x00000cdc
-#define NV10TCL_VERTEX_TX1_4I_RQ_R_SHIFT 0
-#define NV10TCL_VERTEX_TX1_4I_RQ_R_MASK 0x0000ffff
-#define NV10TCL_VERTEX_TX1_4I_RQ_Q_SHIFT 16
-#define NV10TCL_VERTEX_TX1_4I_RQ_Q_MASK 0xffff0000
-#define NV10TCL_VERTEX_FOG_1F 0x00000ce0
-#define NV10TCL_VERTEX_WGH_1F 0x00000ce4
-#define NV10TCL_EDGEFLAG_ENABLE 0x00000cec
-#define NV10TCL_VERTEX_ARRAY_VALIDATE 0x00000cf0
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET(x) (0x00000d00+((x)*8))
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_OFFSET__SIZE 0x00000008
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT(x) (0x00000d04+((x)*8))
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT__SIZE 0x00000008
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_ATTRIB_FORMAT_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_POS 0x00000d00
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS 0x00000d04
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_POS_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_COL 0x00000d08
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL 0x00000d0c
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_COL2 0x00000d10
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2 0x00000d14
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_COL2_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_TX0 0x00000d18
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0 0x00000d1c
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX0_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_TX1 0x00000d20
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1 0x00000d24
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_TX1_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_NOR 0x00000d28
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR 0x00000d2c
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_NOR_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_WGH 0x00000d30
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH 0x00000d34
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_WGH_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_ARRAY_OFFSET_FOG 0x00000d38
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG 0x00000d3c
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_TYPE_SHIFT 0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_TYPE_MASK 0x0000000f
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_FIELDS_SHIFT 4
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_FIELDS_MASK 0x000000f0
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_STRIDE_SHIFT 8
-#define NV10TCL_VERTEX_ARRAY_FORMAT_FOG_STRIDE_MASK 0x0000ff00
-#define NV10TCL_VERTEX_BEGIN_END 0x00000dfc
-#define NV10TCL_VERTEX_BEGIN_END_STOP 0x00000000
-#define NV10TCL_VERTEX_BEGIN_END_POINTS 0x00000001
-#define NV10TCL_VERTEX_BEGIN_END_LINES 0x00000002
-#define NV10TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003
-#define NV10TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004
-#define NV10TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005
-#define NV10TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006
-#define NV10TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007
-#define NV10TCL_VERTEX_BEGIN_END_QUADS 0x00000008
-#define NV10TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009
-#define NV10TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a
-#define NV10TCL_VB_ELEMENT_U16 0x00000e00
-#define NV10TCL_VB_ELEMENT_U16_I0_SHIFT 0
-#define NV10TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff
-#define NV10TCL_VB_ELEMENT_U16_I1_SHIFT 16
-#define NV10TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000
-#define NV10TCL_VB_ELEMENT_U32 0x00001100
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END 0x000013fc
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_STOP 0x00000000
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_POINTS 0x00000001
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINES 0x00000002
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINE_LOOP 0x00000003
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_LINE_STRIP 0x00000004
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLES 0x00000005
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLE_STRIP 0x00000006
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_TRIANGLE_FAN 0x00000007
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_QUADS 0x00000008
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_QUAD_STRIP 0x00000009
-#define NV10TCL_VERTEX_BUFFER_BEGIN_END_POLYGON 0x0000000a
-#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS 0x00001400
-#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_FIRST_SHIFT 0
-#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_FIRST_MASK 0x0000ffff
-#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_LAST_SHIFT 24
-#define NV10TCL_VERTEX_BUFFER_DRAW_ARRAYS_LAST_MASK 0xff000000
-#define NV10TCL_VERTEX_ARRAY_DATA 0x00001800
-
-
-#define NV04_CONTEXT_COLOR_KEY 0x00000057
-
-
-
-#define NV03_CONTEXT_SURFACES_2D 0x00000058
-
-#define NV03_CONTEXT_SURFACES_2D_SYNCHRONIZE 0x00000100
-#define NV03_CONTEXT_SURFACES_2D_DMA_NOTIFY 0x00000180
-#define NV03_CONTEXT_SURFACES_2D_DMA_SOURCE 0x00000184
-#define NV03_CONTEXT_SURFACES_2D_DMA_DESTIN 0x00000188
-#define NV03_CONTEXT_SURFACES_2D_COLOR_FORMAT 0x00000300
-#define NV03_CONTEXT_SURFACES_2D_PITCH 0x00000304
-#define NV03_CONTEXT_SURFACES_2D_PITCH_SOURCE_SHIFT 0
-#define NV03_CONTEXT_SURFACES_2D_PITCH_SOURCE_MASK 0x0000ffff
-#define NV03_CONTEXT_SURFACES_2D_PITCH_DESTIN_SHIFT 16
-#define NV03_CONTEXT_SURFACES_2D_PITCH_DESTIN_MASK 0xffff0000
-#define NV03_CONTEXT_SURFACES_2D_OFFSET_SOURCE 0x00000308
-#define NV03_CONTEXT_SURFACES_2D_OFFSET_DESTIN 0x0000030c
-
-
-#define NV03_CONTEXT_SURFACES_3D 0x0000005a
-
-#define NV03_CONTEXT_SURFACES_3D_SYNCHRONIZE 0x00000100
-#define NV03_CONTEXT_SURFACES_3D_DMA_NOTIFY 0x00000180
-#define NV03_CONTEXT_SURFACES_3D_DMA_SURFACE 0x00000184
-#define NV03_CONTEXT_SURFACES_3D_PITCH 0x00000300
-#define NV03_CONTEXT_SURFACES_3D_OFFSET_COLOR 0x00000304
-#define NV03_CONTEXT_SURFACES_3D_OFFSET_ZETA 0x00000308
-
-
-#define NV04_RENDER_SOLID_LINE 0x0000005c
-
-#define NV04_RENDER_SOLID_LINE_SURFACE 0x00000198
-
-
-#define NV04_RENDER_SOLID_TRIANGLE 0x0000005d
-
-
-
-#define NV04_RENDER_SOLID_RECTANGLE 0x0000005e
-
-#define NV04_RENDER_SOLID_RECTANGLE_SURFACE 0x00000198
-
-
-#define NV04_IMAGE_BLIT 0x0000005f
-
-#define NV04_IMAGE_BLIT_NOP 0x00000100
-#define NV04_IMAGE_BLIT_NOTIFY 0x00000104
-#define NV04_IMAGE_BLIT_DMA_NOTIFY 0x00000180
-#define NV04_IMAGE_BLIT_COLOR_KEY 0x00000184
-#define NV04_IMAGE_BLIT_CLIP_RECTANGLE 0x00000188
-#define NV04_IMAGE_BLIT_PATTERN 0x0000018c
-#define NV04_IMAGE_BLIT_ROP 0x00000190
-#define NV04_IMAGE_BLIT_BETA4 0x00000198
-#define NV04_IMAGE_BLIT_SURFACE 0x0000019c
-#define NV04_IMAGE_BLIT_OPERATION 0x000002fc
-#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY_AND 0x00000000
-#define NV04_IMAGE_BLIT_OPERATION_ROP_AND 0x00000001
-#define NV04_IMAGE_BLIT_OPERATION_BLEND_AND 0x00000002
-#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY 0x00000003
-#define NV04_IMAGE_BLIT_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV04_IMAGE_BLIT_OPERATION_BLEND_PREMULT 0x00000005
-
-
-#define NV04_INDEXED_IMAGE_FROM_CPU 0x00000060
-
-#define NV04_INDEXED_IMAGE_FROM_CPU_NOP 0x00000100
-#define NV04_INDEXED_IMAGE_FROM_CPU_NOTIFY 0x00000104
-#define NV04_INDEXED_IMAGE_FROM_CPU_PATCH 0x0000010c
-#define NV04_INDEXED_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180
-#define NV04_INDEXED_IMAGE_FROM_CPU_DMA_LUT 0x00000184
-#define NV04_INDEXED_IMAGE_FROM_CPU_COLOR_FORMAT 0x000003e8
-#define NV04_INDEXED_IMAGE_FROM_CPU_INDEX_FORMAT 0x000003ec
-#define NV04_INDEXED_IMAGE_FROM_CPU_LUT_OFFSET 0x000003f0
-#define NV04_INDEXED_IMAGE_FROM_CPU_POINT 0x000003f4
-#define NV04_INDEXED_IMAGE_FROM_CPU_SIZE_OUT 0x000003f8
-#define NV04_INDEXED_IMAGE_FROM_CPU_SIZE_IN 0x000003fc
-#define NV04_INDEXED_IMAGE_FROM_CPU_COLOR 0x00000400
-
-
-#define NV04_IMAGE_FROM_CPU 0x00000061
-
-#define NV04_IMAGE_FROM_CPU_BETA4 0x00000198
-#define NV04_IMAGE_FROM_CPU_SURFACE 0x0000019c
-
-
-#define NV10_CONTEXT_SURFACES_2D 0x00000062
-
-
-
-#define NV05_SCALED_IMAGE_FROM_MEMORY 0x00000063
-
-#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION 0x000002fc
-#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_DITHER 0x00000000
-#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE 0x00000001
-#define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_SUBTR_TRUNCATE 0x00000002
-
-
-#define NV01_IMAGE_SRCCOPY_AND 0x00000064
-
-#define NV01_IMAGE_SRCCOPY_AND_NOTIFY 0x00000104
-#define NV01_IMAGE_SRCCOPY_AND_DMA_NOTIFY 0x00000180
-#define NV01_IMAGE_SRCCOPY_AND_IMAGE_OUTPUT 0x00000200
-#define NV01_IMAGE_SRCCOPY_AND_IMAGE_INPUT 0x00000204
-
-
-#define NV05_INDEXED_IMAGE_FROM_CPU 0x00000064
-
-#define NV05_INDEXED_IMAGE_FROM_CPU_COLOR_KEY 0x00000188
-#define NV05_INDEXED_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x0000018c
-#define NV05_INDEXED_IMAGE_FROM_CPU_PATTERN 0x00000190
-#define NV05_INDEXED_IMAGE_FROM_CPU_ROP 0x00000194
-#define NV05_INDEXED_IMAGE_FROM_CPU_BETA1 0x00000198
-#define NV05_INDEXED_IMAGE_FROM_CPU_BETA4 0x0000019c
-#define NV05_INDEXED_IMAGE_FROM_CPU_SURFACE 0x000001a0
-#define NV05_INDEXED_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000003e0
-#define NV05_INDEXED_IMAGE_FROM_CPU_OPERATION 0x000003e4
-#define NV05_INDEXED_IMAGE_FROM_CPU_INDICES 0x00000400
-
-
-#define NV05_IMAGE_FROM_CPU 0x00000065
-
-#define NV05_IMAGE_FROM_CPU_BETA4 0x00000198
-#define NV05_IMAGE_FROM_CPU_SURFACE 0x0000019c
-
-
-#define NV05_STRETCHED_IMAGE_FROM_CPU 0x00000066
-
-#define NV05_STRETCHED_IMAGE_FROM_CPU_BETA4 0x00000194
-#define NV05_STRETCHED_IMAGE_FROM_CPU_SURFACE 0x00000198
-#define NV05_STRETCHED_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000002f8
-
-
-#define NV04_IMAGE_BLEND_PREMULT 0x00000067
-
-#define NV04_IMAGE_BLEND_PREMULT_NOP 0x00000100
-#define NV04_IMAGE_BLEND_PREMULT_NOTIFY 0x00000104
-#define NV04_IMAGE_BLEND_PREMULT_DMA_NOTIFY 0x00000180
-#define NV04_IMAGE_BLEND_PREMULT_IMAGE_OUTPUT 0x00000200
-#define NV04_IMAGE_BLEND_PREMULT_BETA_INPUT 0x00000204
-#define NV04_IMAGE_BLEND_PREMULT_IMAGE_INPUT 0x00000208
-
-
-#define NV03_CHANNEL_PIO 0x0000006a
-
-
-
-#define NV03_CHANNEL_DMA 0x0000006b
-
-
-
-#define NV04_BETA_SOLID 0x00000072
-
-#define NV04_BETA_SOLID_NOP 0x00000100
-#define NV04_BETA_SOLID_NOTIFY 0x00000104
-#define NV04_BETA_SOLID_DMA_NOTIFY 0x00000180
-#define NV04_BETA_SOLID_BETA_OUTPUT 0x00000200
-#define NV04_BETA_SOLID_BETA_FACTOR 0x00000300
-
-
-#define NV04_STRETCHED_IMAGE_FROM_CPU 0x00000076
-
-
-
-#define NV04_SCALED_IMAGE_FROM_MEMORY 0x00000077
-
-#define NV04_SCALED_IMAGE_FROM_MEMORY_NOP 0x00000100
-#define NV04_SCALED_IMAGE_FROM_MEMORY_NOTIFY 0x00000104
-#define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_NOTIFY 0x00000180
-#define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE 0x00000184
-#define NV04_SCALED_IMAGE_FROM_MEMORY_PATTERN 0x00000188
-#define NV04_SCALED_IMAGE_FROM_MEMORY_ROP 0x0000018c
-#define NV04_SCALED_IMAGE_FROM_MEMORY_BETA1 0x00000190
-#define NV04_SCALED_IMAGE_FROM_MEMORY_BETA4 0x00000194
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000198
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION 0x000002fc
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_DITHER 0x00000000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE 0x00000001
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_SUBTR_TRUNCATE 0x00000002
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT 0x00000300
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5 0x00000001
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X1R5G5B5 0x00000002
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8 0x00000003
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8 0x00000004
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_V8YB8U8YA8 0x00000005
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_YB8V8YA8U8 0x00000006
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5 0x00000007
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8 0x00000008
-#define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8 0x00000009
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_AND 0x00000000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_ROP_AND 0x00000001
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_AND 0x00000002
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY 0x00000003
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_BLEND_PREMULT 0x00000005
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT 0x00000308
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_X_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POINT_Y_MASK 0xffff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_W_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE_H_MASK 0xffff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT 0x00000310
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_X_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_X_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_Y_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POINT_Y_MASK 0xffff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE 0x00000314
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_W_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_W_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_H_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE_H_MASK 0xffff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_DU_DX 0x00000318
-#define NV04_SCALED_IMAGE_FROM_MEMORY_DV_DY 0x0000031c
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE 0x00000400
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_W_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_W_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_H_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE_H_MASK 0xffff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT 0x00000404
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_PITCH_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_PITCH_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_MASK 0x00ff0000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER 0x00010000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CORNER 0x00020000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_SHIFT 24
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_MASK 0xff000000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE 0x00000000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_BILINEAR 0x01000000
-#define NV04_SCALED_IMAGE_FROM_MEMORY_ADDRESS 0x00000408
-#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT 0x0000040c
-#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_X_SHIFT 0
-#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_X_MASK 0x0000ffff
-#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_Y_SHIFT 16
-#define NV04_SCALED_IMAGE_FROM_MEMORY_POINT_Y_MASK 0xffff0000
-
-
-#define NV10_TEXTURE_FROM_CPU 0x0000007b
-
-#define NV10_TEXTURE_FROM_CPU_NOP 0x00000100
-#define NV10_TEXTURE_FROM_CPU_NOTIFY 0x00000104
-#define NV10_TEXTURE_FROM_CPU_WAIT_FOR_IDLE 0x00000108
-#define NV10_TEXTURE_FROM_CPU_PM_TRIGGER 0x00000140
-#define NV10_TEXTURE_FROM_CPU_DMA_NOTIFY 0x00000180
-#define NV10_TEXTURE_FROM_CPU_SURFACE 0x00000184
-#define NV10_TEXTURE_FROM_CPU_COLOR_FORMAT 0x00000300
-#define NV10_TEXTURE_FROM_CPU_POINT 0x00000304
-#define NV10_TEXTURE_FROM_CPU_POINT_X_SHIFT 0
-#define NV10_TEXTURE_FROM_CPU_POINT_X_MASK 0x0000ffff
-#define NV10_TEXTURE_FROM_CPU_POINT_Y_SHIFT 16
-#define NV10_TEXTURE_FROM_CPU_POINT_Y_MASK 0xffff0000
-#define NV10_TEXTURE_FROM_CPU_SIZE 0x00000308
-#define NV10_TEXTURE_FROM_CPU_SIZE_W_SHIFT 0
-#define NV10_TEXTURE_FROM_CPU_SIZE_W_MASK 0x0000ffff
-#define NV10_TEXTURE_FROM_CPU_SIZE_H_SHIFT 16
-#define NV10_TEXTURE_FROM_CPU_SIZE_H_MASK 0xffff0000
-#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL 0x0000030c
-#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_X_SHIFT 0
-#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_X_MASK 0x0000ffff
-#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_W_SHIFT 16
-#define NV10_TEXTURE_FROM_CPU_CLIP_HORIZONTAL_W_MASK 0xffff0000
-#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL 0x00000310
-#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_Y_SHIFT 0
-#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_Y_MASK 0x0000ffff
-#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_H_SHIFT 16
-#define NV10_TEXTURE_FROM_CPU_CLIP_VERTICAL_H_MASK 0xffff0000
-#define NV10_TEXTURE_FROM_CPU_COLOR(x) (0x00000400+((x)*4))
-#define NV10_TEXTURE_FROM_CPU_COLOR__SIZE 0x00000700
-
-
-#define NV10_VIDEO_DISPLAY 0x0000007c
-
-
-
-#define NV10_DVD_SUBPICTURE 0x00000088
-
-
-
-#define NV10_SCALED_IMAGE_FROM_MEMORY 0x00000089
-
-#define NV10_SCALED_IMAGE_FROM_MEMORY_WAIT_FOR_IDLE 0x00000108
-
-
-#define NV10_IMAGE_FROM_CPU 0x0000008a
-
-#define NV10_IMAGE_FROM_CPU_COLOR_CONVERSION 0x000002f8
-
-
-#define NV10_CONTEXT_SURFACES_3D 0x00000093
-
-
-
-#define NV10_DX5_TEXTURE_TRIANGLE 0x00000094
-
-
-
-#define NV10_DX6_MULTI_TEXTURE_TRIANGLE 0x00000095
-
-
-
-#define NV11TCL 0x00000096
-
-#define NV11TCL_COLOR_LOGIC_OP_ENABLE 0x00000d40
-#define NV11TCL_COLOR_LOGIC_OP_OP 0x00000d44
-#define NV11TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500
-#define NV11TCL_COLOR_LOGIC_OP_OP_AND 0x00001501
-#define NV11TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502
-#define NV11TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503
-#define NV11TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504
-#define NV11TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505
-#define NV11TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506
-#define NV11TCL_COLOR_LOGIC_OP_OP_OR 0x00001507
-#define NV11TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508
-#define NV11TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509
-#define NV11TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a
-#define NV11TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b
-#define NV11TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c
-#define NV11TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d
-#define NV11TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e
-#define NV11TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f
-
-
-#define NV20TCL 0x00000097
-
-#define NV20TCL_NOP 0x00000100
-#define NV20TCL_NOTIFY 0x00000104
-#define NV20TCL_DMA_NOTIFY 0x00000180
-#define NV20TCL_DMA_TEXTURE0 0x00000184
-#define NV20TCL_DMA_TEXTURE1 0x00000188
-#define NV20TCL_DMA_COLOR 0x00000194
-#define NV20TCL_DMA_ZETA 0x00000198
-#define NV20TCL_DMA_VTXBUF0 0x0000019c
-#define NV20TCL_DMA_VTXBUF1 0x000001a0
-#define NV20TCL_DMA_FENCE 0x000001a4
-#define NV20TCL_DMA_QUERY 0x000001a8
-#define NV20TCL_RT_HORIZ 0x00000200
-#define NV20TCL_RT_HORIZ_X_SHIFT 0
-#define NV20TCL_RT_HORIZ_X_MASK 0x0000ffff
-#define NV20TCL_RT_HORIZ_W_SHIFT 16
-#define NV20TCL_RT_HORIZ_W_MASK 0xffff0000
-#define NV20TCL_RT_VERT 0x00000204
-#define NV20TCL_RT_VERT_Y_SHIFT 0
-#define NV20TCL_RT_VERT_Y_MASK 0x0000ffff
-#define NV20TCL_RT_VERT_H_SHIFT 16
-#define NV20TCL_RT_VERT_H_MASK 0xffff0000
-#define NV20TCL_RT_FORMAT 0x00000208
-#define NV20TCL_RT_FORMAT_TYPE_SHIFT 8
-#define NV20TCL_RT_FORMAT_TYPE_MASK 0x00000f00
-#define NV20TCL_RT_FORMAT_TYPE_LINEAR 0x00000100
-#define NV20TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200
-#define NV20TCL_RT_FORMAT_COLOR_SHIFT 0
-#define NV20TCL_RT_FORMAT_COLOR_MASK 0x0000001f
-#define NV20TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003
-#define NV20TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005
-#define NV20TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008
-#define NV20TCL_RT_FORMAT_COLOR_B8 0x00000009
-#define NV20TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d
-#define NV20TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f
-#define NV20TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010
-#define NV20TCL_RT_PITCH 0x0000020c
-#define NV20TCL_RT_PITCH_COLOR_PITCH_SHIFT 0
-#define NV20TCL_RT_PITCH_COLOR_PITCH_MASK 0x0000ffff
-#define NV20TCL_RT_PITCH_ZETA_PITCH_SHIFT 16
-#define NV20TCL_RT_PITCH_ZETA_PITCH_MASK 0xffff0000
-#define NV20TCL_COLOR_OFFSET 0x00000210
-#define NV20TCL_ZETA_OFFSET 0x00000214
-#define NV20TCL_RC_IN_ALPHA(x) (0x00000260+((x)*4))
-#define NV20TCL_RC_IN_ALPHA__SIZE 0x00000008
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV20TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4)
-#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000
-#define NV20TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV20TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12)
-#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000
-#define NV20TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV20TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV20TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20)
-#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000
-#define NV20TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV20TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV20TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28)
-#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000
-#define NV20TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV20TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV20TCL_RC_FINAL0 0x00000288
-#define NV20TCL_RC_FINAL0_D_INPUT_SHIFT 0
-#define NV20TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f
-#define NV20TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV20TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV20TCL_RC_FINAL0_D_INPUT_FOG 0x00000003
-#define NV20TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV20TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV20TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV20TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV20TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c
-#define NV20TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d
-#define NV20TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV20TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4)
-#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV20TCL_RC_FINAL0_D_MAPPING_SHIFT 5
-#define NV20TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0
-#define NV20TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV20TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV20TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV20TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV20TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV20TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV20TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV20TCL_RC_FINAL0_C_INPUT_SHIFT 8
-#define NV20TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00
-#define NV20TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_FINAL0_C_INPUT_FOG 0x00000300
-#define NV20TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12)
-#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV20TCL_RC_FINAL0_C_MAPPING_SHIFT 13
-#define NV20TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000
-#define NV20TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV20TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV20TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV20TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV20TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV20TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV20TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV20TCL_RC_FINAL0_B_INPUT_SHIFT 16
-#define NV20TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000
-#define NV20TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV20TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV20TCL_RC_FINAL0_B_INPUT_FOG 0x00030000
-#define NV20TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV20TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV20TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV20TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV20TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000
-#define NV20TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000
-#define NV20TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV20TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20)
-#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV20TCL_RC_FINAL0_B_MAPPING_SHIFT 21
-#define NV20TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000
-#define NV20TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV20TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV20TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV20TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV20TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV20TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV20TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV20TCL_RC_FINAL0_A_INPUT_SHIFT 24
-#define NV20TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000
-#define NV20TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV20TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV20TCL_RC_FINAL0_A_INPUT_FOG 0x03000000
-#define NV20TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV20TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV20TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV20TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV20TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000
-#define NV20TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000
-#define NV20TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV20TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28)
-#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_SHIFT 29
-#define NV20TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV20TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV20TCL_RC_FINAL1 0x0000028c
-#define NV20TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7)
-#define NV20TCL_RC_FINAL1_G_INPUT_SHIFT 8
-#define NV20TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00
-#define NV20TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_FINAL1_G_INPUT_FOG 0x00000300
-#define NV20TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12)
-#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV20TCL_RC_FINAL1_G_MAPPING_SHIFT 13
-#define NV20TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000
-#define NV20TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV20TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV20TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV20TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV20TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV20TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV20TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV20TCL_RC_FINAL1_F_INPUT_SHIFT 16
-#define NV20TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000
-#define NV20TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV20TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV20TCL_RC_FINAL1_F_INPUT_FOG 0x00030000
-#define NV20TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV20TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV20TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000
-#define NV20TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000
-#define NV20TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000
-#define NV20TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000
-#define NV20TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV20TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20)
-#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV20TCL_RC_FINAL1_F_MAPPING_SHIFT 21
-#define NV20TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000
-#define NV20TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV20TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV20TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV20TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV20TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV20TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV20TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV20TCL_RC_FINAL1_E_INPUT_SHIFT 24
-#define NV20TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000
-#define NV20TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV20TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV20TCL_RC_FINAL1_E_INPUT_FOG 0x03000000
-#define NV20TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV20TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV20TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000
-#define NV20TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000
-#define NV20TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000
-#define NV20TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000
-#define NV20TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV20TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28)
-#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_SHIFT 29
-#define NV20TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV20TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV20TCL_LIGHT_CONTROL 0x00000294
-#define NV20TCL_FOG_MODE 0x0000029c
-#define NV20TCL_FOG_MODE_EXP 0x00000800
-#define NV20TCL_FOG_MODE_EXP_2 0x00000802
-#define NV20TCL_FOG_MODE_EXP2 0x00000803
-#define NV20TCL_FOG_MODE_LINEAR 0x00000804
-#define NV20TCL_FOG_MODE_LINEAR_2 0x00002601
-#define NV20TCL_FOG_COORD_DIST 0x000002a0
-#define NV20TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000
-#define NV20TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001
-#define NV20TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002
-#define NV20TCL_FOG_COORD_DIST_COORD_FOG 0x00000003
-#define NV20TCL_FOG_ENABLE 0x000002a4
-#define NV20TCL_FOG_COLOR 0x000002a8
-#define NV20TCL_FOG_COLOR_R_SHIFT 0
-#define NV20TCL_FOG_COLOR_R_MASK 0x000000ff
-#define NV20TCL_FOG_COLOR_G_SHIFT 8
-#define NV20TCL_FOG_COLOR_G_MASK 0x0000ff00
-#define NV20TCL_FOG_COLOR_B_SHIFT 16
-#define NV20TCL_FOG_COLOR_B_MASK 0x00ff0000
-#define NV20TCL_FOG_COLOR_A_SHIFT 24
-#define NV20TCL_FOG_COLOR_A_MASK 0xff000000
-#define NV20TCL_VIEWPORT_CLIP_MODE 0x000002b4
-#define NV20TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*4))
-#define NV20TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008
-#define NV20TCL_VIEWPORT_CLIP_VERT(x) (0x000002e0+((x)*4))
-#define NV20TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008
-#define NV20TCL_ALPHA_FUNC_ENABLE 0x00000300
-#define NV20TCL_BLEND_FUNC_ENABLE 0x00000304
-#define NV20TCL_CULL_FACE_ENABLE 0x00000308
-#define NV20TCL_DEPTH_TEST_ENABLE 0x0000030c
-#define NV20TCL_DITHER_ENABLE 0x00000310
-#define NV20TCL_LIGHTING_ENABLE 0x00000314
-#define NV20TCL_POINT_PARAMETERS_ENABLE 0x00000318
-#define NV20TCL_POINT_SMOOTH_ENABLE 0x0000031c
-#define NV20TCL_LINE_SMOOTH_ENABLE 0x00000320
-#define NV20TCL_POLYGON_SMOOTH_ENABLE 0x00000324
-#define NV20TCL_STENCIL_ENABLE 0x0000032c
-#define NV20TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000330
-#define NV20TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000334
-#define NV20TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000338
-#define NV20TCL_ALPHA_FUNC_FUNC 0x0000033c
-#define NV20TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200
-#define NV20TCL_ALPHA_FUNC_FUNC_LESS 0x00000201
-#define NV20TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202
-#define NV20TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203
-#define NV20TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV20TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV20TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV20TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206
-#define NV20TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207
-#define NV20TCL_ALPHA_FUNC_REF 0x00000340
-#define NV20TCL_BLEND_FUNC_SRC 0x00000344
-#define NV20TCL_BLEND_FUNC_SRC_ZERO 0x00000000
-#define NV20TCL_BLEND_FUNC_SRC_ONE 0x00000001
-#define NV20TCL_BLEND_FUNC_SRC_SRC_COLOR 0x00000300
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV20TCL_BLEND_FUNC_SRC_SRC_ALPHA 0x00000302
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV20TCL_BLEND_FUNC_SRC_DST_ALPHA 0x00000304
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV20TCL_BLEND_FUNC_SRC_DST_COLOR 0x00000306
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_DST_COLOR 0x00000307
-#define NV20TCL_BLEND_FUNC_SRC_SRC_ALPHA_SATURATE 0x00000308
-#define NV20TCL_BLEND_FUNC_SRC_CONSTANT_COLOR 0x00008001
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV20TCL_BLEND_FUNC_SRC_CONSTANT_ALPHA 0x00008003
-#define NV20TCL_BLEND_FUNC_SRC_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV20TCL_BLEND_FUNC_DST 0x00000348
-#define NV20TCL_BLEND_FUNC_DST_ZERO 0x00000000
-#define NV20TCL_BLEND_FUNC_DST_ONE 0x00000001
-#define NV20TCL_BLEND_FUNC_DST_SRC_COLOR 0x00000300
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV20TCL_BLEND_FUNC_DST_SRC_ALPHA 0x00000302
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV20TCL_BLEND_FUNC_DST_DST_ALPHA 0x00000304
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV20TCL_BLEND_FUNC_DST_DST_COLOR 0x00000306
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_DST_COLOR 0x00000307
-#define NV20TCL_BLEND_FUNC_DST_SRC_ALPHA_SATURATE 0x00000308
-#define NV20TCL_BLEND_FUNC_DST_CONSTANT_COLOR 0x00008001
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV20TCL_BLEND_FUNC_DST_CONSTANT_ALPHA 0x00008003
-#define NV20TCL_BLEND_FUNC_DST_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV20TCL_BLEND_COLOR 0x0000034c
-#define NV20TCL_BLEND_COLOR_B_SHIFT 0
-#define NV20TCL_BLEND_COLOR_B_MASK 0x000000ff
-#define NV20TCL_BLEND_COLOR_G_SHIFT 8
-#define NV20TCL_BLEND_COLOR_G_MASK 0x0000ff00
-#define NV20TCL_BLEND_COLOR_R_SHIFT 16
-#define NV20TCL_BLEND_COLOR_R_MASK 0x00ff0000
-#define NV20TCL_BLEND_COLOR_A_SHIFT 24
-#define NV20TCL_BLEND_COLOR_A_MASK 0xff000000
-#define NV20TCL_BLEND_EQUATION 0x00000350
-#define NV20TCL_BLEND_EQUATION_FUNC_ADD 0x00008006
-#define NV20TCL_BLEND_EQUATION_MIN 0x00008007
-#define NV20TCL_BLEND_EQUATION_MAX 0x00008008
-#define NV20TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a
-#define NV20TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV20TCL_DEPTH_FUNC 0x00000354
-#define NV20TCL_DEPTH_FUNC_NEVER 0x00000200
-#define NV20TCL_DEPTH_FUNC_LESS 0x00000201
-#define NV20TCL_DEPTH_FUNC_EQUAL 0x00000202
-#define NV20TCL_DEPTH_FUNC_LEQUAL 0x00000203
-#define NV20TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV20TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV20TCL_DEPTH_FUNC_NOTEQUAL 0x00000205
-#define NV20TCL_DEPTH_FUNC_GEQUAL 0x00000206
-#define NV20TCL_DEPTH_FUNC_ALWAYS 0x00000207
-#define NV20TCL_COLOR_MASK 0x00000358
-#define NV20TCL_COLOR_MASK_B (1 << 0)
-#define NV20TCL_COLOR_MASK_G (1 << 8)
-#define NV20TCL_COLOR_MASK_R (1 << 16)
-#define NV20TCL_COLOR_MASK_A (1 << 24)
-#define NV20TCL_DEPTH_WRITE_ENABLE 0x0000035c
-#define NV20TCL_STENCIL_MASK 0x00000360
-#define NV20TCL_STENCIL_FUNC_FUNC 0x00000364
-#define NV20TCL_STENCIL_FUNC_FUNC_NEVER 0x00000200
-#define NV20TCL_STENCIL_FUNC_FUNC_LESS 0x00000201
-#define NV20TCL_STENCIL_FUNC_FUNC_EQUAL 0x00000202
-#define NV20TCL_STENCIL_FUNC_FUNC_LEQUAL 0x00000203
-#define NV20TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204
-#define NV20TCL_STENCIL_FUNC_FUNC_GREATER 0x00000204
-#define NV20TCL_STENCIL_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV20TCL_STENCIL_FUNC_FUNC_GEQUAL 0x00000206
-#define NV20TCL_STENCIL_FUNC_FUNC_ALWAYS 0x00000207
-#define NV20TCL_STENCIL_FUNC_REF 0x00000368
-#define NV20TCL_STENCIL_FUNC_MASK 0x0000036c
-#define NV20TCL_STENCIL_OP_FAIL 0x00000370
-#define NV20TCL_STENCIL_OP_FAIL_ZERO 0x00000000
-#define NV20TCL_STENCIL_OP_FAIL_INVERT 0x0000150a
-#define NV20TCL_STENCIL_OP_FAIL_KEEP 0x00001e00
-#define NV20TCL_STENCIL_OP_FAIL_REPLACE 0x00001e01
-#define NV20TCL_STENCIL_OP_FAIL_INCR 0x00001e02
-#define NV20TCL_STENCIL_OP_FAIL_DECR 0x00001e03
-#define NV20TCL_STENCIL_OP_FAIL_INCR_WRAP 0x00008507
-#define NV20TCL_STENCIL_OP_FAIL_DECR_WRAP 0x00008508
-#define NV20TCL_STENCIL_OP_ZFAIL 0x00000374
-#define NV20TCL_STENCIL_OP_ZFAIL_ZERO 0x00000000
-#define NV20TCL_STENCIL_OP_ZFAIL_INVERT 0x0000150a
-#define NV20TCL_STENCIL_OP_ZFAIL_KEEP 0x00001e00
-#define NV20TCL_STENCIL_OP_ZFAIL_REPLACE 0x00001e01
-#define NV20TCL_STENCIL_OP_ZFAIL_INCR 0x00001e02
-#define NV20TCL_STENCIL_OP_ZFAIL_DECR 0x00001e03
-#define NV20TCL_STENCIL_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV20TCL_STENCIL_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV20TCL_STENCIL_OP_ZPASS 0x00000378
-#define NV20TCL_STENCIL_OP_ZPASS_ZERO 0x00000000
-#define NV20TCL_STENCIL_OP_ZPASS_INVERT 0x0000150a
-#define NV20TCL_STENCIL_OP_ZPASS_KEEP 0x00001e00
-#define NV20TCL_STENCIL_OP_ZPASS_REPLACE 0x00001e01
-#define NV20TCL_STENCIL_OP_ZPASS_INCR 0x00001e02
-#define NV20TCL_STENCIL_OP_ZPASS_DECR 0x00001e03
-#define NV20TCL_STENCIL_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV20TCL_STENCIL_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV20TCL_SHADE_MODEL 0x0000037c
-#define NV20TCL_SHADE_MODEL_FLAT 0x00001d00
-#define NV20TCL_SHADE_MODEL_SMOOTH 0x00001d01
-#define NV20TCL_LINE_WIDTH 0x00000380
-#define NV20TCL_POLYGON_OFFSET_FACTOR 0x00000384
-#define NV20TCL_POLYGON_OFFSET_UNITS 0x00000388
-#define NV20TCL_POLYGON_MODE_FRONT 0x0000038c
-#define NV20TCL_POLYGON_MODE_FRONT_POINT 0x00001b00
-#define NV20TCL_POLYGON_MODE_FRONT_LINE 0x00001b01
-#define NV20TCL_POLYGON_MODE_FRONT_FILL 0x00001b02
-#define NV20TCL_POLYGON_MODE_BACK 0x00000390
-#define NV20TCL_POLYGON_MODE_BACK_POINT 0x00001b00
-#define NV20TCL_POLYGON_MODE_BACK_LINE 0x00001b01
-#define NV20TCL_POLYGON_MODE_BACK_FILL 0x00001b02
-#define NV20TCL_DEPTH_RANGE_NEAR 0x00000394
-#define NV20TCL_DEPTH_RANGE_FAR 0x00000398
-#define NV20TCL_CULL_FACE 0x0000039c
-#define NV20TCL_CULL_FACE_FRONT 0x00000404
-#define NV20TCL_CULL_FACE_BACK 0x00000405
-#define NV20TCL_CULL_FACE_FRONT_AND_BACK 0x00000408
-#define NV20TCL_FRONT_FACE 0x000003a0
-#define NV20TCL_FRONT_FACE_CW 0x00000900
-#define NV20TCL_FRONT_FACE_CCW 0x00000901
-#define NV20TCL_NORMALIZE_ENABLE 0x000003a4
-#define NV20TCL_COLOR_MATERIAL_FRONT_R 0x000003a8
-#define NV20TCL_COLOR_MATERIAL_FRONT_G 0x000003ac
-#define NV20TCL_COLOR_MATERIAL_FRONT_B 0x000003b0
-#define NV20TCL_COLOR_MATERIAL_FRONT_A 0x000003b4
-#define NV20TCL_SEPARATE_SPECULAR_ENABLE 0x000003b8
-#define NV20TCL_ENABLED_LIGHTS 0x000003bc
-#define NV20TCL_TX_GEN_S(x) (0x000003c0+((x)*16))
-#define NV20TCL_TX_GEN_S__SIZE 0x00000004
-#define NV20TCL_TX_GEN_S_FALSE 0x00000000
-#define NV20TCL_TX_GEN_S_EYE_LINEAR 0x00002400
-#define NV20TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401
-#define NV20TCL_TX_GEN_S_SPHERE_MAP 0x00002402
-#define NV20TCL_TX_GEN_S_NORMAL_MAP 0x00008511
-#define NV20TCL_TX_GEN_S_REFLECTION_MAP 0x00008512
-#define NV20TCL_TX_GEN_T(x) (0x000003c4+((x)*16))
-#define NV20TCL_TX_GEN_T__SIZE 0x00000004
-#define NV20TCL_TX_GEN_T_FALSE 0x00000000
-#define NV20TCL_TX_GEN_T_EYE_LINEAR 0x00002400
-#define NV20TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401
-#define NV20TCL_TX_GEN_T_SPHERE_MAP 0x00002402
-#define NV20TCL_TX_GEN_T_NORMAL_MAP 0x00008511
-#define NV20TCL_TX_GEN_T_REFLECTION_MAP 0x00008512
-#define NV20TCL_TX_GEN_R(x) (0x000003c8+((x)*16))
-#define NV20TCL_TX_GEN_R__SIZE 0x00000004
-#define NV20TCL_TX_GEN_R_FALSE 0x00000000
-#define NV20TCL_TX_GEN_R_EYE_LINEAR 0x00002400
-#define NV20TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401
-#define NV20TCL_TX_GEN_R_SPHERE_MAP 0x00002402
-#define NV20TCL_TX_GEN_R_NORMAL_MAP 0x00008511
-#define NV20TCL_TX_GEN_R_REFLECTION_MAP 0x00008512
-#define NV20TCL_TX_GEN_Q(x) (0x000003cc+((x)*16))
-#define NV20TCL_TX_GEN_Q__SIZE 0x00000004
-#define NV20TCL_TX_GEN_Q_FALSE 0x00000000
-#define NV20TCL_TX_GEN_Q_EYE_LINEAR 0x00002400
-#define NV20TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401
-#define NV20TCL_TX_GEN_Q_SPHERE_MAP 0x00002402
-#define NV20TCL_TX_GEN_Q_NORMAL_MAP 0x00008511
-#define NV20TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512
-#define NV20TCL_TX_MATRIX_ENABLE(x) (0x00000420+((x)*4))
-#define NV20TCL_TX_MATRIX_ENABLE__SIZE 0x00000004
-#define NV20TCL_POINT_SIZE 0x0000043c
-#define NV20TCL_MODELVIEW0_MATRIX(x) (0x00000480+((x)*4))
-#define NV20TCL_MODELVIEW0_MATRIX__SIZE 0x00000010
-#define NV20TCL_MODELVIEW1_MATRIX(x) (0x000004c0+((x)*4))
-#define NV20TCL_MODELVIEW1_MATRIX__SIZE 0x00000010
-#define NV20TCL_MODELVIEW2_MATRIX(x) (0x00000500+((x)*4))
-#define NV20TCL_MODELVIEW2_MATRIX__SIZE 0x00000010
-#define NV20TCL_MODELVIEW3_MATRIX(x) (0x00000540+((x)*4))
-#define NV20TCL_MODELVIEW3_MATRIX__SIZE 0x00000010
-#define NV20TCL_INVERSE_MODELVIEW0_MATRIX(x) (0x00000580+((x)*4))
-#define NV20TCL_INVERSE_MODELVIEW0_MATRIX__SIZE 0x00000010
-#define NV20TCL_INVERSE_MODELVIEW1_MATRIX(x) (0x000005c0+((x)*4))
-#define NV20TCL_INVERSE_MODELVIEW1_MATRIX__SIZE 0x00000010
-#define NV20TCL_INVERSE_MODELVIEW2_MATRIX(x) (0x00000600+((x)*4))
-#define NV20TCL_INVERSE_MODELVIEW2_MATRIX__SIZE 0x00000010
-#define NV20TCL_INVERSE_MODELVIEW3_MATRIX(x) (0x00000640+((x)*4))
-#define NV20TCL_INVERSE_MODELVIEW3_MATRIX__SIZE 0x00000010
-#define NV20TCL_PROJECTION_MATRIX(x) (0x00000680+((x)*4))
-#define NV20TCL_PROJECTION_MATRIX__SIZE 0x00000010
-#define NV20TCL_TX0_MATRIX(x) (0x000006c0+((x)*4))
-#define NV20TCL_TX0_MATRIX__SIZE 0x00000010
-#define NV20TCL_TX1_MATRIX(x) (0x00000700+((x)*4))
-#define NV20TCL_TX1_MATRIX__SIZE 0x00000010
-#define NV20TCL_TX2_MATRIX(x) (0x00000740+((x)*4))
-#define NV20TCL_TX2_MATRIX__SIZE 0x00000010
-#define NV20TCL_TX3_MATRIX(x) (0x00000780+((x)*4))
-#define NV20TCL_TX3_MATRIX__SIZE 0x00000010
-#define NV20TCL_TX0_CLIP_PLANE_A(x) (0x00000840+((x)*16))
-#define NV20TCL_TX0_CLIP_PLANE_A__SIZE 0x00000004
-#define NV20TCL_TX0_CLIP_PLANE_B(x) (0x00000844+((x)*16))
-#define NV20TCL_TX0_CLIP_PLANE_B__SIZE 0x00000004
-#define NV20TCL_TX0_CLIP_PLANE_C(x) (0x00000848+((x)*16))
-#define NV20TCL_TX0_CLIP_PLANE_C__SIZE 0x00000004
-#define NV20TCL_TX0_CLIP_PLANE_D(x) (0x0000084c+((x)*16))
-#define NV20TCL_TX0_CLIP_PLANE_D__SIZE 0x00000004
-#define NV20TCL_TX1_CLIP_PLANE_A(x) (0x00000880+((x)*16))
-#define NV20TCL_TX1_CLIP_PLANE_A__SIZE 0x00000004
-#define NV20TCL_TX1_CLIP_PLANE_B(x) (0x00000884+((x)*16))
-#define NV20TCL_TX1_CLIP_PLANE_B__SIZE 0x00000004
-#define NV20TCL_TX1_CLIP_PLANE_C(x) (0x00000888+((x)*16))
-#define NV20TCL_TX1_CLIP_PLANE_C__SIZE 0x00000004
-#define NV20TCL_TX1_CLIP_PLANE_D(x) (0x0000088c+((x)*16))
-#define NV20TCL_TX1_CLIP_PLANE_D__SIZE 0x00000004
-#define NV20TCL_TX2_CLIP_PLANE_A(x) (0x000008c0+((x)*16))
-#define NV20TCL_TX2_CLIP_PLANE_A__SIZE 0x00000004
-#define NV20TCL_TX2_CLIP_PLANE_B(x) (0x000008c4+((x)*16))
-#define NV20TCL_TX2_CLIP_PLANE_B__SIZE 0x00000004
-#define NV20TCL_TX2_CLIP_PLANE_C(x) (0x000008c8+((x)*16))
-#define NV20TCL_TX2_CLIP_PLANE_C__SIZE 0x00000004
-#define NV20TCL_TX2_CLIP_PLANE_D(x) (0x000008cc+((x)*16))
-#define NV20TCL_TX2_CLIP_PLANE_D__SIZE 0x00000004
-#define NV20TCL_TX3_CLIP_PLANE_A(x) (0x00000900+((x)*16))
-#define NV20TCL_TX3_CLIP_PLANE_A__SIZE 0x00000004
-#define NV20TCL_TX3_CLIP_PLANE_B(x) (0x00000904+((x)*16))
-#define NV20TCL_TX3_CLIP_PLANE_B__SIZE 0x00000004
-#define NV20TCL_TX3_CLIP_PLANE_C(x) (0x00000908+((x)*16))
-#define NV20TCL_TX3_CLIP_PLANE_C__SIZE 0x00000004
-#define NV20TCL_TX3_CLIP_PLANE_D(x) (0x0000090c+((x)*16))
-#define NV20TCL_TX3_CLIP_PLANE_D__SIZE 0x00000004
-#define NV20TCL_FOG_EQUATION_CONSTANT 0x000009c0
-#define NV20TCL_FOG_EQUATION_LINEAR 0x000009c4
-#define NV20TCL_FOG_EQUATION_QUADRATIC 0x000009c8
-#define NV20TCL_FRONT_MATERIAL_SHININESS(x) (0x000009e0+((x)*4))
-#define NV20TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006
-#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10
-#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14
-#define NV20TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18
-#define NV20TCL_VIEWPORT_SCALE0_X 0x00000a20
-#define NV20TCL_VIEWPORT_SCALE0_Y 0x00000a24
-#define NV20TCL_VIEWPORT_SCALE0_Z 0x00000a28
-#define NV20TCL_VIEWPORT_SCALE0_W 0x00000a2c
-#define NV20TCL_POINT_PARAMETER(x) (0x00000a30+((x)*4))
-#define NV20TCL_POINT_PARAMETER__SIZE 0x00000008
-#define NV20TCL_RC_CONSTANT_COLOR0(x) (0x00000a60+((x)*4))
-#define NV20TCL_RC_CONSTANT_COLOR0__SIZE 0x00000008
-#define NV20TCL_RC_CONSTANT_COLOR0_B_SHIFT 0
-#define NV20TCL_RC_CONSTANT_COLOR0_B_MASK 0x000000ff
-#define NV20TCL_RC_CONSTANT_COLOR0_G_SHIFT 8
-#define NV20TCL_RC_CONSTANT_COLOR0_G_MASK 0x0000ff00
-#define NV20TCL_RC_CONSTANT_COLOR0_R_SHIFT 16
-#define NV20TCL_RC_CONSTANT_COLOR0_R_MASK 0x00ff0000
-#define NV20TCL_RC_CONSTANT_COLOR0_A_SHIFT 24
-#define NV20TCL_RC_CONSTANT_COLOR0_A_MASK 0xff000000
-#define NV20TCL_RC_CONSTANT_COLOR1(x) (0x00000a80+((x)*4))
-#define NV20TCL_RC_CONSTANT_COLOR1__SIZE 0x00000008
-#define NV20TCL_RC_CONSTANT_COLOR1_B_SHIFT 0
-#define NV20TCL_RC_CONSTANT_COLOR1_B_MASK 0x000000ff
-#define NV20TCL_RC_CONSTANT_COLOR1_G_SHIFT 8
-#define NV20TCL_RC_CONSTANT_COLOR1_G_MASK 0x0000ff00
-#define NV20TCL_RC_CONSTANT_COLOR1_R_SHIFT 16
-#define NV20TCL_RC_CONSTANT_COLOR1_R_MASK 0x00ff0000
-#define NV20TCL_RC_CONSTANT_COLOR1_A_SHIFT 24
-#define NV20TCL_RC_CONSTANT_COLOR1_A_MASK 0xff000000
-#define NV20TCL_RC_OUT_ALPHA(x) (0x00000aa0+((x)*4))
-#define NV20TCL_RC_OUT_ALPHA__SIZE 0x00000008
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV20TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV20TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12)
-#define NV20TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13)
-#define NV20TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14)
-#define NV20TCL_RC_OUT_ALPHA_BIAS (1 << 15)
-#define NV20TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV20TCL_RC_OUT_ALPHA_SCALE_SHIFT 17
-#define NV20TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000
-#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV20TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV20TCL_RC_IN_RGB(x) (0x00000ac0+((x)*4))
-#define NV20TCL_RC_IN_RGB__SIZE 0x00000008
-#define NV20TCL_RC_IN_RGB_D_INPUT_SHIFT 0
-#define NV20TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f
-#define NV20TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV20TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV20TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003
-#define NV20TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV20TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV20TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c
-#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d
-#define NV20TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV20TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4)
-#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV20TCL_RC_IN_RGB_D_MAPPING_SHIFT 5
-#define NV20TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0
-#define NV20TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV20TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV20TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV20TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV20TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV20TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV20TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV20TCL_RC_IN_RGB_C_INPUT_SHIFT 8
-#define NV20TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00
-#define NV20TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300
-#define NV20TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12)
-#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_SHIFT 13
-#define NV20TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV20TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV20TCL_RC_IN_RGB_B_INPUT_SHIFT 16
-#define NV20TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000
-#define NV20TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV20TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV20TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000
-#define NV20TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV20TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV20TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000
-#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000
-#define NV20TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV20TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20)
-#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_SHIFT 21
-#define NV20TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV20TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV20TCL_RC_IN_RGB_A_INPUT_SHIFT 24
-#define NV20TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV20TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28)
-#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV20TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_SHIFT 29
-#define NV20TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV20TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV20TCL_VIEWPORT_SCALE1_X 0x00000af0
-#define NV20TCL_VIEWPORT_SCALE1_Y 0x00000af4
-#define NV20TCL_VIEWPORT_SCALE1_Z 0x00000af8
-#define NV20TCL_VIEWPORT_SCALE1_W 0x00000afc
-#define NV20TCL_VP_UPLOAD_INST(x) (0x00000b00+((x)*4))
-#define NV20TCL_VP_UPLOAD_INST__SIZE 0x00000004
-#define NV20TCL_VP_UPLOAD_CONST(x) (0x00000b80+((x)*4))
-#define NV20TCL_VP_UPLOAD_CONST__SIZE 0x00000004
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_R(x) (0x00000c00+((x)*64))
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_G(x) (0x00000c04+((x)*64))
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_B(x) (0x00000c08+((x)*64))
-#define NV20TCL_LIGHT_BACK_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00001000+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00001004+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00001008+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000100c+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00001010+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00001014+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00001018+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000101c+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00001020+((x)*128))
-#define NV20TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008
-#define NV20TCL_LIGHT_HALF_VECTOR_X(x) (0x00001028+((x)*128))
-#define NV20TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008
-#define NV20TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000102c+((x)*128))
-#define NV20TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008
-#define NV20TCL_LIGHT_HALF_VECTOR_Z(x) (0x00001030+((x)*128))
-#define NV20TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008
-#define NV20TCL_LIGHT_DIRECTION_X(x) (0x00001034+((x)*128))
-#define NV20TCL_LIGHT_DIRECTION_X__SIZE 0x00000008
-#define NV20TCL_LIGHT_DIRECTION_Y(x) (0x00001038+((x)*128))
-#define NV20TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008
-#define NV20TCL_LIGHT_DIRECTION_Z(x) (0x0000103c+((x)*128))
-#define NV20TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008
-#define NV20TCL_LIGHT_POSITION_X(x) (0x0000105c+((x)*128))
-#define NV20TCL_LIGHT_POSITION_X__SIZE 0x00000008
-#define NV20TCL_LIGHT_POSITION_Y(x) (0x00001060+((x)*128))
-#define NV20TCL_LIGHT_POSITION_Y__SIZE 0x00000008
-#define NV20TCL_LIGHT_POSITION_Z(x) (0x00001064+((x)*128))
-#define NV20TCL_LIGHT_POSITION_Z__SIZE 0x00000008
-#define NV20TCL_LIGHT_CONSTANT_ATTENUATION(x) (0x00001068+((x)*128))
-#define NV20TCL_LIGHT_CONSTANT_ATTENUATION__SIZE 0x00000008
-#define NV20TCL_LIGHT_LINEAR_ATTENUATION(x) (0x0000106c+((x)*128))
-#define NV20TCL_LIGHT_LINEAR_ATTENUATION__SIZE 0x00000008
-#define NV20TCL_LIGHT_QUADRATIC_ATTENUATION(x) (0x00001070+((x)*128))
-#define NV20TCL_LIGHT_QUADRATIC_ATTENUATION__SIZE 0x00000008
-#define NV20TCL_POLYGON_STIPPLE_ENABLE 0x0000147c
-#define NV20TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4))
-#define NV20TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020
-#define NV20TCL_VERTEX_POS_3F_X 0x00001500
-#define NV20TCL_VERTEX_POS_3F_Y 0x00001504
-#define NV20TCL_VERTEX_POS_3F_Z 0x00001508
-#define NV20TCL_VERTEX_POS_4F_X 0x00001518
-#define NV20TCL_VERTEX_POS_4F_Y 0x0000151c
-#define NV20TCL_VERTEX_POS_4F_Z 0x00001520
-#define NV20TCL_VERTEX_POS_3I_XY 0x00001528
-#define NV20TCL_VERTEX_POS_3I_XY_X_SHIFT 0
-#define NV20TCL_VERTEX_POS_3I_XY_X_MASK 0x0000ffff
-#define NV20TCL_VERTEX_POS_3I_XY_Y_SHIFT 16
-#define NV20TCL_VERTEX_POS_3I_XY_Y_MASK 0xffff0000
-#define NV20TCL_VERTEX_POS_3I_Z 0x0000152c
-#define NV20TCL_VERTEX_POS_3I_Z_Z_SHIFT 0
-#define NV20TCL_VERTEX_POS_3I_Z_Z_MASK 0x0000ffff
-#define NV20TCL_VERTEX_NOR_3F_X 0x00001530
-#define NV20TCL_VERTEX_NOR_3F_Y 0x00001534
-#define NV20TCL_VERTEX_NOR_3F_Z 0x00001538
-#define NV20TCL_VERTEX_NOR_3I_XY 0x00001540
-#define NV20TCL_VERTEX_NOR_3I_XY_X_SHIFT 0
-#define NV20TCL_VERTEX_NOR_3I_XY_X_MASK 0x0000ffff
-#define NV20TCL_VERTEX_NOR_3I_XY_Y_SHIFT 16
-#define NV20TCL_VERTEX_NOR_3I_XY_Y_MASK 0xffff0000
-#define NV20TCL_VERTEX_NOR_3I_Z 0x00001544
-#define NV20TCL_VERTEX_NOR_3I_Z_Z_SHIFT 0
-#define NV20TCL_VERTEX_NOR_3I_Z_Z_MASK 0x0000ffff
-#define NV20TCL_VERTEX_COL_4F_X 0x00001550
-#define NV20TCL_VERTEX_COL_4F_Y 0x00001554
-#define NV20TCL_VERTEX_COL_4F_Z 0x00001558
-#define NV20TCL_VERTEX_COL_4F_W 0x0000155c
-#define NV20TCL_VERTEX_COL_3F_X 0x00001560
-#define NV20TCL_VERTEX_COL_3F_Y 0x00001564
-#define NV20TCL_VERTEX_COL_3F_Z 0x00001568
-#define NV20TCL_VERTEX_COL_4I 0x0000156c
-#define NV20TCL_VERTEX_COL_4I_R_SHIFT 0
-#define NV20TCL_VERTEX_COL_4I_R_MASK 0x000000ff
-#define NV20TCL_VERTEX_COL_4I_G_SHIFT 8
-#define NV20TCL_VERTEX_COL_4I_G_MASK 0x0000ff00
-#define NV20TCL_VERTEX_COL_4I_B_SHIFT 16
-#define NV20TCL_VERTEX_COL_4I_B_MASK 0x00ff0000
-#define NV20TCL_VERTEX_COL_4I_A_SHIFT 24
-#define NV20TCL_VERTEX_COL_4I_A_MASK 0xff000000
-#define NV20TCL_VERTEX_COL2_3F_X 0x00001580
-#define NV20TCL_VERTEX_COL2_3F_Y 0x00001584
-#define NV20TCL_VERTEX_COL2_3F_Z 0x00001588
-#define NV20TCL_VERTEX_COL2_4I 0x0000158c
-#define NV20TCL_VERTEX_COL2_4I_R_SHIFT 0
-#define NV20TCL_VERTEX_COL2_4I_R_MASK 0x000000ff
-#define NV20TCL_VERTEX_COL2_4I_G_SHIFT 8
-#define NV20TCL_VERTEX_COL2_4I_G_MASK 0x0000ff00
-#define NV20TCL_VERTEX_COL2_4I_B_SHIFT 16
-#define NV20TCL_VERTEX_COL2_4I_B_MASK 0x00ff0000
-#define NV20TCL_VERTEX_COL2_4I_A_SHIFT 24
-#define NV20TCL_VERTEX_COL2_4I_A_MASK 0xff000000
-#define NV20TCL_VERTEX_TX0_2F_S 0x00001590
-#define NV20TCL_VERTEX_TX0_2F_T 0x00001594
-#define NV20TCL_VERTEX_TX0_2I 0x00001598
-#define NV20TCL_VERTEX_TX0_2I_S_SHIFT 0
-#define NV20TCL_VERTEX_TX0_2I_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX0_2I_T_SHIFT 16
-#define NV20TCL_VERTEX_TX0_2I_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX0_4F_S 0x000015a0
-#define NV20TCL_VERTEX_TX0_4F_T 0x000015a4
-#define NV20TCL_VERTEX_TX0_4F_R 0x000015a8
-#define NV20TCL_VERTEX_TX0_4F_Q 0x000015ac
-#define NV20TCL_VERTEX_TX0_4I_ST 0x000015b0
-#define NV20TCL_VERTEX_TX0_4I_ST_S_SHIFT 0
-#define NV20TCL_VERTEX_TX0_4I_ST_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX0_4I_ST_T_SHIFT 16
-#define NV20TCL_VERTEX_TX0_4I_ST_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX0_4I_RQ 0x000015b4
-#define NV20TCL_VERTEX_TX0_4I_RQ_R_SHIFT 0
-#define NV20TCL_VERTEX_TX0_4I_RQ_R_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX0_4I_RQ_Q_SHIFT 16
-#define NV20TCL_VERTEX_TX0_4I_RQ_Q_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX1_2F_S 0x000015b8
-#define NV20TCL_VERTEX_TX1_2F_T 0x000015bc
-#define NV20TCL_VERTEX_TX1_2I 0x000015c0
-#define NV20TCL_VERTEX_TX1_2I_S_SHIFT 0
-#define NV20TCL_VERTEX_TX1_2I_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX1_2I_T_SHIFT 16
-#define NV20TCL_VERTEX_TX1_2I_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX1_4F_S 0x000015c8
-#define NV20TCL_VERTEX_TX1_4F_T 0x000015cc
-#define NV20TCL_VERTEX_TX1_4F_R 0x000015d0
-#define NV20TCL_VERTEX_TX1_4F_Q 0x000015d4
-#define NV20TCL_VERTEX_TX1_4I_ST 0x000015d8
-#define NV20TCL_VERTEX_TX1_4I_ST_S_SHIFT 0
-#define NV20TCL_VERTEX_TX1_4I_ST_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX1_4I_ST_T_SHIFT 16
-#define NV20TCL_VERTEX_TX1_4I_ST_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX1_4I_RQ 0x000015dc
-#define NV20TCL_VERTEX_TX1_4I_RQ_R_SHIFT 0
-#define NV20TCL_VERTEX_TX1_4I_RQ_R_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX1_4I_RQ_Q_SHIFT 16
-#define NV20TCL_VERTEX_TX1_4I_RQ_Q_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX2_2F_S 0x000015e0
-#define NV20TCL_VERTEX_TX2_2F_T 0x000015e4
-#define NV20TCL_VERTEX_TX2_2I 0x000015e8
-#define NV20TCL_VERTEX_TX2_2I_S_SHIFT 0
-#define NV20TCL_VERTEX_TX2_2I_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX2_2I_T_SHIFT 16
-#define NV20TCL_VERTEX_TX2_2I_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX2_4F_S 0x000015f0
-#define NV20TCL_VERTEX_TX2_4F_T 0x000015f4
-#define NV20TCL_VERTEX_TX2_4F_R 0x000015f8
-#define NV20TCL_VERTEX_TX2_4F_Q 0x000015fc
-#define NV20TCL_VERTEX_TX2_4I_ST 0x00001600
-#define NV20TCL_VERTEX_TX2_4I_ST_S_SHIFT 0
-#define NV20TCL_VERTEX_TX2_4I_ST_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX2_4I_ST_T_SHIFT 16
-#define NV20TCL_VERTEX_TX2_4I_ST_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX2_4I_RQ 0x00001604
-#define NV20TCL_VERTEX_TX2_4I_RQ_R_SHIFT 0
-#define NV20TCL_VERTEX_TX2_4I_RQ_R_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX2_4I_RQ_Q_SHIFT 16
-#define NV20TCL_VERTEX_TX2_4I_RQ_Q_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX3_2F_S 0x00001608
-#define NV20TCL_VERTEX_TX3_2F_T 0x0000160c
-#define NV20TCL_VERTEX_TX3_2I 0x00001610
-#define NV20TCL_VERTEX_TX3_2I_S_SHIFT 0
-#define NV20TCL_VERTEX_TX3_2I_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX3_2I_T_SHIFT 16
-#define NV20TCL_VERTEX_TX3_2I_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX3_4F_S 0x00001620
-#define NV20TCL_VERTEX_TX3_4F_T 0x00001624
-#define NV20TCL_VERTEX_TX3_4F_R 0x00001628
-#define NV20TCL_VERTEX_TX3_4F_Q 0x0000162c
-#define NV20TCL_VERTEX_TX3_4I_ST 0x00001630
-#define NV20TCL_VERTEX_TX3_4I_ST_S_SHIFT 0
-#define NV20TCL_VERTEX_TX3_4I_ST_S_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX3_4I_ST_T_SHIFT 16
-#define NV20TCL_VERTEX_TX3_4I_ST_T_MASK 0xffff0000
-#define NV20TCL_VERTEX_TX3_4I_RQ 0x00001634
-#define NV20TCL_VERTEX_TX3_4I_RQ_R_SHIFT 0
-#define NV20TCL_VERTEX_TX3_4I_RQ_R_MASK 0x0000ffff
-#define NV20TCL_VERTEX_TX3_4I_RQ_Q_SHIFT 16
-#define NV20TCL_VERTEX_TX3_4I_RQ_Q_MASK 0xffff0000
-#define NV20TCL_VERTEX_FOG_1F 0x00001698
-#define NV20TCL_EDGEFLAG_ENABLE 0x000016bc
-#define NV20TCL_VTXBUF_ADDRESS(x) (0x00001720+((x)*4))
-#define NV20TCL_VTXBUF_ADDRESS__SIZE 0x00000010
-#define NV20TCL_VTXBUF_ADDRESS_DMA1 (1 << 31)
-#define NV20TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0
-#define NV20TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff
-#define NV20TCL_VTXFMT(x) (0x00001760+((x)*4))
-#define NV20TCL_VTXFMT__SIZE 0x00000010
-#define NV20TCL_VTXFMT_TYPE_SHIFT 0
-#define NV20TCL_VTXFMT_TYPE_MASK 0x0000000f
-#define NV20TCL_VTXFMT_TYPE_FLOAT 0x00000002
-#define NV20TCL_VTXFMT_TYPE_UBYTE 0x00000004
-#define NV20TCL_VTXFMT_TYPE_USHORT 0x00000005
-#define NV20TCL_VTXFMT_SIZE_SHIFT 4
-#define NV20TCL_VTXFMT_SIZE_MASK 0x000000f0
-#define NV20TCL_VTXFMT_STRIDE_SHIFT 8
-#define NV20TCL_VTXFMT_STRIDE_MASK 0x0000ff00
-#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0
-#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4
-#define NV20TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8
-#define NV20TCL_COLOR_MATERIAL_BACK_A 0x000017ac
-#define NV20TCL_COLOR_MATERIAL_BACK_R 0x000017b0
-#define NV20TCL_COLOR_MATERIAL_BACK_G 0x000017b4
-#define NV20TCL_COLOR_MATERIAL_BACK_B 0x000017b8
-#define NV20TCL_COLOR_LOGIC_OP_ENABLE 0x000017bc
-#define NV20TCL_COLOR_LOGIC_OP_OP 0x000017c0
-#define NV20TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500
-#define NV20TCL_COLOR_LOGIC_OP_OP_AND 0x00001501
-#define NV20TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502
-#define NV20TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503
-#define NV20TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504
-#define NV20TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505
-#define NV20TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506
-#define NV20TCL_COLOR_LOGIC_OP_OP_OR 0x00001507
-#define NV20TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508
-#define NV20TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509
-#define NV20TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a
-#define NV20TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b
-#define NV20TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c
-#define NV20TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d
-#define NV20TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e
-#define NV20TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f
-#define NV20TCL_LIGHT_MODEL_TWO_SIDE_ENABLE 0x000017c4
-#define NV20TCL_TX_SHADER_CULL_MODE 0x000017f8
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S (1 << 0)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_S_LESS 0x00000001
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T (1 << 1)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_T_LESS 0x00000002
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R (1 << 2)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_R_LESS 0x00000004
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q (1 << 3)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX0_Q_LESS 0x00000008
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S (1 << 4)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_S_LESS 0x00000010
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T (1 << 5)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_T_LESS 0x00000020
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R (1 << 6)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_R_LESS 0x00000040
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q (1 << 7)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX1_Q_LESS 0x00000080
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S (1 << 8)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_S_LESS 0x00000100
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T (1 << 9)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_T_LESS 0x00000200
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R (1 << 10)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_R_LESS 0x00000400
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q (1 << 11)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX2_Q_LESS 0x00000800
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S (1 << 12)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_S_LESS 0x00001000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T (1 << 13)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_T_LESS 0x00002000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R (1 << 14)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_R_LESS 0x00004000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q (1 << 15)
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q_GEQUAL 0x00000000
-#define NV20TCL_TX_SHADER_CULL_MODE_TX3_Q_LESS 0x00008000
-#define NV20TCL_VERTEX_BEGIN_END 0x000017fc
-#define NV20TCL_VERTEX_BEGIN_END_STOP 0x00000000
-#define NV20TCL_VERTEX_BEGIN_END_POINTS 0x00000001
-#define NV20TCL_VERTEX_BEGIN_END_LINES 0x00000002
-#define NV20TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003
-#define NV20TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004
-#define NV20TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005
-#define NV20TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006
-#define NV20TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007
-#define NV20TCL_VERTEX_BEGIN_END_QUADS 0x00000008
-#define NV20TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009
-#define NV20TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a
-#define NV20TCL_VB_ELEMENT_U16 0x00001800
-#define NV20TCL_VB_ELEMENT_U16_I0_SHIFT 0
-#define NV20TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff
-#define NV20TCL_VB_ELEMENT_U16_I1_SHIFT 16
-#define NV20TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000
-#define NV20TCL_VB_VERTEX_BATCH 0x00001810
-#define NV20TCL_VB_VERTEX_BATCH_OFFSET_SHIFT 0
-#define NV20TCL_VB_VERTEX_BATCH_OFFSET_MASK 0x00ffffff
-#define NV20TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24
-#define NV20TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000
-#define NV20TCL_VERTEX_DATA 0x00001818
-#define NV20TCL_TX_SHADER_CONST_EYE_X 0x0000181c
-#define NV20TCL_TX_SHADER_CONST_EYE_Y 0x00001820
-#define NV20TCL_TX_SHADER_CONST_EYE_Z 0x00001824
-#define NV20TCL_VTX_ATTR_4F_X(x) (0x00001a00+((x)*16))
-#define NV20TCL_VTX_ATTR_4F_X__SIZE 0x00000010
-#define NV20TCL_VTX_ATTR_4F_Y(x) (0x00001a04+((x)*16))
-#define NV20TCL_VTX_ATTR_4F_Y__SIZE 0x00000010
-#define NV20TCL_VTX_ATTR_4F_Z(x) (0x00001a08+((x)*16))
-#define NV20TCL_VTX_ATTR_4F_Z__SIZE 0x00000010
-#define NV20TCL_VTX_ATTR_4F_W(x) (0x00001a0c+((x)*16))
-#define NV20TCL_VTX_ATTR_4F_W__SIZE 0x00000010
-#define NV20TCL_TX_OFFSET(x) (0x00001b00+((x)*64))
-#define NV20TCL_TX_OFFSET__SIZE 0x00000004
-#define NV20TCL_TX_FORMAT(x) (0x00001b04+((x)*64))
-#define NV20TCL_TX_FORMAT__SIZE 0x00000004
-#define NV20TCL_TX_FORMAT_DMA0 (1 << 0)
-#define NV20TCL_TX_FORMAT_DMA1 (1 << 1)
-#define NV20TCL_TX_FORMAT_CUBIC (1 << 2)
-#define NV20TCL_TX_FORMAT_NO_BORDER (1 << 3)
-#define NV20TCL_TX_FORMAT_DIMS_SHIFT 4
-#define NV20TCL_TX_FORMAT_DIMS_MASK 0x000000f0
-#define NV20TCL_TX_FORMAT_DIMS_1D 0x00000010
-#define NV20TCL_TX_FORMAT_DIMS_2D 0x00000020
-#define NV20TCL_TX_FORMAT_DIMS_3D 0x00000030
-#define NV20TCL_TX_FORMAT_FORMAT_SHIFT 8
-#define NV20TCL_TX_FORMAT_FORMAT_MASK 0x0000ff00
-#define NV20TCL_TX_FORMAT_FORMAT_L8 0x00000000
-#define NV20TCL_TX_FORMAT_FORMAT_A8 0x00000100
-#define NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000200
-#define NV20TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000300
-#define NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000400
-#define NV20TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000500
-#define NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000600
-#define NV20TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000700
-#define NV20TCL_TX_FORMAT_FORMAT_INDEX8 0x00000b00
-#define NV20TCL_TX_FORMAT_FORMAT_DXT1 0x00000c00
-#define NV20TCL_TX_FORMAT_FORMAT_DXT3 0x00000e00
-#define NV20TCL_TX_FORMAT_FORMAT_DXT5 0x00000f00
-#define NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00001000
-#define NV20TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00001100
-#define NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00001200
-#define NV20TCL_TX_FORMAT_FORMAT_L8_RECT 0x00001300
-#define NV20TCL_TX_FORMAT_FORMAT_A8L8 0x00001a00
-#define NV20TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00001b00
-#define NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00001d00
-#define NV20TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00001e00
-#define NV20TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00002000
-#define NV20TCL_TX_FORMAT_FORMAT_DSDT 0x00002800
-#define NV20TCL_TX_FORMAT_FORMAT_A16 0x00003200
-#define NV20TCL_TX_FORMAT_FORMAT_HILO16 0x00003300
-#define NV20TCL_TX_FORMAT_FORMAT_A16_RECT 0x00003500
-#define NV20TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00003600
-#define NV20TCL_TX_FORMAT_FORMAT_HILO8 0x00004400
-#define NV20TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00004500
-#define NV20TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00004600
-#define NV20TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00004700
-#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00004a00
-#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00004b00
-#define NV20TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00004c00
-#define NV20TCL_TX_FORMAT_MIPMAP (1 << 19)
-#define NV20TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 20
-#define NV20TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x00f00000
-#define NV20TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 24
-#define NV20TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x0f000000
-#define NV20TCL_TX_FORMAT_BASE_SIZE_W_SHIFT 28
-#define NV20TCL_TX_FORMAT_BASE_SIZE_W_MASK 0xf0000000
-#define NV20TCL_TX_WRAP(x) (0x00001b08+((x)*64))
-#define NV20TCL_TX_WRAP__SIZE 0x00000004
-#define NV20TCL_TX_WRAP_S_SHIFT 0
-#define NV20TCL_TX_WRAP_S_MASK 0x000000ff
-#define NV20TCL_TX_WRAP_S_REPEAT 0x00000001
-#define NV20TCL_TX_WRAP_S_MIRRORED_REPEAT 0x00000002
-#define NV20TCL_TX_WRAP_S_CLAMP_TO_EDGE 0x00000003
-#define NV20TCL_TX_WRAP_S_CLAMP_TO_BORDER 0x00000004
-#define NV20TCL_TX_WRAP_S_CLAMP 0x00000005
-#define NV20TCL_TX_WRAP_T_SHIFT 8
-#define NV20TCL_TX_WRAP_T_MASK 0x00000f00
-#define NV20TCL_TX_WRAP_T_REPEAT 0x00000100
-#define NV20TCL_TX_WRAP_T_MIRRORED_REPEAT 0x00000200
-#define NV20TCL_TX_WRAP_T_CLAMP_TO_EDGE 0x00000300
-#define NV20TCL_TX_WRAP_T_CLAMP_TO_BORDER 0x00000400
-#define NV20TCL_TX_WRAP_T_CLAMP 0x00000500
-#define NV20TCL_TX_WRAP_R_SHIFT 16
-#define NV20TCL_TX_WRAP_R_MASK 0x000f0000
-#define NV20TCL_TX_WRAP_R_REPEAT 0x00010000
-#define NV20TCL_TX_WRAP_R_MIRRORED_REPEAT 0x00020000
-#define NV20TCL_TX_WRAP_R_CLAMP_TO_EDGE 0x00030000
-#define NV20TCL_TX_WRAP_R_CLAMP_TO_BORDER 0x00040000
-#define NV20TCL_TX_WRAP_R_CLAMP 0x00050000
-#define NV20TCL_TX_ENABLE(x) (0x00001b0c+((x)*64))
-#define NV20TCL_TX_ENABLE__SIZE 0x00000004
-#define NV20TCL_TX_ENABLE_ANISO_SHIFT 4
-#define NV20TCL_TX_ENABLE_ANISO_MASK 0x00000030
-#define NV20TCL_TX_ENABLE_ANISO_NONE 0x00000000
-#define NV20TCL_TX_ENABLE_ANISO_2X 0x00000010
-#define NV20TCL_TX_ENABLE_ANISO_4X 0x00000020
-#define NV20TCL_TX_ENABLE_ANISO_8X 0x00000030
-#define NV20TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14
-#define NV20TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000
-#define NV20TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26
-#define NV20TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000
-#define NV20TCL_TX_ENABLE_ENABLE (1 << 30)
-#define NV20TCL_TX_SWIZZLE(x) (0x00001b10+((x)*64))
-#define NV20TCL_TX_SWIZZLE__SIZE 0x00000004
-#define NV20TCL_TX_SWIZZLE_RECT_PITCH_SHIFT 16
-#define NV20TCL_TX_SWIZZLE_RECT_PITCH_MASK 0xffff0000
-#define NV20TCL_TX_FILTER(x) (0x00001b14+((x)*64))
-#define NV20TCL_TX_FILTER__SIZE 0x00000004
-#define NV20TCL_TX_FILTER_LOD_BIAS_SHIFT 8
-#define NV20TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00
-#define NV20TCL_TX_FILTER_MINIFY_SHIFT 16
-#define NV20TCL_TX_FILTER_MINIFY_MASK 0x000f0000
-#define NV20TCL_TX_FILTER_MINIFY_NEAREST 0x00010000
-#define NV20TCL_TX_FILTER_MINIFY_LINEAR 0x00020000
-#define NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x00030000
-#define NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x00040000
-#define NV20TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x00050000
-#define NV20TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x00060000
-#define NV20TCL_TX_FILTER_MAGNIFY_SHIFT 24
-#define NV20TCL_TX_FILTER_MAGNIFY_MASK 0x0f000000
-#define NV20TCL_TX_FILTER_MAGNIFY_NEAREST 0x01000000
-#define NV20TCL_TX_FILTER_MAGNIFY_LINEAR 0x02000000
-#define NV20TCL_TX_NPOT_SIZE(x) (0x00001b1c+((x)*64))
-#define NV20TCL_TX_NPOT_SIZE__SIZE 0x00000004
-#define NV20TCL_TX_NPOT_SIZE_H_SHIFT 0
-#define NV20TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff
-#define NV20TCL_TX_NPOT_SIZE_W_SHIFT 16
-#define NV20TCL_TX_NPOT_SIZE_W_MASK 0xffff0000
-#define NV20TCL_TX_PALETTE_OFFSET(x) (0x00001b20+((x)*64))
-#define NV20TCL_TX_PALETTE_OFFSET__SIZE 0x00000004
-#define NV20TCL_TX_BORDER_COLOR(x) (0x00001b24+((x)*64))
-#define NV20TCL_TX_BORDER_COLOR__SIZE 0x00000004
-#define NV20TCL_TX_BORDER_COLOR_B_SHIFT 0
-#define NV20TCL_TX_BORDER_COLOR_B_MASK 0x000000ff
-#define NV20TCL_TX_BORDER_COLOR_G_SHIFT 8
-#define NV20TCL_TX_BORDER_COLOR_G_MASK 0x0000ff00
-#define NV20TCL_TX_BORDER_COLOR_R_SHIFT 16
-#define NV20TCL_TX_BORDER_COLOR_R_MASK 0x00ff0000
-#define NV20TCL_TX_BORDER_COLOR_A_SHIFT 24
-#define NV20TCL_TX_BORDER_COLOR_A_MASK 0xff000000
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX00(x) (0x00001b28+((x)*64))
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX00__SIZE 0x00000004
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX01(x) (0x00001b2c+((x)*64))
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX01__SIZE 0x00000004
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX11(x) (0x00001b30+((x)*64))
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX11__SIZE 0x00000004
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX10(x) (0x00001b34+((x)*64))
-#define NV20TCL_TX_SHADER_OFFSET_MATRIX10__SIZE 0x00000004
-#define NV20TCL_DEPTH_UNK17D8 0x00001d78
-#define NV20TCL_DEPTH_UNK17D8_CLAMP_SHIFT 4
-#define NV20TCL_DEPTH_UNK17D8_CLAMP_MASK 0x000000f0
-#define NV20TCL_MULTISAMPLE_CONTROL 0x00001d7c
-#define NV20TCL_CLEAR_DEPTH_VALUE 0x00001d8c
-#define NV20TCL_CLEAR_VALUE 0x00001d90
-#define NV20TCL_CLEAR_BUFFERS 0x00001d94
-#define NV20TCL_CLEAR_BUFFERS_COLOR_A (1 << 7)
-#define NV20TCL_CLEAR_BUFFERS_COLOR_B (1 << 6)
-#define NV20TCL_CLEAR_BUFFERS_COLOR_G (1 << 5)
-#define NV20TCL_CLEAR_BUFFERS_COLOR_R (1 << 4)
-#define NV20TCL_CLEAR_BUFFERS_STENCIL (1 << 1)
-#define NV20TCL_CLEAR_BUFFERS_DEPTH (1 << 0)
-#define NV20TCL_RC_COLOR0 0x00001e20
-#define NV20TCL_RC_COLOR0_B_SHIFT 0
-#define NV20TCL_RC_COLOR0_B_MASK 0x000000ff
-#define NV20TCL_RC_COLOR0_G_SHIFT 8
-#define NV20TCL_RC_COLOR0_G_MASK 0x0000ff00
-#define NV20TCL_RC_COLOR0_R_SHIFT 16
-#define NV20TCL_RC_COLOR0_R_MASK 0x00ff0000
-#define NV20TCL_RC_COLOR0_A_SHIFT 24
-#define NV20TCL_RC_COLOR0_A_MASK 0xff000000
-#define NV20TCL_RC_COLOR1 0x00001e24
-#define NV20TCL_RC_COLOR1_B_SHIFT 0
-#define NV20TCL_RC_COLOR1_B_MASK 0x000000ff
-#define NV20TCL_RC_COLOR1_G_SHIFT 8
-#define NV20TCL_RC_COLOR1_G_MASK 0x0000ff00
-#define NV20TCL_RC_COLOR1_R_SHIFT 16
-#define NV20TCL_RC_COLOR1_R_MASK 0x00ff0000
-#define NV20TCL_RC_COLOR1_A_SHIFT 24
-#define NV20TCL_RC_COLOR1_A_MASK 0xff000000
-#define NV20TCL_BACK_MATERIAL_SHININESS(x) (0x00001e28+((x)*4))
-#define NV20TCL_BACK_MATERIAL_SHININESS__SIZE 0x00000006
-#define NV20TCL_RC_OUT_RGB(x) (0x00001e40+((x)*4))
-#define NV20TCL_RC_OUT_RGB__SIZE 0x00000008
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV20TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV20TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV20TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV20TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12)
-#define NV20TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13)
-#define NV20TCL_RC_OUT_RGB_MUX_SUM (1 << 14)
-#define NV20TCL_RC_OUT_RGB_BIAS (1 << 15)
-#define NV20TCL_RC_OUT_RGB_BIAS_NONE 0x00000000
-#define NV20TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV20TCL_RC_OUT_RGB_SCALE_SHIFT 17
-#define NV20TCL_RC_OUT_RGB_SCALE_MASK 0x00000000
-#define NV20TCL_RC_OUT_RGB_SCALE_NONE 0x00000000
-#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV20TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV20TCL_RC_ENABLE 0x00001e60
-#define NV20TCL_RC_ENABLE_NUM_COMBINERS_SHIFT 0
-#define NV20TCL_RC_ENABLE_NUM_COMBINERS_MASK 0x0000000f
-#define NV20TCL_TX_RCOMP 0x00001e6c
-#define NV20TCL_TX_RCOMP_NEVER 0x00000000
-#define NV20TCL_TX_RCOMP_GREATER 0x00000001
-#define NV20TCL_TX_RCOMP_EQUAL 0x00000002
-#define NV20TCL_TX_RCOMP_GEQUAL 0x00000003
-#define NV20TCL_TX_RCOMP_LESS 0x00000004
-#define NV20TCL_TX_RCOMP_NOTEQUAL 0x00000005
-#define NV20TCL_TX_RCOMP_LEQUAL 0x00000006
-#define NV20TCL_TX_RCOMP_ALWAYS 0x00000007
-#define NV20TCL_TX_SHADER_OP 0x00001e70
-#define NV20TCL_TX_SHADER_OP_TX0_SHIFT 0
-#define NV20TCL_TX_SHADER_OP_TX0_MASK 0x0000001f
-#define NV20TCL_TX_SHADER_OP_TX0_NONE 0x00000000
-#define NV20TCL_TX_SHADER_OP_TX0_TEXTURE_2D 0x00000001
-#define NV20TCL_TX_SHADER_OP_TX0_PASS_THROUGH 0x00000004
-#define NV20TCL_TX_SHADER_OP_TX0_CULL_FRAGMENT 0x00000005
-#define NV20TCL_TX_SHADER_OP_TX0_OFFSET_TEXTURE_2D 0x00000006
-#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT_TEXTURE_2D 0x00000009
-#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT_DEPTH_REPLACE 0x0000000a
-#define NV20TCL_TX_SHADER_OP_TX0_DEPENDANT_AR_TEXTURE_2D 0x0000000f
-#define NV20TCL_TX_SHADER_OP_TX0_DEPENDANT_GB_TEXTURE_2D 0x00000010
-#define NV20TCL_TX_SHADER_OP_TX0_DOT_PRODUCT 0x00000011
-#define NV20TCL_TX_SHADER_OP_TX1_SHIFT 5
-#define NV20TCL_TX_SHADER_OP_TX1_MASK 0x000003e0
-#define NV20TCL_TX_SHADER_OP_TX1_NONE 0x00000000
-#define NV20TCL_TX_SHADER_OP_TX1_TEXTURE_2D 0x00000020
-#define NV20TCL_TX_SHADER_OP_TX1_PASS_THROUGH 0x00000080
-#define NV20TCL_TX_SHADER_OP_TX1_CULL_FRAGMENT 0x000000a0
-#define NV20TCL_TX_SHADER_OP_TX1_OFFSET_TEXTURE_2D 0x000000c0
-#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT_TEXTURE_2D 0x00000120
-#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT_DEPTH_REPLACE 0x00000140
-#define NV20TCL_TX_SHADER_OP_TX1_DEPENDANT_AR_TEXTURE_2D 0x000001e0
-#define NV20TCL_TX_SHADER_OP_TX1_DEPENDANT_GB_TEXTURE_2D 0x00000200
-#define NV20TCL_TX_SHADER_OP_TX1_DOT_PRODUCT 0x00000220
-#define NV20TCL_TX_SHADER_OP_TX2_SHIFT 10
-#define NV20TCL_TX_SHADER_OP_TX2_MASK 0x00007c00
-#define NV20TCL_TX_SHADER_OP_TX2_NONE 0x00000000
-#define NV20TCL_TX_SHADER_OP_TX2_TEXTURE_2D 0x00000400
-#define NV20TCL_TX_SHADER_OP_TX2_PASS_THROUGH 0x00001000
-#define NV20TCL_TX_SHADER_OP_TX2_CULL_FRAGMENT 0x00001400
-#define NV20TCL_TX_SHADER_OP_TX2_OFFSET_TEXTURE_2D 0x00001800
-#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT_TEXTURE_2D 0x00002400
-#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT_DEPTH_REPLACE 0x00002800
-#define NV20TCL_TX_SHADER_OP_TX2_DEPENDANT_AR_TEXTURE_2D 0x00003c00
-#define NV20TCL_TX_SHADER_OP_TX2_DEPENDANT_GB_TEXTURE_2D 0x00004000
-#define NV20TCL_TX_SHADER_OP_TX2_DOT_PRODUCT 0x00004400
-#define NV20TCL_TX_SHADER_OP_TX3_SHIFT 15
-#define NV20TCL_TX_SHADER_OP_TX3_MASK 0x000f8000
-#define NV20TCL_TX_SHADER_OP_TX3_NONE 0x00000000
-#define NV20TCL_TX_SHADER_OP_TX3_TEXTURE_2D 0x00008000
-#define NV20TCL_TX_SHADER_OP_TX3_PASS_THROUGH 0x00020000
-#define NV20TCL_TX_SHADER_OP_TX3_CULL_FRAGMENT 0x00028000
-#define NV20TCL_TX_SHADER_OP_TX3_OFFSET_TEXTURE_2D 0x00030000
-#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT_TEXTURE_2D 0x00048000
-#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT_DEPTH_REPLACE 0x00050000
-#define NV20TCL_TX_SHADER_OP_TX3_DEPENDANT_AR_TEXTURE_2D 0x00078000
-#define NV20TCL_TX_SHADER_OP_TX3_DEPENDANT_GB_TEXTURE_2D 0x00080000
-#define NV20TCL_TX_SHADER_OP_TX3_DOT_PRODUCT 0x00088000
-#define NV20TCL_TX_SHADER_DOTMAPPING 0x00001e74
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX0_SHIFT 0
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX0_MASK 0x0000000f
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX1_SHIFT 4
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX1_MASK 0x000000f0
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX2_SHIFT 8
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX2_MASK 0x00000f00
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX3_SHIFT 12
-#define NV20TCL_TX_SHADER_DOTMAPPING_TX3_MASK 0x0000f000
-#define NV20TCL_TX_SHADER_PREVIOUS 0x00001e78
-#define NV20TCL_TX_SHADER_PREVIOUS_TX0_SHIFT 8
-#define NV20TCL_TX_SHADER_PREVIOUS_TX0_MASK 0x00000f00
-#define NV20TCL_TX_SHADER_PREVIOUS_TX1_SHIFT 12
-#define NV20TCL_TX_SHADER_PREVIOUS_TX1_MASK 0x0000f000
-#define NV20TCL_TX_SHADER_PREVIOUS_TX2_SHIFT 16
-#define NV20TCL_TX_SHADER_PREVIOUS_TX2_MASK 0x00030000
-#define NV20TCL_TX_SHADER_PREVIOUS_TX3_SHIFT 20
-#define NV20TCL_TX_SHADER_PREVIOUS_TX3_MASK 0x00300000
-#define NV20TCL_ENGINE 0x00001e94
-#define NV20TCL_ENGINE_VP (1 << 1)
-#define NV20TCL_ENGINE_FIXED (1 << 2)
-#define NV20TCL_VP_UPLOAD_FROM_ID 0x00001e9c
-#define NV20TCL_VP_START_FROM_ID 0x00001ea0
-#define NV20TCL_VP_UPLOAD_CONST_ID 0x00001ea4
-#define NV20TCL_VIEWPORT_TRANSLATE_X 0x00001f00
-#define NV20TCL_VIEWPORT_TRANSLATE_Y 0x00001f04
-#define NV20TCL_VIEWPORT_TRANSLATE_Z 0x00001f08
-#define NV20TCL_VIEWPORT_TRANSLATE_W 0x00001f0c
-
-
-#define NV17TCL 0x00000099
-
-#define NV17TCL_DMA_IN_MEMORY4 0x000001ac
-#define NV17TCL_DMA_IN_MEMORY5 0x000001b0
-#define NV17TCL_COLOR_MASK_ENABLE 0x000002bc
-#define NV17TCL_LMA_DEPTH_BUFFER_PITCH 0x00000d5c
-#define NV17TCL_LMA_DEPTH_BUFFER_OFFSET 0x00000d60
-#define NV17TCL_LMA_DEPTH_FILL_VALUE 0x00000d68
-#define NV17TCL_LMA_DEPTH_BUFFER_CLEAR 0x00000d6c
-#define NV17TCL_LMA_DEPTH_ENABLE 0x00001658
-
-
-#define NV20_SWIZZLED_SURFACE 0x0000009e
-
-
-
-#define NV12_IMAGE_BLIT 0x0000009f
-
-
-
-#define NV30_CONTEXT_SURFACES_2D 0x00000362
-
-
-
-#define NV30_STRETCHED_IMAGE_FROM_CPU 0x00000366
-
-
-
-#define NV30_TEXTURE_FROM_CPU 0x0000037b
-
-
-
-#define NV30_SCALED_IMAGE_FROM_MEMORY 0x00000389
-
-
-
-#define NV30_IMAGE_FROM_CPU 0x0000038a
-
-
-
-#define NV30TCL 0x00000397
-
-
-
-#define NV30_SWIZZLED_SURFACE 0x0000039e
-
-
-
-#define NV35TCL 0x00000497
-
-
-
-#define NV25TCL 0x00000597
-
-#define NV25TCL_DMA_IN_MEMORY4 0x0000019c
-#define NV25TCL_DMA_IN_MEMORY5 0x000001a0
-#define NV25TCL_DMA_IN_MEMORY8 0x000001ac
-#define NV25TCL_DMA_IN_MEMORY9 0x000001b0
-
-
-#define NV34TCL 0x00000697
-
-#define NV34TCL_NOP 0x00000100
-#define NV34TCL_NOTIFY 0x00000104
-#define NV34TCL_DMA_NOTIFY 0x00000180
-#define NV34TCL_DMA_TEXTURE0 0x00000184
-#define NV34TCL_DMA_TEXTURE1 0x00000188
-#define NV34TCL_DMA_COLOR1 0x0000018c
-#define NV34TCL_DMA_COLOR0 0x00000194
-#define NV34TCL_DMA_ZETA 0x00000198
-#define NV34TCL_DMA_VTXBUF0 0x0000019c
-#define NV34TCL_DMA_VTXBUF1 0x000001a0
-#define NV34TCL_DMA_FENCE 0x000001a4
-#define NV34TCL_DMA_QUERY 0x000001a8
-#define NV34TCL_DMA_IN_MEMORY7 0x000001ac
-#define NV34TCL_DMA_IN_MEMORY8 0x000001b0
-#define NV34TCL_RT_HORIZ 0x00000200
-#define NV34TCL_RT_HORIZ_X_SHIFT 0
-#define NV34TCL_RT_HORIZ_X_MASK 0x0000ffff
-#define NV34TCL_RT_HORIZ_W_SHIFT 16
-#define NV34TCL_RT_HORIZ_W_MASK 0xffff0000
-#define NV34TCL_RT_VERT 0x00000204
-#define NV34TCL_RT_VERT_Y_SHIFT 0
-#define NV34TCL_RT_VERT_Y_MASK 0x0000ffff
-#define NV34TCL_RT_VERT_H_SHIFT 16
-#define NV34TCL_RT_VERT_H_MASK 0xffff0000
-#define NV34TCL_RT_FORMAT 0x00000208
-#define NV34TCL_RT_FORMAT_TYPE_SHIFT 8
-#define NV34TCL_RT_FORMAT_TYPE_MASK 0x00000f00
-#define NV34TCL_RT_FORMAT_TYPE_LINEAR 0x00000100
-#define NV34TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200
-#define NV34TCL_RT_FORMAT_ZETA_SHIFT 5
-#define NV34TCL_RT_FORMAT_ZETA_MASK 0x000000e0
-#define NV34TCL_RT_FORMAT_ZETA_Z16 0x00000020
-#define NV34TCL_RT_FORMAT_ZETA_Z24S8 0x00000040
-#define NV34TCL_RT_FORMAT_COLOR_SHIFT 0
-#define NV34TCL_RT_FORMAT_COLOR_MASK 0x0000001f
-#define NV34TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003
-#define NV34TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005
-#define NV34TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008
-#define NV34TCL_RT_FORMAT_COLOR_B8 0x00000009
-#define NV34TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d
-#define NV34TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f
-#define NV34TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010
-#define NV34TCL_COLOR0_PITCH 0x0000020c
-#define NV34TCL_COLOR0_PITCH_COLOR0_SHIFT 0
-#define NV34TCL_COLOR0_PITCH_COLOR0_MASK 0x0000ffff
-#define NV34TCL_COLOR0_PITCH_ZETA_SHIFT 16
-#define NV34TCL_COLOR0_PITCH_ZETA_MASK 0xffff0000
-#define NV34TCL_COLOR0_OFFSET 0x00000210
-#define NV34TCL_ZETA_OFFSET 0x00000214
-#define NV34TCL_COLOR1_OFFSET 0x00000218
-#define NV34TCL_COLOR1_PITCH 0x0000021c
-#define NV34TCL_RT_ENABLE 0x00000220
-#define NV34TCL_RT_ENABLE_MRT (1 << 4)
-#define NV34TCL_RT_ENABLE_COLOR1 (1 << 1)
-#define NV34TCL_RT_ENABLE_COLOR0 (1 << 0)
-#define NV34TCL_LMA_DEPTH_PITCH 0x0000022c
-#define NV34TCL_LMA_DEPTH_OFFSET 0x00000230
-#define NV34TCL_TX_UNITS_ENABLE 0x0000023c
-#define NV34TCL_TX_UNITS_ENABLE_TX0 (1 << 0)
-#define NV34TCL_TX_UNITS_ENABLE_TX1 (1 << 1)
-#define NV34TCL_TX_UNITS_ENABLE_TX2 (1 << 2)
-#define NV34TCL_TX_UNITS_ENABLE_TX3 (1 << 3)
-#define NV34TCL_TX_UNITS_ENABLE_TX4 (1 << 4)
-#define NV34TCL_TX_UNITS_ENABLE_TX5 (1 << 5)
-#define NV34TCL_TX_UNITS_ENABLE_TX6 (1 << 6)
-#define NV34TCL_TX_UNITS_ENABLE_TX7 (1 << 7)
-#define NV34TCL_TX_MATRIX_ENABLE(x) (0x00000240+((x)*4))
-#define NV34TCL_TX_MATRIX_ENABLE__SIZE 0x00000008
-#define NV34TCL_VIEWPORT_TX_ORIGIN 0x000002b8
-#define NV34TCL_VIEWPORT_TX_ORIGIN_X_SHIFT 0
-#define NV34TCL_VIEWPORT_TX_ORIGIN_X_MASK 0x0000ffff
-#define NV34TCL_VIEWPORT_TX_ORIGIN_Y_SHIFT 16
-#define NV34TCL_VIEWPORT_TX_ORIGIN_Y_MASK 0xffff0000
-#define NV34TCL_VIEWPORT_CLIP_MODE 0x000002bc
-#define NV34TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*8))
-#define NV34TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008
-#define NV34TCL_VIEWPORT_CLIP_HORIZ_L_SHIFT 0
-#define NV34TCL_VIEWPORT_CLIP_HORIZ_L_MASK 0x0000ffff
-#define NV34TCL_VIEWPORT_CLIP_HORIZ_R_SHIFT 16
-#define NV34TCL_VIEWPORT_CLIP_HORIZ_R_MASK 0xffff0000
-#define NV34TCL_VIEWPORT_CLIP_VERT(x) (0x000002c4+((x)*8))
-#define NV34TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008
-#define NV34TCL_VIEWPORT_CLIP_VERT_T_SHIFT 0
-#define NV34TCL_VIEWPORT_CLIP_VERT_T_MASK 0x0000ffff
-#define NV34TCL_VIEWPORT_CLIP_VERT_D_SHIFT 16
-#define NV34TCL_VIEWPORT_CLIP_VERT_D_MASK 0xffff0000
-#define NV34TCL_DITHER_ENABLE 0x00000300
-#define NV34TCL_ALPHA_FUNC_ENABLE 0x00000304
-#define NV34TCL_ALPHA_FUNC_FUNC 0x00000308
-#define NV34TCL_ALPHA_FUNC_FUNC_NEVER 0x00000200
-#define NV34TCL_ALPHA_FUNC_FUNC_LESS 0x00000201
-#define NV34TCL_ALPHA_FUNC_FUNC_EQUAL 0x00000202
-#define NV34TCL_ALPHA_FUNC_FUNC_LEQUAL 0x00000203
-#define NV34TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_ALPHA_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_ALPHA_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV34TCL_ALPHA_FUNC_FUNC_GEQUAL 0x00000206
-#define NV34TCL_ALPHA_FUNC_FUNC_ALWAYS 0x00000207
-#define NV34TCL_ALPHA_FUNC_REF 0x0000030c
-#define NV34TCL_BLEND_FUNC_ENABLE 0x00000310
-#define NV34TCL_BLEND_FUNC_SRC 0x00000314
-#define NV34TCL_BLEND_FUNC_SRC_RGB_SHIFT 0
-#define NV34TCL_BLEND_FUNC_SRC_RGB_MASK 0x0000ffff
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001
-#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV34TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV34TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV34TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV34TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV34TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003
-#define NV34TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SHIFT 16
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_MASK 0xffff0000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00010000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x03000000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x03020000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x03040000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x03060000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x03070000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x03080000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x80010000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x80030000
-#define NV34TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000
-#define NV34TCL_BLEND_FUNC_DST 0x00000318
-#define NV34TCL_BLEND_FUNC_DST_RGB_SHIFT 0
-#define NV34TCL_BLEND_FUNC_DST_RGB_MASK 0x0000ffff
-#define NV34TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001
-#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV34TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV34TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV34TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV34TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV34TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003
-#define NV34TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_SHIFT 16
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_MASK 0xffff0000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00010000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x03000000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x03020000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x03040000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x03060000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x03070000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x03080000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x80010000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x80030000
-#define NV34TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000
-#define NV34TCL_BLEND_COLOR 0x0000031c
-#define NV34TCL_BLEND_COLOR_B_SHIFT 0
-#define NV34TCL_BLEND_COLOR_B_MASK 0x000000ff
-#define NV34TCL_BLEND_COLOR_G_SHIFT 8
-#define NV34TCL_BLEND_COLOR_G_MASK 0x0000ff00
-#define NV34TCL_BLEND_COLOR_R_SHIFT 16
-#define NV34TCL_BLEND_COLOR_R_MASK 0x00ff0000
-#define NV34TCL_BLEND_COLOR_A_SHIFT 24
-#define NV34TCL_BLEND_COLOR_A_MASK 0xff000000
-#define NV34TCL_BLEND_EQUATION 0x00000320
-#define NV34TCL_BLEND_EQUATION_FUNC_ADD 0x00008006
-#define NV34TCL_BLEND_EQUATION_MIN 0x00008007
-#define NV34TCL_BLEND_EQUATION_MAX 0x00008008
-#define NV34TCL_BLEND_EQUATION_FUNC_SUBTRACT 0x0000800a
-#define NV34TCL_BLEND_EQUATION_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV34TCL_COLOR_MASK 0x00000324
-#define NV34TCL_COLOR_MASK_B_SHIFT 0
-#define NV34TCL_COLOR_MASK_B_MASK 0x000000ff
-#define NV34TCL_COLOR_MASK_G_SHIFT 8
-#define NV34TCL_COLOR_MASK_G_MASK 0x0000ff00
-#define NV34TCL_COLOR_MASK_R_SHIFT 16
-#define NV34TCL_COLOR_MASK_R_MASK 0x00ff0000
-#define NV34TCL_COLOR_MASK_A_SHIFT 24
-#define NV34TCL_COLOR_MASK_A_MASK 0xff000000
-#define NV34TCL_STENCIL_BACK_ENABLE 0x00000328
-#define NV34TCL_STENCIL_BACK_MASK 0x0000032c
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC 0x00000330
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206
-#define NV34TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207
-#define NV34TCL_STENCIL_BACK_FUNC_REF 0x00000334
-#define NV34TCL_STENCIL_BACK_FUNC_MASK 0x00000338
-#define NV34TCL_STENCIL_BACK_OP_FAIL 0x0000033c
-#define NV34TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000
-#define NV34TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a
-#define NV34TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00
-#define NV34TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02
-#define NV34TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03
-#define NV34TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL 0x00000340
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV34TCL_STENCIL_BACK_OP_ZPASS 0x00000344
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV34TCL_STENCIL_FRONT_ENABLE 0x00000348
-#define NV34TCL_STENCIL_FRONT_MASK 0x0000034c
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC 0x00000350
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206
-#define NV34TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207
-#define NV34TCL_STENCIL_FRONT_FUNC_REF 0x00000354
-#define NV34TCL_STENCIL_FRONT_FUNC_MASK 0x00000358
-#define NV34TCL_STENCIL_FRONT_OP_FAIL 0x0000035c
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL 0x00000360
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS 0x00000364
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV34TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV34TCL_SHADE_MODEL 0x00000368
-#define NV34TCL_SHADE_MODEL_FLAT 0x00001d00
-#define NV34TCL_SHADE_MODEL_SMOOTH 0x00001d01
-#define NV34TCL_FOG_ENABLE 0x0000036c
-#define NV34TCL_FOG_COLOR 0x00000370
-#define NV34TCL_FOG_COLOR_R_SHIFT 0
-#define NV34TCL_FOG_COLOR_R_MASK 0x000000ff
-#define NV34TCL_FOG_COLOR_G_SHIFT 8
-#define NV34TCL_FOG_COLOR_G_MASK 0x0000ff00
-#define NV34TCL_FOG_COLOR_B_SHIFT 16
-#define NV34TCL_FOG_COLOR_B_MASK 0x00ff0000
-#define NV34TCL_FOG_COLOR_A_SHIFT 24
-#define NV34TCL_FOG_COLOR_A_MASK 0xff000000
-#define NV34TCL_COLOR_LOGIC_OP_ENABLE 0x00000374
-#define NV34TCL_COLOR_LOGIC_OP_OP 0x00000378
-#define NV34TCL_COLOR_LOGIC_OP_OP_CLEAR 0x00001500
-#define NV34TCL_COLOR_LOGIC_OP_OP_AND 0x00001501
-#define NV34TCL_COLOR_LOGIC_OP_OP_AND_REVERSE 0x00001502
-#define NV34TCL_COLOR_LOGIC_OP_OP_COPY 0x00001503
-#define NV34TCL_COLOR_LOGIC_OP_OP_AND_INVERTED 0x00001504
-#define NV34TCL_COLOR_LOGIC_OP_OP_NOOP 0x00001505
-#define NV34TCL_COLOR_LOGIC_OP_OP_XOR 0x00001506
-#define NV34TCL_COLOR_LOGIC_OP_OP_OR 0x00001507
-#define NV34TCL_COLOR_LOGIC_OP_OP_NOR 0x00001508
-#define NV34TCL_COLOR_LOGIC_OP_OP_EQUIV 0x00001509
-#define NV34TCL_COLOR_LOGIC_OP_OP_INVERT 0x0000150a
-#define NV34TCL_COLOR_LOGIC_OP_OP_OR_REVERSE 0x0000150b
-#define NV34TCL_COLOR_LOGIC_OP_OP_COPY_INVERTED 0x0000150c
-#define NV34TCL_COLOR_LOGIC_OP_OP_OR_INVERTED 0x0000150d
-#define NV34TCL_COLOR_LOGIC_OP_OP_NAND 0x0000150e
-#define NV34TCL_COLOR_LOGIC_OP_OP_SET 0x0000150f
-#define NV34TCL_NORMALIZE_ENABLE 0x0000037c
-#define NV34TCL_COLOR_MATERIAL 0x00000390
-#define NV34TCL_COLOR_MATERIAL_FRONT_EMISSION_ENABLE (1 << 0)
-#define NV34TCL_COLOR_MATERIAL_FRONT_AMBIENT_ENABLE (1 << 2)
-#define NV34TCL_COLOR_MATERIAL_FRONT_DIFFUSE_ENABLE (1 << 4)
-#define NV34TCL_COLOR_MATERIAL_FRONT_SPECULAR_ENABLE (1 << 6)
-#define NV34TCL_COLOR_MATERIAL_BACK_EMISSION_ENABLE (1 << 8)
-#define NV34TCL_COLOR_MATERIAL_BACK_AMBIENT_ENABLE (1 << 10)
-#define NV34TCL_COLOR_MATERIAL_BACK_DIFFUSE_ENABLE (1 << 12)
-#define NV34TCL_COLOR_MATERIAL_BACK_SPECULAR_ENABLE (1 << 14)
-#define NV34TCL_DEPTH_RANGE_NEAR 0x00000394
-#define NV34TCL_DEPTH_RANGE_FAR 0x00000398
-#define NV34TCL_COLOR_MATERIAL_FRONT_R 0x000003a0
-#define NV34TCL_COLOR_MATERIAL_FRONT_G 0x000003a4
-#define NV34TCL_COLOR_MATERIAL_FRONT_B 0x000003a8
-#define NV34TCL_COLOR_MATERIAL_FRONT_A 0x000003b4
-#define NV34TCL_LINE_WIDTH 0x000003b8
-#define NV34TCL_LINE_SMOOTH_ENABLE 0x000003bc
-#define NV34TCL_TX_GEN_S(x) (0x00000400+((x)*16))
-#define NV34TCL_TX_GEN_S__SIZE 0x00000008
-#define NV34TCL_TX_GEN_S_FALSE 0x00000000
-#define NV34TCL_TX_GEN_S_EYE_LINEAR 0x00002400
-#define NV34TCL_TX_GEN_S_OBJECT_LINEAR 0x00002401
-#define NV34TCL_TX_GEN_S_SPHERE_MAP 0x00002402
-#define NV34TCL_TX_GEN_S_NORMAL_MAP 0x00008511
-#define NV34TCL_TX_GEN_S_REFLECTION_MAP 0x00008512
-#define NV34TCL_TX_GEN_T(x) (0x00000404+((x)*16))
-#define NV34TCL_TX_GEN_T__SIZE 0x00000008
-#define NV34TCL_TX_GEN_T_FALSE 0x00000000
-#define NV34TCL_TX_GEN_T_EYE_LINEAR 0x00002400
-#define NV34TCL_TX_GEN_T_OBJECT_LINEAR 0x00002401
-#define NV34TCL_TX_GEN_T_SPHERE_MAP 0x00002402
-#define NV34TCL_TX_GEN_T_NORMAL_MAP 0x00008511
-#define NV34TCL_TX_GEN_T_REFLECTION_MAP 0x00008512
-#define NV34TCL_TX_GEN_R(x) (0x00000408+((x)*16))
-#define NV34TCL_TX_GEN_R__SIZE 0x00000008
-#define NV34TCL_TX_GEN_R_FALSE 0x00000000
-#define NV34TCL_TX_GEN_R_EYE_LINEAR 0x00002400
-#define NV34TCL_TX_GEN_R_OBJECT_LINEAR 0x00002401
-#define NV34TCL_TX_GEN_R_SPHERE_MAP 0x00002402
-#define NV34TCL_TX_GEN_R_NORMAL_MAP 0x00008511
-#define NV34TCL_TX_GEN_R_REFLECTION_MAP 0x00008512
-#define NV34TCL_TX_GEN_Q(x) (0x0000040c+((x)*16))
-#define NV34TCL_TX_GEN_Q__SIZE 0x00000008
-#define NV34TCL_TX_GEN_Q_FALSE 0x00000000
-#define NV34TCL_TX_GEN_Q_EYE_LINEAR 0x00002400
-#define NV34TCL_TX_GEN_Q_OBJECT_LINEAR 0x00002401
-#define NV34TCL_TX_GEN_Q_SPHERE_MAP 0x00002402
-#define NV34TCL_TX_GEN_Q_NORMAL_MAP 0x00008511
-#define NV34TCL_TX_GEN_Q_REFLECTION_MAP 0x00008512
-#define NV34TCL_MODELVIEW_MATRIX(x) (0x00000480+((x)*4))
-#define NV34TCL_MODELVIEW_MATRIX__SIZE 0x00000010
-#define NV34TCL_INVERSE_MODELVIEW_MATRIX(x) (0x00000580+((x)*4))
-#define NV34TCL_INVERSE_MODELVIEW_MATRIX__SIZE 0x0000000c
-#define NV34TCL_PROJECTION_MATRIX(x) (0x00000680+((x)*4))
-#define NV34TCL_PROJECTION_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX0_MATRIX(x) (0x000006c0+((x)*4))
-#define NV34TCL_TX0_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX1_MATRIX(x) (0x00000700+((x)*4))
-#define NV34TCL_TX1_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX2_MATRIX(x) (0x00000740+((x)*4))
-#define NV34TCL_TX2_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX3_MATRIX(x) (0x00000780+((x)*4))
-#define NV34TCL_TX3_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX4_MATRIX(x) (0x000007c0+((x)*4))
-#define NV34TCL_TX4_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX5_MATRIX(x) (0x00000800+((x)*4))
-#define NV34TCL_TX5_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX6_MATRIX(x) (0x00000840+((x)*4))
-#define NV34TCL_TX6_MATRIX__SIZE 0x00000010
-#define NV34TCL_TX7_MATRIX(x) (0x00000880+((x)*4))
-#define NV34TCL_TX7_MATRIX__SIZE 0x00000010
-#define NV34TCL_SCISSOR_HORIZ 0x000008c0
-#define NV34TCL_SCISSOR_HORIZ_X_SHIFT 0
-#define NV34TCL_SCISSOR_HORIZ_X_MASK 0x0000ffff
-#define NV34TCL_SCISSOR_HORIZ_W_SHIFT 16
-#define NV34TCL_SCISSOR_HORIZ_W_MASK 0xffff0000
-#define NV34TCL_SCISSOR_VERT 0x000008c4
-#define NV34TCL_SCISSOR_VERT_Y_SHIFT 0
-#define NV34TCL_SCISSOR_VERT_Y_MASK 0x0000ffff
-#define NV34TCL_SCISSOR_VERT_H_SHIFT 16
-#define NV34TCL_SCISSOR_VERT_H_MASK 0xffff0000
-#define NV34TCL_FOG_COORD_DIST 0x000008c8
-#define NV34TCL_FOG_COORD_DIST_COORD_FALSE 0x00000000
-#define NV34TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_RADIAL_NV 0x00000001
-#define NV34TCL_FOG_COORD_DIST_COORD_FRAGMENT_DEPTH_DISTANCE_EYE_PLANE_ABSOLUTE_NV 0x00000002
-#define NV34TCL_FOG_COORD_DIST_COORD_FOG 0x00000003
-#define NV34TCL_FOG_MODE 0x000008cc
-#define NV34TCL_FOG_MODE_EXP 0x00000800
-#define NV34TCL_FOG_MODE_EXP_2 0x00000802
-#define NV34TCL_FOG_MODE_EXP2 0x00000803
-#define NV34TCL_FOG_MODE_LINEAR 0x00000804
-#define NV34TCL_FOG_MODE_LINEAR_2 0x00002601
-#define NV34TCL_FOG_EQUATION_CONSTANT 0x000008d0
-#define NV34TCL_FOG_EQUATION_LINEAR 0x000008d4
-#define NV34TCL_FOG_EQUATION_QUADRATIC 0x000008d8
-#define NV34TCL_FP_ACTIVE_PROGRAM 0x000008e4
-#define NV34TCL_FP_ACTIVE_PROGRAM_DMA0 (1 << 0)
-#define NV34TCL_FP_ACTIVE_PROGRAM_DMA1 (1 << 1)
-#define NV34TCL_FP_ACTIVE_PROGRAM_OFFSET_SHIFT 2
-#define NV34TCL_FP_ACTIVE_PROGRAM_OFFSET_MASK 0xfffffffc
-#define NV34TCL_RC_COLOR0 0x000008ec
-#define NV34TCL_RC_COLOR0_B_SHIFT 0
-#define NV34TCL_RC_COLOR0_B_MASK 0x000000ff
-#define NV34TCL_RC_COLOR0_G_SHIFT 8
-#define NV34TCL_RC_COLOR0_G_MASK 0x0000ff00
-#define NV34TCL_RC_COLOR0_R_SHIFT 16
-#define NV34TCL_RC_COLOR0_R_MASK 0x00ff0000
-#define NV34TCL_RC_COLOR0_A_SHIFT 24
-#define NV34TCL_RC_COLOR0_A_MASK 0xff000000
-#define NV34TCL_RC_COLOR1 0x000008f0
-#define NV34TCL_RC_COLOR1_B_SHIFT 0
-#define NV34TCL_RC_COLOR1_B_MASK 0x000000ff
-#define NV34TCL_RC_COLOR1_G_SHIFT 8
-#define NV34TCL_RC_COLOR1_G_MASK 0x0000ff00
-#define NV34TCL_RC_COLOR1_R_SHIFT 16
-#define NV34TCL_RC_COLOR1_R_MASK 0x00ff0000
-#define NV34TCL_RC_COLOR1_A_SHIFT 24
-#define NV34TCL_RC_COLOR1_A_MASK 0xff000000
-#define NV34TCL_RC_FINAL0 0x000008f4
-#define NV34TCL_RC_FINAL0_D_INPUT_SHIFT 0
-#define NV34TCL_RC_FINAL0_D_INPUT_MASK 0x0000000f
-#define NV34TCL_RC_FINAL0_D_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV34TCL_RC_FINAL0_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV34TCL_RC_FINAL0_D_INPUT_FOG 0x00000003
-#define NV34TCL_RC_FINAL0_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV34TCL_RC_FINAL0_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV34TCL_RC_FINAL0_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV34TCL_RC_FINAL0_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV34TCL_RC_FINAL0_D_INPUT_SPARE0_NV 0x0000000c
-#define NV34TCL_RC_FINAL0_D_INPUT_SPARE1_NV 0x0000000d
-#define NV34TCL_RC_FINAL0_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV34TCL_RC_FINAL0_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE (1 << 4)
-#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL0_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV34TCL_RC_FINAL0_D_MAPPING_SHIFT 5
-#define NV34TCL_RC_FINAL0_D_MAPPING_MASK 0x000000e0
-#define NV34TCL_RC_FINAL0_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL0_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV34TCL_RC_FINAL0_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV34TCL_RC_FINAL0_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV34TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV34TCL_RC_FINAL0_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV34TCL_RC_FINAL0_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV34TCL_RC_FINAL0_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV34TCL_RC_FINAL0_C_INPUT_SHIFT 8
-#define NV34TCL_RC_FINAL0_C_INPUT_MASK 0x00000f00
-#define NV34TCL_RC_FINAL0_C_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_FINAL0_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_FINAL0_C_INPUT_FOG 0x00000300
-#define NV34TCL_RC_FINAL0_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_FINAL0_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_FINAL0_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_FINAL0_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_FINAL0_C_INPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_FINAL0_C_INPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_FINAL0_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_FINAL0_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE (1 << 12)
-#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL0_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV34TCL_RC_FINAL0_C_MAPPING_SHIFT 13
-#define NV34TCL_RC_FINAL0_C_MAPPING_MASK 0x0000e000
-#define NV34TCL_RC_FINAL0_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL0_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV34TCL_RC_FINAL0_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV34TCL_RC_FINAL0_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV34TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV34TCL_RC_FINAL0_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV34TCL_RC_FINAL0_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV34TCL_RC_FINAL0_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV34TCL_RC_FINAL0_B_INPUT_SHIFT 16
-#define NV34TCL_RC_FINAL0_B_INPUT_MASK 0x000f0000
-#define NV34TCL_RC_FINAL0_B_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV34TCL_RC_FINAL0_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV34TCL_RC_FINAL0_B_INPUT_FOG 0x00030000
-#define NV34TCL_RC_FINAL0_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV34TCL_RC_FINAL0_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV34TCL_RC_FINAL0_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV34TCL_RC_FINAL0_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV34TCL_RC_FINAL0_B_INPUT_SPARE0_NV 0x000c0000
-#define NV34TCL_RC_FINAL0_B_INPUT_SPARE1_NV 0x000d0000
-#define NV34TCL_RC_FINAL0_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV34TCL_RC_FINAL0_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE (1 << 20)
-#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL0_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV34TCL_RC_FINAL0_B_MAPPING_SHIFT 21
-#define NV34TCL_RC_FINAL0_B_MAPPING_MASK 0x00e00000
-#define NV34TCL_RC_FINAL0_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL0_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV34TCL_RC_FINAL0_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV34TCL_RC_FINAL0_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV34TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV34TCL_RC_FINAL0_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV34TCL_RC_FINAL0_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV34TCL_RC_FINAL0_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV34TCL_RC_FINAL0_A_INPUT_SHIFT 24
-#define NV34TCL_RC_FINAL0_A_INPUT_MASK 0x0f000000
-#define NV34TCL_RC_FINAL0_A_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV34TCL_RC_FINAL0_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV34TCL_RC_FINAL0_A_INPUT_FOG 0x03000000
-#define NV34TCL_RC_FINAL0_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV34TCL_RC_FINAL0_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV34TCL_RC_FINAL0_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV34TCL_RC_FINAL0_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV34TCL_RC_FINAL0_A_INPUT_SPARE0_NV 0x0c000000
-#define NV34TCL_RC_FINAL0_A_INPUT_SPARE1_NV 0x0d000000
-#define NV34TCL_RC_FINAL0_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV34TCL_RC_FINAL0_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE (1 << 28)
-#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL0_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_SHIFT 29
-#define NV34TCL_RC_FINAL0_A_MAPPING_MASK 0xe0000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV34TCL_RC_FINAL0_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV34TCL_RC_FINAL1 0x000008f8
-#define NV34TCL_RC_FINAL1_COLOR_SUM_CLAMP (1 << 7)
-#define NV34TCL_RC_FINAL1_G_INPUT_SHIFT 8
-#define NV34TCL_RC_FINAL1_G_INPUT_MASK 0x00000f00
-#define NV34TCL_RC_FINAL1_G_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_FINAL1_G_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_FINAL1_G_INPUT_FOG 0x00000300
-#define NV34TCL_RC_FINAL1_G_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_FINAL1_G_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_FINAL1_G_INPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_FINAL1_G_INPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_FINAL1_G_INPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_FINAL1_G_INPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_FINAL1_G_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_FINAL1_G_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE (1 << 12)
-#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL1_G_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV34TCL_RC_FINAL1_G_MAPPING_SHIFT 13
-#define NV34TCL_RC_FINAL1_G_MAPPING_MASK 0x0000e000
-#define NV34TCL_RC_FINAL1_G_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL1_G_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV34TCL_RC_FINAL1_G_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV34TCL_RC_FINAL1_G_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV34TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV34TCL_RC_FINAL1_G_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV34TCL_RC_FINAL1_G_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV34TCL_RC_FINAL1_G_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV34TCL_RC_FINAL1_F_INPUT_SHIFT 16
-#define NV34TCL_RC_FINAL1_F_INPUT_MASK 0x000f0000
-#define NV34TCL_RC_FINAL1_F_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV34TCL_RC_FINAL1_F_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV34TCL_RC_FINAL1_F_INPUT_FOG 0x00030000
-#define NV34TCL_RC_FINAL1_F_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV34TCL_RC_FINAL1_F_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV34TCL_RC_FINAL1_F_INPUT_TEXTURE0_ARB 0x00080000
-#define NV34TCL_RC_FINAL1_F_INPUT_TEXTURE1_ARB 0x00090000
-#define NV34TCL_RC_FINAL1_F_INPUT_SPARE0_NV 0x000c0000
-#define NV34TCL_RC_FINAL1_F_INPUT_SPARE1_NV 0x000d0000
-#define NV34TCL_RC_FINAL1_F_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV34TCL_RC_FINAL1_F_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE (1 << 20)
-#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL1_F_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV34TCL_RC_FINAL1_F_MAPPING_SHIFT 21
-#define NV34TCL_RC_FINAL1_F_MAPPING_MASK 0x00e00000
-#define NV34TCL_RC_FINAL1_F_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL1_F_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV34TCL_RC_FINAL1_F_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV34TCL_RC_FINAL1_F_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV34TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV34TCL_RC_FINAL1_F_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV34TCL_RC_FINAL1_F_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV34TCL_RC_FINAL1_F_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV34TCL_RC_FINAL1_E_INPUT_SHIFT 24
-#define NV34TCL_RC_FINAL1_E_INPUT_MASK 0x0f000000
-#define NV34TCL_RC_FINAL1_E_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV34TCL_RC_FINAL1_E_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV34TCL_RC_FINAL1_E_INPUT_FOG 0x03000000
-#define NV34TCL_RC_FINAL1_E_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV34TCL_RC_FINAL1_E_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV34TCL_RC_FINAL1_E_INPUT_TEXTURE0_ARB 0x08000000
-#define NV34TCL_RC_FINAL1_E_INPUT_TEXTURE1_ARB 0x09000000
-#define NV34TCL_RC_FINAL1_E_INPUT_SPARE0_NV 0x0c000000
-#define NV34TCL_RC_FINAL1_E_INPUT_SPARE1_NV 0x0d000000
-#define NV34TCL_RC_FINAL1_E_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV34TCL_RC_FINAL1_E_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE (1 << 28)
-#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_FINAL1_E_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_SHIFT 29
-#define NV34TCL_RC_FINAL1_E_MAPPING_MASK 0xe0000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV34TCL_RC_FINAL1_E_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV34TCL_RC_ENABLE 0x000008fc
-#define NV34TCL_RC_ENABLE_NUM_COMBINERS_SHIFT 0
-#define NV34TCL_RC_ENABLE_NUM_COMBINERS_MASK 0x0000000f
-#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR0_SHIFT 12
-#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR0_MASK 0x0000f000
-#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR1_SHIFT 16
-#define NV34TCL_RC_ENABLE_STAGE_CONSTANT_COLOR1_MASK 0x000f0000
-#define NV34TCL_RC_IN_ALPHA(x) (0x00000900+((x)*32))
-#define NV34TCL_RC_IN_ALPHA__SIZE 0x00000008
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_SHIFT 0
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_MASK 0x0000000f
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_FOG 0x00000003
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE0_NV 0x0000000c
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE1_NV 0x0000000d
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV34TCL_RC_IN_ALPHA_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE (1 << 4)
-#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_BLUE 0x00000000
-#define NV34TCL_RC_IN_ALPHA_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SHIFT 5
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_MASK 0x000000e0
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV34TCL_RC_IN_ALPHA_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_SHIFT 8
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_MASK 0x00000f00
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_FOG 0x00000300
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_IN_ALPHA_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE (1 << 12)
-#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_BLUE 0x00000000
-#define NV34TCL_RC_IN_ALPHA_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SHIFT 13
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_MASK 0x0000e000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV34TCL_RC_IN_ALPHA_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_SHIFT 16
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_MASK 0x000f0000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_FOG 0x00030000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE0_NV 0x000c0000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE1_NV 0x000d0000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV34TCL_RC_IN_ALPHA_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE (1 << 20)
-#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_BLUE 0x00000000
-#define NV34TCL_RC_IN_ALPHA_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SHIFT 21
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_MASK 0x00e00000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV34TCL_RC_IN_ALPHA_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_SHIFT 24
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_MASK 0x0f000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_FOG 0x03000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE0_NV 0x0c000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE1_NV 0x0d000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV34TCL_RC_IN_ALPHA_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE (1 << 28)
-#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_BLUE 0x00000000
-#define NV34TCL_RC_IN_ALPHA_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SHIFT 29
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_MASK 0xe0000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV34TCL_RC_IN_ALPHA_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV34TCL_RC_IN_RGB(x) (0x00000904+((x)*32))
-#define NV34TCL_RC_IN_RGB__SIZE 0x00000008
-#define NV34TCL_RC_IN_RGB_D_INPUT_SHIFT 0
-#define NV34TCL_RC_IN_RGB_D_INPUT_MASK 0x0000000f
-#define NV34TCL_RC_IN_RGB_D_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV34TCL_RC_IN_RGB_D_INPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV34TCL_RC_IN_RGB_D_INPUT_FOG 0x00000003
-#define NV34TCL_RC_IN_RGB_D_INPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV34TCL_RC_IN_RGB_D_INPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE0_ARB 0x00000008
-#define NV34TCL_RC_IN_RGB_D_INPUT_TEXTURE1_ARB 0x00000009
-#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE0_NV 0x0000000c
-#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE1_NV 0x0000000d
-#define NV34TCL_RC_IN_RGB_D_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV34TCL_RC_IN_RGB_D_INPUT_E_TIMES_F_NV 0x0000000f
-#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE (1 << 4)
-#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_IN_RGB_D_COMPONENT_USAGE_ALPHA 0x00000010
-#define NV34TCL_RC_IN_RGB_D_MAPPING_SHIFT 5
-#define NV34TCL_RC_IN_RGB_D_MAPPING_MASK 0x000000e0
-#define NV34TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_RGB_D_MAPPING_UNSIGNED_INVERT_NV 0x00000020
-#define NV34TCL_RC_IN_RGB_D_MAPPING_EXPAND_NORMAL_NV 0x00000040
-#define NV34TCL_RC_IN_RGB_D_MAPPING_EXPAND_NEGATE_NV 0x00000060
-#define NV34TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NORMAL_NV 0x00000080
-#define NV34TCL_RC_IN_RGB_D_MAPPING_HALF_BIAS_NEGATE_NV 0x000000a0
-#define NV34TCL_RC_IN_RGB_D_MAPPING_SIGNED_IDENTITY_NV 0x000000c0
-#define NV34TCL_RC_IN_RGB_D_MAPPING_SIGNED_NEGATE_NV 0x000000e0
-#define NV34TCL_RC_IN_RGB_C_INPUT_SHIFT 8
-#define NV34TCL_RC_IN_RGB_C_INPUT_MASK 0x00000f00
-#define NV34TCL_RC_IN_RGB_C_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_IN_RGB_C_INPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_IN_RGB_C_INPUT_FOG 0x00000300
-#define NV34TCL_RC_IN_RGB_C_INPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_IN_RGB_C_INPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_IN_RGB_C_INPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_IN_RGB_C_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_IN_RGB_C_INPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE (1 << 12)
-#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_IN_RGB_C_COMPONENT_USAGE_ALPHA 0x00001000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_SHIFT 13
-#define NV34TCL_RC_IN_RGB_C_MAPPING_MASK 0x0000e000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_UNSIGNED_INVERT_NV 0x00002000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_EXPAND_NORMAL_NV 0x00004000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_EXPAND_NEGATE_NV 0x00006000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NORMAL_NV 0x00008000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_HALF_BIAS_NEGATE_NV 0x0000a000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_SIGNED_IDENTITY_NV 0x0000c000
-#define NV34TCL_RC_IN_RGB_C_MAPPING_SIGNED_NEGATE_NV 0x0000e000
-#define NV34TCL_RC_IN_RGB_B_INPUT_SHIFT 16
-#define NV34TCL_RC_IN_RGB_B_INPUT_MASK 0x000f0000
-#define NV34TCL_RC_IN_RGB_B_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR0_NV 0x00010000
-#define NV34TCL_RC_IN_RGB_B_INPUT_CONSTANT_COLOR1_NV 0x00020000
-#define NV34TCL_RC_IN_RGB_B_INPUT_FOG 0x00030000
-#define NV34TCL_RC_IN_RGB_B_INPUT_PRIMARY_COLOR_NV 0x00040000
-#define NV34TCL_RC_IN_RGB_B_INPUT_SECONDARY_COLOR_NV 0x00050000
-#define NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE0_ARB 0x00080000
-#define NV34TCL_RC_IN_RGB_B_INPUT_TEXTURE1_ARB 0x00090000
-#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE0_NV 0x000c0000
-#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE1_NV 0x000d0000
-#define NV34TCL_RC_IN_RGB_B_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000e0000
-#define NV34TCL_RC_IN_RGB_B_INPUT_E_TIMES_F_NV 0x000f0000
-#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE (1 << 20)
-#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_IN_RGB_B_COMPONENT_USAGE_ALPHA 0x00100000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_SHIFT 21
-#define NV34TCL_RC_IN_RGB_B_MAPPING_MASK 0x00e00000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_UNSIGNED_INVERT_NV 0x00200000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_EXPAND_NORMAL_NV 0x00400000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_EXPAND_NEGATE_NV 0x00600000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NORMAL_NV 0x00800000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_HALF_BIAS_NEGATE_NV 0x00a00000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_SIGNED_IDENTITY_NV 0x00c00000
-#define NV34TCL_RC_IN_RGB_B_MAPPING_SIGNED_NEGATE_NV 0x00e00000
-#define NV34TCL_RC_IN_RGB_A_INPUT_SHIFT 24
-#define NV34TCL_RC_IN_RGB_A_INPUT_MASK 0x0f000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_ZERO 0x00000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR0_NV 0x01000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_CONSTANT_COLOR1_NV 0x02000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_FOG 0x03000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_PRIMARY_COLOR_NV 0x04000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_SECONDARY_COLOR_NV 0x05000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE0_ARB 0x08000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_TEXTURE1_ARB 0x09000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE0_NV 0x0c000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE1_NV 0x0d000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0e000000
-#define NV34TCL_RC_IN_RGB_A_INPUT_E_TIMES_F_NV 0x0f000000
-#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE (1 << 28)
-#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_RGB 0x00000000
-#define NV34TCL_RC_IN_RGB_A_COMPONENT_USAGE_ALPHA 0x10000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_SHIFT 29
-#define NV34TCL_RC_IN_RGB_A_MAPPING_MASK 0xe0000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_IDENTITY_NV 0x00000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_UNSIGNED_INVERT_NV 0x20000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_EXPAND_NORMAL_NV 0x40000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_EXPAND_NEGATE_NV 0x60000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NORMAL_NV 0x80000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_HALF_BIAS_NEGATE_NV 0xa0000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_SIGNED_IDENTITY_NV 0xc0000000
-#define NV34TCL_RC_IN_RGB_A_MAPPING_SIGNED_NEGATE_NV 0xe0000000
-#define NV34TCL_RC_CONSTANT_COLOR0(x) (0x00000908+((x)*32))
-#define NV34TCL_RC_CONSTANT_COLOR0__SIZE 0x00000008
-#define NV34TCL_RC_CONSTANT_COLOR0_B_SHIFT 0
-#define NV34TCL_RC_CONSTANT_COLOR0_B_MASK 0x000000ff
-#define NV34TCL_RC_CONSTANT_COLOR0_G_SHIFT 8
-#define NV34TCL_RC_CONSTANT_COLOR0_G_MASK 0x0000ff00
-#define NV34TCL_RC_CONSTANT_COLOR0_R_SHIFT 16
-#define NV34TCL_RC_CONSTANT_COLOR0_R_MASK 0x00ff0000
-#define NV34TCL_RC_CONSTANT_COLOR0_A_SHIFT 24
-#define NV34TCL_RC_CONSTANT_COLOR0_A_MASK 0xff000000
-#define NV34TCL_RC_CONSTANT_COLOR1(x) (0x0000090c+((x)*32))
-#define NV34TCL_RC_CONSTANT_COLOR1__SIZE 0x00000008
-#define NV34TCL_RC_CONSTANT_COLOR1_B_SHIFT 0
-#define NV34TCL_RC_CONSTANT_COLOR1_B_MASK 0x000000ff
-#define NV34TCL_RC_CONSTANT_COLOR1_G_SHIFT 8
-#define NV34TCL_RC_CONSTANT_COLOR1_G_MASK 0x0000ff00
-#define NV34TCL_RC_CONSTANT_COLOR1_R_SHIFT 16
-#define NV34TCL_RC_CONSTANT_COLOR1_R_MASK 0x00ff0000
-#define NV34TCL_RC_CONSTANT_COLOR1_A_SHIFT 24
-#define NV34TCL_RC_CONSTANT_COLOR1_A_MASK 0xff000000
-#define NV34TCL_RC_OUT_ALPHA(x) (0x00000910+((x)*32))
-#define NV34TCL_RC_OUT_ALPHA__SIZE 0x00000008
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SHIFT 0
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_MASK 0x0000000f
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_FOG 0x00000003
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV34TCL_RC_OUT_ALPHA_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SHIFT 4
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_MASK 0x000000f0
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_FOG 0x00000030
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV34TCL_RC_OUT_ALPHA_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SHIFT 8
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_MASK 0x00000f00
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_FOG 0x00000300
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_OUT_ALPHA_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_OUT_ALPHA_CD_DOT_PRODUCT (1 << 12)
-#define NV34TCL_RC_OUT_ALPHA_AB_DOT_PRODUCT (1 << 13)
-#define NV34TCL_RC_OUT_ALPHA_MUX_SUM (1 << 14)
-#define NV34TCL_RC_OUT_ALPHA_BIAS (1 << 15)
-#define NV34TCL_RC_OUT_ALPHA_BIAS_NONE 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV34TCL_RC_OUT_ALPHA_SCALE_SHIFT 17
-#define NV34TCL_RC_OUT_ALPHA_SCALE_MASK 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_SCALE_NONE 0x00000000
-#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV34TCL_RC_OUT_ALPHA_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV34TCL_RC_OUT_RGB(x) (0x00000914+((x)*32))
-#define NV34TCL_RC_OUT_RGB__SIZE 0x00000008
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SHIFT 0
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_MASK 0x0000000f
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR0_NV 0x00000001
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_CONSTANT_COLOR1_NV 0x00000002
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_FOG 0x00000003
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_PRIMARY_COLOR_NV 0x00000004
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SECONDARY_COLOR_NV 0x00000005
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE0_ARB 0x00000008
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_TEXTURE1_ARB 0x00000009
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_NV 0x0000000c
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE1_NV 0x0000000d
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x0000000e
-#define NV34TCL_RC_OUT_RGB_CD_OUTPUT_E_TIMES_F_NV 0x0000000f
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SHIFT 4
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_MASK 0x000000f0
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR0_NV 0x00000010
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_CONSTANT_COLOR1_NV 0x00000020
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_FOG 0x00000030
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_PRIMARY_COLOR_NV 0x00000040
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SECONDARY_COLOR_NV 0x00000050
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE0_ARB 0x00000080
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_TEXTURE1_ARB 0x00000090
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_NV 0x000000c0
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE1_NV 0x000000d0
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x000000e0
-#define NV34TCL_RC_OUT_RGB_AB_OUTPUT_E_TIMES_F_NV 0x000000f0
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SHIFT 8
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_MASK 0x00000f00
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_ZERO 0x00000000
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR0_NV 0x00000100
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_CONSTANT_COLOR1_NV 0x00000200
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_FOG 0x00000300
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_PRIMARY_COLOR_NV 0x00000400
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SECONDARY_COLOR_NV 0x00000500
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE0_ARB 0x00000800
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_TEXTURE1_ARB 0x00000900
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_NV 0x00000c00
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE1_NV 0x00000d00
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_SPARE0_PLUS_SECONDARY_COLOR_NV 0x00000e00
-#define NV34TCL_RC_OUT_RGB_SUM_OUTPUT_E_TIMES_F_NV 0x00000f00
-#define NV34TCL_RC_OUT_RGB_CD_DOT_PRODUCT (1 << 12)
-#define NV34TCL_RC_OUT_RGB_AB_DOT_PRODUCT (1 << 13)
-#define NV34TCL_RC_OUT_RGB_MUX_SUM (1 << 14)
-#define NV34TCL_RC_OUT_RGB_BIAS (1 << 15)
-#define NV34TCL_RC_OUT_RGB_BIAS_NONE 0x00000000
-#define NV34TCL_RC_OUT_RGB_BIAS_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x00008000
-#define NV34TCL_RC_OUT_RGB_SCALE_SHIFT 17
-#define NV34TCL_RC_OUT_RGB_SCALE_MASK 0x00000000
-#define NV34TCL_RC_OUT_RGB_SCALE_NONE 0x00000000
-#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_TWO_NV 0x00020000
-#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_FOUR_NV 0x00040000
-#define NV34TCL_RC_OUT_RGB_SCALE_SCALE_BY_ONE_HALF_NV 0x00060000
-#define NV34TCL_VIEWPORT_HORIZ 0x00000a00
-#define NV34TCL_VIEWPORT_HORIZ_X_SHIFT 0
-#define NV34TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff
-#define NV34TCL_VIEWPORT_HORIZ_W_SHIFT 16
-#define NV34TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000
-#define NV34TCL_VIEWPORT_VERT 0x00000a04
-#define NV34TCL_VIEWPORT_VERT_Y_SHIFT 0
-#define NV34TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff
-#define NV34TCL_VIEWPORT_VERT_H_SHIFT 16
-#define NV34TCL_VIEWPORT_VERT_H_MASK 0xffff0000
-#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10
-#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14
-#define NV34TCL_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18
-#define NV34TCL_VIEWPORT_TRANSLATE_X 0x00000a20
-#define NV34TCL_VIEWPORT_TRANSLATE_Y 0x00000a24
-#define NV34TCL_VIEWPORT_TRANSLATE_Z 0x00000a28
-#define NV34TCL_VIEWPORT_TRANSLATE_W 0x00000a2c
-#define NV34TCL_VIEWPORT_SCALE_X 0x00000a30
-#define NV34TCL_VIEWPORT_SCALE_Y 0x00000a34
-#define NV34TCL_VIEWPORT_SCALE_Z 0x00000a38
-#define NV34TCL_VIEWPORT_SCALE_W 0x00000a3c
-#define NV34TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000a60
-#define NV34TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000a64
-#define NV34TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000a68
-#define NV34TCL_DEPTH_FUNC 0x00000a6c
-#define NV34TCL_DEPTH_FUNC_NEVER 0x00000200
-#define NV34TCL_DEPTH_FUNC_LESS 0x00000201
-#define NV34TCL_DEPTH_FUNC_EQUAL 0x00000202
-#define NV34TCL_DEPTH_FUNC_LEQUAL 0x00000203
-#define NV34TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV34TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV34TCL_DEPTH_FUNC_NOTEQUAL 0x00000205
-#define NV34TCL_DEPTH_FUNC_GEQUAL 0x00000206
-#define NV34TCL_DEPTH_FUNC_ALWAYS 0x00000207
-#define NV34TCL_DEPTH_WRITE_ENABLE 0x00000a70
-#define NV34TCL_DEPTH_TEST_ENABLE 0x00000a74
-#define NV34TCL_POLYGON_OFFSET_FACTOR 0x00000a78
-#define NV34TCL_POLYGON_OFFSET_UNITS 0x00000a7c
-#define NV34TCL_VTX_ATTR_3I_XY(x) (0x00000a80+((x)*8))
-#define NV34TCL_VTX_ATTR_3I_XY__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_3I_XY_X_SHIFT 0
-#define NV34TCL_VTX_ATTR_3I_XY_X_MASK 0x0000ffff
-#define NV34TCL_VTX_ATTR_3I_XY_Y_SHIFT 16
-#define NV34TCL_VTX_ATTR_3I_XY_Y_MASK 0xffff0000
-#define NV34TCL_VTX_ATTR_3I_Z(x) (0x00000a84+((x)*8))
-#define NV34TCL_VTX_ATTR_3I_Z__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_3I_Z_Z_SHIFT 0
-#define NV34TCL_VTX_ATTR_3I_Z_Z_MASK 0x0000ffff
-#define NV34TCL_VP_UPLOAD_INST(x) (0x00000b80+((x)*4))
-#define NV34TCL_VP_UPLOAD_INST__SIZE 0x00000004
-#define NV34TCL_TX0_CLIP_PLANE_A(x) (0x00000e00+((x)*16))
-#define NV34TCL_TX0_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX0_CLIP_PLANE_B(x) (0x00000e04+((x)*16))
-#define NV34TCL_TX0_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX0_CLIP_PLANE_C(x) (0x00000e08+((x)*16))
-#define NV34TCL_TX0_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX0_CLIP_PLANE_D(x) (0x00000e0c+((x)*16))
-#define NV34TCL_TX0_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX1_CLIP_PLANE_A(x) (0x00000e40+((x)*16))
-#define NV34TCL_TX1_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX1_CLIP_PLANE_B(x) (0x00000e44+((x)*16))
-#define NV34TCL_TX1_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX1_CLIP_PLANE_C(x) (0x00000e48+((x)*16))
-#define NV34TCL_TX1_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX1_CLIP_PLANE_D(x) (0x00000e4c+((x)*16))
-#define NV34TCL_TX1_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX2_CLIP_PLANE_A(x) (0x00000e80+((x)*16))
-#define NV34TCL_TX2_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX2_CLIP_PLANE_B(x) (0x00000e84+((x)*16))
-#define NV34TCL_TX2_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX2_CLIP_PLANE_C(x) (0x00000e88+((x)*16))
-#define NV34TCL_TX2_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX2_CLIP_PLANE_D(x) (0x00000e8c+((x)*16))
-#define NV34TCL_TX2_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX3_CLIP_PLANE_A(x) (0x00000ec0+((x)*16))
-#define NV34TCL_TX3_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX3_CLIP_PLANE_B(x) (0x00000ec4+((x)*16))
-#define NV34TCL_TX3_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX3_CLIP_PLANE_C(x) (0x00000ec8+((x)*16))
-#define NV34TCL_TX3_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX3_CLIP_PLANE_D(x) (0x00000ecc+((x)*16))
-#define NV34TCL_TX3_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX4_CLIP_PLANE_A(x) (0x00000f00+((x)*16))
-#define NV34TCL_TX4_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX4_CLIP_PLANE_B(x) (0x00000f04+((x)*16))
-#define NV34TCL_TX4_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX4_CLIP_PLANE_C(x) (0x00000f08+((x)*16))
-#define NV34TCL_TX4_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX4_CLIP_PLANE_D(x) (0x00000f0c+((x)*16))
-#define NV34TCL_TX4_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX5_CLIP_PLANE_A(x) (0x00000f40+((x)*16))
-#define NV34TCL_TX5_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX5_CLIP_PLANE_B(x) (0x00000f44+((x)*16))
-#define NV34TCL_TX5_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX5_CLIP_PLANE_C(x) (0x00000f48+((x)*16))
-#define NV34TCL_TX5_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX5_CLIP_PLANE_D(x) (0x00000f4c+((x)*16))
-#define NV34TCL_TX5_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX6_CLIP_PLANE_A(x) (0x00000f80+((x)*16))
-#define NV34TCL_TX6_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX6_CLIP_PLANE_B(x) (0x00000f84+((x)*16))
-#define NV34TCL_TX6_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX6_CLIP_PLANE_C(x) (0x00000f88+((x)*16))
-#define NV34TCL_TX6_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX6_CLIP_PLANE_D(x) (0x00000f8c+((x)*16))
-#define NV34TCL_TX6_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_TX7_CLIP_PLANE_A(x) (0x00000fc0+((x)*16))
-#define NV34TCL_TX7_CLIP_PLANE_A__SIZE 0x00000004
-#define NV34TCL_TX7_CLIP_PLANE_B(x) (0x00000fc4+((x)*16))
-#define NV34TCL_TX7_CLIP_PLANE_B__SIZE 0x00000004
-#define NV34TCL_TX7_CLIP_PLANE_C(x) (0x00000fc8+((x)*16))
-#define NV34TCL_TX7_CLIP_PLANE_C__SIZE 0x00000004
-#define NV34TCL_TX7_CLIP_PLANE_D(x) (0x00000fcc+((x)*16))
-#define NV34TCL_TX7_CLIP_PLANE_D__SIZE 0x00000004
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(x) (0x00001000+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(x) (0x00001004+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(x) (0x00001008+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(x) (0x0000100c+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(x) (0x00001010+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(x) (0x00001014+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(x) (0x00001018+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(x) (0x0000101c+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G__SIZE 0x00000008
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(x) (0x00001020+((x)*64))
-#define NV34TCL_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B__SIZE 0x00000008
-#define NV34TCL_LIGHT_HALF_VECTOR_X(x) (0x00001028+((x)*64))
-#define NV34TCL_LIGHT_HALF_VECTOR_X__SIZE 0x00000008
-#define NV34TCL_LIGHT_HALF_VECTOR_Y(x) (0x0000102c+((x)*64))
-#define NV34TCL_LIGHT_HALF_VECTOR_Y__SIZE 0x00000008
-#define NV34TCL_LIGHT_HALF_VECTOR_Z(x) (0x00001030+((x)*64))
-#define NV34TCL_LIGHT_HALF_VECTOR_Z__SIZE 0x00000008
-#define NV34TCL_LIGHT_DIRECTION_X(x) (0x00001034+((x)*64))
-#define NV34TCL_LIGHT_DIRECTION_X__SIZE 0x00000008
-#define NV34TCL_LIGHT_DIRECTION_Y(x) (0x00001038+((x)*64))
-#define NV34TCL_LIGHT_DIRECTION_Y__SIZE 0x00000008
-#define NV34TCL_LIGHT_DIRECTION_Z(x) (0x0000103c+((x)*64))
-#define NV34TCL_LIGHT_DIRECTION_Z__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_CUTOFF_A(x) (0x00001200+((x)*64))
-#define NV34TCL_LIGHT_SPOT_CUTOFF_A__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_CUTOFF_B(x) (0x00001204+((x)*64))
-#define NV34TCL_LIGHT_SPOT_CUTOFF_B__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_CUTOFF_C(x) (0x00001208+((x)*64))
-#define NV34TCL_LIGHT_SPOT_CUTOFF_C__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_DIR_X(x) (0x0000120c+((x)*64))
-#define NV34TCL_LIGHT_SPOT_DIR_X__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_DIR_Y(x) (0x00001210+((x)*64))
-#define NV34TCL_LIGHT_SPOT_DIR_Y__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_DIR_Z(x) (0x00001214+((x)*64))
-#define NV34TCL_LIGHT_SPOT_DIR_Z__SIZE 0x00000008
-#define NV34TCL_LIGHT_SPOT_CUTOFF_D(x) (0x00001218+((x)*64))
-#define NV34TCL_LIGHT_SPOT_CUTOFF_D__SIZE 0x00000008
-#define NV34TCL_LIGHT_POSITION_X(x) (0x0000121c+((x)*64))
-#define NV34TCL_LIGHT_POSITION_X__SIZE 0x00000008
-#define NV34TCL_LIGHT_POSITION_Y(x) (0x00001220+((x)*64))
-#define NV34TCL_LIGHT_POSITION_Y__SIZE 0x00000008
-#define NV34TCL_LIGHT_POSITION_Z(x) (0x00001224+((x)*64))
-#define NV34TCL_LIGHT_POSITION_Z__SIZE 0x00000008
-#define NV34TCL_LIGHT_ATTENUATION_CONSTANT(x) (0x00001228+((x)*64))
-#define NV34TCL_LIGHT_ATTENUATION_CONSTANT__SIZE 0x00000008
-#define NV34TCL_LIGHT_ATTENUATION_LINEAR(x) (0x0000122c+((x)*64))
-#define NV34TCL_LIGHT_ATTENUATION_LINEAR__SIZE 0x00000008
-#define NV34TCL_LIGHT_ATTENUATION_QUADRATIC(x) (0x00001230+((x)*64))
-#define NV34TCL_LIGHT_ATTENUATION_QUADRATIC__SIZE 0x00000008
-#define NV34TCL_FRONT_MATERIAL_SHININESS(x) (0x00001400+((x)*4))
-#define NV34TCL_FRONT_MATERIAL_SHININESS__SIZE 0x00000006
-#define NV34TCL_ENABLED_LIGHTS 0x00001420
-#define NV34TCL_FP_REG_CONTROL 0x00001450
-#define NV34TCL_FP_REG_CONTROL_UNK1_SHIFT 16
-#define NV34TCL_FP_REG_CONTROL_UNK1_MASK 0xffff0000
-#define NV34TCL_FP_REG_CONTROL_UNK0_SHIFT 0
-#define NV34TCL_FP_REG_CONTROL_UNK0_MASK 0x0000ffff
-#define NV34TCL_VP_CLIP_PLANES_ENABLE 0x00001478
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE0 (1 << 1)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE1 (1 << 5)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE2 (1 << 9)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE3 (1 << 13)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE4 (1 << 17)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE5 (1 << 21)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE6 (1 << 25)
-#define NV34TCL_VP_CLIP_PLANES_ENABLE_PLANE7 (1 << 29)
-#define NV34TCL_POLYGON_STIPPLE_ENABLE 0x0000147c
-#define NV34TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4))
-#define NV34TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020
-#define NV34TCL_VTX_ATTR_3F_X(x) (0x00001500+((x)*16))
-#define NV34TCL_VTX_ATTR_3F_X__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_3F_Y(x) (0x00001504+((x)*16))
-#define NV34TCL_VTX_ATTR_3F_Y__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_3F_Z(x) (0x00001508+((x)*16))
-#define NV34TCL_VTX_ATTR_3F_Z__SIZE 0x00000010
-#define NV34TCL_VP_CLIP_PLANE_A(x) (0x00001600+((x)*16))
-#define NV34TCL_VP_CLIP_PLANE_A__SIZE 0x00000006
-#define NV34TCL_VP_CLIP_PLANE_B(x) (0x00001604+((x)*16))
-#define NV34TCL_VP_CLIP_PLANE_B__SIZE 0x00000006
-#define NV34TCL_VP_CLIP_PLANE_C(x) (0x00001608+((x)*16))
-#define NV34TCL_VP_CLIP_PLANE_C__SIZE 0x00000006
-#define NV34TCL_VP_CLIP_PLANE_D(x) (0x0000160c+((x)*16))
-#define NV34TCL_VP_CLIP_PLANE_D__SIZE 0x00000006
-#define NV34TCL_VTXBUF_ADDRESS(x) (0x00001680+((x)*4))
-#define NV34TCL_VTXBUF_ADDRESS__SIZE 0x00000010
-#define NV34TCL_VTXBUF_ADDRESS_DMA1 (1 << 31)
-#define NV34TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0
-#define NV34TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff
-#define NV34TCL_VTXFMT(x) (0x00001740+((x)*4))
-#define NV34TCL_VTXFMT__SIZE 0x00000010
-#define NV34TCL_VTXFMT_TYPE_SHIFT 0
-#define NV34TCL_VTXFMT_TYPE_MASK 0x0000000f
-#define NV34TCL_VTXFMT_TYPE_FLOAT 0x00000002
-#define NV34TCL_VTXFMT_TYPE_UBYTE 0x00000004
-#define NV34TCL_VTXFMT_TYPE_USHORT 0x00000005
-#define NV34TCL_VTXFMT_SIZE_SHIFT 4
-#define NV34TCL_VTXFMT_SIZE_MASK 0x000000f0
-#define NV34TCL_VTXFMT_STRIDE_SHIFT 8
-#define NV34TCL_VTXFMT_STRIDE_MASK 0x0000ff00
-#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0
-#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4
-#define NV34TCL_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8
-#define NV34TCL_COLOR_MATERIAL_BACK_R 0x000017b0
-#define NV34TCL_COLOR_MATERIAL_BACK_G 0x000017b4
-#define NV34TCL_COLOR_MATERIAL_BACK_B 0x000017b8
-#define NV34TCL_COLOR_MATERIAL_BACK_A 0x000017c0
-#define NV34TCL_QUERY_RESET 0x000017c8
-#define NV34TCL_QUERY_UNK17CC 0x000017cc
-#define NV34TCL_QUERY_GET 0x00001800
-#define NV34TCL_QUERY_GET_UNK24_SHIFT 24
-#define NV34TCL_QUERY_GET_UNK24_MASK 0xff000000
-#define NV34TCL_QUERY_GET_OFFSET_SHIFT 0
-#define NV34TCL_QUERY_GET_OFFSET_MASK 0x00ffffff
-#define NV34TCL_VERTEX_BEGIN_END 0x00001808
-#define NV34TCL_VERTEX_BEGIN_END_STOP 0x00000000
-#define NV34TCL_VERTEX_BEGIN_END_POINTS 0x00000001
-#define NV34TCL_VERTEX_BEGIN_END_LINES 0x00000002
-#define NV34TCL_VERTEX_BEGIN_END_LINE_LOOP 0x00000003
-#define NV34TCL_VERTEX_BEGIN_END_LINE_STRIP 0x00000004
-#define NV34TCL_VERTEX_BEGIN_END_TRIANGLES 0x00000005
-#define NV34TCL_VERTEX_BEGIN_END_TRIANGLE_STRIP 0x00000006
-#define NV34TCL_VERTEX_BEGIN_END_TRIANGLE_FAN 0x00000007
-#define NV34TCL_VERTEX_BEGIN_END_QUADS 0x00000008
-#define NV34TCL_VERTEX_BEGIN_END_QUAD_STRIP 0x00000009
-#define NV34TCL_VERTEX_BEGIN_END_POLYGON 0x0000000a
-#define NV34TCL_VB_ELEMENT_U16 0x0000180c
-#define NV34TCL_VB_ELEMENT_U16_I0_SHIFT 0
-#define NV34TCL_VB_ELEMENT_U16_I0_MASK 0x0000ffff
-#define NV34TCL_VB_ELEMENT_U16_I1_SHIFT 16
-#define NV34TCL_VB_ELEMENT_U16_I1_MASK 0xffff0000
-#define NV34TCL_VB_ELEMENT_U32 0x00001810
-#define NV34TCL_VB_VERTEX_BATCH 0x00001814
-#define NV34TCL_VB_VERTEX_BATCH_OFFSET_SHIFT 0
-#define NV34TCL_VB_VERTEX_BATCH_OFFSET_MASK 0x00ffffff
-#define NV34TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24
-#define NV34TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000
-#define NV34TCL_VERTEX_DATA 0x00001818
-#define NV34TCL_IDXBUF_ADDRESS 0x0000181c
-#define NV34TCL_IDXBUF_FORMAT 0x00001820
-#define NV34TCL_IDXBUF_FORMAT_TYPE_SHIFT 4
-#define NV34TCL_IDXBUF_FORMAT_TYPE_MASK 0x000000f0
-#define NV34TCL_IDXBUF_FORMAT_TYPE_U32 0x00000000
-#define NV34TCL_IDXBUF_FORMAT_TYPE_U16 0x00000010
-#define NV34TCL_IDXBUF_FORMAT_DMA1 (1 << 0)
-#define NV34TCL_VB_INDEX_BATCH 0x00001824
-#define NV34TCL_VB_INDEX_BATCH_COUNT_SHIFT 24
-#define NV34TCL_VB_INDEX_BATCH_COUNT_MASK 0xff000000
-#define NV34TCL_VB_INDEX_BATCH_START_SHIFT 0
-#define NV34TCL_VB_INDEX_BATCH_START_MASK 0x00ffffff
-#define NV34TCL_POLYGON_MODE_FRONT 0x00001828
-#define NV34TCL_POLYGON_MODE_FRONT_POINT 0x00001b00
-#define NV34TCL_POLYGON_MODE_FRONT_LINE 0x00001b01
-#define NV34TCL_POLYGON_MODE_FRONT_FILL 0x00001b02
-#define NV34TCL_POLYGON_MODE_BACK 0x0000182c
-#define NV34TCL_POLYGON_MODE_BACK_POINT 0x00001b00
-#define NV34TCL_POLYGON_MODE_BACK_LINE 0x00001b01
-#define NV34TCL_POLYGON_MODE_BACK_FILL 0x00001b02
-#define NV34TCL_CULL_FACE 0x00001830
-#define NV34TCL_CULL_FACE_FRONT 0x00000404
-#define NV34TCL_CULL_FACE_BACK 0x00000405
-#define NV34TCL_CULL_FACE_FRONT_AND_BACK 0x00000408
-#define NV34TCL_FRONT_FACE 0x00001834
-#define NV34TCL_FRONT_FACE_CW 0x00000900
-#define NV34TCL_FRONT_FACE_CCW 0x00000901
-#define NV34TCL_POLYGON_SMOOTH_ENABLE 0x00001838
-#define NV34TCL_CULL_FACE_ENABLE 0x0000183c
-#define NV34TCL_TX_PALETTE_OFFSET(x) (0x00001840+((x)*4))
-#define NV34TCL_TX_PALETTE_OFFSET__SIZE 0x00000004
-#define NV34TCL_VTX_ATTR_2F_X(x) (0x00001880+((x)*8))
-#define NV34TCL_VTX_ATTR_2F_X__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_2F_Y(x) (0x00001884+((x)*8))
-#define NV34TCL_VTX_ATTR_2F_Y__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_2I(x) (0x00001900+((x)*4))
-#define NV34TCL_VTX_ATTR_2I__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_2I_X_SHIFT 0
-#define NV34TCL_VTX_ATTR_2I_X_MASK 0x0000ffff
-#define NV34TCL_VTX_ATTR_2I_Y_SHIFT 16
-#define NV34TCL_VTX_ATTR_2I_Y_MASK 0xffff0000
-#define NV34TCL_VTX_ATTR_4UB(x) (0x00001940+((x)*4))
-#define NV34TCL_VTX_ATTR_4UB__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4UB_X_SHIFT 0
-#define NV34TCL_VTX_ATTR_4UB_X_MASK 0x000000ff
-#define NV34TCL_VTX_ATTR_4UB_Y_SHIFT 8
-#define NV34TCL_VTX_ATTR_4UB_Y_MASK 0x0000ff00
-#define NV34TCL_VTX_ATTR_4UB_Z_SHIFT 16
-#define NV34TCL_VTX_ATTR_4UB_Z_MASK 0x00ff0000
-#define NV34TCL_VTX_ATTR_4UB_W_SHIFT 24
-#define NV34TCL_VTX_ATTR_4UB_W_MASK 0xff000000
-#define NV34TCL_VTX_ATTR_4I_XY(x) (0x00001980+((x)*8))
-#define NV34TCL_VTX_ATTR_4I_XY__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4I_XY_X_SHIFT 0
-#define NV34TCL_VTX_ATTR_4I_XY_X_MASK 0x0000ffff
-#define NV34TCL_VTX_ATTR_4I_XY_Y_SHIFT 16
-#define NV34TCL_VTX_ATTR_4I_XY_Y_MASK 0xffff0000
-#define NV34TCL_VTX_ATTR_4I_ZW(x) (0x00001984+((x)*8))
-#define NV34TCL_VTX_ATTR_4I_ZW__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4I_ZW_Z_SHIFT 0
-#define NV34TCL_VTX_ATTR_4I_ZW_Z_MASK 0x0000ffff
-#define NV34TCL_VTX_ATTR_4I_ZW_W_SHIFT 16
-#define NV34TCL_VTX_ATTR_4I_ZW_W_MASK 0xffff0000
-#define NV34TCL_TX_OFFSET(x) (0x00001a00+((x)*32))
-#define NV34TCL_TX_OFFSET__SIZE 0x00000004
-#define NV34TCL_TX_FORMAT(x) (0x00001a04+((x)*32))
-#define NV34TCL_TX_FORMAT__SIZE 0x00000004
-#define NV34TCL_TX_FORMAT_DMA0 (1 << 0)
-#define NV34TCL_TX_FORMAT_DMA1 (1 << 1)
-#define NV34TCL_TX_FORMAT_CUBIC (1 << 2)
-#define NV34TCL_TX_FORMAT_NO_BORDER (1 << 3)
-#define NV34TCL_TX_FORMAT_DIMS_SHIFT 4
-#define NV34TCL_TX_FORMAT_DIMS_MASK 0x000000f0
-#define NV34TCL_TX_FORMAT_DIMS_1D 0x00000010
-#define NV34TCL_TX_FORMAT_DIMS_2D 0x00000020
-#define NV34TCL_TX_FORMAT_DIMS_3D 0x00000030
-#define NV34TCL_TX_FORMAT_FORMAT_SHIFT 8
-#define NV34TCL_TX_FORMAT_FORMAT_MASK 0x0000ff00
-#define NV34TCL_TX_FORMAT_FORMAT_L8 0x00000000
-#define NV34TCL_TX_FORMAT_FORMAT_A8 0x00000100
-#define NV34TCL_TX_FORMAT_FORMAT_A1R5G5B5 0x00000200
-#define NV34TCL_TX_FORMAT_FORMAT_A8_RECT 0x00000300
-#define NV34TCL_TX_FORMAT_FORMAT_A4R4G4B4 0x00000400
-#define NV34TCL_TX_FORMAT_FORMAT_R5G6B5 0x00000500
-#define NV34TCL_TX_FORMAT_FORMAT_A8R8G8B8 0x00000600
-#define NV34TCL_TX_FORMAT_FORMAT_X8R8G8B8 0x00000700
-#define NV34TCL_TX_FORMAT_FORMAT_INDEX8 0x00000b00
-#define NV34TCL_TX_FORMAT_FORMAT_DXT1 0x00000c00
-#define NV34TCL_TX_FORMAT_FORMAT_DXT3 0x00000e00
-#define NV34TCL_TX_FORMAT_FORMAT_DXT5 0x00000f00
-#define NV34TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT 0x00001000
-#define NV34TCL_TX_FORMAT_FORMAT_R5G6B5_RECT 0x00001100
-#define NV34TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT 0x00001200
-#define NV34TCL_TX_FORMAT_FORMAT_L8_RECT 0x00001300
-#define NV34TCL_TX_FORMAT_FORMAT_A8L8 0x00001a00
-#define NV34TCL_TX_FORMAT_FORMAT_A8_RECT2 0x00001b00
-#define NV34TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT 0x00001d00
-#define NV34TCL_TX_FORMAT_FORMAT_R8G8B8_RECT 0x00001e00
-#define NV34TCL_TX_FORMAT_FORMAT_L8A8_RECT 0x00002000
-#define NV34TCL_TX_FORMAT_FORMAT_DSDT 0x00002800
-#define NV34TCL_TX_FORMAT_FORMAT_A16 0x00003200
-#define NV34TCL_TX_FORMAT_FORMAT_HILO16 0x00003300
-#define NV34TCL_TX_FORMAT_FORMAT_A16_RECT 0x00003500
-#define NV34TCL_TX_FORMAT_FORMAT_HILO16_RECT 0x00003600
-#define NV34TCL_TX_FORMAT_FORMAT_HILO8 0x00004400
-#define NV34TCL_TX_FORMAT_FORMAT_SIGNED_HILO8 0x00004500
-#define NV34TCL_TX_FORMAT_FORMAT_HILO8_RECT 0x00004600
-#define NV34TCL_TX_FORMAT_FORMAT_SIGNED_HILO8_RECT 0x00004700
-#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_RGBA16_NV 0x00004a00
-#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_RGBA32_NV 0x00004b00
-#define NV34TCL_TX_FORMAT_FORMAT_FLOAT_R32_NV 0x00004c00
-#define NV34TCL_TX_FORMAT_MIPMAP (1 << 19)
-#define NV34TCL_TX_FORMAT_BASE_SIZE_U_SHIFT 20
-#define NV34TCL_TX_FORMAT_BASE_SIZE_U_MASK 0x00f00000
-#define NV34TCL_TX_FORMAT_BASE_SIZE_V_SHIFT 24
-#define NV34TCL_TX_FORMAT_BASE_SIZE_V_MASK 0x0f000000
-#define NV34TCL_TX_FORMAT_BASE_SIZE_W_SHIFT 28
-#define NV34TCL_TX_FORMAT_BASE_SIZE_W_MASK 0xf0000000
-#define NV34TCL_TX_WRAP(x) (0x00001a08+((x)*32))
-#define NV34TCL_TX_WRAP__SIZE 0x00000004
-#define NV34TCL_TX_WRAP_S_SHIFT 0
-#define NV34TCL_TX_WRAP_S_MASK 0x000000ff
-#define NV34TCL_TX_WRAP_S_REPEAT 0x00000001
-#define NV34TCL_TX_WRAP_S_MIRRORED_REPEAT 0x00000002
-#define NV34TCL_TX_WRAP_S_CLAMP_TO_EDGE 0x00000003
-#define NV34TCL_TX_WRAP_S_CLAMP_TO_BORDER 0x00000004
-#define NV34TCL_TX_WRAP_S_CLAMP 0x00000005
-#define NV34TCL_TX_WRAP_T_SHIFT 8
-#define NV34TCL_TX_WRAP_T_MASK 0x00000f00
-#define NV34TCL_TX_WRAP_T_REPEAT 0x00000100
-#define NV34TCL_TX_WRAP_T_MIRRORED_REPEAT 0x00000200
-#define NV34TCL_TX_WRAP_T_CLAMP_TO_EDGE 0x00000300
-#define NV34TCL_TX_WRAP_T_CLAMP_TO_BORDER 0x00000400
-#define NV34TCL_TX_WRAP_T_CLAMP 0x00000500
-#define NV34TCL_TX_WRAP_EXPAND_NORMAL_SHIFT 12
-#define NV34TCL_TX_WRAP_EXPAND_NORMAL_MASK 0x0000f000
-#define NV34TCL_TX_WRAP_R_SHIFT 16
-#define NV34TCL_TX_WRAP_R_MASK 0x000f0000
-#define NV34TCL_TX_WRAP_R_REPEAT 0x00010000
-#define NV34TCL_TX_WRAP_R_MIRRORED_REPEAT 0x00020000
-#define NV34TCL_TX_WRAP_R_CLAMP_TO_EDGE 0x00030000
-#define NV34TCL_TX_WRAP_R_CLAMP_TO_BORDER 0x00040000
-#define NV34TCL_TX_WRAP_R_CLAMP 0x00050000
-#define NV34TCL_TX_WRAP_RCOMP_SHIFT 28
-#define NV34TCL_TX_WRAP_RCOMP_MASK 0xf0000000
-#define NV34TCL_TX_WRAP_RCOMP_NEVER 0x00000000
-#define NV34TCL_TX_WRAP_RCOMP_GREATER 0x10000000
-#define NV34TCL_TX_WRAP_RCOMP_EQUAL 0x20000000
-#define NV34TCL_TX_WRAP_RCOMP_GEQUAL 0x30000000
-#define NV34TCL_TX_WRAP_RCOMP_LESS 0x40000000
-#define NV34TCL_TX_WRAP_RCOMP_NOTEQUAL 0x50000000
-#define NV34TCL_TX_WRAP_RCOMP_LEQUAL 0x60000000
-#define NV34TCL_TX_WRAP_RCOMP_ALWAYS 0x70000000
-#define NV34TCL_TX_ENABLE(x) (0x00001a0c+((x)*32))
-#define NV34TCL_TX_ENABLE__SIZE 0x00000004
-#define NV34TCL_TX_ENABLE_ANISO_SHIFT 4
-#define NV34TCL_TX_ENABLE_ANISO_MASK 0x00000030
-#define NV34TCL_TX_ENABLE_ANISO_NONE 0x00000000
-#define NV34TCL_TX_ENABLE_ANISO_2X 0x00000010
-#define NV34TCL_TX_ENABLE_ANISO_4X 0x00000020
-#define NV34TCL_TX_ENABLE_ANISO_8X 0x00000030
-#define NV34TCL_TX_ENABLE_MIPMAP_MAX_LOD_SHIFT 14
-#define NV34TCL_TX_ENABLE_MIPMAP_MAX_LOD_MASK 0x0003c000
-#define NV34TCL_TX_ENABLE_MIPMAP_MIN_LOD_SHIFT 26
-#define NV34TCL_TX_ENABLE_MIPMAP_MIN_LOD_MASK 0x3c000000
-#define NV34TCL_TX_ENABLE_ENABLE (1 << 30)
-#define NV34TCL_TX_SWIZZLE(x) (0x00001a10+((x)*32))
-#define NV34TCL_TX_SWIZZLE__SIZE 0x00000004
-#define NV34TCL_TX_SWIZZLE_S0_X_SHIFT 14
-#define NV34TCL_TX_SWIZZLE_S0_X_MASK 0x0000c000
-#define NV34TCL_TX_SWIZZLE_S0_X_ZERO 0x00000000
-#define NV34TCL_TX_SWIZZLE_S0_X_ONE 0x00004000
-#define NV34TCL_TX_SWIZZLE_S0_X_S1 0x00008000
-#define NV34TCL_TX_SWIZZLE_S0_Y_SHIFT 12
-#define NV34TCL_TX_SWIZZLE_S0_Y_MASK 0x00003000
-#define NV34TCL_TX_SWIZZLE_S0_Y_ZERO 0x00000000
-#define NV34TCL_TX_SWIZZLE_S0_Y_ONE 0x00001000
-#define NV34TCL_TX_SWIZZLE_S0_Y_S1 0x00002000
-#define NV34TCL_TX_SWIZZLE_S0_Z_SHIFT 10
-#define NV34TCL_TX_SWIZZLE_S0_Z_MASK 0x00000c00
-#define NV34TCL_TX_SWIZZLE_S0_Z_ZERO 0x00000000
-#define NV34TCL_TX_SWIZZLE_S0_Z_ONE 0x00000400
-#define NV34TCL_TX_SWIZZLE_S0_Z_S1 0x00000800
-#define NV34TCL_TX_SWIZZLE_S0_W_SHIFT 8
-#define NV34TCL_TX_SWIZZLE_S0_W_MASK 0x00000300
-#define NV34TCL_TX_SWIZZLE_S0_W_ZERO 0x00000000
-#define NV34TCL_TX_SWIZZLE_S0_W_ONE 0x00000100
-#define NV34TCL_TX_SWIZZLE_S0_W_S1 0x00000200
-#define NV34TCL_TX_SWIZZLE_S1_X_SHIFT 6
-#define NV34TCL_TX_SWIZZLE_S1_X_MASK 0x000000c0
-#define NV34TCL_TX_SWIZZLE_S1_X_W 0x00000000
-#define NV34TCL_TX_SWIZZLE_S1_X_Z 0x00000040
-#define NV34TCL_TX_SWIZZLE_S1_X_Y 0x00000080
-#define NV34TCL_TX_SWIZZLE_S1_X_X 0x000000c0
-#define NV34TCL_TX_SWIZZLE_S1_Y_SHIFT 4
-#define NV34TCL_TX_SWIZZLE_S1_Y_MASK 0x00000030
-#define NV34TCL_TX_SWIZZLE_S1_Y_W 0x00000000
-#define NV34TCL_TX_SWIZZLE_S1_Y_Z 0x00000010
-#define NV34TCL_TX_SWIZZLE_S1_Y_Y 0x00000020
-#define NV34TCL_TX_SWIZZLE_S1_Y_X 0x00000030
-#define NV34TCL_TX_SWIZZLE_S1_Z_SHIFT 2
-#define NV34TCL_TX_SWIZZLE_S1_Z_MASK 0x0000000c
-#define NV34TCL_TX_SWIZZLE_S1_Z_W 0x00000000
-#define NV34TCL_TX_SWIZZLE_S1_Z_Z 0x00000004
-#define NV34TCL_TX_SWIZZLE_S1_Z_Y 0x00000008
-#define NV34TCL_TX_SWIZZLE_S1_Z_X 0x0000000c
-#define NV34TCL_TX_SWIZZLE_S1_W_SHIFT 0
-#define NV34TCL_TX_SWIZZLE_S1_W_MASK 0x00000003
-#define NV34TCL_TX_SWIZZLE_S1_W_W 0x00000000
-#define NV34TCL_TX_SWIZZLE_S1_W_Z 0x00000001
-#define NV34TCL_TX_SWIZZLE_S1_W_Y 0x00000002
-#define NV34TCL_TX_SWIZZLE_S1_W_X 0x00000003
-#define NV34TCL_TX_SWIZZLE_RECT_PITCH_SHIFT 16
-#define NV34TCL_TX_SWIZZLE_RECT_PITCH_MASK 0xffff0000
-#define NV34TCL_TX_FILTER(x) (0x00001a14+((x)*32))
-#define NV34TCL_TX_FILTER__SIZE 0x00000004
-#define NV34TCL_TX_FILTER_LOD_BIAS_SHIFT 8
-#define NV34TCL_TX_FILTER_LOD_BIAS_MASK 0x00000f00
-#define NV34TCL_TX_FILTER_MINIFY_SHIFT 16
-#define NV34TCL_TX_FILTER_MINIFY_MASK 0x000f0000
-#define NV34TCL_TX_FILTER_MINIFY_NEAREST 0x00010000
-#define NV34TCL_TX_FILTER_MINIFY_LINEAR 0x00020000
-#define NV34TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_NEAREST 0x00030000
-#define NV34TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_NEAREST 0x00040000
-#define NV34TCL_TX_FILTER_MINIFY_NEAREST_MIPMAP_LINEAR 0x00050000
-#define NV34TCL_TX_FILTER_MINIFY_LINEAR_MIPMAP_LINEAR 0x00060000
-#define NV34TCL_TX_FILTER_MAGNIFY_SHIFT 24
-#define NV34TCL_TX_FILTER_MAGNIFY_MASK 0x0f000000
-#define NV34TCL_TX_FILTER_MAGNIFY_NEAREST 0x01000000
-#define NV34TCL_TX_FILTER_MAGNIFY_LINEAR 0x02000000
-#define NV34TCL_TX_FILTER_SIGNED_BLUE (1 << 28)
-#define NV34TCL_TX_FILTER_SIGNED_GREEN (1 << 29)
-#define NV34TCL_TX_FILTER_SIGNED_RED (1 << 30)
-#define NV34TCL_TX_FILTER_SIGNED_ALPHA (1 << 31)
-#define NV34TCL_TX_NPOT_SIZE(x) (0x00001a18+((x)*32))
-#define NV34TCL_TX_NPOT_SIZE__SIZE 0x00000004
-#define NV34TCL_TX_NPOT_SIZE_H_SHIFT 0
-#define NV34TCL_TX_NPOT_SIZE_H_MASK 0x0000ffff
-#define NV34TCL_TX_NPOT_SIZE_W_SHIFT 16
-#define NV34TCL_TX_NPOT_SIZE_W_MASK 0xffff0000
-#define NV34TCL_TX_BORDER_COLOR(x) (0x00001a1c+((x)*32))
-#define NV34TCL_TX_BORDER_COLOR__SIZE 0x00000004
-#define NV34TCL_TX_BORDER_COLOR_B_SHIFT 0
-#define NV34TCL_TX_BORDER_COLOR_B_MASK 0x000000ff
-#define NV34TCL_TX_BORDER_COLOR_G_SHIFT 8
-#define NV34TCL_TX_BORDER_COLOR_G_MASK 0x0000ff00
-#define NV34TCL_TX_BORDER_COLOR_R_SHIFT 16
-#define NV34TCL_TX_BORDER_COLOR_R_MASK 0x00ff0000
-#define NV34TCL_TX_BORDER_COLOR_A_SHIFT 24
-#define NV34TCL_TX_BORDER_COLOR_A_MASK 0xff000000
-#define NV34TCL_VTX_ATTR_4F_X(x) (0x00001c00+((x)*16))
-#define NV34TCL_VTX_ATTR_4F_X__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4F_Y(x) (0x00001c04+((x)*16))
-#define NV34TCL_VTX_ATTR_4F_Y__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4F_Z(x) (0x00001c08+((x)*16))
-#define NV34TCL_VTX_ATTR_4F_Z__SIZE 0x00000010
-#define NV34TCL_VTX_ATTR_4F_W(x) (0x00001c0c+((x)*16))
-#define NV34TCL_VTX_ATTR_4F_W__SIZE 0x00000010
-#define NV34TCL_FP_CONTROL 0x00001d60
-#define NV34TCL_FP_CONTROL_USES_KIL (1 << 7)
-#define NV34TCL_FP_CONTROL_USED_REGS_MINUS1_DIV2_SHIFT 0
-#define NV34TCL_FP_CONTROL_USED_REGS_MINUS1_DIV2_MASK 0x0000000f
-#define NV34TCL_DEPTH_UNK17D8 0x00001d78
-#define NV34TCL_DEPTH_UNK17D8_CLAMP_SHIFT 4
-#define NV34TCL_DEPTH_UNK17D8_CLAMP_MASK 0x000000f0
-#define NV34TCL_MULTISAMPLE_CONTROL 0x00001d7c
-#define NV34TCL_MULTISAMPLE_CONTROL_ENABLE (1 << 0)
-#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_ALPHA_TO_COVERAGE (1 << 4)
-#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_ALPHA_TO_ONE (1 << 8)
-#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_COVERAGE_SHIFT 16
-#define NV34TCL_MULTISAMPLE_CONTROL_SAMPLE_COVERAGE_MASK 0xffff0000
-#define NV34TCL_CLEAR_DEPTH_VALUE 0x00001d8c
-#define NV34TCL_CLEAR_COLOR_VALUE 0x00001d90
-#define NV34TCL_CLEAR_COLOR_VALUE_B_SHIFT 0
-#define NV34TCL_CLEAR_COLOR_VALUE_B_MASK 0x000000ff
-#define NV34TCL_CLEAR_COLOR_VALUE_G_SHIFT 8
-#define NV34TCL_CLEAR_COLOR_VALUE_G_MASK 0x0000ff00
-#define NV34TCL_CLEAR_COLOR_VALUE_R_SHIFT 16
-#define NV34TCL_CLEAR_COLOR_VALUE_R_MASK 0x00ff0000
-#define NV34TCL_CLEAR_COLOR_VALUE_A_SHIFT 24
-#define NV34TCL_CLEAR_COLOR_VALUE_A_MASK 0xff000000
-#define NV34TCL_CLEAR_BUFFERS 0x00001d94
-#define NV34TCL_CLEAR_BUFFERS_COLOR_A (1 << 7)
-#define NV34TCL_CLEAR_BUFFERS_COLOR_B (1 << 6)
-#define NV34TCL_CLEAR_BUFFERS_COLOR_G (1 << 5)
-#define NV34TCL_CLEAR_BUFFERS_COLOR_R (1 << 4)
-#define NV34TCL_CLEAR_BUFFERS_STENCIL (1 << 1)
-#define NV34TCL_CLEAR_BUFFERS_DEPTH (1 << 0)
-#define NV34TCL_DO_VERTICES 0x00001dac
-#define NV34TCL_LINE_STIPPLE_ENABLE 0x00001db4
-#define NV34TCL_LINE_STIPPLE_PATTERN 0x00001db8
-#define NV34TCL_LINE_STIPPLE_PATTERN_FACTOR_SHIFT 0
-#define NV34TCL_LINE_STIPPLE_PATTERN_FACTOR_MASK 0x0000ffff
-#define NV34TCL_LINE_STIPPLE_PATTERN_PATTERN_SHIFT 16
-#define NV34TCL_LINE_STIPPLE_PATTERN_PATTERN_MASK 0xffff0000
-#define NV34TCL_BACK_MATERIAL_SHININESS(x) (0x00001e20+((x)*4))
-#define NV34TCL_BACK_MATERIAL_SHININESS__SIZE 0x00000006
-#define NV34TCL_VTX_ATTR_1F(x) (0x00001e40+((x)*4))
-#define NV34TCL_VTX_ATTR_1F__SIZE 0x00000010
-#define NV34TCL_ENGINE 0x00001e94
-#define NV34TCL_ENGINE_FP (1 << 0)
-#define NV34TCL_ENGINE_VP (1 << 1)
-#define NV34TCL_ENGINE_FIXED (1 << 2)
-#define NV34TCL_VP_UPLOAD_FROM_ID 0x00001e9c
-#define NV34TCL_VP_START_FROM_ID 0x00001ea0
-#define NV34TCL_POINT_PARAMETERS(x) (0x00001ec0+((x)*4))
-#define NV34TCL_POINT_PARAMETERS__SIZE 0x00000008
-#define NV34TCL_POINT_SIZE 0x00001ee0
-#define NV34TCL_POINT_PARAMETERS_ENABLE 0x00001ee4
-#define NV34TCL_POINT_SPRITE 0x00001ee8
-#define NV34TCL_POINT_SPRITE_ENABLE (1 << 0)
-#define NV34TCL_POINT_SPRITE_R_MODE_SHIFT 1
-#define NV34TCL_POINT_SPRITE_R_MODE_MASK 0x00000006
-#define NV34TCL_POINT_SPRITE_R_MODE_ZERO 0x00000000
-#define NV34TCL_POINT_SPRITE_R_MODE_R 0x00000002
-#define NV34TCL_POINT_SPRITE_R_MODE_S 0x00000004
-#define NV34TCL_POINT_SPRITE_COORD_REPLACE (1 << 11)
-#define NV34TCL_VP_UPLOAD_CONST_ID 0x00001efc
-#define NV34TCL_VP_UPLOAD_CONST_X(x) (0x00001f00+((x)*16))
-#define NV34TCL_VP_UPLOAD_CONST_X__SIZE 0x00000004
-#define NV34TCL_VP_UPLOAD_CONST_Y(x) (0x00001f04+((x)*16))
-#define NV34TCL_VP_UPLOAD_CONST_Y__SIZE 0x00000004
-#define NV34TCL_VP_UPLOAD_CONST_Z(x) (0x00001f08+((x)*16))
-#define NV34TCL_VP_UPLOAD_CONST_Z__SIZE 0x00000004
-#define NV34TCL_VP_UPLOAD_CONST_W(x) (0x00001f0c+((x)*16))
-#define NV34TCL_VP_UPLOAD_CONST_W__SIZE 0x00000004
-#define NV34TCL_UNK1f80(x) (0x00001f80+((x)*4))
-#define NV34TCL_UNK1f80__SIZE 0x00000010
-
-
-#define NV40_CONTEXT_SURFACES_2D 0x00003062
-
-
-
-#define NV40_STRETCHED_IMAGE_FROM_CPU 0x00003066
-
-
-
-#define NV40_TEXTURE_FROM_CPU 0x0000307b
-
-
-
-#define NV40_SCALED_IMAGE_FROM_MEMORY 0x00003089
-
-
-
-#define NV40_IMAGE_FROM_CPU 0x0000308a
-
-
-
-#define NV40_SWIZZLED_SURFACE 0x0000309e
-
-
-
-#define NV40TCL 0x00004097
-
-#define NV40TCL_REF_CNT 0x00000050
-#define NV40TCL_NOP 0x00000100
-#define NV40TCL_NOTIFY 0x00000104
-#define NV40TCL_DMA_NOTIFY 0x00000180
-#define NV40TCL_DMA_TEXTURE0 0x00000184
-#define NV40TCL_DMA_TEXTURE1 0x00000188
-#define NV40TCL_DMA_COLOR1 0x0000018c
-#define NV40TCL_DMA_COLOR0 0x00000194
-#define NV40TCL_DMA_ZETA 0x00000198
-#define NV40TCL_DMA_VTXBUF0 0x0000019c
-#define NV40TCL_DMA_VTXBUF1 0x000001a0
-#define NV40TCL_DMA_FENCE 0x000001a4
-#define NV40TCL_DMA_QUERY 0x000001a8
-#define NV40TCL_DMA_UNK01AC 0x000001ac
-#define NV40TCL_DMA_UNK01B0 0x000001b0
-#define NV40TCL_DMA_COLOR2 0x000001b4
-#define NV40TCL_DMA_COLOR3 0x000001b8
-#define NV40TCL_RT_HORIZ 0x00000200
-#define NV40TCL_RT_HORIZ_W_SHIFT 16
-#define NV40TCL_RT_HORIZ_W_MASK 0xffff0000
-#define NV40TCL_RT_HORIZ_X_SHIFT 0
-#define NV40TCL_RT_HORIZ_X_MASK 0x0000ffff
-#define NV40TCL_RT_VERT 0x00000204
-#define NV40TCL_RT_VERT_H_SHIFT 16
-#define NV40TCL_RT_VERT_H_MASK 0xffff0000
-#define NV40TCL_RT_VERT_Y_SHIFT 0
-#define NV40TCL_RT_VERT_Y_MASK 0x0000ffff
-#define NV40TCL_RT_FORMAT 0x00000208
-#define NV40TCL_RT_FORMAT_LOG2_HEIGHT_SHIFT 24
-#define NV40TCL_RT_FORMAT_LOG2_HEIGHT_MASK 0xff000000
-#define NV40TCL_RT_FORMAT_LOG2_WIDTH_SHIFT 16
-#define NV40TCL_RT_FORMAT_LOG2_WIDTH_MASK 0x00ff0000
-#define NV40TCL_RT_FORMAT_TYPE_SHIFT 8
-#define NV40TCL_RT_FORMAT_TYPE_MASK 0x00000f00
-#define NV40TCL_RT_FORMAT_TYPE_LINEAR 0x00000100
-#define NV40TCL_RT_FORMAT_TYPE_SWIZZLED 0x00000200
-#define NV40TCL_RT_FORMAT_ZETA_SHIFT 5
-#define NV40TCL_RT_FORMAT_ZETA_MASK 0x000000e0
-#define NV40TCL_RT_FORMAT_ZETA_Z16 0x00000020
-#define NV40TCL_RT_FORMAT_ZETA_Z24S8 0x00000040
-#define NV40TCL_RT_FORMAT_COLOR_SHIFT 0
-#define NV40TCL_RT_FORMAT_COLOR_MASK 0x0000001f
-#define NV40TCL_RT_FORMAT_COLOR_R5G6B5 0x00000003
-#define NV40TCL_RT_FORMAT_COLOR_X8R8G8B8 0x00000005
-#define NV40TCL_RT_FORMAT_COLOR_A8R8G8B8 0x00000008
-#define NV40TCL_RT_FORMAT_COLOR_B8 0x00000009
-#define NV40TCL_RT_FORMAT_COLOR_UNKNOWN 0x0000000d
-#define NV40TCL_RT_FORMAT_COLOR_X8B8G8R8 0x0000000f
-#define NV40TCL_RT_FORMAT_COLOR_A8B8G8R8 0x00000010
-#define NV40TCL_COLOR0_PITCH 0x0000020c
-#define NV40TCL_COLOR0_OFFSET 0x00000210
-#define NV40TCL_ZETA_OFFSET 0x00000214
-#define NV40TCL_COLOR1_OFFSET 0x00000218
-#define NV40TCL_COLOR1_PITCH 0x0000021c
-#define NV40TCL_RT_ENABLE 0x00000220
-#define NV40TCL_RT_ENABLE_MRT (1 << 4)
-#define NV40TCL_RT_ENABLE_COLOR3 (1 << 3)
-#define NV40TCL_RT_ENABLE_COLOR2 (1 << 2)
-#define NV40TCL_RT_ENABLE_COLOR1 (1 << 1)
-#define NV40TCL_RT_ENABLE_COLOR0 (1 << 0)
-#define NV40TCL_ZETA_PITCH 0x0000022c
-#define NV40TCL_COLOR2_PITCH 0x00000280
-#define NV40TCL_COLOR3_PITCH 0x00000284
-#define NV40TCL_COLOR2_OFFSET 0x00000288
-#define NV40TCL_COLOR3_OFFSET 0x0000028c
-#define NV40TCL_VIEWPORT_CLIP_HORIZ(x) (0x000002c0+((x)*8))
-#define NV40TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008
-#define NV40TCL_VIEWPORT_CLIP_VERT(x) (0x000002c4+((x)*8))
-#define NV40TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008
-#define NV40TCL_DITHER_ENABLE 0x00000300
-#define NV40TCL_ALPHA_TEST_ENABLE 0x00000304
-#define NV40TCL_ALPHA_TEST_FUNC 0x00000308
-#define NV40TCL_ALPHA_TEST_FUNC_NEVER 0x00000200
-#define NV40TCL_ALPHA_TEST_FUNC_LESS 0x00000201
-#define NV40TCL_ALPHA_TEST_FUNC_EQUAL 0x00000202
-#define NV40TCL_ALPHA_TEST_FUNC_LEQUAL 0x00000203
-#define NV40TCL_ALPHA_TEST_FUNC_GREATER 0x00000204
-#define NV40TCL_ALPHA_TEST_FUNC_GREATER 0x00000204
-#define NV40TCL_ALPHA_TEST_FUNC_NOTEQUAL 0x00000205
-#define NV40TCL_ALPHA_TEST_FUNC_GEQUAL 0x00000206
-#define NV40TCL_ALPHA_TEST_FUNC_ALWAYS 0x00000207
-#define NV40TCL_ALPHA_TEST_REF 0x0000030c
-#define NV40TCL_BLEND_ENABLE 0x00000310
-#define NV40TCL_BLEND_FUNC_SRC 0x00000314
-#define NV40TCL_BLEND_FUNC_SRC_RGB_SHIFT 0
-#define NV40TCL_BLEND_FUNC_SRC_RGB_MASK 0x0000ffff
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001
-#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV40TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV40TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV40TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV40TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV40TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003
-#define NV40TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SHIFT 16
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_MASK 0xffff0000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00010000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x03000000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x03020000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x03040000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x03060000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x03070000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x03080000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x80010000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x80030000
-#define NV40TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000
-#define NV40TCL_BLEND_FUNC_DST 0x00000318
-#define NV40TCL_BLEND_FUNC_DST_RGB_SHIFT 0
-#define NV40TCL_BLEND_FUNC_DST_RGB_MASK 0x0000ffff
-#define NV40TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001
-#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV40TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV40TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV40TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV40TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV40TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003
-#define NV40TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_SHIFT 16
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_MASK 0xffff0000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00010000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x03000000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x03010000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x03020000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x03030000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x03040000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x03050000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x03060000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x03070000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x03080000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x80010000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x80020000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x80030000
-#define NV40TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x80040000
-#define NV40TCL_BLEND_COLOR 0x0000031c
-#define NV40TCL_BLEND_EQUATION 0x00000320
-#define NV40TCL_BLEND_EQUATION_RGB_SHIFT 0
-#define NV40TCL_BLEND_EQUATION_RGB_MASK 0x0000ffff
-#define NV40TCL_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
-#define NV40TCL_BLEND_EQUATION_RGB_MIN 0x00008007
-#define NV40TCL_BLEND_EQUATION_RGB_MAX 0x00008008
-#define NV40TCL_BLEND_EQUATION_RGB_FUNC_SUBTRACT 0x0000800a
-#define NV40TCL_BLEND_EQUATION_RGB_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV40TCL_BLEND_EQUATION_ALPHA_SHIFT 16
-#define NV40TCL_BLEND_EQUATION_ALPHA_MASK 0xffff0000
-#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_ADD 0x80060000
-#define NV40TCL_BLEND_EQUATION_ALPHA_MIN 0x80070000
-#define NV40TCL_BLEND_EQUATION_ALPHA_MAX 0x80080000
-#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_SUBTRACT 0x800a0000
-#define NV40TCL_BLEND_EQUATION_ALPHA_FUNC_REVERSE_SUBTRACT 0x800b0000
-#define NV40TCL_COLOR_MASK 0x00000324
-#define NV40TCL_COLOR_MASK_BUFFER0_B_SHIFT 0
-#define NV40TCL_COLOR_MASK_BUFFER0_B_MASK 0x000000ff
-#define NV40TCL_COLOR_MASK_BUFFER0_G_SHIFT 8
-#define NV40TCL_COLOR_MASK_BUFFER0_G_MASK 0x0000ff00
-#define NV40TCL_COLOR_MASK_BUFFER0_R_SHIFT 16
-#define NV40TCL_COLOR_MASK_BUFFER0_R_MASK 0x00ff0000
-#define NV40TCL_COLOR_MASK_BUFFER0_A_SHIFT 24
-#define NV40TCL_COLOR_MASK_BUFFER0_A_MASK 0xff000000
-#define NV40TCL_STENCIL_FRONT_ENABLE 0x00000328
-#define NV40TCL_STENCIL_FRONT_MASK 0x0000032c
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC 0x00000330
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206
-#define NV40TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207
-#define NV40TCL_STENCIL_FRONT_FUNC_REF 0x00000334
-#define NV40TCL_STENCIL_FRONT_FUNC_MASK 0x00000338
-#define NV40TCL_STENCIL_FRONT_OP_FAIL 0x0000033c
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL 0x00000340
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS 0x00000344
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV40TCL_STENCIL_BACK_ENABLE 0x00000348
-#define NV40TCL_STENCIL_BACK_MASK 0x0000034c
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC 0x00000350
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206
-#define NV40TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207
-#define NV40TCL_STENCIL_BACK_FUNC_REF 0x00000354
-#define NV40TCL_STENCIL_BACK_FUNC_MASK 0x00000358
-#define NV40TCL_STENCIL_BACK_OP_FAIL 0x0000035c
-#define NV40TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000
-#define NV40TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a
-#define NV40TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00
-#define NV40TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02
-#define NV40TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03
-#define NV40TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL 0x00000360
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV40TCL_STENCIL_BACK_OP_ZPASS 0x00000364
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV40TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV40TCL_SHADE_MODEL 0x00000368
-#define NV40TCL_SHADE_MODEL_FLAT 0x00001d00
-#define NV40TCL_SHADE_MODEL_SMOOTH 0x00001d01
-#define NV40TCL_MRT_COLOR_MASK 0x00000370
-#define NV40TCL_MRT_COLOR_MASK_BUFFER1_A (1 << 4)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER1_R (1 << 5)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER1_G (1 << 6)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER1_B (1 << 7)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER2_A (1 << 8)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER2_R (1 << 9)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER2_G (1 << 10)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER2_B (1 << 11)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER3_A (1 << 12)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER3_R (1 << 13)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER3_G (1 << 14)
-#define NV40TCL_MRT_COLOR_MASK_BUFFER3_B (1 << 15)
-#define NV40TCL_COLOR_LOGIC_OP_ENABLE 0x00000374
-#define NV40TCL_COLOR_LOGIC_OP 0x00000378
-#define NV40TCL_COLOR_LOGIC_OP_CLEAR 0x00001500
-#define NV40TCL_COLOR_LOGIC_OP_AND 0x00001501
-#define NV40TCL_COLOR_LOGIC_OP_AND_REVERSE 0x00001502
-#define NV40TCL_COLOR_LOGIC_OP_COPY 0x00001503
-#define NV40TCL_COLOR_LOGIC_OP_AND_INVERTED 0x00001504
-#define NV40TCL_COLOR_LOGIC_OP_NOOP 0x00001505
-#define NV40TCL_COLOR_LOGIC_OP_XOR 0x00001506
-#define NV40TCL_COLOR_LOGIC_OP_OR 0x00001507
-#define NV40TCL_COLOR_LOGIC_OP_NOR 0x00001508
-#define NV40TCL_COLOR_LOGIC_OP_EQUIV 0x00001509
-#define NV40TCL_COLOR_LOGIC_OP_INVERT 0x0000150a
-#define NV40TCL_COLOR_LOGIC_OP_OR_REVERSE 0x0000150b
-#define NV40TCL_COLOR_LOGIC_OP_COPY_INVERTED 0x0000150c
-#define NV40TCL_COLOR_LOGIC_OP_OR_INVERTED 0x0000150d
-#define NV40TCL_COLOR_LOGIC_OP_NAND 0x0000150e
-#define NV40TCL_COLOR_LOGIC_OP_SET 0x0000150f
-#define NV40TCL_DEPTH_RANGE_NEAR 0x00000394
-#define NV40TCL_DEPTH_RANGE_FAR 0x00000398
-#define NV40TCL_LINE_WIDTH 0x000003b8
-#define NV40TCL_LINE_SMOOTH_ENABLE 0x000003bc
-#define NV40TCL_UNK03C0(x) (0x000003c0+((x)*4))
-#define NV40TCL_UNK03C0__SIZE 0x00000010
-#define NV40TCL_UNK0400(x) (0x00000400+((x)*4))
-#define NV40TCL_UNK0400__SIZE 0x00000010
-#define NV40TCL_UNK0440(x) (0x00000440+((x)*4))
-#define NV40TCL_UNK0440__SIZE 0x00000020
-#define NV40TCL_SCISSOR_HORIZ 0x000008c0
-#define NV40TCL_SCISSOR_HORIZ_X_SHIFT 0
-#define NV40TCL_SCISSOR_HORIZ_X_MASK 0x0000ffff
-#define NV40TCL_SCISSOR_HORIZ_W_SHIFT 16
-#define NV40TCL_SCISSOR_HORIZ_W_MASK 0xffff0000
-#define NV40TCL_SCISSOR_VERT 0x000008c4
-#define NV40TCL_SCISSOR_VERT_Y_SHIFT 0
-#define NV40TCL_SCISSOR_VERT_Y_MASK 0x0000ffff
-#define NV40TCL_SCISSOR_VERT_H_SHIFT 16
-#define NV40TCL_SCISSOR_VERT_H_MASK 0xffff0000
-#define NV40TCL_FOG_MODE 0x000008cc
-#define NV40TCL_FOG_EQUATION_CONSTANT 0x000008d0
-#define NV40TCL_FOG_EQUATION_LINEAR 0x000008d4
-#define NV40TCL_FOG_EQUATION_QUADRATIC 0x000008d8
-#define NV40TCL_FP_ADDRESS 0x000008e4
-#define NV40TCL_FP_ADDRESS_OFFSET_SHIFT 8
-#define NV40TCL_FP_ADDRESS_OFFSET_MASK 0xffffff00
-#define NV40TCL_FP_ADDRESS_DMA1 (1 << 1)
-#define NV40TCL_FP_ADDRESS_DMA0 (1 << 0)
-#define NV40TCL_VIEWPORT_HORIZ 0x00000a00
-#define NV40TCL_VIEWPORT_HORIZ_W_SHIFT 16
-#define NV40TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000
-#define NV40TCL_VIEWPORT_HORIZ_X_SHIFT 0
-#define NV40TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff
-#define NV40TCL_VIEWPORT_VERT 0x00000a04
-#define NV40TCL_VIEWPORT_VERT_H_SHIFT 16
-#define NV40TCL_VIEWPORT_VERT_H_MASK 0xffff0000
-#define NV40TCL_VIEWPORT_VERT_Y_SHIFT 0
-#define NV40TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff
-#define NV40TCL_VIEWPORT_TRANSLATE_X 0x00000a20
-#define NV40TCL_VIEWPORT_TRANSLATE_Y 0x00000a24
-#define NV40TCL_VIEWPORT_TRANSLATE_Z 0x00000a28
-#define NV40TCL_VIEWPORT_TRANSLATE_W 0x00000a2c
-#define NV40TCL_VIEWPORT_SCALE_X 0x00000a30
-#define NV40TCL_VIEWPORT_SCALE_Y 0x00000a34
-#define NV40TCL_VIEWPORT_SCALE_Z 0x00000a38
-#define NV40TCL_VIEWPORT_SCALE_W 0x00000a3c
-#define NV40TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000a60
-#define NV40TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000a64
-#define NV40TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000a68
-#define NV40TCL_DEPTH_FUNC 0x00000a6c
-#define NV40TCL_DEPTH_FUNC_NEVER 0x00000200
-#define NV40TCL_DEPTH_FUNC_LESS 0x00000201
-#define NV40TCL_DEPTH_FUNC_EQUAL 0x00000202
-#define NV40TCL_DEPTH_FUNC_LEQUAL 0x00000203
-#define NV40TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV40TCL_DEPTH_FUNC_GREATER 0x00000204
-#define NV40TCL_DEPTH_FUNC_NOTEQUAL 0x00000205
-#define NV40TCL_DEPTH_FUNC_GEQUAL 0x00000206
-#define NV40TCL_DEPTH_FUNC_ALWAYS 0x00000207
-#define NV40TCL_DEPTH_WRITE_ENABLE 0x00000a70
-#define NV40TCL_DEPTH_TEST_ENABLE 0x00000a74
-#define NV40TCL_POLYGON_OFFSET_FACTOR 0x00000a78
-#define NV40TCL_POLYGON_OFFSET_UNITS 0x00000a7c
-#define NV40TCL_VTX_ATTR_3I_XY(x) (0x00000a80+((x)*8))
-#define NV40TCL_VTX_ATTR_3I_XY__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_3I_XY_X_SHIFT 0
-#define NV40TCL_VTX_ATTR_3I_XY_X_MASK 0x0000ffff
-#define NV40TCL_VTX_ATTR_3I_XY_Y_SHIFT 16
-#define NV40TCL_VTX_ATTR_3I_XY_Y_MASK 0xffff0000
-#define NV40TCL_VTX_ATTR_3I_Z(x) (0x00000a84+((x)*8))
-#define NV40TCL_VTX_ATTR_3I_Z__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_3I_Z_Z_SHIFT 0
-#define NV40TCL_VTX_ATTR_3I_Z_Z_MASK 0x0000ffff
-#define NV40TCL_UNK0B40(x) (0x00000b40+((x)*4))
-#define NV40TCL_UNK0B40__SIZE 0x00000008
-#define NV40TCL_VP_UPLOAD_INST(x) (0x00000b80+((x)*4))
-#define NV40TCL_VP_UPLOAD_INST__SIZE 0x00000004
-#define NV40TCL_CLIP_PLANE_ENABLE 0x00001478
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE0 (1 << 1)
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE1 (1 << 5)
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE2 (1 << 9)
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE3 (1 << 13)
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE4 (1 << 17)
-#define NV40TCL_CLIP_PLANE_ENABLE_PLANE5 (1 << 21)
-#define NV40TCL_POLYGON_STIPPLE_ENABLE 0x0000147c
-#define NV40TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001480+((x)*4))
-#define NV40TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020
-#define NV40TCL_VTX_ATTR_3F_X(x) (0x00001500+((x)*16))
-#define NV40TCL_VTX_ATTR_3F_X__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_3F_Y(x) (0x00001504+((x)*16))
-#define NV40TCL_VTX_ATTR_3F_Y__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_3F_Z(x) (0x00001508+((x)*16))
-#define NV40TCL_VTX_ATTR_3F_Z__SIZE 0x00000010
-#define NV40TCL_VTXBUF_ADDRESS(x) (0x00001680+((x)*4))
-#define NV40TCL_VTXBUF_ADDRESS__SIZE 0x00000010
-#define NV40TCL_VTXBUF_ADDRESS_DMA1 (1 << 31)
-#define NV40TCL_VTXBUF_ADDRESS_OFFSET_SHIFT 0
-#define NV40TCL_VTXBUF_ADDRESS_OFFSET_MASK 0x0fffffff
-#define NV40TCL_VTX_CACHE_INVALIDATE 0x00001714
-#define NV40TCL_VTXFMT(x) (0x00001740+((x)*4))
-#define NV40TCL_VTXFMT__SIZE 0x00000010
-#define NV40TCL_VTXFMT_TYPE_SHIFT 0
-#define NV40TCL_VTXFMT_TYPE_MASK 0x0000000f
-#define NV40TCL_VTXFMT_TYPE_FLOAT 0x00000002
-#define NV40TCL_VTXFMT_TYPE_UBYTE 0x00000004
-#define NV40TCL_VTXFMT_TYPE_USHORT 0x00000005
-#define NV40TCL_VTXFMT_SIZE_SHIFT 4
-#define NV40TCL_VTXFMT_SIZE_MASK 0x000000f0
-#define NV40TCL_VTXFMT_STRIDE_SHIFT 8
-#define NV40TCL_VTXFMT_STRIDE_MASK 0x0000ff00
-#define NV40TCL_QUERY_RESET 0x000017c8
-#define NV40TCL_QUERY_UNK17CC 0x000017cc
-#define NV40TCL_QUERY_GET 0x00001800
-#define NV40TCL_QUERY_GET_UNK24_SHIFT 24
-#define NV40TCL_QUERY_GET_UNK24_MASK 0xff000000
-#define NV40TCL_QUERY_GET_OFFSET_SHIFT 0
-#define NV40TCL_QUERY_GET_OFFSET_MASK 0x00ffffff
-#define NV40TCL_BEGIN_END 0x00001808
-#define NV40TCL_BEGIN_END_STOP 0x00000000
-#define NV40TCL_BEGIN_END_POINTS 0x00000001
-#define NV40TCL_BEGIN_END_LINES 0x00000002
-#define NV40TCL_BEGIN_END_LINE_LOOP 0x00000003
-#define NV40TCL_BEGIN_END_LINE_STRIP 0x00000004
-#define NV40TCL_BEGIN_END_TRIANGLES 0x00000005
-#define NV40TCL_BEGIN_END_TRIANGLE_STRIP 0x00000006
-#define NV40TCL_BEGIN_END_TRIANGLE_FAN 0x00000007
-#define NV40TCL_BEGIN_END_QUADS 0x00000008
-#define NV40TCL_BEGIN_END_QUAD_STRIP 0x00000009
-#define NV40TCL_BEGIN_END_POLYGON 0x0000000a
-#define NV40TCL_VB_ELEMENT_U16 0x0000180c
-#define NV40TCL_VB_ELEMENT_U16_1_SHIFT 16
-#define NV40TCL_VB_ELEMENT_U16_1_MASK 0xffff0000
-#define NV40TCL_VB_ELEMENT_U16_0_SHIFT 0
-#define NV40TCL_VB_ELEMENT_U16_0_MASK 0x0000ffff
-#define NV40TCL_VB_ELEMENT_U32 0x00001810
-#define NV40TCL_VB_VERTEX_BATCH 0x00001814
-#define NV40TCL_VB_VERTEX_BATCH_COUNT_SHIFT 24
-#define NV40TCL_VB_VERTEX_BATCH_COUNT_MASK 0xff000000
-#define NV40TCL_VB_VERTEX_BATCH_START_SHIFT 0
-#define NV40TCL_VB_VERTEX_BATCH_START_MASK 0x00ffffff
-#define NV40TCL_VERTEX_DATA 0x00001818
-#define NV40TCL_IDXBUF_ADDRESS 0x0000181c
-#define NV40TCL_IDXBUF_FORMAT 0x00001820
-#define NV40TCL_IDXBUF_FORMAT_TYPE_SHIFT 4
-#define NV40TCL_IDXBUF_FORMAT_TYPE_MASK 0x000000f0
-#define NV40TCL_IDXBUF_FORMAT_TYPE_U32 0x00000000
-#define NV40TCL_IDXBUF_FORMAT_TYPE_U16 0x00000010
-#define NV40TCL_IDXBUF_FORMAT_DMA1 (1 << 0)
-#define NV40TCL_VB_INDEX_BATCH 0x00001824
-#define NV40TCL_VB_INDEX_BATCH_COUNT_SHIFT 24
-#define NV40TCL_VB_INDEX_BATCH_COUNT_MASK 0xff000000
-#define NV40TCL_VB_INDEX_BATCH_START_SHIFT 0
-#define NV40TCL_VB_INDEX_BATCH_START_MASK 0x00ffffff
-#define NV40TCL_POLYGON_MODE_FRONT 0x00001828
-#define NV40TCL_POLYGON_MODE_FRONT_POINT 0x00001b00
-#define NV40TCL_POLYGON_MODE_FRONT_LINE 0x00001b01
-#define NV40TCL_POLYGON_MODE_FRONT_FILL 0x00001b02
-#define NV40TCL_POLYGON_MODE_BACK 0x0000182c
-#define NV40TCL_POLYGON_MODE_BACK_POINT 0x00001b00
-#define NV40TCL_POLYGON_MODE_BACK_LINE 0x00001b01
-#define NV40TCL_POLYGON_MODE_BACK_FILL 0x00001b02
-#define NV40TCL_CULL_FACE 0x00001830
-#define NV40TCL_CULL_FACE_FRONT 0x00000404
-#define NV40TCL_CULL_FACE_BACK 0x00000405
-#define NV40TCL_CULL_FACE_FRONT_AND_BACK 0x00000408
-#define NV40TCL_FRONT_FACE 0x00001834
-#define NV40TCL_FRONT_FACE_CW 0x00000900
-#define NV40TCL_FRONT_FACE_CCW 0x00000901
-#define NV40TCL_POLYGON_SMOOTH_ENABLE 0x00001838
-#define NV40TCL_CULL_FACE_ENABLE 0x0000183c
-#define NV40TCL_TEX_SIZE1(x) (0x00001840+((x)*4))
-#define NV40TCL_TEX_SIZE1__SIZE 0x00000008
-#define NV40TCL_TEX_SIZE1_DEPTH_SHIFT 20
-#define NV40TCL_TEX_SIZE1_DEPTH_MASK 0xfff00000
-#define NV40TCL_TEX_SIZE1_PITCH_SHIFT 0
-#define NV40TCL_TEX_SIZE1_PITCH_MASK 0x0000ffff
-#define NV40TCL_VTX_ATTR_2F_X(x) (0x00001880+((x)*8))
-#define NV40TCL_VTX_ATTR_2F_X__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_2F_Y(x) (0x00001884+((x)*8))
-#define NV40TCL_VTX_ATTR_2F_Y__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_2I(x) (0x00001900+((x)*4))
-#define NV40TCL_VTX_ATTR_2I__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_2I_X_SHIFT 0
-#define NV40TCL_VTX_ATTR_2I_X_MASK 0x0000ffff
-#define NV40TCL_VTX_ATTR_2I_Y_SHIFT 16
-#define NV40TCL_VTX_ATTR_2I_Y_MASK 0xffff0000
-#define NV40TCL_VTX_ATTR_4UB(x) (0x00001940+((x)*4))
-#define NV40TCL_VTX_ATTR_4UB__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4UB_X_SHIFT 0
-#define NV40TCL_VTX_ATTR_4UB_X_MASK 0x000000ff
-#define NV40TCL_VTX_ATTR_4UB_Y_SHIFT 8
-#define NV40TCL_VTX_ATTR_4UB_Y_MASK 0x0000ff00
-#define NV40TCL_VTX_ATTR_4UB_Z_SHIFT 16
-#define NV40TCL_VTX_ATTR_4UB_Z_MASK 0x00ff0000
-#define NV40TCL_VTX_ATTR_4UB_W_SHIFT 24
-#define NV40TCL_VTX_ATTR_4UB_W_MASK 0xff000000
-#define NV40TCL_VTX_ATTR_4I_XY(x) (0x00001980+((x)*8))
-#define NV40TCL_VTX_ATTR_4I_XY__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4I_XY_X_SHIFT 0
-#define NV40TCL_VTX_ATTR_4I_XY_X_MASK 0x0000ffff
-#define NV40TCL_VTX_ATTR_4I_XY_Y_SHIFT 16
-#define NV40TCL_VTX_ATTR_4I_XY_Y_MASK 0xffff0000
-#define NV40TCL_VTX_ATTR_4I_ZW(x) (0x00001984+((x)*8))
-#define NV40TCL_VTX_ATTR_4I_ZW__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4I_ZW_Z_SHIFT 0
-#define NV40TCL_VTX_ATTR_4I_ZW_Z_MASK 0x0000ffff
-#define NV40TCL_VTX_ATTR_4I_ZW_W_SHIFT 16
-#define NV40TCL_VTX_ATTR_4I_ZW_W_MASK 0xffff0000
-#define NV40TCL_TEX_OFFSET(x) (0x00001a00+((x)*32))
-#define NV40TCL_TEX_OFFSET__SIZE 0x00000010
-#define NV40TCL_TEX_FORMAT(x) (0x00001a04+((x)*32))
-#define NV40TCL_TEX_FORMAT__SIZE 0x00000010
-#define NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT 16
-#define NV40TCL_TEX_FORMAT_MIPMAP_COUNT_MASK 0x000f0000
-#define NV40TCL_TEX_FORMAT_RECT (1 << 14)
-#define NV40TCL_TEX_FORMAT_LINEAR (1 << 13)
-#define NV40TCL_TEX_FORMAT_FORMAT_SHIFT 8
-#define NV40TCL_TEX_FORMAT_FORMAT_MASK 0x00001f00
-#define NV40TCL_TEX_FORMAT_FORMAT_L8 0x00000100
-#define NV40TCL_TEX_FORMAT_FORMAT_A1R5G5B5 0x00000200
-#define NV40TCL_TEX_FORMAT_FORMAT_A4R4G4B4 0x00000300
-#define NV40TCL_TEX_FORMAT_FORMAT_R5G6B5 0x00000400
-#define NV40TCL_TEX_FORMAT_FORMAT_A8R8G8B8 0x00000500
-#define NV40TCL_TEX_FORMAT_FORMAT_DXT1 0x00000600
-#define NV40TCL_TEX_FORMAT_FORMAT_DXT3 0x00000700
-#define NV40TCL_TEX_FORMAT_FORMAT_DXT5 0x00000800
-#define NV40TCL_TEX_FORMAT_FORMAT_A8L8 0x00000b00
-#define NV40TCL_TEX_FORMAT_FORMAT_Z24 0x00001000
-#define NV40TCL_TEX_FORMAT_FORMAT_Z16 0x00001200
-#define NV40TCL_TEX_FORMAT_FORMAT_A16 0x00001400
-#define NV40TCL_TEX_FORMAT_FORMAT_A16L16 0x00001500
-#define NV40TCL_TEX_FORMAT_FORMAT_HILO8 0x00001800
-#define NV40TCL_TEX_FORMAT_FORMAT_RGBA16F 0x00001a00
-#define NV40TCL_TEX_FORMAT_FORMAT_RGBA32F 0x00001b00
-#define NV40TCL_TEX_FORMAT_DIMS_SHIFT 4
-#define NV40TCL_TEX_FORMAT_DIMS_MASK 0x000000f0
-#define NV40TCL_TEX_FORMAT_DIMS_1D 0x00000010
-#define NV40TCL_TEX_FORMAT_DIMS_2D 0x00000020
-#define NV40TCL_TEX_FORMAT_DIMS_3D 0x00000030
-#define NV40TCL_TEX_FORMAT_NO_BORDER (1 << 3)
-#define NV40TCL_TEX_FORMAT_CUBIC (1 << 2)
-#define NV40TCL_TEX_FORMAT_DMA1 (1 << 1)
-#define NV40TCL_TEX_FORMAT_DMA0 (1 << 0)
-#define NV40TCL_TEX_WRAP(x) (0x00001a08+((x)*32))
-#define NV40TCL_TEX_WRAP__SIZE 0x00000010
-#define NV40TCL_TEX_WRAP_S_SHIFT 0
-#define NV40TCL_TEX_WRAP_S_MASK 0x000000ff
-#define NV40TCL_TEX_WRAP_S_REPEAT 0x00000001
-#define NV40TCL_TEX_WRAP_S_MIRRORED_REPEAT 0x00000002
-#define NV40TCL_TEX_WRAP_S_CLAMP_TO_EDGE 0x00000003
-#define NV40TCL_TEX_WRAP_S_CLAMP_TO_BORDER 0x00000004
-#define NV40TCL_TEX_WRAP_S_CLAMP 0x00000005
-#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP_TO_EDGE 0x00000006
-#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP_TO_BORDER 0x00000007
-#define NV40TCL_TEX_WRAP_S_MIRROR_CLAMP 0x00000008
-#define NV40TCL_TEX_WRAP_T_SHIFT 8
-#define NV40TCL_TEX_WRAP_T_MASK 0x00000f00
-#define NV40TCL_TEX_WRAP_T_REPEAT 0x00000100
-#define NV40TCL_TEX_WRAP_T_MIRRORED_REPEAT 0x00000200
-#define NV40TCL_TEX_WRAP_T_CLAMP_TO_EDGE 0x00000300
-#define NV40TCL_TEX_WRAP_T_CLAMP_TO_BORDER 0x00000400
-#define NV40TCL_TEX_WRAP_T_CLAMP 0x00000500
-#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP_TO_EDGE 0x00000600
-#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP_TO_BORDER 0x00000700
-#define NV40TCL_TEX_WRAP_T_MIRROR_CLAMP 0x00000800
-#define NV40TCL_TEX_WRAP_EXPAND_NORMAL_SHIFT 12
-#define NV40TCL_TEX_WRAP_EXPAND_NORMAL_MASK 0x0000f000
-#define NV40TCL_TEX_WRAP_R_SHIFT 16
-#define NV40TCL_TEX_WRAP_R_MASK 0x00ff0000
-#define NV40TCL_TEX_WRAP_R_REPEAT 0x00010000
-#define NV40TCL_TEX_WRAP_R_MIRRORED_REPEAT 0x00020000
-#define NV40TCL_TEX_WRAP_R_CLAMP_TO_EDGE 0x00030000
-#define NV40TCL_TEX_WRAP_R_CLAMP_TO_BORDER 0x00040000
-#define NV40TCL_TEX_WRAP_R_CLAMP 0x00050000
-#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP_TO_EDGE 0x00060000
-#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP_TO_BORDER 0x00070000
-#define NV40TCL_TEX_WRAP_R_MIRROR_CLAMP 0x00080000
-#define NV40TCL_TEX_WRAP_RCOMP_SHIFT 28
-#define NV40TCL_TEX_WRAP_RCOMP_MASK 0xf0000000
-#define NV40TCL_TEX_WRAP_RCOMP_NEVER 0x00000000
-#define NV40TCL_TEX_WRAP_RCOMP_GREATER 0x10000000
-#define NV40TCL_TEX_WRAP_RCOMP_EQUAL 0x20000000
-#define NV40TCL_TEX_WRAP_RCOMP_GEQUAL 0x30000000
-#define NV40TCL_TEX_WRAP_RCOMP_LESS 0x40000000
-#define NV40TCL_TEX_WRAP_RCOMP_NOTEQUAL 0x50000000
-#define NV40TCL_TEX_WRAP_RCOMP_LEQUAL 0x60000000
-#define NV40TCL_TEX_WRAP_RCOMP_ALWAYS 0x70000000
-#define NV40TCL_TEX_ENABLE(x) (0x00001a0c+((x)*32))
-#define NV40TCL_TEX_ENABLE__SIZE 0x00000010
-#define NV40TCL_TEX_ENABLE_ENABLE (1 << 31)
-#define NV40TCL_TEX_ENABLE_MIPMAP_MIN_LOD_SHIFT 27
-#define NV40TCL_TEX_ENABLE_MIPMAP_MIN_LOD_MASK 0x38000000
-#define NV40TCL_TEX_ENABLE_MIPMAP_MAX_LOD_SHIFT 15
-#define NV40TCL_TEX_ENABLE_MIPMAP_MAX_LOD_MASK 0x00038000
-#define NV40TCL_TEX_ENABLE_ANISO_SHIFT 4
-#define NV40TCL_TEX_ENABLE_ANISO_MASK 0x000000f0
-#define NV40TCL_TEX_ENABLE_ANISO_NONE 0x00000000
-#define NV40TCL_TEX_ENABLE_ANISO_2X 0x00000010
-#define NV40TCL_TEX_ENABLE_ANISO_4X 0x00000020
-#define NV40TCL_TEX_ENABLE_ANISO_6X 0x00000030
-#define NV40TCL_TEX_ENABLE_ANISO_8X 0x00000040
-#define NV40TCL_TEX_ENABLE_ANISO_10X 0x00000050
-#define NV40TCL_TEX_ENABLE_ANISO_12X 0x00000060
-#define NV40TCL_TEX_ENABLE_ANISO_16X 0x00000070
-#define NV40TCL_TEX_SWIZZLE(x) (0x00001a10+((x)*32))
-#define NV40TCL_TEX_SWIZZLE__SIZE 0x00000010
-#define NV40TCL_TEX_SWIZZLE_S0_X_SHIFT 14
-#define NV40TCL_TEX_SWIZZLE_S0_X_MASK 0x0000c000
-#define NV40TCL_TEX_SWIZZLE_S0_X_ZERO 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S0_X_ONE 0x00004000
-#define NV40TCL_TEX_SWIZZLE_S0_X_S1 0x00008000
-#define NV40TCL_TEX_SWIZZLE_S0_Y_SHIFT 12
-#define NV40TCL_TEX_SWIZZLE_S0_Y_MASK 0x00003000
-#define NV40TCL_TEX_SWIZZLE_S0_Y_ZERO 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S0_Y_ONE 0x00001000
-#define NV40TCL_TEX_SWIZZLE_S0_Y_S1 0x00002000
-#define NV40TCL_TEX_SWIZZLE_S0_Z_SHIFT 10
-#define NV40TCL_TEX_SWIZZLE_S0_Z_MASK 0x00000c00
-#define NV40TCL_TEX_SWIZZLE_S0_Z_ZERO 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S0_Z_ONE 0x00000400
-#define NV40TCL_TEX_SWIZZLE_S0_Z_S1 0x00000800
-#define NV40TCL_TEX_SWIZZLE_S0_W_SHIFT 8
-#define NV40TCL_TEX_SWIZZLE_S0_W_MASK 0x00000300
-#define NV40TCL_TEX_SWIZZLE_S0_W_ZERO 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S0_W_ONE 0x00000100
-#define NV40TCL_TEX_SWIZZLE_S0_W_S1 0x00000200
-#define NV40TCL_TEX_SWIZZLE_S1_X_SHIFT 6
-#define NV40TCL_TEX_SWIZZLE_S1_X_MASK 0x000000c0
-#define NV40TCL_TEX_SWIZZLE_S1_X_W 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S1_X_Z 0x00000040
-#define NV40TCL_TEX_SWIZZLE_S1_X_Y 0x00000080
-#define NV40TCL_TEX_SWIZZLE_S1_X_X 0x000000c0
-#define NV40TCL_TEX_SWIZZLE_S1_Y_SHIFT 4
-#define NV40TCL_TEX_SWIZZLE_S1_Y_MASK 0x00000030
-#define NV40TCL_TEX_SWIZZLE_S1_Y_W 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S1_Y_Z 0x00000010
-#define NV40TCL_TEX_SWIZZLE_S1_Y_Y 0x00000020
-#define NV40TCL_TEX_SWIZZLE_S1_Y_X 0x00000030
-#define NV40TCL_TEX_SWIZZLE_S1_Z_SHIFT 2
-#define NV40TCL_TEX_SWIZZLE_S1_Z_MASK 0x0000000c
-#define NV40TCL_TEX_SWIZZLE_S1_Z_W 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S1_Z_Z 0x00000004
-#define NV40TCL_TEX_SWIZZLE_S1_Z_Y 0x00000008
-#define NV40TCL_TEX_SWIZZLE_S1_Z_X 0x0000000c
-#define NV40TCL_TEX_SWIZZLE_S1_W_SHIFT 0
-#define NV40TCL_TEX_SWIZZLE_S1_W_MASK 0x00000003
-#define NV40TCL_TEX_SWIZZLE_S1_W_W 0x00000000
-#define NV40TCL_TEX_SWIZZLE_S1_W_Z 0x00000001
-#define NV40TCL_TEX_SWIZZLE_S1_W_Y 0x00000002
-#define NV40TCL_TEX_SWIZZLE_S1_W_X 0x00000003
-#define NV40TCL_TEX_FILTER(x) (0x00001a14+((x)*32))
-#define NV40TCL_TEX_FILTER__SIZE 0x00000010
-#define NV40TCL_TEX_FILTER_SIGNED_ALPHA (1 << 31)
-#define NV40TCL_TEX_FILTER_SIGNED_RED (1 << 30)
-#define NV40TCL_TEX_FILTER_SIGNED_GREEN (1 << 29)
-#define NV40TCL_TEX_FILTER_SIGNED_BLUE (1 << 28)
-#define NV40TCL_TEX_FILTER_MIN_SHIFT 16
-#define NV40TCL_TEX_FILTER_MIN_MASK 0x000f0000
-#define NV40TCL_TEX_FILTER_MIN_NEAREST 0x00010000
-#define NV40TCL_TEX_FILTER_MIN_LINEAR 0x00020000
-#define NV40TCL_TEX_FILTER_MIN_NEAREST_MIPMAP_NEAREST 0x00030000
-#define NV40TCL_TEX_FILTER_MIN_LINEAR_MIPMAP_NEAREST 0x00040000
-#define NV40TCL_TEX_FILTER_MIN_NEAREST_MIPMAP_LINEAR 0x00050000
-#define NV40TCL_TEX_FILTER_MIN_LINEAR_MIPMAP_LINEAR 0x00060000
-#define NV40TCL_TEX_FILTER_MAG_SHIFT 24
-#define NV40TCL_TEX_FILTER_MAG_MASK 0x0f000000
-#define NV40TCL_TEX_FILTER_MAG_NEAREST 0x01000000
-#define NV40TCL_TEX_FILTER_MAG_LINEAR 0x02000000
-#define NV40TCL_TEX_SIZE0(x) (0x00001a18+((x)*32))
-#define NV40TCL_TEX_SIZE0__SIZE 0x00000010
-#define NV40TCL_TEX_SIZE0_H_SHIFT 0
-#define NV40TCL_TEX_SIZE0_H_MASK 0x0000ffff
-#define NV40TCL_TEX_SIZE0_W_SHIFT 16
-#define NV40TCL_TEX_SIZE0_W_MASK 0xffff0000
-#define NV40TCL_TEX_BORDER_COLOR(x) (0x00001a1c+((x)*32))
-#define NV40TCL_TEX_BORDER_COLOR__SIZE 0x00000010
-#define NV40TCL_TEX_BORDER_COLOR_B_SHIFT 0
-#define NV40TCL_TEX_BORDER_COLOR_B_MASK 0x000000ff
-#define NV40TCL_TEX_BORDER_COLOR_G_SHIFT 8
-#define NV40TCL_TEX_BORDER_COLOR_G_MASK 0x0000ff00
-#define NV40TCL_TEX_BORDER_COLOR_R_SHIFT 16
-#define NV40TCL_TEX_BORDER_COLOR_R_MASK 0x00ff0000
-#define NV40TCL_TEX_BORDER_COLOR_A_SHIFT 24
-#define NV40TCL_TEX_BORDER_COLOR_A_MASK 0xff000000
-#define NV40TCL_VTX_ATTR_4F_X(x) (0x00001c00+((x)*16))
-#define NV40TCL_VTX_ATTR_4F_X__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4F_Y(x) (0x00001c04+((x)*16))
-#define NV40TCL_VTX_ATTR_4F_Y__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4F_Z(x) (0x00001c08+((x)*16))
-#define NV40TCL_VTX_ATTR_4F_Z__SIZE 0x00000010
-#define NV40TCL_VTX_ATTR_4F_W(x) (0x00001c0c+((x)*16))
-#define NV40TCL_VTX_ATTR_4F_W__SIZE 0x00000010
-#define NV40TCL_FP_CONTROL 0x00001d60
-#define NV40TCL_FP_CONTROL_TEMP_COUNT_SHIFT 24
-#define NV40TCL_FP_CONTROL_TEMP_COUNT_MASK 0xff000000
-#define NV40TCL_FP_CONTROL_KIL (1 << 7)
-#define NV40TCL_MULTISAMPLE_CONTROL 0x00001d7c
-#define NV40TCL_CLEAR_VALUE_DEPTH 0x00001d8c
-#define NV40TCL_CLEAR_VALUE_COLOR 0x00001d90
-#define NV40TCL_CLEAR_BUFFERS 0x00001d94
-#define NV40TCL_CLEAR_BUFFERS_COLOR_A (1 << 7)
-#define NV40TCL_CLEAR_BUFFERS_COLOR_B (1 << 6)
-#define NV40TCL_CLEAR_BUFFERS_COLOR_G (1 << 5)
-#define NV40TCL_CLEAR_BUFFERS_COLOR_R (1 << 4)
-#define NV40TCL_CLEAR_BUFFERS_STENCIL (1 << 1)
-#define NV40TCL_CLEAR_BUFFERS_DEPTH (1 << 0)
-#define NV40TCL_LINE_STIPPLE_ENABLE 0x00001db4
-#define NV40TCL_LINE_STIPPLE_PATTERN 0x00001db8
-#define NV40TCL_LINE_STIPPLE_PATTERN_FACTOR_SHIFT 0
-#define NV40TCL_LINE_STIPPLE_PATTERN_FACTOR_MASK 0x0000ffff
-#define NV40TCL_LINE_STIPPLE_PATTERN_PATTERN_SHIFT 16
-#define NV40TCL_LINE_STIPPLE_PATTERN_PATTERN_MASK 0xffff0000
-#define NV40TCL_VTX_ATTR_1F(x) (0x00001e40+((x)*4))
-#define NV40TCL_VTX_ATTR_1F__SIZE 0x00000010
-#define NV40TCL_VP_UPLOAD_FROM_ID 0x00001e9c
-#define NV40TCL_VP_START_FROM_ID 0x00001ea0
-#define NV40TCL_POINT_SIZE 0x00001ee0
-#define NV40TCL_POINT_SPRITE 0x00001ee8
-#define NV40TCL_VP_UPLOAD_CONST_ID 0x00001efc
-#define NV40TCL_VP_UPLOAD_CONST_X(x) (0x00001f00+((x)*16))
-#define NV40TCL_VP_UPLOAD_CONST_X__SIZE 0x00000004
-#define NV40TCL_VP_UPLOAD_CONST_Y(x) (0x00001f04+((x)*16))
-#define NV40TCL_VP_UPLOAD_CONST_Y__SIZE 0x00000004
-#define NV40TCL_VP_UPLOAD_CONST_Z(x) (0x00001f08+((x)*16))
-#define NV40TCL_VP_UPLOAD_CONST_Z__SIZE 0x00000004
-#define NV40TCL_VP_UPLOAD_CONST_W(x) (0x00001f0c+((x)*16))
-#define NV40TCL_VP_UPLOAD_CONST_W__SIZE 0x00000004
-#define NV40TCL_TEX_CACHE_CTL 0x00001fd8
-#define NV40TCL_VP_ATTRIB_EN 0x00001ff0
-#define NV40TCL_VP_RESULT_EN 0x00001ff4
-
-
-#define NV44TCL 0x00004497
-
-
-
-#define NV50_2D 0x0000502d
-
-#define NV50_2D_NOP 0x00000100
-#define NV50_2D_NOTIFY 0x00000104
-#define NV50_2D_DMA_NOTIFY 0x00000180
-#define NV50_2D_DMA_IN_MEMORY0 0x00000184
-#define NV50_2D_DMA_IN_MEMORY1 0x00000188
-#define NV50_2D_DMA_IN_MEMORY2 0x0000018c
-#define NV50_2D_DST_FORMAT 0x00000200
-#define NV50_2D_DST_FORMAT_32BPP 0x000000cf
-#define NV50_2D_DST_FORMAT_24BPP 0x000000e6
-#define NV50_2D_DST_FORMAT_16BPP 0x000000e8
-#define NV50_2D_DST_FORMAT_8BPP 0x000000f3
-#define NV50_2D_DST_FORMAT_15BPP 0x000000f8
-#define NV50_2D_DST_PITCH 0x00000214
-#define NV50_2D_DST_WIDTH 0x00000218
-#define NV50_2D_DST_HEIGHT 0x0000021c
-#define NV50_2D_DST_ADDRESS_HIGH 0x00000220
-#define NV50_2D_DST_ADDRESS_LOW 0x00000224
-#define NV50_2D_SRC_FORMAT 0x00000230
-#define NV50_2D_SRC_FORMAT_32BPP 0x000000cf
-#define NV50_2D_SRC_FORMAT_24BPP 0x000000e6
-#define NV50_2D_SRC_FORMAT_16BPP 0x000000e8
-#define NV50_2D_SRC_FORMAT_8BPP 0x000000f3
-#define NV50_2D_SRC_FORMAT_15BPP 0x000000f8
-#define NV50_2D_SRC_PITCH 0x00000244
-#define NV50_2D_SRC_WIDTH 0x00000248
-#define NV50_2D_SRC_HEIGHT 0x0000024c
-#define NV50_2D_SRC_ADDRESS_HIGH 0x00000250
-#define NV50_2D_SRC_ADDRESS_LOW 0x00000254
-#define NV50_2D_CLIP_X 0x00000280
-#define NV50_2D_CLIP_Y 0x00000284
-#define NV50_2D_CLIP_Z 0x00000288
-#define NV50_2D_CLIP_W 0x0000028c
-#define NV50_2D_ROP 0x000002a0
-#define NV50_2D_OPERATION 0x000002ac
-#define NV50_2D_OPERATION_SRCCOPY_AND 0x00000000
-#define NV50_2D_OPERATION_ROP_AND 0x00000001
-#define NV50_2D_OPERATION_BLEND_AND 0x00000002
-#define NV50_2D_OPERATION_SRCCOPY 0x00000003
-#define NV50_2D_OPERATION_SRCCOPY_PREMULT 0x00000004
-#define NV50_2D_OPERATION_BLEND_PREMULT 0x00000005
-#define NV50_2D_PATTERN_FORMAT 0x000002e8
-#define NV50_2D_PATTERN_FORMAT_16BPP 0x00000000
-#define NV50_2D_PATTERN_FORMAT_15BPP 0x00000001
-#define NV50_2D_PATTERN_FORMAT_32BPP 0x00000002
-#define NV50_2D_PATTERN_FORMAT_8BPP 0x00000003
-#define NV50_2D_PATTERN_COLOR(x) (0x000002f0+((x)*4))
-#define NV50_2D_PATTERN_COLOR__SIZE 0x00000002
-#define NV50_2D_PATTERN_BITMAP(x) (0x000002f8+((x)*4))
-#define NV50_2D_PATTERN_BITMAP__SIZE 0x00000002
-#define NV50_2D_RECT_FORMAT 0x00000584
-#define NV50_2D_RECT_FORMAT_32BPP 0x000000cf
-#define NV50_2D_RECT_FORMAT_24BPP 0x000000e6
-#define NV50_2D_RECT_FORMAT_16BPP 0x000000e8
-#define NV50_2D_RECT_FORMAT_8BPP 0x000000f3
-#define NV50_2D_RECT_FORMAT_15BPP 0x000000f8
-#define NV50_2D_RECT_COLOR 0x00000588
-#define NV50_2D_RECT_X1 0x00000600
-#define NV50_2D_RECT_Y1 0x00000604
-#define NV50_2D_RECT_X2 0x00000608
-#define NV50_2D_RECT_Y2 0x0000060c
-#define NV50_2D_SIFC_UNK0800 0x00000800
-#define NV50_2D_SIFC_FORMAT 0x00000804
-#define NV50_2D_SIFC_FORMAT_32BPP 0x000000cf
-#define NV50_2D_SIFC_FORMAT_24BPP 0x000000e6
-#define NV50_2D_SIFC_FORMAT_16BPP 0x000000e8
-#define NV50_2D_SIFC_FORMAT_8BPP 0x000000f3
-#define NV50_2D_SIFC_FORMAT_15BPP 0x000000f8
-#define NV50_2D_SIFC_WIDTH 0x00000838
-#define NV50_2D_SIFC_HEIGHT 0x0000083c
-#define NV50_2D_SIFC_SCALE_UNK0840 0x00000840
-#define NV50_2D_SIFC_SCALE_UNK0844 0x00000844
-#define NV50_2D_SIFC_SCALE_UNK0848 0x00000848
-#define NV50_2D_SIFC_SCALE_UNK084C 0x0000084c
-#define NV50_2D_SIFC_UNK0850 0x00000850
-#define NV50_2D_SIFC_DST_X 0x00000854
-#define NV50_2D_SIFC_UNK0858 0x00000858
-#define NV50_2D_SIFC_DST_Y 0x0000085c
-#define NV50_2D_SIFC_DATA 0x00000860
-#define NV50_2D_BLIT_DST_X 0x000008b0
-#define NV50_2D_BLIT_DST_Y 0x000008b4
-#define NV50_2D_BLIT_DST_W 0x000008b8
-#define NV50_2D_BLIT_DST_H 0x000008bc
-#define NV50_2D_BLIT_SRC_X 0x000008d4
-#define NV50_2D_BLIT_SRC_Y 0x000008dc
-
-
-#define NV50_MEMORY_TO_MEMORY_FORMAT 0x00005039
-
-#define NV50_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN_HIGH 0x00000238
-#define NV50_MEMORY_TO_MEMORY_FORMAT_OFFSET_OUT_HIGH 0x0000023c
-
-
-#define NV50TCL 0x00005097
-
-#define NV50TCL_NOP 0x00000100
-#define NV50TCL_NOTIFY 0x00000104
-#define NV50TCL_DMA_NOTIFY 0x00000180
-#define NV50TCL_DMA_UNK0(x) (0x00000184+((x)*4))
-#define NV50TCL_DMA_UNK0__SIZE 0x0000000b
-#define NV50TCL_DMA_UNK1(x) (0x000001c0+((x)*4))
-#define NV50TCL_DMA_UNK1__SIZE 0x00000008
-#define NV50TCL_RT_ADDRESS_HIGH(x) (0x00000200+((x)*32))
-#define NV50TCL_RT_ADDRESS_HIGH__SIZE 0x00000008
-#define NV50TCL_RT_ADDRESS_LOW(x) (0x00000204+((x)*32))
-#define NV50TCL_RT_ADDRESS_LOW__SIZE 0x00000008
-#define NV50TCL_RT_FORMAT(x) (0x00000208+((x)*32))
-#define NV50TCL_RT_FORMAT__SIZE 0x00000008
-#define NV50TCL_RT_FORMAT_32BPP 0x000000cf
-#define NV50TCL_RT_FORMAT_24BPP 0x000000e6
-#define NV50TCL_RT_FORMAT_16BPP 0x000000e8
-#define NV50TCL_RT_FORMAT_8BPP 0x000000f3
-#define NV50TCL_RT_FORMAT_15BPP 0x000000f8
-#define NV50TCL_RT_TILE_UNK(x) (0x0000020c+((x)*32))
-#define NV50TCL_RT_TILE_UNK__SIZE 0x00000008
-#define NV50TCL_RT_UNK4(x) (0x00000210+((x)*32))
-#define NV50TCL_RT_UNK4__SIZE 0x00000008
-#define NV50TCL_VTX_ATTR_1F(x) (0x00000300+((x)*4))
-#define NV50TCL_VTX_ATTR_1F__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_2F_X(x) (0x00000380+((x)*8))
-#define NV50TCL_VTX_ATTR_2F_X__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_2F_Y(x) (0x00000384+((x)*8))
-#define NV50TCL_VTX_ATTR_2F_Y__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_3F_X(x) (0x00000400+((x)*16))
-#define NV50TCL_VTX_ATTR_3F_X__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_3F_Y(x) (0x00000404+((x)*16))
-#define NV50TCL_VTX_ATTR_3F_Y__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_3F_Z(x) (0x00000408+((x)*16))
-#define NV50TCL_VTX_ATTR_3F_Z__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_3F_W(x) (0x0000040c+((x)*16))
-#define NV50TCL_VTX_ATTR_3F_W__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4F_X(x) (0x00000500+((x)*16))
-#define NV50TCL_VTX_ATTR_4F_X__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4F_Y(x) (0x00000504+((x)*16))
-#define NV50TCL_VTX_ATTR_4F_Y__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4F_Z(x) (0x00000508+((x)*16))
-#define NV50TCL_VTX_ATTR_4F_Z__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4F_W(x) (0x0000050c+((x)*16))
-#define NV50TCL_VTX_ATTR_4F_W__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_2I(x) (0x00000680+((x)*4))
-#define NV50TCL_VTX_ATTR_2I__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_2I_X_SHIFT 0
-#define NV50TCL_VTX_ATTR_2I_X_MASK 0x0000ffff
-#define NV50TCL_VTX_ATTR_2I_Y_SHIFT 16
-#define NV50TCL_VTX_ATTR_2I_Y_MASK 0xffff0000
-#define NV50TCL_VTX_ATTR_4I_0(x) (0x00000700+((x)*8))
-#define NV50TCL_VTX_ATTR_4I_0__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4I_0_X_SHIFT 0
-#define NV50TCL_VTX_ATTR_4I_0_X_MASK 0x0000ffff
-#define NV50TCL_VTX_ATTR_4I_0_Y_SHIFT 16
-#define NV50TCL_VTX_ATTR_4I_0_Y_MASK 0xffff0000
-#define NV50TCL_VTX_ATTR_4I_1(x) (0x00000704+((x)*8))
-#define NV50TCL_VTX_ATTR_4I_1__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4I_1_Z_SHIFT 0
-#define NV50TCL_VTX_ATTR_4I_1_Z_MASK 0x0000ffff
-#define NV50TCL_VTX_ATTR_4I_1_W_SHIFT 16
-#define NV50TCL_VTX_ATTR_4I_1_W_MASK 0xffff0000
-#define NV50TCL_VTX_ATTR_4NI_0(x) (0x00000780+((x)*8))
-#define NV50TCL_VTX_ATTR_4NI_0__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4NI_0_X_SHIFT 0
-#define NV50TCL_VTX_ATTR_4NI_0_X_MASK 0x0000ffff
-#define NV50TCL_VTX_ATTR_4NI_0_Y_SHIFT 16
-#define NV50TCL_VTX_ATTR_4NI_0_Y_MASK 0xffff0000
-#define NV50TCL_VTX_ATTR_4NI_1(x) (0x00000784+((x)*8))
-#define NV50TCL_VTX_ATTR_4NI_1__SIZE 0x00000010
-#define NV50TCL_VTX_ATTR_4NI_1_Z_SHIFT 0
-#define NV50TCL_VTX_ATTR_4NI_1_Z_MASK 0x0000ffff
-#define NV50TCL_VTX_ATTR_4NI_1_W_SHIFT 16
-#define NV50TCL_VTX_ATTR_4NI_1_W_MASK 0xffff0000
-#define NV50TCL_VERTEX_ARRAY_FORMAT(x) (0x00000900+((x)*16))
-#define NV50TCL_VERTEX_ARRAY_FORMAT__SIZE 0x00000010
-#define NV50TCL_VIEWPORT_UNK0(x) (0x00000a00+((x)*4))
-#define NV50TCL_VIEWPORT_UNK0__SIZE 0x00000003
-#define NV50TCL_VIEWPORT_UNK1(x) (0x00000a0c+((x)*4))
-#define NV50TCL_VIEWPORT_UNK1__SIZE 0x00000003
-#define NV50TCL_VIEWPORT_HORIZ 0x00000c00
-#define NV50TCL_VIEWPORT_HORIZ_X_SHIFT 0
-#define NV50TCL_VIEWPORT_HORIZ_X_MASK 0x0000ffff
-#define NV50TCL_VIEWPORT_HORIZ_W_SHIFT 16
-#define NV50TCL_VIEWPORT_HORIZ_W_MASK 0xffff0000
-#define NV50TCL_VIEWPORT_VERT 0x00000c04
-#define NV50TCL_VIEWPORT_VERT_Y_SHIFT 0
-#define NV50TCL_VIEWPORT_VERT_Y_MASK 0x0000ffff
-#define NV50TCL_VIEWPORT_VERT_H_SHIFT 16
-#define NV50TCL_VIEWPORT_VERT_H_MASK 0xffff0000
-#define NV50TCL_DEPTH_RANGE_NEAR 0x00000c08
-#define NV50TCL_DEPTH_RANGE_FAR 0x00000c0c
-#define NV50TCL_VIEWPORT_CLIP_HORIZ(x) (0x00000d00+((x)*8))
-#define NV50TCL_VIEWPORT_CLIP_HORIZ__SIZE 0x00000008
-#define NV50TCL_VIEWPORT_CLIP_VERT(x) (0x00000d04+((x)*8))
-#define NV50TCL_VIEWPORT_CLIP_VERT__SIZE 0x00000008
-#define NV50TCL_VERTEX_BUFFER_FIRST 0x00000d74
-#define NV50TCL_VERTEX_BUFFER_COUNT 0x00000d78
-#define NV50TCL_CLEAR_COLOR(x) (0x00000d80+((x)*4))
-#define NV50TCL_CLEAR_COLOR__SIZE 0x00000004
-#define NV50TCL_CLEAR_DEPTH 0x00000d90
-#define NV50TCL_CLEAR_STENCIL 0x00000da0
-#define NV50TCL_POLYGON_MODE_FRONT 0x00000dac
-#define NV50TCL_POLYGON_MODE_FRONT_POINT 0x00001b00
-#define NV50TCL_POLYGON_MODE_FRONT_LINE 0x00001b01
-#define NV50TCL_POLYGON_MODE_FRONT_FILL 0x00001b02
-#define NV50TCL_POLYGON_MODE_BACK 0x00000db0
-#define NV50TCL_POLYGON_MODE_BACK_POINT 0x00001b00
-#define NV50TCL_POLYGON_MODE_BACK_LINE 0x00001b01
-#define NV50TCL_POLYGON_MODE_BACK_FILL 0x00001b02
-#define NV50TCL_POLYGON_SMOOTH_ENABLE 0x00000db4
-#define NV50TCL_POLYGON_OFFSET_POINT_ENABLE 0x00000dc0
-#define NV50TCL_POLYGON_OFFSET_LINE_ENABLE 0x00000dc4
-#define NV50TCL_POLYGON_OFFSET_FILL_ENABLE 0x00000dc8
-#define NV50TCL_SCISSOR_HORIZ 0x00000e04
-#define NV50TCL_SCISSOR_HORIZ_L_SHIFT 0
-#define NV50TCL_SCISSOR_HORIZ_L_MASK 0x0000ffff
-#define NV50TCL_SCISSOR_HORIZ_R_SHIFT 16
-#define NV50TCL_SCISSOR_HORIZ_R_MASK 0xffff0000
-#define NV50TCL_SCISSOR_VERT 0x00000e08
-#define NV50TCL_SCISSOR_VERT_T_SHIFT 0
-#define NV50TCL_SCISSOR_VERT_T_MASK 0x0000ffff
-#define NV50TCL_SCISSOR_VERT_B_SHIFT 16
-#define NV50TCL_SCISSOR_VERT_B_MASK 0xffff0000
-#define NV50TCL_CB_ADDR 0x00000f00
-#define NV50TCL_CB_ADDR_ID_SHIFT 8
-#define NV50TCL_CB_ADDR_ID_MASK 0xffffff00
-#define NV50TCL_CB_ADDR_BUFFER_SHIFT 0
-#define NV50TCL_CB_ADDR_BUFFER_MASK 0x000000ff
-#define NV50TCL_CB_DATA(x) (0x00000f04+((x)*4))
-#define NV50TCL_CB_DATA__SIZE 0x00000010
-#define NV50TCL_STENCIL_FRONT_FUNC_REF 0x00000f54
-#define NV50TCL_STENCIL_FRONT_MASK 0x00000f58
-#define NV50TCL_STENCIL_FRONT_FUNC_MASK 0x00000f5c
-#define NV50TCL_GP_ADDRESS_HIGH 0x00000f70
-#define NV50TCL_GP_ADDRESS_LOW 0x00000f74
-#define NV50TCL_VP_ADDRESS_HIGH 0x00000f7c
-#define NV50TCL_VP_ADDRESS_LOW 0x00000f80
-#define NV50TCL_FP_ADDRESS_HIGH 0x00000fa4
-#define NV50TCL_FP_ADDRESS_LOW 0x00000fa8
-#define NV50TCL_ZETA_ADDRESS_HIGH 0x00000fe0
-#define NV50TCL_ZETA_ADDRESS_LOW 0x00000fe4
-#define NV50TCL_UNKFF4 0x00000ff4
-#define NV50TCL_UNKFF4_W_SHIFT 16
-#define NV50TCL_UNKFF4_W_MASK 0xffff0000
-#define NV50TCL_UNKFF8 0x00000ff8
-#define NV50TCL_UNKFF8_H_SHIFT 16
-#define NV50TCL_UNKFF8_H_MASK 0xffff0000
-#define NV50TCL_RT_HORIZ(x) (0x00001240+((x)*8))
-#define NV50TCL_RT_HORIZ__SIZE 0x00000008
-#define NV50TCL_RT_VERT(x) (0x00001244+((x)*8))
-#define NV50TCL_RT_VERT__SIZE 0x00000008
-#define NV50TCL_CB_DEF_ADDRESS_HIGH 0x00001280
-#define NV50TCL_CB_DEF_ADDRESS_LOW 0x00001284
-#define NV50TCL_CB_DEF_SET 0x00001288
-#define NV50TCL_CB_DEF_SET_SIZE_SHIFT 0
-#define NV50TCL_CB_DEF_SET_SIZE_MASK 0x0000ffff
-#define NV50TCL_CB_DEF_SET_BUFFER_SHIFT 16
-#define NV50TCL_CB_DEF_SET_BUFFER_MASK 0xffff0000
-#define NV50TCL_DEPTH_TEST_ENABLE 0x000012cc
-#define NV50TCL_SHADE_MODEL 0x000012d4
-#define NV50TCL_SHADE_MODEL_FLAT 0x00001d00
-#define NV50TCL_SHADE_MODEL_SMOOTH 0x00001d01
-#define NV50TCL_DEPTH_WRITE_ENABLE 0x000012e8
-#define NV50TCL_ALPHA_TEST_ENABLE 0x000012ec
-#define NV50TCL_DEPTH_TEST_FUNC 0x0000130c
-#define NV50TCL_DEPTH_TEST_FUNC_NEVER 0x00000200
-#define NV50TCL_DEPTH_TEST_FUNC_LESS 0x00000201
-#define NV50TCL_DEPTH_TEST_FUNC_EQUAL 0x00000202
-#define NV50TCL_DEPTH_TEST_FUNC_LEQUAL 0x00000203
-#define NV50TCL_DEPTH_TEST_FUNC_GREATER 0x00000204
-#define NV50TCL_DEPTH_TEST_FUNC_GREATER 0x00000204
-#define NV50TCL_DEPTH_TEST_FUNC_NOTEQUAL 0x00000205
-#define NV50TCL_DEPTH_TEST_FUNC_GEQUAL 0x00000206
-#define NV50TCL_DEPTH_TEST_FUNC_ALWAYS 0x00000207
-#define NV50TCL_ALPHA_TEST_REF 0x00001310
-#define NV50TCL_ALPHA_TEST_FUNC 0x00001314
-#define NV50TCL_ALPHA_TEST_FUNC_NEVER 0x00000200
-#define NV50TCL_ALPHA_TEST_FUNC_LESS 0x00000201
-#define NV50TCL_ALPHA_TEST_FUNC_EQUAL 0x00000202
-#define NV50TCL_ALPHA_TEST_FUNC_LEQUAL 0x00000203
-#define NV50TCL_ALPHA_TEST_FUNC_GREATER 0x00000204
-#define NV50TCL_ALPHA_TEST_FUNC_GREATER 0x00000204
-#define NV50TCL_ALPHA_TEST_FUNC_NOTEQUAL 0x00000205
-#define NV50TCL_ALPHA_TEST_FUNC_GEQUAL 0x00000206
-#define NV50TCL_ALPHA_TEST_FUNC_ALWAYS 0x00000207
-#define NV50TCL_BLEND_COLOR(x) (0x0000131c+((x)*4))
-#define NV50TCL_BLEND_COLOR__SIZE 0x00000004
-#define NV50TCL_BLEND_EQUATION_RGB 0x00001340
-#define NV50TCL_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
-#define NV50TCL_BLEND_EQUATION_RGB_MIN 0x00008007
-#define NV50TCL_BLEND_EQUATION_RGB_MAX 0x00008008
-#define NV50TCL_BLEND_EQUATION_RGB_FUNC_SUBTRACT 0x0000800a
-#define NV50TCL_BLEND_EQUATION_RGB_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV50TCL_BLEND_FUNC_SRC_RGB 0x00001344
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ZERO 0x00000000
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE 0x00000001
-#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_COLOR 0x00000300
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA 0x00000302
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV50TCL_BLEND_FUNC_SRC_RGB_DST_ALPHA 0x00000304
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV50TCL_BLEND_FUNC_SRC_RGB_DST_COLOR 0x00000306
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV50TCL_BLEND_FUNC_SRC_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV50TCL_BLEND_FUNC_SRC_RGB_CONSTANT_COLOR 0x00008001
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV50TCL_BLEND_FUNC_SRC_RGB_CONSTANT_ALPHA 0x00008003
-#define NV50TCL_BLEND_FUNC_SRC_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV50TCL_BLEND_FUNC_DST_RGB 0x00001348
-#define NV50TCL_BLEND_FUNC_DST_RGB_ZERO 0x00000000
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE 0x00000001
-#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_COLOR 0x00000300
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA 0x00000302
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV50TCL_BLEND_FUNC_DST_RGB_DST_ALPHA 0x00000304
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV50TCL_BLEND_FUNC_DST_RGB_DST_COLOR 0x00000306
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_DST_COLOR 0x00000307
-#define NV50TCL_BLEND_FUNC_DST_RGB_SRC_ALPHA_SATURATE 0x00000308
-#define NV50TCL_BLEND_FUNC_DST_RGB_CONSTANT_COLOR 0x00008001
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV50TCL_BLEND_FUNC_DST_RGB_CONSTANT_ALPHA 0x00008003
-#define NV50TCL_BLEND_FUNC_DST_RGB_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV50TCL_BLEND_EQUATION_ALPHA 0x0000134c
-#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_ADD 0x00008006
-#define NV50TCL_BLEND_EQUATION_ALPHA_MIN 0x00008007
-#define NV50TCL_BLEND_EQUATION_ALPHA_MAX 0x00008008
-#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_SUBTRACT 0x0000800a
-#define NV50TCL_BLEND_EQUATION_ALPHA_FUNC_REVERSE_SUBTRACT 0x0000800b
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA 0x00001350
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ZERO 0x00000000
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE 0x00000001
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_COLOR 0x00000300
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA 0x00000302
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_DST_ALPHA 0x00000304
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_DST_COLOR 0x00000306
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_DST_COLOR 0x00000307
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA_SATURATE 0x00000308
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_COLOR 0x00008001
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_CONSTANT_ALPHA 0x00008003
-#define NV50TCL_BLEND_FUNC_SRC_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV50TCL_BLEND_FUNC_DST_ALPHA 0x00001358
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ZERO 0x00000000
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE 0x00000001
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_COLOR 0x00000300
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_COLOR 0x00000301
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA 0x00000302
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_SRC_ALPHA 0x00000303
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_DST_ALPHA 0x00000304
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_ALPHA 0x00000305
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_DST_COLOR 0x00000306
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_DST_COLOR 0x00000307
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_SRC_ALPHA_SATURATE 0x00000308
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_COLOR 0x00008001
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_COLOR 0x00008002
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_CONSTANT_ALPHA 0x00008003
-#define NV50TCL_BLEND_FUNC_DST_ALPHA_ONE_MINUS_CONSTANT_ALPHA 0x00008004
-#define NV50TCL_BLEND_ENABLE(x) (0x00001360+((x)*4))
-#define NV50TCL_BLEND_ENABLE__SIZE 0x00000008
-#define NV50TCL_STENCIL_BACK_ENABLE 0x00001380
-#define NV50TCL_STENCIL_BACK_OP_FAIL 0x00001384
-#define NV50TCL_STENCIL_BACK_OP_FAIL_ZERO 0x00000000
-#define NV50TCL_STENCIL_BACK_OP_FAIL_INVERT 0x0000150a
-#define NV50TCL_STENCIL_BACK_OP_FAIL_KEEP 0x00001e00
-#define NV50TCL_STENCIL_BACK_OP_FAIL_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_BACK_OP_FAIL_INCR 0x00001e02
-#define NV50TCL_STENCIL_BACK_OP_FAIL_DECR 0x00001e03
-#define NV50TCL_STENCIL_BACK_OP_FAIL_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_BACK_OP_FAIL_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL 0x00001388
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_ZERO 0x00000000
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INVERT 0x0000150a
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_KEEP 0x00001e00
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INCR 0x00001e02
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_DECR 0x00001e03
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_BACK_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_BACK_OP_ZPASS 0x0000138c
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_ZERO 0x00000000
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_INVERT 0x0000150a
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_KEEP 0x00001e00
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_INCR 0x00001e02
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_DECR 0x00001e03
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_BACK_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC 0x00001390
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_NEVER 0x00000200
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_LESS 0x00000201
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_EQUAL 0x00000202
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_LEQUAL 0x00000203
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GREATER 0x00000204
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_GEQUAL 0x00000206
-#define NV50TCL_STENCIL_BACK_FUNC_FUNC_ALWAYS 0x00000207
-#define NV50TCL_STENCIL_BACK_FUNC_REF 0x00001394
-#define NV50TCL_STENCIL_BACK_MASK 0x00001398
-#define NV50TCL_STENCIL_BACK_FUNC_MASK 0x0000139c
-#define NV50TCL_LINE_WIDTH 0x000013b0
-#define NV50TCL_VP_START_ID 0x0000140c
-#define NV50TCL_GP_START_ID 0x00001410
-#define NV50TCL_FP_START_ID 0x00001414
-#define NV50TCL_POINT_SIZE 0x00001518
-#define NV50TCL_TSC_ADDRESS_HIGH 0x0000155c
-#define NV50TCL_TSC_ADDRESS_LOW 0x00001560
-#define NV50TCL_POLYGON_OFFSET_FACTOR 0x0000156c
-#define NV50TCL_LINE_SMOOTH_ENABLE 0x00001570
-#define NV50TCL_TIC_ADDRESS_HIGH 0x00001574
-#define NV50TCL_TIC_ADDRESS_LOW 0x00001578
-#define NV50TCL_STENCIL_FRONT_ENABLE 0x00001594
-#define NV50TCL_STENCIL_FRONT_OP_FAIL 0x00001598
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_ZERO 0x00000000
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_INVERT 0x0000150a
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_KEEP 0x00001e00
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_INCR 0x00001e02
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_DECR 0x00001e03
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_FRONT_OP_FAIL_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL 0x0000159c
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_ZERO 0x00000000
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INVERT 0x0000150a
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_KEEP 0x00001e00
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INCR 0x00001e02
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_DECR 0x00001e03
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_FRONT_OP_ZFAIL_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS 0x000015a0
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_ZERO 0x00000000
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INVERT 0x0000150a
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_KEEP 0x00001e00
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_REPLACE 0x00001e01
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INCR 0x00001e02
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_DECR 0x00001e03
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_INCR_WRAP 0x00008507
-#define NV50TCL_STENCIL_FRONT_OP_ZPASS_DECR_WRAP 0x00008508
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC 0x000015a4
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_NEVER 0x00000200
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_LESS 0x00000201
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_EQUAL 0x00000202
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_LEQUAL 0x00000203
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GREATER 0x00000204
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_NOTEQUAL 0x00000205
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_GEQUAL 0x00000206
-#define NV50TCL_STENCIL_FRONT_FUNC_FUNC_ALWAYS 0x00000207
-#define NV50TCL_POLYGON_OFFSET_UNITS 0x000015bc
-#define NV50TCL_VERTEX_BEGIN 0x000015dc
-#define NV50TCL_VERTEX_BEGIN_POINTS 0x00000000
-#define NV50TCL_VERTEX_BEGIN_LINES 0x00000001
-#define NV50TCL_VERTEX_BEGIN_LINE_LOOP 0x00000002
-#define NV50TCL_VERTEX_BEGIN_LINE_STRIP 0x00000003
-#define NV50TCL_VERTEX_BEGIN_TRIANGLES 0x00000004
-#define NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP 0x00000005
-#define NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN 0x00000006
-#define NV50TCL_VERTEX_BEGIN_QUADS 0x00000007
-#define NV50TCL_VERTEX_BEGIN_QUAD_STRIP 0x00000008
-#define NV50TCL_VERTEX_BEGIN_POLYGON 0x00000009
-#define NV50TCL_VERTEX_END 0x000015e0
-#define NV50TCL_VERTEX_DATA 0x00001640
-#define NV50TCL_VP_ATTR_EN_0 0x00001650
-#define NV50TCL_VP_ATTR_EN_0_7_SHIFT 28
-#define NV50TCL_VP_ATTR_EN_0_7_MASK 0xf0000000
-#define NV50TCL_VP_ATTR_EN_0_7_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_7_XNNN 0x10000000
-#define NV50TCL_VP_ATTR_EN_0_7_NYNN 0x20000000
-#define NV50TCL_VP_ATTR_EN_0_7_XYNN 0x30000000
-#define NV50TCL_VP_ATTR_EN_0_7_NNZN 0x40000000
-#define NV50TCL_VP_ATTR_EN_0_7_XNZN 0x50000000
-#define NV50TCL_VP_ATTR_EN_0_7_NYZN 0x60000000
-#define NV50TCL_VP_ATTR_EN_0_7_XYZN 0x70000000
-#define NV50TCL_VP_ATTR_EN_0_7_NNNW 0x80000000
-#define NV50TCL_VP_ATTR_EN_0_7_XNNW 0x90000000
-#define NV50TCL_VP_ATTR_EN_0_7_NYNW 0xa0000000
-#define NV50TCL_VP_ATTR_EN_0_7_XYNW 0xb0000000
-#define NV50TCL_VP_ATTR_EN_0_7_NNZW 0xc0000000
-#define NV50TCL_VP_ATTR_EN_0_7_XNZW 0xd0000000
-#define NV50TCL_VP_ATTR_EN_0_7_NYZW 0xe0000000
-#define NV50TCL_VP_ATTR_EN_0_7_XYZW 0xf0000000
-#define NV50TCL_VP_ATTR_EN_0_6_SHIFT 24
-#define NV50TCL_VP_ATTR_EN_0_6_MASK 0x0f000000
-#define NV50TCL_VP_ATTR_EN_0_6_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_6_XNNN 0x01000000
-#define NV50TCL_VP_ATTR_EN_0_6_NYNN 0x02000000
-#define NV50TCL_VP_ATTR_EN_0_6_XYNN 0x03000000
-#define NV50TCL_VP_ATTR_EN_0_6_NNZN 0x04000000
-#define NV50TCL_VP_ATTR_EN_0_6_XNZN 0x05000000
-#define NV50TCL_VP_ATTR_EN_0_6_NYZN 0x06000000
-#define NV50TCL_VP_ATTR_EN_0_6_XYZN 0x07000000
-#define NV50TCL_VP_ATTR_EN_0_6_NNNW 0x08000000
-#define NV50TCL_VP_ATTR_EN_0_6_XNNW 0x09000000
-#define NV50TCL_VP_ATTR_EN_0_6_NYNW 0x0a000000
-#define NV50TCL_VP_ATTR_EN_0_6_XYNW 0x0b000000
-#define NV50TCL_VP_ATTR_EN_0_6_NNZW 0x0c000000
-#define NV50TCL_VP_ATTR_EN_0_6_XNZW 0x0d000000
-#define NV50TCL_VP_ATTR_EN_0_6_NYZW 0x0e000000
-#define NV50TCL_VP_ATTR_EN_0_6_XYZW 0x0f000000
-#define NV50TCL_VP_ATTR_EN_0_5_SHIFT 20
-#define NV50TCL_VP_ATTR_EN_0_5_MASK 0x00f00000
-#define NV50TCL_VP_ATTR_EN_0_5_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_5_XNNN 0x00100000
-#define NV50TCL_VP_ATTR_EN_0_5_NYNN 0x00200000
-#define NV50TCL_VP_ATTR_EN_0_5_XYNN 0x00300000
-#define NV50TCL_VP_ATTR_EN_0_5_NNZN 0x00400000
-#define NV50TCL_VP_ATTR_EN_0_5_XNZN 0x00500000
-#define NV50TCL_VP_ATTR_EN_0_5_NYZN 0x00600000
-#define NV50TCL_VP_ATTR_EN_0_5_XYZN 0x00700000
-#define NV50TCL_VP_ATTR_EN_0_5_NNNW 0x00800000
-#define NV50TCL_VP_ATTR_EN_0_5_XNNW 0x00900000
-#define NV50TCL_VP_ATTR_EN_0_5_NYNW 0x00a00000
-#define NV50TCL_VP_ATTR_EN_0_5_XYNW 0x00b00000
-#define NV50TCL_VP_ATTR_EN_0_5_NNZW 0x00c00000
-#define NV50TCL_VP_ATTR_EN_0_5_XNZW 0x00d00000
-#define NV50TCL_VP_ATTR_EN_0_5_NYZW 0x00e00000
-#define NV50TCL_VP_ATTR_EN_0_5_XYZW 0x00f00000
-#define NV50TCL_VP_ATTR_EN_0_4_SHIFT 16
-#define NV50TCL_VP_ATTR_EN_0_4_MASK 0x000f0000
-#define NV50TCL_VP_ATTR_EN_0_4_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_4_XNNN 0x00010000
-#define NV50TCL_VP_ATTR_EN_0_4_NYNN 0x00020000
-#define NV50TCL_VP_ATTR_EN_0_4_XYNN 0x00030000
-#define NV50TCL_VP_ATTR_EN_0_4_NNZN 0x00040000
-#define NV50TCL_VP_ATTR_EN_0_4_XNZN 0x00050000
-#define NV50TCL_VP_ATTR_EN_0_4_NYZN 0x00060000
-#define NV50TCL_VP_ATTR_EN_0_4_XYZN 0x00070000
-#define NV50TCL_VP_ATTR_EN_0_4_NNNW 0x00080000
-#define NV50TCL_VP_ATTR_EN_0_4_XNNW 0x00090000
-#define NV50TCL_VP_ATTR_EN_0_4_NYNW 0x000a0000
-#define NV50TCL_VP_ATTR_EN_0_4_XYNW 0x000b0000
-#define NV50TCL_VP_ATTR_EN_0_4_NNZW 0x000c0000
-#define NV50TCL_VP_ATTR_EN_0_4_XNZW 0x000d0000
-#define NV50TCL_VP_ATTR_EN_0_4_NYZW 0x000e0000
-#define NV50TCL_VP_ATTR_EN_0_4_XYZW 0x000f0000
-#define NV50TCL_VP_ATTR_EN_0_3_SHIFT 12
-#define NV50TCL_VP_ATTR_EN_0_3_MASK 0x0000f000
-#define NV50TCL_VP_ATTR_EN_0_3_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_3_XNNN 0x00001000
-#define NV50TCL_VP_ATTR_EN_0_3_NYNN 0x00002000
-#define NV50TCL_VP_ATTR_EN_0_3_XYNN 0x00003000
-#define NV50TCL_VP_ATTR_EN_0_3_NNZN 0x00004000
-#define NV50TCL_VP_ATTR_EN_0_3_XNZN 0x00005000
-#define NV50TCL_VP_ATTR_EN_0_3_NYZN 0x00006000
-#define NV50TCL_VP_ATTR_EN_0_3_XYZN 0x00007000
-#define NV50TCL_VP_ATTR_EN_0_3_NNNW 0x00008000
-#define NV50TCL_VP_ATTR_EN_0_3_XNNW 0x00009000
-#define NV50TCL_VP_ATTR_EN_0_3_NYNW 0x0000a000
-#define NV50TCL_VP_ATTR_EN_0_3_XYNW 0x0000b000
-#define NV50TCL_VP_ATTR_EN_0_3_NNZW 0x0000c000
-#define NV50TCL_VP_ATTR_EN_0_3_XNZW 0x0000d000
-#define NV50TCL_VP_ATTR_EN_0_3_NYZW 0x0000e000
-#define NV50TCL_VP_ATTR_EN_0_3_XYZW 0x0000f000
-#define NV50TCL_VP_ATTR_EN_0_2_SHIFT 8
-#define NV50TCL_VP_ATTR_EN_0_2_MASK 0x00000f00
-#define NV50TCL_VP_ATTR_EN_0_2_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_2_XNNN 0x00000100
-#define NV50TCL_VP_ATTR_EN_0_2_NYNN 0x00000200
-#define NV50TCL_VP_ATTR_EN_0_2_XYNN 0x00000300
-#define NV50TCL_VP_ATTR_EN_0_2_NNZN 0x00000400
-#define NV50TCL_VP_ATTR_EN_0_2_XNZN 0x00000500
-#define NV50TCL_VP_ATTR_EN_0_2_NYZN 0x00000600
-#define NV50TCL_VP_ATTR_EN_0_2_XYZN 0x00000700
-#define NV50TCL_VP_ATTR_EN_0_2_NNNW 0x00000800
-#define NV50TCL_VP_ATTR_EN_0_2_XNNW 0x00000900
-#define NV50TCL_VP_ATTR_EN_0_2_NYNW 0x00000a00
-#define NV50TCL_VP_ATTR_EN_0_2_XYNW 0x00000b00
-#define NV50TCL_VP_ATTR_EN_0_2_NNZW 0x00000c00
-#define NV50TCL_VP_ATTR_EN_0_2_XNZW 0x00000d00
-#define NV50TCL_VP_ATTR_EN_0_2_NYZW 0x00000e00
-#define NV50TCL_VP_ATTR_EN_0_2_XYZW 0x00000f00
-#define NV50TCL_VP_ATTR_EN_0_1_SHIFT 4
-#define NV50TCL_VP_ATTR_EN_0_1_MASK 0x000000f0
-#define NV50TCL_VP_ATTR_EN_0_1_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_1_XNNN 0x00000010
-#define NV50TCL_VP_ATTR_EN_0_1_NYNN 0x00000020
-#define NV50TCL_VP_ATTR_EN_0_1_XYNN 0x00000030
-#define NV50TCL_VP_ATTR_EN_0_1_NNZN 0x00000040
-#define NV50TCL_VP_ATTR_EN_0_1_XNZN 0x00000050
-#define NV50TCL_VP_ATTR_EN_0_1_NYZN 0x00000060
-#define NV50TCL_VP_ATTR_EN_0_1_XYZN 0x00000070
-#define NV50TCL_VP_ATTR_EN_0_1_NNNW 0x00000080
-#define NV50TCL_VP_ATTR_EN_0_1_XNNW 0x00000090
-#define NV50TCL_VP_ATTR_EN_0_1_NYNW 0x000000a0
-#define NV50TCL_VP_ATTR_EN_0_1_XYNW 0x000000b0
-#define NV50TCL_VP_ATTR_EN_0_1_NNZW 0x000000c0
-#define NV50TCL_VP_ATTR_EN_0_1_XNZW 0x000000d0
-#define NV50TCL_VP_ATTR_EN_0_1_NYZW 0x000000e0
-#define NV50TCL_VP_ATTR_EN_0_1_XYZW 0x000000f0
-#define NV50TCL_VP_ATTR_EN_0_0_SHIFT 0
-#define NV50TCL_VP_ATTR_EN_0_0_MASK 0x0000000f
-#define NV50TCL_VP_ATTR_EN_0_0_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_0_0_XNNN 0x00000001
-#define NV50TCL_VP_ATTR_EN_0_0_NYNN 0x00000002
-#define NV50TCL_VP_ATTR_EN_0_0_XYNN 0x00000003
-#define NV50TCL_VP_ATTR_EN_0_0_NNZN 0x00000004
-#define NV50TCL_VP_ATTR_EN_0_0_XNZN 0x00000005
-#define NV50TCL_VP_ATTR_EN_0_0_NYZN 0x00000006
-#define NV50TCL_VP_ATTR_EN_0_0_XYZN 0x00000007
-#define NV50TCL_VP_ATTR_EN_0_0_NNNW 0x00000008
-#define NV50TCL_VP_ATTR_EN_0_0_XNNW 0x00000009
-#define NV50TCL_VP_ATTR_EN_0_0_NYNW 0x0000000a
-#define NV50TCL_VP_ATTR_EN_0_0_XYNW 0x0000000b
-#define NV50TCL_VP_ATTR_EN_0_0_NNZW 0x0000000c
-#define NV50TCL_VP_ATTR_EN_0_0_XNZW 0x0000000d
-#define NV50TCL_VP_ATTR_EN_0_0_NYZW 0x0000000e
-#define NV50TCL_VP_ATTR_EN_0_0_XYZW 0x0000000f
-#define NV50TCL_VP_ATTR_EN_1 0x00001654
-#define NV50TCL_VP_ATTR_EN_1_15_SHIFT 28
-#define NV50TCL_VP_ATTR_EN_1_15_MASK 0xf0000000
-#define NV50TCL_VP_ATTR_EN_1_15_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_15_XNNN 0x10000000
-#define NV50TCL_VP_ATTR_EN_1_15_NYNN 0x20000000
-#define NV50TCL_VP_ATTR_EN_1_15_XYNN 0x30000000
-#define NV50TCL_VP_ATTR_EN_1_15_NNZN 0x40000000
-#define NV50TCL_VP_ATTR_EN_1_15_XNZN 0x50000000
-#define NV50TCL_VP_ATTR_EN_1_15_NYZN 0x60000000
-#define NV50TCL_VP_ATTR_EN_1_15_XYZN 0x70000000
-#define NV50TCL_VP_ATTR_EN_1_15_NNNW 0x80000000
-#define NV50TCL_VP_ATTR_EN_1_15_XNNW 0x90000000
-#define NV50TCL_VP_ATTR_EN_1_15_NYNW 0xa0000000
-#define NV50TCL_VP_ATTR_EN_1_15_XYNW 0xb0000000
-#define NV50TCL_VP_ATTR_EN_1_15_NNZW 0xc0000000
-#define NV50TCL_VP_ATTR_EN_1_15_XNZW 0xd0000000
-#define NV50TCL_VP_ATTR_EN_1_15_NYZW 0xe0000000
-#define NV50TCL_VP_ATTR_EN_1_15_XYZW 0xf0000000
-#define NV50TCL_VP_ATTR_EN_1_14_SHIFT 24
-#define NV50TCL_VP_ATTR_EN_1_14_MASK 0x0f000000
-#define NV50TCL_VP_ATTR_EN_1_14_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_14_XNNN 0x01000000
-#define NV50TCL_VP_ATTR_EN_1_14_NYNN 0x02000000
-#define NV50TCL_VP_ATTR_EN_1_14_XYNN 0x03000000
-#define NV50TCL_VP_ATTR_EN_1_14_NNZN 0x04000000
-#define NV50TCL_VP_ATTR_EN_1_14_XNZN 0x05000000
-#define NV50TCL_VP_ATTR_EN_1_14_NYZN 0x06000000
-#define NV50TCL_VP_ATTR_EN_1_14_XYZN 0x07000000
-#define NV50TCL_VP_ATTR_EN_1_14_NNNW 0x08000000
-#define NV50TCL_VP_ATTR_EN_1_14_XNNW 0x09000000
-#define NV50TCL_VP_ATTR_EN_1_14_NYNW 0x0a000000
-#define NV50TCL_VP_ATTR_EN_1_14_XYNW 0x0b000000
-#define NV50TCL_VP_ATTR_EN_1_14_NNZW 0x0c000000
-#define NV50TCL_VP_ATTR_EN_1_14_XNZW 0x0d000000
-#define NV50TCL_VP_ATTR_EN_1_14_NYZW 0x0e000000
-#define NV50TCL_VP_ATTR_EN_1_14_XYZW 0x0f000000
-#define NV50TCL_VP_ATTR_EN_1_13_SHIFT 20
-#define NV50TCL_VP_ATTR_EN_1_13_MASK 0x00f00000
-#define NV50TCL_VP_ATTR_EN_1_13_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_13_XNNN 0x00100000
-#define NV50TCL_VP_ATTR_EN_1_13_NYNN 0x00200000
-#define NV50TCL_VP_ATTR_EN_1_13_XYNN 0x00300000
-#define NV50TCL_VP_ATTR_EN_1_13_NNZN 0x00400000
-#define NV50TCL_VP_ATTR_EN_1_13_XNZN 0x00500000
-#define NV50TCL_VP_ATTR_EN_1_13_NYZN 0x00600000
-#define NV50TCL_VP_ATTR_EN_1_13_XYZN 0x00700000
-#define NV50TCL_VP_ATTR_EN_1_13_NNNW 0x00800000
-#define NV50TCL_VP_ATTR_EN_1_13_XNNW 0x00900000
-#define NV50TCL_VP_ATTR_EN_1_13_NYNW 0x00a00000
-#define NV50TCL_VP_ATTR_EN_1_13_XYNW 0x00b00000
-#define NV50TCL_VP_ATTR_EN_1_13_NNZW 0x00c00000
-#define NV50TCL_VP_ATTR_EN_1_13_XNZW 0x00d00000
-#define NV50TCL_VP_ATTR_EN_1_13_NYZW 0x00e00000
-#define NV50TCL_VP_ATTR_EN_1_13_XYZW 0x00f00000
-#define NV50TCL_VP_ATTR_EN_1_12_SHIFT 16
-#define NV50TCL_VP_ATTR_EN_1_12_MASK 0x000f0000
-#define NV50TCL_VP_ATTR_EN_1_12_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_12_XNNN 0x00010000
-#define NV50TCL_VP_ATTR_EN_1_12_NYNN 0x00020000
-#define NV50TCL_VP_ATTR_EN_1_12_XYNN 0x00030000
-#define NV50TCL_VP_ATTR_EN_1_12_NNZN 0x00040000
-#define NV50TCL_VP_ATTR_EN_1_12_XNZN 0x00050000
-#define NV50TCL_VP_ATTR_EN_1_12_NYZN 0x00060000
-#define NV50TCL_VP_ATTR_EN_1_12_XYZN 0x00070000
-#define NV50TCL_VP_ATTR_EN_1_12_NNNW 0x00080000
-#define NV50TCL_VP_ATTR_EN_1_12_XNNW 0x00090000
-#define NV50TCL_VP_ATTR_EN_1_12_NYNW 0x000a0000
-#define NV50TCL_VP_ATTR_EN_1_12_XYNW 0x000b0000
-#define NV50TCL_VP_ATTR_EN_1_12_NNZW 0x000c0000
-#define NV50TCL_VP_ATTR_EN_1_12_XNZW 0x000d0000
-#define NV50TCL_VP_ATTR_EN_1_12_NYZW 0x000e0000
-#define NV50TCL_VP_ATTR_EN_1_12_XYZW 0x000f0000
-#define NV50TCL_VP_ATTR_EN_1_11_SHIFT 12
-#define NV50TCL_VP_ATTR_EN_1_11_MASK 0x0000f000
-#define NV50TCL_VP_ATTR_EN_1_11_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_11_XNNN 0x00001000
-#define NV50TCL_VP_ATTR_EN_1_11_NYNN 0x00002000
-#define NV50TCL_VP_ATTR_EN_1_11_XYNN 0x00003000
-#define NV50TCL_VP_ATTR_EN_1_11_NNZN 0x00004000
-#define NV50TCL_VP_ATTR_EN_1_11_XNZN 0x00005000
-#define NV50TCL_VP_ATTR_EN_1_11_NYZN 0x00006000
-#define NV50TCL_VP_ATTR_EN_1_11_XYZN 0x00007000
-#define NV50TCL_VP_ATTR_EN_1_11_NNNW 0x00008000
-#define NV50TCL_VP_ATTR_EN_1_11_XNNW 0x00009000
-#define NV50TCL_VP_ATTR_EN_1_11_NYNW 0x0000a000
-#define NV50TCL_VP_ATTR_EN_1_11_XYNW 0x0000b000
-#define NV50TCL_VP_ATTR_EN_1_11_NNZW 0x0000c000
-#define NV50TCL_VP_ATTR_EN_1_11_XNZW 0x0000d000
-#define NV50TCL_VP_ATTR_EN_1_11_NYZW 0x0000e000
-#define NV50TCL_VP_ATTR_EN_1_11_XYZW 0x0000f000
-#define NV50TCL_VP_ATTR_EN_1_10_SHIFT 8
-#define NV50TCL_VP_ATTR_EN_1_10_MASK 0x00000f00
-#define NV50TCL_VP_ATTR_EN_1_10_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_10_XNNN 0x00000100
-#define NV50TCL_VP_ATTR_EN_1_10_NYNN 0x00000200
-#define NV50TCL_VP_ATTR_EN_1_10_XYNN 0x00000300
-#define NV50TCL_VP_ATTR_EN_1_10_NNZN 0x00000400
-#define NV50TCL_VP_ATTR_EN_1_10_XNZN 0x00000500
-#define NV50TCL_VP_ATTR_EN_1_10_NYZN 0x00000600
-#define NV50TCL_VP_ATTR_EN_1_10_XYZN 0x00000700
-#define NV50TCL_VP_ATTR_EN_1_10_NNNW 0x00000800
-#define NV50TCL_VP_ATTR_EN_1_10_XNNW 0x00000900
-#define NV50TCL_VP_ATTR_EN_1_10_NYNW 0x00000a00
-#define NV50TCL_VP_ATTR_EN_1_10_XYNW 0x00000b00
-#define NV50TCL_VP_ATTR_EN_1_10_NNZW 0x00000c00
-#define NV50TCL_VP_ATTR_EN_1_10_XNZW 0x00000d00
-#define NV50TCL_VP_ATTR_EN_1_10_NYZW 0x00000e00
-#define NV50TCL_VP_ATTR_EN_1_10_XYZW 0x00000f00
-#define NV50TCL_VP_ATTR_EN_1_9_SHIFT 4
-#define NV50TCL_VP_ATTR_EN_1_9_MASK 0x000000f0
-#define NV50TCL_VP_ATTR_EN_1_9_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_9_XNNN 0x00000010
-#define NV50TCL_VP_ATTR_EN_1_9_NYNN 0x00000020
-#define NV50TCL_VP_ATTR_EN_1_9_XYNN 0x00000030
-#define NV50TCL_VP_ATTR_EN_1_9_NNZN 0x00000040
-#define NV50TCL_VP_ATTR_EN_1_9_XNZN 0x00000050
-#define NV50TCL_VP_ATTR_EN_1_9_NYZN 0x00000060
-#define NV50TCL_VP_ATTR_EN_1_9_XYZN 0x00000070
-#define NV50TCL_VP_ATTR_EN_1_9_NNNW 0x00000080
-#define NV50TCL_VP_ATTR_EN_1_9_XNNW 0x00000090
-#define NV50TCL_VP_ATTR_EN_1_9_NYNW 0x000000a0
-#define NV50TCL_VP_ATTR_EN_1_9_XYNW 0x000000b0
-#define NV50TCL_VP_ATTR_EN_1_9_NNZW 0x000000c0
-#define NV50TCL_VP_ATTR_EN_1_9_XNZW 0x000000d0
-#define NV50TCL_VP_ATTR_EN_1_9_NYZW 0x000000e0
-#define NV50TCL_VP_ATTR_EN_1_9_XYZW 0x000000f0
-#define NV50TCL_VP_ATTR_EN_1_8_SHIFT 0
-#define NV50TCL_VP_ATTR_EN_1_8_MASK 0x0000000f
-#define NV50TCL_VP_ATTR_EN_1_8_NONE 0x00000000
-#define NV50TCL_VP_ATTR_EN_1_8_XNNN 0x00000001
-#define NV50TCL_VP_ATTR_EN_1_8_NYNN 0x00000002
-#define NV50TCL_VP_ATTR_EN_1_8_XYNN 0x00000003
-#define NV50TCL_VP_ATTR_EN_1_8_NNZN 0x00000004
-#define NV50TCL_VP_ATTR_EN_1_8_XNZN 0x00000005
-#define NV50TCL_VP_ATTR_EN_1_8_NYZN 0x00000006
-#define NV50TCL_VP_ATTR_EN_1_8_XYZN 0x00000007
-#define NV50TCL_VP_ATTR_EN_1_8_NNNW 0x00000008
-#define NV50TCL_VP_ATTR_EN_1_8_XNNW 0x00000009
-#define NV50TCL_VP_ATTR_EN_1_8_NYNW 0x0000000a
-#define NV50TCL_VP_ATTR_EN_1_8_XYNW 0x0000000b
-#define NV50TCL_VP_ATTR_EN_1_8_NNZW 0x0000000c
-#define NV50TCL_VP_ATTR_EN_1_8_XNZW 0x0000000d
-#define NV50TCL_VP_ATTR_EN_1_8_NYZW 0x0000000e
-#define NV50TCL_VP_ATTR_EN_1_8_XYZW 0x0000000f
-#define NV50TCL_LINE_STIPPLE_ENABLE 0x0000166c
-#define NV50TCL_LINE_STIPPLE_PATTERN 0x00001680
-#define NV50TCL_POLYGON_STIPPLE_ENABLE 0x0000168c
-#define NV50TCL_VP_REG_HPOS 0x000016bc
-#define NV50TCL_VP_REG_HPOS_X_SHIFT 0
-#define NV50TCL_VP_REG_HPOS_X_MASK 0x000000ff
-#define NV50TCL_VP_REG_HPOS_Y_SHIFT 8
-#define NV50TCL_VP_REG_HPOS_Y_MASK 0x0000ff00
-#define NV50TCL_VP_REG_HPOS_Z_SHIFT 16
-#define NV50TCL_VP_REG_HPOS_Z_MASK 0x00ff0000
-#define NV50TCL_VP_REG_HPOS_W_SHIFT 24
-#define NV50TCL_VP_REG_HPOS_W_MASK 0xff000000
-#define NV50TCL_VP_REG_COL0 0x000016c0
-#define NV50TCL_VP_REG_COL0_X_SHIFT 0
-#define NV50TCL_VP_REG_COL0_X_MASK 0x000000ff
-#define NV50TCL_VP_REG_COL0_Y_SHIFT 8
-#define NV50TCL_VP_REG_COL0_Y_MASK 0x0000ff00
-#define NV50TCL_VP_REG_COL0_Z_SHIFT 16
-#define NV50TCL_VP_REG_COL0_Z_MASK 0x00ff0000
-#define NV50TCL_VP_REG_COL0_W_SHIFT 24
-#define NV50TCL_VP_REG_COL0_W_MASK 0xff000000
-#define NV50TCL_POLYGON_STIPPLE_PATTERN(x) (0x00001700+((x)*4))
-#define NV50TCL_POLYGON_STIPPLE_PATTERN__SIZE 0x00000020
-#define NV50TCL_CULL_FACE_ENABLE 0x00001918
-#define NV50TCL_FRONT_FACE 0x0000191c
-#define NV50TCL_FRONT_FACE_CW 0x00000900
-#define NV50TCL_FRONT_FACE_CCW 0x00000901
-#define NV50TCL_CULL_FACE 0x00001920
-#define NV50TCL_CULL_FACE_FRONT 0x00000404
-#define NV50TCL_CULL_FACE_BACK 0x00000405
-#define NV50TCL_CULL_FACE_FRONT_AND_BACK 0x00000408
-#define NV50TCL_LOGIC_OP_ENABLE 0x000019c4
-#define NV50TCL_LOGIC_OP 0x000019c8
-#define NV50TCL_LOGIC_OP_CLEAR 0x00001500
-#define NV50TCL_LOGIC_OP_AND 0x00001501
-#define NV50TCL_LOGIC_OP_AND_REVERSE 0x00001502
-#define NV50TCL_LOGIC_OP_COPY 0x00001503
-#define NV50TCL_LOGIC_OP_AND_INVERTED 0x00001504
-#define NV50TCL_LOGIC_OP_NOOP 0x00001505
-#define NV50TCL_LOGIC_OP_XOR 0x00001506
-#define NV50TCL_LOGIC_OP_OR 0x00001507
-#define NV50TCL_LOGIC_OP_NOR 0x00001508
-#define NV50TCL_LOGIC_OP_EQUIV 0x00001509
-#define NV50TCL_LOGIC_OP_INVERT 0x0000150a
-#define NV50TCL_LOGIC_OP_OR_REVERSE 0x0000150b
-#define NV50TCL_LOGIC_OP_COPY_INVERTED 0x0000150c
-#define NV50TCL_LOGIC_OP_OR_INVERTED 0x0000150d
-#define NV50TCL_LOGIC_OP_NAND 0x0000150e
-#define NV50TCL_LOGIC_OP_SET 0x0000150f
-#define NV50TCL_CLEAR_BUFFERS 0x000019d0
-#define NV50TCL_COLOR_MASK(x) (0x00001a00+((x)*4))
-#define NV50TCL_COLOR_MASK__SIZE 0x00000008
-#define NV50TCL_COLOR_MASK_R_SHIFT 0
-#define NV50TCL_COLOR_MASK_R_MASK 0x0000000f
-#define NV50TCL_COLOR_MASK_G_SHIFT 4
-#define NV50TCL_COLOR_MASK_G_MASK 0x000000f0
-#define NV50TCL_COLOR_MASK_B_SHIFT 8
-#define NV50TCL_COLOR_MASK_B_MASK 0x00000f00
-#define NV50TCL_COLOR_MASK_A_SHIFT 12
-#define NV50TCL_COLOR_MASK_A_MASK 0x0000f000
-
-
-#define NV50_COMPUTE 0x000050c0
-
-#define NV50_COMPUTE_DMA_UNK0 0x000001a0
-#define NV50_COMPUTE_DMA_STATUS 0x000001a4
-#define NV50_COMPUTE_DMA_UNK1 0x000001b8
-#define NV50_COMPUTE_DMA_UNK2 0x000001bc
-#define NV50_COMPUTE_DMA_UNK3 0x000001c0
-#define NV50_COMPUTE_UNK4_HIGH 0x00000210
-#define NV50_COMPUTE_UNK4_LOW 0x00000214
-#define NV50_COMPUTE_UNK5_HIGH 0x00000218
-#define NV50_COMPUTE_UNK5_LOW 0x0000021c
-#define NV50_COMPUTE_UNK6_HIGH 0x00000294
-#define NV50_COMPUTE_UNK6_LOW 0x00000298
-#define NV50_COMPUTE_CONST_BASE_HIGH 0x000002a4
-#define NV50_COMPUTE_CONST_BASE_LO 0x000002a8
-#define NV50_COMPUTE_CONST_SIZE_SEG 0x000002ac
-#define NV50_COMPUTE_REG_COUNT 0x000002c0
-#define NV50_COMPUTE_STATUS_HIGH 0x00000310
-#define NV50_COMPUTE_STATUS_LOW 0x00000314
-#define NV50_COMPUTE_EXECUTE 0x0000031c
-#define NV50_COMPUTE_USER_PARAM_COUNT 0x00000374
-#define NV50_COMPUTE_GRIDDIM_YX 0x000003a4
-#define NV50_COMPUTE_SHARED_SIZE 0x000003a8
-#define NV50_COMPUTE_BLOCKDIM_YX 0x000003ac
-#define NV50_COMPUTE_BLOCKDIM_Z 0x000003b0
-#define NV50_COMPUTE_CALL_ADDRESS 0x000003b4
-#define NV50_COMPUTE_GLOBAL_BASE_HIGH(x) (0x00000400+((x)*32))
-#define NV50_COMPUTE_GLOBAL_BASE_HIGH__SIZE 0x00000010
-#define NV50_COMPUTE_GLOBAL_BASE_LOW(x) (0x00000404+((x)*32))
-#define NV50_COMPUTE_GLOBAL_BASE_LOW__SIZE 0x00000010
-#define NV50_COMPUTE_GLOBAL_LIMIT_HIGH(x) (0x00000408+((x)*32))
-#define NV50_COMPUTE_GLOBAL_LIMIT_HIGH__SIZE 0x00000010
-#define NV50_COMPUTE_GLOBAL_LIMIT_LOW(x) (0x0000040c+((x)*32))
-#define NV50_COMPUTE_GLOBAL_LIMIT_LOW__SIZE 0x00000010
-#define NV50_COMPUTE_GLOBAL_UNK(x) (0x00000410+((x)*32))
-#define NV50_COMPUTE_GLOBAL_UNK__SIZE 0x00000010
-#define NV50_COMPUTE_USER_PARAM(x) (0x00000600+((x)*4))
-#define NV50_COMPUTE_USER_PARAM__SIZE 0x00000040
-
-
-#define NV54TCL 0x00008297
-
-
-
-#endif /* NOUVEAU_REG_H */
diff --git a/src/gallium/drivers/nouveau/nouveau_device.h b/src/gallium/drivers/nouveau/nouveau_device.h
deleted file mode 100644
index e25e89fedd..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_device.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_DEVICE_H__
-#define __NOUVEAU_DEVICE_H__
-
-struct nouveau_device {
- unsigned chipset;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_grobj.h b/src/gallium/drivers/nouveau/nouveau_grobj.h
deleted file mode 100644
index 8f5abf9051..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_grobj.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_GROBJ_H__
-#define __NOUVEAU_GROBJ_H__
-
-#include "nouveau_channel.h"
-
-struct nouveau_grobj {
- struct nouveau_channel *channel;
- int grclass;
- uint32_t handle;
- int subc;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_notifier.h b/src/gallium/drivers/nouveau/nouveau_notifier.h
deleted file mode 100644
index 35adde1e32..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_notifier.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_NOTIFIER_H__
-#define __NOUVEAU_NOTIFIER_H__
-
-#define NV_NOTIFIER_SIZE 32
-#define NV_NOTIFY_TIME_0 0x00000000
-#define NV_NOTIFY_TIME_1 0x00000004
-#define NV_NOTIFY_RETURN_VALUE 0x00000008
-#define NV_NOTIFY_STATE 0x0000000C
-#define NV_NOTIFY_STATE_STATUS_MASK 0xFF000000
-#define NV_NOTIFY_STATE_STATUS_SHIFT 24
-#define NV_NOTIFY_STATE_STATUS_COMPLETED 0x00
-#define NV_NOTIFY_STATE_STATUS_IN_PROCESS 0x01
-#define NV_NOTIFY_STATE_ERROR_CODE_MASK 0x0000FFFF
-#define NV_NOTIFY_STATE_ERROR_CODE_SHIFT 0
-
-struct nouveau_notifier {
- struct nouveau_channel *channel;
- uint32_t handle;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_pushbuf.h b/src/gallium/drivers/nouveau/nouveau_pushbuf.h
deleted file mode 100644
index 1909765098..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_pushbuf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_PUSHBUF_H__
-#define __NOUVEAU_PUSHBUF_H__
-
-struct nouveau_pushbuf {
- struct nouveau_channel *channel;
- unsigned remaining;
- uint32_t *cur;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_resource.h b/src/gallium/drivers/nouveau/nouveau_resource.h
deleted file mode 100644
index 1af7961d30..0000000000
--- a/src/gallium/drivers/nouveau/nouveau_resource.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_RESOURCE_H__
-#define __NOUVEAU_RESOURCE_H__
-
-struct nouveau_resource {
- struct nouveau_resource *prev;
- struct nouveau_resource *next;
-
- int in_use;
- void *priv;
-
- unsigned int start;
- unsigned int size;
-};
-
-#endif
diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h
index 729988b095..4ae4ff4940 100644
--- a/src/gallium/drivers/nouveau/nouveau_stateobj.h
+++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h
@@ -147,8 +147,9 @@ so_emit_reloc_markers(struct nouveau_winsys *nvws, struct nouveau_stateobj *so)
struct nouveau_stateobj_reloc *r = &so->reloc[i];
nvws->push_reloc(nvws, pb->cur++, r->bo, r->packet,
- (r->flags &
- (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) |
+ (r->flags & (NOUVEAU_BO_VRAM |
+ NOUVEAU_BO_GART |
+ NOUVEAU_BO_RDWR)) |
NOUVEAU_BO_DUMMY, 0, 0);
nvws->push_reloc(nvws, pb->cur++, r->bo, r->data,
r->flags | NOUVEAU_BO_DUMMY, r->vor, r->tor);
diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index 25e0b05be1..b86c4b9338 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -50,13 +50,15 @@ struct nouveau_winsys {
uint32_t (*notifier_status)(struct nouveau_notifier *, int id);
uint32_t (*notifier_retval)(struct nouveau_notifier *, int id);
int (*notifier_wait)(struct nouveau_notifier *, int id,
- int status, int timeout);
+ int status, double timeout);
int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *,
unsigned, unsigned, struct pipe_surface *,
unsigned, unsigned, unsigned, unsigned);
int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *,
unsigned, unsigned, unsigned, unsigned, unsigned);
+
+ struct nouveau_bo *(*get_bo)(struct pipe_buffer *);
};
extern struct pipe_screen *
diff --git a/src/gallium/drivers/nv04/Makefile b/src/gallium/drivers/nv04/Makefile
index 5ea51a2f42..4ed62dae95 100644
--- a/src/gallium/drivers/nv04/Makefile
+++ b/src/gallium/drivers/nv04/Makefile
@@ -4,6 +4,7 @@ include $(TOP)/configs/current
LIBNAME = nv04
DRIVER_SOURCES = \
+ nv04_surface_2d.c \
nv04_clear.c \
nv04_context.c \
nv04_fragprog.c \
diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c
index 0575dc0afc..993c5ef5dd 100644
--- a/src/gallium/drivers/nv04/nv04_miptree.c
+++ b/src/gallium/drivers/nv04/nv04_miptree.c
@@ -69,6 +69,31 @@ nv04_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
return &mt->base;
}
+static struct pipe_texture *
+nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv04_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv04_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].pitch = stride[0];
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
static void
nv04_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt)
{
@@ -144,6 +169,7 @@ void
nv04_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv04_miptree_create;
+ pscreen->texture_blanket = nv04_miptree_blanket;
pscreen->texture_release = nv04_miptree_release;
pscreen->get_tex_surface = nv04_miptree_surface_new;
pscreen->tex_surface_release = nv04_miptree_surface_del;
diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c
index e5e3d4772a..9ef38bc244 100644
--- a/src/gallium/drivers/nv04/nv04_screen.c
+++ b/src/gallium/drivers/nv04/nv04_screen.c
@@ -149,10 +149,19 @@ nv04_screen_destroy(struct pipe_screen *pscreen)
nvws->notifier_free(&screen->sync);
nvws->grobj_free(&screen->fahrenheit);
+ nv04_surface_2d_takedown(&screen->eng2d);
FREE(pscreen);
}
+static struct pipe_buffer *
+nv04_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv04_miptree *mt = (struct nv04_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
struct pipe_screen *
nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
@@ -181,6 +190,10 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
}
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv04_surface_buffer;
+
/* 3D object */
ret = nvws->grobj_alloc(nvws, fahrenheit_class, &screen->fahrenheit);
if (ret) {
diff --git a/src/gallium/drivers/nv04/nv04_screen.h b/src/gallium/drivers/nv04/nv04_screen.h
index 99a49cdf7a..540aec907b 100644
--- a/src/gallium/drivers/nv04/nv04_screen.h
+++ b/src/gallium/drivers/nv04/nv04_screen.h
@@ -2,6 +2,7 @@
#define __NV04_SCREEN_H__
#include "pipe/p_screen.h"
+#include "nv04_surface_2d.h"
struct nv04_screen {
struct pipe_screen pipe;
@@ -10,6 +11,7 @@ struct nv04_screen {
unsigned chipset;
/* HW graphics objects */
+ struct nv04_surface_2d *eng2d;
struct nouveau_grobj *fahrenheit;
struct nouveau_grobj *context_surfaces_3d;
struct nouveau_notifier *sync;
diff --git a/src/gallium/drivers/nv04/nv04_surface.c b/src/gallium/drivers/nv04/nv04_surface.c
index 0d0983f9d4..14abf16679 100644
--- a/src/gallium/drivers/nv04/nv04_surface.c
+++ b/src/gallium/drivers/nv04/nv04_surface.c
@@ -39,10 +39,18 @@ nv04_surface_copy(struct pipe_context *pipe, boolean do_flip,
unsigned width, unsigned height)
{
struct nv04_context *nv04 = nv04_context(pipe);
- struct nouveau_winsys *nvws = nv04->nvws;
+ struct nv04_surface_2d *eng2d = nv04->screen->eng2d;
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ if (do_flip) {
+ desty += height;
+ while (height--) {
+ eng2d->copy(eng2d, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
+ }
+ return;
+ }
+
+ eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
}
static void
@@ -51,9 +59,9 @@ nv04_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv04_context *nv04 = nv04_context(pipe);
- struct nouveau_winsys *nvws = nv04->nvws;
+ struct nv04_surface_2d *eng2d = nv04->screen->eng2d;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ eng2d->fill(eng2d, dest, destx, desty, width, height, value);
}
void
diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c
new file mode 100644
index 0000000000..230cfd17dd
--- /dev/null
+++ b/src/gallium/drivers/nv04/nv04_surface_2d.c
@@ -0,0 +1,448 @@
+#include "pipe/p_context.h"
+#include "pipe/p_format.h"
+#include "util/u_memory.h"
+
+#include "nouveau/nouveau_winsys.h"
+#include "nouveau/nouveau_util.h"
+#include "nv04_surface_2d.h"
+
+static INLINE int
+nv04_surface_format(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A8_UNORM:
+ return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
+ case PIPE_FORMAT_R16_SNORM:
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8;
+ case PIPE_FORMAT_Z24S8_UNORM:
+ return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32;
+ default:
+ return -1;
+ }
+}
+
+static INLINE int
+nv04_rect_format(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A8_UNORM:
+ return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_Z24S8_UNORM:
+ return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
+ default:
+ return -1;
+ }
+}
+
+static INLINE int
+nv04_scaled_image_format(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A1R5G5B5_UNORM:
+ return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8;
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8;
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ case PIPE_FORMAT_R16_SNORM:
+ return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
+ default:
+ return -1;
+ }
+}
+
+static INLINE unsigned
+nv04_swizzle_bits(unsigned x, unsigned y)
+{
+ unsigned u = (x & 0x001) << 0 |
+ (x & 0x002) << 1 |
+ (x & 0x004) << 2 |
+ (x & 0x008) << 3 |
+ (x & 0x010) << 4 |
+ (x & 0x020) << 5 |
+ (x & 0x040) << 6 |
+ (x & 0x080) << 7 |
+ (x & 0x100) << 8 |
+ (x & 0x200) << 9 |
+ (x & 0x400) << 10 |
+ (x & 0x800) << 11;
+
+ unsigned v = (y & 0x001) << 1 |
+ (y & 0x002) << 2 |
+ (y & 0x004) << 3 |
+ (y & 0x008) << 4 |
+ (y & 0x010) << 5 |
+ (y & 0x020) << 6 |
+ (y & 0x040) << 7 |
+ (y & 0x080) << 8 |
+ (y & 0x100) << 9 |
+ (y & 0x200) << 10 |
+ (y & 0x400) << 11 |
+ (y & 0x800) << 12;
+ return v | u;
+}
+
+static int
+nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
+ struct pipe_surface *dst, int dx, int dy,
+ struct pipe_surface *src, int sx, int sy,
+ int w, int h)
+{
+ struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_grobj *swzsurf = ctx->swzsurf;
+ struct nouveau_grobj *sifm = ctx->sifm;
+ struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
+ struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
+ const unsigned max_w = 1024;
+ const unsigned max_h = 1024;
+ const unsigned sub_w = w > max_w ? max_w : w;
+ const unsigned sub_h = h > max_h ? max_h : h;
+ unsigned cx;
+ unsigned cy;
+
+ /* POT or GTFO */
+ assert(!(w & (w - 1)) && !(h & (h - 1)));
+
+ BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1);
+ OUT_RELOCo(chan, dst_bo,
+ NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+
+ BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_FORMAT, 1);
+ OUT_RING (chan, nv04_surface_format(dst->format) |
+ log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT |
+ log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT);
+
+ BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1);
+ OUT_RELOCo(chan, src_bo,
+ NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1);
+ OUT_RING (chan, swzsurf->handle);
+
+ for (cy = 0; cy < h; cy += sub_h) {
+ for (cx = 0; cx < w; cx += sub_w) {
+ BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1);
+ OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) *
+ dst->block.size, NOUVEAU_BO_GART |
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+
+ BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9);
+ OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE);
+ OUT_RING (chan, nv04_scaled_image_format(src->format));
+ OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, sub_h << 16 | sub_w);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, sub_h << 16 | sub_w);
+ OUT_RING (chan, 1 << 20);
+ OUT_RING (chan, 1 << 20);
+
+ BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4);
+ OUT_RING (chan, sub_h << 16 | sub_w);
+ OUT_RING (chan, src->stride |
+ NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER |
+ NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE);
+ OUT_RELOCl(chan, src_bo, src->offset + cy * src->stride +
+ cx * src->block.size, NOUVEAU_BO_GART |
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RING (chan, 0);
+ }
+ }
+
+ return 0;
+}
+
+static int
+nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx,
+ struct pipe_surface *dst, int dx, int dy,
+ struct pipe_surface *src, int sx, int sy, int w, int h)
+{
+ struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_grobj *m2mf = ctx->m2mf;
+ struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
+ struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
+ unsigned dst_offset, src_offset;
+
+ dst_offset = dst->offset + (dy * dst->stride) + (dx * dst->block.size);
+ src_offset = src->offset + (sy * src->stride) + (sx * src->block.size);
+
+ WAIT_RING (chan, 3 + ((h / 2047) + 1) * 9);
+ BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2);
+ OUT_RELOCo(chan, src_bo,
+ NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCo(chan, dst_bo,
+ NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+
+ while (h) {
+ int count = (h > 2047) ? 2047 : h;
+
+ BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
+ OUT_RELOCl(chan, src_bo, src_offset,
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD);
+ OUT_RELOCl(chan, dst_bo, dst_offset,
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR);
+ OUT_RING (chan, src->stride);
+ OUT_RING (chan, dst->stride);
+ OUT_RING (chan, w * src->block.size);
+ OUT_RING (chan, count);
+ OUT_RING (chan, 0x0101);
+ OUT_RING (chan, 0);
+
+ h -= count;
+ src_offset += src->stride * count;
+ dst_offset += dst->stride * count;
+ }
+
+ return 0;
+}
+
+static int
+nv04_surface_copy_blit(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
+ int dx, int dy, struct pipe_surface *src, int sx, int sy,
+ int w, int h)
+{
+ struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_grobj *surf2d = ctx->surf2d;
+ struct nouveau_grobj *blit = ctx->blit;
+ struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
+ struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
+ int format;
+
+ format = nv04_surface_format(dst->format);
+ if (format < 0)
+ return 1;
+
+ WAIT_RING (chan, 12);
+ BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
+ OUT_RELOCo(chan, src_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
+ OUT_RING (chan, format);
+ OUT_RING (chan, (dst->stride << 16) | src->stride);
+ OUT_RELOCl(chan, src_bo, src->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
+ OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+
+ BEGIN_RING(chan, blit, 0x0300, 3);
+ OUT_RING (chan, (sy << 16) | sx);
+ OUT_RING (chan, (dy << 16) | dx);
+ OUT_RING (chan, ( h << 16) | w);
+
+ return 0;
+}
+
+static void
+nv04_surface_copy(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
+ int dx, int dy, struct pipe_surface *src, int sx, int sy,
+ int w, int h)
+{
+ int src_linear = src->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR;
+ int dst_linear = dst->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR;
+
+ assert(src->format == dst->format);
+
+ /* Setup transfer to swizzle the texture to vram if needed */
+ if (src_linear && !dst_linear && w > 1 && h > 1) {
+ nv04_surface_copy_swizzle(ctx, dst, dx, dy, src, sx, sy, w, h);
+ return;
+ }
+
+ /* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback
+ * to NV_MEMORY_TO_MEMORY_FORMAT in this case.
+ */
+ if ((src->offset & 63) || (dst->offset & 63) ||
+ (src->stride & 63) || (dst->stride & 63)) {
+ nv04_surface_copy_m2mf(ctx, dst, dx, dy, src, sx, sy, w, h);
+ return;
+ }
+
+ nv04_surface_copy_blit(ctx, dst, dx, dy, src, sx, sy, w, h);
+}
+
+static void
+nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
+ int dx, int dy, int w, int h, unsigned value)
+{
+ struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_grobj *surf2d = ctx->surf2d;
+ struct nouveau_grobj *rect = ctx->rect;
+ struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
+ int cs2d_format, gdirect_format;
+
+ cs2d_format = nv04_surface_format(dst->format);
+ assert(cs2d_format >= 0);
+
+ gdirect_format = nv04_rect_format(dst->format);
+ assert(gdirect_format >= 0);
+
+ WAIT_RING (chan, 16);
+ BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
+ OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
+ OUT_RING (chan, cs2d_format);
+ OUT_RING (chan, (dst->stride << 16) | dst->stride);
+ OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(chan, dst_bo, dst->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+
+ BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1);
+ OUT_RING (chan, gdirect_format);
+ BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR1_A, 1);
+ OUT_RING (chan, value);
+ BEGIN_RING(chan, rect,
+ NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(0), 2);
+ OUT_RING (chan, (dx << 16) | dy);
+ OUT_RING (chan, ( w << 16) | h);
+}
+
+void
+nv04_surface_2d_takedown(struct nv04_surface_2d **pctx)
+{
+ struct nv04_surface_2d *ctx;
+
+ if (!pctx || !*pctx)
+ return;
+ ctx = *pctx;
+ *pctx = NULL;
+
+ nouveau_notifier_free(&ctx->ntfy);
+ nouveau_grobj_free(&ctx->m2mf);
+ nouveau_grobj_free(&ctx->surf2d);
+ nouveau_grobj_free(&ctx->swzsurf);
+ nouveau_grobj_free(&ctx->rect);
+ nouveau_grobj_free(&ctx->blit);
+ nouveau_grobj_free(&ctx->sifm);
+
+ FREE(ctx);
+}
+
+struct nv04_surface_2d *
+nv04_surface_2d_init(struct nouveau_winsys *nvws)
+{
+ struct nv04_surface_2d *ctx = CALLOC_STRUCT(nv04_surface_2d);
+ struct nouveau_channel *chan = nvws->channel;
+ unsigned handle = 0x88000000, class;
+ int ret;
+
+ if (!ctx)
+ return NULL;
+
+ ret = nouveau_notifier_alloc(chan, handle++, 1, &ctx->ntfy);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ ret = nouveau_grobj_alloc(chan, handle++, 0x0039, &ctx->m2mf);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ BEGIN_RING(chan, ctx->m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1);
+ OUT_RING (chan, ctx->ntfy->handle);
+
+ if (chan->device->chipset < 0x10)
+ class = NV04_CONTEXT_SURFACES_2D;
+ else
+ class = NV10_CONTEXT_SURFACES_2D;
+
+ ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->surf2d);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ BEGIN_RING(chan, ctx->surf2d,
+ NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
+ OUT_RING (chan, chan->vram->handle);
+ OUT_RING (chan, chan->vram->handle);
+
+ if (chan->device->chipset < 0x10)
+ class = NV04_IMAGE_BLIT;
+ else
+ class = NV12_IMAGE_BLIT;
+
+ ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->blit);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_DMA_NOTIFY, 1);
+ OUT_RING (chan, ctx->ntfy->handle);
+ BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_SURFACE, 1);
+ OUT_RING (chan, ctx->surf2d->handle);
+ BEGIN_RING(chan, ctx->blit, NV04_IMAGE_BLIT_OPERATION, 1);
+ OUT_RING (chan, NV04_IMAGE_BLIT_OPERATION_SRCCOPY);
+
+ ret = nouveau_grobj_alloc(chan, handle++, NV04_GDI_RECTANGLE_TEXT,
+ &ctx->rect);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1);
+ OUT_RING (chan, ctx->ntfy->handle);
+ BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1);
+ OUT_RING (chan, ctx->surf2d->handle);
+ BEGIN_RING(chan, ctx->rect, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1);
+ OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY);
+ BEGIN_RING(chan, ctx->rect,
+ NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT, 1);
+ OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE);
+
+ switch (chan->device->chipset & 0xf0) {
+ case 0x00:
+ case 0x10:
+ class = NV04_SWIZZLED_SURFACE;
+ break;
+ case 0x20:
+ class = NV20_SWIZZLED_SURFACE;
+ break;
+ case 0x30:
+ class = NV30_SWIZZLED_SURFACE;
+ break;
+ case 0x40:
+ case 0x60:
+ class = NV40_SWIZZLED_SURFACE;
+ break;
+ default:
+ /* Famous last words: this really can't happen.. */
+ assert(0);
+ break;
+ }
+
+ ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->swzsurf);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ if (chan->device->chipset < 0x10) {
+ class = NV04_SCALED_IMAGE_FROM_MEMORY;
+ } else
+ if (chan->device->chipset < 0x40) {
+ class = NV10_SCALED_IMAGE_FROM_MEMORY;
+ } else {
+ class = NV40_SCALED_IMAGE_FROM_MEMORY;
+ }
+
+ ret = nouveau_grobj_alloc(chan, handle++, class, &ctx->sifm);
+ if (ret) {
+ nv04_surface_2d_takedown(&ctx);
+ return NULL;
+ }
+
+ ctx->nvws = nvws;
+ ctx->copy = nv04_surface_copy;
+ ctx->fill = nv04_surface_fill;
+ return ctx;
+}
diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.h b/src/gallium/drivers/nv04/nv04_surface_2d.h
new file mode 100644
index 0000000000..21b8f86960
--- /dev/null
+++ b/src/gallium/drivers/nv04/nv04_surface_2d.h
@@ -0,0 +1,29 @@
+#ifndef __NV04_SURFACE_2D_H__
+#define __NV04_SURFACE_2D_H__
+
+struct nv04_surface_2d {
+ struct nouveau_winsys *nvws;
+ struct nouveau_notifier *ntfy;
+ struct nouveau_grobj *surf2d;
+ struct nouveau_grobj *swzsurf;
+ struct nouveau_grobj *m2mf;
+ struct nouveau_grobj *rect;
+ struct nouveau_grobj *blit;
+ struct nouveau_grobj *sifm;
+
+ struct pipe_buffer *(*buf)(struct pipe_surface *);
+
+ void (*copy)(struct nv04_surface_2d *, struct pipe_surface *dst,
+ int dx, int dy, struct pipe_surface *src, int sx, int sy,
+ int w, int h);
+ void (*fill)(struct nv04_surface_2d *, struct pipe_surface *dst,
+ int dx, int dy, int w, int h, unsigned value);
+};
+
+struct nv04_surface_2d *
+nv04_surface_2d_init(struct nouveau_winsys *nvws);
+
+void
+nv04_surface_2d_takedown(struct nv04_surface_2d **);
+
+#endif
diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c
index 909278213e..9616135461 100644
--- a/src/gallium/drivers/nv10/nv10_miptree.c
+++ b/src/gallium/drivers/nv10/nv10_miptree.c
@@ -51,6 +51,31 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt)
}
static struct pipe_texture *
+nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv10_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv10_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].pitch = stride[0];
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
+static struct pipe_texture *
nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
@@ -141,6 +166,7 @@ nv10_miptree_surface_release(struct pipe_screen *screen,
void nv10_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv10_miptree_create;
+ pscreen->texture_blanket = nv10_miptree_blanket;
pscreen->texture_release = nv10_miptree_release;
pscreen->get_tex_surface = nv10_miptree_surface_get;
pscreen->tex_surface_release = nv10_miptree_surface_release;
diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c
index 2f945a193c..f417b06c94 100644
--- a/src/gallium/drivers/nv10/nv10_screen.c
+++ b/src/gallium/drivers/nv10/nv10_screen.c
@@ -152,6 +152,14 @@ nv10_screen_destroy(struct pipe_screen *pscreen)
FREE(pscreen);
}
+static struct pipe_buffer *
+nv10_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv10_miptree *mt = (struct nv10_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
struct pipe_screen *
nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
@@ -164,6 +172,10 @@ nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv10_surface_buffer;
+
/* 3D object */
if (chipset>=0x20)
celsius_class=NV11TCL;
diff --git a/src/gallium/drivers/nv10/nv10_screen.h b/src/gallium/drivers/nv10/nv10_screen.h
index 3f8750a13f..60102a369a 100644
--- a/src/gallium/drivers/nv10/nv10_screen.h
+++ b/src/gallium/drivers/nv10/nv10_screen.h
@@ -2,6 +2,7 @@
#define __NV10_SCREEN_H__
#include "pipe/p_screen.h"
+#include "nv04/nv04_surface_2d.h"
struct nv10_screen {
struct pipe_screen pipe;
@@ -9,6 +10,7 @@ struct nv10_screen {
struct nouveau_winsys *nvws;
/* HW graphics objects */
+ struct nv04_surface_2d *eng2d;
struct nouveau_grobj *celsius;
struct nouveau_notifier *sync;
};
diff --git a/src/gallium/drivers/nv10/nv10_surface.c b/src/gallium/drivers/nv10/nv10_surface.c
index 78fd7b42da..2538151063 100644
--- a/src/gallium/drivers/nv10/nv10_surface.c
+++ b/src/gallium/drivers/nv10/nv10_surface.c
@@ -39,10 +39,18 @@ nv10_surface_copy(struct pipe_context *pipe, boolean do_flip,
unsigned width, unsigned height)
{
struct nv10_context *nv10 = nv10_context(pipe);
- struct nouveau_winsys *nvws = nv10->nvws;
+ struct nv04_surface_2d *eng2d = nv10->screen->eng2d;
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ if (do_flip) {
+ desty += height;
+ while (height--) {
+ eng2d->copy(eng2d, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
+ }
+ return;
+ }
+
+ eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
}
static void
@@ -51,9 +59,9 @@ nv10_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv10_context *nv10 = nv10_context(pipe);
- struct nouveau_winsys *nvws = nv10->nvws;
+ struct nv04_surface_2d *eng2d = nv10->screen->eng2d;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ eng2d->fill(eng2d, dest, destx, desty, width, height, value);
}
void
diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c
index 8e4cc80902..ef7e9c5428 100644
--- a/src/gallium/drivers/nv20/nv20_miptree.c
+++ b/src/gallium/drivers/nv20/nv20_miptree.c
@@ -51,10 +51,37 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt)
}
static struct pipe_texture *
+nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv20_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv20_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].pitch = stride[0];
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
+static struct pipe_texture *
nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
struct nv20_miptree *mt;
+ unsigned buf_usage = PIPE_BUFFER_USAGE_PIXEL |
+ NOUVEAU_BUFFER_USAGE_TEXTURE;
mt = MALLOC(sizeof(struct nv20_miptree));
if (!mt)
@@ -63,10 +90,35 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
mt->base.refcount = 1;
mt->base.screen = screen;
+ /* Swizzled textures must be POT */
+ if (pt->width[0] & (pt->width[0] - 1) ||
+ pt->height[0] & (pt->height[0] - 1))
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+ else
+ if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY |
+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET))
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+ else
+ if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC)
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+ else {
+ switch (pt->format) {
+ /* TODO: Figure out which formats can be swizzled */
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ case PIPE_FORMAT_R16_SNORM:
+ break;
+ default:
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+ }
+ }
+
+ if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC)
+ buf_usage |= PIPE_BUFFER_USAGE_CPU_READ_WRITE;
+
nv20_miptree_layout(mt);
- mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
- mt->total_size);
+ mt->buffer = ws->buffer_create(ws, 256, buf_usage, mt->total_size);
if (!mt->buffer) {
FREE(mt);
return NULL;
@@ -146,6 +198,7 @@ nv20_miptree_surface_release(struct pipe_screen *pscreen,
void nv20_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv20_miptree_create;
+ pscreen->texture_blanket = nv20_miptree_blanket;
pscreen->texture_release = nv20_miptree_release;
pscreen->get_tex_surface = nv20_miptree_surface_get;
pscreen->tex_surface_release = nv20_miptree_surface_release;
diff --git a/src/gallium/drivers/nv20/nv20_screen.c b/src/gallium/drivers/nv20/nv20_screen.c
index c9171fa178..5f2b7b4f71 100644
--- a/src/gallium/drivers/nv20/nv20_screen.c
+++ b/src/gallium/drivers/nv20/nv20_screen.c
@@ -152,6 +152,14 @@ nv20_screen_destroy(struct pipe_screen *pscreen)
FREE(pscreen);
}
+static struct pipe_buffer *
+nv20_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv20_miptree *mt = (struct nv20_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
struct pipe_screen *
nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
@@ -164,6 +172,10 @@ nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv20_surface_buffer;
+
/* 3D object */
if (chipset >= 0x25)
kelvin_class = NV25TCL;
diff --git a/src/gallium/drivers/nv20/nv20_screen.h b/src/gallium/drivers/nv20/nv20_screen.h
index 8f2f2e341d..bf2f2c0d9f 100644
--- a/src/gallium/drivers/nv20/nv20_screen.h
+++ b/src/gallium/drivers/nv20/nv20_screen.h
@@ -2,6 +2,7 @@
#define __NV20_SCREEN_H__
#include "pipe/p_screen.h"
+#include "nv04/nv04_surface_2d.h"
struct nv20_screen {
struct pipe_screen pipe;
@@ -9,6 +10,7 @@ struct nv20_screen {
struct nouveau_winsys *nvws;
/* HW graphics objects */
+ struct nv04_surface_2d *eng2d;
struct nouveau_grobj *kelvin;
struct nouveau_notifier *sync;
};
diff --git a/src/gallium/drivers/nv20/nv20_surface.c b/src/gallium/drivers/nv20/nv20_surface.c
index 9b4c028eae..6cd607583c 100644
--- a/src/gallium/drivers/nv20/nv20_surface.c
+++ b/src/gallium/drivers/nv20/nv20_surface.c
@@ -39,10 +39,18 @@ nv20_surface_copy(struct pipe_context *pipe, boolean do_flip,
unsigned width, unsigned height)
{
struct nv20_context *nv20 = nv20_context(pipe);
- struct nouveau_winsys *nvws = nv20->nvws;
+ struct nv04_surface_2d *eng2d = nv20->screen->eng2d;
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ if (do_flip) {
+ desty += height;
+ while (height--) {
+ eng2d->copy(eng2d, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
+ }
+ return;
+ }
+
+ eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
}
static void
@@ -51,9 +59,9 @@ nv20_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv20_context *nv20 = nv20_context(pipe);
- struct nouveau_winsys *nvws = nv20->nvws;
+ struct nv04_surface_2d *eng2d = nv20->screen->eng2d;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ eng2d->fill(eng2d, dest, destx, desty, width, height, value);
}
void
diff --git a/src/gallium/drivers/nv20/nv20_vertprog.c b/src/gallium/drivers/nv20/nv20_vertprog.c
index a885fcd7a5..5db0e807ff 100644
--- a/src/gallium/drivers/nv20/nv20_vertprog.c
+++ b/src/gallium/drivers/nv20/nv20_vertprog.c
@@ -613,7 +613,7 @@ nv20_vertprog_translate(struct nv20_context *nv20,
imm = &parse.FullToken.FullImmediate;
assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32);
-// assert(imm->Immediate.Size == 4);
+ assert(imm->Immediate.NrTokens == 4 + 1);
vpc->imm[vpc->nr_imm++] =
constant(vpc, -1,
imm->u.ImmediateFloat32[0].Float,
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index c55756971b..b11ed8c24e 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -8,10 +8,14 @@ static void
nv30_miptree_layout(struct nv30_miptree *nv30mt)
{
struct pipe_texture *pt = &nv30mt->base;
- boolean swizzled = FALSE;
uint width = pt->width[0], height = pt->height[0], depth = pt->depth[0];
uint offset = 0;
- int nr_faces, l, f, pitch;
+ int nr_faces, l, f;
+ uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL |
+ PIPE_TEXTURE_USAGE_RENDER_TARGET |
+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+ PIPE_TEXTURE_USAGE_PRIMARY);
if (pt->target == PIPE_TEXTURE_CUBE) {
nr_faces = 6;
@@ -22,7 +26,6 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
nr_faces = 1;
}
- pitch = pt->width[0];
for (l = 0; l <= pt->last_level; l++) {
pt->width[l] = width;
pt->height[l] = height;
@@ -30,11 +33,11 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
- if (swizzled)
- pitch = pt->nblocksx[l];
- pitch = align(pitch, 64);
+ if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
+ nv30mt->level[l].pitch = align(pt->width[0] * pt->block.size, 64);
+ else
+ nv30mt->level[l].pitch = pt->width[l] * pt->block.size;
- nv30mt->level[l].pitch = pitch * pt->block.size;
nv30mt->level[l].image_offset =
CALLOC(nr_faces, sizeof(unsigned));
@@ -44,10 +47,18 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
}
for (f = 0; f < nr_faces; f++) {
- for (l = 0; l <= pt->last_level; l++) {
+ for (l = 0; l < pt->last_level; l++) {
nv30mt->level[l].image_offset[f] = offset;
- offset += nv30mt->level[l].pitch * pt->height[l];
+
+ if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) &&
+ pt->width[l + 1] > 1 && pt->height[l + 1] > 1)
+ offset += align(nv30mt->level[l].pitch * pt->height[l], 64);
+ else
+ offset += nv30mt->level[l].pitch * pt->height[l];
}
+
+ nv30mt->level[l].image_offset[f] = offset;
+ offset += nv30mt->level[l].pitch * pt->height[l];
}
nv30mt->total_size = offset;
@@ -74,7 +85,8 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
else
if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY |
- PIPE_TEXTURE_USAGE_DISPLAY_TARGET))
+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL))
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
else
if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC)
@@ -85,7 +97,11 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_X8R8G8B8_UNORM:
case PIPE_FORMAT_R16_SNORM:
- break;
+ {
+ if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE))
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+ break;
+ }
default:
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
}
@@ -105,6 +121,31 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
return &mt->base;
}
+static struct pipe_texture *
+nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv30_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv30_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].pitch = stride[0];
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
static void
nv30_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt)
{
@@ -123,8 +164,8 @@ nv30_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt)
}
if (mt->shadow_tex) {
- assert(mt->shadow_surface);
- pscreen->tex_surface_release(pscreen, &mt->shadow_surface);
+ if (mt->shadow_surface)
+ pscreen->tex_surface_release(pscreen, &mt->shadow_surface);
nv30_miptree_release(pscreen, &mt->shadow_tex);
}
@@ -187,6 +228,7 @@ void
nv30_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv30_miptree_create;
+ pscreen->texture_blanket = nv30_miptree_blanket;
pscreen->texture_release = nv30_miptree_release;
pscreen->get_tex_surface = nv30_miptree_surface_new;
pscreen->tex_surface_release = nv30_miptree_surface_del;
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c
index 9738436dc4..c97a73f0b1 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -127,6 +127,14 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
return FALSE;
}
+static struct pipe_buffer *
+nv30_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv30_miptree *mt = (struct nv30_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
static void *
nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
unsigned flags )
@@ -134,7 +142,6 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
struct pipe_winsys *ws = screen->winsys;
struct pipe_surface *surface_to_map;
void *map;
- struct nv30_miptree *nv30mt = (struct nv30_miptree *)surface->texture;
if (!(surface->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) {
struct nv30_miptree *mt = (struct nv30_miptree *)surface->texture;
@@ -163,7 +170,7 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
assert(surface_to_map);
- map = ws->buffer_map(ws, nv30mt->buffer, flags);
+ map = ws->buffer_map(ws, nv30_surface_buffer(surface_to_map), flags);
if (!map)
return NULL;
@@ -175,7 +182,6 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
{
struct pipe_winsys *ws = screen->winsys;
struct pipe_surface *surface_to_unmap;
- struct nv30_miptree *nv30mt = (struct nv30_miptree *)surface->texture;
/* TODO: Copy from shadow just before push buffer is flushed instead.
There are probably some programs that map/unmap excessively
@@ -192,15 +198,16 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
assert(surface_to_unmap);
- ws->buffer_unmap(ws, nv30mt->buffer);
+ ws->buffer_unmap(ws, nv30_surface_buffer(surface_to_unmap));
if (surface_to_unmap != surface) {
struct nv30_screen *nvscreen = nv30_screen(screen);
- nvscreen->nvws->surface_copy(nvscreen->nvws,
- surface, 0, 0,
- surface_to_unmap, 0, 0,
- surface->width, surface->height);
+ nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0,
+ surface_to_unmap, 0, 0,
+ surface->width, surface->height);
+
+ screen->tex_surface_release(screen, &surface_to_unmap);
}
}
@@ -233,6 +240,10 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv30_surface_buffer;
+
/* 3D object */
switch (chipset & 0xf0) {
case 0x30:
diff --git a/src/gallium/drivers/nv30/nv30_screen.h b/src/gallium/drivers/nv30/nv30_screen.h
index b7ddc2a959..b11e470f94 100644
--- a/src/gallium/drivers/nv30/nv30_screen.h
+++ b/src/gallium/drivers/nv30/nv30_screen.h
@@ -2,6 +2,7 @@
#define __NV30_SCREEN_H__
#include "pipe/p_screen.h"
+#include "nv04/nv04_surface_2d.h"
struct nv30_screen {
struct pipe_screen pipe;
@@ -11,6 +12,7 @@ struct nv30_screen {
unsigned cur_pctx;
/* HW graphics objects */
+ struct nv04_surface_2d *eng2d;
struct nouveau_grobj *rankine;
struct nouveau_notifier *sync;
diff --git a/src/gallium/drivers/nv30/nv30_surface.c b/src/gallium/drivers/nv30/nv30_surface.c
index 806131dcc9..0f8dc12045 100644
--- a/src/gallium/drivers/nv30/nv30_surface.c
+++ b/src/gallium/drivers/nv30/nv30_surface.c
@@ -30,7 +30,6 @@
#include "pipe/p_defines.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
-
#include "util/u_tile.h"
static void
@@ -40,22 +39,18 @@ nv30_surface_copy(struct pipe_context *pipe, boolean do_flip,
unsigned width, unsigned height)
{
struct nv30_context *nv30 = nv30_context(pipe);
- struct nouveau_winsys *nvws = nv30->nvws;
+ struct nv04_surface_2d *eng2d = nv30->screen->eng2d;
if (do_flip) {
- /*XXX: This dodgyness will do for now for correctness. But,
- * need to investigate whether the 2D engine is able to
- * manage a flip (perhaps SIFM?), if not, use the 3D engine
- */
desty += height;
while (height--) {
- nvws->surface_copy(nvws, dest, destx, desty--, src,
- srcx, srcy++, width, 1);
+ eng2d->copy(eng2d, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
}
- } else {
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ return;
}
+
+ eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
}
static void
@@ -64,9 +59,9 @@ nv30_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv30_context *nv30 = nv30_context(pipe);
- struct nouveau_winsys *nvws = nv30->nvws;
+ struct nv04_surface_2d *eng2d = nv30->screen->eng2d;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ eng2d->fill(eng2d, dest, destx, desty, width, height, value);
}
void
diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c
index 72824559e8..d262725057 100644
--- a/src/gallium/drivers/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nv30/nv30_vertprog.c
@@ -613,7 +613,7 @@ nv30_vertprog_translate(struct nv30_context *nv30,
imm = &parse.FullToken.FullImmediate;
assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32);
-// assert(imm->Immediate.Size == 4);
+ assert(imm->Immediate.NrTokens == 4 + 1);
vpc->imm[vpc->nr_imm++] =
constant(vpc, -1,
imm->u.ImmediateFloat32[0].Float,
diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c
index b1fba11d2f..e38b1e7f5c 100644
--- a/src/gallium/drivers/nv40/nv40_miptree.c
+++ b/src/gallium/drivers/nv40/nv40_miptree.c
@@ -10,7 +10,12 @@ nv40_miptree_layout(struct nv40_miptree *mt)
struct pipe_texture *pt = &mt->base;
uint width = pt->width[0], height = pt->height[0], depth = pt->depth[0];
uint offset = 0;
- int nr_faces, l, f, pitch;
+ int nr_faces, l, f;
+ uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL |
+ PIPE_TEXTURE_USAGE_RENDER_TARGET |
+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+ PIPE_TEXTURE_USAGE_PRIMARY);
if (pt->target == PIPE_TEXTURE_CUBE) {
nr_faces = 6;
@@ -21,7 +26,6 @@ nv40_miptree_layout(struct nv40_miptree *mt)
nr_faces = 1;
}
- pitch = pt->width[0];
for (l = 0; l <= pt->last_level; l++) {
pt->width[l] = width;
pt->height[l] = height;
@@ -29,11 +33,11 @@ nv40_miptree_layout(struct nv40_miptree *mt)
pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
- if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
- pitch = pt->nblocksx[l];
- pitch = align(pitch, 64);
+ if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
+ mt->level[l].pitch = align(pt->width[0] * pt->block.size, 64);
+ else
+ mt->level[l].pitch = pt->width[l] * pt->block.size;
- mt->level[l].pitch = pitch * pt->block.size;
mt->level[l].image_offset =
CALLOC(nr_faces, sizeof(unsigned));
@@ -43,10 +47,18 @@ nv40_miptree_layout(struct nv40_miptree *mt)
}
for (f = 0; f < nr_faces; f++) {
- for (l = 0; l <= pt->last_level; l++) {
+ for (l = 0; l < pt->last_level; l++) {
mt->level[l].image_offset[f] = offset;
- offset += mt->level[l].pitch * pt->height[l];
+
+ if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) &&
+ pt->width[l + 1] > 1 && pt->height[l + 1] > 1)
+ offset += align(mt->level[l].pitch * pt->height[l], 64);
+ else
+ offset += mt->level[l].pitch * pt->height[l];
}
+
+ mt->level[l].image_offset[f] = offset;
+ offset += mt->level[l].pitch * pt->height[l];
}
mt->total_size = offset;
@@ -75,7 +87,8 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
else
if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY |
- PIPE_TEXTURE_USAGE_DISPLAY_TARGET))
+ PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL))
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
else
if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC)
@@ -86,7 +99,11 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_X8R8G8B8_UNORM:
case PIPE_FORMAT_R16_SNORM:
+ {
+ if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE))
+ mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
break;
+ }
default:
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
}
@@ -106,6 +123,31 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
return &mt->base;
}
+static struct pipe_texture *
+nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv40_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv40_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->level[0].pitch = stride[0];
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
static void
nv40_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt)
{
@@ -124,8 +166,8 @@ nv40_miptree_release(struct pipe_screen *pscreen, struct pipe_texture **ppt)
}
if (mt->shadow_tex) {
- assert(mt->shadow_surface);
- pscreen->tex_surface_release(pscreen, &mt->shadow_surface);
+ if (mt->shadow_surface)
+ pscreen->tex_surface_release(pscreen, &mt->shadow_surface);
nv40_miptree_release(pscreen, &mt->shadow_tex);
}
@@ -188,6 +230,7 @@ void
nv40_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv40_miptree_create;
+ pscreen->texture_blanket = nv40_miptree_blanket;
pscreen->texture_release = nv40_miptree_release;
pscreen->get_tex_surface = nv40_miptree_surface_new;
pscreen->tex_surface_release = nv40_miptree_surface_del;
diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c
index 41d342d27d..2372bc8441 100644
--- a/src/gallium/drivers/nv40/nv40_screen.c
+++ b/src/gallium/drivers/nv40/nv40_screen.c
@@ -136,6 +136,14 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,
return FALSE;
}
+static struct pipe_buffer *
+nv40_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv40_miptree *mt = (struct nv40_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
static void *
nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
unsigned flags )
@@ -143,7 +151,6 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
struct pipe_winsys *ws = screen->winsys;
struct pipe_surface *surface_to_map;
void *map;
- struct nv40_miptree *mt;
if (!(surface->texture->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) {
struct nv40_miptree *mt = (struct nv40_miptree *)surface->texture;
@@ -171,8 +178,7 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
surface_to_map = surface;
assert(surface_to_map);
- mt = (struct nv40_miptree *)surface_to_map->texture;
- map = ws->buffer_map(ws, mt->buffer, flags);
+ map = ws->buffer_map(ws, nv40_surface_buffer(surface_to_map), flags);
if (!map)
return NULL;
@@ -184,7 +190,6 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
{
struct pipe_winsys *ws = screen->winsys;
struct pipe_surface *surface_to_unmap;
- struct nv40_miptree *mt;
/* TODO: Copy from shadow just before push buffer is flushed instead.
There are probably some programs that map/unmap excessively
@@ -201,16 +206,16 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
assert(surface_to_unmap);
- mt = (struct nv40_miptree *)surface_to_unmap->texture;
- ws->buffer_unmap(ws, mt->buffer);
+ ws->buffer_unmap(ws, nv40_surface_buffer(surface_to_unmap));
if (surface_to_unmap != surface) {
struct nv40_screen *nvscreen = nv40_screen(screen);
- nvscreen->nvws->surface_copy(nvscreen->nvws,
- surface, 0, 0,
- surface_to_unmap, 0, 0,
- surface->width, surface->height);
+ nvscreen->eng2d->copy(nvscreen->eng2d, surface, 0, 0,
+ surface_to_unmap, 0, 0,
+ surface->width, surface->height);
+
+ screen->tex_surface_release(screen, &surface_to_unmap);
}
}
@@ -243,6 +248,10 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv40_surface_buffer;
+
/* 3D object */
switch (chipset & 0xf0) {
case 0x40:
diff --git a/src/gallium/drivers/nv40/nv40_screen.h b/src/gallium/drivers/nv40/nv40_screen.h
index c04a1275a0..4500aa0e5c 100644
--- a/src/gallium/drivers/nv40/nv40_screen.h
+++ b/src/gallium/drivers/nv40/nv40_screen.h
@@ -2,6 +2,7 @@
#define __NV40_SCREEN_H__
#include "pipe/p_screen.h"
+#include "nv04/nv04_surface_2d.h"
struct nv40_screen {
struct pipe_screen pipe;
@@ -11,6 +12,7 @@ struct nv40_screen {
unsigned cur_pctx;
/* HW graphics objects */
+ struct nv04_surface_2d *eng2d;
struct nouveau_grobj *curie;
struct nouveau_notifier *sync;
diff --git a/src/gallium/drivers/nv40/nv40_surface.c b/src/gallium/drivers/nv40/nv40_surface.c
index aa51d04051..c4a5fb20d9 100644
--- a/src/gallium/drivers/nv40/nv40_surface.c
+++ b/src/gallium/drivers/nv40/nv40_surface.c
@@ -30,7 +30,6 @@
#include "pipe/p_defines.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
-
#include "util/u_tile.h"
static void
@@ -40,22 +39,18 @@ nv40_surface_copy(struct pipe_context *pipe, boolean do_flip,
unsigned width, unsigned height)
{
struct nv40_context *nv40 = nv40_context(pipe);
- struct nouveau_winsys *nvws = nv40->nvws;
+ struct nv04_surface_2d *eng2d = nv40->screen->eng2d;
if (do_flip) {
- /*XXX: This dodgyness will do for now for correctness. But,
- * need to investigate whether the 2D engine is able to
- * manage a flip (perhaps SIFM?), if not, use the 3D engine
- */
desty += height;
while (height--) {
- nvws->surface_copy(nvws, dest, destx, desty--, src,
- srcx, srcy++, width, 1);
+ eng2d->copy(eng2d, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
}
- } else {
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ return;
}
+
+ eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height);
}
static void
@@ -64,9 +59,9 @@ nv40_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv40_context *nv40 = nv40_context(pipe);
- struct nouveau_winsys *nvws = nv40->nvws;
+ struct nv04_surface_2d *eng2d = nv40->screen->eng2d;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ eng2d->fill(eng2d, dest, destx, desty, width, height, value);
}
void
diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c
index 1392fe956f..0862386638 100644
--- a/src/gallium/drivers/nv40/nv40_vertprog.c
+++ b/src/gallium/drivers/nv40/nv40_vertprog.c
@@ -784,7 +784,7 @@ nv40_vertprog_translate(struct nv40_context *nv40,
imm = &parse.FullToken.FullImmediate;
assert(imm->Immediate.DataType == TGSI_IMM_FLOAT32);
-// assert(imm->Immediate.Size == 4);
+ assert(imm->Immediate.NrTokens == 4 + 1);
vpc->imm[vpc->nr_imm++] =
constant(vpc, -1,
imm->u.ImmediateFloat32[0].Float,
diff --git a/src/gallium/drivers/nv50/nv50_clear.c b/src/gallium/drivers/nv50/nv50_clear.c
index 6380f397ea..f9bc3b53ca 100644
--- a/src/gallium/drivers/nv50/nv50_clear.c
+++ b/src/gallium/drivers/nv50/nv50_clear.c
@@ -31,6 +31,8 @@ nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps,
unsigned clearValue)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
struct pipe_framebuffer_state fb, s_fb = nv50->framebuffer;
struct pipe_scissor_state sc, s_sc = nv50->scissor;
unsigned dirty = nv50->dirty;
@@ -59,21 +61,21 @@ nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps,
switch (ps->format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
- BEGIN_RING(tesla, 0x0d80, 4);
- OUT_RINGf (ubyte_to_float((clearValue >> 16) & 0xff));
- OUT_RINGf (ubyte_to_float((clearValue >> 8) & 0xff));
- OUT_RINGf (ubyte_to_float((clearValue >> 0) & 0xff));
- OUT_RINGf (ubyte_to_float((clearValue >> 24) & 0xff));
- BEGIN_RING(tesla, 0x19d0, 1);
- OUT_RING (0x3c);
+ BEGIN_RING(chan, tesla, 0x0d80, 4);
+ OUT_RINGf (chan, ubyte_to_float((clearValue >> 16) & 0xff));
+ OUT_RINGf (chan, ubyte_to_float((clearValue >> 8) & 0xff));
+ OUT_RINGf (chan, ubyte_to_float((clearValue >> 0) & 0xff));
+ OUT_RINGf (chan, ubyte_to_float((clearValue >> 24) & 0xff));
+ BEGIN_RING(chan, tesla, 0x19d0, 1);
+ OUT_RING (chan, 0x3c);
break;
case PIPE_FORMAT_Z24S8_UNORM:
- BEGIN_RING(tesla, 0x0d90, 1);
- OUT_RINGf ((float)(clearValue >> 8) * (1.0 / 16777215.0));
- BEGIN_RING(tesla, 0x0da0, 1);
- OUT_RING (clearValue & 0xff);
- BEGIN_RING(tesla, 0x19d0, 1);
- OUT_RING (0x03);
+ BEGIN_RING(chan, tesla, 0x0d90, 1);
+ OUT_RINGf (chan, (float)(clearValue >> 8) * (1.0 / 16777215.0));
+ BEGIN_RING(chan, tesla, 0x0da0, 1);
+ OUT_RING (chan, clearValue & 0xff);
+ BEGIN_RING(chan, tesla, 0x19d0, 1);
+ OUT_RING (chan, 0x03);
break;
default:
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height,
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index 99776239d2..565a5da668 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -33,7 +33,7 @@ nv50_flush(struct pipe_context *pipe, unsigned flags,
{
struct nv50_context *nv50 = (struct nv50_context *)pipe;
- FIRE_RING(fence);
+ FIRE_RING(nv50->screen->nvws->channel);
}
static void
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index 6c9e18429a..1e9d45cb34 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -15,10 +15,6 @@
#include "nouveau/nouveau_gldefs.h"
#include "nouveau/nouveau_stateobj.h"
-#define NOUVEAU_PUSH_CONTEXT(ctx) \
- struct nv50_screen *ctx = nv50->screen
-#include "nouveau/nouveau_push.h"
-
#include "nv50_screen.h"
#include "nv50_program.h"
@@ -171,6 +167,11 @@ extern void nv50_init_query_functions(struct nv50_context *nv50);
extern void nv50_screen_init_miptree_functions(struct pipe_screen *pscreen);
+extern int
+nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst,
+ int dx, int dy, struct pipe_surface *src, int sx, int sy,
+ int w, int h);
+
/* nv50_draw.c */
extern struct draw_stage *nv50_draw_render_stage(struct nv50_context *nv50);
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index c6e65c9816..91091d53f5 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -104,6 +104,31 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
return &mt->base;
}
+static struct pipe_texture *
+nv50_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
+ const unsigned *stride, struct pipe_buffer *pb)
+{
+ struct nv50_miptree *mt;
+
+ /* Only supports 2D, non-mipmapped textures for the moment */
+ if (pt->target != PIPE_TEXTURE_2D || pt->last_level != 0 ||
+ pt->depth[0] != 1)
+ return NULL;
+
+ mt = CALLOC_STRUCT(nv50_miptree);
+ if (!mt)
+ return NULL;
+
+ mt->base = *pt;
+ mt->base.refcount = 1;
+ mt->base.screen = pscreen;
+ mt->image_nr = 1;
+ mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
+
+ pipe_buffer_reference(pscreen, &mt->buffer, pb);
+ return &mt->base;
+}
+
static INLINE void
mark_dirty(uint32_t *flags, unsigned image)
{
@@ -141,7 +166,7 @@ void
nv50_miptree_sync(struct pipe_screen *pscreen, struct nv50_miptree *mt,
unsigned level, unsigned image)
{
- struct nouveau_winsys *nvws = nv50_screen(pscreen)->nvws;
+ struct nv50_screen *nvscreen = nv50_screen(pscreen);
struct nv50_miptree_level *lvl = &mt->level[level];
struct pipe_surface *dst, *src;
unsigned face = 0, zslice = 0;
@@ -172,7 +197,7 @@ nv50_miptree_sync(struct pipe_screen *pscreen, struct nv50_miptree *mt,
dst = pscreen->get_tex_surface(pscreen, &mt->base, face, level, zslice,
PIPE_BUFFER_USAGE_GPU_READ);
- nvws->surface_copy(nvws, dst, 0, 0, src, 0, 0, dst->width, dst->height);
+ nv50_surface_do_copy(nvscreen, dst, 0, 0, src, 0, 0, dst->width, dst->height);
pscreen->tex_surface_release(pscreen, &dst);
pscreen->tex_surface_release(pscreen, &src);
@@ -183,7 +208,7 @@ static void
nv50_miptree_sync_cpu(struct pipe_screen *pscreen, struct nv50_miptree *mt,
unsigned level, unsigned image)
{
- struct nouveau_winsys *nvws = nv50_screen(pscreen)->nvws;
+ struct nv50_screen *nvscreen = nv50_screen(pscreen);
struct nv50_miptree_level *lvl = &mt->level[level];
struct pipe_surface *dst, *src;
unsigned face = 0, zslice = 0;
@@ -204,7 +229,7 @@ nv50_miptree_sync_cpu(struct pipe_screen *pscreen, struct nv50_miptree *mt,
dst = pscreen->get_tex_surface(pscreen, &mt->base, face, level, zslice,
PIPE_BUFFER_USAGE_CPU_READ);
- nvws->surface_copy(nvws, dst, 0, 0, src, 0, 0, dst->width, dst->height);
+ nv50_surface_do_copy(nvscreen, dst, 0, 0, src, 0, 0, dst->width, dst->height);
pscreen->tex_surface_release(pscreen, &dst);
pscreen->tex_surface_release(pscreen, &src);
@@ -287,6 +312,7 @@ void
nv50_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
pscreen->texture_create = nv50_miptree_create;
+ pscreen->texture_blanket = nv50_miptree_blanket;
pscreen->texture_release = nv50_miptree_release;
pscreen->get_tex_surface = nv50_miptree_surface_new;
pscreen->tex_surface_release = nv50_miptree_surface_del;
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index b902c8cf53..14c5d47e79 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -1545,13 +1545,16 @@ static void
nv50_program_upload_data(struct nv50_context *nv50, float *map,
unsigned start, unsigned count)
{
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
+
while (count) {
unsigned nr = count > 2047 ? 2047 : count;
- BEGIN_RING(tesla, 0x00000f00, 1);
- OUT_RING ((NV50_CB_PMISC << 0) | (start << 8));
- BEGIN_RING(tesla, 0x40000f04, nr);
- OUT_RINGp (map, nr);
+ BEGIN_RING(chan, tesla, 0x00000f00, 1);
+ OUT_RING (chan, (NV50_CB_PMISC << 0) | (start << 8));
+ BEGIN_RING(chan, tesla, 0x40000f04, nr);
+ OUT_RINGp (chan, map, nr);
map += nr;
start += nr;
@@ -1598,6 +1601,8 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)
static void
nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)
{
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
struct pipe_winsys *ws = nv50->pipe.winsys;
struct nv50_program_exec *e;
struct nouveau_stateobj *so;
@@ -1664,14 +1669,14 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)
nr = MIN2(count, 2047);
nr = MIN2(nvws->channel->pushbuf->remaining, nr);
if (nvws->channel->pushbuf->remaining < (nr + 3)) {
- FIRE_RING(NULL);
+ FIRE_RING(chan);
continue;
}
- BEGIN_RING(tesla, 0x0f00, 1);
- OUT_RING ((start << 8) | NV50_CB_PUPLOAD);
- BEGIN_RING(tesla, 0x40000f04, nr);
- OUT_RINGp (up + start, nr);
+ BEGIN_RING(chan, tesla, 0x0f00, 1);
+ OUT_RING (chan, (start << 8) | NV50_CB_PUPLOAD);
+ BEGIN_RING(chan, tesla, 0x40000f04, nr);
+ OUT_RINGp (chan, up + start, nr);
start += nr;
count -= nr;
diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c
index 1b3a41340a..20745ceab8 100644
--- a/src/gallium/drivers/nv50/nv50_query.c
+++ b/src/gallium/drivers/nv50/nv50_query.c
@@ -71,12 +71,14 @@ static void
nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
struct nv50_query *q = nv50_query(pq);
- BEGIN_RING(tesla, 0x1530, 1);
- OUT_RING (1);
- BEGIN_RING(tesla, 0x1514, 1);
- OUT_RING (1);
+ BEGIN_RING(chan, tesla, 0x1530, 1);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, tesla, 0x1514, 1);
+ OUT_RING (chan, 1);
q->ready = FALSE;
}
@@ -85,14 +87,17 @@ static void
nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
struct nv50_query *q = nv50_query(pq);
- BEGIN_RING(tesla, 0x1b00, 4);
- OUT_RELOCh(q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCl(q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RING (0x00000000);
- OUT_RING (0x0100f002);
- FIRE_RING (NULL);
+ WAIT_RING (chan, 5);
+ BEGIN_RING(chan, tesla, 0x1b00, 4);
+ OUT_RELOCh(chan, q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RELOCl(chan, q->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
+ OUT_RING (chan, 0x00000000);
+ OUT_RING (chan, 0x0100f002);
+ FIRE_RING (chan);
}
static boolean
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 6cddddacd5..58d7a621a8 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -173,6 +173,14 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D object */
+ ret = nvws->grobj_alloc(nvws, NV50_2D, &screen->eng2d);
+ if (ret) {
+ NOUVEAU_ERR("Error creating 2D object: %d\n", ret);
+ nv50_screen_destroy(&screen->pipe);
+ return NULL;
+ }
+
/* 3D object */
if ((chipset & 0xf0) != 0x50 && (chipset & 0xf0) != 0x80) {
NOUVEAU_ERR("Not a G8x chipset\n");
@@ -218,6 +226,22 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
}
+ /* Static 2D init */
+ so = so_new(64, 0);
+ so_method(so, screen->eng2d, NV50_2D_DMA_NOTIFY, 4);
+ so_data (so, screen->sync->handle);
+ so_data (so, screen->nvws->channel->vram->handle);
+ so_data (so, screen->nvws->channel->vram->handle);
+ so_data (so, screen->nvws->channel->vram->handle);
+ so_method(so, screen->eng2d, NV50_2D_OPERATION, 1);
+ so_data (so, NV50_2D_OPERATION_SRCCOPY);
+ so_method(so, screen->eng2d, 0x0290, 1);
+ so_data (so, 0);
+ so_method(so, screen->eng2d, 0x0888, 1);
+ so_data (so, 1);
+ so_emit(nvws, so);
+ so_ref(NULL, &so);
+
/* Static tesla init */
so = so_new(256, 20);
diff --git a/src/gallium/drivers/nv50/nv50_screen.h b/src/gallium/drivers/nv50/nv50_screen.h
index 400ddcef06..c888ca071c 100644
--- a/src/gallium/drivers/nv50/nv50_screen.h
+++ b/src/gallium/drivers/nv50/nv50_screen.h
@@ -11,6 +11,7 @@ struct nv50_screen {
unsigned cur_pctx;
struct nouveau_grobj *tesla;
+ struct nouveau_grobj *eng2d;
struct nouveau_notifier *sync;
struct pipe_buffer *constbuf;
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
index 602d76ac74..948112ffa9 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -47,9 +47,11 @@ nv50_state_validate_fb(struct nv50_context *nv50)
so_method(so, tesla, NV50TCL_RT_ADDRESS_HIGH(i), 5);
so_reloc (so, nv50_surface_buffer(fb->cbufs[i]), fb->cbufs[i]->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0);
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH |
+ NOUVEAU_BO_RDWR, 0, 0);
so_reloc (so, nv50_surface_buffer(fb->cbufs[i]), fb->cbufs[i]->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0);
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_RDWR, 0, 0);
switch (fb->cbufs[i]->format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
so_data(so, 0xcf);
@@ -82,9 +84,11 @@ nv50_state_validate_fb(struct nv50_context *nv50)
so_method(so, tesla, NV50TCL_ZETA_ADDRESS_HIGH, 5);
so_reloc (so, nv50_surface_buffer(fb->zsbuf), fb->zsbuf->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0);
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH |
+ NOUVEAU_BO_RDWR, 0, 0);
so_reloc (so, nv50_surface_buffer(fb->zsbuf), fb->zsbuf->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0);
+ NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_RDWR, 0, 0);
switch (fb->zsbuf->format) {
case PIPE_FORMAT_Z24S8_UNORM:
so_data(so, 0x16);
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index 8ebbc84817..f2dd2eb30b 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -20,6 +20,9 @@
* SOFTWARE.
*/
+#define __NOUVEAU_PUSH_H__
+#include <stdint.h>
+#include "nouveau/nouveau_pushbuf.h"
#include "nv50_context.h"
#include "pipe/p_defines.h"
#include "pipe/internal/p_winsys_screen.h"
@@ -27,6 +30,118 @@
#include "util/u_tile.h"
+static INLINE int
+nv50_format(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_Z24S8_UNORM:
+ return NV50_2D_DST_FORMAT_32BPP;
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ return NV50_2D_DST_FORMAT_24BPP;
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ return NV50_2D_DST_FORMAT_16BPP;
+ case PIPE_FORMAT_A8_UNORM:
+ return NV50_2D_DST_FORMAT_8BPP;
+ default:
+ return -1;
+ }
+}
+
+static int
+nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
+{
+ struct nouveau_channel *chan = screen->nvws->channel;
+ struct nouveau_grobj *eng2d = screen->eng2d;
+ struct nouveau_bo *bo;
+ int format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT;
+ int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD);
+
+ bo = screen->nvws->get_bo(nv50_miptree(ps->texture)->buffer);
+ if (!bo)
+ return 1;
+
+ format = nv50_format(ps->format);
+ if (format < 0)
+ return 1;
+
+ if (!bo->tiled) {
+ BEGIN_RING(chan, eng2d, mthd, 2);
+ OUT_RING (chan, format);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, eng2d, mthd + 0x14, 5);
+ OUT_RING (chan, ps->stride);
+ OUT_RING (chan, ps->width);
+ OUT_RING (chan, ps->height);
+ OUT_RELOCh(chan, bo, ps->offset, flags);
+ OUT_RELOCl(chan, bo, ps->offset, flags);
+ } else {
+ BEGIN_RING(chan, eng2d, mthd, 5);
+ OUT_RING (chan, format);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, eng2d, mthd + 0x18, 4);
+ OUT_RING (chan, ps->width);
+ OUT_RING (chan, ps->height);
+ OUT_RELOCh(chan, bo, ps->offset, flags);
+ OUT_RELOCl(chan, bo, ps->offset, flags);
+ }
+
+#if 0
+ if (dst) {
+ BEGIN_RING(chan, eng2d, NV50_2D_CLIP_X, 4);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, surf->width);
+ OUT_RING (chan, surf->height);
+ }
+#endif
+
+ return 0;
+}
+
+int
+nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst,
+ int dx, int dy, struct pipe_surface *src, int sx, int sy,
+ int w, int h)
+{
+ struct nouveau_channel *chan = screen->nvws->channel;
+ struct nouveau_grobj *eng2d = screen->eng2d;
+ int ret;
+
+ WAIT_RING (chan, 32);
+
+ ret = nv50_surface_set(screen, dst, 1);
+ if (ret)
+ return ret;
+
+ ret = nv50_surface_set(screen, src, 0);
+ if (ret)
+ return ret;
+
+ BEGIN_RING(chan, eng2d, 0x088c, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 4);
+ OUT_RING (chan, dx);
+ OUT_RING (chan, dy);
+ OUT_RING (chan, w);
+ OUT_RING (chan, h);
+ BEGIN_RING(chan, eng2d, 0x08c0, 4);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, 1);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, eng2d, 0x08d0, 4);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, sx);
+ OUT_RING (chan, 0);
+ OUT_RING (chan, sy);
+
+ return 0;
+}
+
static void
nv50_surface_copy(struct pipe_context *pipe, boolean flip,
struct pipe_surface *dest, unsigned destx, unsigned desty,
@@ -34,17 +149,19 @@ nv50_surface_copy(struct pipe_context *pipe, boolean flip,
unsigned width, unsigned height)
{
struct nv50_context *nv50 = (struct nv50_context *)pipe;
- struct nouveau_winsys *nvws = nv50->screen->nvws;
+ struct nv50_screen *screen = nv50->screen;
+
+ assert(src->format == dest->format);
if (flip) {
desty += height;
while (height--) {
- nvws->surface_copy(nvws, dest, destx, desty--, src,
- srcx, srcy++, width, 1);
+ nv50_surface_do_copy(screen, dest, destx, desty--, src,
+ srcx, srcy++, width, 1);
}
} else {
- nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
- width, height);
+ nv50_surface_do_copy(screen, dest, destx, desty, src, srcx,
+ srcy, width, height);
}
}
@@ -54,9 +171,30 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
unsigned height, unsigned value)
{
struct nv50_context *nv50 = (struct nv50_context *)pipe;
- struct nouveau_winsys *nvws = nv50->screen->nvws;
+ struct nv50_screen *screen = nv50->screen;
+ struct nouveau_channel *chan = screen->nvws->channel;
+ struct nouveau_grobj *eng2d = screen->eng2d;
+ int format, ret;
+
+ format = nv50_format(dest->format);
+ if (format < 0)
+ return;
+
+ WAIT_RING (chan, 32);
+
+ ret = nv50_surface_set(screen, dest, 1);
+ if (ret)
+ return;
- nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
+ BEGIN_RING(chan, eng2d, 0x0580, 3);
+ OUT_RING (chan, 4);
+ OUT_RING (chan, format);
+ OUT_RING (chan, value);
+ BEGIN_RING(chan, eng2d, NV50_2D_RECT_X1, 4);
+ OUT_RING (chan, destx);
+ OUT_RING (chan, desty);
+ OUT_RING (chan, width);
+ OUT_RING (chan, height);
}
static void *
diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c
index 239407c92b..675f9b20cb 100644
--- a/src/gallium/drivers/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nv50/nv50_tex.c
@@ -117,13 +117,15 @@ nv50_tex_construct(struct nouveau_stateobj *so, struct nv50_miptree *mt)
return 1;
}
- so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW, 0, 0);
+ so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW |
+ NOUVEAU_BO_RD, 0, 0);
so_data (so, 0xd0005000);
so_data (so, 0x00300000);
so_data (so, mt->base.width[0]);
so_data (so, (mt->base.depth[0] << 16) | mt->base.height[0]);
so_data (so, 0x03000000);
- so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH, 0, 0);
+ so_reloc(so, mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_HIGH |
+ NOUVEAU_BO_RD, 0, 0);
return 0;
}
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index c482a4c241..0c970adb03 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -53,25 +53,27 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
unsigned count)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
nv50_state_validate(nv50);
- BEGIN_RING(tesla, 0x142c, 1);
- OUT_RING (0);
- BEGIN_RING(tesla, 0x142c, 1);
- OUT_RING (0);
- BEGIN_RING(tesla, 0x1440, 1);
- OUT_RING (0);
- BEGIN_RING(tesla, 0x1334, 1);
- OUT_RING (0);
-
- BEGIN_RING(tesla, NV50TCL_VERTEX_BEGIN, 1);
- OUT_RING (nv50_prim(mode));
- BEGIN_RING(tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2);
- OUT_RING (start);
- OUT_RING (count);
- BEGIN_RING(tesla, NV50TCL_VERTEX_END, 1);
- OUT_RING (0);
+ BEGIN_RING(chan, tesla, 0x142c, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, tesla, 0x142c, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, tesla, 0x1440, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, tesla, 0x1334, 1);
+ OUT_RING (chan, 0);
+
+ BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1);
+ OUT_RING (chan, nv50_prim(mode));
+ BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2);
+ OUT_RING (chan, start);
+ OUT_RING (chan, count);
+ BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1);
+ OUT_RING (chan, 0);
pipe->flush(pipe, 0, NULL);
return TRUE;
@@ -81,11 +83,14 @@ static INLINE void
nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map,
unsigned start, unsigned count)
{
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
+
map += start;
if (count & 1) {
- BEGIN_RING(tesla, 0x15e8, 1);
- OUT_RING (map[0]);
+ BEGIN_RING(chan, tesla, 0x15e8, 1);
+ OUT_RING (chan, map[0]);
map++;
count--;
}
@@ -94,9 +99,9 @@ nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map,
unsigned nr = count > 2046 ? 2046 : count;
int i;
- BEGIN_RING(tesla, 0x400015f0, nr >> 1);
+ BEGIN_RING(chan, tesla, 0x400015f0, nr >> 1);
for (i = 0; i < nr; i += 2)
- OUT_RING ((map[1] << 16) | map[0]);
+ OUT_RING (chan, (map[1] << 16) | map[0]);
count -= nr;
map += nr;
@@ -107,11 +112,14 @@ static INLINE void
nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map,
unsigned start, unsigned count)
{
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
+
map += start;
if (count & 1) {
- BEGIN_RING(tesla, 0x15e8, 1);
- OUT_RING (map[0]);
+ BEGIN_RING(chan, tesla, 0x15e8, 1);
+ OUT_RING (chan, map[0]);
map++;
count--;
}
@@ -120,9 +128,9 @@ nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map,
unsigned nr = count > 2046 ? 2046 : count;
int i;
- BEGIN_RING(tesla, 0x400015f0, nr >> 1);
+ BEGIN_RING(chan, tesla, 0x400015f0, nr >> 1);
for (i = 0; i < nr; i += 2)
- OUT_RING ((map[1] << 16) | map[0]);
+ OUT_RING (chan, (map[1] << 16) | map[0]);
count -= nr;
map += nr;
@@ -133,13 +141,16 @@ static INLINE void
nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint8_t *map,
unsigned start, unsigned count)
{
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
+
map += start;
while (count) {
unsigned nr = count > 2047 ? 2047 : count;
- BEGIN_RING(tesla, 0x400015e8, nr);
- OUT_RINGp (map, nr);
+ BEGIN_RING(chan, tesla, 0x400015e8, nr);
+ OUT_RINGp (chan, map, nr);
count -= nr;
map += nr;
@@ -152,18 +163,20 @@ nv50_draw_elements(struct pipe_context *pipe,
unsigned mode, unsigned start, unsigned count)
{
struct nv50_context *nv50 = nv50_context(pipe);
+ struct nouveau_channel *chan = nv50->screen->nvws->channel;
+ struct nouveau_grobj *tesla = nv50->screen->tesla;
struct pipe_winsys *ws = pipe->winsys;
void *map = ws->buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ);
nv50_state_validate(nv50);
- BEGIN_RING(tesla, 0x142c, 1);
- OUT_RING (0);
- BEGIN_RING(tesla, 0x142c, 1);
- OUT_RING (0);
+ BEGIN_RING(chan, tesla, 0x142c, 1);
+ OUT_RING (chan, 0);
+ BEGIN_RING(chan, tesla, 0x142c, 1);
+ OUT_RING (chan, 0);
- BEGIN_RING(tesla, NV50TCL_VERTEX_BEGIN, 1);
- OUT_RING (nv50_prim(mode));
+ BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1);
+ OUT_RING (chan, nv50_prim(mode));
switch (indexSize) {
case 1:
nv50_draw_elements_inline_u08(nv50, map, start, count);
@@ -177,8 +190,8 @@ nv50_draw_elements(struct pipe_context *pipe,
default:
assert(0);
}
- BEGIN_RING(tesla, NV50TCL_VERTEX_END, 1);
- OUT_RING (0);
+ BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1);
+ OUT_RING (chan, 0);
pipe->flush(pipe, 0, NULL);
return TRUE;
diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile
new file mode 100644
index 0000000000..85b3f15ac5
--- /dev/null
+++ b/src/gallium/drivers/r300/Makefile
@@ -0,0 +1,22 @@
+TOP = ../../../..
+include $(TOP)/configs/current
+
+LIBNAME = r300
+
+C_SOURCES = \
+ r300_chipset.c \
+ r300_clear.c \
+ r300_context.c \
+ r300_emit.c \
+ r300_flush.c \
+ r300_screen.c \
+ r300_state.c \
+ r300_state_derived.c \
+ r300_state_shader.c \
+ r300_surface.c \
+ r300_swtcl_emit.c \
+ r300_texture.c
+
+include ../../Makefile.template
+
+symlinks:
diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript
new file mode 100644
index 0000000000..18684c3e7f
--- /dev/null
+++ b/src/gallium/drivers/r300/SConscript
@@ -0,0 +1,17 @@
+Import('*')
+
+env = env.Clone()
+
+r300 = env.ConvenienceLibrary(
+ target = 'r300',
+ source = [
+ 'r300_blit.c',
+ 'r300_clear.c',
+ 'r300_context.c',
+ 'r300_screen.c',
+ 'r300_state.c',
+ 'r300_surface.c',
+ ])
+
+Export('r300')
+
diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c
new file mode 100644
index 0000000000..794fa2b9b8
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_chipset.c
@@ -0,0 +1,348 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_chipset.h"
+#include "pipe/p_debug.h"
+
+/* r300_chipset: A file all to itself for deducing the various properties of
+ * Radeons. */
+
+/* Parse a PCI ID and fill an r300_capabilities struct with information. */
+void r300_parse_chipset(struct r300_capabilities* caps)
+{
+ /* Reasonable defaults */
+ caps->has_tcl = TRUE;
+ caps->is_r500 = FALSE;
+ caps->num_vert_fpus = 4;
+
+
+ /* Note: These are not ordered by PCI ID. I leave that task to GCC,
+ * which will perform the ordering while collating jump tables. Instead,
+ * I've tried to group them according to capabilities and age. */
+ switch (caps->pci_id) {
+ case 0x4144:
+ caps->family = CHIP_FAMILY_R300;
+ break;
+
+ case 0x4145:
+ case 0x4146:
+ case 0x4147:
+ case 0x4E44:
+ case 0x4E45:
+ case 0x4E46:
+ case 0x4E47:
+ caps->family = CHIP_FAMILY_R300;
+ break;
+
+ case 0x4150:
+ case 0x4151:
+ case 0x4152:
+ case 0x4153:
+ case 0x4154:
+ case 0x4155:
+ case 0x4156:
+ case 0x4E50:
+ case 0x4E51:
+ case 0x4E52:
+ case 0x4E53:
+ case 0x4E54:
+ case 0x4E56:
+ caps->family = CHIP_FAMILY_RV350;
+ break;
+
+ case 0x4148:
+ case 0x4149:
+ case 0x414A:
+ case 0x414B:
+ case 0x4E48:
+ case 0x4E49:
+ case 0x4E4B:
+ caps->family = CHIP_FAMILY_R350;
+ break;
+
+ case 0x4E4A:
+ caps->family = CHIP_FAMILY_R360;
+ break;
+
+ case 0x5460:
+ case 0x5462:
+ case 0x5464:
+ case 0x5B60:
+ case 0x5B62:
+ case 0x5B63:
+ case 0x5B64:
+ case 0x5B65:
+ caps->family = CHIP_FAMILY_RV370;
+ break;
+
+ case 0x3150:
+ case 0x3152:
+ case 0x3154:
+ case 0x3E50:
+ case 0x3E54:
+ caps->family = CHIP_FAMILY_RV380;
+ break;
+
+ case 0x4A48:
+ case 0x4A49:
+ case 0x4A4A:
+ case 0x4A4B:
+ case 0x4A4C:
+ case 0x4A4D:
+ case 0x4A4E:
+ case 0x4A4F:
+ case 0x4A50:
+ case 0x4A54:
+ caps->family = CHIP_FAMILY_R420;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x5548:
+ case 0x5549:
+ case 0x554A:
+ case 0x554B:
+ case 0x5550:
+ case 0x5551:
+ case 0x5552:
+ case 0x5554:
+ case 0x5D57:
+ caps->family = CHIP_FAMILY_R423;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x554C:
+ case 0x554D:
+ case 0x554E:
+ case 0x554F:
+ case 0x5D48:
+ case 0x5D49:
+ case 0x5D4A:
+ caps->family = CHIP_FAMILY_R430;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x5D4C:
+ case 0x5D4D:
+ case 0x5D4E:
+ case 0x5D4F:
+ case 0x5D50:
+ case 0x5D52:
+ caps->family = CHIP_FAMILY_R480;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x4B49:
+ case 0x4B4A:
+ case 0x4B4B:
+ case 0x4B4C:
+ caps->family = CHIP_FAMILY_R481;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x5E4C:
+ case 0x5E4F:
+ case 0x564A:
+ case 0x564B:
+ case 0x564F:
+ case 0x5652:
+ case 0x5653:
+ case 0x5657:
+ case 0x5E48:
+ case 0x5E4A:
+ case 0x5E4B:
+ case 0x5E4D:
+ caps->family = CHIP_FAMILY_RV410;
+ caps->num_vert_fpus = 6;
+ break;
+
+ case 0x5954:
+ case 0x5955:
+ caps->family = CHIP_FAMILY_RS480;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x5974:
+ case 0x5975:
+ caps->family = CHIP_FAMILY_RS482;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x5A41:
+ case 0x5A42:
+ caps->family = CHIP_FAMILY_RS400;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x5A61:
+ case 0x5A62:
+ caps->family = CHIP_FAMILY_RC410;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x791E:
+ case 0x791F:
+ caps->family = CHIP_FAMILY_RS690;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x796C:
+ case 0x796D:
+ case 0x796E:
+ case 0x796F:
+ caps->family = CHIP_FAMILY_RS740;
+ caps->has_tcl = FALSE;
+ break;
+
+ case 0x7100:
+ case 0x7101:
+ case 0x7102:
+ case 0x7103:
+ case 0x7104:
+ case 0x7105:
+ case 0x7106:
+ case 0x7108:
+ case 0x7109:
+ case 0x710A:
+ case 0x710B:
+ case 0x710C:
+ case 0x710E:
+ case 0x710F:
+ caps->family = CHIP_FAMILY_R520;
+ caps->num_vert_fpus = 8;
+ caps->is_r500 = TRUE;
+ break;
+
+ case 0x7140:
+ case 0x7141:
+ case 0x7142:
+ case 0x7143:
+ case 0x7144:
+ case 0x7145:
+ case 0x7146:
+ case 0x7147:
+ case 0x7149:
+ case 0x714A:
+ case 0x714B:
+ case 0x714C:
+ case 0x714D:
+ case 0x714E:
+ case 0x714F:
+ case 0x7151:
+ case 0x7152:
+ case 0x7153:
+ case 0x715E:
+ case 0x715F:
+ case 0x7180:
+ case 0x7181:
+ case 0x7183:
+ case 0x7186:
+ case 0x7187:
+ case 0x7188:
+ case 0x718A:
+ case 0x718B:
+ case 0x718C:
+ case 0x718D:
+ case 0x718F:
+ case 0x7193:
+ case 0x7196:
+ case 0x719B:
+ case 0x719F:
+ case 0x7200:
+ case 0x7210:
+ case 0x7211:
+ caps->family = CHIP_FAMILY_RV515;
+ caps->num_vert_fpus = 2;
+ caps->is_r500 = TRUE;
+ break;
+
+ case 0x71C0:
+ case 0x71C1:
+ case 0x71C2:
+ case 0x71C3:
+ case 0x71C4:
+ case 0x71C5:
+ case 0x71C6:
+ case 0x71C7:
+ case 0x71CD:
+ case 0x71CE:
+ case 0x71D2:
+ case 0x71D4:
+ case 0x71D5:
+ case 0x71D6:
+ case 0x71DA:
+ case 0x71DE:
+ caps->family = CHIP_FAMILY_RV530;
+ caps->num_vert_fpus = 5;
+ caps->is_r500 = TRUE;
+ break;
+
+ case 0x7240:
+ case 0x7243:
+ case 0x7244:
+ case 0x7245:
+ case 0x7246:
+ case 0x7247:
+ case 0x7248:
+ case 0x7249:
+ case 0x724A:
+ case 0x724B:
+ case 0x724C:
+ case 0x724D:
+ case 0x724E:
+ case 0x724F:
+ case 0x7284:
+ caps->family = CHIP_FAMILY_R580;
+ caps->num_vert_fpus = 8;
+ caps->is_r500 = TRUE;
+ break;
+
+ case 0x7280:
+ caps->family = CHIP_FAMILY_RV570;
+ caps->num_vert_fpus = 5;
+ caps->is_r500 = TRUE;
+ break;
+
+ case 0x7281:
+ case 0x7283:
+ case 0x7287:
+ case 0x7288:
+ case 0x7289:
+ case 0x728B:
+ case 0x728C:
+ case 0x7290:
+ case 0x7291:
+ case 0x7293:
+ case 0x7297:
+ caps->family = CHIP_FAMILY_RV560;
+ caps->num_vert_fpus = 5;
+ caps->is_r500 = TRUE;
+ break;
+
+ default:
+ debug_printf("r300: Warning: Unknown chipset 0x%x\n",
+ caps->pci_id);
+ break;
+ }
+
+ /* XXX SW TCL is broken so no forcing it off right now
+ caps->has_tcl = FALSE; */
+}
diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h
new file mode 100644
index 0000000000..a9cd372ec5
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_chipset.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_CHIPSET_H
+#define R300_CHIPSET_H
+
+#include "pipe/p_compiler.h"
+
+/* Structure containing all the possible information about a specific Radeon
+ * in the R3xx, R4xx, and R5xx families. */
+struct r300_capabilities {
+ /* PCI ID */
+ uint32_t pci_id;
+ /* Chipset family */
+ int family;
+ /* The number of vertex floating-point units */
+ int num_vert_fpus;
+ /* The number of fragment pipes */
+ int num_frag_pipes;
+ /* Whether or not TCL is physically present */
+ boolean has_tcl;
+ /* Whether or not this is an RV515 or newer; R500s have many differences
+ * that require extra consideration, compared to their R3xx cousins:
+ * - Extra bit of width and height on texture sizes
+ * - Blend color is split across two registers
+ * - Universal Shader (US) block used for fragment shaders */
+ boolean is_r500;
+};
+
+/* Enumerations for legibility and telling which card we're running on. */
+enum {
+ CHIP_FAMILY_R300 = 0,
+ CHIP_FAMILY_R350,
+ CHIP_FAMILY_R360,
+ CHIP_FAMILY_RV350,
+ CHIP_FAMILY_RV370,
+ CHIP_FAMILY_RV380,
+ CHIP_FAMILY_R420,
+ CHIP_FAMILY_R423,
+ CHIP_FAMILY_R430,
+ CHIP_FAMILY_R480,
+ CHIP_FAMILY_R481,
+ CHIP_FAMILY_RV410,
+ CHIP_FAMILY_RS400,
+ CHIP_FAMILY_RC410,
+ CHIP_FAMILY_RS480,
+ CHIP_FAMILY_RS482,
+ CHIP_FAMILY_RS690,
+ CHIP_FAMILY_RS740,
+ CHIP_FAMILY_RV515,
+ CHIP_FAMILY_R520,
+ CHIP_FAMILY_RV530,
+ CHIP_FAMILY_R580,
+ CHIP_FAMILY_RV560,
+ CHIP_FAMILY_RV570
+};
+
+void r300_parse_chipset(struct r300_capabilities* caps);
+
+#endif /* R300_CHIPSET_H */
diff --git a/src/gallium/drivers/r300/r300_clear.c b/src/gallium/drivers/r300/r300_clear.c
new file mode 100644
index 0000000000..fd28437aaa
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_clear.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_clear.h"
+
+/* This gets its own file because Intel's is in its own file.
+ * I assume there's a good reason. */
+void r300_clear(struct pipe_context* pipe,
+ struct pipe_surface* ps,
+ unsigned color)
+{
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ ps->status = PIPE_SURFACE_STATUS_DEFINED;
+} \ No newline at end of file
diff --git a/src/gallium/drivers/r300/r300_clear.h b/src/gallium/drivers/r300/r300_clear.h
new file mode 100644
index 0000000000..e24a0690c9
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_clear.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "pipe/p_context.h"
+
+void r300_clear(struct pipe_context* pipe,
+ struct pipe_surface* ps,
+ unsigned color);
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
new file mode 100644
index 0000000000..37dc9e86d6
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_context.h"
+
+static boolean r300_draw_range_elements(struct pipe_context* pipe,
+ struct pipe_buffer* indexBuffer,
+ unsigned indexSize,
+ unsigned minIndex,
+ unsigned maxIndex,
+ unsigned mode,
+ unsigned start,
+ unsigned count)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ int i;
+
+ if (r300->dirty_state) {
+ r300_update_derived_state(r300);
+ r300_emit_dirty_state(r300);
+ }
+
+ for (i = 0; i < r300->vertex_buffer_count; i++) {
+ void* buf = pipe_buffer_map(pipe->screen,
+ r300->vertex_buffers[i].buffer,
+ PIPE_BUFFER_USAGE_CPU_READ);
+ draw_set_mapped_vertex_buffer(r300->draw, i, buf);
+ }
+
+ if (indexBuffer) {
+ void* indices = pipe_buffer_map(pipe->screen, indexBuffer,
+ PIPE_BUFFER_USAGE_CPU_READ);
+ draw_set_mapped_element_buffer_range(r300->draw, indexSize,
+ minIndex, maxIndex, indices);
+ } else {
+ draw_set_mapped_element_buffer(r300->draw, 0, NULL);
+ }
+
+ draw_set_mapped_constant_buffer(r300->draw,
+ r300->shader_constants[PIPE_SHADER_VERTEX].constants,
+ r300->shader_constants[PIPE_SHADER_VERTEX].user_count *
+ (sizeof(float) * 4));
+
+ /* Abandon all hope, ye who enter here. */
+ draw_arrays(r300->draw, mode, start, count);
+
+ for (i = 0; i < r300->vertex_buffer_count; i++) {
+ pipe_buffer_unmap(pipe->screen, r300->vertex_buffers[i].buffer);
+ draw_set_mapped_vertex_buffer(r300->draw, i, NULL);
+ }
+
+ if (indexBuffer) {
+ pipe_buffer_unmap(pipe->screen, indexBuffer);
+ draw_set_mapped_element_buffer_range(r300->draw, 0, start,
+ start + count - 1, NULL);
+ }
+
+ return true;
+}
+
+static boolean r300_draw_elements(struct pipe_context* pipe,
+ struct pipe_buffer* indexBuffer,
+ unsigned indexSize, unsigned mode,
+ unsigned start, unsigned count)
+{
+ return r300_draw_range_elements(pipe, indexBuffer, indexSize, 0, ~0,
+ mode, start, count);
+}
+
+static boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
+ unsigned start, unsigned count)
+{
+ return r300_draw_elements(pipe, NULL, 0, mode, start, count);
+}
+
+static void r300_destroy_context(struct pipe_context* context) {
+ struct r300_context* r300 = r300_context(context);
+
+ draw_destroy(r300->draw);
+
+ FREE(r300->blend_color_state);
+ FREE(r300->scissor_state);
+ FREE(r300);
+}
+
+struct pipe_context* r300_create_context(struct pipe_screen* screen,
+ struct pipe_winsys* winsys,
+ struct r300_winsys* r300_winsys)
+{
+ struct r300_context* r300 = CALLOC_STRUCT(r300_context);
+
+ if (!r300)
+ return NULL;
+
+ r300->winsys = r300_winsys;
+ r300->context.winsys = winsys;
+ r300->context.screen = r300_create_screen(winsys, r300_winsys);
+
+ r300->context.destroy = r300_destroy_context;
+
+ r300->context.clear = r300_clear;
+
+ r300->context.draw_arrays = r300_draw_arrays;
+ r300->context.draw_elements = r300_draw_elements;
+ r300->context.draw_range_elements = r300_draw_range_elements;
+
+ r300->draw = draw_create();
+ draw_set_rasterize_stage(r300->draw, r300_draw_swtcl_stage(r300));
+
+ r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
+ r300->scissor_state = CALLOC_STRUCT(r300_scissor_state);
+
+ r300_init_flush_functions(r300);
+
+ r300_init_surface_functions(r300);
+
+ r300_init_state_functions(r300);
+
+ r300->dirty_state = R300_NEW_KITCHEN_SINK;
+ r300->dirty_hw++;
+
+ return &r300->context;
+}
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
new file mode 100644
index 0000000000..a3727c8fb4
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_CONTEXT_H
+#define R300_CONTEXT_H
+
+#include "draw/draw_context.h"
+#include "draw/draw_vertex.h"
+#include "pipe/p_context.h"
+#include "tgsi/tgsi_scan.h"
+#include "util/u_memory.h"
+
+#include "r300_clear.h"
+#include "r300_screen.h"
+#include "r300_winsys.h"
+
+struct r300_blend_state {
+ uint32_t blend_control; /* R300_RB3D_CBLEND: 0x4e04 */
+ uint32_t alpha_blend_control; /* R300_RB3D_ABLEND: 0x4e08 */
+ uint32_t rop; /* R300_RB3D_ROPCNTL: 0x4e18 */
+ uint32_t dither; /* R300_RB3D_DITHER_CTL: 0x4e50 */
+};
+
+struct r300_blend_color_state {
+ /* RV515 and earlier */
+ uint32_t blend_color; /* R300_RB3D_BLEND_COLOR: 0x4e10 */
+ /* R520 and newer */
+ uint32_t blend_color_red_alpha; /* R500_RB3D_CONSTANT_COLOR_AR: 0x4ef8 */
+ uint32_t blend_color_green_blue; /* R500_RB3D_CONSTANT_COLOR_GB: 0x4efc */
+};
+
+struct r300_dsa_state {
+ uint32_t alpha_function; /* R300_FG_ALPHA_FUNC: 0x4bd4 */
+ uint32_t alpha_reference; /* R500_FG_ALPHA_VALUE: 0x4be0 */
+ uint32_t z_buffer_control; /* R300_ZB_CNTL: 0x4f00 */
+ uint32_t z_stencil_control; /* R300_ZB_ZSTENCILCNTL: 0x4f04 */
+ uint32_t stencil_ref_mask; /* R300_ZB_STENCILREFMASK: 0x4f08 */
+ uint32_t z_buffer_top; /* R300_ZB_ZTOP: 0x4f14 */
+ uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */
+};
+
+struct r300_rs_state {
+ /* XXX icky as fucking hell */
+ struct pipe_rasterizer_state rs;
+
+ uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
+ uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */
+ uint32_t line_control; /* R300_GA_LINE_CNTL: 0x4234 */
+ uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
+ uint32_t depth_offset_front;/* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */
+ uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */
+ uint32_t depth_offset_back; /* R300_SU_POLY_OFFSET_BACK_OFFSET: 0x42b0 */
+ uint32_t polygon_offset_enable; /* R300_SU_POLY_OFFSET_ENABLE: 0x42b4 */
+ uint32_t cull_mode; /* R300_SU_CULL_MODE: 0x42b8 */
+ uint32_t line_stipple_config; /* R300_GA_LINE_STIPPLE_CONFIG: 0x4328 */
+ uint32_t line_stipple_value; /* R300_GA_LINE_STIPPLE_VALUE: 0x4260 */
+};
+
+struct r300_sampler_state {
+ uint32_t filter0; /* R300_TX_FILTER0: 0x4400 */
+ uint32_t filter1; /* R300_TX_FILTER1: 0x4440 */
+ uint32_t border_color; /* R300_TX_BORDER_COLOR: 0x45c0 */
+};
+
+struct r300_scissor_state {
+ uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */
+ uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */
+};
+
+struct r300_texture_state {
+};
+
+#define R300_NEW_BLEND 0x0000001
+#define R300_NEW_BLEND_COLOR 0x0000002
+#define R300_NEW_CONSTANTS 0x0000004
+#define R300_NEW_DSA 0x0000008
+#define R300_NEW_FRAMEBUFFERS 0x0000010
+#define R300_NEW_FRAGMENT_SHADER 0x0000020
+#define R300_NEW_RASTERIZER 0x0000040
+#define R300_NEW_SAMPLER 0x0000080
+#define R300_NEW_SCISSOR 0x0008000
+#define R300_NEW_TEXTURE 0x0010000
+#define R300_NEW_VERTEX_FORMAT 0x1000000
+#define R300_NEW_VERTEX_SHADER 0x2000000
+#define R300_NEW_KITCHEN_SINK 0x3ffffff
+
+/* The next several objects are not pure Radeon state; they inherit from
+ * various Gallium classes. */
+
+struct r300_constant_buffer {
+ /* Buffer of constants */
+ /* XXX first number should be raised */
+ float constants[8][4];
+ /* Number of user-defined constants */
+ int user_count;
+ /* Total number of constants */
+ int count;
+};
+
+struct r3xx_fragment_shader {
+ /* Parent class */
+ struct pipe_shader_state state;
+ struct tgsi_shader_info info;
+
+ /* Has this shader been translated yet? */
+ boolean translated;
+
+ /* Pixel stack size */
+ int stack_size;
+};
+
+struct r300_fragment_shader {
+ /* Parent class */
+ struct r3xx_fragment_shader shader;
+
+ /* Number of ALU instructions */
+ int alu_instruction_count;
+
+ /* Number of texture instructions */
+ int tex_instruction_count;
+
+ /* Number of texture indirections */
+ int indirections;
+
+ /* Indirection node offsets */
+ int offset0;
+ int offset1;
+ int offset2;
+ int offset3;
+
+ /* Machine instructions */
+ struct {
+ uint32_t alu_rgb_inst;
+ uint32_t alu_rgb_addr;
+ uint32_t alu_alpha_inst;
+ uint32_t alu_alpha_addr;
+ } instructions[64]; /* XXX magic num */
+};
+
+struct r500_fragment_shader {
+ /* Parent class */
+ struct r3xx_fragment_shader shader;
+
+ /* Number of used instructions */
+ int instruction_count;
+
+ /* Machine instructions */
+ struct {
+ uint32_t inst0;
+ uint32_t inst1;
+ uint32_t inst2;
+ uint32_t inst3;
+ uint32_t inst4;
+ uint32_t inst5;
+ } instructions[256]; /*< XXX magic number */
+};
+
+struct r300_texture {
+ /* Parent class */
+ struct pipe_texture tex;
+
+ /* Offsets into the buffer. */
+ unsigned offset[PIPE_MAX_TEXTURE_LEVELS];
+
+ /* Total size of this texture, in bytes. */
+ unsigned size;
+
+ /* Pipe buffer backing this texture. */
+ struct pipe_buffer* buffer;
+};
+
+struct r300_context {
+ /* Parent class */
+ struct pipe_context context;
+
+ /* The interface to the windowing system, etc. */
+ struct r300_winsys* winsys;
+ /* Draw module. Used mostly for SW TCL. */
+ struct draw_context* draw;
+
+ /* Various CSO state objects. */
+ /* Blend state. */
+ struct r300_blend_state* blend_state;
+ /* Blend color state. */
+ struct r300_blend_color_state* blend_color_state;
+ /* Shader constants. */
+ struct r300_constant_buffer shader_constants[PIPE_SHADER_TYPES];
+ /* Depth, stencil, and alpha state. */
+ struct r300_dsa_state* dsa_state;
+ /* Fragment shader. */
+ struct r3xx_fragment_shader* fs;
+ /* Framebuffer state. We currently don't need our own version of this. */
+ struct pipe_framebuffer_state framebuffer_state;
+ /* Rasterizer state. */
+ struct r300_rs_state* rs_state;
+ /* Sampler states. */
+ struct r300_sampler_state* sampler_states[8];
+ int sampler_count;
+ /* Scissor state. */
+ struct r300_scissor_state* scissor_state;
+ /* Texture states. */
+ struct r300_texture* textures[8];
+ struct r300_texture_state* texture_states[8];
+ int texture_count;
+ /* Vertex buffers. */
+ struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
+ int vertex_buffer_count;
+ /* Vertex information. */
+ struct vertex_info vertex_info;
+ /* Bitmask of dirty state objects. */
+ uint32_t dirty_state;
+ /* Flag indicating whether or not the HW is dirty. */
+ uint32_t dirty_hw;
+};
+
+/* Convenience cast wrapper. */
+static struct r300_context* r300_context(struct pipe_context* context) {
+ return (struct r300_context*)context;
+}
+
+/* Context initialization. */
+void r300_init_state_functions(struct r300_context* r300);
+void r300_init_surface_functions(struct r300_context* r300);
+
+/* Fun with includes: r300_winsys also declares this prototype.
+ * We'll just step out in that case... */
+#ifndef R300_WINSYS_H
+struct pipe_context* r300_create_context(struct pipe_screen* screen,
+ struct pipe_winsys* winsys,
+ struct r300_winsys* r300_winsys);
+#endif
+
+#endif /* R300_CONTEXT_H */
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
new file mode 100644
index 0000000000..d8038ff1e1
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_CS_H
+#define R300_CS_H
+
+#include "util/u_math.h"
+
+#include "r300_reg.h"
+#include "r300_winsys.h"
+
+/* Yes, I know macros are ugly. However, they are much prettier than the code
+ * that they neatly hide away, and don't have the cost of function setup,so
+ * we're going to use them. */
+
+#define MAX_CS_SIZE 64 * 1024 / 4
+
+#define VERY_VERBOSE_REGISTERS 0
+
+/* XXX stolen from radeon_drm.h */
+#define RADEON_GEM_DOMAIN_CPU 0x1
+#define RADEON_GEM_DOMAIN_GTT 0x2
+#define RADEON_GEM_DOMAIN_VRAM 0x4
+
+/* XXX stolen from radeon_reg.h */
+#define RADEON_CP_PACKET0 0x0
+
+#define CP_PACKET0(register, count) \
+ (RADEON_CP_PACKET0 | ((count) << 16) | ((register) >> 2))
+
+#define CP_PACKET3(op, count) \
+ (RADEON_CP_PACKET3 | (op) | ((count) << 16))
+
+#define CS_LOCALS(context) \
+ struct r300_winsys* cs_winsys = context->winsys; \
+ struct radeon_cs* cs = cs_winsys->cs; \
+ int cs_count = 0;
+
+#define CHECK_CS(size) \
+ cs_winsys->check_cs(cs, (size))
+
+#define BEGIN_CS(size) do { \
+ CHECK_CS(size); \
+ debug_printf("r300: BEGIN_CS, count %d, in %s (%s:%d)\n", \
+ size, __FUNCTION__, __FILE__, __LINE__); \
+ cs_winsys->begin_cs(cs, (size), __FILE__, __FUNCTION__, __LINE__); \
+ cs_count = size; \
+} while (0)
+
+#define OUT_CS(value) do { \
+ cs_winsys->write_cs_dword(cs, (value)); \
+ cs_count--; \
+} while (0)
+
+#define OUT_CS_32F(value) do { \
+ cs_winsys->write_cs_dword(cs, fui(value)); \
+ cs_count--; \
+} while (0)
+
+#define OUT_CS_REG(register, value) do { \
+ if (VERY_VERBOSE_REGISTERS) \
+ debug_printf("r300: writing 0x%08X to register 0x%04X\n", \
+ value, register); \
+ assert(register); \
+ OUT_CS(CP_PACKET0(register, 0)); \
+ OUT_CS(value); \
+} while (0)
+
+/* Note: This expects count to be the number of registers,
+ * not the actual packet0 count! */
+#define OUT_CS_REG_SEQ(register, count) do { \
+ if (VERY_VERBOSE_REGISTERS) \
+ debug_printf("r300: writing register sequence of %d to 0x%04X\n", \
+ count, register); \
+ assert(register); \
+ OUT_CS(CP_PACKET0(register, ((count) - 1))); \
+} while (0)
+
+#define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \
+ debug_printf("r300: writing relocation for buffer %p, offset %d\n", \
+ bo, offset); \
+ assert(bo); \
+ OUT_CS(offset); \
+ cs_winsys->write_cs_reloc(cs, bo, rd, wd, flags); \
+ cs_count -= 2; \
+} while (0)
+
+#define END_CS do { \
+ debug_printf("r300: END_CS in %s (%s:%d)\n", __FUNCTION__, __FILE__, \
+ __LINE__); \
+ if (cs_count != 0) \
+ debug_printf("r300: Warning: cs_count off by %d\n", cs_count); \
+ cs_winsys->end_cs(cs, __FILE__, __FUNCTION__, __LINE__); \
+} while (0)
+
+#define FLUSH_CS do { \
+ debug_printf("r300: FLUSH_CS in %s (%s:%d)\n\n", __FUNCTION__, __FILE__, \
+ __LINE__); \
+ cs_winsys->flush_cs(cs); \
+} while (0)
+
+#include "r300_cs_inlines.h"
+
+#endif /* R300_CS_H */
diff --git a/src/gallium/drivers/r300/r300_cs_inlines.h b/src/gallium/drivers/r300/r300_cs_inlines.h
new file mode 100644
index 0000000000..03bb608eb9
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_cs_inlines.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+/* r300_cs_inlines: This is just a handful of useful inlines for sending
+ * (very) common instructions to the CS buffer. Should only be included from
+ * r300_cs.h, probably. */
+
+#ifdef R300_CS_H
+
+#define RADEON_ONE_REG_WR (1 << 15)
+
+#define OUT_CS_ONE_REG(register, count) do { \
+ if (VERY_VERBOSE_REGISTERS) \
+ debug_printf("r300: writing data sequence of %d to 0x%04X\n", \
+ count, register); \
+ assert(register); \
+ OUT_CS(CP_PACKET0(register, ((count) - 1)) | RADEON_ONE_REG_WR); \
+} while (0)
+
+#define R300_PACIFY do { \
+ OUT_CS_REG(RADEON_WAIT_UNTIL, (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) | \
+ (1 << 18)); \
+} while (0)
+
+#define R300_SCREENDOOR do { \
+ OUT_CS_REG(R300_SC_SCREENDOOR, 0x0); \
+ R300_PACIFY; \
+ OUT_CS_REG(R300_SC_SCREENDOOR, 0xffffff); \
+} while (0)
+
+#endif /* R300_CS_H */
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
new file mode 100644
index 0000000000..a2819294a4
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+/* r300_emit: Functions for emitting state. */
+
+#include "r300_emit.h"
+
+void r300_emit_blend_state(struct r300_context* r300,
+ struct r300_blend_state* blend)
+{
+ CS_LOCALS(r300);
+ BEGIN_CS(7);
+ OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 2);
+ OUT_CS(blend->blend_control);
+ OUT_CS(blend->alpha_blend_control);
+ OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop);
+ OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither);
+ END_CS;
+}
+
+void r300_emit_blend_color_state(struct r300_context* r300,
+ struct r300_blend_color_state* bc)
+{
+ struct r300_screen* r300screen =
+ (struct r300_screen*)r300->context.screen;
+ CS_LOCALS(r300);
+ if (r300screen->caps->is_r500) {
+ BEGIN_CS(3);
+ OUT_CS_REG_SEQ(R500_RB3D_CONSTANT_COLOR_AR, 2);
+ OUT_CS(bc->blend_color_red_alpha);
+ OUT_CS(bc->blend_color_green_blue);
+ END_CS;
+ } else {
+ BEGIN_CS(2);
+ OUT_CS_REG(R300_RB3D_BLEND_COLOR, bc->blend_color);
+ END_CS;
+ }
+}
+
+void r300_emit_dsa_state(struct r300_context* r300,
+ struct r300_dsa_state* dsa)
+{
+ struct r300_screen* r300screen =
+ (struct r300_screen*)r300->context.screen;
+ CS_LOCALS(r300);
+ BEGIN_CS(r300screen->caps->is_r500 ? 8 : 8);
+ OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function);
+ /* XXX figure out the r300 counterpart for this */
+ if (r300screen->caps->is_r500) {
+ /* OUT_CS_REG(R500_FG_ALPHA_VALUE, dsa->alpha_reference); */
+ }
+ OUT_CS_REG_SEQ(R300_ZB_CNTL, 3);
+ OUT_CS(dsa->z_buffer_control);
+ OUT_CS(dsa->z_stencil_control);
+ OUT_CS(dsa->stencil_ref_mask);
+ OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top);
+ if (r300screen->caps->is_r500) {
+ /* OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); */
+ }
+ END_CS;
+}
+
+void r300_emit_fragment_shader(struct r300_context* r300,
+ struct r300_fragment_shader* fs)
+{
+ CS_LOCALS(r300);
+ int i;
+ BEGIN_CS(0);
+
+ OUT_CS_REG(R300_US_CONFIG, MAX2(fs->indirections - 1, 0));
+ OUT_CS_REG(R300_US_PIXSIZE, fs->shader.stack_size);
+ /* XXX figure out exactly how big the sizes are on this reg */
+ OUT_CS_REG(R300_US_CODE_OFFSET, 0x0);
+ /* XXX figure these ones out a bit better kthnx */
+ OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_3, R300_RGBA_OUT);
+
+ for (i = 0; i < fs->alu_instruction_count; i++) {
+ OUT_CS_REG(R300_US_ALU_RGB_INST_0 + (4 * i),
+ fs->instructions[i].alu_rgb_inst);
+ OUT_CS_REG(R300_US_ALU_RGB_ADDR_0 + (4 * i),
+ fs->instructions[i].alu_rgb_addr);
+ OUT_CS_REG(R300_US_ALU_ALPHA_INST_0 + (4 * i),
+ fs->instructions[i].alu_alpha_inst);
+ OUT_CS_REG(R300_US_ALU_ALPHA_ADDR_0 + (4 * i),
+ fs->instructions[i].alu_alpha_addr);
+ }
+
+ END_CS;
+}
+
+void r500_emit_fragment_shader(struct r300_context* r300,
+ struct r500_fragment_shader* fs)
+{
+ CS_LOCALS(r300);
+ int i = 0;
+ BEGIN_CS(9 + (fs->instruction_count * 6));
+ OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO);
+ OUT_CS_REG(R500_US_PIXSIZE, fs->shader.stack_size);
+ OUT_CS_REG(R500_US_CODE_ADDR, R500_US_CODE_START_ADDR(0) |
+ R500_US_CODE_END_ADDR(fs->instruction_count));
+
+ OUT_CS_REG(R500_GA_US_VECTOR_INDEX, R500_GA_US_VECTOR_INDEX_TYPE_INSTR);
+ OUT_CS_ONE_REG(R500_GA_US_VECTOR_DATA,
+ fs->instruction_count * 6);
+ for (i = 0; i < fs->instruction_count; i++) {
+ OUT_CS(fs->instructions[i].inst0);
+ OUT_CS(fs->instructions[i].inst1);
+ OUT_CS(fs->instructions[i].inst2);
+ OUT_CS(fs->instructions[i].inst3);
+ OUT_CS(fs->instructions[i].inst4);
+ OUT_CS(fs->instructions[i].inst5);
+ }
+ END_CS;
+}
+
+/* Translate pipe_format into US_OUT_FMT. Note that formats are stored from
+ * C3 to C0. */
+uint32_t translate_out_fmt(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return R300_US_OUT_FMT_C4_8 |
+ R300_C0_SEL_B | R300_C1_SEL_G |
+ R300_C2_SEL_R | R300_C3_SEL_A;
+ default:
+ return R300_US_OUT_FMT_UNUSED;
+ }
+ return 0;
+}
+
+/* XXX add pitch, stride */
+void r300_emit_fb_state(struct r300_context* r300,
+ struct pipe_framebuffer_state* fb)
+{
+ CS_LOCALS(r300);
+ struct r300_texture* tex;
+ int i;
+
+ BEGIN_CS((5 * fb->nr_cbufs) + (fb->zsbuf ? 5 : 0) + 4);
+ for (i = 0; i < fb->nr_cbufs; i++) {
+ tex = (struct r300_texture*)fb->cbufs[i]->texture;
+ OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1);
+ OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+
+ OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i),
+ translate_out_fmt(fb->cbufs[i]->format));
+ }
+
+ if (fb->zsbuf) {
+ tex = (struct r300_texture*)fb->zsbuf->texture;
+ OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1);
+ OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ if (fb->zsbuf->format == PIPE_FORMAT_Z24S8_UNORM) {
+ OUT_CS_REG(R300_ZB_FORMAT,
+ R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL);
+ } else {
+ OUT_CS_REG(R300_ZB_FORMAT, 0x0);
+ }
+ }
+
+ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT,
+ R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS |
+ R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D);
+ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE |
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE);
+ END_CS;
+}
+
+void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
+{
+ struct r300_screen* r300screen =
+ (struct r300_screen*)r300->context.screen;
+ CS_LOCALS(r300);
+ BEGIN_CS(13);
+ OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
+ OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6);
+ OUT_CS(rs->depth_scale_front);
+ OUT_CS(rs->depth_offset_front);
+ OUT_CS(rs->depth_scale_back);
+ OUT_CS(rs->depth_offset_back);
+ OUT_CS(rs->polygon_offset_enable);
+ OUT_CS(rs->cull_mode);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, rs->line_stipple_config);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, rs->line_stipple_value);
+ END_CS;
+}
+
+void r300_emit_scissor_state(struct r300_context* r300,
+ struct r300_scissor_state* scissor)
+{
+ CS_LOCALS(r300);
+ BEGIN_CS(3);
+ OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
+ OUT_CS(scissor->scissor_top_left);
+ OUT_CS(scissor->scissor_bottom_right);
+ END_CS;
+}
+
+/* Emit all dirty state. */
+void r300_emit_dirty_state(struct r300_context* r300)
+{
+ struct r300_screen* r300screen =
+ (struct r300_screen*)r300->context.screen;
+ CS_LOCALS(r300);
+
+ if (!(r300->dirty_state) && !(r300->dirty_hw)) {
+ return;
+ }
+
+ /* XXX check size */
+
+ if (r300->dirty_state & R300_NEW_BLEND) {
+ r300_emit_blend_state(r300, r300->blend_state);
+ }
+
+ if (r300->dirty_state & R300_NEW_BLEND_COLOR) {
+ r300_emit_blend_color_state(r300, r300->blend_color_state);
+ }
+
+ if (r300->dirty_state & R300_NEW_DSA) {
+ r300_emit_dsa_state(r300, r300->dsa_state);
+ }
+
+ if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER) {
+ if (r300screen->caps->is_r500) {
+ r500_emit_fragment_shader(r300,
+ (struct r500_fragment_shader*)r300->fs);
+ } else {
+ r300_emit_fragment_shader(r300,
+ (struct r300_fragment_shader*)r300->fs);
+ }
+ }
+
+ if (r300->dirty_state & R300_NEW_RASTERIZER) {
+ r300_emit_rs_state(r300, r300->rs_state);
+ }
+
+ if (r300->dirty_state & R300_NEW_SCISSOR) {
+ r300_emit_scissor_state(r300, r300->scissor_state);
+ }
+
+ r300->dirty_state = 0;
+}
diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h
new file mode 100644
index 0000000000..f21ca33171
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_emit.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_EMIT_H
+#define R300_EMIT_H
+
+#include "util/u_math.h"
+
+#include "r300_context.h"
+#include "r300_cs.h"
+#include "r300_screen.h"
+
+void r300_emit_blend_state(struct r300_context* r300,
+ struct r300_blend_state* blend);
+
+void r300_emit_blend_color_state(struct r300_context* r300,
+ struct r300_blend_color_state* bc);
+
+void r300_emit_dsa_state(struct r300_context* r300,
+ struct r300_dsa_state* dsa);
+
+void r300_emit_fragment_shader(struct r300_context* r300,
+ struct r300_fragment_shader* fs);
+
+void r500_emit_fragment_shader(struct r300_context* r300,
+ struct r500_fragment_shader* fs);
+
+void r300_emit_fb_state(struct r300_context* r300,
+ struct pipe_framebuffer_state* fb);
+
+void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs);
+
+void r300_emit_scissor_state(struct r300_context* r300,
+ struct r300_scissor_state* scissor);
+
+
+/* Emit all dirty state. */
+void r300_emit_dirty_state(struct r300_context* r300);
+
+#endif /* R300_EMIT_H */
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
new file mode 100644
index 0000000000..3766f0a0a7
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_flush.h"
+
+static void r300_flush(struct pipe_context* pipe,
+ unsigned flags,
+ struct pipe_fence_handle** fence)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ CS_LOCALS(r300);
+
+ if (r300->dirty_hw) {
+ FLUSH_CS;
+ r300->dirty_state = R300_NEW_KITCHEN_SINK;
+ r300->dirty_hw = 0;
+ }
+}
+
+void r300_init_flush_functions(struct r300_context* r300)
+{
+ r300->context.flush = r300_flush;
+}
diff --git a/src/gallium/drivers/r300/r300_flush.h b/src/gallium/drivers/r300/r300_flush.h
new file mode 100644
index 0000000000..a1b224b39c
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_flush.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_FLUSH_H
+#define R300_FLUSH_H
+
+#include "pipe/p_context.h"
+
+#include "r300_context.h"
+#include "r300_cs.h"
+
+void r300_init_flush_functions(struct r300_context* r300);
+
+#endif /* R300_FLUSH_H */
diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
new file mode 100644
index 0000000000..468e0a2e44
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -0,0 +1,3250 @@
+/**************************************************************************
+
+Copyright (C) 2004-2005 Nicolai Haehnle et al.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/* *INDENT-OFF* */
+
+#ifndef _R300_REG_H
+#define _R300_REG_H
+
+#define R300_MC_INIT_MISC_LAT_TIMER 0x180
+# define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0
+# define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4
+# define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8
+# define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12
+# define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16
+# define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20
+# define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24
+# define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28
+
+
+#define R300_MC_INIT_GFX_LAT_TIMER 0x154
+# define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0
+# define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4
+# define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8
+# define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12
+# define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16
+# define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20
+# define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24
+# define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28
+
+/*
+ * This file contains registers and constants for the R300. They have been
+ * found mostly by examining command buffers captured using glxtest, as well
+ * as by extrapolating some known registers and constants from the R200.
+ * I am fairly certain that they are correct unless stated otherwise
+ * in comments.
+ */
+
+#define R300_SE_VPORT_XSCALE 0x1D98
+#define R300_SE_VPORT_XOFFSET 0x1D9C
+#define R300_SE_VPORT_YSCALE 0x1DA0
+#define R300_SE_VPORT_YOFFSET 0x1DA4
+#define R300_SE_VPORT_ZSCALE 0x1DA8
+#define R300_SE_VPORT_ZOFFSET 0x1DAC
+
+
+/*
+ * Vertex Array Processing (VAP) Control
+ */
+#define R300_VAP_CNTL 0x2080
+# define R300_PVS_NUM_SLOTS_SHIFT 0
+# define R300_PVS_NUM_CNTLRS_SHIFT 4
+# define R300_PVS_NUM_FPUS_SHIFT 8
+# define R300_VF_MAX_VTX_NUM_SHIFT 18
+# define R300_GL_CLIP_SPACE_DEF (0 << 22)
+# define R300_DX_CLIP_SPACE_DEF (1 << 22)
+# define R500_TCL_STATE_OPTIMIZATION (1 << 23)
+
+/* This register is written directly and also starts data section
+ * in many 3d CP_PACKET3's
+ */
+#define R300_VAP_VF_CNTL 0x2084
+# define R300_VAP_VF_CNTL__PRIM_TYPE__SHIFT 0
+# define R300_VAP_VF_CNTL__PRIM_NONE (0<<0)
+# define R300_VAP_VF_CNTL__PRIM_POINTS (1<<0)
+# define R300_VAP_VF_CNTL__PRIM_LINES (2<<0)
+# define R300_VAP_VF_CNTL__PRIM_LINE_STRIP (3<<0)
+# define R300_VAP_VF_CNTL__PRIM_TRIANGLES (4<<0)
+# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN (5<<0)
+# define R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP (6<<0)
+# define R300_VAP_VF_CNTL__PRIM_LINE_LOOP (12<<0)
+# define R300_VAP_VF_CNTL__PRIM_QUADS (13<<0)
+# define R300_VAP_VF_CNTL__PRIM_QUAD_STRIP (14<<0)
+# define R300_VAP_VF_CNTL__PRIM_POLYGON (15<<0)
+
+# define R300_VAP_VF_CNTL__PRIM_WALK__SHIFT 4
+ /* State based - direct writes to registers trigger vertex
+ generation */
+# define R300_VAP_VF_CNTL__PRIM_WALK_STATE_BASED (0<<4)
+# define R300_VAP_VF_CNTL__PRIM_WALK_INDICES (1<<4)
+# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST (2<<4)
+# define R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED (3<<4)
+
+ /* I don't think I saw these three used.. */
+# define R300_VAP_VF_CNTL__COLOR_ORDER__SHIFT 6
+# define R300_VAP_VF_CNTL__TCL_OUTPUT_CTL_ENA__SHIFT 9
+# define R300_VAP_VF_CNTL__PROG_STREAM_ENA__SHIFT 10
+
+ /* index size - when not set the indices are assumed to be 16 bit */
+# define R300_VAP_VF_CNTL__INDEX_SIZE_32bit (1<<11)
+ /* number of vertices */
+# define R300_VAP_VF_CNTL__NUM_VERTICES__SHIFT 16
+
+#define R500_VAP_INDEX_OFFSET 0x208c
+
+#define R300_VAP_OUTPUT_VTX_FMT_0 0x2090
+# define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0)
+# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT (1<<1)
+# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT (1<<2)
+# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT (1<<3)
+# define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT (1<<4)
+# define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16)
+
+#define R300_VAP_OUTPUT_VTX_FMT_1 0x2094
+ /* each of the following is 3 bits wide, specifies number
+ of components */
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18
+# define R300_VAP_OUTPUT_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21
+# define R300_VAP_OUTPUT_VTX_FMT_1__NOT_PRESENT 0
+# define R300_VAP_OUTPUT_VTX_FMT_1__1_COMPONENT 1
+# define R300_VAP_OUTPUT_VTX_FMT_1__2_COMPONENTS 2
+# define R300_VAP_OUTPUT_VTX_FMT_1__3_COMPONENTS 3
+# define R300_VAP_OUTPUT_VTX_FMT_1__4_COMPONENTS 4
+
+#define R300_SE_VTE_CNTL 0x20b0
+# define R300_VPORT_X_SCALE_ENA (1 << 0)
+# define R300_VPORT_X_OFFSET_ENA (1 << 1)
+# define R300_VPORT_Y_SCALE_ENA (1 << 2)
+# define R300_VPORT_Y_OFFSET_ENA (1 << 3)
+# define R300_VPORT_Z_SCALE_ENA (1 << 4)
+# define R300_VPORT_Z_OFFSET_ENA (1 << 5)
+# define R300_VTX_XY_FMT (1 << 8)
+# define R300_VTX_Z_FMT (1 << 9)
+# define R300_VTX_W0_FMT (1 << 10)
+# define R300_SERIAL_PROC_ENA (1 << 11)
+
+#define R300_VAP_VTX_SIZE 0x20b4
+
+/* BEGIN: Vertex data assembly - lots of uncertainties */
+
+/* gap */
+
+/* Maximum Vertex Indx Clamp */
+#define R300_VAP_VF_MAX_VTX_INDX 0x2134
+/* Minimum Vertex Indx Clamp */
+#define R300_VAP_VF_MIN_VTX_INDX 0x2138
+
+/** Vertex assembler/processor control status */
+#define R300_VAP_CNTL_STATUS 0x2140
+/* No swap at all (default) */
+# define R300_VC_NO_SWAP (0 << 0)
+/* 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC */
+# define R300_VC_16BIT_SWAP (1 << 0)
+/* 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA */
+# define R300_VC_32BIT_SWAP (2 << 0)
+/* Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB */
+# define R300_VC_HALF_DWORD_SWAP (3 << 0)
+/* The TCL engine will not be used (as it is logically or even physically removed) */
+# define R300_VAP_TCL_BYPASS (1 << 8)
+/* Read only flag if TCL engine is busy. */
+# define R300_VAP_PVS_BUSY (1 << 11)
+/* TODO: gap for MAX_MPS */
+/* Read only flag if the vertex store is busy. */
+# define R300_VAP_VS_BUSY (1 << 24)
+/* Read only flag if the reciprocal engine is busy. */
+# define R300_VAP_RCP_BUSY (1 << 25)
+/* Read only flag if the viewport transform engine is busy. */
+# define R300_VAP_VTE_BUSY (1 << 26)
+/* Read only flag if the memory interface unit is busy. */
+# define R300_VAP_MUI_BUSY (1 << 27)
+/* Read only flag if the vertex cache is busy. */
+# define R300_VAP_VC_BUSY (1 << 28)
+/* Read only flag if the vertex fetcher is busy. */
+# define R300_VAP_VF_BUSY (1 << 29)
+/* Read only flag if the register pipeline is busy. */
+# define R300_VAP_REGPIPE_BUSY (1 << 30)
+/* Read only flag if the VAP engine is busy. */
+# define R300_VAP_VAP_BUSY (1 << 31)
+
+/* gap */
+
+/* Where do we get our vertex data?
+ *
+ * Vertex data either comes either from immediate mode registers or from
+ * vertex arrays.
+ * There appears to be no mixed mode (though we can force the pitch of
+ * vertex arrays to 0, effectively reusing the same element over and over
+ * again).
+ *
+ * Immediate mode is controlled by the INPUT_CNTL registers. I am not sure
+ * if these registers influence vertex array processing.
+ *
+ * Vertex arrays are controlled via the 3D_LOAD_VBPNTR packet3.
+ *
+ * In both cases, vertex attributes are then passed through INPUT_ROUTE.
+ *
+ * Beginning with INPUT_ROUTE_0_0 is a list of WORDs that route vertex data
+ * into the vertex processor's input registers.
+ * The first word routes the first input, the second word the second, etc.
+ * The corresponding input is routed into the register with the given index.
+ * The list is ended by a word with INPUT_ROUTE_END set.
+ *
+ * Always set COMPONENTS_4 in immediate mode.
+ */
+
+#define R300_VAP_PROG_STREAM_CNTL_0 0x2150
+# define R300_DATA_TYPE_0_SHIFT 0
+# define R300_DATA_TYPE_FLOAT_1 0
+# define R300_DATA_TYPE_FLOAT_2 1
+# define R300_DATA_TYPE_FLOAT_3 2
+# define R300_DATA_TYPE_FLOAT_4 3
+# define R300_DATA_TYPE_BYTE 4
+# define R300_DATA_TYPE_D3DCOLOR 5
+# define R300_DATA_TYPE_SHORT_2 6
+# define R300_DATA_TYPE_SHORT_4 7
+# define R300_DATA_TYPE_VECTOR_3_TTT 8
+# define R300_DATA_TYPE_VECTOR_3_EET 9
+# define R300_SKIP_DWORDS_SHIFT 4
+# define R300_DST_VEC_LOC_SHIFT 8
+# define R300_LAST_VEC (1 << 13)
+# define R300_SIGNED (1 << 14)
+# define R300_NORMALIZE (1 << 15)
+# define R300_DATA_TYPE_1_SHIFT 16
+#define R300_VAP_PROG_STREAM_CNTL_1 0x2154
+#define R300_VAP_PROG_STREAM_CNTL_2 0x2158
+#define R300_VAP_PROG_STREAM_CNTL_3 0x215C
+#define R300_VAP_PROG_STREAM_CNTL_4 0x2160
+#define R300_VAP_PROG_STREAM_CNTL_5 0x2164
+#define R300_VAP_PROG_STREAM_CNTL_6 0x2168
+#define R300_VAP_PROG_STREAM_CNTL_7 0x216C
+/* gap */
+
+/* Notes:
+ * - always set up to produce at least two attributes:
+ * if vertex program uses only position, fglrx will set normal, too
+ * - INPUT_CNTL_0_COLOR and INPUT_CNTL_COLOR bits are always equal.
+ */
+#define R300_VAP_VTX_STATE_CNTL 0x2180
+# define R300_COLOR_0_ASSEMBLY_SHIFT 0
+# define R300_SEL_COLOR 0
+# define R300_SEL_USER_COLOR_0 1
+# define R300_SEL_USER_COLOR_1 2
+# define R300_COLOR_1_ASSEMBLY_SHIFT 2
+# define R300_COLOR_2_ASSEMBLY_SHIFT 4
+# define R300_COLOR_3_ASSEMBLY_SHIFT 6
+# define R300_COLOR_4_ASSEMBLY_SHIFT 8
+# define R300_COLOR_5_ASSEMBLY_SHIFT 10
+# define R300_COLOR_6_ASSEMBLY_SHIFT 12
+# define R300_COLOR_7_ASSEMBLY_SHIFT 14
+# define R300_UPDATE_USER_COLOR_0_ENA (1 << 16)
+
+/*
+ * Each bit in this field applies to the corresponding vector in the VSM
+ * memory (i.e. Bit 0 applies to VECTOR_0 (POSITION), etc.). If the bit
+ * is set, then the corresponding 4-Dword Vector is output into the Vertex Stream.
+ */
+#define R300_VAP_VSM_VTX_ASSM 0x2184
+# define R300_INPUT_CNTL_POS 0x00000001
+# define R300_INPUT_CNTL_NORMAL 0x00000002
+# define R300_INPUT_CNTL_COLOR 0x00000004
+# define R300_INPUT_CNTL_TC0 0x00000400
+# define R300_INPUT_CNTL_TC1 0x00000800
+# define R300_INPUT_CNTL_TC2 0x00001000 /* GUESS */
+# define R300_INPUT_CNTL_TC3 0x00002000 /* GUESS */
+# define R300_INPUT_CNTL_TC4 0x00004000 /* GUESS */
+# define R300_INPUT_CNTL_TC5 0x00008000 /* GUESS */
+# define R300_INPUT_CNTL_TC6 0x00010000 /* GUESS */
+# define R300_INPUT_CNTL_TC7 0x00020000 /* GUESS */
+
+/* Programmable Stream Control Signed Normalize Control */
+#define R300_VAP_PSC_SGN_NORM_CNTL 0x21dc
+# define SGN_NORM_ZERO 0
+# define SGN_NORM_ZERO_CLAMP_MINUS_ONE 1
+# define SGN_NORM_NO_ZERO 2
+
+/* gap */
+
+/* Words parallel to INPUT_ROUTE_0; All words that are active in INPUT_ROUTE_0
+ * are set to a swizzling bit pattern, other words are 0.
+ *
+ * In immediate mode, the pattern is always set to xyzw. In vertex array
+ * mode, the swizzling pattern is e.g. used to set zw components in texture
+ * coordinates with only tweo components.
+ */
+#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0
+# define R300_SWIZZLE0_SHIFT 0
+# define R300_SWIZZLE_SELECT_X_SHIFT 0
+# define R300_SWIZZLE_SELECT_Y_SHIFT 3
+# define R300_SWIZZLE_SELECT_Z_SHIFT 6
+# define R300_SWIZZLE_SELECT_W_SHIFT 9
+
+# define R300_SWIZZLE_SELECT_X 0
+# define R300_SWIZZLE_SELECT_Y 1
+# define R300_SWIZZLE_SELECT_Z 2
+# define R300_SWIZZLE_SELECT_W 3
+# define R300_SWIZZLE_SELECT_FP_ZERO 4
+# define R300_SWIZZLE_SELECT_FP_ONE 5
+/* alternate forms for r300_emit.c */
+# define R300_INPUT_ROUTE_SELECT_X 0
+# define R300_INPUT_ROUTE_SELECT_Y 1
+# define R300_INPUT_ROUTE_SELECT_Z 2
+# define R300_INPUT_ROUTE_SELECT_W 3
+# define R300_INPUT_ROUTE_SELECT_ZERO 4
+# define R300_INPUT_ROUTE_SELECT_ONE 5
+
+# define R300_WRITE_ENA_SHIFT 12
+# define R300_WRITE_ENA_X 1
+# define R300_WRITE_ENA_Y 2
+# define R300_WRITE_ENA_Z 4
+# define R300_WRITE_ENA_W 8
+# define R300_SWIZZLE1_SHIFT 16
+#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4
+#define R300_VAP_PROG_STREAM_CNTL_EXT_2 0x21e8
+#define R300_VAP_PROG_STREAM_CNTL_EXT_3 0x21ec
+#define R300_VAP_PROG_STREAM_CNTL_EXT_4 0x21f0
+#define R300_VAP_PROG_STREAM_CNTL_EXT_5 0x21f4
+#define R300_VAP_PROG_STREAM_CNTL_EXT_6 0x21f8
+#define R300_VAP_PROG_STREAM_CNTL_EXT_7 0x21fc
+
+/* END: Vertex data assembly */
+
+/* gap */
+
+/* BEGIN: Upload vertex program and data */
+
+/*
+ * The programmable vertex shader unit has a memory bank of unknown size
+ * that can be written to in 16 byte units by writing the address into
+ * UPLOAD_ADDRESS, followed by data in UPLOAD_DATA (multiples of 4 DWORDs).
+ *
+ * Pointers into the memory bank are always in multiples of 16 bytes.
+ *
+ * The memory bank is divided into areas with fixed meaning.
+ *
+ * Starting at address UPLOAD_PROGRAM: Vertex program instructions.
+ * Native limits reported by drivers from ATI suggest size 256 (i.e. 4KB),
+ * whereas the difference between known addresses suggests size 512.
+ *
+ * Starting at address UPLOAD_PARAMETERS: Vertex program parameters.
+ * Native reported limits and the VPI layout suggest size 256, whereas
+ * difference between known addresses suggests size 512.
+ *
+ * At address UPLOAD_POINTSIZE is a vector (0, 0, ps, 0), where ps is the
+ * floating point pointsize. The exact purpose of this state is uncertain,
+ * as there is also the R300_RE_POINTSIZE register.
+ *
+ * Multiple vertex programs and parameter sets can be loaded at once,
+ * which could explain the size discrepancy.
+ */
+#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200
+# define R300_PVS_CODE_START 0
+# define R300_MAX_PVS_CODE_LINES 256
+# define R500_MAX_PVS_CODE_LINES 1024
+# define R300_PVS_CONST_START 512
+# define R500_PVS_CONST_START 1024
+# define R300_MAX_PVS_CONST_VECS 256
+# define R500_MAX_PVS_CONST_VECS 1024
+# define R300_PVS_UCP_START 1024
+# define R500_PVS_UCP_START 1536
+# define R300_POINT_VPORT_SCALE_OFFSET 1030
+# define R500_POINT_VPORT_SCALE_OFFSET 1542
+# define R300_POINT_GEN_TEX_OFFSET 1031
+# define R500_POINT_GEN_TEX_OFFSET 1543
+
+/*
+ * These are obsolete defines form r300_context.h, but they might give some
+ * clues when investigating the addresses further...
+ */
+#if 0
+#define VSF_DEST_PROGRAM 0x0
+#define VSF_DEST_MATRIX0 0x200
+#define VSF_DEST_MATRIX1 0x204
+#define VSF_DEST_MATRIX2 0x208
+#define VSF_DEST_VECTOR0 0x20c
+#define VSF_DEST_VECTOR1 0x20d
+#define VSF_DEST_UNKNOWN1 0x400
+#define VSF_DEST_UNKNOWN2 0x406
+#endif
+
+/* gap */
+
+#define R300_VAP_PVS_UPLOAD_DATA 0x2208
+
+/* END: Upload vertex program and data */
+
+/* gap */
+
+/* I do not know the purpose of this register. However, I do know that
+ * it is set to 221C_CLEAR for clear operations and to 221C_NORMAL
+ * for normal rendering.
+ *
+ * 2007-11-05: This register is the user clip plane control register, but there
+ * also seems to be a rendering mode control; the NORMAL/CLEAR defines.
+ *
+ * See bug #9871. http://bugs.freedesktop.org/attachment.cgi?id=10672&action=view
+ */
+#define R300_VAP_CLIP_CNTL 0x221C
+# define R300_VAP_UCP_ENABLE_0 (1 << 0)
+# define R300_VAP_UCP_ENABLE_1 (1 << 1)
+# define R300_VAP_UCP_ENABLE_2 (1 << 2)
+# define R300_VAP_UCP_ENABLE_3 (1 << 3)
+# define R300_VAP_UCP_ENABLE_4 (1 << 4)
+# define R300_VAP_UCP_ENABLE_5 (1 << 5)
+# define R300_PS_UCP_MODE_DIST_COP (0 << 14)
+# define R300_PS_UCP_MODE_RADIUS_COP (1 << 14)
+# define R300_PS_UCP_MODE_RADIUS_COP_CLIP (2 << 14)
+# define R300_PS_UCP_MODE_CLIP_AS_TRIFAN (3 << 14)
+# define R300_CLIP_DISABLE (1 << 16)
+# define R300_UCP_CULL_ONLY_ENABLE (1 << 17)
+# define R300_BOUNDARY_EDGE_FLAG_ENABLE (1 << 18)
+# define R500_COLOR2_IS_TEXTURE (1 << 20)
+# define R500_COLOR3_IS_TEXTURE (1 << 21)
+
+/* These seem to be per-pixel and per-vertex X and Y clipping planes. The first
+ * plane is per-pixel and the second plane is per-vertex.
+ *
+ * This was determined by experimentation alone but I believe it is correct.
+ *
+ * These registers are called X_QUAD0_1_FL to X_QUAD0_4_FL by glxtest.
+ */
+#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220
+#define R300_VAP_GB_VERT_DISC_ADJ 0x2224
+#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228
+#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c
+
+/* gap */
+
+/* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between
+ * rendering commands and overwriting vertex program parameters.
+ * Therefore, I suspect writing zero to 0x2284 synchronizes the engine and
+ * avoids bugs caused by still running shaders reading bad data from memory.
+ */
+#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284
+
+/* This register is used to define the number of core clocks to wait for a
+ * vertex to be received by the VAP input controller (while the primitive
+ * path is backed up) before forcing any accumulated vertices to be submitted
+ * to the vertex processing path.
+ */
+#define VAP_PVS_VTX_TIMEOUT_REG 0x2288
+# define R300_2288_R300 0x00750000 /* -- nh */
+# define R300_2288_RV350 0x0000FFFF /* -- Vladimir */
+
+/* gap */
+
+/* Addresses are relative to the vertex program instruction area of the
+ * memory bank. PROGRAM_END points to the last instruction of the active
+ * program
+ *
+ * The meaning of the two UNKNOWN fields is obviously not known. However,
+ * experiments so far have shown that both *must* point to an instruction
+ * inside the vertex program, otherwise the GPU locks up.
+ *
+ * fglrx usually sets CNTL_3_UNKNOWN to the end of the program and
+ * R300_PVS_CNTL_1_POS_END_SHIFT points to instruction where last write to
+ * position takes place.
+ *
+ * Most likely this is used to ignore rest of the program in cases
+ * where group of verts arent visible. For some reason this "section"
+ * is sometimes accepted other instruction that have no relationship with
+ * position calculations.
+ */
+#define R300_VAP_PVS_CODE_CNTL_0 0x22D0
+# define R300_PVS_FIRST_INST_SHIFT 0
+# define R300_PVS_XYZW_VALID_INST_SHIFT 10
+# define R300_PVS_LAST_INST_SHIFT 20
+/* Addresses are relative the the vertex program parameters area. */
+#define R300_VAP_PVS_CONST_CNTL 0x22D4
+# define R300_PVS_CONST_BASE_OFFSET_SHIFT 0
+# define R300_PVS_MAX_CONST_ADDR_SHIFT 16
+#define R300_VAP_PVS_CODE_CNTL_1 0x22D8
+# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0
+#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22DC
+
+/* The entire range from 0x2300 to 0x2AC inclusive seems to be used for
+ * immediate vertices
+ */
+#define R300_VAP_VTX_COLOR_R 0x2464
+#define R300_VAP_VTX_COLOR_G 0x2468
+#define R300_VAP_VTX_COLOR_B 0x246C
+#define R300_VAP_VTX_POS_0_X_1 0x2490 /* used for glVertex2*() */
+#define R300_VAP_VTX_POS_0_Y_1 0x2494
+#define R300_VAP_VTX_COLOR_PKD 0x249C /* RGBA */
+#define R300_VAP_VTX_POS_0_X_2 0x24A0 /* used for glVertex3*() */
+#define R300_VAP_VTX_POS_0_Y_2 0x24A4
+#define R300_VAP_VTX_POS_0_Z_2 0x24A8
+/* write 0 to indicate end of packet? */
+#define R300_VAP_VTX_END_OF_PKT 0x24AC
+
+/* gap */
+
+/* These are values from r300_reg/r300_reg.h - they are known to be correct
+ * and are here so we can use one register file instead of several
+ * - Vladimir
+ */
+#define R300_GB_VAP_RASTER_VTX_FMT_0 0x4000
+# define R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT (1<<0)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT (1<<1)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_1_PRESENT (1<<2)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_2_PRESENT (1<<3)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_3_PRESENT (1<<4)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_SPACE (0xf<<5)
+# define R300_GB_VAP_RASTER_VTX_FMT_0__PT_SIZE_PRESENT (0x1<<16)
+
+#define R300_GB_VAP_RASTER_VTX_FMT_1 0x4004
+ /* each of the following is 3 bits wide, specifies number
+ of components */
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18
+# define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21
+
+/* UNK30 seems to enables point to quad transformation on textures
+ * (or something closely related to that).
+ * This bit is rather fatal at the time being due to lackings at pixel
+ * shader side
+ * Specifies top of Raster pipe specific enable controls.
+ */
+#define R300_GB_ENABLE 0x4008
+# define R300_GB_POINT_STUFF_DISABLE (0 << 0)
+# define R300_GB_POINT_STUFF_ENABLE (1 << 0) /* Specifies if points will have stuffed texture coordinates. */
+# define R300_GB_LINE_STUFF_DISABLE (0 << 1)
+# define R300_GB_LINE_STUFF_ENABLE (1 << 1) /* Specifies if lines will have stuffed texture coordinates. */
+# define R300_GB_TRIANGLE_STUFF_DISABLE (0 << 2)
+# define R300_GB_TRIANGLE_STUFF_ENABLE (1 << 2) /* Specifies if triangles will have stuffed texture coordinates. */
+# define R300_GB_STENCIL_AUTO_DISABLE (0 << 4)
+# define R300_GB_STENCIL_AUTO_ENABLE (1 << 4) /* Enable stencil auto inc/dec based on triangle cw/ccw, force into dzy low bit. */
+# define R300_GB_STENCIL_AUTO_FORCE (2 << 4) /* Force 0 into dzy low bit. */
+
+ /* each of the following is 2 bits wide */
+#define R300_GB_TEX_REPLICATE 0 /* Replicate VAP source texture coordinates (S,T,[R,Q]). */
+#define R300_GB_TEX_ST 1 /* Stuff with source texture coordinates (S,T). */
+#define R300_GB_TEX_STR 2 /* Stuff with source texture coordinates (S,T,R). */
+# define R300_GB_TEX0_SOURCE_SHIFT 16
+# define R300_GB_TEX1_SOURCE_SHIFT 18
+# define R300_GB_TEX2_SOURCE_SHIFT 20
+# define R300_GB_TEX3_SOURCE_SHIFT 22
+# define R300_GB_TEX4_SOURCE_SHIFT 24
+# define R300_GB_TEX5_SOURCE_SHIFT 26
+# define R300_GB_TEX6_SOURCE_SHIFT 28
+# define R300_GB_TEX7_SOURCE_SHIFT 30
+
+/* MSPOS - positions for multisample antialiasing (?) */
+#define R300_GB_MSPOS0 0x4010
+ /* shifts - each of the fields is 4 bits */
+# define R300_GB_MSPOS0__MS_X0_SHIFT 0
+# define R300_GB_MSPOS0__MS_Y0_SHIFT 4
+# define R300_GB_MSPOS0__MS_X1_SHIFT 8
+# define R300_GB_MSPOS0__MS_Y1_SHIFT 12
+# define R300_GB_MSPOS0__MS_X2_SHIFT 16
+# define R300_GB_MSPOS0__MS_Y2_SHIFT 20
+# define R300_GB_MSPOS0__MSBD0_Y 24
+# define R300_GB_MSPOS0__MSBD0_X 28
+
+#define R300_GB_MSPOS1 0x4014
+# define R300_GB_MSPOS1__MS_X3_SHIFT 0
+# define R300_GB_MSPOS1__MS_Y3_SHIFT 4
+# define R300_GB_MSPOS1__MS_X4_SHIFT 8
+# define R300_GB_MSPOS1__MS_Y4_SHIFT 12
+# define R300_GB_MSPOS1__MS_X5_SHIFT 16
+# define R300_GB_MSPOS1__MS_Y5_SHIFT 20
+# define R300_GB_MSPOS1__MSBD1 24
+
+/* Specifies the graphics pipeline configuration for rasterization. */
+#define R300_GB_TILE_CONFIG 0x4018
+# define R300_GB_TILE_DISABLE (0 << 0)
+# define R300_GB_TILE_ENABLE (1 << 0)
+# define R300_GB_TILE_PIPE_COUNT_RV300 (0 << 1) /* RV350 (1 pipe, 1 ctx) */
+# define R300_GB_TILE_PIPE_COUNT_R300 (3 << 1) /* R300 (2 pipes, 1 ctx) */
+# define R300_GB_TILE_PIPE_COUNT_R420_3P (6 << 1) /* R420-3P (3 pipes, 1 ctx) */
+# define R300_GB_TILE_PIPE_COUNT_R420 (7 << 1) /* R420 (4 pipes, 1 ctx) */
+# define R300_GB_TILE_SIZE_8 (0 << 4)
+# define R300_GB_TILE_SIZE_16 (1 << 4)
+# define R300_GB_TILE_SIZE_32 (2 << 4)
+# define R300_GB_SUPER_SIZE_1 (0 << 6)
+# define R300_GB_SUPER_SIZE_2 (1 << 6)
+# define R300_GB_SUPER_SIZE_4 (2 << 6)
+# define R300_GB_SUPER_SIZE_8 (3 << 6)
+# define R300_GB_SUPER_SIZE_16 (4 << 6)
+# define R300_GB_SUPER_SIZE_32 (5 << 6)
+# define R300_GB_SUPER_SIZE_64 (6 << 6)
+# define R300_GB_SUPER_SIZE_128 (7 << 6)
+# define R300_GB_SUPER_X_SHIFT 9 /* 3 bits wide */
+# define R300_GB_SUPER_Y_SHIFT 12 /* 3 bits wide */
+# define R300_GB_SUPER_TILE_A (0 << 15)
+# define R300_GB_SUPER_TILE_B (1 << 15)
+# define R300_GB_SUBPIXEL_1_12 (0 << 16)
+# define R300_GB_SUBPIXEL_1_16 (1 << 16)
+# define GB_TILE_CONFIG_QUADS_PER_RAS_4 (0 << 17)
+# define GB_TILE_CONFIG_QUADS_PER_RAS_8 (1 << 17)
+# define GB_TILE_CONFIG_QUADS_PER_RAS_16 (2 << 17)
+# define GB_TILE_CONFIG_QUADS_PER_RAS_32 (3 << 17)
+# define GB_TILE_CONFIG_BB_SCAN_INTERCEPT (0 << 19)
+# define GB_TILE_CONFIG_BB_SCAN_BOUND_BOX (1 << 19)
+# define GB_TILE_CONFIG_ALT_SCAN_EN_LR (0 << 20)
+# define GB_TILE_CONFIG_ALT_SCAN_EN_LRL (1 << 20)
+# define GB_TILE_CONFIG_ALT_OFFSET (0 << 21)
+# define GB_TILE_CONFIG_SUBPRECISION (0 << 22)
+# define GB_TILE_CONFIG_ALT_TILING_DEF (0 << 23)
+# define GB_TILE_CONFIG_ALT_TILING_3_2 (1 << 23)
+# define GB_TILE_CONFIG_Z_EXTENDED_24_1 (0 << 24)
+# define GB_TILE_CONFIG_Z_EXTENDED_S25_1 (1 << 24)
+
+/* Specifies the sizes of the various FIFO`s in the sc/rs/us. This register must be the first one written */
+#define R300_GB_FIFO_SIZE 0x4024
+ /* each of the following is 2 bits wide */
+#define R300_GB_FIFO_SIZE_32 0
+#define R300_GB_FIFO_SIZE_64 1
+#define R300_GB_FIFO_SIZE_128 2
+#define R300_GB_FIFO_SIZE_256 3
+# define R300_SC_IFIFO_SIZE_SHIFT 0
+# define R300_SC_TZFIFO_SIZE_SHIFT 2
+# define R300_SC_BFIFO_SIZE_SHIFT 4
+
+# define R300_US_OFIFO_SIZE_SHIFT 12
+# define R300_US_WFIFO_SIZE_SHIFT 14
+ /* the following use the same constants as above, but meaning is
+ is times 2 (i.e. instead of 32 words it means 64 */
+# define R300_RS_TFIFO_SIZE_SHIFT 6
+# define R300_RS_CFIFO_SIZE_SHIFT 8
+# define R300_US_RAM_SIZE_SHIFT 10
+ /* watermarks, 3 bits wide */
+# define R300_RS_HIGHWATER_COL_SHIFT 16
+# define R300_RS_HIGHWATER_TEX_SHIFT 19
+# define R300_OFIFO_HIGHWATER_SHIFT 22 /* two bits only */
+# define R300_CUBE_FIFO_HIGHWATER_COL_SHIFT 24
+
+#define GB_Z_PEQ_CONFIG 0x4028
+# define GB_Z_PEQ_CONFIG_Z_PEQ_SIZE_4_4 (0 << 0)
+# define GB_Z_PEQ_CONFIG_Z_PEQ_SIZE_8_8 (1 << 0)
+
+/* Specifies various polygon specific selects (fog, depth, perspective). */
+#define R300_GB_SELECT 0x401c
+# define R300_GB_FOG_SELECT_C0A (0 << 0)
+# define R300_GB_FOG_SELECT_C1A (1 << 0)
+# define R300_GB_FOG_SELECT_C2A (2 << 0)
+# define R300_GB_FOG_SELECT_C3A (3 << 0)
+# define R300_GB_FOG_SELECT_1_1_W (4 << 0)
+# define R300_GB_FOG_SELECT_Z (5 << 0)
+# define R300_GB_DEPTH_SELECT_Z (0 << 3)
+# define R300_GB_DEPTH_SELECT_1_1_W (1 << 3)
+# define R300_GB_W_SELECT_1_W (0 << 4)
+# define R300_GB_W_SELECT_1 (1 << 4)
+# define R300_GB_FOG_STUFF_DISABLE (0 << 5)
+# define R300_GB_FOG_STUFF_ENABLE (1 << 5)
+# define R300_GB_FOG_STUFF_TEX_SHIFT 6
+# define R300_GB_FOG_STUFF_TEX_MASK 0x000003c0
+# define R300_GB_FOG_STUFF_COMP_SHIFT 10
+# define R300_GB_FOG_STUFF_COMP_MASK 0x00000c00
+
+/* Specifies the graphics pipeline configuration for antialiasing. */
+#define R300_GB_AA_CONFIG 0x4020
+# define GB_AA_CONFIG_AA_DISABLE (0 << 0)
+# define GB_AA_CONFIG_AA_ENABLE (1 << 0)
+# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_2 (0 << 1)
+# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_3 (1 << 1)
+# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_4 (2 << 1)
+# define GB_AA_CONFIG_NUM_AA_SUBSAMPLES_6 (3 << 1)
+
+/* Selects which of 4 pipes are active. */
+#define GB_PIPE_SELECT 0x402c
+# define GB_PIPE_SELECT_PIPE0_ID_SHIFT 0
+# define GB_PIPE_SELECT_PIPE1_ID_SHIFT 2
+# define GB_PIPE_SELECT_PIPE2_ID_SHIFT 4
+# define GB_PIPE_SELECT_PIPE3_ID_SHIFT 6
+# define GB_PIPE_SELECT_PIPE_MASK_SHIFT 8
+# define GB_PIPE_SELECT_MAX_PIPE 12
+# define GB_PIPE_SELECT_BAD_PIPES 14
+# define GB_PIPE_SELECT_CONFIG_PIPES 18
+
+
+/* Specifies the sizes of the various FIFO`s in the sc/rs. */
+#define GB_FIFO_SIZE1 0x4070
+/* High water mark for SC input fifo */
+# define GB_FIFO_SIZE1_SC_HIGHWATER_IFIFO_SHIFT 0
+# define GB_FIFO_SIZE1_SC_HIGHWATER_IFIFO_MASK 0x0000003f
+/* High water mark for SC input fifo (B) */
+# define GB_FIFO_SIZE1_SC_HIGHWATER_BFIFO_SHIFT 6
+# define GB_FIFO_SIZE1_SC_HIGHWATER_BFIFO_MASK 0x00000fc0
+/* High water mark for RS colors' fifo */
+# define GB_FIFO_SIZE1_SC_HIGHWATER_COL_SHIFT 12
+# define GB_FIFO_SIZE1_SC_HIGHWATER_COL_MASK 0x0003f000
+/* High water mark for RS textures' fifo */
+# define GB_FIFO_SIZE1_SC_HIGHWATER_TEX_SHIFT 18
+# define GB_FIFO_SIZE1_SC_HIGHWATER_TEX_MASK 0x00fc0000
+
+/* This table specifies the source location and format for up to 16 texture
+ * addresses (i[0]:i[15]) and four colors (c[0]:c[3])
+ */
+#define R500_RS_IP_0 0x4074
+#define R500_RS_IP_1 0x4078
+#define R500_RS_IP_2 0x407C
+#define R500_RS_IP_3 0x4080
+#define R500_RS_IP_4 0x4084
+#define R500_RS_IP_5 0x4088
+#define R500_RS_IP_6 0x408C
+#define R500_RS_IP_7 0x4090
+#define R500_RS_IP_8 0x4094
+#define R500_RS_IP_9 0x4098
+#define R500_RS_IP_10 0x409C
+#define R500_RS_IP_11 0x40A0
+#define R500_RS_IP_12 0x40A4
+#define R500_RS_IP_13 0x40A8
+#define R500_RS_IP_14 0x40AC
+#define R500_RS_IP_15 0x40B0
+#define R500_RS_IP_PTR_K0 62
+#define R500_RS_IP_PTR_K1 63
+#define R500_RS_IP_TEX_PTR_S_SHIFT 0
+#define R500_RS_IP_TEX_PTR_T_SHIFT 6
+#define R500_RS_IP_TEX_PTR_R_SHIFT 12
+#define R500_RS_IP_TEX_PTR_Q_SHIFT 18
+#define R500_RS_IP_COL_PTR_SHIFT 24
+#define R500_RS_IP_COL_FMT_SHIFT 27
+# define R500_RS_COL_PTR(x) (x << 24)
+# define R500_RS_COL_FMT(x) (x << 27)
+/* gap */
+#define R500_RS_IP_OFFSET_DIS (0 << 31)
+#define R500_RS_IP_OFFSET_EN (1 << 31)
+
+/* gap */
+
+/* Zero to flush caches. */
+#define R300_TX_INVALTAGS 0x4100
+#define R300_TX_FLUSH 0x0
+
+/* The upper enable bits are guessed, based on fglrx reported limits. */
+#define R300_TX_ENABLE 0x4104
+# define R300_TX_ENABLE_0 (1 << 0)
+# define R300_TX_ENABLE_1 (1 << 1)
+# define R300_TX_ENABLE_2 (1 << 2)
+# define R300_TX_ENABLE_3 (1 << 3)
+# define R300_TX_ENABLE_4 (1 << 4)
+# define R300_TX_ENABLE_5 (1 << 5)
+# define R300_TX_ENABLE_6 (1 << 6)
+# define R300_TX_ENABLE_7 (1 << 7)
+# define R300_TX_ENABLE_8 (1 << 8)
+# define R300_TX_ENABLE_9 (1 << 9)
+# define R300_TX_ENABLE_10 (1 << 10)
+# define R300_TX_ENABLE_11 (1 << 11)
+# define R300_TX_ENABLE_12 (1 << 12)
+# define R300_TX_ENABLE_13 (1 << 13)
+# define R300_TX_ENABLE_14 (1 << 14)
+# define R300_TX_ENABLE_15 (1 << 15)
+
+#define R500_TX_FILTER_4 0x4110
+# define R500_TX_WEIGHT_1_SHIFT (0)
+# define R500_TX_WEIGHT_0_SHIFT (11)
+# define R500_TX_WEIGHT_PAIR (1<<22)
+# define R500_TX_PHASE_SHIFT (23)
+# define R500_TX_DIRECTION_HORIZONTAL (0<<27)
+# define R500_TX_DIRECTION_VERITCAL (1<<27)
+
+/* S Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */
+#define R300_GA_POINT_S0 0x4200
+
+/* T Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */
+#define R300_GA_POINT_T0 0x4204
+
+/* S Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */
+#define R300_GA_POINT_S1 0x4208
+
+/* T Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */
+#define R300_GA_POINT_T1 0x420c
+
+/* Specifies amount to shift integer position of vertex (screen space) before
+ * converting to float for triangle stipple.
+ */
+#define R300_GA_TRIANGLE_STIPPLE 0x4214
+# define R300_GA_TRIANGLE_STIPPLE_X_SHIFT_SHIFT 0
+# define R300_GA_TRIANGLE_STIPPLE_X_SHIFT_MASK 0x0000000f
+# define R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT 16
+# define R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_MASK 0x000f0000
+
+/* The pointsize is given in multiples of 6. The pointsize can be enormous:
+ * Clear() renders a single point that fills the entire framebuffer.
+ * 1/2 Height of point; fixed (16.0), subpixel format (1/12 or 1/16, even if in
+ * 8b precision).
+ */
+#define R300_GA_POINT_SIZE 0x421C
+# define R300_POINTSIZE_Y_SHIFT 0
+# define R300_POINTSIZE_Y_MASK 0x0000ffff
+# define R300_POINTSIZE_X_SHIFT 16
+# define R300_POINTSIZE_X_MASK 0xffff0000
+# define R300_POINTSIZE_MAX (R300_POINTSIZE_Y_MASK / 6)
+
+/* Blue fill color */
+#define R500_GA_FILL_R 0x4220
+
+/* Blue fill color */
+#define R500_GA_FILL_G 0x4224
+
+/* Blue fill color */
+#define R500_GA_FILL_B 0x4228
+
+/* Alpha fill color */
+#define R500_GA_FILL_A 0x422c
+
+
+/* Specifies maximum and minimum point & sprite sizes for per vertex size
+ * specification. The lower part (15:0) is MIN and (31:16) is max.
+ */
+#define R300_GA_POINT_MINMAX 0x4230
+# define R300_GA_POINT_MINMAX_MIN_SHIFT 0
+# define R300_GA_POINT_MINMAX_MIN_MASK (0xFFFF << 0)
+# define R300_GA_POINT_MINMAX_MAX_SHIFT 16
+# define R300_GA_POINT_MINMAX_MAX_MASK (0xFFFF << 16)
+
+/* 1/2 width of line, in subpixels (1/12 or 1/16 only, even in 8b
+ * subprecision); (16.0) fixed format.
+ *
+ * The line width is given in multiples of 6.
+ * In default mode lines are classified as vertical lines.
+ * HO: horizontal
+ * VE: vertical or horizontal
+ * HO & VE: no classification
+ */
+#define R300_GA_LINE_CNTL 0x4234
+# define R300_GA_LINE_CNTL_WIDTH_SHIFT 0
+# define R300_GA_LINE_CNTL_WIDTH_MASK 0x0000ffff
+# define R300_GA_LINE_CNTL_END_TYPE_HOR (0 << 16)
+# define R300_GA_LINE_CNTL_END_TYPE_VER (1 << 16)
+# define R300_GA_LINE_CNTL_END_TYPE_SQR (2 << 16) /* horizontal or vertical depending upon slope */
+# define R300_GA_LINE_CNTL_END_TYPE_COMP (3 << 16) /* Computed (perpendicular to slope) */
+# define R500_GA_LINE_CNTL_SORT_NO (0 << 18)
+# define R500_GA_LINE_CNTL_SORT_MINX_MINY (1 << 18)
+/** TODO: looks wrong */
+# define R300_LINESIZE_MAX (R300_GA_LINE_CNTL_WIDTH_MASK / 6)
+/** TODO: looks wrong */
+# define R300_LINE_CNT_HO (1 << 16)
+/** TODO: looks wrong */
+# define R300_LINE_CNT_VE (1 << 17)
+
+/* Line Stipple configuration information. */
+#define R300_GA_LINE_STIPPLE_CONFIG 0x4238
+# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_NO (0 << 0)
+# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_LINE (1 << 0)
+# define R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_PACKET (2 << 0)
+# define R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_SHIFT 2
+# define R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_MASK 0xfffffffc
+
+/* Used to load US instructions and constants */
+#define R500_GA_US_VECTOR_INDEX 0x4250
+# define R500_GA_US_VECTOR_INDEX_SHIFT 0
+# define R500_GA_US_VECTOR_INDEX_MASK 0x000000ff
+# define R500_GA_US_VECTOR_INDEX_TYPE_INSTR (0 << 16)
+# define R500_GA_US_VECTOR_INDEX_TYPE_CONST (1 << 16)
+# define R500_GA_US_VECTOR_INDEX_CLAMP_NO (0 << 17)
+# define R500_GA_US_VECTOR_INDEX_CLAMP_CONST (1 << 17)
+
+/* Data register for loading US instructions and constants */
+#define R500_GA_US_VECTOR_DATA 0x4254
+
+/* Specifies color properties and mappings of textures. */
+#define R500_GA_COLOR_CONTROL_PS3 0x4258
+# define R500_TEX0_SHADING_PS3_SOLID (0 << 0)
+# define R500_TEX0_SHADING_PS3_FLAT (1 << 0)
+# define R500_TEX0_SHADING_PS3_GOURAUD (2 << 0)
+# define R500_TEX1_SHADING_PS3_SOLID (0 << 2)
+# define R500_TEX1_SHADING_PS3_FLAT (1 << 2)
+# define R500_TEX1_SHADING_PS3_GOURAUD (2 << 2)
+# define R500_TEX2_SHADING_PS3_SOLID (0 << 4)
+# define R500_TEX2_SHADING_PS3_FLAT (1 << 4)
+# define R500_TEX2_SHADING_PS3_GOURAUD (2 << 4)
+# define R500_TEX3_SHADING_PS3_SOLID (0 << 6)
+# define R500_TEX3_SHADING_PS3_FLAT (1 << 6)
+# define R500_TEX3_SHADING_PS3_GOURAUD (2 << 6)
+# define R500_TEX4_SHADING_PS3_SOLID (0 << 8)
+# define R500_TEX4_SHADING_PS3_FLAT (1 << 8)
+# define R500_TEX4_SHADING_PS3_GOURAUD (2 << 8)
+# define R500_TEX5_SHADING_PS3_SOLID (0 << 10)
+# define R500_TEX5_SHADING_PS3_FLAT (1 << 10)
+# define R500_TEX5_SHADING_PS3_GOURAUD (2 << 10)
+# define R500_TEX6_SHADING_PS3_SOLID (0 << 12)
+# define R500_TEX6_SHADING_PS3_FLAT (1 << 12)
+# define R500_TEX6_SHADING_PS3_GOURAUD (2 << 12)
+# define R500_TEX7_SHADING_PS3_SOLID (0 << 14)
+# define R500_TEX7_SHADING_PS3_FLAT (1 << 14)
+# define R500_TEX7_SHADING_PS3_GOURAUD (2 << 14)
+# define R500_TEX8_SHADING_PS3_SOLID (0 << 16)
+# define R500_TEX8_SHADING_PS3_FLAT (1 << 16)
+# define R500_TEX8_SHADING_PS3_GOURAUD (2 << 16)
+# define R500_TEX9_SHADING_PS3_SOLID (0 << 18)
+# define R500_TEX9_SHADING_PS3_FLAT (1 << 18)
+# define R500_TEX9_SHADING_PS3_GOURAUD (2 << 18)
+# define R500_TEX10_SHADING_PS3_SOLID (0 << 20)
+# define R500_TEX10_SHADING_PS3_FLAT (1 << 20)
+# define R500_TEX10_SHADING_PS3_GOURAUD (2 << 20)
+# define R500_COLOR0_TEX_OVERRIDE_NO (0 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_0 (1 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_1 (2 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_2 (3 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_3 (4 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_4 (5 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_5 (6 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_6 (7 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_7 (8 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_8_C2 (9 << 22)
+# define R500_COLOR0_TEX_OVERRIDE_TEX_9_C3 (10 << 22)
+# define R500_COLOR1_TEX_OVERRIDE_NO (0 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_0 (1 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_1 (2 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_2 (3 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_3 (4 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_4 (5 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_5 (6 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_6 (7 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_7 (8 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_8_C2 (9 << 26)
+# define R500_COLOR1_TEX_OVERRIDE_TEX_9_C3 (10 << 26)
+
+/* Returns idle status of various G3D block, captured when GA_IDLE written or
+ * when hard or soft reset asserted.
+ */
+#define R500_GA_IDLE 0x425c
+# define R500_GA_IDLE_PIPE3_Z_IDLE (0 << 0)
+# define R500_GA_IDLE_PIPE2_Z_IDLE (0 << 1)
+# define R500_GA_IDLE_PIPE3_CD_IDLE (0 << 2)
+# define R500_GA_IDLE_PIPE2_CD_IDLE (0 << 3)
+# define R500_GA_IDLE_PIPE3_FG_IDLE (0 << 4)
+# define R500_GA_IDLE_PIPE2_FG_IDLE (0 << 5)
+# define R500_GA_IDLE_PIPE3_US_IDLE (0 << 6)
+# define R500_GA_IDLE_PIPE2_US_IDLE (0 << 7)
+# define R500_GA_IDLE_PIPE3_SC_IDLE (0 << 8)
+# define R500_GA_IDLE_PIPE2_SC_IDLE (0 << 9)
+# define R500_GA_IDLE_PIPE3_RS_IDLE (0 << 10)
+# define R500_GA_IDLE_PIPE2_RS_IDLE (0 << 11)
+# define R500_GA_IDLE_PIPE1_Z_IDLE (0 << 12)
+# define R500_GA_IDLE_PIPE0_Z_IDLE (0 << 13)
+# define R500_GA_IDLE_PIPE1_CD_IDLE (0 << 14)
+# define R500_GA_IDLE_PIPE0_CD_IDLE (0 << 15)
+# define R500_GA_IDLE_PIPE1_FG_IDLE (0 << 16)
+# define R500_GA_IDLE_PIPE0_FG_IDLE (0 << 17)
+# define R500_GA_IDLE_PIPE1_US_IDLE (0 << 18)
+# define R500_GA_IDLE_PIPE0_US_IDLE (0 << 19)
+# define R500_GA_IDLE_PIPE1_SC_IDLE (0 << 20)
+# define R500_GA_IDLE_PIPE0_SC_IDLE (0 << 21)
+# define R500_GA_IDLE_PIPE1_RS_IDLE (0 << 22)
+# define R500_GA_IDLE_PIPE0_RS_IDLE (0 << 23)
+# define R500_GA_IDLE_SU_IDLE (0 << 24)
+# define R500_GA_IDLE_GA_IDLE (0 << 25)
+# define R500_GA_IDLE_GA_UNIT2_IDLE (0 << 26)
+
+/* Current value of stipple accumulator. */
+#define R300_GA_LINE_STIPPLE_VALUE 0x4260
+
+/* S Texture Coordinate Value for Vertex 0 of Line (stuff textures -- i.e. AA) */
+#define R300_GA_LINE_S0 0x4264
+/* S Texture Coordinate Value for Vertex 1 of Lines (V2 of parallelogram -- stuff textures -- i.e. AA) */
+#define R300_GA_LINE_S1 0x4268
+
+/* GA Input fifo high water marks */
+#define R500_GA_FIFO_CNTL 0x4270
+# define R500_GA_FIFO_CNTL_VERTEX_FIFO_MASK 0x00000007
+# define R500_GA_FIFO_CNTL_VERTEX_FIFO_SHIFT 0
+# define R500_GA_FIFO_CNTL_VERTEX_INDEX_MASK 0x00000038
+# define R500_GA_FIFO_CNTL_VERTEX_INDEX_SHIFT 3
+# define R500_GA_FIFO_CNTL_VERTEX_REG_MASK 0x00003fc0
+# define R500_GA_FIFO_CNTL_VERTEX_REG_SHIFT 6
+
+/* GA enhance/tweaks */
+#define R300_GA_ENHANCE 0x4274
+# define R300_GA_ENHANCE_DEADLOCK_CNTL_NO_EFFECT (0 << 0)
+# define R300_GA_ENHANCE_DEADLOCK_CNTL_PREVENT_TCL (1 << 0) /* Prevents TCL interface from deadlocking on GA side. */
+# define R300_GA_ENHANCE_FASTSYNC_CNTL_NO_EFFECT (0 << 1)
+# define R300_GA_ENHANCE_FASTSYNC_CNTL_ENABLE (1 << 1) /* Enables high-performance register/primitive switching. */
+# define R500_GA_ENHANCE_REG_READWRITE_NO_EFFECT (0 << 2) /* R520+ only */
+# define R500_GA_ENHANCE_REG_READWRITE_ENABLE (1 << 2) /* R520+ only, Enables GA support of simultaneous register reads and writes. */
+# define R500_GA_ENHANCE_REG_NOSTALL_NO_EFFECT (0 << 3)
+# define R500_GA_ENHANCE_REG_NOSTALL_ENABLE (1 << 3) /* Enables GA support of no-stall reads for register read back. */
+
+#define R300_GA_COLOR_CONTROL 0x4278
+# define R300_GA_COLOR_CONTROL_RGB0_SHADING_SOLID (0 << 0)
+# define R300_GA_COLOR_CONTROL_RGB0_SHADING_FLAT (1 << 0)
+# define R300_GA_COLOR_CONTROL_RGB0_SHADING_GOURAUD (2 << 0)
+# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_SOLID (0 << 2)
+# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_FLAT (1 << 2)
+# define R300_GA_COLOR_CONTROL_ALPHA0_SHADING_GOURAUD (2 << 2)
+# define R300_GA_COLOR_CONTROL_RGB1_SHADING_SOLID (0 << 4)
+# define R300_GA_COLOR_CONTROL_RGB1_SHADING_FLAT (1 << 4)
+# define R300_GA_COLOR_CONTROL_RGB1_SHADING_GOURAUD (2 << 4)
+# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_SOLID (0 << 6)
+# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_FLAT (1 << 6)
+# define R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD (2 << 6)
+# define R300_GA_COLOR_CONTROL_RGB2_SHADING_SOLID (0 << 8)
+# define R300_GA_COLOR_CONTROL_RGB2_SHADING_FLAT (1 << 8)
+# define R300_GA_COLOR_CONTROL_RGB2_SHADING_GOURAUD (2 << 8)
+# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_SOLID (0 << 10)
+# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_FLAT (1 << 10)
+# define R300_GA_COLOR_CONTROL_ALPHA2_SHADING_GOURAUD (2 << 10)
+# define R300_GA_COLOR_CONTROL_RGB3_SHADING_SOLID (0 << 12)
+# define R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT (1 << 12)
+# define R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD (2 << 12)
+# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_SOLID (0 << 14)
+# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_FLAT (1 << 14)
+# define R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD (2 << 14)
+# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_FIRST (0 << 16)
+# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_SECOND (1 << 16)
+# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_THIRD (2 << 16)
+# define R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST (3 << 16)
+
+/** TODO: might be candidate for removal */
+# define R300_RE_SHADE_MODEL_SMOOTH ( \
+ R300_GA_COLOR_CONTROL_RGB0_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_RGB1_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_RGB2_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST )
+/** TODO: might be candidate for removal, the GOURAUD stuff also looks buggy to me */
+# define R300_RE_SHADE_MODEL_FLAT ( \
+ R300_GA_COLOR_CONTROL_RGB0_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_FLAT | \
+ R300_GA_COLOR_CONTROL_RGB1_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_RGB2_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_FLAT | \
+ R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \
+ R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST )
+
+/* Specifies red & green components of fill color -- S312 format -- Backwards comp. */
+#define R300_GA_SOLID_RG 0x427c
+# define GA_SOLID_RG_COLOR_GREEN_SHIFT 0
+# define GA_SOLID_RG_COLOR_GREEN_MASK 0x0000ffff
+# define GA_SOLID_RG_COLOR_RED_SHIFT 16
+# define GA_SOLID_RG_COLOR_RED_MASK 0xffff0000
+/* Specifies blue & alpha components of fill color -- S312 format -- Backwards comp. */
+#define R300_GA_SOLID_BA 0x4280
+# define GA_SOLID_BA_COLOR_ALPHA_SHIFT 0
+# define GA_SOLID_BA_COLOR_ALPHA_MASK 0x0000ffff
+# define GA_SOLID_BA_COLOR_BLUE_SHIFT 16
+# define GA_SOLID_BA_COLOR_BLUE_MASK 0xffff0000
+
+/* Polygon Mode
+ * Dangerous
+ */
+#define R300_GA_POLY_MODE 0x4288
+# define R300_GA_POLY_MODE_DISABLE (0 << 0)
+# define R300_GA_POLY_MODE_DUAL (1 << 0) /* send 2 sets of 3 polys with specified poly type */
+/* reserved */
+# define R300_GA_POLY_MODE_FRONT_PTYPE_POINT (0 << 4)
+# define R300_GA_POLY_MODE_FRONT_PTYPE_LINE (1 << 4)
+# define R300_GA_POLY_MODE_FRONT_PTYPE_TRI (2 << 4)
+/* reserved */
+# define R300_GA_POLY_MODE_BACK_PTYPE_POINT (0 << 7)
+# define R300_GA_POLY_MODE_BACK_PTYPE_LINE (1 << 7)
+# define R300_GA_POLY_MODE_BACK_PTYPE_TRI (2 << 7)
+/* reserved */
+
+/* Specifies the rouding mode for geometry & color SPFP to FP conversions. */
+#define R300_GA_ROUND_MODE 0x428c
+# define R300_GA_ROUND_MODE_GEOMETRY_ROUND_TRUNC (0 << 0)
+# define R300_GA_ROUND_MODE_GEOMETRY_ROUND_NEAREST (1 << 0)
+# define R300_GA_ROUND_MODE_COLOR_ROUND_TRUNC (0 << 2)
+# define R300_GA_ROUND_MODE_COLOR_ROUND_NEAREST (1 << 2)
+# define R300_GA_ROUND_MODE_RGB_CLAMP_RGB (0 << 4)
+# define R300_GA_ROUND_MODE_RGB_CLAMP_FP20 (1 << 4)
+# define R300_GA_ROUND_MODE_ALPHA_CLAMP_RGB (0 << 5)
+# define R300_GA_ROUND_MODE_ALPHA_CLAMP_FP20 (1 << 5)
+# define R500_GA_ROUND_MODE_GEOMETRY_MASK_SHIFT 6
+# define R500_GA_ROUND_MODE_GEOMETRY_MASK_MASK 0x000003c0
+
+/* Specifies x & y offsets for vertex data after conversion to FP.
+ * Offsets are in S15 format (subpixels -- 1/12 or 1/16, even in 8b
+ * subprecision).
+ */
+#define R300_GA_OFFSET 0x4290
+# define R300_GA_OFFSET_X_OFFSET_SHIFT 0
+# define R300_GA_OFFSET_X_OFFSET_MASK 0x0000ffff
+# define R300_GA_OFFSET_Y_OFFSET_SHIFT 16
+# define R300_GA_OFFSET_Y_OFFSET_MASK 0xffff0000
+
+/* Specifies the scale to apply to fog. */
+#define R300_GA_FOG_SCALE 0x4294
+/* Specifies the offset to apply to fog. */
+#define R300_GA_FOG_OFFSET 0x4298
+/* Specifies number of cycles to assert reset, and also causes RB3D soft reset to assert. */
+#define R300_GA_SOFT_RESET 0x429c
+
+/* Not sure why there are duplicate of factor and constant values.
+ * My best guess so far is that there are seperate zbiases for test and write.
+ * Ordering might be wrong.
+ * Some of the tests indicate that fgl has a fallback implementation of zbias
+ * via pixel shaders.
+ */
+#define R300_SU_TEX_WRAP 0x42A0
+#define R300_SU_POLY_OFFSET_FRONT_SCALE 0x42A4
+#define R300_SU_POLY_OFFSET_FRONT_OFFSET 0x42A8
+#define R300_SU_POLY_OFFSET_BACK_SCALE 0x42AC
+#define R300_SU_POLY_OFFSET_BACK_OFFSET 0x42B0
+
+/* This register needs to be set to (1<<1) for RV350 to correctly
+ * perform depth test (see --vb-triangles in r300_demo)
+ * Don't know about other chips. - Vladimir
+ * This is set to 3 when GL_POLYGON_OFFSET_FILL is on.
+ * My guess is that there are two bits for each zbias primitive
+ * (FILL, LINE, POINT).
+ * One to enable depth test and one for depth write.
+ * Yet this doesnt explain why depth writes work ...
+ */
+#define R300_SU_POLY_OFFSET_ENABLE 0x42B4
+# define R300_FRONT_ENABLE (1 << 0)
+# define R300_BACK_ENABLE (1 << 1)
+# define R300_PARA_ENABLE (1 << 2)
+
+#define R300_SU_CULL_MODE 0x42B8
+# define R300_CULL_FRONT (1 << 0)
+# define R300_CULL_BACK (1 << 1)
+# define R300_FRONT_FACE_CCW (0 << 2)
+# define R300_FRONT_FACE_CW (1 << 2)
+
+/* SU Depth Scale value */
+#define R300_SU_DEPTH_SCALE 0x42c0
+/* SU Depth Offset value */
+#define R300_SU_DEPTH_OFFSET 0x42c4
+
+
+/* BEGIN: Rasterization / Interpolators - many guesses */
+
+/*
+ * TC_CNT is the number of incoming texture coordinate sets (i.e. it depends
+ * on the vertex program, *not* the fragment program)
+ */
+#define R300_RS_COUNT 0x4300
+# define R300_IT_COUNT_SHIFT 0
+# define R300_IT_COUNT_MASK 0x0000007f
+# define R300_IC_COUNT_SHIFT 7
+# define R300_IC_COUNT_MASK 0x00000780
+# define R300_W_ADDR_SHIFT 12
+# define R300_W_ADDR_MASK 0x0003f000
+# define R300_HIRES_DIS (0 << 18)
+# define R300_HIRES_EN (1 << 18)
+
+#define R300_RS_INST_COUNT 0x4304
+# define R300_RS_INST_COUNT_SHIFT 0
+# define R300_RS_INST_COUNT_MASK 0x0000000f
+# define R300_RS_TX_OFFSET_SHIFT 5
+# define R300_RS_TX_OFFSET_MASK 0x000000e0
+
+/* gap */
+
+/* Only used for texture coordinates.
+ * Use the source field to route texture coordinate input from the
+ * vertex program to the desired interpolator. Note that the source
+ * field is relative to the outputs the vertex program *actually*
+ * writes. If a vertex program only writes texcoord[1], this will
+ * be source index 0.
+ * Set INTERP_USED on all interpolators that produce data used by
+ * the fragment program. INTERP_USED looks like a swizzling mask,
+ * but I haven't seen it used that way.
+ *
+ * Note: The _UNKNOWN constants are always set in their respective
+ * register. I don't know if this is necessary.
+ */
+#define R300_RS_IP_0 0x4310
+#define R300_RS_IP_1 0x4314
+#define R300_RS_IP_2 0x4318
+#define R300_RS_IP_3 0x431C
+# define R300_RS_INTERP_SRC_SHIFT 2 /* TODO: check for removal */
+# define R300_RS_INTERP_SRC_MASK (7 << 2) /* TODO: check for removal */
+# define R300_RS_TEX_PTR(x) (x << 0)
+# define R300_RS_COL_PTR(x) (x << 6)
+# define R300_RS_COL_FMT(x) (x << 9)
+# define R300_RS_COL_FMT_RGBA 0
+# define R300_RS_COL_FMT_RGB0 1
+# define R300_RS_COL_FMT_RGB1 2
+# define R300_RS_COL_FMT_000A 4
+# define R300_RS_COL_FMT_0000 5
+# define R300_RS_COL_FMT_0001 6
+# define R300_RS_COL_FMT_111A 8
+# define R300_RS_COL_FMT_1110 9
+# define R300_RS_COL_FMT_1111 10
+# define R300_RS_SEL_S(x) (x << 13)
+# define R300_RS_SEL_T(x) (x << 16)
+# define R300_RS_SEL_R(x) (x << 19)
+# define R300_RS_SEL_Q(x) (x << 22)
+# define R300_RS_SEL_C0 0
+# define R300_RS_SEL_C1 1
+# define R300_RS_SEL_C2 2
+# define R300_RS_SEL_C3 3
+# define R300_RS_SEL_K0 4
+# define R300_RS_SEL_K1 5
+
+
+/* */
+#define R500_RS_INST_0 0x4320
+#define R500_RS_INST_1 0x4324
+#define R500_RS_INST_2 0x4328
+#define R500_RS_INST_3 0x432c
+#define R500_RS_INST_4 0x4330
+#define R500_RS_INST_5 0x4334
+#define R500_RS_INST_6 0x4338
+#define R500_RS_INST_7 0x433c
+#define R500_RS_INST_8 0x4340
+#define R500_RS_INST_9 0x4344
+#define R500_RS_INST_10 0x4348
+#define R500_RS_INST_11 0x434c
+#define R500_RS_INST_12 0x4350
+#define R500_RS_INST_13 0x4354
+#define R500_RS_INST_14 0x4358
+#define R500_RS_INST_15 0x435c
+#define R500_RS_INST_TEX_ID_SHIFT 0
+#define R500_RS_INST_TEX_CN_WRITE (1 << 4)
+#define R500_RS_INST_TEX_ADDR_SHIFT 5
+#define R500_RS_INST_COL_ID_SHIFT 12
+#define R500_RS_INST_COL_CN_NO_WRITE (0 << 16)
+#define R500_RS_INST_COL_CN_WRITE (1 << 16)
+#define R500_RS_INST_COL_CN_WRITE_FBUFFER (2 << 16)
+#define R500_RS_INST_COL_CN_WRITE_BACKFACE (3 << 16)
+#define R500_RS_INST_COL_ADDR_SHIFT 18
+#define R500_RS_INST_TEX_ADJ (1 << 25)
+#define R500_RS_INST_W_CN (1 << 26)
+
+/* These DWORDs control how vertex data is routed into fragment program
+ * registers, after interpolators.
+ */
+#define R300_RS_INST_0 0x4330
+#define R300_RS_INST_1 0x4334
+#define R300_RS_INST_2 0x4338
+#define R300_RS_INST_3 0x433C
+#define R300_RS_INST_4 0x4340
+#define R300_RS_INST_5 0x4344
+#define R300_RS_INST_6 0x4348
+#define R300_RS_INST_7 0x434C
+# define R300_RS_INST_TEX_ID(x) ((x) << 0)
+# define R300_RS_INST_TEX_CN_WRITE (1 << 3)
+# define R300_RS_INST_TEX_ADDR_SHIFT 6
+# define R300_RS_INST_COL_ID(x) ((x) << 11)
+# define R300_RS_INST_COL_CN_WRITE (1 << 14)
+# define R300_RS_INST_COL_ADDR_SHIFT 17
+# define R300_RS_INST_TEX_ADJ (1 << 22)
+# define R300_RS_COL_BIAS_UNUSED_SHIFT 23
+
+/* END: Rasterization / Interpolators - many guesses */
+
+/* Hierarchical Z Enable */
+#define R300_SC_HYPERZ 0x43a4
+# define R300_SC_HYPERZ_DISABLE (0 << 0)
+# define R300_SC_HYPERZ_ENABLE (1 << 0)
+# define R300_SC_HYPERZ_MIN (0 << 1)
+# define R300_SC_HYPERZ_MAX (1 << 1)
+# define R300_SC_HYPERZ_ADJ_256 (0 << 2)
+# define R300_SC_HYPERZ_ADJ_128 (1 << 2)
+# define R300_SC_HYPERZ_ADJ_64 (2 << 2)
+# define R300_SC_HYPERZ_ADJ_32 (3 << 2)
+# define R300_SC_HYPERZ_ADJ_16 (4 << 2)
+# define R300_SC_HYPERZ_ADJ_8 (5 << 2)
+# define R300_SC_HYPERZ_ADJ_4 (6 << 2)
+# define R300_SC_HYPERZ_ADJ_2 (7 << 2)
+# define R300_SC_HYPERZ_HZ_Z0MIN_NO (0 << 5)
+# define R300_SC_HYPERZ_HZ_Z0MIN (1 << 5)
+# define R300_SC_HYPERZ_HZ_Z0MAX_NO (0 << 6)
+# define R300_SC_HYPERZ_HZ_Z0MAX (1 << 6)
+
+#define R300_SC_EDGERULE 0x43a8
+
+/* BEGIN: Scissors and cliprects */
+
+/* There are four clipping rectangles. Their corner coordinates are inclusive.
+ * Every pixel is assigned a number from 0 and 15 by setting bits 0-3 depending
+ * on whether the pixel is inside cliprects 0-3, respectively. For example,
+ * if a pixel is inside cliprects 0 and 1, but outside 2 and 3, it is assigned
+ * the number 3 (binary 0011).
+ * Iff the bit corresponding to the pixel's number in RE_CLIPRECT_CNTL is set,
+ * the pixel is rasterized.
+ *
+ * In addition to this, there is a scissors rectangle. Only pixels inside the
+ * scissors rectangle are drawn. (coordinates are inclusive)
+ *
+ * For some reason, the top-left corner of the framebuffer is at (1440, 1440)
+ * for the purpose of clipping and scissors.
+ */
+#define R300_SC_CLIPRECT_TL_0 0x43B0
+#define R300_SC_CLIPRECT_BR_0 0x43B4
+#define R300_SC_CLIPRECT_TL_1 0x43B8
+#define R300_SC_CLIPRECT_BR_1 0x43BC
+#define R300_SC_CLIPRECT_TL_2 0x43C0
+#define R300_SC_CLIPRECT_BR_2 0x43C4
+#define R300_SC_CLIPRECT_TL_3 0x43C8
+#define R300_SC_CLIPRECT_BR_3 0x43CC
+# define R300_CLIPRECT_OFFSET 1440
+# define R300_CLIPRECT_MASK 0x1FFF
+# define R300_CLIPRECT_X_SHIFT 0
+# define R300_CLIPRECT_X_MASK (0x1FFF << 0)
+# define R300_CLIPRECT_Y_SHIFT 13
+# define R300_CLIPRECT_Y_MASK (0x1FFF << 13)
+#define R300_SC_CLIP_RULE 0x43D0
+# define R300_CLIP_OUT (1 << 0)
+# define R300_CLIP_0 (1 << 1)
+# define R300_CLIP_1 (1 << 2)
+# define R300_CLIP_10 (1 << 3)
+# define R300_CLIP_2 (1 << 4)
+# define R300_CLIP_20 (1 << 5)
+# define R300_CLIP_21 (1 << 6)
+# define R300_CLIP_210 (1 << 7)
+# define R300_CLIP_3 (1 << 8)
+# define R300_CLIP_30 (1 << 9)
+# define R300_CLIP_31 (1 << 10)
+# define R300_CLIP_310 (1 << 11)
+# define R300_CLIP_32 (1 << 12)
+# define R300_CLIP_320 (1 << 13)
+# define R300_CLIP_321 (1 << 14)
+# define R300_CLIP_3210 (1 << 15)
+
+/* gap */
+
+#define R300_SC_SCISSORS_TL 0x43E0
+#define R300_SC_SCISSORS_BR 0x43E4
+# define R300_SCISSORS_OFFSET 1440
+# define R300_SCISSORS_X_SHIFT 0
+# define R300_SCISSORS_X_MASK (0x1FFF << 0)
+# define R300_SCISSORS_Y_SHIFT 13
+# define R300_SCISSORS_Y_MASK (0x1FFF << 13)
+
+/* Screen door sample mask */
+#define R300_SC_SCREENDOOR 0x43e8
+
+/* END: Scissors and cliprects */
+
+/* BEGIN: Texture specification */
+
+/*
+ * The texture specification dwords are grouped by meaning and not by texture
+ * unit. This means that e.g. the offset for texture image unit N is found in
+ * register TX_OFFSET_0 + (4*N)
+ */
+#define R300_TX_FILTER0_0 0x4400
+#define R300_TX_FILTER0_1 0x4404
+#define R300_TX_FILTER0_2 0x4408
+#define R300_TX_FILTER0_3 0x440c
+#define R300_TX_FILTER0_4 0x4410
+#define R300_TX_FILTER0_5 0x4414
+#define R300_TX_FILTER0_6 0x4418
+#define R300_TX_FILTER0_7 0x441c
+#define R300_TX_FILTER0_8 0x4420
+#define R300_TX_FILTER0_9 0x4424
+#define R300_TX_FILTER0_10 0x4428
+#define R300_TX_FILTER0_11 0x442c
+#define R300_TX_FILTER0_12 0x4430
+#define R300_TX_FILTER0_13 0x4434
+#define R300_TX_FILTER0_14 0x4438
+#define R300_TX_FILTER0_15 0x443c
+# define R300_TX_REPEAT 0
+# define R300_TX_MIRRORED 1
+# define R300_TX_CLAMP_TO_EDGE 2
+# define R300_TX_MIRROR_ONCE_TO_EDGE 3
+# define R300_TX_CLAMP 4
+# define R300_TX_MIRROR_ONCE 5
+# define R300_TX_CLAMP_TO_BORDER 6
+# define R300_TX_MIRROR_ONCE_TO_BORDER 7
+# define R300_TX_WRAP_S_SHIFT 0
+# define R300_TX_WRAP_S_MASK (7 << 0)
+# define R300_TX_WRAP_T_SHIFT 3
+# define R300_TX_WRAP_T_MASK (7 << 3)
+# define R300_TX_WRAP_R_SHIFT 6
+# define R300_TX_WRAP_R_MASK (7 << 6)
+# define R300_TX_MAG_FILTER_4 (0 << 9)
+# define R300_TX_MAG_FILTER_NEAREST (1 << 9)
+# define R300_TX_MAG_FILTER_LINEAR (2 << 9)
+# define R300_TX_MAG_FILTER_ANISO (3 << 9)
+# define R300_TX_MAG_FILTER_MASK (3 << 9)
+# define R300_TX_MIN_FILTER_NEAREST (1 << 11)
+# define R300_TX_MIN_FILTER_LINEAR (2 << 11)
+# define R300_TX_MIN_FILTER_ANISO (3 << 11)
+# define R300_TX_MIN_FILTER_MASK (3 << 11)
+# define R300_TX_MIN_FILTER_MIP_NONE (0 << 13)
+# define R300_TX_MIN_FILTER_MIP_NEAREST (1 << 13)
+# define R300_TX_MIN_FILTER_MIP_LINEAR (2 << 13)
+# define R300_TX_MIN_FILTER_MIP_MASK (3 << 13)
+# define R300_TX_MAX_ANISO_1_TO_1 (0 << 21)
+# define R300_TX_MAX_ANISO_2_TO_1 (1 << 21)
+# define R300_TX_MAX_ANISO_4_TO_1 (2 << 21)
+# define R300_TX_MAX_ANISO_8_TO_1 (3 << 21)
+# define R300_TX_MAX_ANISO_16_TO_1 (4 << 21)
+# define R300_TX_MAX_ANISO_MASK (7 << 21)
+
+#define R300_TX_FILTER1_0 0x4440
+# define R300_CHROMA_KEY_MODE_DISABLE 0
+# define R300_CHROMA_KEY_FORCE 1
+# define R300_CHROMA_KEY_BLEND 2
+# define R300_MC_ROUND_NORMAL (0<<2)
+# define R300_MC_ROUND_MPEG4 (1<<2)
+# define R300_LOD_BIAS_SHIFT 3
+# define R300_LOD_BIAS_MASK 0x1ff8
+# define R300_EDGE_ANISO_EDGE_DIAG (0<<13)
+# define R300_EDGE_ANISO_EDGE_ONLY (1<<13)
+# define R300_MC_COORD_TRUNCATE_DISABLE (0<<14)
+# define R300_MC_COORD_TRUNCATE_MPEG (1<<14)
+# define R300_TX_TRI_PERF_0_8 (0<<15)
+# define R300_TX_TRI_PERF_1_8 (1<<15)
+# define R300_TX_TRI_PERF_1_4 (2<<15)
+# define R300_TX_TRI_PERF_3_8 (3<<15)
+# define R300_ANISO_THRESHOLD_MASK (7<<17)
+
+# define R500_MACRO_SWITCH (1<<22)
+# define R500_BORDER_FIX (1<<31)
+
+#define R300_TX_SIZE_0 0x4480
+# define R300_TX_WIDTHMASK_SHIFT 0
+# define R300_TX_WIDTHMASK_MASK (2047 << 0)
+# define R300_TX_HEIGHTMASK_SHIFT 11
+# define R300_TX_HEIGHTMASK_MASK (2047 << 11)
+# define R300_TX_DEPTHMASK_SHIFT 22
+# define R300_TX_DEPTHMASK_MASK (0xf << 22)
+# define R300_TX_MAX_MIP_LEVEL_SHIFT 26
+# define R300_TX_MAX_MIP_LEVEL_MASK (0xf << 26)
+# define R300_TX_SIZE_PROJECTED (1<<30)
+# define R300_TX_SIZE_TXPITCH_EN (1<<31)
+#define R300_TX_FORMAT_0 0x44C0
+ /* The interpretation of the format word by Wladimir van der Laan */
+ /* The X, Y, Z and W refer to the layout of the components.
+ They are given meanings as R, G, B and Alpha by the swizzle
+ specification */
+# define R300_TX_FORMAT_X8 0x0
+# define R500_TX_FORMAT_X1 0x0 // bit set in format 2
+# define R300_TX_FORMAT_X16 0x1
+# define R500_TX_FORMAT_X1_REV 0x0 // bit set in format 2
+# define R300_TX_FORMAT_Y4X4 0x2
+# define R300_TX_FORMAT_Y8X8 0x3
+# define R300_TX_FORMAT_Y16X16 0x4
+# define R300_TX_FORMAT_Z3Y3X2 0x5
+# define R300_TX_FORMAT_Z5Y6X5 0x6
+# define R300_TX_FORMAT_Z6Y5X5 0x7
+# define R300_TX_FORMAT_Z11Y11X10 0x8
+# define R300_TX_FORMAT_Z10Y11X11 0x9
+# define R300_TX_FORMAT_W4Z4Y4X4 0xA
+# define R300_TX_FORMAT_W1Z5Y5X5 0xB
+# define R300_TX_FORMAT_W8Z8Y8X8 0xC
+# define R300_TX_FORMAT_W2Z10Y10X10 0xD
+# define R300_TX_FORMAT_W16Z16Y16X16 0xE
+# define R300_TX_FORMAT_DXT1 0xF
+# define R300_TX_FORMAT_DXT3 0x10
+# define R300_TX_FORMAT_DXT5 0x11
+# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */
+# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */
+# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */
+# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */
+
+ /* These two values are wrong, but they're the only values that
+ * produce any even vaguely correct results. Can r300 only do 16-bit
+ * depth textures?
+ */
+# define R300_TX_FORMAT_X24_Y8 0x1e
+# define R300_TX_FORMAT_X32 0x1e
+
+ /* 0x16 - some 16 bit green format.. ?? */
+# define R300_TX_FORMAT_3D (1 << 25)
+# define R300_TX_FORMAT_CUBIC_MAP (2 << 25)
+
+ /* gap */
+ /* Floating point formats */
+ /* Note - hardware supports both 16 and 32 bit floating point */
+# define R300_TX_FORMAT_FL_I16 0x18
+# define R300_TX_FORMAT_FL_I16A16 0x19
+# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A
+# define R300_TX_FORMAT_FL_I32 0x1B
+# define R300_TX_FORMAT_FL_I32A32 0x1C
+# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D
+ /* alpha modes, convenience mostly */
+ /* if you have alpha, pick constant appropriate to the
+ number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */
+# define R300_TX_FORMAT_ALPHA_1CH 0x000
+# define R300_TX_FORMAT_ALPHA_2CH 0x200
+# define R300_TX_FORMAT_ALPHA_4CH 0x600
+# define R300_TX_FORMAT_ALPHA_NONE 0xA00
+ /* Swizzling */
+ /* constants */
+# define R300_TX_FORMAT_X 0
+# define R300_TX_FORMAT_Y 1
+# define R300_TX_FORMAT_Z 2
+# define R300_TX_FORMAT_W 3
+# define R300_TX_FORMAT_ZERO 4
+# define R300_TX_FORMAT_ONE 5
+ /* 2.0*Z, everything above 1.0 is set to 0.0 */
+# define R300_TX_FORMAT_CUT_Z 6
+ /* 2.0*W, everything above 1.0 is set to 0.0 */
+# define R300_TX_FORMAT_CUT_W 7
+
+# define R300_TX_FORMAT_B_SHIFT 18
+# define R300_TX_FORMAT_G_SHIFT 15
+# define R300_TX_FORMAT_R_SHIFT 12
+# define R300_TX_FORMAT_A_SHIFT 9
+ /* Convenience macro to take care of layout and swizzling */
+# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \
+ ((R300_TX_FORMAT_##B)<<R300_TX_FORMAT_B_SHIFT) \
+ | ((R300_TX_FORMAT_##G)<<R300_TX_FORMAT_G_SHIFT) \
+ | ((R300_TX_FORMAT_##R)<<R300_TX_FORMAT_R_SHIFT) \
+ | ((R300_TX_FORMAT_##A)<<R300_TX_FORMAT_A_SHIFT) \
+ | (R300_TX_FORMAT_##FMT) \
+ )
+ /* These can be ORed with result of R300_EASY_TX_FORMAT()
+ We don't really know what they do. Take values from a
+ constant color ? */
+# define R300_TX_FORMAT_CONST_X (1<<5)
+# define R300_TX_FORMAT_CONST_Y (2<<5)
+# define R300_TX_FORMAT_CONST_Z (4<<5)
+# define R300_TX_FORMAT_CONST_W (8<<5)
+
+# define R300_TX_FORMAT_YUV_MODE 0x00800000
+
+#define R300_TX_FORMAT2_0 0x4500 /* obvious missing in gap */
+# define R300_TX_PITCHMASK_SHIFT 0
+# define R300_TX_PITCHMASK_MASK (2047 << 0)
+# define R500_TXFORMAT_MSB (1 << 14)
+# define R500_TXWIDTH_BIT11 (1 << 15)
+# define R500_TXHEIGHT_BIT11 (1 << 16)
+# define R500_POW2FIX2FLT (1 << 17)
+# define R500_SEL_FILTER4_TC0 (0 << 18)
+# define R500_SEL_FILTER4_TC1 (1 << 18)
+# define R500_SEL_FILTER4_TC2 (2 << 18)
+# define R500_SEL_FILTER4_TC3 (3 << 18)
+
+#define R300_TX_OFFSET_0 0x4540
+#define R300_TX_OFFSET_1 0x4544
+#define R300_TX_OFFSET_2 0x4548
+#define R300_TX_OFFSET_3 0x454C
+#define R300_TX_OFFSET_4 0x4550
+#define R300_TX_OFFSET_5 0x4554
+#define R300_TX_OFFSET_6 0x4558
+#define R300_TX_OFFSET_7 0x455C
+ /* BEGIN: Guess from R200 */
+# define R300_TXO_ENDIAN_NO_SWAP (0 << 0)
+# define R300_TXO_ENDIAN_BYTE_SWAP (1 << 0)
+# define R300_TXO_ENDIAN_WORD_SWAP (2 << 0)
+# define R300_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
+# define R300_TXO_MACRO_TILE (1 << 2)
+# define R300_TXO_MICRO_TILE_LINEAR (0 << 3)
+# define R300_TXO_MICRO_TILE (1 << 3)
+# define R300_TXO_MICRO_TILE_SQUARE (2 << 3)
+# define R300_TXO_OFFSET_MASK 0xffffffe0
+# define R300_TXO_OFFSET_SHIFT 5
+ /* END: Guess from R200 */
+
+/* 32 bit chroma key */
+#define R300_TX_CHROMA_KEY_0 0x4580
+#define R300_TX_CHROMA_KEY_1 0x4584
+#define R300_TX_CHROMA_KEY_2 0x4588
+#define R300_TX_CHROMA_KEY_3 0x458c
+#define R300_TX_CHROMA_KEY_4 0x4590
+#define R300_TX_CHROMA_KEY_5 0x4594
+#define R300_TX_CHROMA_KEY_6 0x4598
+#define R300_TX_CHROMA_KEY_7 0x459c
+#define R300_TX_CHROMA_KEY_8 0x45a0
+#define R300_TX_CHROMA_KEY_9 0x45a4
+#define R300_TX_CHROMA_KEY_10 0x45a8
+#define R300_TX_CHROMA_KEY_11 0x45ac
+#define R300_TX_CHROMA_KEY_12 0x45b0
+#define R300_TX_CHROMA_KEY_13 0x45b4
+#define R300_TX_CHROMA_KEY_14 0x45b8
+#define R300_TX_CHROMA_KEY_15 0x45bc
+/* ff00ff00 == { 0, 1.0, 0, 1.0 } */
+
+/* Border Color */
+#define R300_TX_BORDER_COLOR_0 0x45c0
+#define R300_TX_BORDER_COLOR_1 0x45c4
+#define R300_TX_BORDER_COLOR_2 0x45c8
+#define R300_TX_BORDER_COLOR_3 0x45cc
+#define R300_TX_BORDER_COLOR_4 0x45d0
+#define R300_TX_BORDER_COLOR_5 0x45d4
+#define R300_TX_BORDER_COLOR_6 0x45d8
+#define R300_TX_BORDER_COLOR_7 0x45dc
+#define R300_TX_BORDER_COLOR_8 0x45e0
+#define R300_TX_BORDER_COLOR_9 0x45e4
+#define R300_TX_BORDER_COLOR_10 0x45e8
+#define R300_TX_BORDER_COLOR_11 0x45ec
+#define R300_TX_BORDER_COLOR_12 0x45f0
+#define R300_TX_BORDER_COLOR_13 0x45f4
+#define R300_TX_BORDER_COLOR_14 0x45f8
+#define R300_TX_BORDER_COLOR_15 0x45fc
+
+
+/* END: Texture specification */
+
+/* BEGIN: Fragment program instruction set */
+
+/* Fragment programs are written directly into register space.
+ * There are separate instruction streams for texture instructions and ALU
+ * instructions.
+ * In order to synchronize these streams, the program is divided into up
+ * to 4 nodes. Each node begins with a number of TEX operations, followed
+ * by a number of ALU operations.
+ * The first node can have zero TEX ops, all subsequent nodes must have at
+ * least
+ * one TEX ops.
+ * All nodes must have at least one ALU op.
+ *
+ * The index of the last node is stored in PFS_CNTL_0: A value of 0 means
+ * 1 node, a value of 3 means 4 nodes.
+ * The total amount of instructions is defined in PFS_CNTL_2. The offsets are
+ * offsets into the respective instruction streams, while *_END points to the
+ * last instruction relative to this offset.
+ */
+#define R300_US_CONFIG 0x4600
+# define R300_PFS_CNTL_LAST_NODES_SHIFT 0
+# define R300_PFS_CNTL_LAST_NODES_MASK (3 << 0)
+# define R300_PFS_CNTL_FIRST_NODE_HAS_TEX (1 << 3)
+#define R300_US_PIXSIZE 0x4604
+/* There is an unshifted value here which has so far always been equal to the
+ * index of the highest used temporary register.
+ */
+#define R300_US_CODE_OFFSET 0x4608
+# define R300_PFS_CNTL_ALU_OFFSET_SHIFT 0
+# define R300_PFS_CNTL_ALU_OFFSET_MASK (63 << 0)
+# define R300_PFS_CNTL_ALU_END_SHIFT 6
+# define R300_PFS_CNTL_ALU_END_MASK (63 << 6)
+# define R300_PFS_CNTL_TEX_OFFSET_SHIFT 13
+# define R300_PFS_CNTL_TEX_OFFSET_MASK (31 << 13)
+# define R300_PFS_CNTL_TEX_END_SHIFT 18
+# define R300_PFS_CNTL_TEX_END_MASK (31 << 18)
+
+/* gap */
+
+/* Nodes are stored backwards. The last active node is always stored in
+ * PFS_NODE_3.
+ * Example: In a 2-node program, NODE_0 and NODE_1 are set to 0. The
+ * first node is stored in NODE_2, the second node is stored in NODE_3.
+ *
+ * Offsets are relative to the master offset from PFS_CNTL_2.
+ */
+#define R300_US_CODE_ADDR_0 0x4610
+#define R300_US_CODE_ADDR_1 0x4614
+#define R300_US_CODE_ADDR_2 0x4618
+#define R300_US_CODE_ADDR_3 0x461C
+# define R300_ALU_START_SHIFT 0
+# define R300_ALU_START_MASK (63 << 0)
+# define R300_ALU_SIZE_SHIFT 6
+# define R300_ALU_SIZE_MASK (63 << 6)
+# define R300_TEX_START_SHIFT 12
+# define R300_TEX_START_MASK (31 << 12)
+# define R300_TEX_SIZE_SHIFT 17
+# define R300_TEX_SIZE_MASK (31 << 17)
+# define R300_RGBA_OUT (1 << 22)
+# define R300_W_OUT (1 << 23)
+
+/* TEX
+ * As far as I can tell, texture instructions cannot write into output
+ * registers directly. A subsequent ALU instruction is always necessary,
+ * even if it's just MAD o0, r0, 1, 0
+ */
+#define R300_US_TEX_INST_0 0x4620
+# define R300_SRC_ADDR_SHIFT 0
+# define R300_SRC_ADDR_MASK (31 << 0)
+# define R300_DST_ADDR_SHIFT 6
+# define R300_DST_ADDR_MASK (31 << 6)
+# define R300_TEX_ID_SHIFT 11
+# define R300_TEX_ID_MASK (15 << 11)
+# define R300_TEX_INST_SHIFT 15
+# define R300_TEX_OP_NOP 0
+# define R300_TEX_OP_LD 1
+# define R300_TEX_OP_KIL 2
+# define R300_TEX_OP_TXP 3
+# define R300_TEX_OP_TXB 4
+# define R300_TEX_INST_MASK (7 << 15)
+
+/* Output format from the unfied shader */
+#define R300_US_OUT_FMT_0 0x46A4
+# define R300_US_OUT_FMT_C4_8 (0 << 0)
+# define R300_US_OUT_FMT_C4_10 (1 << 0)
+# define R300_US_OUT_FMT_C4_10_GAMMA (2 << 0)
+# define R300_US_OUT_FMT_C_16 (3 << 0)
+# define R300_US_OUT_FMT_C2_16 (4 << 0)
+# define R300_US_OUT_FMT_C4_16 (5 << 0)
+# define R300_US_OUT_FMT_C_16_MPEG (6 << 0)
+# define R300_US_OUT_FMT_C2_16_MPEG (7 << 0)
+# define R300_US_OUT_FMT_C2_4 (8 << 0)
+# define R300_US_OUT_FMT_C_3_3_2 (9 << 0)
+# define R300_US_OUT_FMT_C_6_5_6 (10 << 0)
+# define R300_US_OUT_FMT_C_11_11_10 (11 << 0)
+# define R300_US_OUT_FMT_C_10_11_11 (12 << 0)
+# define R300_US_OUT_FMT_C_2_10_10_10 (13 << 0)
+/* reserved */
+# define R300_US_OUT_FMT_UNUSED (15 << 0)
+# define R300_US_OUT_FMT_C_16_FP (16 << 0)
+# define R300_US_OUT_FMT_C2_16_FP (17 << 0)
+# define R300_US_OUT_FMT_C4_16_FP (18 << 0)
+# define R300_US_OUT_FMT_C_32_FP (19 << 0)
+# define R300_US_OUT_FMT_C2_32_FP (20 << 0)
+# define R300_US_OUT_FMT_C4_32_FP (21 << 0)
+# define R300_C0_SEL_A (0 << 8)
+# define R300_C0_SEL_R (1 << 8)
+# define R300_C0_SEL_G (2 << 8)
+# define R300_C0_SEL_B (3 << 8)
+# define R300_C1_SEL_A (0 << 10)
+# define R300_C1_SEL_R (1 << 10)
+# define R300_C1_SEL_G (2 << 10)
+# define R300_C1_SEL_B (3 << 10)
+# define R300_C2_SEL_A (0 << 12)
+# define R300_C2_SEL_R (1 << 12)
+# define R300_C2_SEL_G (2 << 12)
+# define R300_C2_SEL_B (3 << 12)
+# define R300_C3_SEL_A (0 << 14)
+# define R300_C3_SEL_R (1 << 14)
+# define R300_C3_SEL_G (2 << 14)
+# define R300_C3_SEL_B (3 << 14)
+# define R300_OUT_SIGN(x) (x << 16)
+# define R500_ROUND_ADJ (1 << 20)
+
+/* ALU
+ * The ALU instructions register blocks are enumerated according to the order
+ * in which fglrx. I assume there is space for 64 instructions, since
+ * each block has space for a maximum of 64 DWORDs, and this matches reported
+ * native limits.
+ *
+ * The basic functional block seems to be one MAD for each color and alpha,
+ * and an adder that adds all components after the MUL.
+ * - ADD, MUL, MAD etc.: use MAD with appropriate neutral operands
+ * - DP4: Use OUTC_DP4, OUTA_DP4
+ * - DP3: Use OUTC_DP3, OUTA_DP4, appropriate alpha operands
+ * - DPH: Use OUTC_DP4, OUTA_DP4, appropriate alpha operands
+ * - CMPH: If ARG2 > 0.5, return ARG0, else return ARG1
+ * - CMP: If ARG2 < 0, return ARG1, else return ARG0
+ * - FLR: use FRC+MAD
+ * - XPD: use MAD+MAD
+ * - SGE, SLT: use MAD+CMP
+ * - RSQ: use ABS modifier for argument
+ * - Use OUTC_REPL_ALPHA to write results of an alpha-only operation
+ * (e.g. RCP) into color register
+ * - apparently, there's no quick DST operation
+ * - fglrx set FPI2_UNKNOWN_31 on a "MAD fragment.color, tmp0, tmp1, tmp2"
+ * - fglrx set FPI2_UNKNOWN_31 on a "MAX r2, r1, c0"
+ * - fglrx once set FPI0_UNKNOWN_31 on a "FRC r1, r1"
+ *
+ * Operand selection
+ * First stage selects three sources from the available registers and
+ * constant parameters. This is defined in INSTR1 (color) and INSTR3 (alpha).
+ * fglrx sorts the three source fields: Registers before constants,
+ * lower indices before higher indices; I do not know whether this is
+ * necessary.
+ *
+ * fglrx fills unused sources with "read constant 0"
+ * According to specs, you cannot select more than two different constants.
+ *
+ * Second stage selects the operands from the sources. This is defined in
+ * INSTR0 (color) and INSTR2 (alpha). You can also select the special constants
+ * zero and one.
+ * Swizzling and negation happens in this stage, as well.
+ *
+ * Important: Color and alpha seem to be mostly separate, i.e. their sources
+ * selection appears to be fully independent (the register storage is probably
+ * physically split into a color and an alpha section).
+ * However (because of the apparent physical split), there is some interaction
+ * WRT swizzling. If, for example, you want to load an R component into an
+ * Alpha operand, this R component is taken from a *color* source, not from
+ * an alpha source. The corresponding register doesn't even have to appear in
+ * the alpha sources list. (I hope this all makes sense to you)
+ *
+ * Destination selection
+ * The destination register index is in FPI1 (color) and FPI3 (alpha)
+ * together with enable bits.
+ * There are separate enable bits for writing into temporary registers
+ * (DSTC_REG_* /DSTA_REG) and and program output registers (DSTC_OUTPUT_*
+ * /DSTA_OUTPUT). You can write to both at once, or not write at all (the
+ * same index must be used for both).
+ *
+ * Note: There is a special form for LRP
+ * - Argument order is the same as in ARB_fragment_program.
+ * - Operation is MAD
+ * - ARG1 is set to ARGC_SRC1C_LRP/ARGC_SRC1A_LRP
+ * - Set FPI0/FPI2_SPECIAL_LRP
+ * Arbitrary LRP (including support for swizzling) requires vanilla MAD+MAD
+ */
+#define R300_US_ALU_RGB_ADDR_0 0x46C0
+# define R300_ALU_SRC0C_SHIFT 0
+# define R300_ALU_SRC0C_MASK (31 << 0)
+# define R300_ALU_SRC0C_CONST (1 << 5)
+# define R300_ALU_SRC1C_SHIFT 6
+# define R300_ALU_SRC1C_MASK (31 << 6)
+# define R300_ALU_SRC1C_CONST (1 << 11)
+# define R300_ALU_SRC2C_SHIFT 12
+# define R300_ALU_SRC2C_MASK (31 << 12)
+# define R300_ALU_SRC2C_CONST (1 << 17)
+# define R300_ALU_SRC_MASK 0x0003ffff
+# define R300_ALU_DSTC_SHIFT 18
+# define R300_ALU_DSTC_MASK (31 << 18)
+# define R300_ALU_DSTC_REG_MASK_SHIFT 23
+# define R300_ALU_DSTC_REG_X (1 << 23)
+# define R300_ALU_DSTC_REG_Y (1 << 24)
+# define R300_ALU_DSTC_REG_Z (1 << 25)
+# define R300_ALU_DSTC_OUTPUT_MASK_SHIFT 26
+# define R300_ALU_DSTC_OUTPUT_X (1 << 26)
+# define R300_ALU_DSTC_OUTPUT_Y (1 << 27)
+# define R300_ALU_DSTC_OUTPUT_Z (1 << 28)
+
+#define R300_US_ALU_ALPHA_ADDR_0 0x47C0
+# define R300_ALU_SRC0A_SHIFT 0
+# define R300_ALU_SRC0A_MASK (31 << 0)
+# define R300_ALU_SRC0A_CONST (1 << 5)
+# define R300_ALU_SRC1A_SHIFT 6
+# define R300_ALU_SRC1A_MASK (31 << 6)
+# define R300_ALU_SRC1A_CONST (1 << 11)
+# define R300_ALU_SRC2A_SHIFT 12
+# define R300_ALU_SRC2A_MASK (31 << 12)
+# define R300_ALU_SRC2A_CONST (1 << 17)
+# define R300_ALU_SRC_MASK 0x0003ffff
+# define R300_ALU_DSTA_SHIFT 18
+# define R300_ALU_DSTA_MASK (31 << 18)
+# define R300_ALU_DSTA_REG (1 << 23)
+# define R300_ALU_DSTA_OUTPUT (1 << 24)
+# define R300_ALU_DSTA_DEPTH (1 << 27)
+
+#define R300_US_ALU_RGB_INST_0 0x48C0
+# define R300_ALU_ARGC_SRC0C_XYZ 0
+# define R300_ALU_ARGC_SRC0C_XXX 1
+# define R300_ALU_ARGC_SRC0C_YYY 2
+# define R300_ALU_ARGC_SRC0C_ZZZ 3
+# define R300_ALU_ARGC_SRC1C_XYZ 4
+# define R300_ALU_ARGC_SRC1C_XXX 5
+# define R300_ALU_ARGC_SRC1C_YYY 6
+# define R300_ALU_ARGC_SRC1C_ZZZ 7
+# define R300_ALU_ARGC_SRC2C_XYZ 8
+# define R300_ALU_ARGC_SRC2C_XXX 9
+# define R300_ALU_ARGC_SRC2C_YYY 10
+# define R300_ALU_ARGC_SRC2C_ZZZ 11
+# define R300_ALU_ARGC_SRC0A 12
+# define R300_ALU_ARGC_SRC1A 13
+# define R300_ALU_ARGC_SRC2A 14
+# define R300_ALU_ARGC_SRCP_XYZ 15
+# define R300_ALU_ARGC_SRCP_XXX 16
+# define R300_ALU_ARGC_SRCP_YYY 17
+# define R300_ALU_ARGC_SRCP_ZZZ 18
+# define R300_ALU_ARGC_SRCP_WWW 19
+# define R300_ALU_ARGC_ZERO 20
+# define R300_ALU_ARGC_ONE 21
+# define R300_ALU_ARGC_HALF 22
+# define R300_ALU_ARGC_SRC0C_YZX 23
+# define R300_ALU_ARGC_SRC1C_YZX 24
+# define R300_ALU_ARGC_SRC2C_YZX 25
+# define R300_ALU_ARGC_SRC0C_ZXY 26
+# define R300_ALU_ARGC_SRC1C_ZXY 27
+# define R300_ALU_ARGC_SRC2C_ZXY 28
+# define R300_ALU_ARGC_SRC0CA_WZY 29
+# define R300_ALU_ARGC_SRC1CA_WZY 30
+# define R300_ALU_ARGC_SRC2CA_WZY 31
+
+# define R300_ALU_ARG0C_SHIFT 0
+# define R300_ALU_ARG0C_MASK (31 << 0)
+# define R300_ALU_ARG0C_NOP (0 << 5)
+# define R300_ALU_ARG0C_NEG (1 << 5)
+# define R300_ALU_ARG0C_ABS (2 << 5)
+# define R300_ALU_ARG0C_NAB (3 << 5)
+# define R300_ALU_ARG1C_SHIFT 7
+# define R300_ALU_ARG1C_MASK (31 << 7)
+# define R300_ALU_ARG1C_NOP (0 << 12)
+# define R300_ALU_ARG1C_NEG (1 << 12)
+# define R300_ALU_ARG1C_ABS (2 << 12)
+# define R300_ALU_ARG1C_NAB (3 << 12)
+# define R300_ALU_ARG2C_SHIFT 14
+# define R300_ALU_ARG2C_MASK (31 << 14)
+# define R300_ALU_ARG2C_NOP (0 << 19)
+# define R300_ALU_ARG2C_NEG (1 << 19)
+# define R300_ALU_ARG2C_ABS (2 << 19)
+# define R300_ALU_ARG2C_NAB (3 << 19)
+# define R300_ALU_SRCP_1_MINUS_2_SRC0 (0 << 21)
+# define R300_ALU_SRCP_SRC1_MINUS_SRC0 (1 << 21)
+# define R300_ALU_SRCP_SRC1_PLUS_SRC0 (2 << 21)
+# define R300_ALU_SRCP_1_MINUS_SRC0 (3 << 21)
+
+# define R300_ALU_OUTC_MAD (0 << 23)
+# define R300_ALU_OUTC_DP3 (1 << 23)
+# define R300_ALU_OUTC_DP4 (2 << 23)
+# define R300_ALU_OUTC_D2A (3 << 23)
+# define R300_ALU_OUTC_MIN (4 << 23)
+# define R300_ALU_OUTC_MAX (5 << 23)
+# define R300_ALU_OUTC_CMPH (7 << 23)
+# define R300_ALU_OUTC_CMP (8 << 23)
+# define R300_ALU_OUTC_FRC (9 << 23)
+# define R300_ALU_OUTC_REPL_ALPHA (10 << 23)
+
+# define R300_ALU_OUTC_MOD_NOP (0 << 27)
+# define R300_ALU_OUTC_MOD_MUL2 (1 << 27)
+# define R300_ALU_OUTC_MOD_MUL4 (2 << 27)
+# define R300_ALU_OUTC_MOD_MUL8 (3 << 27)
+# define R300_ALU_OUTC_MOD_DIV2 (4 << 27)
+# define R300_ALU_OUTC_MOD_DIV4 (5 << 27)
+# define R300_ALU_OUTC_MOD_DIV8 (6 << 27)
+
+# define R300_ALU_OUTC_CLAMP (1 << 30)
+# define R300_ALU_INSERT_NOP (1 << 31)
+
+#define R300_US_ALU_ALPHA_INST_0 0x49C0
+# define R300_ALU_ARGA_SRC0C_X 0
+# define R300_ALU_ARGA_SRC0C_Y 1
+# define R300_ALU_ARGA_SRC0C_Z 2
+# define R300_ALU_ARGA_SRC1C_X 3
+# define R300_ALU_ARGA_SRC1C_Y 4
+# define R300_ALU_ARGA_SRC1C_Z 5
+# define R300_ALU_ARGA_SRC2C_X 6
+# define R300_ALU_ARGA_SRC2C_Y 7
+# define R300_ALU_ARGA_SRC2C_Z 8
+# define R300_ALU_ARGA_SRC0A 9
+# define R300_ALU_ARGA_SRC1A 10
+# define R300_ALU_ARGA_SRC2A 11
+# define R300_ALU_ARGA_SRCP_X 12
+# define R300_ALU_ARGA_SRCP_Y 13
+# define R300_ALU_ARGA_SRCP_Z 14
+# define R300_ALU_ARGA_SRCP_W 15
+
+# define R300_ALU_ARGA_ZERO 16
+# define R300_ALU_ARGA_ONE 17
+# define R300_ALU_ARGA_HALF 18
+# define R300_ALU_ARG0A_SHIFT 0
+# define R300_ALU_ARG0A_MASK (31 << 0)
+# define R300_ALU_ARG0A_NOP (0 << 5)
+# define R300_ALU_ARG0A_NEG (1 << 5)
+# define R300_ALU_ARG0A_ABS (2 << 5)
+# define R300_ALU_ARG0A_NAB (3 << 5)
+# define R300_ALU_ARG1A_SHIFT 7
+# define R300_ALU_ARG1A_MASK (31 << 7)
+# define R300_ALU_ARG1A_NOP (0 << 12)
+# define R300_ALU_ARG1A_NEG (1 << 12)
+# define R300_ALU_ARG1A_ABS (2 << 12)
+# define R300_ALU_ARG1A_NAB (3 << 12)
+# define R300_ALU_ARG2A_SHIFT 14
+# define R300_ALU_ARG2A_MASK (31 << 14)
+# define R300_ALU_ARG2A_NOP (0 << 19)
+# define R300_ALU_ARG2A_NEG (1 << 19)
+# define R300_ALU_ARG2A_ABS (2 << 19)
+# define R300_ALU_ARG2A_NAB (3 << 19)
+# define R300_ALU_SRCP_1_MINUS_2_SRC0 (0 << 21)
+# define R300_ALU_SRCP_SRC1_MINUS_SRC0 (1 << 21)
+# define R300_ALU_SRCP_SRC1_PLUS_SRC0 (2 << 21)
+# define R300_ALU_SRCP_1_MINUS_SRC0 (3 << 21)
+
+# define R300_ALU_OUTA_MAD (0 << 23)
+# define R300_ALU_OUTA_DP4 (1 << 23)
+# define R300_ALU_OUTA_MIN (2 << 23)
+# define R300_ALU_OUTA_MAX (3 << 23)
+# define R300_ALU_OUTA_CND (5 << 23)
+# define R300_ALU_OUTA_CMP (6 << 23)
+# define R300_ALU_OUTA_FRC (7 << 23)
+# define R300_ALU_OUTA_EX2 (8 << 23)
+# define R300_ALU_OUTA_LG2 (9 << 23)
+# define R300_ALU_OUTA_RCP (10 << 23)
+# define R300_ALU_OUTA_RSQ (11 << 23)
+
+# define R300_ALU_OUTA_MOD_NOP (0 << 27)
+# define R300_ALU_OUTA_MOD_MUL2 (1 << 27)
+# define R300_ALU_OUTA_MOD_MUL4 (2 << 27)
+# define R300_ALU_OUTA_MOD_MUL8 (3 << 27)
+# define R300_ALU_OUTA_MOD_DIV2 (4 << 27)
+# define R300_ALU_OUTA_MOD_DIV4 (5 << 27)
+# define R300_ALU_OUTA_MOD_DIV8 (6 << 27)
+
+# define R300_ALU_OUTA_CLAMP (1 << 30)
+/* END: Fragment program instruction set */
+
+/* Fog: Fog Blending Enable */
+#define R300_FG_FOG_BLEND 0x4bc0
+# define R300_FG_FOG_BLEND_DISABLE (0 << 0)
+# define R300_FG_FOG_BLEND_ENABLE (1 << 0)
+# define R300_FG_FOG_BLEND_FN_LINEAR (0 << 1)
+# define R300_FG_FOG_BLEND_FN_EXP (1 << 1)
+# define R300_FG_FOG_BLEND_FN_EXP2 (2 << 1)
+# define R300_FG_FOG_BLEND_FN_CONSTANT (3 << 1)
+# define R300_FG_FOG_BLEND_FN_MASK (3 << 1)
+
+/* Fog: Red Component of Fog Color */
+#define R300_FG_FOG_COLOR_R 0x4bc8
+/* Fog: Green Component of Fog Color */
+#define R300_FG_FOG_COLOR_G 0x4bcc
+/* Fog: Blue Component of Fog Color */
+#define R300_FG_FOG_COLOR_B 0x4bd0
+# define R300_FG_FOG_COLOR_MASK 0x000003ff
+
+/* Fog: Constant Factor for Fog Blending */
+#define R300_FG_FOG_FACTOR 0x4bc4
+# define FG_FOG_FACTOR_MASK 0x000003ff
+
+/* Fog: Alpha function */
+#define R300_FG_ALPHA_FUNC 0x4bd4
+# define R300_FG_ALPHA_FUNC_VAL_MASK 0x000000ff
+# define R300_FG_ALPHA_FUNC_NEVER (0 << 8)
+# define R300_FG_ALPHA_FUNC_LESS (1 << 8)
+# define R300_FG_ALPHA_FUNC_EQUAL (2 << 8)
+# define R300_FG_ALPHA_FUNC_LE (3 << 8)
+# define R300_FG_ALPHA_FUNC_GREATER (4 << 8)
+# define R300_FG_ALPHA_FUNC_NOTEQUAL (5 << 8)
+# define R300_FG_ALPHA_FUNC_GE (6 << 8)
+# define R300_FG_ALPHA_FUNC_ALWAYS (7 << 8)
+# define R300_ALPHA_TEST_OP_MASK (7 << 8)
+# define R300_FG_ALPHA_FUNC_DISABLE (0 << 11)
+# define R300_FG_ALPHA_FUNC_ENABLE (1 << 11)
+
+# define R500_FG_ALPHA_FUNC_10BIT (0 << 12)
+# define R500_FG_ALPHA_FUNC_8BIT (1 << 12)
+
+# define R300_FG_ALPHA_FUNC_MASK_DISABLE (0 << 16)
+# define R300_FG_ALPHA_FUNC_MASK_ENABLE (1 << 16)
+# define R300_FG_ALPHA_FUNC_CFG_2_OF_4 (0 << 17)
+# define R300_FG_ALPHA_FUNC_CFG_3_OF_6 (1 << 17)
+
+# define R300_FG_ALPHA_FUNC_DITH_DISABLE (0 << 20)
+# define R300_FG_ALPHA_FUNC_DITH_ENABLE (1 << 20)
+
+# define R500_FG_ALPHA_FUNC_OFFSET_DISABLE (0 << 24)
+# define R500_FG_ALPHA_FUNC_OFFSET_ENABLE (1 << 24) /* Not supported in R520 */
+# define R500_FG_ALPHA_FUNC_DISC_ZERO_MASK_DISABLE (0 << 25)
+# define R500_FG_ALPHA_FUNC_DISC_ZERO_MASK_ENABLE (1 << 25)
+
+# define R500_FG_ALPHA_FUNC_FP16_DISABLE (0 << 28)
+# define R500_FG_ALPHA_FUNC_FP16_ENABLE (1 << 28)
+
+
+/* Fog: Where does the depth come from? */
+#define R300_FG_DEPTH_SRC 0x4bd8
+# define R300_FG_DEPTH_SRC_SCAN (0 << 0)
+# define R300_FG_DEPTH_SRC_SHADER (1 << 0)
+
+/* Fog: Alpha Compare Value */
+#define R500_FG_ALPHA_VALUE 0x4be0
+# define R500_FG_ALPHA_VALUE_MASK 0x0000ffff
+
+/* gap */
+
+/* Fragment program parameters in 7.16 floating point */
+#define R300_PFS_PARAM_0_X 0x4C00
+#define R300_PFS_PARAM_0_Y 0x4C04
+#define R300_PFS_PARAM_0_Z 0x4C08
+#define R300_PFS_PARAM_0_W 0x4C0C
+/* last consts */
+#define R300_PFS_PARAM_31_X 0x4DF0
+#define R300_PFS_PARAM_31_Y 0x4DF4
+#define R300_PFS_PARAM_31_Z 0x4DF8
+#define R300_PFS_PARAM_31_W 0x4DFC
+
+/* Unpipelined. */
+#define R300_RB3D_CCTL 0x4e00
+# define R300_RB3D_CCTL_NUM_MULTIWRITES_1_BUFFER (0 << 5)
+# define R300_RB3D_CCTL_NUM_MULTIWRITES_2_BUFFERS (1 << 5)
+# define R300_RB3D_CCTL_NUM_MULTIWRITES_3_BUFFERS (2 << 5)
+# define R300_RB3D_CCTL_NUM_MULTIWRITES_4_BUFFERS (3 << 5)
+# define R300_RB3D_CCTL_CLRCMP_FLIPE_DISABLE (0 << 7)
+# define R300_RB3D_CCTL_CLRCMP_FLIPE_ENABLE (1 << 7)
+# define R300_RB3D_CCTL_AA_COMPRESSION_DISABLE (0 << 9)
+# define R300_RB3D_CCTL_AA_COMPRESSION_ENABLE (1 << 9)
+# define R300_RB3D_CCTL_CMASK_DISABLE (0 << 10)
+# define R300_RB3D_CCTL_CMASK_ENABLE (1 << 10)
+/* reserved */
+# define R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_DISABLE (0 << 12)
+# define R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE (1 << 12)
+# define R300_RB3D_CCTL_WRITE_COMPRESSION_ENABLE (0 << 13)
+# define R300_RB3D_CCTL_WRITE_COMPRESSION_DISABLE (1 << 13)
+# define R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_DISABLE (0 << 14)
+# define R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE (1 << 14)
+
+
+/* Notes:
+ * - AFAIK fglrx always sets BLEND_UNKNOWN when blending is used in
+ * the application
+ * - AFAIK fglrx always sets BLEND_NO_SEPARATE when CBLEND and ABLEND
+ * are set to the same
+ * function (both registers are always set up completely in any case)
+ * - Most blend flags are simply copied from R200 and not tested yet
+ */
+#define R300_RB3D_CBLEND 0x4E04
+#define R300_RB3D_ABLEND 0x4E08
+/* the following only appear in CBLEND */
+# define R300_ALPHA_BLEND_ENABLE (1 << 0)
+# define R300_SEPARATE_ALPHA_ENABLE (1 << 1)
+# define R300_READ_ENABLE (1 << 2)
+# define R300_DISCARD_SRC_PIXELS_DIS (0 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_0 (1 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_COLOR_0 (2 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_COLOR_0 (3 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_1 (4 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_COLOR_1 (5 << 3)
+# define R300_DISCARD_SRC_PIXELS_SRC_ALPHA_COLOR_1 (6 << 3)
+
+/* the following are shared between CBLEND and ABLEND */
+# define R300_FCN_MASK (3 << 12)
+# define R300_COMB_FCN_ADD_CLAMP (0 << 12)
+# define R300_COMB_FCN_ADD_NOCLAMP (1 << 12)
+# define R300_COMB_FCN_SUB_CLAMP (2 << 12)
+# define R300_COMB_FCN_SUB_NOCLAMP (3 << 12)
+# define R300_COMB_FCN_MIN (4 << 12)
+# define R300_COMB_FCN_MAX (5 << 12)
+# define R300_COMB_FCN_RSUB_CLAMP (6 << 12)
+# define R300_COMB_FCN_RSUB_NOCLAMP (7 << 12)
+# define R300_BLEND_GL_ZERO (32)
+# define R300_BLEND_GL_ONE (33)
+# define R300_BLEND_GL_SRC_COLOR (34)
+# define R300_BLEND_GL_ONE_MINUS_SRC_COLOR (35)
+# define R300_BLEND_GL_DST_COLOR (36)
+# define R300_BLEND_GL_ONE_MINUS_DST_COLOR (37)
+# define R300_BLEND_GL_SRC_ALPHA (38)
+# define R300_BLEND_GL_ONE_MINUS_SRC_ALPHA (39)
+# define R300_BLEND_GL_DST_ALPHA (40)
+# define R300_BLEND_GL_ONE_MINUS_DST_ALPHA (41)
+# define R300_BLEND_GL_SRC_ALPHA_SATURATE (42)
+# define R300_BLEND_GL_CONST_COLOR (43)
+# define R300_BLEND_GL_ONE_MINUS_CONST_COLOR (44)
+# define R300_BLEND_GL_CONST_ALPHA (45)
+# define R300_BLEND_GL_ONE_MINUS_CONST_ALPHA (46)
+# define R300_BLEND_MASK (63)
+# define R300_SRC_BLEND_SHIFT (16)
+# define R300_DST_BLEND_SHIFT (24)
+
+/* Constant color used by the blender. Pipelined through the blender.
+ * Note: For R520, this field is ignored, use RB3D_CONSTANT_COLOR_GB__BLUE,
+ * RB3D_CONSTANT_COLOR_GB__GREEN, etc. instead.
+ */
+#define R300_RB3D_BLEND_COLOR 0x4E10
+
+
+/* 3D Color Channel Mask. If all the channels used in the current color format
+ * are disabled, then the cb will discard all the incoming quads. Pipelined
+ * through the blender.
+ */
+#define RB3D_COLOR_CHANNEL_MASK 0x4E0C
+# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK0 (1 << 0)
+# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK0 (1 << 1)
+# define RB3D_COLOR_CHANNEL_MASK_RED_MASK0 (1 << 2)
+# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK0 (1 << 3)
+# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK1 (1 << 4)
+# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK1 (1 << 5)
+# define RB3D_COLOR_CHANNEL_MASK_RED_MASK1 (1 << 6)
+# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK1 (1 << 7)
+# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK2 (1 << 8)
+# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK2 (1 << 9)
+# define RB3D_COLOR_CHANNEL_MASK_RED_MASK2 (1 << 10)
+# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK2 (1 << 11)
+# define RB3D_COLOR_CHANNEL_MASK_BLUE_MASK3 (1 << 12)
+# define RB3D_COLOR_CHANNEL_MASK_GREEN_MASK3 (1 << 13)
+# define RB3D_COLOR_CHANNEL_MASK_RED_MASK3 (1 << 14)
+# define RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK3 (1 << 15)
+
+/* Clear color that is used when the color mask is set to 00. Unpipelined.
+ * Program this register with a 32-bit value in ARGB8888 or ARGB2101010
+ * formats, ignoring the fields.
+ */
+#define RB3D_COLOR_CLEAR_VALUE 0x4e14
+
+/* gap */
+
+/* Color Compare Color. Stalls the 2d/3d datapath until it is idle. */
+#define RB3D_CLRCMP_CLR 0x4e20
+
+/* Color Compare Mask. Stalls the 2d/3d datapath until it is idle. */
+#define RB3D_CLRCMP_MSK 0x4e24
+
+/* Color Buffer Address Offset of multibuffer 0. Unpipelined. */
+#define R300_RB3D_COLOROFFSET0 0x4E28
+# define R300_COLOROFFSET_MASK 0xFFFFFFE0
+/* Color Buffer Address Offset of multibuffer 1. Unpipelined. */
+#define R300_RB3D_COLOROFFSET1 0x4E2C
+/* Color Buffer Address Offset of multibuffer 2. Unpipelined. */
+#define R300_RB3D_COLOROFFSET2 0x4E30
+/* Color Buffer Address Offset of multibuffer 3. Unpipelined. */
+#define R300_RB3D_COLOROFFSET3 0x4E34
+
+/* Color buffer format and tiling control for all the multibuffers and the
+ * pitch of multibuffer 0 to 3. Unpipelined. The cache must be empty before any
+ * of the registers are changed.
+ *
+ * Bit 16: Larger tiles
+ * Bit 17: 4x2 tiles
+ * Bit 18: Extremely weird tile like, but some pixels duplicated?
+ */
+#define R300_RB3D_COLORPITCH0 0x4E38
+# define R300_COLORPITCH_MASK 0x00003FFE
+# define R300_COLOR_TILE_DISABLE (0 << 16)
+# define R300_COLOR_TILE_ENABLE (1 << 16)
+# define R300_COLOR_MICROTILE_DISABLE (0 << 17)
+# define R300_COLOR_MICROTILE_ENABLE (1 << 17)
+# define R300_COLOR_MICROTILE_ENABLE_SQUARE (2 << 17) /* Only available in 16-bit */
+# define R300_COLOR_ENDIAN_NO_SWAP (0 << 19)
+# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 19)
+# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 19)
+# define R300_COLOR_ENDIAN_HALF_DWORD_SWAP (3 << 19)
+# define R500_COLOR_FORMAT_ARGB10101010 (0 << 21)
+# define R500_COLOR_FORMAT_UV1010 (1 << 21)
+# define R500_COLOR_FORMAT_CI8 (2 << 21) /* 2D only */
+# define R300_COLOR_FORMAT_ARGB1555 (3 << 21)
+# define R300_COLOR_FORMAT_RGB565 (4 << 21)
+# define R500_COLOR_FORMAT_ARGB2101010 (5 << 21)
+# define R300_COLOR_FORMAT_ARGB8888 (6 << 21)
+# define R300_COLOR_FORMAT_ARGB32323232 (7 << 21)
+/* reserved */
+# define R300_COLOR_FORMAT_I8 (9 << 21)
+# define R300_COLOR_FORMAT_ARGB16161616 (10 << 21)
+# define R300_COLOR_FORMAT_VYUY (11 << 21)
+# define R300_COLOR_FORMAT_YVYU (12 << 21)
+# define R300_COLOR_FORMAT_UV88 (13 << 21)
+# define R500_COLOR_FORMAT_I10 (14 << 21)
+# define R300_COLOR_FORMAT_ARGB4444 (15 << 21)
+#define R300_RB3D_COLORPITCH1 0x4E3C
+#define R300_RB3D_COLORPITCH2 0x4E40
+#define R300_RB3D_COLORPITCH3 0x4E44
+
+/* gap */
+
+/* Destination Color Buffer Cache Control/Status. If the cb is in e2 mode, then
+ * a flush or free will not occur upon a write to this register, but a sync
+ * will be immediately sent if one is requested. If both DC_FLUSH and DC_FREE
+ * are zero but DC_FINISH is one, then a sync will be sent immediately -- the
+ * cb will not wait for all the previous operations to complete before sending
+ * the sync. Unpipelined except when DC_FINISH and DC_FREE are both set to
+ * zero.
+ *
+ * Set to 0A before 3D operations, set to 02 afterwards.
+ */
+#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_NO_EFFECT (0 << 0)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_NO_EFFECT_1 (1 << 0)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D (2 << 0)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D_1 (3 << 0)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_NO_EFFECT (0 << 2)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_NO_EFFECT_1 (1 << 2)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS (2 << 2)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS_1 (3 << 2)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_NO_SIGNAL (0 << 4)
+# define R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL (1 << 4)
+
+#define R300_RB3D_DITHER_CTL 0x4E50
+# define R300_RB3D_DITHER_CTL_DITHER_MODE_TRUNCATE (0 << 0)
+# define R300_RB3D_DITHER_CTL_DITHER_MODE_ROUND (1 << 0)
+# define R300_RB3D_DITHER_CTL_DITHER_MODE_LUT (2 << 0)
+/* reserved */
+# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_TRUNCATE (0 << 2)
+# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_ROUND (1 << 2)
+# define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT (2 << 2)
+/* reserved */
+
+/* Resolve buffer destination address. The cache must be empty before changing
+ * this register if the cb is in resolve mode. Unpipelined
+ */
+#define R300_RB3D_AARESOLVE_OFFSET 0x4e80
+# define R300_RB3D_AARESOLVE_OFFSET_SHIFT 5
+# define R300_RB3D_AARESOLVE_OFFSET_MASK 0xffffffe0 /* At least according to the calculations of Christoph Brill */
+
+/* Resolve Buffer Pitch and Tiling Control. The cache must be empty before
+ * changing this register if the cb is in resolve mode. Unpipelined
+ */
+#define R300_RB3D_AARESOLVE_PITCH 0x4e84
+# define R300_RB3D_AARESOLVE_PITCH_SHIFT 1
+# define R300_RB3D_AARESOLVE_PITCH_MASK 0x00003ffe /* At least according to the calculations of Christoph Brill */
+
+/* Resolve Buffer Control. Unpipelined */
+#define R300_RB3D_AARESOLVE_CTL 0x4e88
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_NORMAL (0 << 0)
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE (1 << 0)
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_GAMMA_10 (0 << 1)
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_GAMMA_22 (1 << 1)
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_SAMPLE0 (0 << 2)
+# define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE (1 << 2)
+
+
+/* Discard src pixels less than or equal to threshold. */
+#define R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD 0x4ea0
+/* Discard src pixels greater than or equal to threshold. */
+#define R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD 0x4ea4
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_BLUE_SHIFT 0
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_BLUE_MASK 0x000000ff
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_GREEN_SHIFT 8
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_GREEN_MASK 0x0000ff00
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_RED_SHIFT 16
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_RED_MASK 0x00ff0000
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_ALPHA_SHIFT 24
+# define R500_RB3D_DISCARD_SRC_PIXEL_THRESHOLD_ALPHA_MASK 0xff000000
+
+/* 3D ROP Control. Stalls the 2d/3d datapath until it is idle. */
+#define R300_RB3D_ROPCNTL 0x4e18
+# define R300_RB3D_ROPCNTL_ROP_ENABLE 0x00000004
+# define R300_RB3D_ROPCNTL_ROP_MASK (15 << 8)
+# define R300_RB3D_ROPCNTL_ROP_SHIFT 8
+
+/* Color Compare Flip. Stalls the 2d/3d datapath until it is idle. */
+#define R300_RB3D_CLRCMP_FLIPE 0x4e1c
+
+/* Sets the fifo sizes */
+#define R500_RB3D_FIFO_SIZE 0x4ef4
+# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_FULL (0 << 0)
+# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_HALF (1 << 0)
+# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_QUATER (2 << 0)
+# define R500_RB3D_FIFO_SIZE_OP_FIFO_SIZE_EIGTHS (3 << 0)
+
+/* Constant color used by the blender. Pipelined through the blender. */
+#define R500_RB3D_CONSTANT_COLOR_AR 0x4ef8
+# define R500_RB3D_CONSTANT_COLOR_AR_RED_MASK 0x0000ffff
+# define R500_RB3D_CONSTANT_COLOR_AR_RED_SHIFT 0
+# define R500_RB3D_CONSTANT_COLOR_AR_ALPHA_MASK 0xffff0000
+# define R500_RB3D_CONSTANT_COLOR_AR_ALPHA_SHIFT 16
+
+/* Constant color used by the blender. Pipelined through the blender. */
+#define R500_RB3D_CONSTANT_COLOR_GB 0x4efc
+# define R500_RB3D_CONSTANT_COLOR_AR_BLUE_MASK 0x0000ffff
+# define R500_RB3D_CONSTANT_COLOR_AR_BLUE_SHIFT 0
+# define R500_RB3D_CONSTANT_COLOR_AR_GREEN_MASK 0xffff0000
+# define R500_RB3D_CONSTANT_COLOR_AR_GREEN_SHIFT 16
+
+/* gap */
+/* There seems to be no "write only" setting, so use Z-test = ALWAYS
+ * for this.
+ * Bit (1<<8) is the "test" bit. so plain write is 6 - vd
+ */
+#define R300_ZB_CNTL 0x4F00
+# define R300_STENCIL_ENABLE (1 << 0)
+# define R300_Z_ENABLE (1 << 1)
+# define R300_Z_WRITE_ENABLE (1 << 2)
+# define R300_Z_SIGNED_COMPARE (1 << 3)
+# define R300_STENCIL_FRONT_BACK (1 << 4)
+
+#define R300_ZB_ZSTENCILCNTL 0x4f04
+ /* functions */
+# define R300_ZS_NEVER 0
+# define R300_ZS_LESS 1
+# define R300_ZS_LEQUAL 2
+# define R300_ZS_EQUAL 3
+# define R300_ZS_GEQUAL 4
+# define R300_ZS_GREATER 5
+# define R300_ZS_NOTEQUAL 6
+# define R300_ZS_ALWAYS 7
+# define R300_ZS_MASK 7
+ /* operations */
+# define R300_ZS_KEEP 0
+# define R300_ZS_ZERO 1
+# define R300_ZS_REPLACE 2
+# define R300_ZS_INCR 3
+# define R300_ZS_DECR 4
+# define R300_ZS_INVERT 5
+# define R300_ZS_INCR_WRAP 6
+# define R300_ZS_DECR_WRAP 7
+# define R300_Z_FUNC_SHIFT 0
+ /* front and back refer to operations done for front
+ and back faces, i.e. separate stencil function support */
+# define R300_S_FRONT_FUNC_SHIFT 3
+# define R300_S_FRONT_SFAIL_OP_SHIFT 6
+# define R300_S_FRONT_ZPASS_OP_SHIFT 9
+# define R300_S_FRONT_ZFAIL_OP_SHIFT 12
+# define R300_S_BACK_FUNC_SHIFT 15
+# define R300_S_BACK_SFAIL_OP_SHIFT 18
+# define R300_S_BACK_ZPASS_OP_SHIFT 21
+# define R300_S_BACK_ZFAIL_OP_SHIFT 24
+
+#define R300_ZB_STENCILREFMASK 0x4f08
+# define R300_STENCILREF_SHIFT 0
+# define R300_STENCILREF_MASK 0x000000ff
+# define R300_STENCILMASK_SHIFT 8
+# define R300_STENCILMASK_MASK 0x0000ff00
+# define R300_STENCILWRITEMASK_SHIFT 16
+# define R300_STENCILWRITEMASK_MASK 0x00ff0000
+
+/* gap */
+
+#define R300_ZB_FORMAT 0x4f10
+# define R300_DEPTHFORMAT_16BIT_INT_Z (0 << 0)
+# define R300_DEPTHFORMAT_16BIT_13E3 (1 << 0)
+# define R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL (2 << 0)
+/* reserved up to (15 << 0) */
+# define R300_INVERT_13E3_LEADING_ONES (0 << 4)
+# define R300_INVERT_13E3_LEADING_ZEROS (1 << 4)
+
+#define R300_ZB_ZTOP 0x4F14
+# define R300_ZTOP_DISABLE (0 << 0)
+# define R300_ZTOP_ENABLE (1 << 0)
+
+/* gap */
+
+#define R300_ZB_ZCACHE_CTLSTAT 0x4f18
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_NO_EFFECT (0 << 0)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE (1 << 0)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_NO_EFFECT (0 << 1)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE (1 << 1)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 31)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 31)
+
+#define R300_ZB_BW_CNTL 0x4f1c
+# define R300_HIZ_DISABLE (0 << 0)
+# define R300_HIZ_ENABLE (1 << 0)
+# define R300_HIZ_MIN (0 << 1)
+# define R300_HIZ_MAX (1 << 1)
+# define R300_FAST_FILL_DISABLE (0 << 2)
+# define R300_FAST_FILL_ENABLE (1 << 2)
+# define R300_RD_COMP_DISABLE (0 << 3)
+# define R300_RD_COMP_ENABLE (1 << 3)
+# define R300_WR_COMP_DISABLE (0 << 4)
+# define R300_WR_COMP_ENABLE (1 << 4)
+# define R300_ZB_CB_CLEAR_RMW (0 << 5)
+# define R300_ZB_CB_CLEAR_CACHE_LINEAR (1 << 5)
+# define R300_FORCE_COMPRESSED_STENCIL_VALUE_DISABLE (0 << 6)
+# define R300_FORCE_COMPRESSED_STENCIL_VALUE_ENABLE (1 << 6)
+
+# define R500_ZEQUAL_OPTIMIZE_ENABLE (0 << 7)
+# define R500_ZEQUAL_OPTIMIZE_DISABLE (1 << 7)
+# define R500_SEQUAL_OPTIMIZE_ENABLE (0 << 8)
+# define R500_SEQUAL_OPTIMIZE_DISABLE (1 << 8)
+
+# define R500_BMASK_ENABLE (0 << 10)
+# define R500_BMASK_DISABLE (1 << 10)
+# define R500_HIZ_EQUAL_REJECT_DISABLE (0 << 11)
+# define R500_HIZ_EQUAL_REJECT_ENABLE (1 << 11)
+# define R500_HIZ_FP_EXP_BITS_DISABLE (0 << 12)
+# define R500_HIZ_FP_EXP_BITS_1 (1 << 12)
+# define R500_HIZ_FP_EXP_BITS_2 (2 << 12)
+# define R500_HIZ_FP_EXP_BITS_3 (3 << 12)
+# define R500_HIZ_FP_EXP_BITS_4 (4 << 12)
+# define R500_HIZ_FP_EXP_BITS_5 (5 << 12)
+# define R500_HIZ_FP_INVERT_LEADING_ONES (0 << 15)
+# define R500_HIZ_FP_INVERT_LEADING_ZEROS (1 << 15)
+# define R500_TILE_OVERWRITE_RECOMPRESSION_ENABLE (0 << 16)
+# define R500_TILE_OVERWRITE_RECOMPRESSION_DISABLE (1 << 16)
+# define R500_CONTIGUOUS_6XAA_SAMPLES_ENABLE (0 << 17)
+# define R500_CONTIGUOUS_6XAA_SAMPLES_DISABLE (1 << 17)
+# define R500_PEQ_PACKING_DISABLE (0 << 18)
+# define R500_PEQ_PACKING_ENABLE (1 << 18)
+# define R500_COVERED_PTR_MASKING_DISABLE (0 << 18)
+# define R500_COVERED_PTR_MASKING_ENABLE (1 << 18)
+
+
+/* gap */
+
+/* Z Buffer Address Offset.
+ * Bits 31 to 5 are used for aligned Z buffer address offset for macro tiles.
+ */
+#define R300_ZB_DEPTHOFFSET 0x4f20
+
+/* Z Buffer Pitch and Endian Control */
+#define R300_ZB_DEPTHPITCH 0x4f24
+# define R300_DEPTHPITCH_MASK 0x00003FFC
+# define R300_DEPTHMACROTILE_DISABLE (0 << 16)
+# define R300_DEPTHMACROTILE_ENABLE (1 << 16)
+# define R300_DEPTHMICROTILE_LINEAR (0 << 17)
+# define R300_DEPTHMICROTILE_TILED (1 << 17)
+# define R300_DEPTHMICROTILE_TILED_SQUARE (2 << 17)
+# define R300_DEPTHENDIAN_NO_SWAP (0 << 18)
+# define R300_DEPTHENDIAN_WORD_SWAP (1 << 18)
+# define R300_DEPTHENDIAN_DWORD_SWAP (2 << 18)
+# define R300_DEPTHENDIAN_HALF_DWORD_SWAP (3 << 18)
+
+/* Z Buffer Clear Value */
+#define R300_ZB_DEPTHCLEARVALUE 0x4f28
+
+/* Hierarchical Z Memory Offset */
+#define R300_ZB_HIZ_OFFSET 0x4f44
+
+/* Hierarchical Z Write Index */
+#define R300_ZB_HIZ_WRINDEX 0x4f48
+
+/* Hierarchical Z Data */
+#define R300_ZB_HIZ_DWORD 0x4f4c
+
+/* Hierarchical Z Read Index */
+#define R300_ZB_HIZ_RDINDEX 0x4f50
+
+/* Hierarchical Z Pitch */
+#define R300_ZB_HIZ_PITCH 0x4f54
+
+/* Z Buffer Z Pass Counter Data */
+#define R300_ZB_ZPASS_DATA 0x4f58
+
+/* Z Buffer Z Pass Counter Address */
+#define R300_ZB_ZPASS_ADDR 0x4f5c
+
+/* Depth buffer X and Y coordinate offset */
+#define R300_ZB_DEPTHXY_OFFSET 0x4f60
+# define R300_DEPTHX_OFFSET_SHIFT 1
+# define R300_DEPTHX_OFFSET_MASK 0x000007FE
+# define R300_DEPTHY_OFFSET_SHIFT 17
+# define R300_DEPTHY_OFFSET_MASK 0x07FE0000
+
+/* Sets the fifo sizes */
+#define R500_ZB_FIFO_SIZE 0x4fd0
+# define R500_OP_FIFO_SIZE_FULL (0 << 0)
+# define R500_OP_FIFO_SIZE_HALF (1 << 0)
+# define R500_OP_FIFO_SIZE_QUATER (2 << 0)
+# define R500_OP_FIFO_SIZE_EIGTHS (4 << 0)
+
+/* Stencil Reference Value and Mask for backfacing quads */
+/* R300_ZB_STENCILREFMASK handles front face */
+#define R500_ZB_STENCILREFMASK_BF 0x4fd4
+# define R500_STENCILREF_SHIFT 0
+# define R500_STENCILREF_MASK 0x000000ff
+# define R500_STENCILMASK_SHIFT 8
+# define R500_STENCILMASK_MASK 0x0000ff00
+# define R500_STENCILWRITEMASK_SHIFT 16
+# define R500_STENCILWRITEMASK_MASK 0x00ff0000
+
+/**
+ * \defgroup R3XX_R5XX_PROGRAMMABLE_VERTEX_SHADER_DESCRIPTION R3XX-R5XX PROGRAMMABLE VERTEX SHADER DESCRIPTION
+ *
+ * The PVS_DST_MATH_INST is used to identify whether the instruction is a Vector
+ * Engine instruction or a Math Engine instruction.
+ */
+
+/*\{*/
+
+enum {
+ /* R3XX */
+ VECTOR_NO_OP = 0,
+ VE_DOT_PRODUCT = 1,
+ VE_MULTIPLY = 2,
+ VE_ADD = 3,
+ VE_MULTIPLY_ADD = 4,
+ VE_DISTANCE_VECTOR = 5,
+ VE_FRACTION = 6,
+ VE_MAXIMUM = 7,
+ VE_MINIMUM = 8,
+ VE_SET_GREATER_THAN_EQUAL = 9,
+ VE_SET_LESS_THAN = 10,
+ VE_MULTIPLYX2_ADD = 11,
+ VE_MULTIPLY_CLAMP = 12,
+ VE_FLT2FIX_DX = 13,
+ VE_FLT2FIX_DX_RND = 14,
+ /* R5XX */
+ VE_PRED_SET_EQ_PUSH = 15,
+ VE_PRED_SET_GT_PUSH = 16,
+ VE_PRED_SET_GTE_PUSH = 17,
+ VE_PRED_SET_NEQ_PUSH = 18,
+ VE_COND_WRITE_EQ = 19,
+ VE_COND_WRITE_GT = 20,
+ VE_COND_WRITE_GTE = 21,
+ VE_COND_WRITE_NEQ = 22,
+ VE_COND_MUX_EQ = 23,
+ VE_COND_MUX_GT = 24,
+ VE_COND_MUX_GTE = 25,
+ VE_SET_GREATER_THAN = 26,
+ VE_SET_EQUAL = 27,
+ VE_SET_NOT_EQUAL = 28,
+};
+
+enum {
+ /* R3XX */
+ MATH_NO_OP = 0,
+ ME_EXP_BASE2_DX = 1,
+ ME_LOG_BASE2_DX = 2,
+ ME_EXP_BASEE_FF = 3,
+ ME_LIGHT_COEFF_DX = 4,
+ ME_POWER_FUNC_FF = 5,
+ ME_RECIP_DX = 6,
+ ME_RECIP_FF = 7,
+ ME_RECIP_SQRT_DX = 8,
+ ME_RECIP_SQRT_FF = 9,
+ ME_MULTIPLY = 10,
+ ME_EXP_BASE2_FULL_DX = 11,
+ ME_LOG_BASE2_FULL_DX = 12,
+ ME_POWER_FUNC_FF_CLAMP_B = 13,
+ ME_POWER_FUNC_FF_CLAMP_B1 = 14,
+ ME_POWER_FUNC_FF_CLAMP_01 = 15,
+ ME_SIN = 16,
+ ME_COS = 17,
+ /* R5XX */
+ ME_LOG_BASE2_IEEE = 18,
+ ME_RECIP_IEEE = 19,
+ ME_RECIP_SQRT_IEEE = 20,
+ ME_PRED_SET_EQ = 21,
+ ME_PRED_SET_GT = 22,
+ ME_PRED_SET_GTE = 23,
+ ME_PRED_SET_NEQ = 24,
+ ME_PRED_SET_CLR = 25,
+ ME_PRED_SET_INV = 26,
+ ME_PRED_SET_POP = 27,
+ ME_PRED_SET_RESTORE = 28,
+};
+
+enum {
+ /* R3XX */
+ PVS_MACRO_OP_2CLK_MADD = 0,
+ PVS_MACRO_OP_2CLK_M2X_ADD = 1,
+};
+
+enum {
+ PVS_SRC_REG_TEMPORARY = 0, /* Intermediate Storage */
+ PVS_SRC_REG_INPUT = 1, /* Input Vertex Storage */
+ PVS_SRC_REG_CONSTANT = 2, /* Constant State Storage */
+ PVS_SRC_REG_ALT_TEMPORARY = 3, /* Alternate Intermediate Storage */
+};
+
+enum {
+ PVS_DST_REG_TEMPORARY = 0, /* Intermediate Storage */
+ PVS_DST_REG_A0 = 1, /* Address Register Storage */
+ PVS_DST_REG_OUT = 2, /* Output Memory. Used for all outputs */
+ PVS_DST_REG_OUT_REPL_X = 3, /* Output Memory & Replicate X to all channels */
+ PVS_DST_REG_ALT_TEMPORARY = 4, /* Alternate Intermediate Storage */
+ PVS_DST_REG_INPUT = 5, /* Output Memory & Replicate X to all channels */
+};
+
+enum {
+ PVS_SRC_SELECT_X = 0, /* Select X Component */
+ PVS_SRC_SELECT_Y = 1, /* Select Y Component */
+ PVS_SRC_SELECT_Z = 2, /* Select Z Component */
+ PVS_SRC_SELECT_W = 3, /* Select W Component */
+ PVS_SRC_SELECT_FORCE_0 = 4, /* Force Component to 0.0 */
+ PVS_SRC_SELECT_FORCE_1 = 5, /* Force Component to 1.0 */
+};
+
+/* PVS Opcode & Destination Operand Description */
+
+enum {
+ PVS_DST_OPCODE_MASK = 0x3f,
+ PVS_DST_OPCODE_SHIFT = 0,
+ PVS_DST_MATH_INST_MASK = 0x1,
+ PVS_DST_MATH_INST_SHIFT = 6,
+ PVS_DST_MACRO_INST_MASK = 0x1,
+ PVS_DST_MACRO_INST_SHIFT = 7,
+ PVS_DST_REG_TYPE_MASK = 0xf,
+ PVS_DST_REG_TYPE_SHIFT = 8,
+ PVS_DST_ADDR_MODE_1_MASK = 0x1,
+ PVS_DST_ADDR_MODE_1_SHIFT = 12,
+ PVS_DST_OFFSET_MASK = 0x7f,
+ PVS_DST_OFFSET_SHIFT = 13,
+ PVS_DST_WE_X_MASK = 0x1,
+ PVS_DST_WE_X_SHIFT = 20,
+ PVS_DST_WE_Y_MASK = 0x1,
+ PVS_DST_WE_Y_SHIFT = 21,
+ PVS_DST_WE_Z_MASK = 0x1,
+ PVS_DST_WE_Z_SHIFT = 22,
+ PVS_DST_WE_W_MASK = 0x1,
+ PVS_DST_WE_W_SHIFT = 23,
+ PVS_DST_VE_SAT_MASK = 0x1,
+ PVS_DST_VE_SAT_SHIFT = 24,
+ PVS_DST_ME_SAT_MASK = 0x1,
+ PVS_DST_ME_SAT_SHIFT = 25,
+ PVS_DST_PRED_ENABLE_MASK = 0x1,
+ PVS_DST_PRED_ENABLE_SHIFT = 26,
+ PVS_DST_PRED_SENSE_MASK = 0x1,
+ PVS_DST_PRED_SENSE_SHIFT = 27,
+ PVS_DST_DUAL_MATH_OP_MASK = 0x3,
+ PVS_DST_DUAL_MATH_OP_SHIFT = 27,
+ PVS_DST_ADDR_SEL_MASK = 0x3,
+ PVS_DST_ADDR_SEL_SHIFT = 29,
+ PVS_DST_ADDR_MODE_0_MASK = 0x1,
+ PVS_DST_ADDR_MODE_0_SHIFT = 31,
+};
+
+/* PVS Source Operand Description */
+
+enum {
+ PVS_SRC_REG_TYPE_MASK = 0x3,
+ PVS_SRC_REG_TYPE_SHIFT = 0,
+ SPARE_0_MASK = 0x1,
+ SPARE_0_SHIFT = 2,
+ PVS_SRC_ABS_XYZW_MASK = 0x1,
+ PVS_SRC_ABS_XYZW_SHIFT = 3,
+ PVS_SRC_ADDR_MODE_0_MASK = 0x1,
+ PVS_SRC_ADDR_MODE_0_SHIFT = 4,
+ PVS_SRC_OFFSET_MASK = 0xff,
+ PVS_SRC_OFFSET_SHIFT = 5,
+ PVS_SRC_SWIZZLE_X_MASK = 0x7,
+ PVS_SRC_SWIZZLE_X_SHIFT = 13,
+ PVS_SRC_SWIZZLE_Y_MASK = 0x7,
+ PVS_SRC_SWIZZLE_Y_SHIFT = 16,
+ PVS_SRC_SWIZZLE_Z_MASK = 0x7,
+ PVS_SRC_SWIZZLE_Z_SHIFT = 19,
+ PVS_SRC_SWIZZLE_W_MASK = 0x7,
+ PVS_SRC_SWIZZLE_W_SHIFT = 22,
+ PVS_SRC_MODIFIER_X_MASK = 0x1,
+ PVS_SRC_MODIFIER_X_SHIFT = 25,
+ PVS_SRC_MODIFIER_Y_MASK = 0x1,
+ PVS_SRC_MODIFIER_Y_SHIFT = 26,
+ PVS_SRC_MODIFIER_Z_MASK = 0x1,
+ PVS_SRC_MODIFIER_Z_SHIFT = 27,
+ PVS_SRC_MODIFIER_W_MASK = 0x1,
+ PVS_SRC_MODIFIER_W_SHIFT = 28,
+ PVS_SRC_ADDR_SEL_MASK = 0x3,
+ PVS_SRC_ADDR_SEL_SHIFT = 29,
+ PVS_SRC_ADDR_MODE_1_MASK = 0x0,
+ PVS_SRC_ADDR_MODE_1_SHIFT = 32,
+};
+
+/*\}*/
+
+/* BEGIN: Packet 3 commands */
+
+/* A primitive emission dword. */
+#define R300_PRIM_TYPE_NONE (0 << 0)
+#define R300_PRIM_TYPE_POINT (1 << 0)
+#define R300_PRIM_TYPE_LINE (2 << 0)
+#define R300_PRIM_TYPE_LINE_STRIP (3 << 0)
+#define R300_PRIM_TYPE_TRI_LIST (4 << 0)
+#define R300_PRIM_TYPE_TRI_FAN (5 << 0)
+#define R300_PRIM_TYPE_TRI_STRIP (6 << 0)
+#define R300_PRIM_TYPE_TRI_TYPE2 (7 << 0)
+#define R300_PRIM_TYPE_RECT_LIST (8 << 0)
+#define R300_PRIM_TYPE_3VRT_POINT_LIST (9 << 0)
+#define R300_PRIM_TYPE_3VRT_LINE_LIST (10 << 0)
+ /* GUESS (based on r200) */
+#define R300_PRIM_TYPE_POINT_SPRITES (11 << 0)
+#define R300_PRIM_TYPE_LINE_LOOP (12 << 0)
+#define R300_PRIM_TYPE_QUADS (13 << 0)
+#define R300_PRIM_TYPE_QUAD_STRIP (14 << 0)
+#define R300_PRIM_TYPE_POLYGON (15 << 0)
+#define R300_PRIM_TYPE_MASK 0xF
+#define R300_PRIM_WALK_IND (1 << 4)
+#define R300_PRIM_WALK_LIST (2 << 4)
+#define R300_PRIM_WALK_RING (3 << 4)
+#define R300_PRIM_WALK_MASK (3 << 4)
+ /* GUESS (based on r200) */
+#define R300_PRIM_COLOR_ORDER_BGRA (0 << 6)
+#define R300_PRIM_COLOR_ORDER_RGBA (1 << 6)
+#define R300_PRIM_NUM_VERTICES_SHIFT 16
+#define R300_PRIM_NUM_VERTICES_MASK 0xffff
+
+
+
+/*
+ * The R500 unified shader (US) registers come in banks of 512 each, one
+ * for each instruction slot in the shader. You can't touch them directly.
+ * R500_US_VECTOR_INDEX() sets the base instruction to modify; successive
+ * writes to R500_GA_US_VECTOR_DATA autoincrement the index after the
+ * instruction is fully specified.
+ */
+#define R500_US_ALU_ALPHA_INST_0 0xa800
+# define R500_ALPHA_OP_MAD 0
+# define R500_ALPHA_OP_DP 1
+# define R500_ALPHA_OP_MIN 2
+# define R500_ALPHA_OP_MAX 3
+/* #define R500_ALPHA_OP_RESERVED 4 */
+# define R500_ALPHA_OP_CND 5
+# define R500_ALPHA_OP_CMP 6
+# define R500_ALPHA_OP_FRC 7
+# define R500_ALPHA_OP_EX2 8
+# define R500_ALPHA_OP_LN2 9
+# define R500_ALPHA_OP_RCP 10
+# define R500_ALPHA_OP_RSQ 11
+# define R500_ALPHA_OP_SIN 12
+# define R500_ALPHA_OP_COS 13
+# define R500_ALPHA_OP_MDH 14
+# define R500_ALPHA_OP_MDV 15
+# define R500_ALPHA_ADDRD(x) (x << 4)
+# define R500_ALPHA_ADDRD_REL (1 << 11)
+# define R500_ALPHA_SEL_A_SHIFT 12
+# define R500_ALPHA_SEL_A_SRC0 (0 << 12)
+# define R500_ALPHA_SEL_A_SRC1 (1 << 12)
+# define R500_ALPHA_SEL_A_SRC2 (2 << 12)
+# define R500_ALPHA_SEL_A_SRCP (3 << 12)
+# define R500_ALPHA_SWIZ_A_R (0 << 14)
+# define R500_ALPHA_SWIZ_A_G (1 << 14)
+# define R500_ALPHA_SWIZ_A_B (2 << 14)
+# define R500_ALPHA_SWIZ_A_A (3 << 14)
+# define R500_ALPHA_SWIZ_A_0 (4 << 14)
+# define R500_ALPHA_SWIZ_A_HALF (5 << 14)
+# define R500_ALPHA_SWIZ_A_1 (6 << 14)
+/* #define R500_ALPHA_SWIZ_A_UNUSED (7 << 14) */
+# define R500_ALPHA_MOD_A_NOP (0 << 17)
+# define R500_ALPHA_MOD_A_NEG (1 << 17)
+# define R500_ALPHA_MOD_A_ABS (2 << 17)
+# define R500_ALPHA_MOD_A_NAB (3 << 17)
+# define R500_ALPHA_SEL_B_SHIFT 19
+# define R500_ALPHA_SEL_B_SRC0 (0 << 19)
+# define R500_ALPHA_SEL_B_SRC1 (1 << 19)
+# define R500_ALPHA_SEL_B_SRC2 (2 << 19)
+# define R500_ALPHA_SEL_B_SRCP (3 << 19)
+# define R500_ALPHA_SWIZ_B_R (0 << 21)
+# define R500_ALPHA_SWIZ_B_G (1 << 21)
+# define R500_ALPHA_SWIZ_B_B (2 << 21)
+# define R500_ALPHA_SWIZ_B_A (3 << 21)
+# define R500_ALPHA_SWIZ_B_0 (4 << 21)
+# define R500_ALPHA_SWIZ_B_HALF (5 << 21)
+# define R500_ALPHA_SWIZ_B_1 (6 << 21)
+/* #define R500_ALPHA_SWIZ_B_UNUSED (7 << 21) */
+# define R500_ALPHA_MOD_B_NOP (0 << 24)
+# define R500_ALPHA_MOD_B_NEG (1 << 24)
+# define R500_ALPHA_MOD_B_ABS (2 << 24)
+# define R500_ALPHA_MOD_B_NAB (3 << 24)
+# define R500_ALPHA_OMOD_IDENTITY (0 << 26)
+# define R500_ALPHA_OMOD_MUL_2 (1 << 26)
+# define R500_ALPHA_OMOD_MUL_4 (2 << 26)
+# define R500_ALPHA_OMOD_MUL_8 (3 << 26)
+# define R500_ALPHA_OMOD_DIV_2 (4 << 26)
+# define R500_ALPHA_OMOD_DIV_4 (5 << 26)
+# define R500_ALPHA_OMOD_DIV_8 (6 << 26)
+# define R500_ALPHA_OMOD_DISABLE (7 << 26)
+# define R500_ALPHA_TARGET(x) (x << 29)
+# define R500_ALPHA_W_OMASK (1 << 31)
+#define R500_US_ALU_ALPHA_ADDR_0 0x9800
+# define R500_ALPHA_ADDR0(x) (x << 0)
+# define R500_ALPHA_ADDR0_CONST (1 << 8)
+# define R500_ALPHA_ADDR0_REL (1 << 9)
+# define R500_ALPHA_ADDR1(x) (x << 10)
+# define R500_ALPHA_ADDR1_CONST (1 << 18)
+# define R500_ALPHA_ADDR1_REL (1 << 19)
+# define R500_ALPHA_ADDR2(x) (x << 20)
+# define R500_ALPHA_ADDR2_CONST (1 << 28)
+# define R500_ALPHA_ADDR2_REL (1 << 29)
+# define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30)
+# define R500_ALPHA_SRCP_OP_A1_MINUS_A0 (1 << 30)
+# define R500_ALPHA_SRCP_OP_A1_PLUS_A0 (2 << 30)
+# define R500_ALPHA_SRCP_OP_1_MINUS_A0 (3 << 30)
+#define R500_US_ALU_RGBA_INST_0 0xb000
+# define R500_ALU_RGBA_OP_MAD (0 << 0)
+# define R500_ALU_RGBA_OP_DP3 (1 << 0)
+# define R500_ALU_RGBA_OP_DP4 (2 << 0)
+# define R500_ALU_RGBA_OP_D2A (3 << 0)
+# define R500_ALU_RGBA_OP_MIN (4 << 0)
+# define R500_ALU_RGBA_OP_MAX (5 << 0)
+/* #define R500_ALU_RGBA_OP_RESERVED (6 << 0) */
+# define R500_ALU_RGBA_OP_CND (7 << 0)
+# define R500_ALU_RGBA_OP_CMP (8 << 0)
+# define R500_ALU_RGBA_OP_FRC (9 << 0)
+# define R500_ALU_RGBA_OP_SOP (10 << 0)
+# define R500_ALU_RGBA_OP_MDH (11 << 0)
+# define R500_ALU_RGBA_OP_MDV (12 << 0)
+# define R500_ALU_RGBA_ADDRD(x) (x << 4)
+# define R500_ALU_RGBA_ADDRD_REL (1 << 11)
+# define R500_ALU_RGBA_SEL_C_SHIFT 12
+# define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12)
+# define R500_ALU_RGBA_SEL_C_SRC1 (1 << 12)
+# define R500_ALU_RGBA_SEL_C_SRC2 (2 << 12)
+# define R500_ALU_RGBA_SEL_C_SRCP (3 << 12)
+# define R500_ALU_RGBA_R_SWIZ_R (0 << 14)
+# define R500_ALU_RGBA_R_SWIZ_G (1 << 14)
+# define R500_ALU_RGBA_R_SWIZ_B (2 << 14)
+# define R500_ALU_RGBA_R_SWIZ_A (3 << 14)
+# define R500_ALU_RGBA_R_SWIZ_0 (4 << 14)
+# define R500_ALU_RGBA_R_SWIZ_HALF (5 << 14)
+# define R500_ALU_RGBA_R_SWIZ_1 (6 << 14)
+/* #define R500_ALU_RGBA_R_SWIZ_UNUSED (7 << 14) */
+# define R500_ALU_RGBA_G_SWIZ_R (0 << 17)
+# define R500_ALU_RGBA_G_SWIZ_G (1 << 17)
+# define R500_ALU_RGBA_G_SWIZ_B (2 << 17)
+# define R500_ALU_RGBA_G_SWIZ_A (3 << 17)
+# define R500_ALU_RGBA_G_SWIZ_0 (4 << 17)
+# define R500_ALU_RGBA_G_SWIZ_HALF (5 << 17)
+# define R500_ALU_RGBA_G_SWIZ_1 (6 << 17)
+/* #define R500_ALU_RGBA_G_SWIZ_UNUSED (7 << 17) */
+# define R500_ALU_RGBA_B_SWIZ_R (0 << 20)
+# define R500_ALU_RGBA_B_SWIZ_G (1 << 20)
+# define R500_ALU_RGBA_B_SWIZ_B (2 << 20)
+# define R500_ALU_RGBA_B_SWIZ_A (3 << 20)
+# define R500_ALU_RGBA_B_SWIZ_0 (4 << 20)
+# define R500_ALU_RGBA_B_SWIZ_HALF (5 << 20)
+# define R500_ALU_RGBA_B_SWIZ_1 (6 << 20)
+/* #define R500_ALU_RGBA_B_SWIZ_UNUSED (7 << 20) */
+# define R500_ALU_RGBA_MOD_C_NOP (0 << 23)
+# define R500_ALU_RGBA_MOD_C_NEG (1 << 23)
+# define R500_ALU_RGBA_MOD_C_ABS (2 << 23)
+# define R500_ALU_RGBA_MOD_C_NAB (3 << 23)
+# define R500_ALU_RGBA_ALPHA_SEL_C_SHIFT 25
+# define R500_ALU_RGBA_ALPHA_SEL_C_SRC0 (0 << 25)
+# define R500_ALU_RGBA_ALPHA_SEL_C_SRC1 (1 << 25)
+# define R500_ALU_RGBA_ALPHA_SEL_C_SRC2 (2 << 25)
+# define R500_ALU_RGBA_ALPHA_SEL_C_SRCP (3 << 25)
+# define R500_ALU_RGBA_A_SWIZ_R (0 << 27)
+# define R500_ALU_RGBA_A_SWIZ_G (1 << 27)
+# define R500_ALU_RGBA_A_SWIZ_B (2 << 27)
+# define R500_ALU_RGBA_A_SWIZ_A (3 << 27)
+# define R500_ALU_RGBA_A_SWIZ_0 (4 << 27)
+# define R500_ALU_RGBA_A_SWIZ_HALF (5 << 27)
+# define R500_ALU_RGBA_A_SWIZ_1 (6 << 27)
+/* #define R500_ALU_RGBA_A_SWIZ_UNUSED (7 << 27) */
+# define R500_ALU_RGBA_ALPHA_MOD_C_NOP (0 << 30)
+# define R500_ALU_RGBA_ALPHA_MOD_C_NEG (1 << 30)
+# define R500_ALU_RGBA_ALPHA_MOD_C_ABS (2 << 30)
+# define R500_ALU_RGBA_ALPHA_MOD_C_NAB (3 << 30)
+#define R500_US_ALU_RGB_INST_0 0xa000
+# define R500_ALU_RGB_SEL_A_SHIFT 0
+# define R500_ALU_RGB_SEL_A_SRC0 (0 << 0)
+# define R500_ALU_RGB_SEL_A_SRC1 (1 << 0)
+# define R500_ALU_RGB_SEL_A_SRC2 (2 << 0)
+# define R500_ALU_RGB_SEL_A_SRCP (3 << 0)
+# define R500_ALU_RGB_R_SWIZ_A_R (0 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_G (1 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_B (2 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_A (3 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_0 (4 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_HALF (5 << 2)
+# define R500_ALU_RGB_R_SWIZ_A_1 (6 << 2)
+/* #define R500_ALU_RGB_R_SWIZ_A_UNUSED (7 << 2) */
+# define R500_ALU_RGB_G_SWIZ_A_R (0 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_G (1 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_B (2 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_A (3 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_0 (4 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_HALF (5 << 5)
+# define R500_ALU_RGB_G_SWIZ_A_1 (6 << 5)
+/* #define R500_ALU_RGB_G_SWIZ_A_UNUSED (7 << 5) */
+# define R500_ALU_RGB_B_SWIZ_A_R (0 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_G (1 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_B (2 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_A (3 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_0 (4 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_HALF (5 << 8)
+# define R500_ALU_RGB_B_SWIZ_A_1 (6 << 8)
+/* #define R500_ALU_RGB_B_SWIZ_A_UNUSED (7 << 8) */
+# define R500_ALU_RGB_MOD_A_NOP (0 << 11)
+# define R500_ALU_RGB_MOD_A_NEG (1 << 11)
+# define R500_ALU_RGB_MOD_A_ABS (2 << 11)
+# define R500_ALU_RGB_MOD_A_NAB (3 << 11)
+# define R500_ALU_RGB_SEL_B_SHIFT 13
+# define R500_ALU_RGB_SEL_B_SRC0 (0 << 13)
+# define R500_ALU_RGB_SEL_B_SRC1 (1 << 13)
+# define R500_ALU_RGB_SEL_B_SRC2 (2 << 13)
+# define R500_ALU_RGB_SEL_B_SRCP (3 << 13)
+# define R500_ALU_RGB_R_SWIZ_B_R (0 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_G (1 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_B (2 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_A (3 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_0 (4 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_HALF (5 << 15)
+# define R500_ALU_RGB_R_SWIZ_B_1 (6 << 15)
+/* #define R500_ALU_RGB_R_SWIZ_B_UNUSED (7 << 15) */
+# define R500_ALU_RGB_G_SWIZ_B_R (0 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_G (1 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_B (2 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_A (3 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_0 (4 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_HALF (5 << 18)
+# define R500_ALU_RGB_G_SWIZ_B_1 (6 << 18)
+/* #define R500_ALU_RGB_G_SWIZ_B_UNUSED (7 << 18) */
+# define R500_ALU_RGB_B_SWIZ_B_R (0 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_G (1 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_B (2 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_A (3 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_0 (4 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_HALF (5 << 21)
+# define R500_ALU_RGB_B_SWIZ_B_1 (6 << 21)
+/* #define R500_ALU_RGB_B_SWIZ_B_UNUSED (7 << 21) */
+# define R500_ALU_RGB_MOD_B_NOP (0 << 24)
+# define R500_ALU_RGB_MOD_B_NEG (1 << 24)
+# define R500_ALU_RGB_MOD_B_ABS (2 << 24)
+# define R500_ALU_RGB_MOD_B_NAB (3 << 24)
+# define R500_ALU_RGB_OMOD_IDENTITY (0 << 26)
+# define R500_ALU_RGB_OMOD_MUL_2 (1 << 26)
+# define R500_ALU_RGB_OMOD_MUL_4 (2 << 26)
+# define R500_ALU_RGB_OMOD_MUL_8 (3 << 26)
+# define R500_ALU_RGB_OMOD_DIV_2 (4 << 26)
+# define R500_ALU_RGB_OMOD_DIV_4 (5 << 26)
+# define R500_ALU_RGB_OMOD_DIV_8 (6 << 26)
+# define R500_ALU_RGB_OMOD_DISABLE (7 << 26)
+# define R500_ALU_RGB_TARGET(x) (x << 29)
+# define R500_ALU_RGB_WMASK (1 << 31)
+#define R500_US_ALU_RGB_ADDR_0 0x9000
+# define R500_RGB_ADDR0(x) (x << 0)
+# define R500_RGB_ADDR0_CONST (1 << 8)
+# define R500_RGB_ADDR0_REL (1 << 9)
+# define R500_RGB_ADDR1(x) (x << 10)
+# define R500_RGB_ADDR1_CONST (1 << 18)
+# define R500_RGB_ADDR1_REL (1 << 19)
+# define R500_RGB_ADDR2(x) (x << 20)
+# define R500_RGB_ADDR2_CONST (1 << 28)
+# define R500_RGB_ADDR2_REL (1 << 29)
+# define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30)
+# define R500_RGB_SRCP_OP_RGB1_MINUS_RGB0 (1 << 30)
+# define R500_RGB_SRCP_OP_RGB1_PLUS_RGB0 (2 << 30)
+# define R500_RGB_SRCP_OP_1_MINUS_RGB0 (3 << 30)
+#define R500_US_CMN_INST_0 0xb800
+# define R500_INST_TYPE_MASK (3 << 0)
+# define R500_INST_TYPE_ALU (0 << 0)
+# define R500_INST_TYPE_OUT (1 << 0)
+# define R500_INST_TYPE_FC (2 << 0)
+# define R500_INST_TYPE_TEX (3 << 0)
+# define R500_INST_TEX_SEM_WAIT (1 << 2)
+# define R500_INST_RGB_PRED_SEL_NONE (0 << 3)
+# define R500_INST_RGB_PRED_SEL_RGBA (1 << 3)
+# define R500_INST_RGB_PRED_SEL_RRRR (2 << 3)
+# define R500_INST_RGB_PRED_SEL_GGGG (3 << 3)
+# define R500_INST_RGB_PRED_SEL_BBBB (4 << 3)
+# define R500_INST_RGB_PRED_SEL_AAAA (5 << 3)
+# define R500_INST_RGB_PRED_INV (1 << 6)
+# define R500_INST_WRITE_INACTIVE (1 << 7)
+# define R500_INST_LAST (1 << 8)
+# define R500_INST_NOP (1 << 9)
+# define R500_INST_ALU_WAIT (1 << 10)
+# define R500_INST_RGB_WMASK_R (1 << 11)
+# define R500_INST_RGB_WMASK_G (1 << 12)
+# define R500_INST_RGB_WMASK_B (1 << 13)
+# define R500_INST_ALPHA_WMASK (1 << 14)
+# define R500_INST_RGB_OMASK_R (1 << 15)
+# define R500_INST_RGB_OMASK_G (1 << 16)
+# define R500_INST_RGB_OMASK_B (1 << 17)
+# define R500_INST_RGB_OMASK_RGB (7 << 15)
+# define R500_INST_ALPHA_OMASK (1 << 18)
+# define R500_INST_RGB_CLAMP (1 << 19)
+# define R500_INST_ALPHA_CLAMP (1 << 20)
+# define R500_INST_ALU_RESULT_SEL (1 << 21)
+# define R500_INST_ALPHA_PRED_INV (1 << 22)
+# define R500_INST_ALU_RESULT_OP_EQ (0 << 23)
+# define R500_INST_ALU_RESULT_OP_LT (1 << 23)
+# define R500_INST_ALU_RESULT_OP_GE (2 << 23)
+# define R500_INST_ALU_RESULT_OP_NE (3 << 23)
+# define R500_INST_ALPHA_PRED_SEL_NONE (0 << 25)
+# define R500_INST_ALPHA_PRED_SEL_RGBA (1 << 25)
+# define R500_INST_ALPHA_PRED_SEL_RRRR (2 << 25)
+# define R500_INST_ALPHA_PRED_SEL_GGGG (3 << 25)
+# define R500_INST_ALPHA_PRED_SEL_BBBB (4 << 25)
+# define R500_INST_ALPHA_PRED_SEL_AAAA (5 << 25)
+/* XXX next four are kind of guessed */
+# define R500_INST_STAT_WE_R (1 << 28)
+# define R500_INST_STAT_WE_G (1 << 29)
+# define R500_INST_STAT_WE_B (1 << 30)
+# define R500_INST_STAT_WE_A (1 << 31)
+
+/* note that these are 8 bit lengths, despite the offsets, at least for R500 */
+#define R500_US_CODE_ADDR 0x4630
+# define R500_US_CODE_START_ADDR(x) (x << 0)
+# define R500_US_CODE_END_ADDR(x) (x << 16)
+#define R500_US_CODE_OFFSET 0x4638
+# define R500_US_CODE_OFFSET_ADDR(x) (x << 0)
+#define R500_US_CODE_RANGE 0x4634
+# define R500_US_CODE_RANGE_ADDR(x) (x << 0)
+# define R500_US_CODE_RANGE_SIZE(x) (x << 16)
+#define R500_US_CONFIG 0x4600
+# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1)
+#define R500_US_FC_ADDR_0 0xa000
+# define R500_FC_BOOL_ADDR(x) (x << 0)
+# define R500_FC_INT_ADDR(x) (x << 8)
+# define R500_FC_JUMP_ADDR(x) (x << 16)
+# define R500_FC_JUMP_GLOBAL (1 << 31)
+#define R500_US_FC_BOOL_CONST 0x4620
+# define R500_FC_KBOOL(x) (x)
+#define R500_US_FC_CTRL 0x4624
+# define R500_FC_TEST_EN (1 << 30)
+# define R500_FC_FULL_FC_EN (1 << 31)
+#define R500_US_FC_INST_0 0x9800
+# define R500_FC_OP_JUMP (0 << 0)
+# define R500_FC_OP_LOOP (1 << 0)
+# define R500_FC_OP_ENDLOOP (2 << 0)
+# define R500_FC_OP_REP (3 << 0)
+# define R500_FC_OP_ENDREP (4 << 0)
+# define R500_FC_OP_BREAKLOOP (5 << 0)
+# define R500_FC_OP_BREAKREP (6 << 0)
+# define R500_FC_OP_CONTINUE (7 << 0)
+# define R500_FC_B_ELSE (1 << 4)
+# define R500_FC_JUMP_ANY (1 << 5)
+# define R500_FC_A_OP_NONE (0 << 6)
+# define R500_FC_A_OP_POP (1 << 6)
+# define R500_FC_A_OP_PUSH (2 << 6)
+# define R500_FC_JUMP_FUNC(x) (x << 8)
+# define R500_FC_B_POP_CNT(x) (x << 16)
+# define R500_FC_B_OP0_NONE (0 << 24)
+# define R500_FC_B_OP0_DECR (1 << 24)
+# define R500_FC_B_OP0_INCR (2 << 24)
+# define R500_FC_B_OP1_DECR (0 << 26)
+# define R500_FC_B_OP1_NONE (1 << 26)
+# define R500_FC_B_OP1_INCR (2 << 26)
+# define R500_FC_IGNORE_UNCOVERED (1 << 28)
+#define R500_US_FC_INT_CONST_0 0x4c00
+# define R500_FC_INT_CONST_KR(x) (x << 0)
+# define R500_FC_INT_CONST_KG(x) (x << 8)
+# define R500_FC_INT_CONST_KB(x) (x << 16)
+/* _0 through _15 */
+#define R500_US_FORMAT0_0 0x4640
+# define R500_FORMAT_TXWIDTH(x) (x << 0)
+# define R500_FORMAT_TXHEIGHT(x) (x << 11)
+# define R500_FORMAT_TXDEPTH(x) (x << 22)
+#define R500_US_PIXSIZE 0x4604
+# define R500_PIX_SIZE(x) (x)
+#define R500_US_TEX_ADDR_0 0x9800
+# define R500_TEX_SRC_ADDR(x) (x << 0)
+# define R500_TEX_SRC_ADDR_REL (1 << 7)
+# define R500_TEX_SRC_S_SWIZ_R (0 << 8)
+# define R500_TEX_SRC_S_SWIZ_G (1 << 8)
+# define R500_TEX_SRC_S_SWIZ_B (2 << 8)
+# define R500_TEX_SRC_S_SWIZ_A (3 << 8)
+# define R500_TEX_SRC_T_SWIZ_R (0 << 10)
+# define R500_TEX_SRC_T_SWIZ_G (1 << 10)
+# define R500_TEX_SRC_T_SWIZ_B (2 << 10)
+# define R500_TEX_SRC_T_SWIZ_A (3 << 10)
+# define R500_TEX_SRC_R_SWIZ_R (0 << 12)
+# define R500_TEX_SRC_R_SWIZ_G (1 << 12)
+# define R500_TEX_SRC_R_SWIZ_B (2 << 12)
+# define R500_TEX_SRC_R_SWIZ_A (3 << 12)
+# define R500_TEX_SRC_Q_SWIZ_R (0 << 14)
+# define R500_TEX_SRC_Q_SWIZ_G (1 << 14)
+# define R500_TEX_SRC_Q_SWIZ_B (2 << 14)
+# define R500_TEX_SRC_Q_SWIZ_A (3 << 14)
+# define R500_TEX_DST_ADDR(x) (x << 16)
+# define R500_TEX_DST_ADDR_REL (1 << 23)
+# define R500_TEX_DST_R_SWIZ_R (0 << 24)
+# define R500_TEX_DST_R_SWIZ_G (1 << 24)
+# define R500_TEX_DST_R_SWIZ_B (2 << 24)
+# define R500_TEX_DST_R_SWIZ_A (3 << 24)
+# define R500_TEX_DST_G_SWIZ_R (0 << 26)
+# define R500_TEX_DST_G_SWIZ_G (1 << 26)
+# define R500_TEX_DST_G_SWIZ_B (2 << 26)
+# define R500_TEX_DST_G_SWIZ_A (3 << 26)
+# define R500_TEX_DST_B_SWIZ_R (0 << 28)
+# define R500_TEX_DST_B_SWIZ_G (1 << 28)
+# define R500_TEX_DST_B_SWIZ_B (2 << 28)
+# define R500_TEX_DST_B_SWIZ_A (3 << 28)
+# define R500_TEX_DST_A_SWIZ_R (0 << 30)
+# define R500_TEX_DST_A_SWIZ_G (1 << 30)
+# define R500_TEX_DST_A_SWIZ_B (2 << 30)
+# define R500_TEX_DST_A_SWIZ_A (3 << 30)
+#define R500_US_TEX_ADDR_DXDY_0 0xa000
+# define R500_DX_ADDR(x) (x << 0)
+# define R500_DX_ADDR_REL (1 << 7)
+# define R500_DX_S_SWIZ_R (0 << 8)
+# define R500_DX_S_SWIZ_G (1 << 8)
+# define R500_DX_S_SWIZ_B (2 << 8)
+# define R500_DX_S_SWIZ_A (3 << 8)
+# define R500_DX_T_SWIZ_R (0 << 10)
+# define R500_DX_T_SWIZ_G (1 << 10)
+# define R500_DX_T_SWIZ_B (2 << 10)
+# define R500_DX_T_SWIZ_A (3 << 10)
+# define R500_DX_R_SWIZ_R (0 << 12)
+# define R500_DX_R_SWIZ_G (1 << 12)
+# define R500_DX_R_SWIZ_B (2 << 12)
+# define R500_DX_R_SWIZ_A (3 << 12)
+# define R500_DX_Q_SWIZ_R (0 << 14)
+# define R500_DX_Q_SWIZ_G (1 << 14)
+# define R500_DX_Q_SWIZ_B (2 << 14)
+# define R500_DX_Q_SWIZ_A (3 << 14)
+# define R500_DY_ADDR(x) (x << 16)
+# define R500_DY_ADDR_REL (1 << 17)
+# define R500_DY_S_SWIZ_R (0 << 24)
+# define R500_DY_S_SWIZ_G (1 << 24)
+# define R500_DY_S_SWIZ_B (2 << 24)
+# define R500_DY_S_SWIZ_A (3 << 24)
+# define R500_DY_T_SWIZ_R (0 << 26)
+# define R500_DY_T_SWIZ_G (1 << 26)
+# define R500_DY_T_SWIZ_B (2 << 26)
+# define R500_DY_T_SWIZ_A (3 << 26)
+# define R500_DY_R_SWIZ_R (0 << 28)
+# define R500_DY_R_SWIZ_G (1 << 28)
+# define R500_DY_R_SWIZ_B (2 << 28)
+# define R500_DY_R_SWIZ_A (3 << 28)
+# define R500_DY_Q_SWIZ_R (0 << 30)
+# define R500_DY_Q_SWIZ_G (1 << 30)
+# define R500_DY_Q_SWIZ_B (2 << 30)
+# define R500_DY_Q_SWIZ_A (3 << 30)
+#define R500_US_TEX_INST_0 0x9000
+# define R500_TEX_ID(x) (x << 16)
+# define R500_TEX_INST_NOP (0 << 22)
+# define R500_TEX_INST_LD (1 << 22)
+# define R500_TEX_INST_TEXKILL (2 << 22)
+# define R500_TEX_INST_PROJ (3 << 22)
+# define R500_TEX_INST_LODBIAS (4 << 22)
+# define R500_TEX_INST_LOD (5 << 22)
+# define R500_TEX_INST_DXDY (6 << 22)
+# define R500_TEX_SEM_ACQUIRE (1 << 25)
+# define R500_TEX_IGNORE_UNCOVERED (1 << 26)
+# define R500_TEX_UNSCALED (1 << 27)
+#define R300_US_W_FMT 0x46b4
+# define R300_W_FMT_W0 (0 << 0)
+# define R300_W_FMT_W24 (1 << 0)
+# define R300_W_FMT_W24FP (2 << 0)
+# define R300_W_SRC_US (0 << 2)
+# define R300_W_SRC_RAS (1 << 2)
+
+
+/* Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR.
+ * Two parameter dwords:
+ * 0. VAP_VTX_FMT: The first parameter is not written to hardware
+ * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword.
+ */
+#define R300_PACKET3_3D_DRAW_VBUF 0x00002800
+
+/* Draw a primitive from immediate vertices in this packet
+ * Up to 16382 dwords:
+ * 0. VAP_VTX_FMT: The first parameter is not written to hardware
+ * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword.
+ * 2 to end: Up to 16380 dwords of vertex data.
+ */
+#define R300_PACKET3_3D_DRAW_IMMD 0x00002900
+
+/* Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR and
+ * immediate vertices in this packet
+ * Up to 16382 dwords:
+ * 0. VAP_VTX_FMT: The first parameter is not written to hardware
+ * 1. VAP_VF_CTL: The second parameter is a standard primitive emission dword.
+ * 2 to end: Up to 16380 dwords of vertex data.
+ */
+#define R300_PACKET3_3D_DRAW_INDX 0x00002A00
+
+
+/* Specify the full set of vertex arrays as (address, stride).
+ * The first parameter is the number of vertex arrays specified.
+ * The rest of the command is a variable length list of blocks, where
+ * each block is three dwords long and specifies two arrays.
+ * The first dword of a block is split into two words, the lower significant
+ * word refers to the first array, the more significant word to the second
+ * array in the block.
+ * The low byte of each word contains the size of an array entry in dwords,
+ * the high byte contains the stride of the array.
+ * The second dword of a block contains the pointer to the first array,
+ * the third dword of a block contains the pointer to the second array.
+ * Note that if the total number of arrays is odd, the third dword of
+ * the last block is omitted.
+ */
+#define R300_PACKET3_3D_LOAD_VBPNTR 0x00002F00
+
+#define R300_PACKET3_INDX_BUFFER 0x00003300
+# define R300_EB_UNK1_SHIFT 24
+# define R300_EB_UNK1 (0x80<<24)
+# define R300_EB_UNK2 0x0810
+
+/* Same as R300_PACKET3_3D_DRAW_VBUF but without VAP_VTX_FMT */
+#define R300_PACKET3_3D_DRAW_VBUF_2 0x00003400
+/* Same as R300_PACKET3_3D_DRAW_IMMD but without VAP_VTX_FMT */
+#define R300_PACKET3_3D_DRAW_IMMD_2 0x00003500
+/* Same as R300_PACKET3_3D_DRAW_INDX but without VAP_VTX_FMT */
+#define R300_PACKET3_3D_DRAW_INDX_2 0x00003600
+
+/* Clears a portion of hierachical Z RAM
+ * 3 dword parameters
+ * 0. START
+ * 1. COUNT: 13:0 (max is 0x3FFF)
+ * 2. CLEAR_VALUE: Value to write into HIZ RAM.
+ */
+#define R300_PACKET3_3D_CLEAR_HIZ 0x00003700
+
+/* Draws a set of primitives using vertex buffers pointed by the state data.
+ * At least 2 Parameters:
+ * 0. VAP_VF_CNTL: The first parameter is a standard primitive emission dword.
+ * 2 to end: Data or indices (see other 3D_DRAW_* packets for details)
+ */
+#define R300_PACKET3_3D_DRAW_128 0x00003900
+
+/* END: Packet 3 commands */
+
+
+/* Color formats for 2d packets
+ */
+#define R300_CP_COLOR_FORMAT_CI8 2
+#define R300_CP_COLOR_FORMAT_ARGB1555 3
+#define R300_CP_COLOR_FORMAT_RGB565 4
+#define R300_CP_COLOR_FORMAT_ARGB8888 6
+#define R300_CP_COLOR_FORMAT_RGB332 7
+#define R300_CP_COLOR_FORMAT_RGB8 9
+#define R300_CP_COLOR_FORMAT_ARGB4444 15
+
+/*
+ * CP type-3 packets
+ */
+#define R300_CP_CMD_BITBLT_MULTI 0xC0009B00
+
+/* XXX Corbin's stuff from radeon and r200 */
+
+#define RADEON_WAIT_UNTIL 0x1720
+# define RADEON_WAIT_CRTC_PFLIP (1 << 0)
+# define RADEON_WAIT_2D_IDLECLEAN (1 << 16)
+# define RADEON_WAIT_3D_IDLECLEAN (1 << 17)
+# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18)
+
+#define RADEON_CP_PACKET3 0xC0000000
+
+#define R200_3D_DRAW_IMMD_2 0xC0003500
+
+#endif /* _R300_REG_H */
+
+/* *INDENT-ON* */
+
+/* vim: set foldenable foldmarker=\\{,\\} foldmethod=marker : */
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
new file mode 100644
index 0000000000..d7354ad893
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -0,0 +1,282 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_screen.h"
+
+/* Return the identifier behind whom the brave coders responsible for this
+ * amalgamation of code, sweat, and duct tape, routinely obscure their names.
+ *
+ * ...I should have just put "Corbin Simpson", but I'm not that cool.
+ *
+ * (Or egotistical. Yet.) */
+static const char* r300_get_vendor(struct pipe_screen* pscreen)
+{
+ return "X.Org R300 Project";
+}
+
+static const char* chip_families[] = {
+ "R300",
+ "R350",
+ "R360",
+ "RV350",
+ "RV370",
+ "RV380",
+ "R420",
+ "R423",
+ "R430",
+ "R480",
+ "R481",
+ "RV410",
+ "RS400",
+ "RC410",
+ "RS480",
+ "RS482",
+ "RS690",
+ "RS740",
+ "RV515",
+ "R520",
+ "RV530",
+ "R580",
+ "RV560",
+ "RV570"
+};
+
+static const char* r300_get_name(struct pipe_screen* pscreen)
+{
+ struct r300_screen* r300screen = r300_screen(pscreen);
+
+ return chip_families[r300screen->caps->family];
+}
+
+static int r300_get_param(struct pipe_screen* pscreen, int param)
+{
+ struct r300_screen* r300screen = r300_screen(pscreen);
+
+ switch (param) {
+ /* XXX cases marked "IN THEORY" are possible on the hardware,
+ * but haven't been implemented yet. */
+ case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
+ /* XXX I'm told this goes up to 16 */
+ return 8;
+ case PIPE_CAP_NPOT_TEXTURES:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_TWO_SIDED_STENCIL:
+ if (r300screen->caps->is_r500) {
+ return 1;
+ } else {
+ return 0;
+ }
+ return 0;
+ case PIPE_CAP_GLSL:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_S3TC:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_ANISOTROPIC_FILTER:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_POINT_SPRITE:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_MAX_RENDER_TARGETS:
+ return 4;
+ case PIPE_CAP_OCCLUSION_QUERY:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_TEXTURE_SHADOW_MAP:
+ /* IN THEORY */
+ return 0;
+ case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
+ if (r300screen->caps->is_r500) {
+ /* 13 == 4096x4096 */
+ return 13;
+ } else {
+ /* 12 == 2048x2048 */
+ return 12;
+ }
+ case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
+ /* So, technically, the limit is the same as above, but some math
+ * shows why this is silly. Assuming RGBA, 4cpp, we can see that
+ * 4096*4096*4096 = 64.0 GiB exactly, so it's not exactly
+ * practical. However, if at some point a game really wants this,
+ * then we can remove or raise this limit. */
+ if (r300screen->caps->is_r500) {
+ /* 9 == 256x256x256 */
+ return 9;
+ } else {
+ /* 8 == 128*128*128 */
+ return 8;
+ }
+ case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
+ if (r300screen->caps->is_r500) {
+ /* 13 == 4096x4096 */
+ return 13;
+ } else {
+ /* 12 == 2048x2048 */
+ return 12;
+ }
+ case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
+ return 1;
+ case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
+ return 1;
+ case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
+ /* XXX guessing (what a terrible guess) */
+ return 2;
+ default:
+ debug_printf("r300: Implementation error: Bad param %d\n",
+ param);
+ return 0;
+ }
+}
+
+static float r300_get_paramf(struct pipe_screen* pscreen, int param)
+{
+ switch (param) {
+ case PIPE_CAP_MAX_LINE_WIDTH:
+ case PIPE_CAP_MAX_LINE_WIDTH_AA:
+ /* XXX this is the biggest thing that will fit in that register.
+ * Perhaps the actual rendering limits are less? */
+ return 10922.0f;
+ case PIPE_CAP_MAX_POINT_WIDTH:
+ case PIPE_CAP_MAX_POINT_WIDTH_AA:
+ /* XXX this is the biggest thing that will fit in that register.
+ * Perhaps the actual rendering limits are less? */
+ return 10922.0f;
+ case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+ return 16.0f;
+ case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+ return 16.0f;
+ default:
+ debug_printf("r300: Implementation error: Bad paramf %d\n",
+ param);
+ return 0.0f;
+ }
+}
+
+/* XXX even moar formats */
+static boolean check_tex_2d_format(enum pipe_format format)
+{
+ switch (format) {
+ /* Colorbuffer */
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ /* Texture */
+ case PIPE_FORMAT_I8_UNORM:
+ /* Z buffer */
+ case PIPE_FORMAT_Z16_UNORM:
+ /* Z buffer with stencil */
+ case PIPE_FORMAT_Z24S8_UNORM:
+ return TRUE;
+
+ /* These formats are explicitly not supported, in order to keep
+ * people from wasting their time trying to implement them... */
+ case PIPE_FORMAT_S8Z24_UNORM:
+ return FALSE;
+
+ default:
+ debug_printf("r300: Warning: Got unknown format: %s, in %s\n",
+ pf_name(format), __FUNCTION__);
+ break;
+ }
+
+ return FALSE;
+}
+
+/* XXX moar targets */
+static boolean r300_is_format_supported(struct pipe_screen* pscreen,
+ enum pipe_format format,
+ enum pipe_texture_target target,
+ unsigned tex_usage,
+ unsigned geom_flags)
+{
+ switch (target) {
+ case PIPE_TEXTURE_2D:
+ return check_tex_2d_format(format);
+ default:
+ debug_printf("r300: Warning: Got unknown format target: %d\n",
+ format);
+ break;
+ }
+
+ return FALSE;
+}
+
+static void* r300_surface_map(struct pipe_screen* screen,
+ struct pipe_surface* surface,
+ unsigned flags)
+{
+ struct r300_texture* tex = (struct r300_texture*)surface->texture;
+ char* map = pipe_buffer_map(screen, tex->buffer, flags);
+
+ if (!map) {
+ return NULL;
+ }
+
+ return map + surface->offset;
+}
+
+static void r300_surface_unmap(struct pipe_screen* screen,
+ struct pipe_surface* surface)
+{
+ struct r300_texture* tex = (struct r300_texture*)surface->texture;
+ pipe_buffer_unmap(screen, tex->buffer);
+}
+
+static void r300_destroy_screen(struct pipe_screen* pscreen)
+{
+ struct r300_screen* r300screen = r300_screen(pscreen);
+
+ FREE(r300screen->caps);
+ FREE(r300screen);
+}
+
+struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys,
+ struct r300_winsys* r300_winsys)
+{
+ struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen);
+ struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities);
+
+ if (!r300screen || !caps)
+ return NULL;
+
+ caps->pci_id = r300_winsys->pci_id;
+ caps->num_frag_pipes = r300_winsys->gb_pipes;
+
+ r300_parse_chipset(caps);
+
+ r300screen->caps = caps;
+ r300screen->screen.winsys = winsys;
+ r300screen->screen.destroy = r300_destroy_screen;
+ r300screen->screen.get_name = r300_get_name;
+ r300screen->screen.get_vendor = r300_get_vendor;
+ r300screen->screen.get_param = r300_get_param;
+ r300screen->screen.get_paramf = r300_get_paramf;
+ r300screen->screen.is_format_supported = r300_is_format_supported;
+ r300screen->screen.surface_map = r300_surface_map;
+ r300screen->screen.surface_unmap = r300_surface_unmap;
+
+ r300_init_screen_texture_functions(&r300screen->screen);
+ u_simple_screen_init(&r300screen->screen);
+
+ return &r300screen->screen;
+}
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
new file mode 100644
index 0000000000..2e25f61dbf
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_SCREEN_H
+#define R300_SCREEN_H
+
+#include "pipe/p_inlines.h"
+#include "pipe/p_screen.h"
+#include "util/u_memory.h"
+#include "util/u_simple_screen.h"
+
+#include "r300_chipset.h"
+#include "r300_texture.h"
+#include "r300_winsys.h"
+
+struct r300_screen {
+ /* Parent class */
+ struct pipe_screen screen;
+
+ /* Chipset capabilities */
+ struct r300_capabilities* caps;
+};
+
+/* Convenience cast wrapper. */
+static struct r300_screen* r300_screen(struct pipe_screen* screen) {
+ return (struct r300_screen*)screen;
+}
+
+/* Creates a new r300 screen. */
+struct pipe_screen* r300_create_screen(struct pipe_winsys* winsys,
+ struct r300_winsys* r300_winsys);
+
+#endif /* R300_SCREEN_H */
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
new file mode 100644
index 0000000000..eae1a5698d
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -0,0 +1,852 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "util/u_math.h"
+#include "util/u_pack_color.h"
+
+#include "pipe/p_debug.h"
+#include "pipe/internal/p_winsys_screen.h"
+
+#include "r300_context.h"
+#include "r300_reg.h"
+#include "r300_state_shader.h"
+
+/* r300_state: Functions used to intialize state context by translating
+ * Gallium state objects into semi-native r300 state objects.
+ *
+ * XXX break this file up into pieces if it gets too big! */
+
+/* Pack a float into a dword. */
+static uint32_t pack_float_32(float f)
+{
+ union {
+ float f;
+ uint32_t u;
+ } u;
+
+ u.f = f;
+ return u.u;
+}
+
+static uint32_t translate_blend_function(int blend_func) {
+ switch (blend_func) {
+ case PIPE_BLEND_ADD:
+ return R300_COMB_FCN_ADD_CLAMP;
+ case PIPE_BLEND_SUBTRACT:
+ return R300_COMB_FCN_SUB_CLAMP;
+ case PIPE_BLEND_REVERSE_SUBTRACT:
+ return R300_COMB_FCN_RSUB_CLAMP;
+ case PIPE_BLEND_MIN:
+ return R300_COMB_FCN_MIN;
+ case PIPE_BLEND_MAX:
+ return R300_COMB_FCN_MAX;
+ default:
+ debug_printf("r300: Unknown blend function %d\n", blend_func);
+ break;
+ }
+ return 0;
+}
+
+/* XXX we can also offer the D3D versions of some of these... */
+static uint32_t translate_blend_factor(int blend_fact) {
+ switch (blend_fact) {
+ case PIPE_BLENDFACTOR_ONE:
+ return R300_BLEND_GL_ONE;
+ case PIPE_BLENDFACTOR_SRC_COLOR:
+ return R300_BLEND_GL_SRC_COLOR;
+ case PIPE_BLENDFACTOR_SRC_ALPHA:
+ return R300_BLEND_GL_SRC_ALPHA;
+ case PIPE_BLENDFACTOR_DST_ALPHA:
+ return R300_BLEND_GL_DST_ALPHA;
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ return R300_BLEND_GL_DST_COLOR;
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
+ return R300_BLEND_GL_SRC_ALPHA_SATURATE;
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ return R300_BLEND_GL_CONST_COLOR;
+ case PIPE_BLENDFACTOR_CONST_ALPHA:
+ return R300_BLEND_GL_CONST_ALPHA;
+ /* XXX WTF are these?
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_SRC1_ALPHA: */
+ case PIPE_BLENDFACTOR_ZERO:
+ return R300_BLEND_GL_ZERO;
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ return R300_BLEND_GL_ONE_MINUS_SRC_COLOR;
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+ return R300_BLEND_GL_ONE_MINUS_SRC_ALPHA;
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA:
+ return R300_BLEND_GL_ONE_MINUS_DST_ALPHA;
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ return R300_BLEND_GL_ONE_MINUS_DST_COLOR;
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ return R300_BLEND_GL_ONE_MINUS_CONST_COLOR;
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
+ return R300_BLEND_GL_ONE_MINUS_CONST_ALPHA;
+ /* XXX see above
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA: */
+ default:
+ debug_printf("r300: Unknown blend factor %d\n", blend_fact);
+ break;
+ }
+ return 0;
+}
+
+/* Create a new blend state based on the CSO blend state.
+ *
+ * This encompasses alpha blending, logic/raster ops, and blend dithering. */
+static void* r300_create_blend_state(struct pipe_context* pipe,
+ const struct pipe_blend_state* state)
+{
+ struct r300_blend_state* blend = CALLOC_STRUCT(r300_blend_state);
+
+ if (state->blend_enable) {
+ /* XXX for now, always do separate alpha...
+ * is it faster to do it with one reg? */
+ blend->blend_control = R300_ALPHA_BLEND_ENABLE |
+ R300_SEPARATE_ALPHA_ENABLE |
+ R300_READ_ENABLE |
+ translate_blend_function(state->rgb_func) |
+ (translate_blend_factor(state->rgb_src_factor) <<
+ R300_SRC_BLEND_SHIFT) |
+ (translate_blend_factor(state->rgb_dst_factor) <<
+ R300_DST_BLEND_SHIFT);
+ blend->alpha_blend_control =
+ translate_blend_function(state->alpha_func) |
+ (translate_blend_factor(state->alpha_src_factor) <<
+ R300_SRC_BLEND_SHIFT) |
+ (translate_blend_factor(state->alpha_dst_factor) <<
+ R300_DST_BLEND_SHIFT);
+ }
+
+ /* PIPE_LOGICOP_* don't need to be translated, fortunately. */
+ /* XXX are logicops still allowed if blending's disabled?
+ * Does Gallium take care of it for us? */
+ if (state->logicop_enable) {
+ blend->rop = R300_RB3D_ROPCNTL_ROP_ENABLE |
+ (state->logicop_func) << R300_RB3D_ROPCNTL_ROP_SHIFT;
+ }
+
+ if (state->dither) {
+ blend->dither = R300_RB3D_DITHER_CTL_DITHER_MODE_LUT |
+ R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT;
+ }
+
+ return (void*)blend;
+}
+
+/* Bind blend state. */
+static void r300_bind_blend_state(struct pipe_context* pipe,
+ void* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+
+ r300->blend_state = (struct r300_blend_state*)state;
+ r300->dirty_state |= R300_NEW_BLEND;
+}
+
+/* Free blend state. */
+static void r300_delete_blend_state(struct pipe_context* pipe,
+ void* state)
+{
+ FREE(state);
+}
+
+/* Set blend color.
+ * Setup both R300 and R500 registers, figure out later which one to write. */
+static void r300_set_blend_color(struct pipe_context* pipe,
+ const struct pipe_blend_color* color)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ uint32_t r, g, b, a;
+ ubyte ur, ug, ub, ua;
+
+ r = util_iround(color->color[0] * 1023.0f);
+ g = util_iround(color->color[1] * 1023.0f);
+ b = util_iround(color->color[2] * 1023.0f);
+ a = util_iround(color->color[3] * 1023.0f);
+
+ ur = float_to_ubyte(color->color[0]);
+ ug = float_to_ubyte(color->color[1]);
+ ub = float_to_ubyte(color->color[2]);
+ ua = float_to_ubyte(color->color[3]);
+
+ r300->blend_color_state->blend_color = (a << 24) | (r << 16) | (g << 8) | b;
+
+ r300->blend_color_state->blend_color_red_alpha = ur | (ua << 16);
+ r300->blend_color_state->blend_color_green_blue = ub | (ug << 16);
+
+ r300->dirty_state |= R300_NEW_BLEND_COLOR;
+}
+
+static void r300_set_clip_state(struct pipe_context* pipe,
+ const struct pipe_clip_state* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ /* XXX Draw */
+ draw_flush(r300->draw);
+ draw_set_clip_state(r300->draw, state);
+}
+
+static void
+ r300_set_constant_buffer(struct pipe_context* pipe,
+ uint shader, uint index,
+ const struct pipe_constant_buffer* buffer)
+{
+ struct r300_context* r300 = r300_context(pipe);
+
+ /* This entire chunk of code seems ever-so-slightly baked.
+ * It's as if I've got pipe_buffer* matryoshkas... */
+ if (buffer && buffer->buffer && buffer->buffer->size) {
+ void* map = pipe->winsys->buffer_map(pipe->winsys, buffer->buffer,
+ PIPE_BUFFER_USAGE_CPU_READ);
+ memcpy(r300->shader_constants[shader].constants,
+ map, buffer->buffer->size);
+ pipe->winsys->buffer_unmap(pipe->winsys, buffer->buffer);
+
+ r300->shader_constants[shader].user_count =
+ buffer->buffer->size / (sizeof(float) * 4);
+ } else {
+ r300->shader_constants[shader].user_count = 0;
+ }
+
+ r300->dirty_state |= R300_NEW_CONSTANTS;
+}
+
+static uint32_t translate_depth_stencil_function(int zs_func) {
+ switch (zs_func) {
+ case PIPE_FUNC_NEVER:
+ return R300_ZS_NEVER;
+ case PIPE_FUNC_LESS:
+ return R300_ZS_LESS;
+ case PIPE_FUNC_EQUAL:
+ return R300_ZS_EQUAL;
+ case PIPE_FUNC_LEQUAL:
+ return R300_ZS_LEQUAL;
+ case PIPE_FUNC_GREATER:
+ return R300_ZS_GREATER;
+ case PIPE_FUNC_NOTEQUAL:
+ return R300_ZS_NOTEQUAL;
+ case PIPE_FUNC_GEQUAL:
+ return R300_ZS_GEQUAL;
+ case PIPE_FUNC_ALWAYS:
+ return R300_ZS_ALWAYS;
+ default:
+ debug_printf("r300: Unknown depth/stencil function %d\n",
+ zs_func);
+ break;
+ }
+ return 0;
+}
+
+static uint32_t translate_stencil_op(int s_op) {
+ switch (s_op) {
+ case PIPE_STENCIL_OP_KEEP:
+ return R300_ZS_KEEP;
+ case PIPE_STENCIL_OP_ZERO:
+ return R300_ZS_ZERO;
+ case PIPE_STENCIL_OP_REPLACE:
+ return R300_ZS_REPLACE;
+ case PIPE_STENCIL_OP_INCR:
+ return R300_ZS_INCR;
+ case PIPE_STENCIL_OP_DECR:
+ return R300_ZS_DECR;
+ case PIPE_STENCIL_OP_INCR_WRAP:
+ return R300_ZS_INCR_WRAP;
+ case PIPE_STENCIL_OP_DECR_WRAP:
+ return R300_ZS_DECR_WRAP;
+ case PIPE_STENCIL_OP_INVERT:
+ return R300_ZS_INVERT;
+ default:
+ debug_printf("r300: Unknown stencil op %d", s_op);
+ break;
+ }
+ return 0;
+}
+
+static uint32_t translate_alpha_function(int alpha_func) {
+ switch (alpha_func) {
+ case PIPE_FUNC_NEVER:
+ return R300_FG_ALPHA_FUNC_NEVER;
+ case PIPE_FUNC_LESS:
+ return R300_FG_ALPHA_FUNC_LESS;
+ case PIPE_FUNC_EQUAL:
+ return R300_FG_ALPHA_FUNC_EQUAL;
+ case PIPE_FUNC_LEQUAL:
+ return R300_FG_ALPHA_FUNC_LE;
+ case PIPE_FUNC_GREATER:
+ return R300_FG_ALPHA_FUNC_GREATER;
+ case PIPE_FUNC_NOTEQUAL:
+ return R300_FG_ALPHA_FUNC_NOTEQUAL;
+ case PIPE_FUNC_GEQUAL:
+ return R300_FG_ALPHA_FUNC_GE;
+ case PIPE_FUNC_ALWAYS:
+ return R300_FG_ALPHA_FUNC_ALWAYS;
+ default:
+ debug_printf("r300: Unknown alpha function %d", alpha_func);
+ break;
+ }
+ return 0;
+}
+
+/* Create a new depth, stencil, and alpha state based on the CSO dsa state.
+ *
+ * This contains the depth buffer, stencil buffer, alpha test, and such.
+ * On the Radeon, depth and stencil buffer setup are intertwined, which is
+ * the reason for some of the strange-looking assignments across registers. */
+static void*
+ r300_create_dsa_state(struct pipe_context* pipe,
+ const struct pipe_depth_stencil_alpha_state* state)
+{
+ struct r300_dsa_state* dsa = CALLOC_STRUCT(r300_dsa_state);
+
+ /* Depth test setup. */
+ if (state->depth.enabled) {
+ dsa->z_buffer_control |= R300_Z_ENABLE;
+
+ if (state->depth.writemask) {
+ dsa->z_buffer_control |= R300_Z_WRITE_ENABLE;
+ }
+
+ dsa->z_stencil_control |=
+ (translate_depth_stencil_function(state->depth.func) <<
+ R300_Z_FUNC_SHIFT);
+ }
+
+ /* Stencil buffer setup. */
+ if (state->stencil[0].enabled) {
+ dsa->z_buffer_control |= R300_STENCIL_ENABLE;
+ dsa->z_stencil_control |=
+ (translate_depth_stencil_function(state->stencil[0].func) <<
+ R300_S_FRONT_FUNC_SHIFT) |
+ (translate_stencil_op(state->stencil[0].fail_op) <<
+ R300_S_FRONT_SFAIL_OP_SHIFT) |
+ (translate_stencil_op(state->stencil[0].zpass_op) <<
+ R300_S_FRONT_ZPASS_OP_SHIFT) |
+ (translate_stencil_op(state->stencil[0].zfail_op) <<
+ R300_S_FRONT_ZFAIL_OP_SHIFT);
+
+ dsa->stencil_ref_mask = (state->stencil[0].ref_value) |
+ (state->stencil[0].valuemask << R300_STENCILMASK_SHIFT) |
+ (state->stencil[0].writemask << R300_STENCILWRITEMASK_SHIFT);
+
+ if (state->stencil[1].enabled) {
+ dsa->z_buffer_control |= R300_STENCIL_FRONT_BACK;
+ dsa->z_stencil_control |=
+ (translate_depth_stencil_function(state->stencil[1].func) <<
+ R300_S_BACK_FUNC_SHIFT) |
+ (translate_stencil_op(state->stencil[1].fail_op) <<
+ R300_S_BACK_SFAIL_OP_SHIFT) |
+ (translate_stencil_op(state->stencil[1].zpass_op) <<
+ R300_S_BACK_ZPASS_OP_SHIFT) |
+ (translate_stencil_op(state->stencil[1].zfail_op) <<
+ R300_S_BACK_ZFAIL_OP_SHIFT);
+
+ dsa->stencil_ref_bf = (state->stencil[1].ref_value) |
+ (state->stencil[1].valuemask << R300_STENCILMASK_SHIFT) |
+ (state->stencil[1].writemask << R300_STENCILWRITEMASK_SHIFT);
+ }
+ }
+
+ /* Alpha test setup. */
+ if (state->alpha.enabled) {
+ dsa->alpha_function = translate_alpha_function(state->alpha.func) |
+ R300_FG_ALPHA_FUNC_ENABLE;
+ dsa->alpha_reference = CLAMP(state->alpha.ref_value * 1023.0f,
+ 0, 1023);
+ } else {
+ dsa->z_buffer_top = R300_ZTOP_ENABLE;
+ }
+
+ return (void*)dsa;
+}
+
+/* Bind DSA state. */
+static void r300_bind_dsa_state(struct pipe_context* pipe,
+ void* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+
+ r300->dsa_state = (struct r300_dsa_state*)state;
+ r300->dirty_state |= R300_NEW_DSA;
+}
+
+/* Free DSA state. */
+static void r300_delete_dsa_state(struct pipe_context* pipe,
+ void* state)
+{
+ FREE(state);
+}
+
+static void r300_set_edgeflags(struct pipe_context* pipe,
+ const unsigned* bitfield)
+{
+ /* XXX you know it's bad when i915 has this blank too */
+}
+
+static void
+ r300_set_framebuffer_state(struct pipe_context* pipe,
+ const struct pipe_framebuffer_state* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+
+ draw_flush(r300->draw);
+
+ r300->framebuffer_state = *state;
+
+ r300->dirty_state |= R300_NEW_FRAMEBUFFERS;
+}
+
+/* Create fragment shader state. */
+static void* r300_create_fs_state(struct pipe_context* pipe,
+ const struct pipe_shader_state* shader)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ struct r3xx_fragment_shader* fs = NULL;
+
+ if (r300_screen(r300->context.screen)->caps->is_r500) {
+ fs =
+ (struct r3xx_fragment_shader*)CALLOC_STRUCT(r500_fragment_shader);
+ } else {
+ fs =
+ (struct r3xx_fragment_shader*)CALLOC_STRUCT(r300_fragment_shader);
+ }
+
+ /* Copy state directly into shader. */
+ fs->state = *shader;
+
+ return (void*)fs;
+}
+
+/* Bind fragment shader state. */
+static void r300_bind_fs_state(struct pipe_context* pipe, void* shader)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ struct r3xx_fragment_shader* fs = (struct r3xx_fragment_shader*)shader;
+
+ if (fs == NULL) {
+ r300->fs = NULL;
+ return;
+ } else if (!fs->translated) {
+ if (r300_screen(r300->context.screen)->caps->is_r500) {
+ r500_translate_fragment_shader(r300, (struct r500_fragment_shader*)fs);
+ } else {
+ r300_translate_fragment_shader(r300, (struct r300_fragment_shader*)fs);
+ }
+ }
+
+ fs->translated = true;
+ r300->fs = fs;
+
+ r300->dirty_state |= R300_NEW_FRAGMENT_SHADER;
+}
+
+/* Delete fragment shader state. */
+static void r300_delete_fs_state(struct pipe_context* pipe, void* shader)
+{
+ FREE(shader);
+}
+
+static void r300_set_polygon_stipple(struct pipe_context* pipe,
+ const struct pipe_poly_stipple* state)
+{
+ /* XXX */
+}
+
+static INLINE int pack_float_16_6x(float f) {
+ return ((int)(f * 6.0) & 0xffff);
+}
+
+/* Create a new rasterizer state based on the CSO rasterizer state.
+ *
+ * This is a very large chunk of state, and covers most of the graphics
+ * backend (GB), geometry assembly (GA), and setup unit (SU) blocks.
+ *
+ * In a not entirely unironic sidenote, this state has nearly nothing to do
+ * with the actual block on the Radeon called the rasterizer (RS). */
+static void* r300_create_rs_state(struct pipe_context* pipe,
+ const struct pipe_rasterizer_state* state)
+{
+ struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state);
+
+ /* XXX this is part of HW TCL */
+ /* XXX endian control */
+ rs->vap_control_status = R300_VAP_TCL_BYPASS;
+
+ rs->point_size = pack_float_16_6x(state->point_size) |
+ (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT);
+
+ rs->line_control = pack_float_16_6x(state->line_width) |
+ R300_GA_LINE_CNTL_END_TYPE_COMP;
+
+ /* Radeons don't think in "CW/CCW", they think in "front/back". */
+ if (state->front_winding == PIPE_WINDING_CW) {
+ rs->cull_mode = R300_FRONT_FACE_CW;
+
+ if (state->offset_cw) {
+ rs->polygon_offset_enable |= R300_FRONT_ENABLE;
+ }
+ if (state->offset_ccw) {
+ rs->polygon_offset_enable |= R300_BACK_ENABLE;
+ }
+ } else {
+ rs->cull_mode = R300_FRONT_FACE_CCW;
+
+ if (state->offset_ccw) {
+ rs->polygon_offset_enable |= R300_FRONT_ENABLE;
+ }
+ if (state->offset_cw) {
+ rs->polygon_offset_enable |= R300_BACK_ENABLE;
+ }
+ }
+ if (state->front_winding & state->cull_mode) {
+ rs->cull_mode |= R300_CULL_FRONT;
+ }
+ if (~(state->front_winding) & state->cull_mode) {
+ rs->cull_mode |= R300_CULL_BACK;
+ }
+
+ if (rs->polygon_offset_enable) {
+ rs->depth_offset_front = rs->depth_offset_back =
+ pack_float_32(state->offset_units);
+ rs->depth_scale_front = rs->depth_scale_back =
+ pack_float_32(state->offset_scale);
+ }
+
+ if (state->line_stipple_enable) {
+ rs->line_stipple_config =
+ R300_GA_LINE_STIPPLE_CONFIG_LINE_RESET_LINE |
+ (pack_float_32((float)state->line_stipple_factor) &
+ R300_GA_LINE_STIPPLE_CONFIG_STIPPLE_SCALE_MASK);
+ /* XXX this might need to be scaled up */
+ rs->line_stipple_value = state->line_stipple_pattern;
+ }
+
+ rs->rs = *state;
+
+ return (void*)rs;
+}
+
+/* Bind rasterizer state. */
+static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ struct r300_rs_state* rs = (struct r300_rs_state*)state;
+
+ draw_set_rasterizer_state(r300->draw, &rs->rs);
+
+ r300->rs_state = rs;
+ r300->dirty_state |= R300_NEW_RASTERIZER;
+}
+
+/* Free rasterizer state. */
+static void r300_delete_rs_state(struct pipe_context* pipe, void* state)
+{
+ FREE(state);
+}
+
+static uint32_t translate_wrap(int wrap) {
+ switch (wrap) {
+ case PIPE_TEX_WRAP_REPEAT:
+ return R300_TX_REPEAT;
+ case PIPE_TEX_WRAP_CLAMP:
+ return R300_TX_CLAMP;
+ case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
+ return R300_TX_CLAMP_TO_EDGE;
+ case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
+ return R300_TX_CLAMP_TO_BORDER;
+ case PIPE_TEX_WRAP_MIRROR_REPEAT:
+ return R300_TX_REPEAT | R300_TX_MIRRORED;
+ case PIPE_TEX_WRAP_MIRROR_CLAMP:
+ return R300_TX_CLAMP | R300_TX_MIRRORED;
+ case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
+ return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
+ case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
+ return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
+ default:
+ debug_printf("r300: Unknown texture wrap %d", wrap);
+ return 0;
+ }
+}
+
+static uint32_t translate_tex_filters(int min, int mag, int mip) {
+ uint32_t retval = 0;
+ switch (min) {
+ case PIPE_TEX_FILTER_NEAREST:
+ retval |= R300_TX_MIN_FILTER_NEAREST;
+ case PIPE_TEX_FILTER_LINEAR:
+ retval |= R300_TX_MIN_FILTER_LINEAR;
+ case PIPE_TEX_FILTER_ANISO:
+ retval |= R300_TX_MIN_FILTER_ANISO;
+ default:
+ debug_printf("r300: Unknown texture filter %d", min);
+ break;
+ }
+ switch (mag) {
+ case PIPE_TEX_FILTER_NEAREST:
+ retval |= R300_TX_MAG_FILTER_NEAREST;
+ case PIPE_TEX_FILTER_LINEAR:
+ retval |= R300_TX_MAG_FILTER_LINEAR;
+ case PIPE_TEX_FILTER_ANISO:
+ retval |= R300_TX_MAG_FILTER_ANISO;
+ default:
+ debug_printf("r300: Unknown texture filter %d", mag);
+ break;
+ }
+ switch (mip) {
+ case PIPE_TEX_MIPFILTER_NONE:
+ retval |= R300_TX_MIN_FILTER_MIP_NONE;
+ case PIPE_TEX_MIPFILTER_NEAREST:
+ retval |= R300_TX_MIN_FILTER_MIP_NEAREST;
+ case PIPE_TEX_MIPFILTER_LINEAR:
+ retval |= R300_TX_MIN_FILTER_MIP_LINEAR;
+ default:
+ debug_printf("r300: Unknown texture filter %d", mip);
+ break;
+ }
+
+ return retval;
+}
+
+static uint32_t anisotropy(float max_aniso) {
+ if (max_aniso >= 16.0f) {
+ return R300_TX_MAX_ANISO_16_TO_1;
+ } else if (max_aniso >= 8.0f) {
+ return R300_TX_MAX_ANISO_8_TO_1;
+ } else if (max_aniso >= 4.0f) {
+ return R300_TX_MAX_ANISO_4_TO_1;
+ } else if (max_aniso >= 2.0f) {
+ return R300_TX_MAX_ANISO_2_TO_1;
+ } else {
+ return R300_TX_MAX_ANISO_1_TO_1;
+ }
+}
+
+static void*
+ r300_create_sampler_state(struct pipe_context* pipe,
+ const struct pipe_sampler_state* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state);
+ int lod_bias;
+
+ sampler->filter0 |=
+ (translate_wrap(state->wrap_s) << R300_TX_WRAP_S_SHIFT) |
+ (translate_wrap(state->wrap_t) << R300_TX_WRAP_T_SHIFT) |
+ (translate_wrap(state->wrap_r) << R300_TX_WRAP_R_SHIFT);
+
+ sampler->filter0 |= translate_tex_filters(state->min_img_filter,
+ state->mag_img_filter,
+ state->min_mip_filter);
+
+ lod_bias = CLAMP((int)(state->lod_bias * 32), -(1 << 9), (1 << 9) - 1);
+
+ sampler->filter1 |= lod_bias << R300_LOD_BIAS_SHIFT;
+
+ sampler->filter1 |= anisotropy(state->max_anisotropy);
+
+ util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM,
+ &sampler->border_color);
+
+ /* R500-specific fixups and optimizations */
+ if (r300_screen(r300->context.screen)->caps->is_r500) {
+ sampler->filter1 |= R500_BORDER_FIX;
+ }
+
+ return (void*)sampler;
+}
+
+static void r300_bind_sampler_states(struct pipe_context* pipe,
+ unsigned count,
+ void** states)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ int i;
+
+ if (count > 8) {
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (r300->sampler_states[i] != states[i]) {
+ r300->sampler_states[i] = (struct r300_sampler_state*)states[i];
+ r300->dirty_state |= (R300_NEW_SAMPLER << i);
+ }
+ }
+
+ r300->sampler_count = count;
+}
+
+static void r300_delete_sampler_state(struct pipe_context* pipe, void* state)
+{
+ FREE(state);
+}
+
+static void r300_set_sampler_textures(struct pipe_context* pipe,
+ unsigned count,
+ struct pipe_texture** texture)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ int i;
+
+ /* XXX magic num */
+ if (count > 8) {
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (r300->textures[i] != (struct r300_texture*)texture[i]) {
+ pipe_texture_reference((struct pipe_texture**)&r300->textures[i],
+ texture[i]);
+ r300->dirty_state |= (R300_NEW_TEXTURE << i);
+ }
+ }
+
+ for (i = count; i < 8; i++) {
+ if (r300->textures[i]) {
+ pipe_texture_reference((struct pipe_texture**)&r300->textures[i],
+ NULL);
+ r300->dirty_state |= (R300_NEW_TEXTURE << i);
+ }
+ }
+
+ r300->texture_count = count;
+}
+
+static void r300_set_scissor_state(struct pipe_context* pipe,
+ const struct pipe_scissor_state* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ draw_flush(r300->draw);
+
+ r300->scissor_state->scissor_top_left =
+ (state->minx << R300_SCISSORS_X_SHIFT) |
+ (state->miny << R300_SCISSORS_Y_SHIFT);
+ r300->scissor_state->scissor_bottom_right =
+ (state->maxx << R300_SCISSORS_X_SHIFT) |
+ (state->maxy << R300_SCISSORS_Y_SHIFT);
+
+ r300->dirty_state |= R300_NEW_SCISSOR;
+}
+
+static void r300_set_viewport_state(struct pipe_context* pipe,
+ const struct pipe_viewport_state* state)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ /* XXX handing this off to Draw for now */
+ draw_set_viewport_state(r300->draw, state);
+}
+
+static void r300_set_vertex_buffers(struct pipe_context* pipe,
+ unsigned count,
+ const struct pipe_vertex_buffer* buffers)
+{
+ struct r300_context* r300 = r300_context(pipe);
+
+ memcpy(r300->vertex_buffers, buffers,
+ sizeof(struct pipe_vertex_buffer) * count);
+
+ r300->vertex_buffer_count = count;
+
+ draw_flush(r300->draw);
+ draw_set_vertex_buffers(r300->draw, count, buffers);
+}
+
+static void r300_set_vertex_elements(struct pipe_context* pipe,
+ unsigned count,
+ const struct pipe_vertex_element* elements)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ /* XXX Draw */
+ draw_flush(r300->draw);
+ draw_set_vertex_elements(r300->draw, count, elements);
+}
+
+static void* r300_create_vs_state(struct pipe_context* pipe,
+ const struct pipe_shader_state* state)
+{
+ struct r300_context* context = r300_context(pipe);
+ /* XXX handing this off to Draw for now */
+ return draw_create_vertex_shader(context->draw, state);
+}
+
+static void r300_bind_vs_state(struct pipe_context* pipe, void* state) {
+ struct r300_context* context = r300_context(pipe);
+ /* XXX handing this off to Draw for now */
+ draw_bind_vertex_shader(context->draw, (struct draw_vertex_shader*)state);
+}
+
+static void r300_delete_vs_state(struct pipe_context* pipe, void* state)
+{
+ struct r300_context* context = r300_context(pipe);
+ /* XXX handing this off to Draw for now */
+ draw_delete_vertex_shader(context->draw, (struct draw_vertex_shader*)state);
+}
+
+void r300_init_state_functions(struct r300_context* r300)
+{
+ r300->context.create_blend_state = r300_create_blend_state;
+ r300->context.bind_blend_state = r300_bind_blend_state;
+ r300->context.delete_blend_state = r300_delete_blend_state;
+
+ r300->context.set_blend_color = r300_set_blend_color;
+
+ r300->context.set_clip_state = r300_set_clip_state;
+
+ r300->context.set_constant_buffer = r300_set_constant_buffer;
+
+ r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state;
+ r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state;
+ r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state;
+
+ r300->context.set_edgeflags = r300_set_edgeflags;
+
+ r300->context.set_framebuffer_state = r300_set_framebuffer_state;
+
+ r300->context.create_fs_state = r300_create_fs_state;
+ r300->context.bind_fs_state = r300_bind_fs_state;
+ r300->context.delete_fs_state = r300_delete_fs_state;
+
+ r300->context.set_polygon_stipple = r300_set_polygon_stipple;
+
+ r300->context.create_rasterizer_state = r300_create_rs_state;
+ r300->context.bind_rasterizer_state = r300_bind_rs_state;
+ r300->context.delete_rasterizer_state = r300_delete_rs_state;
+
+ r300->context.create_sampler_state = r300_create_sampler_state;
+ r300->context.bind_sampler_states = r300_bind_sampler_states;
+ r300->context.delete_sampler_state = r300_delete_sampler_state;
+
+ r300->context.set_sampler_textures = r300_set_sampler_textures;
+
+ r300->context.set_scissor_state = r300_set_scissor_state;
+
+ r300->context.set_viewport_state = r300_set_viewport_state;
+
+ r300->context.set_vertex_buffers = r300_set_vertex_buffers;
+ r300->context.set_vertex_elements = r300_set_vertex_elements;
+
+ r300->context.create_vs_state = r300_create_vs_state;
+ r300->context.bind_vs_state = r300_bind_vs_state;
+ r300->context.delete_vs_state = r300_delete_vs_state;
+}
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
new file mode 100644
index 0000000000..df19f20fc8
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_state_derived.h"
+
+/* r300_state_derived: Various bits of state which are dependent upon
+ * currently bound CSO data. */
+
+/* Update the vertex_info struct in our r300_context.
+ *
+ * The vertex_info struct describes the post-TCL format of vertices. It is
+ * required for Draw when doing SW TCL, and also for describing the
+ * dreaded RS block on R300 chipsets. */
+/* XXX this function should be able to handle vert shaders as well as draw */
+static void r300_update_vertex_layout(struct r300_context* r300)
+{
+ struct vertex_info vinfo;
+ boolean pos = false, psize = false, fog = false;
+ int i, texs = 0, cols = 0;
+
+ struct tgsi_shader_info* info = &r300->fs->info;
+ memset(&vinfo, 0, sizeof(vinfo));
+
+ /* This is rather lame. Since draw_find_vs_output doesn't return an error
+ * when it can't find an output, we have to pre-iterate and count each
+ * output ourselves. */
+ for (i = 0; i < info->num_inputs; i++) {
+ switch (info->input_semantic_name[i]) {
+ case TGSI_SEMANTIC_POSITION:
+ pos = true;
+ break;
+ case TGSI_SEMANTIC_COLOR:
+ cols++;
+ break;
+ case TGSI_SEMANTIC_FOG:
+ fog = true;
+ break;
+ case TGSI_SEMANTIC_PSIZE:
+ psize = true;
+ break;
+ case TGSI_SEMANTIC_GENERIC:
+ texs++;
+ break;
+ default:
+ debug_printf("r300: Unknown vertex input %d\n",
+ info->input_semantic_name[i]);
+ break;
+ }
+ }
+
+ /* Do the actual vertex_info setup.
+ *
+ * vertex_info has four uints of hardware-specific data in it.
+ * vinfo.hwfmt[0] is VAP_OUT_VTX_FMT_0
+ * vinfo.hwfmt[1] is VAP_OUT_VTX_FMT_1 */
+
+ if (pos) {
+ draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_POS,
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_POSITION, 0));
+ vinfo.hwfmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT;
+ } else {
+ debug_printf("r300: No vertex input for position in SW TCL;\n"
+ " this will probably end poorly.\n");
+ }
+
+ if (psize) {
+ draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_LINEAR,
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_PSIZE, 0));
+ vinfo.hwfmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT;
+ }
+
+ for (i = 0; i < cols; i++) {
+ draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR,
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_COLOR, i));
+ vinfo.hwfmt[0] |= (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i);
+ }
+
+ if (fog) {
+ draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_PERSPECTIVE,
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_FOG, 0));
+ vinfo.hwfmt[0] |=
+ (R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << cols);
+ }
+
+ for (i = 0; i < texs; i++) {
+ draw_emit_vertex_attr(&vinfo, EMIT_4F, INTERP_LINEAR,
+ draw_find_vs_output(r300->draw, TGSI_SEMANTIC_GENERIC, i));
+ vinfo.hwfmt[1] |= (4 << (3 * i));
+ }
+
+ draw_compute_vertex_size(&vinfo);
+
+ if (memcmp(&r300->vertex_info, &vinfo, sizeof(struct vertex_info))) {
+ memcpy(&r300->vertex_info, &vinfo, sizeof(struct vertex_info));
+ r300->dirty_state |= R300_NEW_VERTEX_FORMAT;
+ }
+}
+
+/* Set up the RS block. This is the part of the chipset that actually does
+ * the rasterization of vertices into fragments. This is also the part of the
+ * chipset that locks up if any part of it is even slightly wrong. */
+void r300_update_rs_block(struct r300_context* r300)
+{
+}
+
+void r300_update_derived_state(struct r300_context* r300)
+{
+ if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER) {
+ r300_update_vertex_layout(r300);
+ }
+
+ if (r300->dirty_state & R300_NEW_VERTEX_FORMAT) {
+ r300_update_rs_block(r300);
+ }
+}
diff --git a/src/gallium/drivers/r300/r300_state_derived.h b/src/gallium/drivers/r300/r300_state_derived.h
new file mode 100644
index 0000000000..72ba6b928d
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_state_derived.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_STATE_DERIVED_H
+#define R300_STATE_DERIVED_H
+
+#include "draw/draw_vertex.h"
+
+#include "r300_context.h"
+#include "r300_reg.h"
+
+void r300_update_derived_state(struct r300_context* r300);
+
+#endif /* R300_STATE_DERIVED_H */
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
new file mode 100644
index 0000000000..d10ac55580
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_state_shader.h"
+
+static void r300_copy_passthrough_shader(struct r300_fragment_shader* fs)
+{
+ struct r300_fragment_shader* pt = &r300_passthrough_fragment_shader;
+ fs->shader.stack_size = pt->shader.stack_size;
+ fs->alu_instruction_count = pt->alu_instruction_count;
+ fs->tex_instruction_count = pt->tex_instruction_count;
+ fs->indirections = pt->indirections;
+ fs->instructions[0] = pt->instructions[0];
+}
+
+static void r500_copy_passthrough_shader(struct r500_fragment_shader* fs)
+{
+ struct r500_fragment_shader* pt = &r500_passthrough_fragment_shader;
+ fs->shader.stack_size = pt->shader.stack_size;
+ fs->instruction_count = pt->instruction_count;
+ fs->instructions[0] = pt->instructions[0];
+}
+
+void r300_translate_fragment_shader(struct r300_context* r300,
+ struct r300_fragment_shader* fs)
+{
+ r300_copy_passthrough_shader(fs);
+}
+
+void r500_translate_fragment_shader(struct r300_context* r300,
+ struct r500_fragment_shader* fs)
+{
+ r500_copy_passthrough_shader(fs);
+}
diff --git a/src/gallium/drivers/r300/r300_state_shader.h b/src/gallium/drivers/r300/r300_state_shader.h
new file mode 100644
index 0000000000..1d5d9ee943
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_state_shader.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_STATE_SHADER_H
+#define R300_STATE_SHADER_H
+
+#include "r300_context.h"
+#include "r300_reg.h"
+#include "r300_screen.h"
+
+void r300_translate_fragment_shader(struct r300_context* r300,
+ struct r300_fragment_shader* fs);
+
+void r500_translate_fragment_shader(struct r300_context* r300,
+ struct r500_fragment_shader* fs);
+
+static const struct r300_fragment_shader r300_passthrough_fragment_shader = {
+ /* XXX This is the emission code. TODO: decode
+ OUT_CS_REG(R300_US_CONFIG, 0);
+ OUT_CS_REG(R300_US_CODE_OFFSET, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_0, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_1, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_2, 0x0);
+ OUT_CS_REG(R300_US_CODE_ADDR_3, 0x400000);
+*/
+ .alu_instruction_count = 1,
+ .tex_instruction_count = 0,
+ .indirections = 1,
+ .shader.stack_size = 2,
+
+ /* XXX decode these */
+ .instructions[0].alu_rgb_inst = 0x50A80,
+ .instructions[0].alu_rgb_inst = 0x1C000000,
+ .instructions[0].alu_alpha_inst = 0x40889,
+ .instructions[0].alu_alpha_inst = 0x1000000,
+};
+
+static const struct r500_fragment_shader r500_passthrough_fragment_shader = {
+ .shader.stack_size = 0,
+ .instruction_count = 1,
+ .instructions[0].inst0 = R500_INST_TYPE_OUT |
+ R500_INST_TEX_SEM_WAIT | R500_INST_LAST |
+ R500_INST_RGB_OMASK_RGB | R500_INST_ALPHA_OMASK |
+ R500_INST_RGB_CLAMP | R500_INST_ALPHA_CLAMP,
+ .instructions[0].inst1 =
+ R500_RGB_ADDR0(0) | R500_RGB_ADDR1(0) | R500_RGB_ADDR1_CONST |
+ R500_RGB_ADDR2(0) | R500_RGB_ADDR2_CONST,
+ .instructions[0].inst2 =
+ R500_ALPHA_ADDR0(0) | R500_ALPHA_ADDR1(0) | R500_ALPHA_ADDR1_CONST |
+ R500_ALPHA_ADDR2(0) | R500_ALPHA_ADDR2_CONST,
+ .instructions[0].inst3 =
+ R500_ALU_RGB_SEL_A_SRC0 | R500_ALU_RGB_R_SWIZ_A_R |
+ R500_ALU_RGB_G_SWIZ_A_G | R500_ALU_RGB_B_SWIZ_A_B |
+ R500_ALU_RGB_SEL_B_SRC0 | R500_ALU_RGB_R_SWIZ_B_R |
+ R500_ALU_RGB_B_SWIZ_B_G | R500_ALU_RGB_G_SWIZ_B_B,
+ .instructions[0].inst4 =
+ R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | R500_ALPHA_SWIZ_B_A,
+ .instructions[0].inst5 =
+ R500_ALU_RGBA_OP_CMP | R500_ALU_RGBA_R_SWIZ_0 |
+ R500_ALU_RGBA_G_SWIZ_0 | R500_ALU_RGBA_B_SWIZ_0 |
+ R500_ALU_RGBA_A_SWIZ_0,
+};
+
+#endif /* R300_STATE_SHADER_H */
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
new file mode 100644
index 0000000000..b2c4f4251d
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -0,0 +1,327 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ * Joakim Sindholt <opensource@zhasha.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_surface.h"
+
+/* Provides pipe_context's "surface_fill". Commonly used for clearing
+ * buffers. */
+static void r300_surface_fill(struct pipe_context* pipe,
+ struct pipe_surface* dest,
+ unsigned x, unsigned y,
+ unsigned w, unsigned h,
+ unsigned color)
+{
+ struct r300_context* r300 = r300_context(pipe);
+ CS_LOCALS(r300);
+ struct r300_capabilities* caps = ((struct r300_screen*)pipe->screen)->caps;
+ struct r300_texture* tex = (struct r300_texture*)dest->texture;
+ int i;
+ float r, g, b, a;
+ r = (float)((color >> 16) & 0xff) / 255.0f;
+ g = (float)((color >> 8) & 0xff) / 255.0f;
+ b = (float)((color >> 0) & 0xff) / 255.0f;
+ debug_printf("r300: Filling surface %p at (%d,%d),"
+ " dimensions %dx%d (stride %d), color 0x%x\n",
+ dest, x, y, w, h, dest->stride, color);
+
+ /* Fallback? */
+ if (0) {
+ debug_printf("r300: Falling back on surface clear...");
+ void* map = pipe->screen->surface_map(pipe->screen, dest,
+ PIPE_BUFFER_USAGE_CPU_WRITE);
+ pipe_fill_rect(map, &dest->block, &dest->stride, x, y, w, h, color);
+ pipe->screen->surface_unmap(pipe->screen, dest);
+ return;
+ }
+
+ BEGIN_CS(163 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2));
+ /* Flush PVS. */
+ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
+
+ OUT_CS_REG(R300_SE_VTE_CNTL, R300_VPORT_X_SCALE_ENA |
+ R300_VPORT_X_OFFSET_ENA | R300_VPORT_Y_SCALE_ENA |
+ R300_VPORT_Y_OFFSET_ENA | R300_VPORT_Z_SCALE_ENA |
+ R300_VPORT_Z_OFFSET_ENA | R300_VTX_W0_FMT);
+ /* Vertex size. */
+ OUT_CS_REG(R300_VAP_VTX_SIZE, 0x8);
+ /* Max and min vertex index clamp. */
+ OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, 0xFFFFFF);
+ OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0);
+ /* XXX endian */
+ OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP);
+ OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0);
+ /* XXX magic number not in r300_reg */
+ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA);
+ OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0);
+ OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ /* XXX is this too long? */
+ OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xFFFF);
+ OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE |
+ R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE);
+ /* XXX more magic numbers */
+ OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
+ OUT_CS_REG(R300_GB_MSPOS1, 0x66666666);
+ /* XXX why doesn't classic Mesa write the number of pipes, too? */
+ OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE |
+ R300_GB_TILE_SIZE_16);
+ OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W);
+ OUT_CS_REG(R300_GB_AA_CONFIG, 0x0);
+ /* XXX point tex stuffing */
+ OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1);
+ OUT_CS_32F(0.0);
+ OUT_CS_REG_SEQ(R300_GA_POINT_S1, 1);
+ OUT_CS_32F(1.0);
+ OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 |
+ (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT));
+ /* XXX should this be related to the actual point size? */
+ OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 |
+ (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT));
+ /* XXX this big chunk should be refactored into rs_state */
+ OUT_CS_REG(R300_GA_LINE_CNTL, 0x00030006);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, 0x3BAAAAAB);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, 0x00000000);
+ OUT_CS_REG(R300_GA_LINE_S0, 0x00000000);
+ OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000);
+ OUT_CS_REG(R300_GA_ENHANCE, 0x00000002);
+ OUT_CS_REG(R300_GA_COLOR_CONTROL, 0x0003AAAA);
+ OUT_CS_REG(R300_GA_SOLID_RG, 0x00000000);
+ OUT_CS_REG(R300_GA_SOLID_BA, 0x00000000);
+ OUT_CS_REG(R300_GA_POLY_MODE, 0x00000000);
+ OUT_CS_REG(R300_GA_ROUND_MODE, 0x00000001);
+ OUT_CS_REG(R300_GA_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_GA_FOG_SCALE, 0x3DBF1412);
+ OUT_CS_REG(R300_GA_FOG_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_SU_TEX_WRAP, 0x00000000);
+ OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, 0x00000000);
+ OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, 0x00000000);
+ OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, 0x00000000);
+ OUT_CS_REG(R300_SU_CULL_MODE, 0x00000000);
+ OUT_CS_REG(R300_SU_DEPTH_SCALE, 0x4B7FFFFF);
+ OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C);
+ OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525);
+ OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000002);
+ OUT_CS_REG(R300_FG_FOG_COLOR_R, 0x00000000);
+ OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000);
+ OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000);
+ OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000);
+ OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000);
+ OUT_CS_REG(R300_RB3D_CCTL, 0x00000000);
+ OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F);
+
+ /* XXX: Oh the wonderful unknown.
+ * Not writing these 8 regs seems to make no difference at all and seeing
+ * as how they're not documented, we should leave them out for now.
+ OUT_CS_REG_SEQ(0x4E54, 8);
+ for (i = 0; i < 8; i++) {
+ OUT_CS(0x00000000);
+ } */
+ OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000);
+ OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000);
+ OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF);
+ OUT_CS_REG(R300_ZB_FORMAT, 0x00000002);
+ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003);
+ OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000);
+ OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000);
+ /* XXX Moar unknown that should probably be left out.
+ OUT_CS_REG(0x4F30, 0x00000000);
+ OUT_CS_REG(0x4F34, 0x00000000); */
+ OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000);
+ OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000);
+ if (caps->has_tcl) {
+ OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0,
+ (R300_DATA_TYPE_FLOAT_4 << R300_DATA_TYPE_0_SHIFT) |
+ ((R300_LAST_VEC | (1 << R300_DST_VEC_LOC_SHIFT) |
+ R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT));
+ } else {
+ OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0,
+ (R300_DATA_TYPE_FLOAT_4 << R300_DATA_TYPE_0_SHIFT) |
+ ((R300_LAST_VEC | (2 << R300_DST_VEC_LOC_SHIFT) |
+ R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT));
+ }
+ OUT_CS_REG(R300_FG_FOG_BLEND, 0x00000000);
+ OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_EXT_0, 0xF688F688);
+ OUT_CS_REG(R300_VAP_VTX_STATE_CNTL, 0x1);
+ OUT_CS_REG(R300_VAP_VSM_VTX_ASSM, 0x405);
+ OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F);
+ OUT_CS_REG(R300_VAP_VTX_SIZE, 0x00000008);
+ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA);
+ OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_0, 0x00000003);
+ OUT_CS_REG(R300_VAP_OUTPUT_VTX_FMT_1, 0x00000000);
+ OUT_CS_REG(R300_TX_ENABLE, 0x0);
+ /* XXX viewport setup */
+ OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F((float)x);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F((float)y);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(0.0);
+
+ if (caps->has_tcl) {
+ OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE |
+ R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
+ }
+
+ /* The size of the point we're about to draw, in sixths of pixels */
+ OUT_CS_REG(R300_GA_POINT_SIZE,
+ ((h * 6) & R300_POINTSIZE_Y_MASK) |
+ ((w * 6) << R300_POINTSIZE_X_SHIFT));
+
+ /* XXX */
+ OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa);
+
+ /* Pixel scissors */
+ OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
+ OUT_CS((x << R300_SCISSORS_X_SHIFT) | (y << R300_SCISSORS_Y_SHIFT));
+ OUT_CS((w << R300_SCISSORS_X_SHIFT) | (h << R300_SCISSORS_Y_SHIFT));
+
+ /* RS block setup */
+ if (caps->is_r500) {
+ /* XXX We seem to be in disagreement about how many of these we have
+ * RS:RS_IP_[0-15] [R/W] 32 bits Access: 8/16/32 MMReg:0x4074-0x40b0
+ * Now that's from the docs. I don't care what the mesa driver says */
+ OUT_CS_REG_SEQ(R500_RS_IP_0, 16);
+ for (i = 0; i < 16; i++) {
+ OUT_CS((R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_S_SHIFT) |
+ (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_T_SHIFT) |
+ (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) |
+ (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT));
+ }
+ OUT_CS_REG_SEQ(R300_RS_COUNT, 2);
+ OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN);
+ OUT_CS(0x00000000);
+ OUT_CS_REG(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE);
+ } else {
+ OUT_CS_REG_SEQ(R300_RS_IP_0, 8);
+ for (i = 0; i < 8; i++) {
+ OUT_CS(R300_RS_SEL_T(R300_RS_SEL_K0) |
+ R300_RS_SEL_R(R300_RS_SEL_K0) | R300_RS_SEL_Q(R300_RS_SEL_K1));
+ }
+ OUT_CS_REG_SEQ(R300_RS_COUNT, 2);
+ OUT_CS((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN);
+ /* XXX Shouldn't this be 0? */
+ OUT_CS(1);
+ OUT_CS_REG(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE);
+ }
+ END_CS;
+
+ /* Fragment shader setup */
+ if (caps->is_r500) {
+ r500_emit_fragment_shader(r300, &r500_passthrough_fragment_shader);
+ } else {
+ r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader);
+ }
+
+ BEGIN_CS(8 + (caps->has_tcl ? 20 : 2));
+ OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4);
+ OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A);
+ OUT_CS(R300_US_OUT_FMT_UNUSED);
+ OUT_CS(R300_US_OUT_FMT_UNUSED);
+ OUT_CS(R300_US_OUT_FMT_UNUSED);
+ OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0);
+ /* XXX these magic numbers should be explained when
+ * this becomes a cached state object */
+ if (caps->has_tcl) {
+ OUT_CS_REG(R300_VAP_CNTL, 0xA |
+ (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) |
+ (0xB << R300_VF_MAX_VTX_NUM_SHIFT) |
+ (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT));
+ OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_0, 0x00100000);
+ OUT_CS_REG(R300_VAP_PVS_CONST_CNTL, 0x00000000);
+ OUT_CS_REG(R300_VAP_PVS_CODE_CNTL_1, 0x00000001);
+ /* XXX translate these back into normal instructions */
+ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x1);
+ OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0x0);
+ OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, 8);
+ OUT_CS(0x00F00203);
+ OUT_CS(0x00D10001);
+ OUT_CS(0x01248001);
+ OUT_CS(0x00000000);
+ OUT_CS(0x00F02203);
+ OUT_CS(0x00D10021);
+ OUT_CS(0x01248021);
+ OUT_CS(0x00000000);
+ } else {
+ OUT_CS_REG(R300_VAP_CNTL, 0xA |
+ (0x5 << R300_PVS_NUM_CNTLRS_SHIFT) |
+ (0x5 << R300_VF_MAX_VTX_NUM_SHIFT) |
+ (caps->num_vert_fpus << R300_PVS_NUM_FPUS_SHIFT));
+ }
+ END_CS;
+
+ r300_emit_blend_state(r300, &blend_clear_state);
+ r300_emit_blend_color_state(r300, &blend_color_clear_state);
+ r300_emit_dsa_state(r300, &dsa_clear_state);
+
+ BEGIN_CS(24);
+ /* Flush colorbuffer and blend caches. */
+ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT,
+ R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D |
+ R300_RB3D_DSTCACHE_CTLSTAT_DC_FINISH_SIGNAL);
+ OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE |
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE);
+
+ OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1);
+ OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ /* XXX (dest->stride >> 2) should be the buffer width in pixels however,
+ * this little calculation is only good as long as the buffer is 32bpp */
+ OUT_CS_REG(R300_RB3D_COLORPITCH0, (dest->stride >> 2) |
+ R300_COLOR_FORMAT_ARGB8888);
+ OUT_CS_REG(RB3D_COLOR_CHANNEL_MASK, 0x0000000F);
+ /* XXX Packet3 */
+ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8));
+ OUT_CS(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING |
+ (1 << R300_PRIM_NUM_VERTICES_SHIFT));
+ OUT_CS_32F(w / 2.0);
+ OUT_CS_32F(h / 2.0);
+ /* XXX this should be the depth value to clear to */
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(r);
+ OUT_CS_32F(g);
+ OUT_CS_32F(b);
+ OUT_CS_32F(1.0);
+
+ /* XXX figure out why this is 0xA and not 0x2 */
+ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA);
+ /* XXX OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE |
+ R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); */
+
+ END_CS;
+
+ r300->dirty_hw++;
+}
+
+void r300_init_surface_functions(struct r300_context* r300)
+{
+ r300->context.surface_fill = r300_surface_fill;
+}
diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h
new file mode 100644
index 0000000000..17d6c62fe8
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_surface.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_SURFACE_H
+#define R300_SURFACE_H
+
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+
+#include "util/u_rect.h"
+
+#include "r300_context.h"
+#include "r300_cs.h"
+#include "r300_emit.h"
+#include "r300_state_shader.h"
+
+const struct r300_blend_state blend_clear_state = {
+ .blend_control = 0x0,
+ .alpha_blend_control = 0x0,
+ .rop = 0x0,
+ .dither = 0x0,
+};
+
+const struct r300_blend_color_state blend_color_clear_state = {
+ .blend_color = 0x0,
+ .blend_color_red_alpha = 0x0,
+ .blend_color_green_blue = 0x0,
+};
+
+const struct r300_dsa_state dsa_clear_state = {
+ .alpha_function = 0x0,
+ .alpha_reference = 0x0,
+ .z_buffer_control = 0x0,
+ .z_stencil_control = 0x0,
+ .stencil_ref_mask = R300_STENCILWRITEMASK_MASK,
+ .z_buffer_top = R300_ZTOP_ENABLE,
+ .stencil_ref_bf = 0x0,
+};
+
+#endif /* R300_SURFACE_H */
diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c
new file mode 100644
index 0000000000..76ef48962b
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_swtcl_emit.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "draw/draw_pipe.h"
+#include "util/u_memory.h"
+
+#include "r300_cs.h"
+#include "r300_context.h"
+#include "r300_reg.h"
+
+/* r300_swtcl_emit: Primitive vertex emission using an immediate
+ * vertex buffer and no HW TCL. */
+
+struct swtcl_stage {
+ /* Parent class */
+ struct draw_stage draw;
+
+ struct r300_context* r300;
+};
+
+static INLINE struct swtcl_stage* swtcl_stage(struct draw_stage* draw) {
+ return (struct swtcl_stage*)draw;
+}
+
+static INLINE void r300_emit_vertex(struct r300_context* r300,
+ const struct vertex_header* vertex)
+{
+ struct vertex_info* vinfo = &r300->vertex_info;
+ CS_LOCALS(r300);
+ uint i, j;
+
+ for (i = 0; i < vinfo->num_attribs; i++) {
+ j = vinfo->attrib[i].src_index;
+ switch (vinfo->attrib[i].emit) {
+ case EMIT_1F:
+ OUT_CS_32F(vertex->data[j][0]);
+ break;
+ case EMIT_2F:
+ OUT_CS_32F(vertex->data[j][0]);
+ OUT_CS_32F(vertex->data[j][1]);
+ break;
+ case EMIT_3F:
+ OUT_CS_32F(vertex->data[j][0]);
+ OUT_CS_32F(vertex->data[j][1]);
+ OUT_CS_32F(vertex->data[j][2]);
+ break;
+ case EMIT_4F:
+ OUT_CS_32F(vertex->data[j][0]);
+ OUT_CS_32F(vertex->data[j][1]);
+ OUT_CS_32F(vertex->data[j][2]);
+ OUT_CS_32F(vertex->data[j][3]);
+ break;
+ default:
+ debug_printf("r300: Unknown emit value %d\n",
+ vinfo->attrib[i].emit);
+ break;
+ }
+ }
+}
+
+static INLINE void r300_emit_prim(struct draw_stage* draw,
+ struct prim_header* prim,
+ unsigned hwprim,
+ unsigned count)
+{
+ struct r300_context* r300 = swtcl_stage(draw)->r300;
+ CS_LOCALS(r300);
+ int i;
+
+ r300_emit_dirty_state(r300);
+
+ BEGIN_CS(3);
+ OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2);
+ OUT_CS(r300->vertex_info.hwfmt[0]);
+ OUT_CS(r300->vertex_info.hwfmt[1]);
+ END_CS;
+
+ BEGIN_CS(2 + (count * r300->vertex_info.size) + 2);
+ OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, count));
+ OUT_CS(hwprim | R300_PRIM_WALK_RING |
+ (count << R300_PRIM_NUM_VERTICES_SHIFT));
+
+ for (i = 0; i < count; i++) {
+ r300_emit_vertex(r300, prim->v[i]);
+ }
+
+ END_CS;
+}
+
+/* Just as an aside...
+ *
+ * Radeons can do many more primitives:
+ * - Line strip
+ * - Triangle fan
+ * - Triangle strip
+ * - Line loop
+ * - Quads
+ * - Quad strip
+ * - Polygons
+ *
+ * The following were just the only ones in Draw. */
+
+static void r300_emit_point(struct draw_stage* draw, struct prim_header* prim)
+{
+ r300_emit_prim(draw, prim, R300_PRIM_TYPE_POINT, 1);
+}
+
+static void r300_emit_line(struct draw_stage* draw, struct prim_header* prim)
+{
+ r300_emit_prim(draw, prim, R300_PRIM_TYPE_LINE, 2);
+}
+
+static void r300_emit_tri(struct draw_stage* draw, struct prim_header* prim)
+{
+ r300_emit_prim(draw, prim, R300_PRIM_TYPE_TRI_LIST, 3);
+}
+
+static void r300_swtcl_flush(struct draw_stage* draw, unsigned flags)
+{
+}
+
+static void r300_reset_stipple(struct draw_stage* draw)
+{
+ /* XXX */
+}
+
+static void r300_swtcl_destroy(struct draw_stage* draw)
+{
+ FREE(draw);
+}
+
+struct draw_stage* r300_draw_swtcl_stage(struct r300_context* r300)
+{
+ struct swtcl_stage* swtcl = CALLOC_STRUCT(swtcl_stage);
+
+ swtcl->r300 = r300;
+ swtcl->draw.point = r300_emit_point;
+ swtcl->draw.line = r300_emit_line;
+ swtcl->draw.tri = r300_emit_tri;
+ swtcl->draw.flush = r300_swtcl_flush;
+ swtcl->draw.reset_stipple_counter = r300_reset_stipple;
+ swtcl->draw.destroy = r300_swtcl_destroy;
+
+ return &swtcl->draw;
+}
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
new file mode 100644
index 0000000000..bd35e089f9
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "r300_texture.h"
+
+static int minify(int i)
+{
+ return MAX2(1, i >> 1);
+}
+
+static void r300_setup_miptree(struct r300_texture* tex)
+{
+ struct pipe_texture* base = &tex->tex;
+ int stride, size, offset;
+
+ for (int i = 0; i <= base->last_level; i++) {
+ if (i > 0) {
+ base->width[i] = minify(base->width[i-1]);
+ base->height[i] = minify(base->height[i-1]);
+ base->depth[i] = minify(base->depth[i-1]);
+ }
+
+ base->nblocksx[i] = pf_get_nblocksx(&base->block, base->width[i]);
+ base->nblocksy[i] = pf_get_nblocksy(&base->block, base->width[i]);
+
+ /* Radeons enjoy things in multiples of 32. */
+ /* XXX NPOT -> 64, not 32 */
+ stride = (base->nblocksx[i] * base->block.size + 63) & ~63;
+ size = stride * base->nblocksy[i] * base->depth[i];
+
+ /* XXX 64 for NPOT */
+ tex->offset[i] = (tex->size + 63) & ~63;
+ tex->size = tex->offset[i] + size;
+ }
+}
+
+/* Create a new texture. */
+static struct pipe_texture*
+ r300_texture_create(struct pipe_screen* screen,
+ const struct pipe_texture* template)
+{
+ /* XXX struct r300_screen* r300screen = r300_screen(screen); */
+
+ struct r300_texture* tex = CALLOC_STRUCT(r300_texture);
+
+ if (!tex) {
+ return NULL;
+ }
+
+ tex->tex = *template;
+ tex->tex.refcount = 1;
+ tex->tex.screen = screen;
+
+ r300_setup_miptree(tex);
+
+ tex->buffer = screen->buffer_create(screen, 64,
+ PIPE_BUFFER_USAGE_PIXEL,
+ tex->size);
+
+ if (!tex->buffer) {
+ FREE(tex);
+ return NULL;
+ }
+
+ return (struct pipe_texture*)tex;
+}
+
+static void r300_texture_release(struct pipe_screen* screen,
+ struct pipe_texture** texture)
+{
+ if (!*texture) {
+ return;
+ }
+
+ (*texture)->refcount--;
+
+ if ((*texture)->refcount <= 0) {
+ struct r300_texture* tex = (struct r300_texture*)*texture;
+
+ pipe_buffer_reference(screen, &tex->buffer, NULL);
+
+ FREE(tex);
+ }
+
+ *texture = NULL;
+}
+
+static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
+ struct pipe_texture* texture,
+ unsigned face,
+ unsigned level,
+ unsigned zslice,
+ unsigned flags)
+{
+ struct r300_texture* tex = (struct r300_texture*)texture;
+ struct pipe_surface* surface = CALLOC_STRUCT(pipe_surface);
+ unsigned offset;
+
+ /* XXX this is certainly dependent on tex target */
+ offset = tex->offset[level];
+
+ if (surface) {
+ surface->refcount = 1;
+ pipe_texture_reference(&surface->texture, texture);
+ surface->format = texture->format;
+ surface->width = texture->width[level];
+ surface->height = texture->height[level];
+ surface->block = texture->block;
+ surface->nblocksx = texture->nblocksx[level];
+ surface->nblocksy = texture->nblocksy[level];
+ /* XXX save the actual stride instead plz kthnxbai */
+ surface->stride =
+ (texture->nblocksx[level] * texture->block.size + 63) & ~63;
+ surface->offset = offset;
+ surface->usage = flags;
+ surface->status = PIPE_SURFACE_STATUS_DEFINED;
+ }
+
+ return surface;
+}
+
+static void r300_tex_surface_release(struct pipe_screen* screen,
+ struct pipe_surface** surface)
+{
+ struct pipe_surface* s = *surface;
+
+ s->refcount--;
+
+ if (s->refcount <= 0) {
+ pipe_texture_reference(&s->texture, NULL);
+ FREE(s);
+ }
+
+ *surface = NULL;
+}
+
+static struct pipe_texture*
+ r300_texture_blanket(struct pipe_screen* screen,
+ const struct pipe_texture* base,
+ const unsigned* stride,
+ struct pipe_buffer* buffer)
+{
+ struct r300_texture* tex;
+
+ if (base->target != PIPE_TEXTURE_2D ||
+ base->last_level != 0 ||
+ base->depth[0] != 1) {
+ return NULL;
+ }
+
+ tex = CALLOC_STRUCT(r300_texture);
+ if (!tex) {
+ return NULL;
+ }
+
+ tex->tex = *base;
+ tex->tex.refcount = 1;
+ tex->tex.screen = screen;
+
+ /* XXX tex->stride = *stride; */
+
+ pipe_buffer_reference(screen, &tex->buffer, buffer);
+
+ return (struct pipe_texture*)tex;
+}
+
+void r300_init_screen_texture_functions(struct pipe_screen* screen)
+{
+ screen->texture_create = r300_texture_create;
+ screen->texture_release = r300_texture_release;
+ screen->get_tex_surface = r300_get_tex_surface;
+ screen->tex_surface_release = r300_tex_surface_release;
+ screen->texture_blanket = r300_texture_blanket;
+}
diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h
new file mode 100644
index 0000000000..7964229a94
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_texture.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_TEXTURE_H
+#define R300_TEXTURE_H
+
+#include "pipe/p_screen.h"
+
+#include "util/u_math.h"
+
+#include "r300_context.h"
+
+void r300_init_screen_texture_functions(struct pipe_screen* screen);
+
+#endif /* R300_TEXTURE_H */
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
new file mode 100644
index 0000000000..5a3a212892
--- /dev/null
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef R300_WINSYS_H
+#define R300_WINSYS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The public interface header for the r300 pipe driver.
+ * Any winsys hosting this pipe needs to implement r300_winsys and then
+ * call r300_create_context to start things. */
+
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+
+struct radeon_cs;
+
+struct r300_winsys {
+
+ /* PCI ID */
+ uint32_t pci_id;
+
+ /* GB pipe count */
+ uint32_t gb_pipes;
+
+ /* CS object. This is very much like Intel's batchbuffer.
+ * Fill it full of dwords and relocs and then submit.
+ * Repeat as needed. */
+ /* Note: Unlike Mesa's version of this, we don't keep a copy of the CSM
+ * that was used to create this CS. Is this a good idea? */
+ /* Note: The pipe driver doesn't know how to use this. This is purely
+ * for the winsys. */
+ struct radeon_cs* cs;
+
+ /* Check to see if there's room for commands. */
+ boolean (*check_cs)(struct radeon_cs* cs, int size);
+
+ /* Start a command emit. */
+ void (*begin_cs)(struct radeon_cs* cs,
+ int size,
+ const char* file,
+ const char* function,
+ int line);
+
+ /* Write a dword to the command buffer. */
+ void (*write_cs_dword)(struct radeon_cs* cs, uint32_t dword);
+
+ /* Write a relocated dword to the command buffer. */
+ void (*write_cs_reloc)(struct radeon_cs* cs,
+ struct pipe_buffer* bo,
+ uint32_t rd,
+ uint32_t wd,
+ uint32_t flags);
+
+ /* Finish a command emit. */
+ void (*end_cs)(struct radeon_cs* cs,
+ const char* file,
+ const char* function,
+ int line);
+
+ /* Flush the CS. */
+ void (*flush_cs)(struct radeon_cs* cs);
+};
+
+struct pipe_context* r300_create_context(struct pipe_screen* screen,
+ struct pipe_winsys* winsys,
+ struct r300_winsys* r300_winsys);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R300_WINSYS_H */
diff --git a/src/gallium/drivers/softpipe/Makefile b/src/gallium/drivers/softpipe/Makefile
index 120bdfd9dd..f186f6df1d 100644
--- a/src/gallium/drivers/softpipe/Makefile
+++ b/src/gallium/drivers/softpipe/Makefile
@@ -14,7 +14,7 @@ C_SOURCES = \
sp_draw_arrays.c \
sp_prim_setup.c \
sp_prim_vbuf.c \
- sp_quad.c \
+ sp_quad_pipe.c \
sp_quad_alpha_test.c \
sp_quad_blend.c \
sp_quad_colormask.c \
diff --git a/src/gallium/drivers/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript
index c1f7daa8ab..f8720638a7 100644
--- a/src/gallium/drivers/softpipe/SConscript
+++ b/src/gallium/drivers/softpipe/SConscript
@@ -17,7 +17,7 @@ softpipe = env.ConvenienceLibrary(
'sp_setup.c',
'sp_quad_alpha_test.c',
'sp_quad_blend.c',
- 'sp_quad.c',
+ 'sp_quad_pipe.c',
'sp_quad_colormask.c',
'sp_quad_coverage.c',
'sp_quad_depth_test.c',
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index e2451c6ecb..59d6df8f2d 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -32,11 +32,10 @@
#define SP_CONTEXT_H
#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
#include "draw/draw_vertex.h"
-#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#include "sp_tex_sample.h"
@@ -51,7 +50,6 @@
*/
#define SP_NUM_QUAD_THREADS 1
-struct softpipe_winsys;
struct softpipe_vbuf_render;
struct draw_context;
struct draw_stage;
@@ -63,15 +61,15 @@ struct sp_vertex_shader;
struct softpipe_context {
struct pipe_context pipe; /**< base class */
- /* The most recent drawing state as set by the driver:
- */
- const struct pipe_blend_state *blend;
+ /** Constant state objects */
+ const struct pipe_blend_state *blend;
const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS];
- const struct pipe_depth_stencil_alpha_state *depth_stencil;
+ const struct pipe_depth_stencil_alpha_state *depth_stencil;
const struct pipe_rasterizer_state *rasterizer;
const struct sp_fragment_shader *fs;
const struct sp_vertex_shader *vs;
+ /** Other rendering state */
struct pipe_blend_color blend_color;
struct pipe_clip_state clip;
struct pipe_constant_buffer constants[PIPE_SHADER_TYPES];
@@ -82,23 +80,20 @@ struct softpipe_context {
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
- unsigned dirty;
unsigned num_samplers;
unsigned num_textures;
unsigned num_vertex_elements;
unsigned num_vertex_buffers;
- boolean no_rast;
+ unsigned dirty; /**< Mask of SP_NEW_x flags */
/* Counter for occlusion queries. Note this supports overlapping
* queries.
*/
uint64_t occlusion_count;
- /*
- * Mapped vertex buffers
- */
+ /** Mapped vertex buffers */
ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
/** Mapped constant buffers */
@@ -108,16 +103,11 @@ struct softpipe_context {
struct vertex_info vertex_info;
struct vertex_info vertex_info_vbuf;
+ /** Which vertex shader output slot contains point size */
int psize_slot;
unsigned reduced_api_prim; /**< PIPE_PRIM_POINTS, _LINES or _TRIANGLES */
-#if 0
- /* Stipple derived state:
- */
- ubyte stipple_masks[16][16];
-#endif
-
/** Derived from scissor and surface bounds: */
struct pipe_scissor_state cliprect;
@@ -159,8 +149,9 @@ struct softpipe_context {
struct softpipe_tile_cache *tex_cache[PIPE_MAX_SAMPLERS];
- int use_sse : 1;
- int dump_fs : 1;
+ unsigned use_sse : 1;
+ unsigned dump_fs : 1;
+ unsigned no_rast : 1;
};
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index f888e815b7..f117096bf7 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -47,16 +47,22 @@ static void
softpipe_map_constant_buffers(struct softpipe_context *sp)
{
struct pipe_winsys *ws = sp->pipe.winsys;
- uint i;
+ uint i, size;
+
for (i = 0; i < PIPE_SHADER_TYPES; i++) {
if (sp->constants[i].buffer && sp->constants[i].buffer->size)
sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
}
+ if (sp->constants[PIPE_SHADER_VERTEX].buffer)
+ size = sp->constants[PIPE_SHADER_VERTEX].buffer->size;
+ else
+ size = 0;
+
draw_set_mapped_constant_buffer(sp->draw,
sp->mapped_constants[PIPE_SHADER_VERTEX],
- sp->constants[PIPE_SHADER_VERTEX].buffer->size);
+ size);
}
static void
diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c
index 453b0373f0..3c7ba565d6 100644
--- a/src/gallium/drivers/softpipe/sp_fs_exec.c
+++ b/src/gallium/drivers/softpipe/sp_fs_exec.c
@@ -29,7 +29,7 @@
#include "sp_context.h"
#include "sp_state.h"
#include "sp_fs.h"
-#include "sp_headers.h"
+#include "sp_quad.h"
#include "pipe/p_state.h"
diff --git a/src/gallium/drivers/softpipe/sp_fs_sse.c b/src/gallium/drivers/softpipe/sp_fs_sse.c
index 9a273c8764..7e22081132 100644
--- a/src/gallium/drivers/softpipe/sp_fs_sse.c
+++ b/src/gallium/drivers/softpipe/sp_fs_sse.c
@@ -29,7 +29,7 @@
#include "sp_context.h"
#include "sp_state.h"
#include "sp_fs.h"
-#include "sp_headers.h"
+#include "sp_quad.h"
#include "pipe/p_state.h"
diff --git a/src/gallium/drivers/softpipe/sp_headers.h b/src/gallium/drivers/softpipe/sp_headers.h
deleted file mode 100644
index 4a42cb3c19..0000000000
--- a/src/gallium/drivers/softpipe/sp_headers.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/* Authors: Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#ifndef SP_HEADERS_H
-#define SP_HEADERS_H
-
-#include "pipe/p_state.h"
-#include "tgsi/tgsi_exec.h"
-
-#define PRIM_POINT 1
-#define PRIM_LINE 2
-#define PRIM_TRI 3
-
-
-/* The rasterizer generates 2x2 quads of fragment and feeds them to
- * the current fp_machine (see below).
- * Remember that Y=0=top with Y increasing down the window.
- */
-#define QUAD_TOP_LEFT 0
-#define QUAD_TOP_RIGHT 1
-#define QUAD_BOTTOM_LEFT 2
-#define QUAD_BOTTOM_RIGHT 3
-
-#define MASK_TOP_LEFT (1 << QUAD_TOP_LEFT)
-#define MASK_TOP_RIGHT (1 << QUAD_TOP_RIGHT)
-#define MASK_BOTTOM_LEFT (1 << QUAD_BOTTOM_LEFT)
-#define MASK_BOTTOM_RIGHT (1 << QUAD_BOTTOM_RIGHT)
-#define MASK_ALL 0xf
-
-
-/**
- * Encodes everything we need to know about a 2x2 pixel block. Uses
- * "Channel-Serial" or "SoA" layout.
- */
-struct quad_header_input
-{
- int x0;
- int y0;
- float coverage[QUAD_SIZE]; /** fragment coverage for antialiasing */
- unsigned facing:1; /**< Front (0) or back (1) facing? */
- unsigned prim:2; /**< PRIM_POINT, LINE, TRI */
-};
-
-struct quad_header_inout
-{
- unsigned mask:4;
-};
-
-struct quad_header_output
-{
- /** colors in SOA format (rrrr, gggg, bbbb, aaaa) */
- float color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][QUAD_SIZE];
- float depth[QUAD_SIZE];
-};
-
-struct quad_header {
- struct quad_header_input input;
- struct quad_header_inout inout;
- struct quad_header_output output;
-
- const struct tgsi_interp_coef *coef;
- const struct tgsi_interp_coef *posCoef;
-
- unsigned nr_attrs;
-};
-
-#endif /* SP_HEADERS_H */
-
diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h
index 08513cb95f..bd6c6cb912 100644
--- a/src/gallium/drivers/softpipe/sp_quad.h
+++ b/src/gallium/drivers/softpipe/sp_quad.h
@@ -31,39 +31,76 @@
#ifndef SP_QUAD_H
#define SP_QUAD_H
+#include "pipe/p_state.h"
+#include "tgsi/tgsi_exec.h"
-struct softpipe_context;
-struct quad_header;
+#define QUAD_PRIM_POINT 1
+#define QUAD_PRIM_LINE 2
+#define QUAD_PRIM_TRI 3
-struct quad_stage {
- struct softpipe_context *softpipe;
- struct quad_stage *next;
+/* The rasterizer generates 2x2 quads of fragment and feeds them to
+ * the current fp_machine (see below).
+ * Remember that Y=0=top with Y increasing down the window.
+ */
+#define QUAD_TOP_LEFT 0
+#define QUAD_TOP_RIGHT 1
+#define QUAD_BOTTOM_LEFT 2
+#define QUAD_BOTTOM_RIGHT 3
+
+#define MASK_TOP_LEFT (1 << QUAD_TOP_LEFT)
+#define MASK_TOP_RIGHT (1 << QUAD_TOP_RIGHT)
+#define MASK_BOTTOM_LEFT (1 << QUAD_BOTTOM_LEFT)
+#define MASK_BOTTOM_RIGHT (1 << QUAD_BOTTOM_RIGHT)
+#define MASK_ALL 0xf
+
+
+/**
+ * Quad stage inputs (pos, coverage, front/back face, etc)
+ */
+struct quad_header_input
+{
+ int x0, y0; /**< quad window pos, always even */
+ float coverage[QUAD_SIZE]; /**< fragment coverage for antialiasing */
+ unsigned facing:1; /**< Front (0) or back (1) facing? */
+ unsigned prim:2; /**< QUAD_PRIM_POINT, LINE, TRI */
+};
- void (*begin)(struct quad_stage *qs);
- /** the stage action */
- void (*run)(struct quad_stage *qs, struct quad_header *quad);
+/**
+ * Quad stage inputs/outputs.
+ */
+struct quad_header_inout
+{
+ unsigned mask:4;
+};
+
- void (*destroy)(struct quad_stage *qs);
+/**
+ * Quad stage outputs (color & depth).
+ */
+struct quad_header_output
+{
+ /** colors in SOA format (rrrr, gggg, bbbb, aaaa) */
+ float color[PIPE_MAX_COLOR_BUFS][NUM_CHANNELS][QUAD_SIZE];
+ float depth[QUAD_SIZE];
};
-struct quad_stage *sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_earlyz_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_alpha_test_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe );
-struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe );
+/**
+ * Encodes everything we need to know about a 2x2 pixel block. Uses
+ * "Channel-Serial" or "SoA" layout.
+ */
+struct quad_header {
+ struct quad_header_input input;
+ struct quad_header_inout inout;
+ struct quad_header_output output;
-void sp_build_quad_pipeline(struct softpipe_context *sp);
+ const struct tgsi_interp_coef *coef;
+ const struct tgsi_interp_coef *posCoef;
-void sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad);
+ unsigned nr_attrs;
+};
#endif /* SP_QUAD_H */
diff --git a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c
index 85c9f037a3..0845bae0e6 100644
--- a/src/gallium/drivers/softpipe/sp_quad_alpha_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c
@@ -4,8 +4,8 @@
*/
#include "sp_context.h"
-#include "sp_headers.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#include "pipe/p_defines.h"
#include "util/u_memory.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index fb1d430a4f..e134e44337 100644
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
@@ -34,10 +34,10 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
+#include "sp_quad.h"
#include "sp_surface.h"
#include "sp_tile_cache.h"
-#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#define VEC4_COPY(DST, SRC) \
diff --git a/src/gallium/drivers/softpipe/sp_quad_bufloop.c b/src/gallium/drivers/softpipe/sp_quad_bufloop.c
index d7d6a6974d..953d8516b9 100644
--- a/src/gallium/drivers/softpipe/sp_quad_bufloop.c
+++ b/src/gallium/drivers/softpipe/sp_quad_bufloop.c
@@ -1,9 +1,9 @@
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
#include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
/**
diff --git a/src/gallium/drivers/softpipe/sp_quad_colormask.c b/src/gallium/drivers/softpipe/sp_quad_colormask.c
index 563c2fc739..dc90e5d5e9 100644
--- a/src/gallium/drivers/softpipe/sp_quad_colormask.c
+++ b/src/gallium/drivers/softpipe/sp_quad_colormask.c
@@ -34,9 +34,9 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
#include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
#include "sp_tile_cache.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad_coverage.c b/src/gallium/drivers/softpipe/sp_quad_coverage.c
index c27fd1482d..4aeee85870 100644
--- a/src/gallium/drivers/softpipe/sp_quad_coverage.c
+++ b/src/gallium/drivers/softpipe/sp_quad_coverage.c
@@ -35,8 +35,8 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
/**
@@ -46,10 +46,11 @@ static void
coverage_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
+ const uint prim = quad->input.prim;
- if ((softpipe->rasterizer->poly_smooth && quad->input.prim == PRIM_TRI) ||
- (softpipe->rasterizer->line_smooth && quad->input.prim == PRIM_LINE) ||
- (softpipe->rasterizer->point_smooth && quad->input.prim == PRIM_POINT)) {
+ if ((softpipe->rasterizer->poly_smooth && prim == QUAD_PRIM_TRI) ||
+ (softpipe->rasterizer->line_smooth && prim == QUAD_PRIM_LINE) ||
+ (softpipe->rasterizer->point_smooth && prim == QUAD_PRIM_POINT)) {
uint cbuf;
/* loop over colorbuffer outputs */
diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 523bd3e080..d463930bae 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -32,9 +32,9 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
#include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
#include "sp_tile_cache.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad_earlyz.c b/src/gallium/drivers/softpipe/sp_quad_earlyz.c
index 6e2dde304e..496fd39ed1 100644
--- a/src/gallium/drivers/softpipe/sp_quad_earlyz.c
+++ b/src/gallium/drivers/softpipe/sp_quad_earlyz.c
@@ -31,8 +31,8 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
-#include "sp_headers.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
/**
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index 5dacbbe55f..adca5df73d 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -43,8 +43,8 @@
#include "sp_context.h"
#include "sp_state.h"
-#include "sp_headers.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#include "sp_texture.h"
#include "sp_tex_sample.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad_occlusion.c b/src/gallium/drivers/softpipe/sp_quad_occlusion.c
index 169bd82876..dfa7ff3b1d 100644
--- a/src/gallium/drivers/softpipe/sp_quad_occlusion.c
+++ b/src/gallium/drivers/softpipe/sp_quad_occlusion.c
@@ -35,9 +35,9 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
#include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
static unsigned count_bits( unsigned val )
{
diff --git a/src/gallium/drivers/softpipe/sp_quad_output.c b/src/gallium/drivers/softpipe/sp_quad_output.c
index a37c8b4c39..92d5f9f3c1 100644
--- a/src/gallium/drivers/softpipe/sp_quad_output.c
+++ b/src/gallium/drivers/softpipe/sp_quad_output.c
@@ -27,9 +27,9 @@
#include "util/u_memory.h"
#include "sp_context.h"
-#include "sp_headers.h"
-#include "sp_surface.h"
#include "sp_quad.h"
+#include "sp_surface.h"
+#include "sp_quad_pipe.h"
#include "sp_tile_cache.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad.c b/src/gallium/drivers/softpipe/sp_quad_pipe.c
index 892ef87ee9..892ef87ee9 100644
--- a/src/gallium/drivers/softpipe/sp_quad.c
+++ b/src/gallium/drivers/softpipe/sp_quad_pipe.c
diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.h b/src/gallium/drivers/softpipe/sp_quad_pipe.h
new file mode 100644
index 0000000000..0e40586ffc
--- /dev/null
+++ b/src/gallium/drivers/softpipe/sp_quad_pipe.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/* Authors: Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef SP_QUAD_PIPE_H
+#define SP_QUAD_PIPE_H
+
+
+struct softpipe_context;
+struct quad_header;
+
+
+/**
+ * Fragment processing is performed on 2x2 blocks of pixels called "quads".
+ * Quad processing is performed with a pipeline of stages represented by
+ * this type.
+ */
+struct quad_stage {
+ struct softpipe_context *softpipe;
+
+ struct quad_stage *next;
+
+ void (*begin)(struct quad_stage *qs);
+
+ /** the stage action */
+ void (*run)(struct quad_stage *qs, struct quad_header *quad);
+
+ void (*destroy)(struct quad_stage *qs);
+};
+
+
+struct quad_stage *sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_earlyz_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_alpha_test_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe );
+struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe );
+
+void sp_build_quad_pipeline(struct softpipe_context *sp);
+
+void sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad);
+
+#endif /* SP_QUAD_PIPE_H */
diff --git a/src/gallium/drivers/softpipe/sp_quad_stencil.c b/src/gallium/drivers/softpipe/sp_quad_stencil.c
index 7495515764..5e9d447737 100644
--- a/src/gallium/drivers/softpipe/sp_quad_stencil.c
+++ b/src/gallium/drivers/softpipe/sp_quad_stencil.c
@@ -5,10 +5,10 @@
#include "sp_context.h"
-#include "sp_headers.h"
+#include "sp_quad.h"
#include "sp_surface.h"
#include "sp_tile_cache.h"
-#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#include "pipe/p_defines.h"
#include "util/u_memory.h"
diff --git a/src/gallium/drivers/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c
index ccf37f6be5..05e862f097 100644
--- a/src/gallium/drivers/softpipe/sp_quad_stipple.c
+++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c
@@ -4,8 +4,8 @@
*/
#include "sp_context.h"
-#include "sp_headers.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
#include "pipe/p_defines.h"
#include "util/u_memory.h"
@@ -19,11 +19,13 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
static const uint bit31 = 1 << 31;
static const uint bit30 = 1 << 30;
- if (quad->input.prim == PRIM_TRI) {
+ if (quad->input.prim == QUAD_PRIM_TRI) {
struct softpipe_context *softpipe = qs->softpipe;
/* need to invert Y to index into OpenGL's stipple pattern */
int y0, y1;
uint stipple0, stipple1;
+ const int col0 = quad->input.x0 % 32;
+
if (softpipe->rasterizer->origin_lower_left) {
y0 = softpipe->framebuffer.height - 1 - quad->input.y0;
y1 = y0 - 1;
@@ -32,12 +34,11 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
y0 = quad->input.y0;
y1 = y0 + 1;
}
+
stipple0 = softpipe->poly_stipple.stipple[y0 % 32];
stipple1 = softpipe->poly_stipple.stipple[y1 % 32];
-#if 1
- {
- const int col0 = quad->input.x0 % 32;
+ /* turn off quad mask bits that fail the stipple test */
if ((stipple0 & (bit31 >> col0)) == 0)
quad->inout.mask &= ~MASK_TOP_LEFT;
@@ -49,19 +50,11 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
if ((stipple1 & (bit30 >> col0)) == 0)
quad->inout.mask &= ~MASK_BOTTOM_RIGHT;
- }
-#else
- /* We'd like to use this code, but we'd need to redefine
- * MASK_TOP_LEFT to be (1 << 1) and MASK_TOP_RIGHT to be (1 << 0),
- * and similarly for the BOTTOM bits. But that may have undesirable
- * side effects elsewhere.
- */
- const int col0 = 30 - (quad->input.x0 % 32);
- quad->inout.mask &= (((stipple0 >> col0) & 0x3) |
- (((stipple1 >> col0) & 0x3) << 2));
-#endif
- if (!quad->inout.mask)
+
+ if (!quad->inout.mask) {
+ /* all fragments failed stipple test, end of quad pipeline */
return;
+ }
}
qs->next->run(qs->next, quad);
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index b1adb9cb7a..0925653b5d 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -32,13 +32,12 @@
* \author Brian Paul
*/
-#include "sp_setup.h"
-
#include "sp_context.h"
-#include "sp_headers.h"
+#include "sp_prim_setup.h"
#include "sp_quad.h"
+#include "sp_quad_pipe.h"
+#include "sp_setup.h"
#include "sp_state.h"
-#include "sp_prim_setup.h"
#include "draw/draw_context.h"
#include "draw/draw_private.h"
#include "draw/draw_vertex.h"
@@ -265,17 +264,20 @@ is_inf_or_nan(float x)
}
-static boolean cull_tri( struct setup_context *setup,
- float det )
+/**
+ * Do triangle cull test using tri determinant (sign indicates orientation)
+ * \return true if triangle is to be culled.
+ */
+static INLINE boolean
+cull_tri(const struct setup_context *setup, float det)
{
- if (det != 0)
- {
+ if (det != 0) {
/* if (det < 0 then Z points toward camera and triangle is
* counter-clockwise winding.
*/
unsigned winding = (det < 0) ? PIPE_WINDING_CCW : PIPE_WINDING_CW;
-
- if ((winding & setup->winding) == 0)
+
+ if ((winding & setup->winding) == 0)
return FALSE;
}
@@ -968,7 +970,7 @@ void setup_tri( struct setup_context *setup,
setup_tri_coefficients( setup );
setup_tri_edges( setup );
- setup->quad.input.prim = PRIM_TRI;
+ setup->quad.input.prim = QUAD_PRIM_TRI;
setup->span.y = 0;
setup->span.y_flags = 0;
@@ -1009,7 +1011,7 @@ void setup_tri( struct setup_context *setup,
* for a line.
*/
static void
-line_linear_coeff(struct setup_context *setup,
+line_linear_coeff(const struct setup_context *setup,
struct tgsi_interp_coef *coef,
uint vertSlot, uint i)
{
@@ -1029,9 +1031,9 @@ line_linear_coeff(struct setup_context *setup,
* for a line.
*/
static void
-line_persp_coeff(struct setup_context *setup,
- struct tgsi_interp_coef *coef,
- uint vertSlot, uint i)
+line_persp_coeff(const struct setup_context *setup,
+ struct tgsi_interp_coef *coef,
+ uint vertSlot, uint i)
{
/* XXX double-check/verify this arithmetic */
const float a0 = setup->vmin[vertSlot][i] * setup->vmin[0][3];
@@ -1206,7 +1208,7 @@ setup_line(struct setup_context *setup,
setup->quad.input.x0 = setup->quad.input.y0 = -1;
setup->quad.inout.mask = 0x0;
- setup->quad.input.prim = PRIM_LINE;
+ setup->quad.input.prim = QUAD_PRIM_LINE;
/* XXX temporary: set coverage to 1.0 so the line appears
* if AA mode happens to be enabled.
*/
@@ -1266,7 +1268,7 @@ setup_line(struct setup_context *setup,
static void
-point_persp_coeff(struct setup_context *setup,
+point_persp_coeff(const struct setup_context *setup,
const float (*vert)[4],
struct tgsi_interp_coef *coef,
uint vertSlot, uint i)
@@ -1361,7 +1363,7 @@ setup_point( struct setup_context *setup,
}
}
- setup->quad.input.prim = PRIM_POINT;
+ setup->quad.input.prim = QUAD_PRIM_POINT;
if (halfSize <= 0.5 && !round) {
/* special case for 1-pixel points */
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 32aa5025e4..adbd0cb7f0 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -34,7 +34,7 @@
*/
#include "sp_context.h"
-#include "sp_headers.h"
+#include "sp_quad.h"
#include "sp_surface.h"
#include "sp_texture.h"
#include "sp_tex_sample.h"
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index f84b3fb9d4..28a9784b16 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -265,7 +265,7 @@ softpipe_tex_surface_release(struct pipe_screen *screen,
* needed post-processing to put them into hardware layout, this is
* where it would happen. For softpipe, nothing to do.
*/
- assert ((*s)->texture);
+ assert(surf->texture);
if (--surf->refcount == 0) {
pipe_texture_reference(&surf->texture, NULL);
FREE(surf);
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 166c6b6b7e..9454cc87db 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -40,6 +40,7 @@ struct pipe_screen;
struct pipe_fence_handle;
struct pipe_state_cache;
struct pipe_query;
+struct pipe_winsys;
/**
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 8714a2ed7d..341d1caea0 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -39,7 +39,8 @@
#include "pipe/p_compiler.h"
-#include "pipe/p_state.h"
+#include "pipe/p_format.h"
+#include "pipe/p_defines.h"
@@ -50,6 +51,9 @@ extern "C" {
/** Opaque type */
struct pipe_fence_handle;
+struct pipe_winsys;
+struct pipe_buffer;
+
/**
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index ad43d799f3..35df70e7b7 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -64,7 +64,7 @@ struct tgsi_processor
struct tgsi_token
{
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_x */
- unsigned Size : 8; /**< UINT */
+ unsigned NrTokens : 8; /**< UINT */
unsigned Padding : 19;
unsigned Extended : 1; /**< BOOL */
};
@@ -107,7 +107,7 @@ enum tgsi_file_type {
struct tgsi_declaration
{
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_DECLARATION */
- unsigned Size : 8; /**< UINT */
+ unsigned NrTokens : 8; /**< UINT */
unsigned File : 4; /**< one of TGSI_FILE_x */
unsigned UsageMask : 4; /**< bitmask of TGSI_WRITEMASK_x flags */
unsigned Interpolate : 4; /**< one of TGSI_INTERPOLATE_x */
@@ -145,7 +145,7 @@ struct tgsi_declaration_semantic
struct tgsi_immediate
{
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_IMMEDIATE */
- unsigned Size : 8; /**< UINT */
+ unsigned NrTokens : 8; /**< UINT */
unsigned DataType : 4; /**< one of TGSI_IMM_x */
unsigned Padding : 15;
unsigned Extended : 1; /**< BOOL */
@@ -442,7 +442,7 @@ struct tgsi_immediate_float32
struct tgsi_instruction
{
unsigned Type : 4; /* TGSI_TOKEN_TYPE_INSTRUCTION */
- unsigned Size : 8; /* UINT */
+ unsigned NrTokens : 8; /* UINT */
unsigned Opcode : 8; /* TGSI_OPCODE_ */
unsigned Saturate : 2; /* TGSI_SAT_ */
unsigned NumDstRegs : 2; /* UINT */
@@ -458,7 +458,7 @@ struct tgsi_instruction
*
* Then, tgsi_instruction::NumSrcRegs of tgsi_src_register follow.
*
- * tgsi_instruction::Size contains the total number of words that make the
+ * tgsi_instruction::NrTokens contains the total number of words that make the
* instruction, including the instruction word.
*/
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 34141ff242..a2e839da5c 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -66,7 +66,6 @@ extern "C" {
/* fwd decls */
struct pipe_screen;
struct pipe_surface;
-struct pipe_winsys;
diff --git a/src/gallium/state_trackers/Makefile b/src/gallium/state_trackers/Makefile
index 07b3fbf311..265ca468c2 100644
--- a/src/gallium/state_trackers/Makefile
+++ b/src/gallium/state_trackers/Makefile
@@ -2,7 +2,7 @@ TOP = ../../..
include $(TOP)/configs/current
-SUBDIRS = glx
+SUBDIRS = $(GALLIUM_STATE_TRACKERS_DIRS)
default: subdirs
diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile
index 17d1a7a8e4..ea4cec0bb8 100644
--- a/src/gallium/state_trackers/egl/Makefile
+++ b/src/gallium/state_trackers/egl/Makefile
@@ -6,8 +6,7 @@ TOP = ../../../..
include ${TOP}/configs/current
-CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \
- $(shell pkg-config --cflags pixman-1 xorg-server) \
+CFLAGS += -g -Wall -Werror-implicit-function-declaration -fPIC \
-I${GALLIUMDIR}/include \
-I${GALLIUMDIR}/auxiliary \
-I${TOP}/src/mesa/drivers/dri/common \
diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c
index 091d437d81..281dff9f8a 100644
--- a/src/gallium/state_trackers/egl/egl_surface.c
+++ b/src/gallium/state_trackers/egl/egl_surface.c
@@ -16,11 +16,11 @@
* Util functions
*/
-static struct drm_mode_modeinfo *
+static drmModeModeInfoPtr
drm_find_mode(drmModeConnectorPtr connector, _EGLMode *mode)
{
int i;
- struct drm_mode_modeinfo *m = NULL;
+ drmModeModeInfoPtr m = NULL;
for (i = 0; i < connector->count_modes; i++) {
m = &connector->modes[i];
diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c
index dec82c3a00..2813bf4360 100644
--- a/src/gallium/state_trackers/egl/egl_tracker.c
+++ b/src/gallium/state_trackers/egl/egl_tracker.c
@@ -92,7 +92,7 @@ drm_update_res(struct drm_device *dev)
static void
drm_add_modes_from_connector(_EGLScreen *screen, drmModeConnectorPtr connector)
{
- struct drm_mode_modeinfo *m;
+ drmModeModeInfoPtr m = NULL;
int i;
for (i = 0; i < connector->count_modes; i++) {
diff --git a/src/gallium/state_trackers/egl/egl_tracker.h b/src/gallium/state_trackers/egl/egl_tracker.h
index 0b4dd9797d..908bab5f9b 100644
--- a/src/gallium/state_trackers/egl/egl_tracker.h
+++ b/src/gallium/state_trackers/egl/egl_tracker.h
@@ -128,7 +128,7 @@ struct drm_screen
/*drmModeCrtcPtr crtc;*/
uint32_t crtcID;
- struct drm_mode_modeinfo *mode;
+ drmModeModeInfoPtr mode;
};
diff --git a/src/gallium/state_trackers/g3dvl/Makefile b/src/gallium/state_trackers/g3dvl/Makefile
index cddfca54fe..f9f4d6be3c 100644
--- a/src/gallium/state_trackers/g3dvl/Makefile
+++ b/src/gallium/state_trackers/g3dvl/Makefile
@@ -3,7 +3,7 @@ OBJECTS = vl_display.o vl_screen.o vl_context.o vl_surface.o vl_shader_build.o
vl_r16snorm_mc_buf.o
GALLIUMDIR = ../..
-CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \
+CFLAGS += -g -Wall -Werror-implicit-function-declaration -fPIC \
-I${GALLIUMDIR}/include \
-I${GALLIUMDIR}/auxiliary \
-I${GALLIUMDIR}/winsys/g3dvl \
diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
index 122c42ed0e..187a13a560 100644
--- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
+++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
@@ -544,7 +544,7 @@ static int vlCreateDataBufs
* to display a rendered surface
* Quad is rendered as a tri strip
*/
- csc->vertex_bufs[0].pitch = sizeof(struct vlVertex2f);
+ csc->vertex_bufs[0].stride = sizeof(struct vlVertex2f);
csc->vertex_bufs[0].max_index = 3;
csc->vertex_bufs[0].buffer_offset = 0;
csc->vertex_bufs[0].buffer = pipe_buffer_create
@@ -573,7 +573,7 @@ static int vlCreateDataBufs
* Create our texcoord buffer and texcoord buffer element
* Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices
*/
- csc->vertex_bufs[1].pitch = sizeof(struct vlVertex2f);
+ csc->vertex_bufs[1].stride = sizeof(struct vlVertex2f);
csc->vertex_bufs[1].max_index = 3;
csc->vertex_bufs[1].buffer_offset = 0;
csc->vertex_bufs[1].buffer = pipe_buffer_create
@@ -602,26 +602,24 @@ static int vlCreateDataBufs
* Create our vertex shader's constant buffer
* Const buffer contains scaling and translation vectors
*/
- csc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
csc->vs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
- csc->vs_const_buf.size
+ sizeof(struct vlVertexShaderConsts)
);
/*
* Create our fragment shader's constant buffer
* Const buffer contains the color conversion matrix and bias vectors
*/
- csc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
csc->fs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT,
- csc->fs_const_buf.size
+ sizeof(struct vlFragmentShaderConsts)
);
/*
diff --git a/src/gallium/state_trackers/g3dvl/vl_context.c b/src/gallium/state_trackers/g3dvl/vl_context.c
index c4c4e23c15..65ddb9f01e 100644
--- a/src/gallium/state_trackers/g3dvl/vl_context.c
+++ b/src/gallium/state_trackers/g3dvl/vl_context.c
@@ -86,7 +86,7 @@ static int vlInitCommon(struct vlContext *context)
}
dsa.alpha.enabled = 0;
dsa.alpha.func = PIPE_FUNC_ALWAYS;
- dsa.alpha.ref = 0;
+ dsa.alpha.ref_value = 0;
context->dsa = pipe->create_depth_stencil_alpha_state(pipe, &dsa);
pipe->bind_depth_stencil_alpha_state(pipe, context->dsa);
diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
index fb9585063e..7cd753f736 100644
--- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
+++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
@@ -913,7 +913,7 @@ static int vlCreateDataBufs
mc->macroblocks_per_picture = mbw * mbh;
/* Create our vertex buffers */
- mc->vertex_bufs.ycbcr.pitch = sizeof(struct vlVertex2f) * 4;
+ mc->vertex_bufs.ycbcr.stride = sizeof(struct vlVertex2f) * 4;
mc->vertex_bufs.ycbcr.max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.ycbcr.buffer_offset = 0;
mc->vertex_bufs.ycbcr.buffer = pipe_buffer_create
@@ -926,7 +926,7 @@ static int vlCreateDataBufs
for (i = 1; i < 3; ++i)
{
- mc->vertex_bufs.all[i].pitch = sizeof(struct vlVertex2f) * 2;
+ mc->vertex_bufs.all[i].stride = sizeof(struct vlVertex2f) * 2;
mc->vertex_bufs.all[i].max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.all[i].buffer_offset = 0;
mc->vertex_bufs.all[i].buffer = pipe_buffer_create
@@ -987,22 +987,20 @@ static int vlCreateDataBufs
mc->vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT;
/* Create our constant buffer */
- mc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
mc->vs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
- mc->vs_const_buf.size
+ sizeof(struct vlVertexShaderConsts)
);
- mc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
mc->fs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT,
- mc->fs_const_buf.size
+ sizeof(struct vlFragmentShaderConsts)
);
memcpy
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c
index 0fa7b25b92..92388f7978 100644
--- a/src/gallium/state_trackers/g3dvl/vl_surface.c
+++ b/src/gallium/state_trackers/g3dvl/vl_surface.c
@@ -152,9 +152,9 @@ int vlPutPicture
bind_pipe_drawable(pipe, drawable);
- pipe->winsys->flush_frontbuffer
+ pipe->screen->flush_frontbuffer
(
- pipe->winsys,
+ pipe->screen,
csc->vlGetFrameBuffer(csc),
pipe->priv
);
@@ -172,13 +172,13 @@ int vlSurfaceGetStatus
assert(surface->context);
assert(status);
- if (surface->render_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->render_fence, 0))
+ if (surface->render_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->render_fence, 0))
{
*status = vlResourceStatusRendering;
return 0;
}
- if (surface->disp_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->disp_fence, 0))
+ if (surface->disp_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->disp_fence, 0))
{
*status = vlResourceStatusDisplaying;
return 0;
@@ -211,7 +211,7 @@ int vlSurfaceSync
assert(surface->context);
assert(surface->render_fence);
- surface->context->pipe->winsys->fence_finish(surface->context->pipe->winsys, surface->render_fence, 0);
+ surface->context->pipe->screen->fence_finish(surface->context->pipe->screen, surface->render_fence, 0);
return 0;
}
diff --git a/src/gallium/state_trackers/glx/xlib/SConscript b/src/gallium/state_trackers/glx/xlib/SConscript
index 14cdad69cb..01641e90e4 100644
--- a/src/gallium/state_trackers/glx/xlib/SConscript
+++ b/src/gallium/state_trackers/glx/xlib/SConscript
@@ -5,8 +5,7 @@ Import('*')
if env['platform'] == 'linux' \
and 'mesa' in env['statetrackers'] \
- and ('softpipe' or 'i915simple' or 'trace') in env['drivers'] \
- and not env['dri']:
+ and ('softpipe' or 'i915simple' or 'trace') in env['drivers']:
env = env.Clone()
diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c
index 70e346a539..1aa4b8a6e2 100644
--- a/src/gallium/state_trackers/wgl/icd/stw_icd.c
+++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c
@@ -31,6 +31,7 @@
#include "GL/gl.h"
#include "pipe/p_debug.h"
+#include "pipe/p_thread.h"
#include "shared/stw_public.h"
#include "icd/stw_icd.h"
@@ -41,11 +42,14 @@
struct stw_icd
{
+ pipe_mutex mutex;
+
+ GLCLTPROCTABLE cpt;
+ boolean cpt_initialized;
+
struct {
struct stw_context *ctx;
} ctx_array[DRV_CONTEXT_MAX];
-
- DHGLRC ctx_current;
};
@@ -62,6 +66,8 @@ stw_icd_init( void )
stw_icd = &stw_icd_storage;
memset(stw_icd, 0, sizeof *stw_icd);
+ pipe_mutex_init( stw_icd->mutex );
+
return TRUE;
}
@@ -70,26 +76,35 @@ stw_icd_cleanup(void)
{
int i;
- if(!stw_icd)
+ if (!stw_icd)
return;
+
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ /* Ensure all contexts are destroyed */
+ for (i = 0; i < DRV_CONTEXT_MAX; i++)
+ if (stw_icd->ctx_array[i].ctx)
+ stw_delete_context( stw_icd->ctx_array[i].ctx );
+ }
+ pipe_mutex_unlock( stw_icd->mutex );
- /* Ensure all contexts are destroyed */
- for (i = 0; i < DRV_CONTEXT_MAX; i++)
- if (stw_icd->ctx_array[i].ctx)
- stw_delete_context( stw_icd->ctx_array[i].ctx );
-
+ pipe_mutex_init( stw_icd->mutex );
stw_icd = NULL;
}
static struct stw_context *
-lookup_context( DHGLRC dhglrc )
+lookup_context( struct stw_icd *icd,
+ DHGLRC dhglrc )
{
if (dhglrc == 0 ||
dhglrc >= DRV_CONTEXT_MAX)
return NULL;
- return stw_icd->ctx_array[dhglrc - 1].ctx;
+ if (icd == NULL)
+ return NULL;
+
+ return icd->ctx_array[dhglrc - 1].ctx;
}
BOOL APIENTRY
@@ -98,14 +113,25 @@ DrvCopyContext(
DHGLRC dhrcDest,
UINT fuMask )
{
- struct stw_context *src = lookup_context( dhrcSource );
- struct stw_context *dst = lookup_context( dhrcDest );
-
- if (src == NULL ||
- dst == NULL)
+ BOOL ret = FALSE;
+
+ if (!stw_icd)
return FALSE;
- return stw_copy_context( src, dst, fuMask );
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ struct stw_context *src = lookup_context( stw_icd, dhrcSource );
+ struct stw_context *dst = lookup_context( stw_icd, dhrcDest );
+
+ if (src == NULL || dst == NULL)
+ goto done;
+
+ ret = stw_copy_context( src, dst, fuMask );
+ }
+done:
+ pipe_mutex_unlock( stw_icd->mutex );
+
+ return ret;
}
DHGLRC APIENTRY
@@ -113,23 +139,37 @@ DrvCreateLayerContext(
HDC hdc,
INT iLayerPlane )
{
- DWORD i;
+ DHGLRC handle = 0;
+
+ if (!stw_icd)
+ return handle;
+
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ int i;
+
+ for (i = 0; i < DRV_CONTEXT_MAX; i++) {
+ if (stw_icd->ctx_array[i].ctx == NULL)
+ break;
+ }
- for (i = 0; i < DRV_CONTEXT_MAX; i++) {
- if (stw_icd->ctx_array[i].ctx == NULL)
- goto found_slot;
+ /* No slot available, fail:
+ */
+ if (i == DRV_CONTEXT_MAX)
+ goto done;
+
+ stw_icd->ctx_array[i].ctx = stw_create_context( hdc, iLayerPlane );
+ if (stw_icd->ctx_array[i].ctx == NULL)
+ goto done;
+
+ /* success:
+ */
+ handle = (DHGLRC) i + 1;
}
-
- /* No slot available, fail:
- */
- return 0;
+done:
+ pipe_mutex_unlock( stw_icd->mutex );
-found_slot:
- stw_icd->ctx_array[i].ctx = stw_create_context( hdc, iLayerPlane );
- if (stw_icd->ctx_array[i].ctx == NULL)
- return 0;
-
- return (DHGLRC) i + 1;
+ return handle;
}
DHGLRC APIENTRY
@@ -143,20 +183,30 @@ BOOL APIENTRY
DrvDeleteContext(
DHGLRC dhglrc )
{
- struct stw_context *ctx;
+ BOOL ret = FALSE;
+
+ if (!stw_icd)
+ return ret;
- ctx = lookup_context( dhglrc );
- if (ctx == NULL)
- goto fail;
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ struct stw_context *ctx;
- if (stw_delete_context( ctx ) == FALSE)
- goto fail;
+ ctx = lookup_context( stw_icd, dhglrc );
+ if (ctx == NULL)
+ goto done;
+
+ if (stw_delete_context( ctx ) == FALSE)
+ goto done;
+
+ stw_icd->ctx_array[dhglrc - 1].ctx = NULL;
+ ret = TRUE;
- stw_icd->ctx_array[dhglrc - 1].ctx = NULL;
- return TRUE;
+ }
+done:
+ pipe_mutex_unlock( stw_icd->mutex );
-fail:
- return FALSE;
+ return ret;
}
BOOL APIENTRY
@@ -183,7 +233,7 @@ DrvDescribePixelFormat(
r = stw_pixelformat_describe( hdc, iPixelFormat, cjpfd, ppfd );
- debug_printf( "%s( 0x%p, %d, %u, 0x%p ) = %d\n",
+ debug_printf( "%s( %p, %d, %u, %p ) = %d\n",
__FUNCTION__, hdc, iPixelFormat, cjpfd, ppfd, r );
return r;
@@ -210,7 +260,7 @@ DrvGetProcAddress(
r = stw_get_proc_address( lpszProc );
- debug_printf( "%s( \", __FUNCTION__%s\" ) = 0x%p\n", lpszProc, r );
+ debug_printf( "%s( \", __FUNCTION__%s\" ) = %p\n", lpszProc, r );
return r;
}
@@ -230,23 +280,32 @@ BOOL APIENTRY
DrvReleaseContext(
DHGLRC dhglrc )
{
- struct stw_context *ctx;
+ BOOL ret = FALSE;
- if (dhglrc != stw_icd->ctx_current)
- goto fail;
+ if (!stw_icd)
+ return ret;
- ctx = lookup_context( dhglrc );
- if (ctx == NULL)
- goto fail;
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ struct stw_context *ctx;
- if (stw_make_current( NULL, NULL ) == FALSE)
- goto fail;
+ /* XXX: The expectation is that ctx is the same context which is
+ * current for this thread. We should check that and return False
+ * if not the case.
+ */
+ ctx = lookup_context( stw_icd, dhglrc );
+ if (ctx == NULL)
+ goto done;
- stw_icd->ctx_current = 0;
- return TRUE;
+ if (stw_make_current( NULL, NULL ) == FALSE)
+ goto done;
-fail:
- return FALSE;
+ ret = TRUE;
+ }
+done:
+ pipe_mutex_unlock( stw_icd->mutex );
+
+ return ret;
}
void APIENTRY
@@ -254,36 +313,20 @@ DrvSetCallbackProcs(
INT nProcs,
PROC *pProcs )
{
- debug_printf( "%s( %d, 0x%p )\n", __FUNCTION__, nProcs, pProcs );
+ debug_printf( "%s( %d, %p )\n", __FUNCTION__, nProcs, pProcs );
return;
}
-#define GPA_GL( NAME ) disp->NAME = gl##NAME
-static GLCLTPROCTABLE cpt;
+static void init_proc_table( GLCLTPROCTABLE *cpt )
+{
+ GLDISPATCHTABLE *disp = &cpt->glDispatchTable;
-PGLCLTPROCTABLE APIENTRY
-DrvSetContext(
- HDC hdc,
- DHGLRC dhglrc,
- PFN_SETPROCTABLE pfnSetProcTable )
-{
- struct stw_context *ctx;
- GLDISPATCHTABLE *disp = &cpt.glDispatchTable;
-
- debug_printf( "%s( 0x%p, %u, 0x%p )\n", __FUNCTION__, hdc, dhglrc, pfnSetProcTable );
-
- ctx = lookup_context( dhglrc );
- if (ctx == NULL)
- return NULL;
-
- if (!stw_make_current( hdc, ctx ))
- return NULL;
-
- memset( &cpt, 0, sizeof( cpt ) );
- cpt.cEntries = OPENGL_VERSION_110_ENTRIES;
+ memset( cpt, 0, sizeof *cpt );
+ cpt->cEntries = OPENGL_VERSION_110_ENTRIES;
+#define GPA_GL( NAME ) disp->NAME = gl##NAME
GPA_GL( NewList );
GPA_GL( EndList );
GPA_GL( CallList );
@@ -620,8 +663,46 @@ DrvSetContext(
GPA_GL( TexSubImage2D );
GPA_GL( PopClientAttrib );
GPA_GL( PushClientAttrib );
+}
- return &cpt;
+PGLCLTPROCTABLE APIENTRY
+DrvSetContext(
+ HDC hdc,
+ DHGLRC dhglrc,
+ PFN_SETPROCTABLE pfnSetProcTable )
+{
+ PGLCLTPROCTABLE result = NULL;
+
+ if (!stw_icd)
+ return result;
+
+ pipe_mutex_lock( stw_icd->mutex );
+ {
+ struct stw_context *ctx;
+
+ debug_printf( "%s( 0x%p, %u, 0x%p )\n",
+ __FUNCTION__, hdc, dhglrc, pfnSetProcTable );
+
+ /* Although WGL allows different dispatch entrypoints per
+ */
+ if (!stw_icd->cpt_initialized) {
+ init_proc_table( &stw_icd->cpt );
+ stw_icd->cpt_initialized = TRUE;
+ }
+
+ ctx = lookup_context( stw_icd, dhglrc );
+ if (ctx == NULL)
+ goto done;
+
+ if (!stw_make_current( hdc, ctx ))
+ goto done;
+
+ result = &stw_icd->cpt;
+ }
+done:
+ pipe_mutex_unlock( stw_icd->mutex );
+
+ return result;
}
int APIENTRY
@@ -646,7 +727,7 @@ DrvSetPixelFormat(
r = stw_pixelformat_set( hdc, iPixelFormat );
- debug_printf( "%s( 0x%p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" );
+ debug_printf( "%s( %p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" );
return r;
}
@@ -665,7 +746,7 @@ BOOL APIENTRY
DrvSwapBuffers(
HDC hdc )
{
- debug_printf( "%s( 0x%p )\n", __FUNCTION__, hdc );
+ debug_printf( "%s( %p )\n", __FUNCTION__, hdc );
return stw_swap_buffers( hdc );
}
@@ -686,5 +767,7 @@ DrvValidateVersion(
{
debug_printf( "%s( %u )\n", __FUNCTION__, ulVersion );
+ /* TODO: get the expected version from the winsys */
+
return ulVersion == 1;
}
diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
index 12b5ac6d91..84b7b287b9 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
@@ -256,6 +256,14 @@ stw_pixelformat_set(
return FALSE;
currentpixelformat = iPixelFormat;
+
+ /* Some applications mistakenly use the undocumented wglSetPixelFormat
+ * function instead of SetPixelFormat, so we call SetPixelFormat here to
+ * avoid opengl32.dll's wglCreateContext to fail */
+ if (GetPixelFormat(hdc) == 0) {
+ SetPixelFormat(hdc, iPixelFormat, NULL);
+ }
+
return TRUE;
}
diff --git a/src/gallium/state_trackers/wgl/shared/stw_quirks.c b/src/gallium/state_trackers/wgl/shared/stw_quirks.c
index bf1ec3fee7..0961ce3bb0 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_quirks.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_quirks.c
@@ -55,9 +55,12 @@ void gl_dispatch_stub_560(void){}
void gl_dispatch_stub_561(void){}
void gl_dispatch_stub_565(void){}
void gl_dispatch_stub_566(void){}
+void gl_dispatch_stub_570(void){}
void gl_dispatch_stub_577(void){}
void gl_dispatch_stub_578(void){}
+void gl_dispatch_stub_582(void){}
void gl_dispatch_stub_603(void){}
+void gl_dispatch_stub_607(void){}
void gl_dispatch_stub_645(void){}
void gl_dispatch_stub_646(void){}
void gl_dispatch_stub_647(void){}
@@ -67,6 +70,7 @@ void gl_dispatch_stub_650(void){}
void gl_dispatch_stub_651(void){}
void gl_dispatch_stub_652(void){}
void gl_dispatch_stub_653(void){}
+void gl_dispatch_stub_657(void){}
void gl_dispatch_stub_733(void){}
void gl_dispatch_stub_734(void){}
void gl_dispatch_stub_735(void){}
@@ -79,6 +83,7 @@ void gl_dispatch_stub_746(void){}
void gl_dispatch_stub_760(void){}
void gl_dispatch_stub_761(void){}
void gl_dispatch_stub_763(void){}
+void gl_dispatch_stub_764(void){}
void gl_dispatch_stub_765(void){}
void gl_dispatch_stub_766(void){}
void gl_dispatch_stub_767(void){}
diff --git a/src/gallium/winsys/drm/Makefile b/src/gallium/winsys/drm/Makefile
index f466ce6c3c..a84fcd8418 100644
--- a/src/gallium/winsys/drm/Makefile
+++ b/src/gallium/winsys/drm/Makefile
@@ -1,20 +1,20 @@
-# src/mesa/drivers/dri/Makefile
+# src/gallium/winsys/drm/Makefile
TOP = ../../../..
include $(TOP)/configs/current
+SUBDIRS = $(GALLIUM_WINSYS_DRM_DIRS)
+default: $(TOP)/$(LIB_DIR)/gallium subdirs
-default: $(TOP)/$(LIB_DIR) subdirs
-
-$(TOP)/$(LIB_DIR):
- -mkdir $(TOP)/$(LIB_DIR)
+$(TOP)/$(LIB_DIR)/gallium:
+ -mkdir -p $(TOP)/$(LIB_DIR)/gallium
subdirs:
- @for dir in $(DRI_DIRS) ; do \
+ @for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
@@ -22,7 +22,7 @@ subdirs:
install:
- @for dir in $(DRI_DIRS) ; do \
+ @for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
@@ -30,7 +30,7 @@ install:
clean:
- @for dir in $(DRI_DIRS) ; do \
+ @for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
diff --git a/src/gallium/winsys/drm/Makefile.template b/src/gallium/winsys/drm/Makefile.template
index 211f4d875e..cccf8abdfd 100644
--- a/src/gallium/winsys/drm/Makefile.template
+++ b/src/gallium/winsys/drm/Makefile.template
@@ -1,9 +1,9 @@
# -*-makefile-*-
MESA_MODULES = \
- $(TOP)/src/mesa/libmesa.a \
+ $(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES)
-
+
COMMON_GALLIUM_SOURCES = \
$(TOP)/src/mesa/drivers/dri/common/utils.c \
$(TOP)/src/mesa/drivers/dri/common/vblank.c \
@@ -79,7 +79,7 @@ SHARED_INCLUDES = \
##### TARGETS #####
-default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/$(LIBNAME_EGL)
+default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME_EGL)
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
@@ -93,11 +93,11 @@ $(LIBNAME_EGL): $(WINSYS_OBJECTS) $(LIBS)
$(OBJECTS) $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) $(PIPE_DRIVERS) $(WINOBJ) $(DRI_LIB_DEPS) \
--whole-archive $(LIBS) $(GALLIUM_AUXILIARIES) --no-whole-archive $(DRIVER_EXTRAS)
-$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
+$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(LIBNAME)
+ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
-$(TOP)/$(LIB_DIR)/$(LIBNAME_EGL): $(LIBNAME_EGL)
- $(INSTALL) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)
+$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME_EGL): $(LIBNAME_EGL)
+ $(INSTALL) $(LIBNAME_EGL) $(TOP)/$(LIB_DIR)/gallium
depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
rm -f depend
diff --git a/src/gallium/winsys/drm/intel/Makefile b/src/gallium/winsys/drm/intel/Makefile
index eede9fc866..78773b8d1b 100644
--- a/src/gallium/winsys/drm/intel/Makefile
+++ b/src/gallium/winsys/drm/intel/Makefile
@@ -2,7 +2,9 @@ TOP = ../../../../..
include $(TOP)/configs/current
-SUBDIRS = gem egl
+# Always build gem and then build winsys with
+# enabled state trackers
+SUBDIRS = gem $(GALLIUM_STATE_TRACKERS_DIRS)
default: subdirs
diff --git a/src/gallium/winsys/drm/intel/common/Makefile b/src/gallium/winsys/drm/intel/common/Makefile
deleted file mode 100644
index bf1a7d691f..0000000000
--- a/src/gallium/winsys/drm/intel/common/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-TOP = ../../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = inteldrm
-
-C_SOURCES = \
- intel_be_batchbuffer.c \
- intel_be_context.c \
- intel_be_device.c \
- ws_dri_bufmgr.c \
- ws_dri_drmpool.c \
- ws_dri_fencemgr.c \
- ws_dri_mallocpool.c \
- ws_dri_slabpool.c
-
-
-include ./Makefile.template
-
-DRIVER_DEFINES = $(shell pkg-config libdrm --cflags \
- && pkg-config libdrm --atleast-version=2.3.1 \
- && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
-symlinks:
-
diff --git a/src/gallium/winsys/drm/intel/common/Makefile.template b/src/gallium/winsys/drm/intel/common/Makefile.template
deleted file mode 100644
index 02ed363a43..0000000000
--- a/src/gallium/winsys/drm/intel/common/Makefile.template
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*-makefile-*-
-
-
-# We still have a dependency on the "dri" buffer manager. Most likely
-# the interface can be reused in non-dri environments, and also as a
-# frontend to simpler memory managers.
-#
-COMMON_SOURCES =
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(CPP_SOURCES:.cpp=.o) \
- $(ASM_SOURCES:.S=.o)
-
-
-### Include directories
-INCLUDES = \
- -I. \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/include \
- $(DRIVER_INCLUDES)
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.cpp.o:
- $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: depend symlinks $(LIBNAME)
-
-
-$(LIBNAME): $(OBJECTS) Makefile Makefile.template
- $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS)
-
-
-depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \
- $(ASM_SOURCES) 2> /dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean::
- -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
- -rm -f depend depend.bak
-
-
-include depend
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c b/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c
deleted file mode 100644
index bc13a5761e..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c
+++ /dev/null
@@ -1,429 +0,0 @@
-
-#include "intel_be_batchbuffer.h"
-#include "intel_be_context.h"
-#include "intel_be_device.h"
-#include <errno.h>
-
-#include "xf86drm.h"
-
-static void
-intel_realloc_relocs(struct intel_be_batchbuffer *batch, int num_relocs)
-{
- unsigned long size = num_relocs * I915_RELOC0_STRIDE + I915_RELOC_HEADER;
-
- size *= sizeof(uint32_t);
- batch->reloc = realloc(batch->reloc, size);
- batch->reloc_size = num_relocs;
-}
-
-
-void
-intel_be_batchbuffer_reset(struct intel_be_batchbuffer *batch)
-{
- /*
- * Get a new, free batchbuffer.
- */
- drmBO *bo;
- struct drm_bo_info_req *req;
-
- driBOUnrefUserList(batch->list);
- driBOResetList(batch->list);
-
- /* base.size is the size available to the i915simple driver */
- batch->base.size = batch->device->max_batch_size - BATCH_RESERVED;
- batch->base.actual_size = batch->device->max_batch_size;
- driBOData(batch->buffer, batch->base.actual_size, NULL, NULL, 0);
-
- /*
- * Add the batchbuffer to the validate list.
- */
-
- driBOAddListItem(batch->list, batch->buffer,
- DRM_BO_FLAG_EXE | DRM_BO_FLAG_MEM_TT,
- DRM_BO_FLAG_EXE | DRM_BO_MASK_MEM,
- &batch->dest_location, &batch->node);
-
- req = &batch->node->bo_arg.d.req.bo_req;
-
- /*
- * Set up information needed for us to make relocations
- * relative to the underlying drm buffer objects.
- */
-
- driReadLockKernelBO();
- bo = driBOKernel(batch->buffer);
- req->presumed_offset = (uint64_t) bo->offset;
- req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
- batch->drmBOVirtual = (uint8_t *) bo->virtual;
- driReadUnlockKernelBO();
-
- /*
- * Adjust the relocation buffer size.
- */
-
- if (batch->reloc_size > INTEL_MAX_RELOCS ||
- batch->reloc == NULL)
- intel_realloc_relocs(batch, INTEL_DEFAULT_RELOCS);
-
- assert(batch->reloc != NULL);
- batch->reloc[0] = 0; /* No relocs yet. */
- batch->reloc[1] = 1; /* Reloc type 1 */
- batch->reloc[2] = 0; /* Only a single relocation list. */
- batch->reloc[3] = 0; /* Only a single relocation list. */
-
- batch->base.map = driBOMap(batch->buffer, DRM_BO_FLAG_WRITE, 0);
- batch->poolOffset = driBOPoolOffset(batch->buffer);
- batch->base.ptr = batch->base.map;
- batch->dirty_state = ~0;
- batch->nr_relocs = 0;
- batch->flags = 0;
- batch->id = 0;//batch->intel->intelScreen->batch_id++;
-}
-
-/*======================================================================
- * Public functions
- */
-struct intel_be_batchbuffer *
-intel_be_batchbuffer_alloc(struct intel_be_context *intel)
-{
- struct intel_be_batchbuffer *batch = calloc(sizeof(*batch), 1);
-
- batch->intel = intel;
- batch->device = intel->device;
-
- driGenBuffers(intel->device->batchPool, "batchbuffer", 1,
- &batch->buffer, 4096,
- DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_EXE, 0);
- batch->last_fence = NULL;
- batch->list = driBOCreateList(20);
- batch->reloc = NULL;
- intel_be_batchbuffer_reset(batch);
- return batch;
-}
-
-void
-intel_be_batchbuffer_free(struct intel_be_batchbuffer *batch)
-{
- if (batch->last_fence) {
- driFenceFinish(batch->last_fence,
- DRM_FENCE_TYPE_EXE, FALSE);
- driFenceUnReference(&batch->last_fence);
- }
- if (batch->base.map) {
- driBOUnmap(batch->buffer);
- batch->base.map = NULL;
- }
- driBOUnReference(batch->buffer);
- driBOFreeList(batch->list);
- if (batch->reloc)
- free(batch->reloc);
- batch->buffer = NULL;
- free(batch);
-}
-
-void
-intel_be_offset_relocation(struct intel_be_batchbuffer *batch,
- unsigned pre_add,
- struct _DriBufferObject *driBO,
- uint64_t val_flags,
- uint64_t val_mask)
-{
- int itemLoc;
- struct _drmBONode *node;
- uint32_t *reloc;
- struct drm_bo_info_req *req;
-
- driBOAddListItem(batch->list, driBO, val_flags, val_mask,
- &itemLoc, &node);
- req = &node->bo_arg.d.req.bo_req;
-
- if (!(req->hint & DRM_BO_HINT_PRESUMED_OFFSET)) {
-
- /*
- * Stop other threads from tampering with the underlying
- * drmBO while we're reading its offset.
- */
-
- driReadLockKernelBO();
- req->presumed_offset = (uint64_t) driBOKernel(driBO)->offset;
- driReadUnlockKernelBO();
- req->hint = DRM_BO_HINT_PRESUMED_OFFSET;
- }
-
- pre_add += driBOPoolOffset(driBO);
-
- if (batch->nr_relocs == batch->reloc_size)
- intel_realloc_relocs(batch, batch->reloc_size * 2);
-
- reloc = batch->reloc +
- (I915_RELOC_HEADER + batch->nr_relocs * I915_RELOC0_STRIDE);
-
- reloc[0] = ((uint8_t *)batch->base.ptr - batch->drmBOVirtual);
- i915_batchbuffer_dword(&batch->base, req->presumed_offset + pre_add);
- reloc[1] = pre_add;
- reloc[2] = itemLoc;
- reloc[3] = batch->dest_location;
- batch->nr_relocs++;
-}
-
-static void
-i915_drm_copy_reply(const struct drm_bo_info_rep * rep, drmBO * buf)
-{
- buf->handle = rep->handle;
- buf->flags = rep->flags;
- buf->size = rep->size;
- buf->offset = rep->offset;
- buf->mapHandle = rep->arg_handle;
- buf->proposedFlags = rep->proposed_flags;
- buf->start = rep->buffer_start;
- buf->fenceFlags = rep->fence_flags;
- buf->replyFlags = rep->rep_flags;
- buf->pageAlignment = rep->page_alignment;
-}
-
-static int
-i915_execbuf(struct intel_be_batchbuffer *batch,
- unsigned int used,
- boolean ignore_cliprects,
- drmBOList *list,
- struct drm_i915_execbuffer *ea)
-{
-// struct intel_be_context *intel = batch->intel;
- drmBONode *node;
- drmMMListHead *l;
- struct drm_i915_op_arg *arg, *first;
- struct drm_bo_op_req *req;
- struct drm_bo_info_rep *rep;
- uint64_t *prevNext = NULL;
- drmBO *buf;
- int ret = 0;
- uint32_t count = 0;
-
- first = NULL;
- for (l = list->list.next; l != &list->list; l = l->next) {
- node = DRMLISTENTRY(drmBONode, l, head);
-
- arg = &node->bo_arg;
- req = &arg->d.req;
-
- if (!first)
- first = arg;
-
- if (prevNext)
- *prevNext = (unsigned long)arg;
-
- prevNext = &arg->next;
- req->bo_req.handle = node->buf->handle;
- req->op = drm_bo_validate;
- req->bo_req.flags = node->arg0;
- req->bo_req.mask = node->arg1;
- req->bo_req.hint |= 0;
- count++;
- }
-
- memset(ea, 0, sizeof(*ea));
- ea->num_buffers = count;
- ea->batch.start = batch->poolOffset;
- ea->batch.used = used;
-#if 0 /* ZZZ JB: no cliprects used */
- ea->batch.cliprects = intel->pClipRects;
- ea->batch.num_cliprects = ignore_cliprects ? 0 : intel->numClipRects;
- ea->batch.DR1 = 0;
- ea->batch.DR4 = 0;((((GLuint) intel->drawX) & 0xffff) |
- (((GLuint) intel->drawY) << 16));
-#else
- ea->batch.cliprects = NULL;
- ea->batch.num_cliprects = 0;
- ea->batch.DR1 = 0;
- ea->batch.DR4 = 0;
-#endif
- ea->fence_arg.flags = DRM_I915_FENCE_FLAG_FLUSHED;
- ea->ops_list = (unsigned long) first;
- first->reloc_ptr = (unsigned long) batch->reloc;
- batch->reloc[0] = batch->nr_relocs;
-
- //return -EFAULT;
- do {
- ret = drmCommandWriteRead(batch->device->fd, DRM_I915_EXECBUFFER, ea,
- sizeof(*ea));
- } while (ret == -EAGAIN);
-
- if (ret != 0)
- return ret;
-
- for (l = list->list.next; l != &list->list; l = l->next) {
- node = DRMLISTENTRY(drmBONode, l, head);
- arg = &node->bo_arg;
- rep = &arg->d.rep.bo_info;
-
- if (!arg->handled) {
- return -EFAULT;
- }
- if (arg->d.rep.ret)
- return arg->d.rep.ret;
-
- buf = node->buf;
- i915_drm_copy_reply(rep, buf);
- }
- return 0;
-}
-
-/* TODO: Push this whole function into bufmgr.
- */
-static struct _DriFenceObject *
-do_flush_locked(struct intel_be_batchbuffer *batch,
- unsigned int used,
- boolean ignore_cliprects, boolean allow_unlock)
-{
- struct intel_be_context *intel = batch->intel;
- struct _DriFenceObject *fo;
- drmFence fence;
- drmBOList *boList;
- struct drm_i915_execbuffer ea;
- int ret = 0;
-
- driBOValidateUserList(batch->list);
- boList = driGetdrmBOList(batch->list);
-
-#if 0 /* ZZZ JB Allways run */
- if (!(intel->numClipRects == 0 && !ignore_cliprects)) {
-#else
- if (1) {
-#endif
- ret = i915_execbuf(batch, used, ignore_cliprects, boList, &ea);
- } else {
- driPutdrmBOList(batch->list);
- fo = NULL;
- goto out;
- }
- driPutdrmBOList(batch->list);
- if (ret)
- abort();
-
- if (ea.fence_arg.error != 0) {
-
- /*
- * The hardware has been idled by the kernel.
- * Don't fence the driBOs.
- */
-
- if (batch->last_fence)
- driFenceUnReference(&batch->last_fence);
-#if 0 /* ZZZ JB: no _mesa_* funcs in gallium */
- _mesa_printf("fence error\n");
-#endif
- batch->last_fence = NULL;
- fo = NULL;
- goto out;
- }
-
- fence.handle = ea.fence_arg.handle;
- fence.fence_class = ea.fence_arg.fence_class;
- fence.type = ea.fence_arg.type;
- fence.flags = ea.fence_arg.flags;
- fence.signaled = ea.fence_arg.signaled;
-
- fo = driBOFenceUserList(batch->device->fenceMgr, batch->list,
- "SuperFence", &fence);
-
- if (driFenceType(fo) & DRM_I915_FENCE_TYPE_RW) {
- if (batch->last_fence)
- driFenceUnReference(&batch->last_fence);
- /*
- * FIXME: Context last fence??
- */
- batch->last_fence = fo;
- driFenceReference(fo);
- }
- out:
-#if 0 /* ZZZ JB: fix this */
- intel->vtbl.lost_hardware(intel);
-#else
- (void)intel;
-#endif
- return fo;
-}
-
-
-struct _DriFenceObject *
-intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch)
-{
- struct intel_be_context *intel = batch->intel;
- unsigned int used = batch->base.ptr - batch->base.map;
- boolean was_locked = batch->intel->hardware_locked(intel);
- struct _DriFenceObject *fence;
-
- if (used == 0) {
- driFenceReference(batch->last_fence);
- return batch->last_fence;
- }
-
- /* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a
- * performance drain that we would like to avoid.
- */
-#if 0 /* ZZZ JB: what should we do here? */
- if (used & 4) {
- ((int *) batch->base.ptr)[0] = intel->vtbl.flush_cmd();
- ((int *) batch->base.ptr)[1] = 0;
- ((int *) batch->base.ptr)[2] = MI_BATCH_BUFFER_END;
- used += 12;
- }
- else {
- ((int *) batch->base.ptr)[0] = intel->vtbl.flush_cmd();
- ((int *) batch->base.ptr)[1] = MI_BATCH_BUFFER_END;
- used += 8;
- }
-#else
- if (used & 4) {
- ((int *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
- ((int *) batch->base.ptr)[1] = 0;
- ((int *) batch->base.ptr)[2] = (0xA<<23); // MI_BATCH_BUFFER_END;
- used += 12;
- }
- else {
- ((int *) batch->base.ptr)[0] = ((0<<29)|(4<<23)); // MI_FLUSH;
- ((int *) batch->base.ptr)[1] = (0xA<<23); // MI_BATCH_BUFFER_END;
- used += 8;
- }
-#endif
- driBOUnmap(batch->buffer);
- batch->base.ptr = NULL;
- batch->base.map = NULL;
-
- /* TODO: Just pass the relocation list and dma buffer up to the
- * kernel.
- */
- if (!was_locked)
- intel->hardware_lock(intel);
-
- fence = do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS),
- FALSE);
-
- if (!was_locked)
- intel->hardware_unlock(intel);
-
- /* Reset the buffer:
- */
- intel_be_batchbuffer_reset(batch);
- return fence;
-}
-
-void
-intel_be_batchbuffer_finish(struct intel_be_batchbuffer *batch)
-{
- struct _DriFenceObject *fence = intel_be_batchbuffer_flush(batch);
- driFenceFinish(fence, driFenceType(fence), FALSE);
- driFenceUnReference(&fence);
-}
-
-#if 0
-void
-intel_be_batchbuffer_data(struct intel_be_batchbuffer *batch,
- const void *data, unsigned int bytes, unsigned int flags)
-{
- assert((bytes & 3) == 0);
- intel_batchbuffer_require_space(batch, bytes, flags);
- memcpy(batch->base.ptr, data, bytes);
- batch->base.ptr += bytes;
-}
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h b/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h
deleted file mode 100644
index f150e3a674..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-
-#ifndef INTEL_BE_BATCHBUFFER_H
-#define INTEL_BE_BATCHBUFFER_H
-
-#include "i915simple/i915_batch.h"
-
-#include "ws_dri_bufmgr.h"
-
-#define BATCH_RESERVED 16
-
-#define INTEL_DEFAULT_RELOCS 100
-#define INTEL_MAX_RELOCS 400
-
-#define INTEL_BATCH_NO_CLIPRECTS 0x1
-#define INTEL_BATCH_CLIPRECTS 0x2
-
-struct intel_be_context;
-struct intel_be_device;
-
-struct intel_be_batchbuffer
-{
- struct i915_batchbuffer base;
-
- struct intel_be_context *intel;
- struct intel_be_device *device;
-
- struct _DriBufferObject *buffer;
- struct _DriFenceObject *last_fence;
- uint32_t flags;
-
- struct _DriBufferList *list;
- size_t list_count;
-
- uint32_t *reloc;
- size_t reloc_size;
- size_t nr_relocs;
-
- uint32_t dirty_state;
- uint32_t id;
-
- uint32_t poolOffset;
- uint8_t *drmBOVirtual;
- struct _drmBONode *node; /* Validation list node for this buffer */
- int dest_location; /* Validation list sequence for this buffer */
-};
-
-struct intel_be_batchbuffer *
-intel_be_batchbuffer_alloc(struct intel_be_context *intel);
-
-void
-intel_be_batchbuffer_free(struct intel_be_batchbuffer *batch);
-
-void
-intel_be_batchbuffer_finish(struct intel_be_batchbuffer *batch);
-
-struct _DriFenceObject *
-intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch);
-
-void
-intel_be_batchbuffer_reset(struct intel_be_batchbuffer *batch);
-
-void
-intel_be_offset_relocation(struct intel_be_batchbuffer *batch,
- unsigned pre_add,
- struct _DriBufferObject *driBO,
- uint64_t val_flags,
- uint64_t val_mask);
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_context.c b/src/gallium/winsys/drm/intel/common/intel_be_context.c
deleted file mode 100644
index 1af39674f4..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_context.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-/*
- * Authors: Jakob Bornecrantz <jakob-at-tungstengraphics.com>
- */
-
-#include "ws_dri_fencemgr.h"
-#include "intel_be_device.h"
-#include "intel_be_context.h"
-#include "intel_be_batchbuffer.h"
-
-static INLINE struct intel_be_context *
-intel_be_context(struct i915_winsys *sws)
-{
- return (struct intel_be_context *)sws;
-}
-
-/* Simple batchbuffer interface:
- */
-
-static struct i915_batchbuffer*
-intel_i915_batch_get(struct i915_winsys *sws)
-{
- struct intel_be_context *intel = intel_be_context(sws);
- return &intel->batch->base;
-}
-
-static void intel_i915_batch_reloc(struct i915_winsys *sws,
- struct pipe_buffer *buf,
- unsigned access_flags,
- unsigned delta)
-{
- struct intel_be_context *intel = intel_be_context(sws);
-
- unsigned flags = DRM_BO_FLAG_MEM_TT;
- unsigned mask = DRM_BO_MASK_MEM;
-
- if (access_flags & I915_BUFFER_ACCESS_WRITE) {
- flags |= DRM_BO_FLAG_WRITE;
- mask |= DRM_BO_FLAG_WRITE;
- }
-
- if (access_flags & I915_BUFFER_ACCESS_READ) {
- flags |= DRM_BO_FLAG_READ;
- mask |= DRM_BO_FLAG_READ;
- }
-
- intel_be_offset_relocation(intel->batch,
- delta,
- dri_bo(buf),
- flags,
- mask);
-}
-
-static void intel_i915_batch_flush(struct i915_winsys *sws,
- struct pipe_fence_handle **fence)
-{
- struct intel_be_context *intel = intel_be_context(sws);
-
- union {
- struct _DriFenceObject *dri;
- struct pipe_fence_handle *pipe;
- } fu;
-
- if (fence)
- assert(!*fence);
-
- fu.dri = intel_be_batchbuffer_flush(intel->batch);
-
- if (!fu.dri) {
- assert(0);
- *fence = NULL;
- return;
- }
-
- if (fu.dri) {
- if (fence)
- *fence = fu.pipe;
- else
- driFenceUnReference(&fu.dri);
- }
-
-}
-
-boolean
-intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *device)
-{
- assert(intel);
- assert(device);
-
- intel->device = device;
-
- /* TODO move framebuffer createion to the driver */
-
- intel->base.batch_get = intel_i915_batch_get;
- intel->base.batch_reloc = intel_i915_batch_reloc;
- intel->base.batch_flush = intel_i915_batch_flush;
-
- intel->batch = intel_be_batchbuffer_alloc(intel);
-
- return true;
-}
-
-void
-intel_be_destroy_context(struct intel_be_context *intel)
-{
- intel_be_batchbuffer_free(intel->batch);
-}
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_context.h b/src/gallium/winsys/drm/intel/common/intel_be_context.h
deleted file mode 100644
index d5cbc93594..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_context.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* These need to be diffrent from the intel winsys */
-#ifndef INTEL_BE_CONTEXT_H
-#define INTEL_BE_CONTEXT_H
-
-#include "i915simple/i915_winsys.h"
-
-struct intel_be_context
-{
- /** Interface to i915simple driver */
- struct i915_winsys base;
-
- struct intel_be_device *device;
- struct intel_be_batchbuffer *batch;
-
- /*
- * Hardware lock functions.
- *
- * Needs to be filled in by the winsys.
- */
- void (*hardware_lock)(struct intel_be_context *context);
- void (*hardware_unlock)(struct intel_be_context *context);
- boolean (*hardware_locked)(struct intel_be_context *context);
-};
-
-/**
- * Intialize a allocated intel_be_context struct.
- *
- * Remember to set the hardware_* functions.
- */
-boolean
-intel_be_init_context(struct intel_be_context *intel,
- struct intel_be_device *device);
-
-/**
- * Destroy a intel_be_context.
- * Does not free the struct that is up to the winsys.
- */
-void
-intel_be_destroy_context(struct intel_be_context *intel);
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_device.c b/src/gallium/winsys/drm/intel/common/intel_be_device.c
deleted file mode 100644
index 85ab1a2684..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_device.c
+++ /dev/null
@@ -1,296 +0,0 @@
-
-
-/*
- * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
- * Jakob Bornecrantz <jakob-at-tungstengraphics-dot-com>
- */
-
-#include "intel_be_device.h"
-#include "ws_dri_bufmgr.h"
-#include "ws_dri_bufpool.h"
-#include "ws_dri_fencemgr.h"
-
-#include "pipe/internal/p_winsys_screen.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_state.h"
-#include "pipe/p_inlines.h"
-#include "util/u_memory.h"
-
-#include "i915simple/i915_screen.h"
-
-/* Turn a pipe winsys into an intel/pipe winsys:
- */
-static INLINE struct intel_be_device *
-intel_be_device( struct pipe_winsys *winsys )
-{
- return (struct intel_be_device *)winsys;
-}
-
-
-/*
- * Buffer functions.
- *
- * Most callbacks map direcly onto dri_bufmgr operations:
- */
-
-static void *intel_be_buffer_map(struct pipe_winsys *winsys,
- struct pipe_buffer *buf,
- unsigned flags )
-{
- unsigned drm_flags = 0;
-
- if (flags & PIPE_BUFFER_USAGE_CPU_WRITE)
- drm_flags |= DRM_BO_FLAG_WRITE;
-
- if (flags & PIPE_BUFFER_USAGE_CPU_READ)
- drm_flags |= DRM_BO_FLAG_READ;
-
- return driBOMap( dri_bo(buf), drm_flags, 0 );
-}
-
-static void intel_be_buffer_unmap(struct pipe_winsys *winsys,
- struct pipe_buffer *buf)
-{
- driBOUnmap( dri_bo(buf) );
-}
-
-static void
-intel_be_buffer_destroy(struct pipe_winsys *winsys,
- struct pipe_buffer *buf)
-{
- driBOUnReference( dri_bo(buf) );
- FREE(buf);
-}
-
-static struct pipe_buffer *
-intel_be_buffer_create(struct pipe_winsys *winsys,
- unsigned alignment,
- unsigned usage,
- unsigned size )
-{
- struct intel_be_buffer *buffer = CALLOC_STRUCT( intel_be_buffer );
- struct intel_be_device *iws = intel_be_device(winsys);
- unsigned flags = 0;
- struct _DriBufferPool *pool;
-
- buffer->base.refcount = 1;
- buffer->base.alignment = alignment;
- buffer->base.usage = usage;
- buffer->base.size = size;
-
- if (usage & (PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_CONSTANT)) {
- flags |= DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
- pool = iws->mallocPool;
- } else if (usage & PIPE_BUFFER_USAGE_CUSTOM) {
- /* For vertex buffers */
- flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
- pool = iws->vertexPool;
- } else {
- flags |= DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT;
- pool = iws->regionPool;
- }
-
- if (usage & PIPE_BUFFER_USAGE_GPU_READ)
- flags |= DRM_BO_FLAG_READ;
-
- if (usage & PIPE_BUFFER_USAGE_GPU_WRITE)
- flags |= DRM_BO_FLAG_WRITE;
-
- /* drm complains if we don't set any read/write flags.
- */
- if ((flags & (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE)) == 0)
- flags |= DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
-
- buffer->pool = pool;
- driGenBuffers( buffer->pool,
- "pipe buffer", 1, &buffer->driBO, alignment, flags, 0 );
-
- driBOData( buffer->driBO, size, NULL, buffer->pool, 0 );
-
- return &buffer->base;
-}
-
-
-static struct pipe_buffer *
-intel_be_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes)
-{
- struct intel_be_buffer *buffer = CALLOC_STRUCT( intel_be_buffer );
- struct intel_be_device *iws = intel_be_device(winsys);
-
- driGenUserBuffer( iws->regionPool,
- "pipe user buffer", &buffer->driBO, ptr, bytes );
-
- buffer->base.refcount = 1;
-
- return &buffer->base;
-}
-
-struct pipe_buffer *
-intel_be_buffer_from_handle(struct intel_be_device *device,
- const char* name, unsigned handle)
-{
- struct intel_be_buffer *be_buf = malloc(sizeof(*be_buf));
- struct pipe_buffer *buffer;
-
- if (!be_buf)
- goto err;
-
- memset(be_buf, 0, sizeof(*be_buf));
-
- driGenBuffers(device->staticPool, name, 1, &be_buf->driBO, 0, 0, 0);
- driBOSetReferenced(be_buf->driBO, handle);
-
- if (0) /** XXX TODO check error */
- goto err_bo;
-
- buffer = &be_buf->base;
- buffer->refcount = 1;
- buffer->alignment = 0;
- buffer->usage = 0;
- buffer->size = driBOSize(be_buf->driBO);
-
- return buffer;
-err_bo:
- free(be_buf);
-err:
- return NULL;
-}
-
-
-static struct pipe_buffer *
-intel_i915_surface_buffer_create(struct pipe_winsys *winsys,
- unsigned width, unsigned height,
- enum pipe_format format,
- unsigned usage,
- unsigned *stride)
-{
- const unsigned alignment = 64;
- struct pipe_format_block block;
- unsigned nblocksx, nblocksy;
-
- pf_get_block(format, &block);
- nblocksx = pf_get_nblocksx(&block, width);
- nblocksy = pf_get_nblocksy(&block, height);
- *stride = round_up(nblocksx * block.size, alignment);
-
- return winsys->buffer_create(winsys, alignment,
- usage,
- *stride * nblocksy);
-}
-
-
-/*
- * Fence functions
- */
-
-static void
-intel_be_fence_reference( struct pipe_winsys *sws,
- struct pipe_fence_handle **ptr,
- struct pipe_fence_handle *fence )
-{
- if (*ptr)
- driFenceUnReference((struct _DriFenceObject **)ptr);
-
- if (fence)
- *ptr = (struct pipe_fence_handle *)driFenceReference((struct _DriFenceObject *)fence);
-}
-
-static int
-intel_be_fence_signalled( struct pipe_winsys *sws,
- struct pipe_fence_handle *fence,
- unsigned flag )
-{
- return driFenceSignaled((struct _DriFenceObject *)fence, flag);
-}
-
-static int
-intel_be_fence_finish( struct pipe_winsys *sws,
- struct pipe_fence_handle *fence,
- unsigned flag )
-{
- return driFenceFinish((struct _DriFenceObject *)fence, flag, 0);
-}
-
-
-/*
- * Misc functions
- */
-
-boolean
-intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id)
-{
- dev->fd = fd;
- dev->max_batch_size = 16 * 4096;
- dev->max_vertex_size = 128 * 4096;
-
- dev->base.buffer_create = intel_be_buffer_create;
- dev->base.user_buffer_create = intel_be_user_buffer_create;
- dev->base.buffer_map = intel_be_buffer_map;
- dev->base.buffer_unmap = intel_be_buffer_unmap;
- dev->base.buffer_destroy = intel_be_buffer_destroy;
- dev->base.surface_buffer_create = intel_i915_surface_buffer_create;
- dev->base.fence_reference = intel_be_fence_reference;
- dev->base.fence_signalled = intel_be_fence_signalled;
- dev->base.fence_finish = intel_be_fence_finish;
-
-#if 0 /* Set by the winsys */
- dev->base.flush_frontbuffer = intel_flush_frontbuffer;
- dev->base.get_name = intel_get_name;
-#endif
-
- dev->fMan = driInitFreeSlabManager(10, 10);
- dev->fenceMgr = driFenceMgrTTMInit(dev->fd);
-
- dev->mallocPool = driMallocPoolInit();
- dev->staticPool = driDRMPoolInit(dev->fd);
- /* Sizes: 64 128 256 512 1024 2048 4096 8192 16384 32768 */
- dev->regionPool = driSlabPoolInit(dev->fd,
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE |
- DRM_BO_FLAG_MEM_TT,
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE |
- DRM_BO_FLAG_MEM_TT,
- 64,
- 10, 120, 4096 * 64, 0,
- dev->fMan);
-
- dev->vertexPool = driSlabPoolInit(dev->fd,
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE |
- DRM_BO_FLAG_MEM_TT,
- DRM_BO_FLAG_READ |
- DRM_BO_FLAG_WRITE |
- DRM_BO_FLAG_MEM_TT,
- dev->max_vertex_size,
- 1, 120, dev->max_vertex_size * 4, 0,
- dev->fMan);
-
- dev->batchPool = driSlabPoolInit(dev->fd,
- DRM_BO_FLAG_EXE |
- DRM_BO_FLAG_MEM_TT,
- DRM_BO_FLAG_EXE |
- DRM_BO_FLAG_MEM_TT,
- dev->max_batch_size,
- 1, 40, dev->max_batch_size * 16, 0,
- dev->fMan);
-
- /* Fill in this struct with callbacks that i915simple will need to
- * communicate with the window system, buffer manager, etc.
- */
- dev->screen = i915_create_screen(&dev->base, id);
-
- return true;
-}
-
-void
-intel_be_destroy_device(struct intel_be_device *dev)
-{
- driPoolTakeDown(dev->mallocPool);
- driPoolTakeDown(dev->staticPool);
- driPoolTakeDown(dev->regionPool);
- driPoolTakeDown(dev->vertexPool);
- driPoolTakeDown(dev->batchPool);
-
- /** TODO takedown fenceMgr and fMan */
-}
diff --git a/src/gallium/winsys/drm/intel/common/intel_be_device.h b/src/gallium/winsys/drm/intel/common/intel_be_device.h
deleted file mode 100644
index 534d638b6a..0000000000
--- a/src/gallium/winsys/drm/intel/common/intel_be_device.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef INTEL_DRM_DEVICE_H
-#define INTEL_DRM_DEVICE_H
-
-#include "pipe/internal/p_winsys_screen.h"
-#include "pipe/p_context.h"
-
-/*
- * Device
- */
-
-struct intel_be_device
-{
- struct pipe_winsys base;
-
- /**
- * Hw level screen
- */
- struct pipe_screen *screen;
-
- int fd; /**< Drm file discriptor */
-
- size_t max_batch_size;
- size_t max_vertex_size;
-
- struct _DriFenceMgr *fenceMgr;
-
- struct _DriBufferPool *batchPool;
- struct _DriBufferPool *regionPool;
- struct _DriBufferPool *mallocPool;
- struct _DriBufferPool *vertexPool;
- struct _DriBufferPool *staticPool;
- struct _DriFreeSlabManager *fMan;
-};
-
-boolean
-intel_be_init_device(struct intel_be_device *device, int fd, unsigned id);
-
-void
-intel_be_destroy_device(struct intel_be_device *dev);
-
-/*
- * Buffer
- */
-
-struct intel_be_buffer {
- struct pipe_buffer base;
- struct _DriBufferPool *pool;
- struct _DriBufferObject *driBO;
-};
-
-/**
- * Create a be buffer from a drm bo handle
- *
- * Takes a reference
- */
-struct pipe_buffer *
-intel_be_buffer_from_handle(struct intel_be_device *device,
- const char* name, unsigned handle);
-
-static INLINE struct intel_be_buffer *
-intel_be_buffer(struct pipe_buffer *buf)
-{
- return (struct intel_be_buffer *)buf;
-}
-
-static INLINE struct _DriBufferObject *
-dri_bo(struct pipe_buffer *buf)
-{
- return intel_be_buffer(buf)->driBO;
-}
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c b/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c
deleted file mode 100644
index 517a97b3ee..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c
+++ /dev/null
@@ -1,949 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
- */
-
-#include <xf86drm.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "pipe/p_thread.h"
-#include "errno.h"
-#include "ws_dri_bufmgr.h"
-#include "string.h"
-#include "pipe/p_debug.h"
-#include "ws_dri_bufpool.h"
-#include "ws_dri_fencemgr.h"
-
-
-/*
- * This lock is here to protect drmBO structs changing underneath us during a
- * validate list call, since validatelist cannot take individiual locks for
- * each drmBO. Validatelist takes this lock in write mode. Any access to an
- * individual drmBO should take this lock in read mode, since in that case, the
- * driBufferObject mutex will protect the access. Locking order is
- * driBufferObject mutex - > this rw lock.
- */
-
-pipe_static_mutex(bmMutex);
-pipe_static_condvar(bmCond);
-
-static int kernelReaders = 0;
-static int num_buffers = 0;
-static int num_user_buffers = 0;
-
-static drmBO *drmBOListBuf(void *iterator)
-{
- drmBONode *node;
- drmMMListHead *l = (drmMMListHead *) iterator;
- node = DRMLISTENTRY(drmBONode, l, head);
- return node->buf;
-}
-
-static void *drmBOListIterator(drmBOList *list)
-{
- void *ret = list->list.next;
-
- if (ret == &list->list)
- return NULL;
- return ret;
-}
-
-static void *drmBOListNext(drmBOList *list, void *iterator)
-{
- void *ret;
-
- drmMMListHead *l = (drmMMListHead *) iterator;
- ret = l->next;
- if (ret == &list->list)
- return NULL;
- return ret;
-}
-
-static drmBONode *drmAddListItem(drmBOList *list, drmBO *item,
- uint64_t arg0,
- uint64_t arg1)
-{
- drmBONode *node;
- drmMMListHead *l;
-
- l = list->free.next;
- if (l == &list->free) {
- node = (drmBONode *) malloc(sizeof(*node));
- if (!node) {
- return NULL;
- }
- list->numCurrent++;
- }
- else {
- DRMLISTDEL(l);
- node = DRMLISTENTRY(drmBONode, l, head);
- }
- node->buf = item;
- node->arg0 = arg0;
- node->arg1 = arg1;
- DRMLISTADD(&node->head, &list->list);
- list->numOnList++;
- return node;
-}
-
-static int drmAddValidateItem(drmBOList *list, drmBO *buf, uint64_t flags,
- uint64_t mask, int *newItem)
-{
- drmBONode *node, *cur;
- drmMMListHead *l;
-
- *newItem = 0;
- cur = NULL;
-
- for (l = list->list.next; l != &list->list; l = l->next) {
- node = DRMLISTENTRY(drmBONode, l, head);
- if (node->buf == buf) {
- cur = node;
- break;
- }
- }
- if (!cur) {
- cur = drmAddListItem(list, buf, flags, mask);
- if (!cur) {
- return -ENOMEM;
- }
- *newItem = 1;
- cur->arg0 = flags;
- cur->arg1 = mask;
- }
- else {
- uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
- uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
-
- if (mask & cur->arg1 & ~DRM_BO_MASK_MEM & (cur->arg0 ^ flags)) {
- return -EINVAL;
- }
-
- cur->arg1 |= mask;
- cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
-
- if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
- (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
- return -EINVAL;
- }
- }
- return 0;
-}
-
-static void drmBOFreeList(drmBOList *list)
-{
- drmBONode *node;
- drmMMListHead *l;
-
- l = list->list.next;
- while(l != &list->list) {
- DRMLISTDEL(l);
- node = DRMLISTENTRY(drmBONode, l, head);
- free(node);
- l = list->list.next;
- list->numCurrent--;
- list->numOnList--;
- }
-
- l = list->free.next;
- while(l != &list->free) {
- DRMLISTDEL(l);
- node = DRMLISTENTRY(drmBONode, l, head);
- free(node);
- l = list->free.next;
- list->numCurrent--;
- }
-}
-
-static int drmAdjustListNodes(drmBOList *list)
-{
- drmBONode *node;
- drmMMListHead *l;
- int ret = 0;
-
- while(list->numCurrent < list->numTarget) {
- node = (drmBONode *) malloc(sizeof(*node));
- if (!node) {
- ret = -ENOMEM;
- break;
- }
- list->numCurrent++;
- DRMLISTADD(&node->head, &list->free);
- }
-
- while(list->numCurrent > list->numTarget) {
- l = list->free.next;
- if (l == &list->free)
- break;
- DRMLISTDEL(l);
- node = DRMLISTENTRY(drmBONode, l, head);
- free(node);
- list->numCurrent--;
- }
- return ret;
-}
-
-static int drmBOCreateList(int numTarget, drmBOList *list)
-{
- DRMINITLISTHEAD(&list->list);
- DRMINITLISTHEAD(&list->free);
- list->numTarget = numTarget;
- list->numCurrent = 0;
- list->numOnList = 0;
- return drmAdjustListNodes(list);
-}
-
-static int drmBOResetList(drmBOList *list)
-{
- drmMMListHead *l;
- int ret;
-
- ret = drmAdjustListNodes(list);
- if (ret)
- return ret;
-
- l = list->list.next;
- while (l != &list->list) {
- DRMLISTDEL(l);
- DRMLISTADD(l, &list->free);
- list->numOnList--;
- l = list->list.next;
- }
- return drmAdjustListNodes(list);
-}
-
-void driWriteLockKernelBO(void)
-{
- pipe_mutex_lock(bmMutex);
- while(kernelReaders != 0)
- pipe_condvar_wait(bmCond, bmMutex);
-}
-
-void driWriteUnlockKernelBO(void)
-{
- pipe_mutex_unlock(bmMutex);
-}
-
-void driReadLockKernelBO(void)
-{
- pipe_mutex_lock(bmMutex);
- kernelReaders++;
- pipe_mutex_unlock(bmMutex);
-}
-
-void driReadUnlockKernelBO(void)
-{
- pipe_mutex_lock(bmMutex);
- if (--kernelReaders == 0)
- pipe_condvar_broadcast(bmCond);
- pipe_mutex_unlock(bmMutex);
-}
-
-
-
-
-/*
- * TODO: Introduce fence pools in the same way as
- * buffer object pools.
- */
-
-typedef struct _DriBufferObject
-{
- DriBufferPool *pool;
- pipe_mutex mutex;
- int refCount;
- const char *name;
- uint64_t flags;
- unsigned hint;
- unsigned alignment;
- unsigned createdByReference;
- void *private;
- /* user-space buffer: */
- unsigned userBuffer;
- void *userData;
- unsigned userSize;
-} DriBufferObject;
-
-typedef struct _DriBufferList {
- drmBOList drmBuffers; /* List of kernel buffers needing validation */
- drmBOList driBuffers; /* List of user-space buffers needing validation */
-} DriBufferList;
-
-
-void
-bmError(int val, const char *file, const char *function, int line)
-{
- printf("Fatal video memory manager error \"%s\".\n"
- "Check kernel logs or set the LIBGL_DEBUG\n"
- "environment variable to \"verbose\" for more info.\n"
- "Detected in file %s, line %d, function %s.\n",
- strerror(-val), file, line, function);
-#ifndef NDEBUG
- abort();
-#else
- abort();
-#endif
-}
-
-extern drmBO *
-driBOKernel(struct _DriBufferObject *buf)
-{
- drmBO *ret;
-
- driReadLockKernelBO();
- pipe_mutex_lock(buf->mutex);
- assert(buf->private != NULL);
- ret = buf->pool->kernel(buf->pool, buf->private);
- if (!ret)
- BM_CKFATAL(-EINVAL);
- pipe_mutex_unlock(buf->mutex);
- driReadUnlockKernelBO();
-
- return ret;
-}
-
-void
-driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
-{
-
- /*
- * This function may block. Is it sane to keep the mutex held during
- * that time??
- */
-
- pipe_mutex_lock(buf->mutex);
- BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, &buf->mutex, lazy));
- pipe_mutex_unlock(buf->mutex);
-}
-
-void *
-driBOMap(struct _DriBufferObject *buf, unsigned flags, unsigned hint)
-{
- void *virtual;
- int retval;
-
- if (buf->userBuffer) {
- return buf->userData;
- }
-
- pipe_mutex_lock(buf->mutex);
- assert(buf->private != NULL);
- retval = buf->pool->map(buf->pool, buf->private, flags, hint,
- &buf->mutex, &virtual);
- pipe_mutex_unlock(buf->mutex);
-
- return retval == 0 ? virtual : NULL;
-}
-
-void
-driBOUnmap(struct _DriBufferObject *buf)
-{
- if (buf->userBuffer)
- return;
-
- assert(buf->private != NULL);
- pipe_mutex_lock(buf->mutex);
- BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
- pipe_mutex_unlock(buf->mutex);
-}
-
-unsigned long
-driBOOffset(struct _DriBufferObject *buf)
-{
- unsigned long ret;
-
- assert(buf->private != NULL);
-
- pipe_mutex_lock(buf->mutex);
- ret = buf->pool->offset(buf->pool, buf->private);
- pipe_mutex_unlock(buf->mutex);
- return ret;
-}
-
-unsigned long
-driBOPoolOffset(struct _DriBufferObject *buf)
-{
- unsigned long ret;
-
- assert(buf->private != NULL);
-
- pipe_mutex_lock(buf->mutex);
- ret = buf->pool->poolOffset(buf->pool, buf->private);
- pipe_mutex_unlock(buf->mutex);
- return ret;
-}
-
-uint64_t
-driBOFlags(struct _DriBufferObject *buf)
-{
- uint64_t ret;
-
- assert(buf->private != NULL);
-
- driReadLockKernelBO();
- pipe_mutex_lock(buf->mutex);
- ret = buf->pool->flags(buf->pool, buf->private);
- pipe_mutex_unlock(buf->mutex);
- driReadUnlockKernelBO();
- return ret;
-}
-
-struct _DriBufferObject *
-driBOReference(struct _DriBufferObject *buf)
-{
- pipe_mutex_lock(buf->mutex);
- if (++buf->refCount == 1) {
- pipe_mutex_unlock(buf->mutex);
- BM_CKFATAL(-EINVAL);
- }
- pipe_mutex_unlock(buf->mutex);
- return buf;
-}
-
-void
-driBOUnReference(struct _DriBufferObject *buf)
-{
- int tmp;
-
- if (!buf)
- return;
-
- pipe_mutex_lock(buf->mutex);
- tmp = --buf->refCount;
- if (!tmp) {
- pipe_mutex_unlock(buf->mutex);
- if (buf->private) {
- if (buf->createdByReference)
- buf->pool->unreference(buf->pool, buf->private);
- else
- buf->pool->destroy(buf->pool, buf->private);
- }
- if (buf->userBuffer)
- num_user_buffers--;
- else
- num_buffers--;
- free(buf);
- } else
- pipe_mutex_unlock(buf->mutex);
-
-}
-
-
-int
-driBOData(struct _DriBufferObject *buf,
- unsigned size, const void *data,
- DriBufferPool *newPool,
- uint64_t flags)
-{
- void *virtual = NULL;
- int newBuffer;
- int retval = 0;
- struct _DriBufferPool *pool;
-
- assert(!buf->userBuffer); /* XXX just do a memcpy? */
-
- pipe_mutex_lock(buf->mutex);
- pool = buf->pool;
-
- if (pool == NULL && newPool != NULL) {
- buf->pool = newPool;
- pool = newPool;
- }
- if (newPool == NULL)
- newPool = pool;
-
- if (!pool->create) {
- assert((size_t)"driBOData called on invalid buffer\n" & 0);
- BM_CKFATAL(-EINVAL);
- }
-
- newBuffer = (!buf->private || pool != newPool ||
- pool->size(pool, buf->private) < size);
-
- if (!flags)
- flags = buf->flags;
-
- if (newBuffer) {
-
- if (buf->createdByReference) {
- assert((size_t)"driBOData requiring resizing called on shared buffer.\n" & 0);
- BM_CKFATAL(-EINVAL);
- }
-
- if (buf->private)
- buf->pool->destroy(buf->pool, buf->private);
-
- pool = newPool;
- buf->pool = newPool;
- buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
- buf->alignment);
- if (!buf->private)
- retval = -ENOMEM;
-
- if (retval == 0)
- retval = pool->map(pool, buf->private,
- DRM_BO_FLAG_WRITE,
- DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual);
- } else if (pool->map(pool, buf->private, DRM_BO_FLAG_WRITE,
- DRM_BO_HINT_DONT_BLOCK, &buf->mutex, &virtual)) {
- /*
- * Buffer is busy. need to create a new one.
- */
-
- void *newBuf;
-
- newBuf = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
- buf->alignment);
- if (newBuf) {
- buf->pool->destroy(buf->pool, buf->private);
- buf->private = newBuf;
- }
-
- retval = pool->map(pool, buf->private,
- DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
- } else {
- uint64_t flag_diff = flags ^ buf->flags;
-
- /*
- * We might need to change buffer flags.
- */
-
- if (flag_diff){
- assert(pool->setStatus != NULL);
- BM_CKFATAL(pool->unmap(pool, buf->private));
- BM_CKFATAL(pool->setStatus(pool, buf->private, flag_diff,
- buf->flags));
- if (!data)
- goto out;
-
- retval = pool->map(pool, buf->private,
- DRM_BO_FLAG_WRITE, 0, &buf->mutex, &virtual);
- }
- }
-
- if (retval == 0) {
- if (data)
- memcpy(virtual, data, size);
-
- BM_CKFATAL(pool->unmap(pool, buf->private));
- }
-
- out:
- pipe_mutex_unlock(buf->mutex);
-
- return retval;
-}
-
-void
-driBOSubData(struct _DriBufferObject *buf,
- unsigned long offset, unsigned long size, const void *data)
-{
- void *virtual;
-
- assert(!buf->userBuffer); /* XXX just do a memcpy? */
-
- pipe_mutex_lock(buf->mutex);
- if (size && data) {
- BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
- DRM_BO_FLAG_WRITE, 0, &buf->mutex,
- &virtual));
- memcpy((unsigned char *) virtual + offset, data, size);
- BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
- }
- pipe_mutex_unlock(buf->mutex);
-}
-
-void
-driBOGetSubData(struct _DriBufferObject *buf,
- unsigned long offset, unsigned long size, void *data)
-{
- void *virtual;
-
- assert(!buf->userBuffer); /* XXX just do a memcpy? */
-
- pipe_mutex_lock(buf->mutex);
- if (size && data) {
- BM_CKFATAL(buf->pool->map(buf->pool, buf->private,
- DRM_BO_FLAG_READ, 0, &buf->mutex, &virtual));
- memcpy(data, (unsigned char *) virtual + offset, size);
- BM_CKFATAL(buf->pool->unmap(buf->pool, buf->private));
- }
- pipe_mutex_unlock(buf->mutex);
-}
-
-void
-driBOSetReferenced(struct _DriBufferObject *buf,
- unsigned long handle)
-{
- pipe_mutex_lock(buf->mutex);
- if (buf->private != NULL) {
- assert((size_t)"Invalid buffer for setReferenced\n" & 0);
- BM_CKFATAL(-EINVAL);
-
- }
- if (buf->pool->reference == NULL) {
- assert((size_t)"Invalid buffer pool for setReferenced\n" & 0);
- BM_CKFATAL(-EINVAL);
- }
- buf->private = buf->pool->reference(buf->pool, handle);
- if (!buf->private) {
- assert((size_t)"Invalid buffer pool for setStatic\n" & 0);
- BM_CKFATAL(-ENOMEM);
- }
- buf->createdByReference = TRUE;
- buf->flags = buf->pool->kernel(buf->pool, buf->private)->flags;
- pipe_mutex_unlock(buf->mutex);
-}
-
-int
-driGenBuffers(struct _DriBufferPool *pool,
- const char *name,
- unsigned n,
- struct _DriBufferObject *buffers[],
- unsigned alignment, uint64_t flags, unsigned hint)
-{
- struct _DriBufferObject *buf;
- int i;
-
- flags = (flags) ? flags : DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_VRAM |
- DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE;
-
- ++num_buffers;
-
- assert(pool);
-
- for (i = 0; i < n; ++i) {
- buf = (struct _DriBufferObject *) calloc(1, sizeof(*buf));
- if (!buf)
- return -ENOMEM;
-
- pipe_mutex_init(buf->mutex);
- pipe_mutex_lock(buf->mutex);
- buf->refCount = 1;
- buf->flags = flags;
- buf->hint = hint;
- buf->name = name;
- buf->alignment = alignment;
- buf->pool = pool;
- buf->createdByReference = 0;
- pipe_mutex_unlock(buf->mutex);
- buffers[i] = buf;
- }
- return 0;
-}
-
-void
-driGenUserBuffer(struct _DriBufferPool *pool,
- const char *name,
- struct _DriBufferObject **buffers,
- void *ptr, unsigned bytes)
-{
- const unsigned alignment = 1, flags = 0, hint = 0;
-
- --num_buffers; /* JB: is inced in GenBuffes */
- driGenBuffers(pool, name, 1, buffers, alignment, flags, hint);
- ++num_user_buffers;
-
- (*buffers)->userBuffer = 1;
- (*buffers)->userData = ptr;
- (*buffers)->userSize = bytes;
-}
-
-void
-driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[])
-{
- int i;
-
- for (i = 0; i < n; ++i) {
- driBOUnReference(buffers[i]);
- }
-}
-
-
-void
-driInitBufMgr(int fd)
-{
- ;
-}
-
-/*
- * Note that lists are per-context and don't need mutex protection.
- */
-
-struct _DriBufferList *
-driBOCreateList(int target)
-{
- struct _DriBufferList *list = calloc(sizeof(*list), 1);
-
- BM_CKFATAL(drmBOCreateList(target, &list->drmBuffers));
- BM_CKFATAL(drmBOCreateList(target, &list->driBuffers));
- return list;
-}
-
-int
-driBOResetList(struct _DriBufferList * list)
-{
- int ret;
- ret = drmBOResetList(&list->drmBuffers);
- if (ret)
- return ret;
- ret = drmBOResetList(&list->driBuffers);
- return ret;
-}
-
-void
-driBOFreeList(struct _DriBufferList * list)
-{
- drmBOFreeList(&list->drmBuffers);
- drmBOFreeList(&list->driBuffers);
- free(list);
-}
-
-
-/*
- * Copied from libdrm, because it is needed by driAddValidateItem.
- */
-
-static drmBONode *
-driAddListItem(drmBOList * list, drmBO * item,
- uint64_t arg0, uint64_t arg1)
-{
- drmBONode *node;
- drmMMListHead *l;
-
- l = list->free.next;
- if (l == &list->free) {
- node = (drmBONode *) malloc(sizeof(*node));
- if (!node) {
- return NULL;
- }
- list->numCurrent++;
- } else {
- DRMLISTDEL(l);
- node = DRMLISTENTRY(drmBONode, l, head);
- }
- memset(&node->bo_arg, 0, sizeof(node->bo_arg));
- node->buf = item;
- node->arg0 = arg0;
- node->arg1 = arg1;
- DRMLISTADDTAIL(&node->head, &list->list);
- list->numOnList++;
- return node;
-}
-
-/*
- * Slightly modified version compared to the libdrm version.
- * This one returns the list index of the buffer put on the list.
- */
-
-static int
-driAddValidateItem(drmBOList * list, drmBO * buf, uint64_t flags,
- uint64_t mask, int *itemLoc,
- struct _drmBONode **pnode)
-{
- drmBONode *node, *cur;
- drmMMListHead *l;
- int count = 0;
-
- cur = NULL;
-
- for (l = list->list.next; l != &list->list; l = l->next) {
- node = DRMLISTENTRY(drmBONode, l, head);
- if (node->buf == buf) {
- cur = node;
- break;
- }
- count++;
- }
- if (!cur) {
- cur = driAddListItem(list, buf, flags, mask);
- if (!cur)
- return -ENOMEM;
-
- cur->arg0 = flags;
- cur->arg1 = mask;
- } else {
- uint64_t memFlags = cur->arg0 & flags & DRM_BO_MASK_MEM;
- uint64_t accFlags = (cur->arg0 | flags) & ~DRM_BO_MASK_MEM;
-
- if (mask & cur->arg1 & ~DRM_BO_MASK_MEM & (cur->arg0 ^ flags)) {
- return -EINVAL;
- }
-
- cur->arg1 |= mask;
- cur->arg0 = (cur->arg0 & ~mask) | ((memFlags | accFlags) & mask);
-
- if (((cur->arg1 & DRM_BO_MASK_MEM) != 0) &&
- (cur->arg0 & DRM_BO_MASK_MEM) == 0) {
- return -EINVAL;
- }
- }
- *itemLoc = count;
- *pnode = cur;
- return 0;
-}
-
-
-void
-driBOAddListItem(struct _DriBufferList * list, struct _DriBufferObject *buf,
- uint64_t flags, uint64_t mask, int *itemLoc,
- struct _drmBONode **node)
-{
- int newItem;
-
- pipe_mutex_lock(buf->mutex);
- BM_CKFATAL(driAddValidateItem(&list->drmBuffers,
- buf->pool->kernel(buf->pool, buf->private),
- flags, mask, itemLoc, node));
- BM_CKFATAL(drmAddValidateItem(&list->driBuffers, (drmBO *) buf,
- flags, mask, &newItem));
- if (newItem)
- buf->refCount++;
-
- pipe_mutex_unlock(buf->mutex);
-}
-
-drmBOList *driGetdrmBOList(struct _DriBufferList *list)
-{
- driWriteLockKernelBO();
- return &list->drmBuffers;
-}
-
-void driPutdrmBOList(struct _DriBufferList *list)
-{
- driWriteUnlockKernelBO();
-}
-
-
-void
-driBOFence(struct _DriBufferObject *buf, struct _DriFenceObject *fence)
-{
- pipe_mutex_lock(buf->mutex);
- if (buf->pool->fence)
- BM_CKFATAL(buf->pool->fence(buf->pool, buf->private, fence));
- pipe_mutex_unlock(buf->mutex);
-
-}
-
-void
-driBOUnrefUserList(struct _DriBufferList *list)
-{
- struct _DriBufferObject *buf;
- void *curBuf;
-
- curBuf = drmBOListIterator(&list->driBuffers);
- while (curBuf) {
- buf = (struct _DriBufferObject *)drmBOListBuf(curBuf);
- driBOUnReference(buf);
- curBuf = drmBOListNext(&list->driBuffers, curBuf);
- }
-}
-
-struct _DriFenceObject *
-driBOFenceUserList(struct _DriFenceMgr *mgr,
- struct _DriBufferList *list, const char *name,
- drmFence *kFence)
-{
- struct _DriFenceObject *fence;
- struct _DriBufferObject *buf;
- void *curBuf;
-
- fence = driFenceCreate(mgr, kFence->fence_class, kFence->type,
- kFence, sizeof(*kFence));
- curBuf = drmBOListIterator(&list->driBuffers);
-
- /*
- * User-space fencing callbacks.
- */
-
- while (curBuf) {
- buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
- driBOFence(buf, fence);
- driBOUnReference(buf);
- curBuf = drmBOListNext(&list->driBuffers, curBuf);
- }
-
- driBOResetList(list);
- return fence;
-}
-
-void
-driBOValidateUserList(struct _DriBufferList * list)
-{
- void *curBuf;
- struct _DriBufferObject *buf;
-
- curBuf = drmBOListIterator(&list->driBuffers);
-
- /*
- * User-space validation callbacks.
- */
-
- while (curBuf) {
- buf = (struct _DriBufferObject *) drmBOListBuf(curBuf);
- pipe_mutex_lock(buf->mutex);
- if (buf->pool->validate)
- BM_CKFATAL(buf->pool->validate(buf->pool, buf->private, &buf->mutex));
- pipe_mutex_unlock(buf->mutex);
- curBuf = drmBOListNext(&list->driBuffers, curBuf);
- }
-}
-
-
-void
-driPoolTakeDown(struct _DriBufferPool *pool)
-{
- pool->takeDown(pool);
-
-}
-
-unsigned long
-driBOSize(struct _DriBufferObject *buf)
-{
- unsigned long size;
-
- pipe_mutex_lock(buf->mutex);
- size = buf->pool->size(buf->pool, buf->private);
- pipe_mutex_unlock(buf->mutex);
-
- return size;
-
-}
-
-drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list)
-{
- return &list->drmBuffers;
-}
-
-drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list)
-{
- return &list->driBuffers;
-}
-
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h b/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h
deleted file mode 100644
index e6c0cff0a0..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
- */
-
-#ifndef _PSB_BUFMGR_H_
-#define _PSB_BUFMGR_H_
-#include <xf86mm.h>
-#include "i915_drm.h"
-#include "ws_dri_fencemgr.h"
-
-typedef struct _drmBONode
-{
- drmMMListHead head;
- drmBO *buf;
- struct drm_i915_op_arg bo_arg;
- uint64_t arg0;
- uint64_t arg1;
-} drmBONode;
-
-typedef struct _drmBOList {
- unsigned numTarget;
- unsigned numCurrent;
- unsigned numOnList;
- drmMMListHead list;
- drmMMListHead free;
-} drmBOList;
-
-
-struct _DriFenceObject;
-struct _DriBufferObject;
-struct _DriBufferPool;
-struct _DriBufferList;
-
-/*
- * Return a pointer to the libdrm buffer object this DriBufferObject
- * uses.
- */
-
-extern drmBO *driBOKernel(struct _DriBufferObject *buf);
-extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags,
- unsigned hint);
-extern void driBOUnmap(struct _DriBufferObject *buf);
-extern unsigned long driBOOffset(struct _DriBufferObject *buf);
-extern unsigned long driBOPoolOffset(struct _DriBufferObject *buf);
-
-extern uint64_t driBOFlags(struct _DriBufferObject *buf);
-extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf);
-extern void driBOUnReference(struct _DriBufferObject *buf);
-
-extern int driBOData(struct _DriBufferObject *r_buf,
- unsigned size, const void *data,
- struct _DriBufferPool *pool, uint64_t flags);
-
-extern void driBOSubData(struct _DriBufferObject *buf,
- unsigned long offset, unsigned long size,
- const void *data);
-extern void driBOGetSubData(struct _DriBufferObject *buf,
- unsigned long offset, unsigned long size,
- void *data);
-extern int driGenBuffers(struct _DriBufferPool *pool,
- const char *name,
- unsigned n,
- struct _DriBufferObject *buffers[],
- unsigned alignment, uint64_t flags, unsigned hint);
-extern void driGenUserBuffer(struct _DriBufferPool *pool,
- const char *name,
- struct _DriBufferObject *buffers[],
- void *ptr, unsigned bytes);
-extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]);
-extern void driInitBufMgr(int fd);
-extern struct _DriBufferList *driBOCreateList(int target);
-extern int driBOResetList(struct _DriBufferList * list);
-extern void driBOAddListItem(struct _DriBufferList * list,
- struct _DriBufferObject *buf,
- uint64_t flags, uint64_t mask, int *itemLoc,
- struct _drmBONode **node);
-
-extern void driBOValidateList(int fd, struct _DriBufferList * list);
-extern void driBOFreeList(struct _DriBufferList * list);
-extern struct _DriFenceObject *driBOFenceUserList(struct _DriFenceMgr *mgr,
- struct _DriBufferList *list,
- const char *name,
- drmFence *kFence);
-extern void driBOUnrefUserList(struct _DriBufferList *list);
-extern void driBOValidateUserList(struct _DriBufferList * list);
-extern drmBOList *driGetdrmBOList(struct _DriBufferList *list);
-extern void driPutdrmBOList(struct _DriBufferList *list);
-
-extern void driBOFence(struct _DriBufferObject *buf,
- struct _DriFenceObject *fence);
-
-extern void driPoolTakeDown(struct _DriBufferPool *pool);
-extern void driBOSetReferenced(struct _DriBufferObject *buf,
- unsigned long handle);
-unsigned long driBOSize(struct _DriBufferObject *buf);
-extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy);
-extern void driPoolTakeDown(struct _DriBufferPool *pool);
-
-extern void driReadLockKernelBO(void);
-extern void driReadUnlockKernelBO(void);
-extern void driWriteLockKernelBO(void);
-extern void driWriteUnlockKernelBO(void);
-
-/*
- * For debugging purposes.
- */
-
-extern drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list);
-extern drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list);
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h b/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h
deleted file mode 100644
index ad3b6f3931..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- */
-
-#ifndef _PSB_BUFPOOL_H_
-#define _PSB_BUFPOOL_H_
-
-#include <xf86drm.h>
-#include "pipe/p_thread.h"
-struct _DriFenceObject;
-
-typedef struct _DriBufferPool
-{
- int fd;
- int (*map) (struct _DriBufferPool * pool, void *private,
- unsigned flags, int hint, pipe_mutex *mutex,
- void **virtual);
- int (*unmap) (struct _DriBufferPool * pool, void *private);
- int (*destroy) (struct _DriBufferPool * pool, void *private);
- unsigned long (*offset) (struct _DriBufferPool * pool, void *private);
- unsigned long (*poolOffset) (struct _DriBufferPool * pool, void *private);
- uint64_t (*flags) (struct _DriBufferPool * pool, void *private);
- unsigned long (*size) (struct _DriBufferPool * pool, void *private);
- void *(*create) (struct _DriBufferPool * pool, unsigned long size,
- uint64_t flags, unsigned hint, unsigned alignment);
- void *(*reference) (struct _DriBufferPool * pool, unsigned handle);
- int (*unreference) (struct _DriBufferPool * pool, void *private);
- int (*fence) (struct _DriBufferPool * pool, void *private,
- struct _DriFenceObject * fence);
- drmBO *(*kernel) (struct _DriBufferPool * pool, void *private);
- int (*validate) (struct _DriBufferPool * pool, void *private, pipe_mutex *mutex);
- int (*waitIdle) (struct _DriBufferPool *pool, void *private, pipe_mutex *mutex,
- int lazy);
- int (*setStatus) (struct _DriBufferPool *pool, void *private,
- uint64_t flag_diff, uint64_t old_flags);
- void (*takeDown) (struct _DriBufferPool * pool);
- void *data;
-} DriBufferPool;
-
-extern void bmError(int val, const char *file, const char *function,
- int line);
-#define BM_CKFATAL(val) \
- do{ \
- int tstVal = (val); \
- if (tstVal) \
- bmError(tstVal, __FILE__, __FUNCTION__, __LINE__); \
- } while(0);
-
-
-/*
- * Builtin pools.
- */
-
-/*
- * Kernel buffer objects. Size in multiples of page size. Page size aligned.
- */
-
-extern struct _DriBufferPool *driDRMPoolInit(int fd);
-extern struct _DriBufferPool *driMallocPoolInit(void);
-
-struct _DriFreeSlabManager;
-extern struct _DriBufferPool * driSlabPoolInit(int fd, uint64_t flags,
- uint64_t validMask,
- uint32_t smallestSize,
- uint32_t numSizes,
- uint32_t desiredNumBuffers,
- uint32_t maxSlabSize,
- uint32_t pageAlignment,
- struct _DriFreeSlabManager *fMan);
-extern void driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan);
-extern struct _DriFreeSlabManager *
-driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec);
-
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c
deleted file mode 100644
index 54618b1c82..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- */
-
-#include <xf86drm.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "ws_dri_bufpool.h"
-#include "ws_dri_bufmgr.h"
-#include "assert.h"
-
-/*
- * Buffer pool implementation using DRM buffer objects as DRI buffer objects.
- */
-
-static void *
-pool_create(struct _DriBufferPool *pool,
- unsigned long size, uint64_t flags, unsigned hint,
- unsigned alignment)
-{
- drmBO *buf = (drmBO *) malloc(sizeof(*buf));
- int ret;
- unsigned pageSize = getpagesize();
-
- if (!buf)
- return NULL;
-
- if ((alignment > pageSize) && (alignment % pageSize)) {
- free(buf);
- return NULL;
- }
-
- ret = drmBOCreate(pool->fd, size, alignment / pageSize,
- NULL,
- flags, hint, buf);
- if (ret) {
- free(buf);
- return NULL;
- }
-
- return (void *) buf;
-}
-
-static void *
-pool_reference(struct _DriBufferPool *pool, unsigned handle)
-{
- drmBO *buf = (drmBO *) malloc(sizeof(*buf));
- int ret;
-
- if (!buf)
- return NULL;
-
- ret = drmBOReference(pool->fd, handle, buf);
-
- if (ret) {
- free(buf);
- return NULL;
- }
-
- return (void *) buf;
-}
-
-static int
-pool_destroy(struct _DriBufferPool *pool, void *private)
-{
- int ret;
- drmBO *buf = (drmBO *) private;
- driReadLockKernelBO();
- ret = drmBOUnreference(pool->fd, buf);
- free(buf);
- driReadUnlockKernelBO();
- return ret;
-}
-
-static int
-pool_unreference(struct _DriBufferPool *pool, void *private)
-{
- int ret;
- drmBO *buf = (drmBO *) private;
- driReadLockKernelBO();
- ret = drmBOUnreference(pool->fd, buf);
- free(buf);
- driReadUnlockKernelBO();
- return ret;
-}
-
-static int
-pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
- int hint, pipe_mutex *mutex, void **virtual)
-{
- drmBO *buf = (drmBO *) private;
- int ret;
-
- driReadLockKernelBO();
- ret = drmBOMap(pool->fd, buf, flags, hint, virtual);
- driReadUnlockKernelBO();
- return ret;
-}
-
-static int
-pool_unmap(struct _DriBufferPool *pool, void *private)
-{
- drmBO *buf = (drmBO *) private;
- int ret;
-
- driReadLockKernelBO();
- ret = drmBOUnmap(pool->fd, buf);
- driReadUnlockKernelBO();
-
- return ret;
-}
-
-static unsigned long
-pool_offset(struct _DriBufferPool *pool, void *private)
-{
- drmBO *buf = (drmBO *) private;
- unsigned long offset;
-
- driReadLockKernelBO();
- assert(buf->flags & DRM_BO_FLAG_NO_MOVE);
- offset = buf->offset;
- driReadUnlockKernelBO();
-
- return buf->offset;
-}
-
-static unsigned long
-pool_poolOffset(struct _DriBufferPool *pool, void *private)
-{
- return 0;
-}
-
-static uint64_t
-pool_flags(struct _DriBufferPool *pool, void *private)
-{
- drmBO *buf = (drmBO *) private;
- uint64_t flags;
-
- driReadLockKernelBO();
- flags = buf->flags;
- driReadUnlockKernelBO();
-
- return flags;
-}
-
-
-static unsigned long
-pool_size(struct _DriBufferPool *pool, void *private)
-{
- drmBO *buf = (drmBO *) private;
- unsigned long size;
-
- driReadLockKernelBO();
- size = buf->size;
- driReadUnlockKernelBO();
-
- return buf->size;
-}
-
-static int
-pool_fence(struct _DriBufferPool *pool, void *private,
- struct _DriFenceObject *fence)
-{
- /*
- * Noop. The kernel handles all fencing.
- */
-
- return 0;
-}
-
-static drmBO *
-pool_kernel(struct _DriBufferPool *pool, void *private)
-{
- return (drmBO *) private;
-}
-
-static int
-pool_waitIdle(struct _DriBufferPool *pool, void *private, pipe_mutex *mutex,
- int lazy)
-{
- drmBO *buf = (drmBO *) private;
- int ret;
-
- driReadLockKernelBO();
- ret = drmBOWaitIdle(pool->fd, buf, (lazy) ? DRM_BO_HINT_WAIT_LAZY:0);
- driReadUnlockKernelBO();
-
- return ret;
-}
-
-
-static void
-pool_takedown(struct _DriBufferPool *pool)
-{
- free(pool);
-}
-
-/*static int
-pool_setStatus(struct _DriBufferPool *pool, void *private,
- uint64_t flag_diff, uint64_t old_flags)
-{
- drmBO *buf = (drmBO *) private;
- uint64_t new_flags = old_flags ^ flag_diff;
- int ret;
-
- driReadLockKernelBO();
- ret = drmBOSetStatus(pool->fd, buf, new_flags, flag_diff,
- 0, 0, 0);
- driReadUnlockKernelBO();
- return ret;
-}*/
-
-struct _DriBufferPool *
-driDRMPoolInit(int fd)
-{
- struct _DriBufferPool *pool;
-
- pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
-
- if (!pool)
- return NULL;
-
- pool->fd = fd;
- pool->map = &pool_map;
- pool->unmap = &pool_unmap;
- pool->destroy = &pool_destroy;
- pool->offset = &pool_offset;
- pool->poolOffset = &pool_poolOffset;
- pool->flags = &pool_flags;
- pool->size = &pool_size;
- pool->create = &pool_create;
- pool->fence = &pool_fence;
- pool->kernel = &pool_kernel;
- pool->validate = NULL;
- pool->waitIdle = &pool_waitIdle;
- pool->takeDown = &pool_takedown;
- pool->reference = &pool_reference;
- pool->unreference = &pool_unreference;
- pool->data = NULL;
- return pool;
-}
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c b/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c
deleted file mode 100644
index 831c75d30c..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c
+++ /dev/null
@@ -1,377 +0,0 @@
-#include "ws_dri_fencemgr.h"
-#include "pipe/p_thread.h"
-#include <xf86mm.h>
-#include <string.h>
-#include <unistd.h>
-
-/*
- * Note: Locking order is
- * _DriFenceObject::mutex
- * _DriFenceMgr::mutex
- */
-
-struct _DriFenceMgr {
- /*
- * Constant members. Need no mutex protection.
- */
- struct _DriFenceMgrCreateInfo info;
- void *private;
-
- /*
- * These members are protected by this->mutex
- */
- pipe_mutex mutex;
- int refCount;
- drmMMListHead *heads;
- int num_fences;
-};
-
-struct _DriFenceObject {
-
- /*
- * These members are constant and need no mutex protection.
- */
- struct _DriFenceMgr *mgr;
- uint32_t fence_class;
- uint32_t fence_type;
-
- /*
- * These members are protected by mgr->mutex.
- */
- drmMMListHead head;
- int refCount;
-
- /*
- * These members are protected by this->mutex.
- */
- pipe_mutex mutex;
- uint32_t signaled_type;
- void *private;
-};
-
-uint32_t
-driFenceType(struct _DriFenceObject *fence)
-{
- return fence->fence_type;
-}
-
-struct _DriFenceMgr *
-driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info)
-{
- struct _DriFenceMgr *tmp;
- uint32_t i;
-
- tmp = calloc(1, sizeof(*tmp));
- if (!tmp)
- return NULL;
-
- pipe_mutex_init(tmp->mutex);
- pipe_mutex_lock(tmp->mutex);
- tmp->refCount = 1;
- tmp->info = *info;
- tmp->num_fences = 0;
- tmp->heads = calloc(tmp->info.num_classes, sizeof(*tmp->heads));
- if (!tmp->heads)
- goto out_err;
-
- for (i=0; i<tmp->info.num_classes; ++i) {
- DRMINITLISTHEAD(&tmp->heads[i]);
- }
- pipe_mutex_unlock(tmp->mutex);
- return tmp;
-
- out_err:
- if (tmp)
- free(tmp);
- return NULL;
-}
-
-static void
-driFenceMgrUnrefUnlock(struct _DriFenceMgr **pMgr)
-{
- struct _DriFenceMgr *mgr = *pMgr;
-
- *pMgr = NULL;
- if (--mgr->refCount == 0)
- free(mgr);
- else
- pipe_mutex_unlock(mgr->mutex);
-}
-
-void
-driFenceMgrUnReference(struct _DriFenceMgr **pMgr)
-{
- pipe_mutex_lock((*pMgr)->mutex);
- driFenceMgrUnrefUnlock(pMgr);
-}
-
-static void
-driFenceUnReferenceLocked(struct _DriFenceObject **pFence)
-{
- struct _DriFenceObject *fence = *pFence;
- struct _DriFenceMgr *mgr = fence->mgr;
-
- *pFence = NULL;
- if (--fence->refCount == 0) {
- DRMLISTDELINIT(&fence->head);
- if (fence->private)
- mgr->info.unreference(mgr, &fence->private);
- --mgr->num_fences;
- fence->mgr = NULL;
- --mgr->refCount;
- free(fence);
-
- }
-}
-
-
-static void
-driSignalPreviousFencesLocked(struct _DriFenceMgr *mgr,
- drmMMListHead *list,
- uint32_t fence_class,
- uint32_t fence_type)
-{
- struct _DriFenceObject *entry;
- drmMMListHead *prev;
-
- while(list != &mgr->heads[fence_class]) {
- entry = DRMLISTENTRY(struct _DriFenceObject, list, head);
-
- /*
- * Up refcount so that entry doesn't disappear from under us
- * when we unlock-relock mgr to get the correct locking order.
- */
-
- ++entry->refCount;
- pipe_mutex_unlock(mgr->mutex);
- pipe_mutex_lock(entry->mutex);
- pipe_mutex_lock(mgr->mutex);
-
- prev = list->prev;
-
-
-
- if (list->prev == list) {
-
- /*
- * Somebody else removed the entry from the list.
- */
-
- pipe_mutex_unlock(entry->mutex);
- driFenceUnReferenceLocked(&entry);
- return;
- }
-
- entry->signaled_type |= (fence_type & entry->fence_type);
- if (entry->signaled_type == entry->fence_type) {
- DRMLISTDELINIT(list);
- mgr->info.unreference(mgr, &entry->private);
- }
- pipe_mutex_unlock(entry->mutex);
- driFenceUnReferenceLocked(&entry);
- list = prev;
- }
-}
-
-
-int
-driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
- int lazy_hint)
-{
- struct _DriFenceMgr *mgr = fence->mgr;
- int ret = 0;
-
- pipe_mutex_lock(fence->mutex);
-
- if ((fence->signaled_type & fence_type) == fence_type)
- goto out0;
-
- ret = mgr->info.finish(mgr, fence->private, fence_type, lazy_hint);
- if (ret)
- goto out0;
-
- pipe_mutex_lock(mgr->mutex);
- pipe_mutex_unlock(fence->mutex);
-
- driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
- fence_type);
- pipe_mutex_unlock(mgr->mutex);
- return 0;
-
- out0:
- pipe_mutex_unlock(fence->mutex);
- return ret;
-}
-
-uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence)
-{
- uint32_t ret;
-
- pipe_mutex_lock(fence->mutex);
- ret = fence->signaled_type;
- pipe_mutex_unlock(fence->mutex);
-
- return ret;
-}
-
-int
-driFenceSignaledType(struct _DriFenceObject *fence, uint32_t flush_type,
- uint32_t *signaled)
-{
- int ret = 0;
- struct _DriFenceMgr *mgr;
-
- pipe_mutex_lock(fence->mutex);
- mgr = fence->mgr;
- *signaled = fence->signaled_type;
- if ((fence->signaled_type & flush_type) == flush_type)
- goto out0;
-
- ret = mgr->info.signaled(mgr, fence->private, flush_type, signaled);
- if (ret) {
- *signaled = fence->signaled_type;
- goto out0;
- }
-
- if ((fence->signaled_type | *signaled) == fence->signaled_type)
- goto out0;
-
- pipe_mutex_lock(mgr->mutex);
- pipe_mutex_unlock(fence->mutex);
-
- driSignalPreviousFencesLocked(mgr, &fence->head, fence->fence_class,
- *signaled);
-
- pipe_mutex_unlock(mgr->mutex);
- return 0;
- out0:
- pipe_mutex_unlock(fence->mutex);
- return ret;
-}
-
-struct _DriFenceObject *
-driFenceReference(struct _DriFenceObject *fence)
-{
- pipe_mutex_lock(fence->mgr->mutex);
- ++fence->refCount;
- pipe_mutex_unlock(fence->mgr->mutex);
- return fence;
-}
-
-void
-driFenceUnReference(struct _DriFenceObject **pFence)
-{
- struct _DriFenceMgr *mgr;
-
- if (*pFence == NULL)
- return;
-
- mgr = (*pFence)->mgr;
- pipe_mutex_lock(mgr->mutex);
- ++mgr->refCount;
- driFenceUnReferenceLocked(pFence);
- driFenceMgrUnrefUnlock(&mgr);
-}
-
-struct _DriFenceObject
-*driFenceCreate(struct _DriFenceMgr *mgr, uint32_t fence_class,
- uint32_t fence_type, void *private, size_t private_size)
-{
- struct _DriFenceObject *fence;
- size_t fence_size = sizeof(*fence);
-
- if (private_size)
- fence_size = ((fence_size + 15) & ~15);
-
- fence = calloc(1, fence_size + private_size);
-
- if (!fence) {
- int ret = mgr->info.finish(mgr, private, fence_type, 0);
-
- if (ret)
- usleep(10000000);
-
- return NULL;
- }
-
- pipe_mutex_init(fence->mutex);
- pipe_mutex_lock(fence->mutex);
- pipe_mutex_lock(mgr->mutex);
- fence->refCount = 1;
- DRMLISTADDTAIL(&fence->head, &mgr->heads[fence_class]);
- fence->mgr = mgr;
- ++mgr->refCount;
- ++mgr->num_fences;
- pipe_mutex_unlock(mgr->mutex);
- fence->fence_class = fence_class;
- fence->fence_type = fence_type;
- fence->signaled_type = 0;
- fence->private = private;
- if (private_size) {
- fence->private = (void *)(((uint8_t *) fence) + fence_size);
- memcpy(fence->private, private, private_size);
- }
-
- pipe_mutex_unlock(fence->mutex);
- return fence;
-}
-
-
-static int
-tSignaled(struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
- uint32_t *signaled_type)
-{
- long fd = (long) mgr->private;
- int dummy;
- drmFence *fence = (drmFence *) private;
- int ret;
-
- *signaled_type = 0;
- ret = drmFenceSignaled((int) fd, fence, flush_type, &dummy);
- if (ret)
- return ret;
-
- *signaled_type = fence->signaled;
-
- return 0;
-}
-
-static int
-tFinish(struct _DriFenceMgr *mgr, void *private, uint32_t fence_type,
- int lazy_hint)
-{
- long fd = (long) mgr->private;
- unsigned flags = lazy_hint ? DRM_FENCE_FLAG_WAIT_LAZY : 0;
-
- return drmFenceWait((int)fd, flags, (drmFence *) private, fence_type);
-}
-
-static int
-tUnref(struct _DriFenceMgr *mgr, void **private)
-{
- long fd = (long) mgr->private;
- drmFence *fence = (drmFence *) *private;
- *private = NULL;
-
- return drmFenceUnreference(fd, fence);
-}
-
-struct _DriFenceMgr *driFenceMgrTTMInit(int fd)
-{
- struct _DriFenceMgrCreateInfo info;
- struct _DriFenceMgr *mgr;
-
- info.flags = DRI_FENCE_CLASS_ORDERED;
- info.num_classes = 4;
- info.signaled = tSignaled;
- info.finish = tFinish;
- info.unreference = tUnref;
-
- mgr = driFenceMgrCreate(&info);
- if (mgr == NULL)
- return NULL;
-
- mgr->private = (void *) (long) fd;
- return mgr;
-}
-
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h b/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h
deleted file mode 100644
index 4ea58dfe18..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef DRI_FENCEMGR_H
-#define DRI_FENCEMGR_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-struct _DriFenceObject;
-struct _DriFenceMgr;
-
-/*
- * Do a quick check to see if the fence manager has registered the fence
- * object as signaled. Note that this function may return a false negative
- * answer.
- */
-extern uint32_t driFenceSignaledTypeCached(struct _DriFenceObject *fence);
-
-/*
- * Check if the fence object is signaled. This function can be substantially
- * more expensive to call than the above function, but will not return a false
- * negative answer. The argument "flush_type" sets the types that the
- * underlying mechanism must make sure will eventually signal.
- */
-extern int driFenceSignaledType(struct _DriFenceObject *fence,
- uint32_t flush_type, uint32_t *signaled);
-
-/*
- * Convenience functions.
- */
-
-static inline int driFenceSignaled(struct _DriFenceObject *fence,
- uint32_t flush_type)
-{
- uint32_t signaled_types;
- int ret = driFenceSignaledType(fence, flush_type, &signaled_types);
- if (ret)
- return 0;
- return ((signaled_types & flush_type) == flush_type);
-}
-
-static inline int driFenceSignaledCached(struct _DriFenceObject *fence,
- uint32_t flush_type)
-{
- uint32_t signaled_types =
- driFenceSignaledTypeCached(fence);
-
- return ((signaled_types & flush_type) == flush_type);
-}
-
-/*
- * Reference a fence object.
- */
-extern struct _DriFenceObject *driFenceReference(struct _DriFenceObject *fence);
-
-/*
- * Unreference a fence object. The fence object pointer will be reset to NULL.
- */
-
-extern void driFenceUnReference(struct _DriFenceObject **pFence);
-
-
-/*
- * Wait for a fence to signal the indicated fence_type.
- * If "lazy_hint" is true, it indicates that the wait may sleep to avoid
- * busy-wait polling.
- */
-extern int driFenceFinish(struct _DriFenceObject *fence, uint32_t fence_type,
- int lazy_hint);
-
-/*
- * Create a DriFenceObject for manager "mgr".
- *
- * "private" is a pointer that should be used for the callbacks in
- * struct _DriFenceMgrCreateInfo.
- *
- * if private_size is nonzero, then the info stored at *private, with size
- * private size will be copied and the fence manager will instead use a
- * pointer to the copied data for the callbacks in
- * struct _DriFenceMgrCreateInfo. In that case, the object pointed to by
- * "private" may be destroyed after the call to driFenceCreate.
- */
-extern struct _DriFenceObject *driFenceCreate(struct _DriFenceMgr *mgr,
- uint32_t fence_class,
- uint32_t fence_type,
- void *private,
- size_t private_size);
-
-extern uint32_t driFenceType(struct _DriFenceObject *fence);
-
-/*
- * Fence creations are ordered. If a fence signals a fence_type,
- * it is safe to assume that all fences of the same class that was
- * created before that fence has signaled the same type.
- */
-
-#define DRI_FENCE_CLASS_ORDERED (1 << 0)
-
-struct _DriFenceMgrCreateInfo {
- uint32_t flags;
- uint32_t num_classes;
- int (*signaled) (struct _DriFenceMgr *mgr, void *private, uint32_t flush_type,
- uint32_t *signaled_type);
- int (*finish) (struct _DriFenceMgr *mgr, void *private, uint32_t fence_type, int lazy_hint);
- int (*unreference) (struct _DriFenceMgr *mgr, void **private);
-};
-
-extern struct _DriFenceMgr *
-driFenceMgrCreate(const struct _DriFenceMgrCreateInfo *info);
-
-void
-driFenceMgrUnReference(struct _DriFenceMgr **pMgr);
-
-extern struct _DriFenceMgr *
-driFenceMgrTTMInit(int fd);
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c
deleted file mode 100644
index 60924eac9e..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
- */
-
-#include <xf86drm.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "pipe/p_debug.h"
-#include "pipe/p_thread.h"
-#include "ws_dri_bufpool.h"
-#include "ws_dri_bufmgr.h"
-
-static void *
-pool_create(struct _DriBufferPool *pool,
- unsigned long size, uint64_t flags, unsigned hint,
- unsigned alignment)
-{
- unsigned long *private = malloc(size + 2*sizeof(unsigned long));
- if ((flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_LOCAL)
- abort();
-
- *private = size;
- return (void *)private;
-}
-
-
-static int
-pool_destroy(struct _DriBufferPool *pool, void *private)
-{
- free(private);
- return 0;
-}
-
-static int
-pool_waitIdle(struct _DriBufferPool *pool, void *private,
- pipe_mutex *mutex, int lazy)
-{
- return 0;
-}
-
-static int
-pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
- int hint, pipe_mutex *mutex, void **virtual)
-{
- *virtual = (void *)((unsigned long *)private + 2);
- return 0;
-}
-
-static int
-pool_unmap(struct _DriBufferPool *pool, void *private)
-{
- return 0;
-}
-
-static unsigned long
-pool_offset(struct _DriBufferPool *pool, void *private)
-{
- /*
- * BUG
- */
- abort();
- return 0UL;
-}
-
-static unsigned long
-pool_poolOffset(struct _DriBufferPool *pool, void *private)
-{
- /*
- * BUG
- */
- abort();
-}
-
-static uint64_t
-pool_flags(struct _DriBufferPool *pool, void *private)
-{
- return DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED;
-}
-
-static unsigned long
-pool_size(struct _DriBufferPool *pool, void *private)
-{
- return *(unsigned long *) private;
-}
-
-
-static int
-pool_fence(struct _DriBufferPool *pool, void *private,
- struct _DriFenceObject *fence)
-{
- abort();
- return 0UL;
-}
-
-static drmBO *
-pool_kernel(struct _DriBufferPool *pool, void *private)
-{
- abort();
- return NULL;
-}
-
-static void
-pool_takedown(struct _DriBufferPool *pool)
-{
- free(pool);
-}
-
-
-struct _DriBufferPool *
-driMallocPoolInit(void)
-{
- struct _DriBufferPool *pool;
-
- pool = (struct _DriBufferPool *) malloc(sizeof(*pool));
- if (!pool)
- return NULL;
-
- pool->data = NULL;
- pool->fd = -1;
- pool->map = &pool_map;
- pool->unmap = &pool_unmap;
- pool->destroy = &pool_destroy;
- pool->offset = &pool_offset;
- pool->poolOffset = &pool_poolOffset;
- pool->flags = &pool_flags;
- pool->size = &pool_size;
- pool->create = &pool_create;
- pool->fence = &pool_fence;
- pool->kernel = &pool_kernel;
- pool->validate = NULL;
- pool->waitIdle = &pool_waitIdle;
- pool->takeDown = &pool_takedown;
- return pool;
-}
diff --git a/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c b/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c
deleted file mode 100644
index 391cea50a7..0000000000
--- a/src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
- */
-
-#include <stdint.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <unistd.h>
-#include <assert.h>
-#include "ws_dri_bufpool.h"
-#include "ws_dri_fencemgr.h"
-#include "ws_dri_bufmgr.h"
-#include "pipe/p_thread.h"
-
-#define DRI_SLABPOOL_ALLOC_RETRIES 100
-
-struct _DriSlab;
-
-struct _DriSlabBuffer {
- int isSlabBuffer;
- drmBO *bo;
- struct _DriFenceObject *fence;
- struct _DriSlab *parent;
- drmMMListHead head;
- uint32_t mapCount;
- uint32_t start;
- uint32_t fenceType;
- int unFenced;
- pipe_condvar event;
-};
-
-struct _DriKernelBO {
- int fd;
- drmBO bo;
- drmMMListHead timeoutHead;
- drmMMListHead head;
- struct timeval timeFreed;
- uint32_t pageAlignment;
- void *virtual;
-};
-
-struct _DriSlab{
- drmMMListHead head;
- drmMMListHead freeBuffers;
- uint32_t numBuffers;
- uint32_t numFree;
- struct _DriSlabBuffer *buffers;
- struct _DriSlabSizeHeader *header;
- struct _DriKernelBO *kbo;
-};
-
-
-struct _DriSlabSizeHeader {
- drmMMListHead slabs;
- drmMMListHead freeSlabs;
- drmMMListHead delayedBuffers;
- uint32_t numDelayed;
- struct _DriSlabPool *slabPool;
- uint32_t bufSize;
- pipe_mutex mutex;
-};
-
-struct _DriFreeSlabManager {
- struct timeval slabTimeout;
- struct timeval checkInterval;
- struct timeval nextCheck;
- drmMMListHead timeoutList;
- drmMMListHead unCached;
- drmMMListHead cached;
- pipe_mutex mutex;
-};
-
-
-struct _DriSlabPool {
-
- /*
- * The data of this structure remains constant after
- * initialization and thus needs no mutex protection.
- */
-
- struct _DriFreeSlabManager *fMan;
- uint64_t proposedFlags;
- uint64_t validMask;
- uint32_t *bucketSizes;
- uint32_t numBuckets;
- uint32_t pageSize;
- int fd;
- int pageAlignment;
- int maxSlabSize;
- int desiredNumBuffers;
- struct _DriSlabSizeHeader *headers;
-};
-
-/*
- * FIXME: Perhaps arrange timeout slabs in size buckets for fast
- * retreival??
- */
-
-
-static inline int
-driTimeAfterEq(struct timeval *arg1, struct timeval *arg2)
-{
- return ((arg1->tv_sec > arg2->tv_sec) ||
- ((arg1->tv_sec == arg2->tv_sec) &&
- (arg1->tv_usec > arg2->tv_usec)));
-}
-
-static inline void
-driTimeAdd(struct timeval *arg, struct timeval *add)
-{
- unsigned int sec;
-
- arg->tv_sec += add->tv_sec;
- arg->tv_usec += add->tv_usec;
- sec = arg->tv_usec / 1000000;
- arg->tv_sec += sec;
- arg->tv_usec -= sec*1000000;
-}
-
-static void
-driFreeKernelBO(struct _DriKernelBO *kbo)
-{
- if (!kbo)
- return;
-
- (void) drmBOUnreference(kbo->fd, &kbo->bo);
- free(kbo);
-}
-
-
-static void
-driFreeTimeoutKBOsLocked(struct _DriFreeSlabManager *fMan,
- struct timeval *time)
-{
- drmMMListHead *list, *next;
- struct _DriKernelBO *kbo;
-
- if (!driTimeAfterEq(time, &fMan->nextCheck))
- return;
-
- for (list = fMan->timeoutList.next, next = list->next;
- list != &fMan->timeoutList;
- list = next, next = list->next) {
-
- kbo = DRMLISTENTRY(struct _DriKernelBO, list, timeoutHead);
-
- if (!driTimeAfterEq(time, &kbo->timeFreed))
- break;
-
- DRMLISTDELINIT(&kbo->timeoutHead);
- DRMLISTDELINIT(&kbo->head);
- driFreeKernelBO(kbo);
- }
-
- fMan->nextCheck = *time;
- driTimeAdd(&fMan->nextCheck, &fMan->checkInterval);
-}
-
-
-/*
- * Add a _DriKernelBO to the free slab manager.
- * This means that it is available for reuse, but if it's not
- * reused in a while, it will be freed.
- */
-
-static void
-driSetKernelBOFree(struct _DriFreeSlabManager *fMan,
- struct _DriKernelBO *kbo)
-{
- struct timeval time;
-
- pipe_mutex_lock(fMan->mutex);
- gettimeofday(&time, NULL);
- driTimeAdd(&time, &fMan->slabTimeout);
-
- kbo->timeFreed = time;
-
- if (kbo->bo.flags & DRM_BO_FLAG_CACHED)
- DRMLISTADD(&kbo->head, &fMan->cached);
- else
- DRMLISTADD(&kbo->head, &fMan->unCached);
-
- DRMLISTADDTAIL(&kbo->timeoutHead, &fMan->timeoutList);
- driFreeTimeoutKBOsLocked(fMan, &time);
-
- pipe_mutex_unlock(fMan->mutex);
-}
-
-/*
- * Get a _DriKernelBO for us to use as storage for a slab.
- *
- */
-
-static struct _DriKernelBO *
-driAllocKernelBO(struct _DriSlabSizeHeader *header)
-
-{
- struct _DriSlabPool *slabPool = header->slabPool;
- struct _DriFreeSlabManager *fMan = slabPool->fMan;
- drmMMListHead *list, *next, *head;
- uint32_t size = header->bufSize * slabPool->desiredNumBuffers;
- struct _DriKernelBO *kbo;
- struct _DriKernelBO *kboTmp;
- int ret;
-
- /*
- * FIXME: We should perhaps allow some variation in slabsize in order
- * to efficiently reuse slabs.
- */
-
- size = (size <= slabPool->maxSlabSize) ? size : slabPool->maxSlabSize;
- size = (size + slabPool->pageSize - 1) & ~(slabPool->pageSize - 1);
- pipe_mutex_lock(fMan->mutex);
-
- kbo = NULL;
-
- retry:
- head = (slabPool->proposedFlags & DRM_BO_FLAG_CACHED) ?
- &fMan->cached : &fMan->unCached;
-
- for (list = head->next, next = list->next;
- list != head;
- list = next, next = list->next) {
-
- kboTmp = DRMLISTENTRY(struct _DriKernelBO, list, head);
-
- if ((kboTmp->bo.size == size) &&
- (slabPool->pageAlignment == 0 ||
- (kboTmp->pageAlignment % slabPool->pageAlignment) == 0)) {
-
- if (!kbo)
- kbo = kboTmp;
-
- if ((kbo->bo.proposedFlags ^ slabPool->proposedFlags) == 0)
- break;
-
- }
- }
-
- if (kbo) {
- DRMLISTDELINIT(&kbo->head);
- DRMLISTDELINIT(&kbo->timeoutHead);
- }
-
- pipe_mutex_unlock(fMan->mutex);
-
- if (kbo) {
- uint64_t new_mask = kbo->bo.proposedFlags ^ slabPool->proposedFlags;
-
- ret = 0;
- if (new_mask) {
- ret = drmBOSetStatus(kbo->fd, &kbo->bo, slabPool->proposedFlags,
- new_mask, DRM_BO_HINT_DONT_FENCE, 0, 0);
- }
- if (ret == 0)
- return kbo;
-
- driFreeKernelBO(kbo);
- kbo = NULL;
- goto retry;
- }
-
- kbo = calloc(1, sizeof(struct _DriKernelBO));
- if (!kbo)
- return NULL;
-
- kbo->fd = slabPool->fd;
- DRMINITLISTHEAD(&kbo->head);
- DRMINITLISTHEAD(&kbo->timeoutHead);
- ret = drmBOCreate(kbo->fd, size, slabPool->pageAlignment, NULL,
- slabPool->proposedFlags,
- DRM_BO_HINT_DONT_FENCE, &kbo->bo);
- if (ret)
- goto out_err0;
-
- ret = drmBOMap(kbo->fd, &kbo->bo,
- DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
- 0, &kbo->virtual);
-
- if (ret)
- goto out_err1;
-
- ret = drmBOUnmap(kbo->fd, &kbo->bo);
- if (ret)
- goto out_err1;
-
- return kbo;
-
- out_err1:
- drmBOUnreference(kbo->fd, &kbo->bo);
- out_err0:
- free(kbo);
- return NULL;
-}
-
-
-static int
-driAllocSlab(struct _DriSlabSizeHeader *header)
-{
- struct _DriSlab *slab;
- struct _DriSlabBuffer *buf;
- uint32_t numBuffers;
- int ret;
- int i;
-
- slab = calloc(1, sizeof(*slab));
- if (!slab)
- return -ENOMEM;
-
- slab->kbo = driAllocKernelBO(header);
- if (!slab->kbo) {
- ret = -ENOMEM;
- goto out_err0;
- }
-
- numBuffers = slab->kbo->bo.size / header->bufSize;
-
- slab->buffers = calloc(numBuffers, sizeof(*slab->buffers));
- if (!slab->buffers) {
- ret = -ENOMEM;
- goto out_err1;
- }
-
- DRMINITLISTHEAD(&slab->head);
- DRMINITLISTHEAD(&slab->freeBuffers);
- slab->numBuffers = numBuffers;
- slab->numFree = 0;
- slab->header = header;
-
- buf = slab->buffers;
- for (i=0; i < numBuffers; ++i) {
- buf->parent = slab;
- buf->start = i* header->bufSize;
- buf->mapCount = 0;
- buf->isSlabBuffer = 1;
- pipe_condvar_init(buf->event);
- DRMLISTADDTAIL(&buf->head, &slab->freeBuffers);
- slab->numFree++;
- buf++;
- }
-
- DRMLISTADDTAIL(&slab->head, &header->slabs);
-
- return 0;
-
- out_err1:
- driSetKernelBOFree(header->slabPool->fMan, slab->kbo);
- free(slab->buffers);
- out_err0:
- free(slab);
- return ret;
-}
-
-/*
- * Delete a buffer from the slab header delayed list and put
- * it on the slab free list.
- */
-
-static void
-driSlabFreeBufferLocked(struct _DriSlabBuffer *buf)
-{
- struct _DriSlab *slab = buf->parent;
- struct _DriSlabSizeHeader *header = slab->header;
- drmMMListHead *list = &buf->head;
-
- DRMLISTDEL(list);
- DRMLISTADDTAIL(list, &slab->freeBuffers);
- slab->numFree++;
-
- if (slab->head.next == &slab->head)
- DRMLISTADDTAIL(&slab->head, &header->slabs);
-
- if (slab->numFree == slab->numBuffers) {
- list = &slab->head;
- DRMLISTDEL(list);
- DRMLISTADDTAIL(list, &header->freeSlabs);
- }
-
- if (header->slabs.next == &header->slabs ||
- slab->numFree != slab->numBuffers) {
-
- drmMMListHead *next;
- struct _DriFreeSlabManager *fMan = header->slabPool->fMan;
-
- for (list = header->freeSlabs.next, next = list->next;
- list != &header->freeSlabs;
- list = next, next = list->next) {
-
- slab = DRMLISTENTRY(struct _DriSlab, list, head);
-
- DRMLISTDELINIT(list);
- driSetKernelBOFree(fMan, slab->kbo);
- free(slab->buffers);
- free(slab);
- }
- }
-}
-
-static void
-driSlabCheckFreeLocked(struct _DriSlabSizeHeader *header, int wait)
-{
- drmMMListHead *list, *prev, *first;
- struct _DriSlabBuffer *buf;
- struct _DriSlab *slab;
- int firstWasSignaled = 1;
- int signaled;
- int i;
- int ret;
-
- /*
- * Rerun the freeing test if the youngest tested buffer
- * was signaled, since there might be more idle buffers
- * in the delay list.
- */
-
- while (firstWasSignaled) {
- firstWasSignaled = 0;
- signaled = 0;
- first = header->delayedBuffers.next;
-
- /* Only examine the oldest 1/3 of delayed buffers:
- */
- if (header->numDelayed > 3) {
- for (i = 0; i < header->numDelayed; i += 3) {
- first = first->next;
- }
- }
-
- for (list = first, prev = list->prev;
- list != &header->delayedBuffers;
- list = prev, prev = list->prev) {
- buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
- slab = buf->parent;
-
- if (!signaled) {
- if (wait) {
- ret = driFenceFinish(buf->fence, buf->fenceType, 0);
- if (ret)
- break;
- signaled = 1;
- wait = 0;
- } else {
- signaled = driFenceSignaled(buf->fence, buf->fenceType);
- }
- if (signaled) {
- if (list == first)
- firstWasSignaled = 1;
- driFenceUnReference(&buf->fence);
- header->numDelayed--;
- driSlabFreeBufferLocked(buf);
- }
- } else if (driFenceSignaledCached(buf->fence, buf->fenceType)) {
- driFenceUnReference(&buf->fence);
- header->numDelayed--;
- driSlabFreeBufferLocked(buf);
- }
- }
- }
-}
-
-
-static struct _DriSlabBuffer *
-driSlabAllocBuffer(struct _DriSlabSizeHeader *header)
-{
- static struct _DriSlabBuffer *buf;
- struct _DriSlab *slab;
- drmMMListHead *list;
- int count = DRI_SLABPOOL_ALLOC_RETRIES;
-
- pipe_mutex_lock(header->mutex);
- while(header->slabs.next == &header->slabs && count > 0) {
- driSlabCheckFreeLocked(header, 0);
- if (header->slabs.next != &header->slabs)
- break;
-
- pipe_mutex_unlock(header->mutex);
- if (count != DRI_SLABPOOL_ALLOC_RETRIES)
- usleep(1);
- pipe_mutex_lock(header->mutex);
- (void) driAllocSlab(header);
- count--;
- }
-
- list = header->slabs.next;
- if (list == &header->slabs) {
- pipe_mutex_unlock(header->mutex);
- return NULL;
- }
- slab = DRMLISTENTRY(struct _DriSlab, list, head);
- if (--slab->numFree == 0)
- DRMLISTDELINIT(list);
-
- list = slab->freeBuffers.next;
- DRMLISTDELINIT(list);
-
- pipe_mutex_unlock(header->mutex);
- buf = DRMLISTENTRY(struct _DriSlabBuffer, list, head);
- return buf;
-}
-
-static void *
-pool_create(struct _DriBufferPool *driPool, unsigned long size,
- uint64_t flags, unsigned hint, unsigned alignment)
-{
- struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
- struct _DriSlabSizeHeader *header;
- struct _DriSlabBuffer *buf;
- void *dummy;
- int i;
- int ret;
-
- /*
- * FIXME: Check for compatibility.
- */
-
- header = pool->headers;
- for (i=0; i<pool->numBuckets; ++i) {
- if (header->bufSize >= size)
- break;
- header++;
- }
-
- if (i < pool->numBuckets)
- return driSlabAllocBuffer(header);
-
-
- /*
- * Fall back to allocate a buffer object directly from DRM.
- * and wrap it in a driBO structure.
- */
-
-
- buf = calloc(1, sizeof(*buf));
-
- if (!buf)
- return NULL;
-
- buf->bo = calloc(1, sizeof(*buf->bo));
- if (!buf->bo)
- goto out_err0;
-
- if (alignment) {
- if ((alignment < pool->pageSize) && (pool->pageSize % alignment))
- goto out_err1;
- if ((alignment > pool->pageSize) && (alignment % pool->pageSize))
- goto out_err1;
- }
-
- ret = drmBOCreate(pool->fd, size, alignment / pool->pageSize, NULL,
- flags, hint, buf->bo);
- if (ret)
- goto out_err1;
-
- ret = drmBOMap(pool->fd, buf->bo, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
- 0, &dummy);
- if (ret)
- goto out_err2;
-
- ret = drmBOUnmap(pool->fd, buf->bo);
- if (ret)
- goto out_err2;
-
- return buf;
- out_err2:
- drmBOUnreference(pool->fd, buf->bo);
- out_err1:
- free(buf->bo);
- out_err0:
- free(buf);
- return NULL;
-}
-
-static int
-pool_destroy(struct _DriBufferPool *driPool, void *private)
-{
- struct _DriSlabBuffer *buf =
- (struct _DriSlabBuffer *) private;
- struct _DriSlab *slab;
- struct _DriSlabSizeHeader *header;
-
- if (!buf->isSlabBuffer) {
- struct _DriSlabPool *pool = (struct _DriSlabPool *) driPool->data;
- int ret;
-
- ret = drmBOUnreference(pool->fd, buf->bo);
- free(buf->bo);
- free(buf);
- return ret;
- }
-
- slab = buf->parent;
- header = slab->header;
-
- pipe_mutex_lock(header->mutex);
- buf->unFenced = 0;
- buf->mapCount = 0;
-
- if (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType)) {
- DRMLISTADDTAIL(&buf->head, &header->delayedBuffers);
- header->numDelayed++;
- } else {
- if (buf->fence)
- driFenceUnReference(&buf->fence);
- driSlabFreeBufferLocked(buf);
- }
-
- pipe_mutex_unlock(header->mutex);
- return 0;
-}
-
-static int
-pool_waitIdle(struct _DriBufferPool *driPool, void *private,
- pipe_mutex *mutex, int lazy)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- while(buf->unFenced)
- pipe_condvar_wait(buf->event, *mutex);
-
- if (!buf->fence)
- return 0;
-
- driFenceFinish(buf->fence, buf->fenceType, lazy);
- driFenceUnReference(&buf->fence);
-
- return 0;
-}
-
-static int
-pool_map(struct _DriBufferPool *pool, void *private, unsigned flags,
- int hint, pipe_mutex *mutex, void **virtual)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
- int busy;
-
- if (buf->isSlabBuffer)
- busy = buf->unFenced || (buf->fence && !driFenceSignaledCached(buf->fence, buf->fenceType));
- else
- busy = buf->fence && !driFenceSignaled(buf->fence, buf->fenceType);
-
-
- if (busy) {
- if (hint & DRM_BO_HINT_DONT_BLOCK)
- return -EBUSY;
- else {
- (void) pool_waitIdle(pool, private, mutex, 0);
- }
- }
-
- ++buf->mapCount;
- *virtual = (buf->isSlabBuffer) ?
- (void *) ((uint8_t *) buf->parent->kbo->virtual + buf->start) :
- (void *) buf->bo->virtual;
-
- return 0;
-}
-
-static int
-pool_unmap(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- --buf->mapCount;
- if (buf->mapCount == 0 && buf->isSlabBuffer)
- pipe_condvar_broadcast(buf->event);
-
- return 0;
-}
-
-static unsigned long
-pool_offset(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
- struct _DriSlab *slab;
- struct _DriSlabSizeHeader *header;
-
- if (!buf->isSlabBuffer) {
- assert(buf->bo->proposedFlags & DRM_BO_FLAG_NO_MOVE);
- return buf->bo->offset;
- }
-
- slab = buf->parent;
- header = slab->header;
-
- (void) header;
- assert(header->slabPool->proposedFlags & DRM_BO_FLAG_NO_MOVE);
- return slab->kbo->bo.offset + buf->start;
-}
-
-static unsigned long
-pool_poolOffset(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- return buf->start;
-}
-
-static uint64_t
-pool_flags(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- if (!buf->isSlabBuffer)
- return buf->bo->flags;
-
- return buf->parent->kbo->bo.flags;
-}
-
-static unsigned long
-pool_size(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
- if (!buf->isSlabBuffer)
- return buf->bo->size;
-
- return buf->parent->header->bufSize;
-}
-
-static int
-pool_fence(struct _DriBufferPool *pool, void *private,
- struct _DriFenceObject *fence)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
- drmBO *bo;
-
- if (buf->fence)
- driFenceUnReference(&buf->fence);
-
- buf->fence = driFenceReference(fence);
- bo = (buf->isSlabBuffer) ?
- &buf->parent->kbo->bo:
- buf->bo;
- buf->fenceType = bo->fenceFlags;
-
- buf->unFenced = 0;
- pipe_condvar_broadcast(buf->event);
-
- return 0;
-}
-
-static drmBO *
-pool_kernel(struct _DriBufferPool *pool, void *private)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- return (buf->isSlabBuffer) ? &buf->parent->kbo->bo : buf->bo;
-}
-
-static int
-pool_validate(struct _DriBufferPool *pool, void *private,
- pipe_mutex *mutex)
-{
- struct _DriSlabBuffer *buf = (struct _DriSlabBuffer *) private;
-
- if (!buf->isSlabBuffer)
- return 0;
-
- while(buf->mapCount != 0)
- pipe_condvar_wait(buf->event, *mutex);
-
- buf->unFenced = 1;
- return 0;
-}
-
-
-struct _DriFreeSlabManager *
-driInitFreeSlabManager(uint32_t checkIntervalMsec, uint32_t slabTimeoutMsec)
-{
- struct _DriFreeSlabManager *tmp;
-
- tmp = calloc(1, sizeof(*tmp));
- if (!tmp)
- return NULL;
-
- pipe_mutex_init(tmp->mutex);
- pipe_mutex_lock(tmp->mutex);
- tmp->slabTimeout.tv_usec = slabTimeoutMsec*1000;
- tmp->slabTimeout.tv_sec = tmp->slabTimeout.tv_usec / 1000000;
- tmp->slabTimeout.tv_usec -= tmp->slabTimeout.tv_sec*1000000;
-
- tmp->checkInterval.tv_usec = checkIntervalMsec*1000;
- tmp->checkInterval.tv_sec = tmp->checkInterval.tv_usec / 1000000;
- tmp->checkInterval.tv_usec -= tmp->checkInterval.tv_sec*1000000;
-
- gettimeofday(&tmp->nextCheck, NULL);
- driTimeAdd(&tmp->nextCheck, &tmp->checkInterval);
- DRMINITLISTHEAD(&tmp->timeoutList);
- DRMINITLISTHEAD(&tmp->unCached);
- DRMINITLISTHEAD(&tmp->cached);
- pipe_mutex_unlock(tmp->mutex);
-
- return tmp;
-}
-
-void
-driFinishFreeSlabManager(struct _DriFreeSlabManager *fMan)
-{
- struct timeval time;
-
- time = fMan->nextCheck;
- driTimeAdd(&time, &fMan->checkInterval);
-
- pipe_mutex_lock(fMan->mutex);
- driFreeTimeoutKBOsLocked(fMan, &time);
- pipe_mutex_unlock(fMan->mutex);
-
- assert(fMan->timeoutList.next == &fMan->timeoutList);
- assert(fMan->unCached.next == &fMan->unCached);
- assert(fMan->cached.next == &fMan->cached);
-
- free(fMan);
-}
-
-static void
-driInitSizeHeader(struct _DriSlabPool *pool, uint32_t size,
- struct _DriSlabSizeHeader *header)
-{
- pipe_mutex_init(header->mutex);
- pipe_mutex_lock(header->mutex);
-
- DRMINITLISTHEAD(&header->slabs);
- DRMINITLISTHEAD(&header->freeSlabs);
- DRMINITLISTHEAD(&header->delayedBuffers);
-
- header->numDelayed = 0;
- header->slabPool = pool;
- header->bufSize = size;
-
- pipe_mutex_unlock(header->mutex);
-}
-
-static void
-driFinishSizeHeader(struct _DriSlabSizeHeader *header)
-{
- drmMMListHead *list, *next;
- struct _DriSlabBuffer *buf;
-
- pipe_mutex_lock(header->mutex);
- for (list = header->delayedBuffers.next, next = list->next;
- list != &header->delayedBuffers;
- list = next, next = list->next) {
-
- buf = DRMLISTENTRY(struct _DriSlabBuffer, list , head);
- if (buf->fence) {
- (void) driFenceFinish(buf->fence, buf->fenceType, 0);
- driFenceUnReference(&buf->fence);
- }
- header->numDelayed--;
- driSlabFreeBufferLocked(buf);
- }
- pipe_mutex_unlock(header->mutex);
-}
-
-static void
-pool_takedown(struct _DriBufferPool *driPool)
-{
- struct _DriSlabPool *pool = driPool->data;
- int i;
-
- for (i=0; i<pool->numBuckets; ++i) {
- driFinishSizeHeader(&pool->headers[i]);
- }
-
- free(pool->headers);
- free(pool->bucketSizes);
- free(pool);
- free(driPool);
-}
-
-struct _DriBufferPool *
-driSlabPoolInit(int fd, uint64_t flags,
- uint64_t validMask,
- uint32_t smallestSize,
- uint32_t numSizes,
- uint32_t desiredNumBuffers,
- uint32_t maxSlabSize,
- uint32_t pageAlignment,
- struct _DriFreeSlabManager *fMan)
-{
- struct _DriBufferPool *driPool;
- struct _DriSlabPool *pool;
- uint32_t i;
-
- driPool = calloc(1, sizeof(*driPool));
- if (!driPool)
- return NULL;
-
- pool = calloc(1, sizeof(*pool));
- if (!pool)
- goto out_err0;
-
- pool->bucketSizes = calloc(numSizes, sizeof(*pool->bucketSizes));
- if (!pool->bucketSizes)
- goto out_err1;
-
- pool->headers = calloc(numSizes, sizeof(*pool->headers));
- if (!pool->headers)
- goto out_err2;
-
- pool->fMan = fMan;
- pool->proposedFlags = flags;
- pool->validMask = validMask;
- pool->numBuckets = numSizes;
- pool->pageSize = getpagesize();
- pool->fd = fd;
- pool->pageAlignment = pageAlignment;
- pool->maxSlabSize = maxSlabSize;
- pool->desiredNumBuffers = desiredNumBuffers;
-
- for (i=0; i<pool->numBuckets; ++i) {
- pool->bucketSizes[i] = (smallestSize << i);
- driInitSizeHeader(pool, pool->bucketSizes[i],
- &pool->headers[i]);
- }
-
- driPool->data = (void *) pool;
- driPool->map = &pool_map;
- driPool->unmap = &pool_unmap;
- driPool->destroy = &pool_destroy;
- driPool->offset = &pool_offset;
- driPool->poolOffset = &pool_poolOffset;
- driPool->flags = &pool_flags;
- driPool->size = &pool_size;
- driPool->create = &pool_create;
- driPool->fence = &pool_fence;
- driPool->kernel = &pool_kernel;
- driPool->validate = &pool_validate;
- driPool->waitIdle = &pool_waitIdle;
- driPool->takeDown = &pool_takedown;
-
- return driPool;
-
- out_err2:
- free(pool->bucketSizes);
- out_err1:
- free(pool);
- out_err0:
- free(driPool);
-
- return NULL;
-}
diff --git a/src/gallium/winsys/drm/intel/dri/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile
deleted file mode 100644
index 2046441a22..0000000000
--- a/src/gallium/winsys/drm/intel/dri/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-TOP = ../../../../../..
-include $(TOP)/configs/current
-
-LIBNAME = i915_dri.so
-LIBNAME_EGL = egl_i915_dri.so
-
-PIPE_DRIVERS = \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- ../common/libinteldrm.a \
- $(TOP)/src/gallium/drivers/i915simple/libi915simple.a
-
-
-DRIVER_SOURCES = \
- intel_winsys_softpipe.c \
- intel_swapbuffers.c \
- intel_context.c \
- intel_lock.c \
- intel_screen.c
-
-C_SOURCES = \
- $(COMMON_GALLIUM_SOURCES) \
- $(DRIVER_SOURCES)
-
-ASM_SOURCES =
-
-DRIVER_DEFINES = -I../common $(shell pkg-config libdrm --atleast-version=2.3.1 \
- && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
-
-include ../../Makefile.template
-
-#intel_tex_layout.o: $(TOP)/src/mesa/drivers/dri/intel/intel_tex_layout.c
-
-symlinks:
diff --git a/src/gallium/winsys/drm/intel/dri/SConscript b/src/gallium/winsys/drm/intel/dri/SConscript
deleted file mode 100644
index 6a4f50afcc..0000000000
--- a/src/gallium/winsys/drm/intel/dri/SConscript
+++ /dev/null
@@ -1,41 +0,0 @@
-Import('*')
-
-if 'mesa' in env['statetrackers']:
-
- env = drienv.Clone()
-
- env.Append(CPPPATH = [
- '../intel',
- 'server'
- ])
-
- #MINIGLX_SOURCES = server/intel_dri.c
-
- DRIVER_SOURCES = [
- 'intel_winsys_pipe.c',
- 'intel_winsys_softpipe.c',
- 'intel_winsys_i915.c',
- 'intel_batchbuffer.c',
- 'intel_swapbuffers.c',
- 'intel_context.c',
- 'intel_lock.c',
- 'intel_screen.c',
- 'intel_batchpool.c',
- ]
-
- sources = \
- COMMON_GALLIUM_SOURCES + \
- COMMON_BM_SOURCES + \
- DRIVER_SOURCES
-
- drivers = [
- softpipe,
- i915simple
- ]
-
- # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
- env.SharedLibrary(
- target ='i915tex_dri.so',
- source = sources,
- LIBS = drivers + mesa + auxiliaries + env['LIBS'],
- )
diff --git a/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h b/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h
deleted file mode 100644
index 3e95326168..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef INTEL_BATCHBUFFER_H
-#define INTEL_BATCHBUFFER_H
-
-#include "intel_be_batchbuffer.h"
-
-/*
- * Need to redefine the BATCH defines
- */
-
-#undef BEGIN_BATCH
-#define BEGIN_BATCH(dwords, relocs) \
- (i915_batchbuffer_check(&intel->base.batch->base, dwords, relocs))
-
-#undef OUT_BATCH
-#define OUT_BATCH(d) \
- i915_batchbuffer_dword(&intel->base.batch->base, d)
-
-#undef OUT_RELOC
-#define OUT_RELOC(buf,flags,mask,delta) do { \
- assert((delta) >= 0); \
- intel_be_offset_relocation(intel->base.batch, delta, buf, flags, mask); \
-} while (0)
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/dri/intel_context.c b/src/gallium/winsys/drm/intel/dri/intel_context.c
deleted file mode 100644
index 97ef731aaa..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_context.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "i830_dri.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_swapbuffers.h"
-#include "intel_batchbuffer.h"
-#include "intel_winsys_softpipe.h"
-
-#include "i915simple/i915_screen.h"
-
-#include "state_tracker/st_public.h"
-#include "state_tracker/st_context.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_context.h"
-
-#include "utils.h"
-
-
-#ifdef DEBUG
-int __intel_debug = 0;
-#endif
-
-
-#define need_GL_ARB_multisample
-#define need_GL_ARB_point_parameters
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_ARB_vertex_program
-#define need_GL_ARB_window_pos
-#define need_GL_EXT_blend_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_cull_vertex
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_framebuffer_object
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_secondary_color
-#define need_GL_NV_vertex_program
-#include "extension_helper.h"
-
-
-/**
- * Extension strings exported by the intel driver.
- *
- * \note
- * It appears that ARB_texture_env_crossbar has "disappeared" compared to the
- * old i830-specific driver.
- */
-const struct dri_extension card_extensions[] = {
- {"GL_ARB_multisample", GL_ARB_multisample_functions},
- {"GL_ARB_multitexture", NULL},
- {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
- {"GL_ARB_texture_border_clamp", NULL},
- {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
- {"GL_ARB_texture_cube_map", NULL},
- {"GL_ARB_texture_env_add", NULL},
- {"GL_ARB_texture_env_combine", NULL},
- {"GL_ARB_texture_env_dot3", NULL},
- {"GL_ARB_texture_mirrored_repeat", NULL},
- {"GL_ARB_texture_rectangle", NULL},
- {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
- {"GL_ARB_pixel_buffer_object", NULL},
- {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
- {"GL_ARB_window_pos", GL_ARB_window_pos_functions},
- {"GL_EXT_blend_color", GL_EXT_blend_color_functions},
- {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
- {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
- {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
- {"GL_EXT_blend_subtract", NULL},
- {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
- {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
- {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
- {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
- {"GL_EXT_packed_depth_stencil", NULL},
- {"GL_EXT_pixel_buffer_object", NULL},
- {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
- {"GL_EXT_stencil_wrap", NULL},
- {"GL_EXT_texture_edge_clamp", NULL},
- {"GL_EXT_texture_env_combine", NULL},
- {"GL_EXT_texture_env_dot3", NULL},
- {"GL_EXT_texture_filter_anisotropic", NULL},
- {"GL_EXT_texture_lod_bias", NULL},
- {"GL_3DFX_texture_compression_FXT1", NULL},
- {"GL_APPLE_client_storage", NULL},
- {"GL_MESA_pack_invert", NULL},
- {"GL_MESA_ycbcr_texture", NULL},
- {"GL_NV_blend_square", NULL},
- {"GL_NV_vertex_program", GL_NV_vertex_program_functions},
- {"GL_NV_vertex_program1_1", NULL},
- {"GL_SGIS_generate_mipmap", NULL },
- {NULL, NULL}
-};
-
-
-
-#ifdef DEBUG
-static const struct dri_debug_control debug_control[] = {
- {"ioctl", DEBUG_IOCTL},
- {"bat", DEBUG_BATCH},
- {"lock", DEBUG_LOCK},
- {"swap", DEBUG_SWAP},
- {NULL, 0}
-};
-#endif
-
-
-
-static void
-intel_lock_hardware(struct intel_be_context *context)
-{
- struct intel_context *intel = (struct intel_context *)context;
- LOCK_HARDWARE(intel);
-}
-
-static void
-intel_unlock_hardware(struct intel_be_context *context)
-{
- struct intel_context *intel = (struct intel_context *)context;
- UNLOCK_HARDWARE(intel);
-}
-
-static boolean
-intel_locked_hardware(struct intel_be_context *context)
-{
- struct intel_context *intel = (struct intel_context *)context;
- return intel->locked ? TRUE : FALSE;
-}
-
-GLboolean
-intelCreateContext(const __GLcontextModes * visual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate)
-{
- struct intel_context *intel = CALLOC_STRUCT(intel_context);
- __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- struct intel_screen *intelScreen = intel_screen(sPriv);
- drmI830Sarea *saPriv = intelScreen->sarea;
- int fthrottle_mode;
- GLboolean havePools;
- struct pipe_context *pipe;
- struct st_context *st_share = NULL;
-
- if (sharedContextPrivate) {
- st_share = ((struct intel_context *) sharedContextPrivate)->st;
- }
-
- driContextPriv->driverPrivate = intel;
- intel->intelScreen = intelScreen;
- intel->driScreen = sPriv;
- intel->sarea = saPriv;
-
- driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
- intel->driScreen->myNum, "i915");
-
-
- /*
- * memory pools
- */
- DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
- // ZZZ JB should be per screen and not be done per context
- havePools = intelCreatePools(sPriv);
- DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
- if (!havePools)
- return GL_FALSE;
-
-
- /* Dri stuff */
- intel->hHWContext = driContextPriv->hHWContext;
- intel->driFd = sPriv->fd;
- intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock;
-
- fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode");
- intel->iw.irq_seq = -1;
- intel->irqsEmitted = 0;
-
- intel->last_swap_fence = NULL;
- intel->first_swap_fence = NULL;
-
-#ifdef DEBUG
- __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
-#endif
- intel->base.hardware_lock = intel_lock_hardware;
- intel->base.hardware_unlock = intel_unlock_hardware;
- intel->base.hardware_locked = intel_locked_hardware;
-
- intel_be_init_context(&intel->base, &intelScreen->base);
-
- /*
- * Pipe-related setup
- */
- if (getenv("INTEL_SP")) {
- /* use softpipe driver instead of hw */
- pipe = intel_create_softpipe( intel, &intelScreen->base.base );
- }
- else {
- switch (intel->intelScreen->deviceID) {
- case PCI_CHIP_I945_G:
- case PCI_CHIP_I945_GM:
- case PCI_CHIP_I945_GME:
- case PCI_CHIP_G33_G:
- case PCI_CHIP_Q33_G:
- case PCI_CHIP_Q35_G:
- case PCI_CHIP_I915_G:
- case PCI_CHIP_I915_GM:
- pipe = i915_create_context(intelScreen->base.screen,
- &intelScreen->base.base,
- &intel->base.base);
- break;
- default:
- fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n",
- intel->intelScreen->deviceID, __FUNCTION__);
-
- pipe = intel_create_softpipe( intel, &intelScreen->base.base );
- break;
- }
- }
-
- pipe->priv = intel;
-
- intel->st = st_create_context(pipe, visual, st_share);
-
- driInitExtensions( intel->st->ctx, card_extensions, GL_TRUE );
-
- return GL_TRUE;
-}
-
-
-void
-intelDestroyContext(__DRIcontextPrivate * driContextPriv)
-{
- struct intel_context *intel = intel_context(driContextPriv);
-
- assert(intel); /* should never be null */
- if (intel) {
- st_finish(intel->st);
-
- if (intel->last_swap_fence) {
- driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
- driFenceUnReference(&intel->last_swap_fence);
- intel->last_swap_fence = NULL;
- }
- if (intel->first_swap_fence) {
- driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
- driFenceUnReference(&intel->first_swap_fence);
- intel->first_swap_fence = NULL;
- }
-
- if (intel->intelScreen->dummyContext == intel)
- intel->intelScreen->dummyContext = NULL;
-
- st_destroy_context(intel->st);
- intel_be_destroy_context(&intel->base);
- free(intel);
- }
-}
-
-
-GLboolean
-intelUnbindContext(__DRIcontextPrivate * driContextPriv)
-{
- struct intel_context *intel = intel_context(driContextPriv);
- st_flush(intel->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- /* XXX make_current(NULL)? */
- return GL_TRUE;
-}
-
-
-GLboolean
-intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
- __DRIdrawablePrivate * driDrawPriv,
- __DRIdrawablePrivate * driReadPriv)
-{
- if (driContextPriv) {
- struct intel_context *intel = intel_context(driContextPriv);
- struct intel_framebuffer *draw_fb = intel_framebuffer(driDrawPriv);
- struct intel_framebuffer *read_fb = intel_framebuffer(driReadPriv);
-
- assert(draw_fb->stfb);
- assert(read_fb->stfb);
-
- /* This is for situations in which we need a rendering context but
- * there may not be any currently bound.
- */
- intel->intelScreen->dummyContext = intel;
-
- st_make_current(intel->st, draw_fb->stfb, read_fb->stfb);
-
- if ((intel->driDrawable != driDrawPriv) ||
- (intel->lastStamp != driDrawPriv->lastStamp)) {
- intel->driDrawable = driDrawPriv;
- intelUpdateWindowSize(driDrawPriv);
- intel->lastStamp = driDrawPriv->lastStamp;
- }
-
- /* The size of the draw buffer will have been updated above.
- * If the readbuffer is a different window, check/update its size now.
- */
- if (driReadPriv != driDrawPriv) {
- intelUpdateWindowSize(driReadPriv);
- }
-
- }
- else {
- st_make_current(NULL, NULL, NULL);
- }
-
- return GL_TRUE;
-}
diff --git a/src/gallium/winsys/drm/intel/dri/intel_context.h b/src/gallium/winsys/drm/intel/dri/intel_context.h
deleted file mode 100644
index 5d22a422af..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_context.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef INTEL_CONTEXT_H
-#define INTEL_CONTEXT_H
-
-#include <stdint.h>
-#include "drm.h"
-
-#include "pipe/p_debug.h"
-
-#include "intel_screen.h"
-#include "i915_drm.h"
-
-#include "intel_be_context.h"
-
-
-struct pipe_context;
-struct intel_context;
-struct _DriBufferObject;
-struct st_context;
-
-
-#define INTEL_MAX_FIXUP 64
-
-/**
- * Intel rendering context, contains a state tracker and intel-specific info.
- */
-struct intel_context
-{
- struct intel_be_context base;
- struct st_context *st;
-
- struct _DriFenceObject *last_swap_fence;
- struct _DriFenceObject *first_swap_fence;
-
-// struct intel_batchbuffer *batch;
-
- boolean locked;
- char *prevLockFile;
- int prevLockLine;
-
- uint irqsEmitted;
- drm_i915_irq_wait_t iw;
-
- drm_context_t hHWContext;
- drmLock *driHwLock;
- int driFd;
-
- __DRIdrawablePrivate *driDrawable;
- __DRIscreenPrivate *driScreen;
- struct intel_screen *intelScreen;
- drmI830Sarea *sarea;
-
- uint lastStamp;
-
- /**
- * Configuration cache
- */
- driOptionCache optionCache;
-};
-
-
-
-/**
- * Intel framebuffer.
- */
-struct intel_framebuffer
-{
- struct st_framebuffer *stfb;
-
- /* other fields TBD */
- int other;
-};
-
-
-
-
-/* These are functions now:
- */
-void LOCK_HARDWARE( struct intel_context *intel );
-void UNLOCK_HARDWARE( struct intel_context *intel );
-
-extern char *__progname;
-
-
-
-/* ================================================================
- * Debugging:
- */
-#ifdef DEBUG
-extern int __intel_debug;
-
-#define DEBUG_SWAP 0x1
-#define DEBUG_LOCK 0x2
-#define DEBUG_IOCTL 0x4
-#define DEBUG_BATCH 0x8
-
-#define DBG(flag, ...) do { \
- if (__intel_debug & (DEBUG_##flag)) \
- printf(__VA_ARGS__); \
-} while(0)
-
-#else
-#define DBG(flag, ...)
-#endif
-
-
-
-#define PCI_CHIP_845_G 0x2562
-#define PCI_CHIP_I830_M 0x3577
-#define PCI_CHIP_I855_GM 0x3582
-#define PCI_CHIP_I865_G 0x2572
-#define PCI_CHIP_I915_G 0x2582
-#define PCI_CHIP_I915_GM 0x2592
-#define PCI_CHIP_I945_G 0x2772
-#define PCI_CHIP_I945_GM 0x27A2
-#define PCI_CHIP_I945_GME 0x27AE
-#define PCI_CHIP_G33_G 0x29C2
-#define PCI_CHIP_Q35_G 0x29B2
-#define PCI_CHIP_Q33_G 0x29D2
-
-
-/** Cast wrapper */
-static INLINE struct intel_context *
-intel_context(__DRIcontextPrivate *driContextPriv)
-{
- return (struct intel_context *) driContextPriv->driverPrivate;
-}
-
-
-/** Cast wrapper */
-static INLINE struct intel_framebuffer *
-intel_framebuffer(__DRIdrawablePrivate * driDrawPriv)
-{
- return (struct intel_framebuffer *) driDrawPriv->driverPrivate;
-}
-
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/dri/intel_lock.c b/src/gallium/winsys/drm/intel/dri/intel_lock.c
deleted file mode 100644
index ad1c202429..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_lock.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "main/glheader.h"
-#include "pipe/p_thread.h"
-#include <GL/internal/glcore.h>
-#include "state_tracker/st_public.h"
-#include "intel_context.h"
-#include "i830_dri.h"
-
-
-
-pipe_static_mutex( lockMutex );
-
-
-static void
-intelContendedLock(struct intel_context *intel, uint flags)
-{
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- __DRIscreenPrivate *sPriv = intel->driScreen;
- struct intel_screen *intelScreen = intel_screen(sPriv);
- drmI830Sarea *sarea = intel->sarea;
-
- drmGetLock(intel->driFd, intel->hHWContext, flags);
-
- DBG(LOCK, "%s - got contended lock\n", __progname);
-
- /* If the window moved, may need to set a new cliprect now.
- *
- * NOTE: This releases and regains the hw lock, so all state
- * checking must be done *after* this call:
- */
- if (dPriv)
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
- if (sarea->width != intelScreen->front.width ||
- sarea->height != intelScreen->front.height) {
-
- intelUpdateScreenRotation(sPriv, sarea);
- }
-}
-
-
-/* Lock the hardware and validate our state.
- */
-void LOCK_HARDWARE( struct intel_context *intel )
-{
- char __ret = 0;
-
- pipe_mutex_lock(lockMutex);
- assert(!intel->locked);
-
- DRM_CAS(intel->driHwLock, intel->hHWContext,
- (DRM_LOCK_HELD|intel->hHWContext), __ret);
-
- if (__ret)
- intelContendedLock( intel, 0 );
-
- DBG(LOCK, "%s - locked\n", __progname);
-
- intel->locked = 1;
-}
-
-
-/* Unlock the hardware using the global current context
- */
-void UNLOCK_HARDWARE( struct intel_context *intel )
-{
- assert(intel->locked);
- intel->locked = 0;
-
- DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext);
-
- pipe_mutex_unlock(lockMutex);
-
- DBG(LOCK, "%s - unlocked\n", __progname);
-}
diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.c b/src/gallium/winsys/drm/intel/dri/intel_screen.c
deleted file mode 100644
index ed75368982..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_screen.c
+++ /dev/null
@@ -1,703 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "utils.h"
-#include "vblank.h"
-#include "xmlpool.h"
-
-#include "intel_context.h"
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-#include "intel_swapbuffers.h"
-
-#include "i830_dri.h"
-#include "ws_dri_bufpool.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_inlines.h"
-#include "state_tracker/st_public.h"
-#include "state_tracker/st_cb_fbo.h"
-
-static void
-intelCreateSurface(struct intel_screen *intelScreen, struct pipe_winsys *winsys, unsigned handle);
-
-static void
-intelCreateSurface(struct intel_screen *intelScreen, struct pipe_winsys *winsys, unsigned handle)
-{
- struct pipe_screen *screen = intelScreen->base.screen;
- struct pipe_texture *texture;
- struct pipe_texture templat;
- struct pipe_surface *surface;
- struct pipe_buffer *buffer;
- unsigned pitch;
-
- assert(intelScreen->front.cpp == 4);
-
- buffer = intel_be_buffer_from_handle(&intelScreen->base,
- "front", handle);
-
- if (!buffer)
- return;
-
- intelScreen->front.buffer = dri_bo(buffer);
-
- memset(&templat, 0, sizeof(templat));
- templat.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
- templat.target = PIPE_TEXTURE_2D;
- templat.last_level = 0;
- templat.depth[0] = 1;
- templat.format = PIPE_FORMAT_A8R8G8B8_UNORM;
- templat.width[0] = intelScreen->front.width;
- templat.height[0] = intelScreen->front.height;
- pf_get_block(templat.format, &templat.block);
- pitch = intelScreen->front.pitch;
-
- texture = screen->texture_blanket(screen,
- &templat,
- &pitch,
- buffer);
-
- /* Unref the buffer we don't need it anyways */
- pipe_buffer_reference(screen, &buffer, NULL);
-
- surface = screen->get_tex_surface(screen,
- texture,
- 0,
- 0,
- 0,
- PIPE_BUFFER_USAGE_GPU_WRITE);
-
- intelScreen->front.texture = texture;
- intelScreen->front.surface = surface;
-}
-
-PUBLIC const char __driConfigOptions[] =
- DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY
-// DRI_CONF_FORCE_S3TC_ENABLE(false)
- DRI_CONF_ALLOW_LARGE_TEXTURES(1)
- DRI_CONF_SECTION_END DRI_CONF_END;
-
-const uint __driNConfigOptions = 3;
-
-#ifdef USE_NEW_INTERFACE
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-#endif /*USE_NEW_INTERFACE */
-
-extern const struct dri_extension card_extensions[];
-
-static GLboolean
-intel_get_param(__DRIscreenPrivate *psp, int param, int *value)
-{
- int ret;
- struct drm_i915_getparam gp;
-
- gp.param = param;
- gp.value = value;
-
- ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drm_i915_getparam: %d\n", ret);
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void
-intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
- unsigned long long offset, int depth, uint pitch)
-{
- abort();
-#if 0
- struct intel_context *intel = (struct intel_context*)
- ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
- struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
- struct st_texture_object *stObj = st_texture_object(tObj);
-
- if (!stObj)
- return;
-
- if (stObj->pt)
- st->pipe->texture_release(intel->st->pipe, &stObj->pt);
-
- stObj->imageOverride = GL_TRUE;
- stObj->depthOverride = depth;
- stObj->pitchOverride = pitch;
-
- if (offset)
- stObj->textureOffset = offset;
-#endif
-}
-
-
-#if 0
-static void
-intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv,
- __DRIcontextPrivate *pcp,
- __DRIDrawableConfigEvent *event)
-{
- (void) dPriv;
- (void) pcp;
- (void) event;
-}
-#endif
-
-#if 0
-static void
-intelHandleBufferAttach(__DRIdrawablePrivate *dPriv,
- __DRIcontextPrivate *pcp,
- __DRIBufferAttachEvent *ba)
-{
- struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv);
-
- switch (ba->buffer.attachment) {
- case DRI_DRAWABLE_BUFFER_FRONT_LEFT:
- intelScreen->front.width = dPriv->w;
- intelScreen->front.height = dPriv->h;
- intelScreen->front.cpp = ba->buffer.cpp;
- intelScreen->front.pitch = ba->buffer.pitch;
- driGenBuffers(intelScreen->base.staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0);
- driBOSetReferenced(intelScreen->front.buffer, ba->buffer.handle);
- break;
-
- case DRI_DRAWABLE_BUFFER_BACK_LEFT:
- case DRI_DRAWABLE_BUFFER_DEPTH:
- case DRI_DRAWABLE_BUFFER_STENCIL:
- case DRI_DRAWABLE_BUFFER_ACCUM:
- /* anything ?? */
- break;
-
- default:
- fprintf(stderr, "unhandled buffer attach event, attachment type %d\n",
- ba->buffer.attachment);
- return;
- }
-}
-#endif
-
-static const __DRItexOffsetExtension intelTexOffsetExtension = {
- { __DRI_TEX_OFFSET },
- intelSetTexOffset,
-};
-
-#if 0
-static const __DRItexBufferExtension intelTexBufferExtension = {
- { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
- intelSetTexBuffer,
-};
-#endif
-
-static const __DRIextension *intelScreenExtensions[] = {
- &driReadDrawableExtension,
- &driCopySubBufferExtension.base,
- &driSwapControlExtension.base,
- &driFrameTrackingExtension.base,
- &driMediaStreamCounterExtension.base,
- &intelTexOffsetExtension.base,
-// &intelTexBufferExtension.base,
- NULL
-};
-
-
-static void
-intelPrintDRIInfo(struct intel_screen * intelScreen,
- __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv)
-{
- fprintf(stderr, "*** Front size: 0x%x offset: 0x%x pitch: %d\n",
- intelScreen->front.size, intelScreen->front.offset,
- intelScreen->front.pitch);
- fprintf(stderr, "*** Memory : 0x%x\n", gDRIPriv->mem);
-}
-
-
-#if 0
-static void
-intelPrintSAREA(const drmI830Sarea * sarea)
-{
- fprintf(stderr, "SAREA: sarea width %d height %d\n", sarea->width,
- sarea->height);
- fprintf(stderr, "SAREA: pitch: %d\n", sarea->pitch);
- fprintf(stderr,
- "SAREA: front offset: 0x%08x size: 0x%x handle: 0x%x\n",
- sarea->front_offset, sarea->front_size,
- (unsigned) sarea->front_handle);
- fprintf(stderr,
- "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n",
- sarea->back_offset, sarea->back_size,
- (unsigned) sarea->back_handle);
- fprintf(stderr, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x\n",
- sarea->depth_offset, sarea->depth_size,
- (unsigned) sarea->depth_handle);
- fprintf(stderr, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n",
- sarea->tex_offset, sarea->tex_size, (unsigned) sarea->tex_handle);
- fprintf(stderr, "SAREA: rotation: %d\n", sarea->rotation);
- fprintf(stderr,
- "SAREA: rotated offset: 0x%08x size: 0x%x\n",
- sarea->rotated_offset, sarea->rotated_size);
- fprintf(stderr, "SAREA: rotated pitch: %d\n", sarea->rotated_pitch);
-}
-#endif
-
-
-/**
- * Use the information in the sarea to update the screen parameters
- * related to screen rotation. Needs to be called locked.
- */
-void
-intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
-{
- struct intel_screen *intelScreen = intel_screen(sPriv);
-
- if (intelScreen->front.map) {
- drmUnmap(intelScreen->front.map, intelScreen->front.size);
- intelScreen->front.map = NULL;
- }
-
- if (intelScreen->front.buffer)
- driDeleteBuffers(1, &intelScreen->front.buffer);
-
- intelScreen->front.width = sarea->width;
- intelScreen->front.height = sarea->height;
- intelScreen->front.offset = sarea->front_offset;
- intelScreen->front.pitch = sarea->pitch * intelScreen->front.cpp;
- intelScreen->front.size = sarea->front_size;
- intelScreen->front.handle = sarea->front_handle;
-
- assert( sarea->front_size >=
- intelScreen->front.pitch * intelScreen->front.height );
-
-#if 0 /* JB not important */
- if (!sarea->front_handle)
- return;
-
- if (drmMap(sPriv->fd,
- sarea->front_handle,
- intelScreen->front.size,
- (drmAddress *) & intelScreen->front.map) != 0) {
- fprintf(stderr, "drmMap(frontbuffer) failed!\n");
- return;
- }
-#endif
-
-#if 0 /* JB */
- if (intelScreen->staticPool) {
- driGenBuffers(intelScreen->staticPool, "static region", 1,
- &intelScreen->front.buffer, 64,
- DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_MOVE |
- DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
-
- driBOSetStatic(intelScreen->front.buffer,
- intelScreen->front.offset,
- intelScreen->front.pitch * intelScreen->front.height,
- intelScreen->front.map, 0);
- }
-#else
- if (intelScreen->base.staticPool) {
- if (intelScreen->front.buffer) {
- driBOUnReference(intelScreen->front.buffer);
- pipe_surface_reference(&intelScreen->front.surface, NULL);
- pipe_texture_reference(&intelScreen->front.texture, NULL);
- }
- intelCreateSurface(intelScreen, &intelScreen->base.base, sarea->front_bo_handle);
- }
-#endif
-}
-
-
-boolean
-intelCreatePools(__DRIscreenPrivate * sPriv)
-{
- //unsigned batchPoolSize = 1024*1024;
- struct intel_screen *intelScreen = intel_screen(sPriv);
-
- if (intelScreen->havePools)
- return GL_TRUE;
-
- intelScreen->havePools = GL_TRUE;
-
- if (intelScreen->sarea)
- intelUpdateScreenRotation(sPriv, intelScreen->sarea);
-
- return GL_TRUE;
-}
-
-static const char *
-intel_get_name( struct pipe_winsys *winsys )
-{
- return "Intel/DRI/ttm";
-}
-
-/*
- * The state tracker (should!) keep track of whether the fake
- * frontbuffer has been touched by any rendering since the last time
- * we copied its contents to the real frontbuffer. Our task is easy:
- */
-static void
-intel_flush_frontbuffer( struct pipe_winsys *winsys,
- struct pipe_surface *surf,
- void *context_private)
-{
- struct intel_context *intel = (struct intel_context *) context_private;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
-
- intelDisplaySurface(dPriv, surf, NULL);
-}
-
-static boolean
-intelInitDriver(__DRIscreenPrivate * sPriv)
-{
- struct intel_screen *intelScreen;
- I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
-
- if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
- fprintf(stderr,
- "\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
- return GL_FALSE;
- }
-
- /* Allocate the private area */
- intelScreen = CALLOC_STRUCT(intel_screen);
- if (!intelScreen)
- return GL_FALSE;
-
- /* parse information in __driConfigOptions */
- driParseOptionInfo(&intelScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- sPriv->private = (void *) intelScreen;
- intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) +
- gDRIPriv->sarea_priv_offset);
-
- intelScreen->deviceID = gDRIPriv->deviceID;
-
- intelScreen->front.cpp = gDRIPriv->cpp;
- intelScreen->drmMinor = sPriv->drm_version.minor;
- intelUpdateScreenRotation(sPriv, intelScreen->sarea);
-
- if (0)
- intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
-
- sPriv->extensions = intelScreenExtensions;
-
- intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
- intelScreen->base.base.get_name = intel_get_name;
- intel_be_init_device(&intelScreen->base, sPriv->fd, intelScreen->deviceID);
-
- return GL_TRUE;
-}
-
-
-static void
-intelDestroyScreen(__DRIscreenPrivate * sPriv)
-{
- struct intel_screen *intelScreen = intel_screen(sPriv);
-
- intel_be_destroy_device(&intelScreen->base);
- /* intelUnmapScreenRegions(intelScreen); */
-
- FREE(intelScreen);
- sPriv->private = NULL;
-}
-
-
-/**
- * This is called when we need to set up GL rendering to a new X window.
- */
-static boolean
-intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
- __DRIdrawablePrivate * driDrawPriv,
- const __GLcontextModes * visual, boolean isPixmap)
-{
- if (isPixmap) {
- return GL_FALSE; /* not implemented */
- }
- else {
- enum pipe_format colorFormat, depthFormat, stencilFormat;
- struct intel_framebuffer *intelfb = CALLOC_STRUCT(intel_framebuffer);
-
- if (!intelfb)
- return GL_FALSE;
-
- if (visual->redBits == 5)
- colorFormat = PIPE_FORMAT_R5G6B5_UNORM;
- else
- colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM;
-
- if (visual->depthBits == 16)
- depthFormat = PIPE_FORMAT_Z16_UNORM;
- else if (visual->depthBits == 24)
- depthFormat = PIPE_FORMAT_S8Z24_UNORM;
- else
- depthFormat = PIPE_FORMAT_NONE;
-
- if (visual->stencilBits == 8)
- stencilFormat = PIPE_FORMAT_S8Z24_UNORM;
- else
- stencilFormat = PIPE_FORMAT_NONE;
-
- intelfb->stfb = st_create_framebuffer(visual,
- colorFormat,
- depthFormat,
- stencilFormat,
- driDrawPriv->w,
- driDrawPriv->h,
- (void*) intelfb);
- if (!intelfb->stfb) {
- free(intelfb);
- return GL_FALSE;
- }
-
- driDrawPriv->driverPrivate = (void *) intelfb;
- return GL_TRUE;
- }
-}
-
-static void
-intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv)
-{
- struct intel_framebuffer *intelfb = intel_framebuffer(driDrawPriv);
- assert(intelfb->stfb);
- st_unreference_framebuffer(intelfb->stfb);
- free(intelfb);
-}
-
-
-/**
- * Get information about previous buffer swaps.
- */
-static int
-intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
-{
- if ((dPriv == NULL) || (dPriv->driverPrivate == NULL)
- || (sInfo == NULL)) {
- return -1;
- }
-
- return 0;
-}
-
-static __DRIconfig **
-intelFillInModes(__DRIscreenPrivate *psp,
- unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer)
-{
- __DRIconfig **configs;
- __GLcontextModes *m;
- unsigned num_modes;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
- int i;
-
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
- };
-
- uint8_t depth_bits_array[3];
- uint8_t stencil_bits_array[3];
- uint8_t msaa_samples_array[1];
-
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = depth_bits;
- depth_bits_array[2] = depth_bits;
- msaa_samples_array[0] = 0;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer. It will be a sw fallback, but some apps won't
- * care about that.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = 0;
- if (depth_bits == 24)
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
- back_buffer_factor = (have_back_buffer) ? 3 : 1;
-
- num_modes = depth_buffer_factor * back_buffer_factor * 4;
-
- if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- }
-
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, msaa_samples_array, 1);
- if (configs == NULL) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
-
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for (i = 0; configs[i]; i++) {
- m = &configs[i]->modes;
- if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
-
- return configs;
-}
-
-/**
- * This is the driver specific part of the createNewScreen entry point.
- *
- * \todo maybe fold this into intelInitDriver
- *
- * \return the __GLcontextModes supported by this driver
- */
-static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp)
-{
-#ifdef I915
- static const __DRIversion ddx_expected = { 1, 5, 0 };
-#else
- static const __DRIversion ddx_expected = { 1, 6, 0 };
-#endif
- static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 5, 0 };
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
-
- if (!driCheckDriDdxDrmVersions2("i915",
- &psp->dri_version, &dri_expected,
- &psp->ddx_version, &ddx_expected,
- &psp->drm_version, &drm_expected)) {
- return NULL;
- }
-
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is
- * called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
- //intelInitExtensions(NULL, GL_TRUE);
-
- if (!intelInitDriver(psp))
- return NULL;
-
- psp->extensions = intelScreenExtensions;
-
- return (const __DRIconfig **)
- intelFillInModes(psp, dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8, 1);
-}
-
-/**
- * This is the driver specific part of the createNewScreen entry point.
- *
- * \return the __GLcontextModes supported by this driver
- */
-static const
-__DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
-{
- struct intel_screen *intelScreen;
-
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is
- * called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- //intelInitExtensions(NULL, GL_TRUE);
-
- /* Allocate the private area */
- intelScreen = CALLOC_STRUCT(intel_screen);
- if (!intelScreen) {
- fprintf(stderr, "\nERROR! Allocating private area failed\n");
- return GL_FALSE;
- }
- /* parse information in __driConfigOptions */
- driParseOptionInfo(&intelScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- psp->private = (void *) intelScreen;
-
- intelScreen->drmMinor = psp->drm_version.minor;
-
- /* Determine chipset ID? */
- if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
- &intelScreen->deviceID))
- return GL_FALSE;
-
- psp->extensions = intelScreenExtensions;
-
- intel_be_init_device(&intelScreen->base, psp->fd, intelScreen->deviceID);
- intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
- intelScreen->base.base.get_name = intel_get_name;
-
- return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1),
- intelFillInModes(psp, 32, 24, 8, 1));
-}
-
-const struct __DriverAPIRec driDriverAPI = {
- .InitScreen = intelInitScreen,
- .DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
- .DestroyContext = intelDestroyContext,
- .CreateBuffer = intelCreateBuffer,
- .DestroyBuffer = intelDestroyBuffer,
- .SwapBuffers = intelSwapBuffers,
- .MakeCurrent = intelMakeCurrent,
- .UnbindContext = intelUnbindContext,
- .GetSwapInfo = intelGetSwapInfo,
- .GetDrawableMSC = driDrawableGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .CopySubBuffer = intelCopySubBuffer,
-
- //.InitScreen2 = intelInitScreen2,
- //.HandleDrawableConfig = intelHandleDrawableConfig,
- //.HandleBufferAttach = intelHandleBufferAttach,
-};
diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.h b/src/gallium/winsys/drm/intel/dri/intel_screen.h
deleted file mode 100644
index 0bb43a915c..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_screen.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef _INTEL_SCREEN_H_
-#define _INTEL_SCREEN_H_
-
-#include "dri_util.h"
-#include "i830_common.h"
-#include "xmlconfig.h"
-#include "ws_dri_bufpool.h"
-
-#include "pipe/p_compiler.h"
-
-#include "intel_be_device.h"
-
-struct intel_screen
-{
- struct intel_be_device base;
-
- struct {
- drm_handle_t handle;
-
- /* We create a static dri buffer for the frontbuffer.
- */
- struct _DriBufferObject *buffer;
- struct pipe_surface *surface;
- struct pipe_texture *texture;
-
- char *map; /* memory map */
- int offset; /* from start of video mem, in bytes */
- int pitch; /* row stride, in bytes */
- int width;
- int height;
- int size;
- int cpp; /* for front and back buffers */
- } front;
-
- int deviceID;
- int drmMinor;
-
- drmI830Sarea *sarea;
-
- /**
- * Configuration cache with default values for all contexts
- */
- driOptionCache optionCache;
-
- boolean havePools;
-
- /**
- * Temporary(?) context to use for SwapBuffers or other situations in
- * which we need a rendering context, but none is currently bound.
- */
- struct intel_context *dummyContext;
-
- /*
- * New stuff form the i915tex integration
- */
- unsigned batch_id;
-
-
- struct pipe_winsys *winsys;
-};
-
-
-
-/** cast wrapper */
-static INLINE struct intel_screen *
-intel_screen(__DRIscreenPrivate *sPriv)
-{
- return (struct intel_screen *) sPriv->private;
-}
-
-
-extern void
-intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
-
-
-extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv);
-
-extern boolean intelUnbindContext(__DRIcontextPrivate * driContextPriv);
-
-extern boolean
-intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
- __DRIdrawablePrivate * driDrawPriv,
- __DRIdrawablePrivate * driReadPriv);
-
-
-extern boolean
-intelCreatePools(__DRIscreenPrivate *sPriv);
-
-extern boolean
-intelCreateContext(const __GLcontextModes * visual,
- __DRIcontextPrivate * driContextPriv,
- void *sharedContextPrivate);
-
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c b/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c
deleted file mode 100644
index 34ad7eebe1..0000000000
--- a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_swapbuffers.h"
-
-#include "intel_reg.h"
-
-#include "pipe/p_context.h"
-#include "state_tracker/st_public.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_cb_fbo.h"
-
-#include "ws_dri_bufmgr.h"
-#include "intel_batchbuffer.h"
-
-/**
- * Display a colorbuffer surface in an X window.
- * Used for SwapBuffers and flushing front buffer rendering.
- *
- * \param dPriv the window/drawable to display into
- * \param surf the surface to display
- * \param rect optional subrect of surface to display (may be NULL).
- */
-void
-intelDisplaySurface(__DRIdrawablePrivate *dPriv,
- struct pipe_surface *surf,
- const drm_clip_rect_t *rect)
-{
- struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv);
- struct intel_context *intel = intelScreen->dummyContext;
-
- DBG(SWAP, "%s\n", __FUNCTION__);
-
- if (!intel) {
- /* XXX this is where some kind of extra/meta context could be useful */
- return;
- }
-
- if (intel->last_swap_fence) {
- driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, TRUE);
- driFenceUnReference(&intel->last_swap_fence);
- intel->last_swap_fence = NULL;
- }
- intel->last_swap_fence = intel->first_swap_fence;
- intel->first_swap_fence = NULL;
-
- /* The LOCK_HARDWARE is required for the cliprects. Buffer offsets
- * should work regardless.
- */
- LOCK_HARDWARE(intel);
- /* if this drawable isn't currently bound the LOCK_HARDWARE done on the
- * current context (which is what intelScreenContext should return) might
- * not get a contended lock and thus cliprects not updated (tests/manywin)
- */
- if (intel_context(dPriv->driContextPriv) != intel)
- DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);
-
-
- if (dPriv && dPriv->numClipRects) {
- const int srcWidth = surf->width;
- const int srcHeight = surf->height;
- const int nbox = dPriv->numClipRects;
- const drm_clip_rect_t *pbox = dPriv->pClipRects;
- const int pitch = intelScreen->front.pitch / intelScreen->front.cpp;
- const int cpp = intelScreen->front.cpp;
- const int srcpitch = surf->stride / cpp;
- int BR13, CMD;
- int i;
-
- ASSERT(surf->buffer);
-
- DBG(SWAP, "screen pitch %d src surface pitch %d\n",
- pitch, surf->stride);
-
- if (cpp == 2) {
- BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24);
- CMD = XY_SRC_COPY_BLT_CMD;
- }
- else {
- BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24) | (1 << 25);
- CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
- XY_SRC_COPY_BLT_WRITE_RGB);
- }
-
- for (i = 0; i < nbox; i++, pbox++) {
- drm_clip_rect_t box;
- drm_clip_rect_t sbox;
-
- if (pbox->x1 > pbox->x2 ||
- pbox->y1 > pbox->y2 ||
- pbox->x2 > intelScreen->front.width ||
- pbox->y2 > intelScreen->front.height) {
- /* invalid cliprect, skip it */
- continue;
- }
-
- box = *pbox;
-
- if (rect) {
- /* intersect cliprect with user-provided src rect */
- drm_clip_rect_t rrect;
-
- rrect.x1 = dPriv->x + rect->x1;
- rrect.y1 = (dPriv->h - rect->y1 - rect->y2) + dPriv->y;
- rrect.x2 = rect->x2 + rrect.x1;
- rrect.y2 = rect->y2 + rrect.y1;
- if (rrect.x1 > box.x1)
- box.x1 = rrect.x1;
- if (rrect.y1 > box.y1)
- box.y1 = rrect.y1;
- if (rrect.x2 < box.x2)
- box.x2 = rrect.x2;
- if (rrect.y2 < box.y2)
- box.y2 = rrect.y2;
-
- if (box.x1 > box.x2 || box.y1 > box.y2)
- continue;
- }
-
- /* restrict blit to size of actually rendered area */
- if (box.x2 - box.x1 > srcWidth)
- box.x2 = srcWidth + box.x1;
- if (box.y2 - box.y1 > srcHeight)
- box.y2 = srcHeight + box.y1;
-
- DBG(SWAP, "box x1 x2 y1 y2 %d %d %d %d\n",
- box.x1, box.x2, box.y1, box.y2);
-
- sbox.x1 = box.x1 - dPriv->x;
- sbox.y1 = box.y1 - dPriv->y;
-
- assert(box.x1 < box.x2);
- assert(box.y1 < box.y2);
-
- /* XXX this could be done with pipe->surface_copy() */
- /* XXX should have its own batch buffer */
- if (!BEGIN_BATCH(8, 2)) {
- /*
- * Since we share this batch buffer with a context
- * we can't flush it since that risks a GPU lockup
- */
- assert(0);
- continue;
- }
-
- OUT_BATCH(CMD);
- OUT_BATCH(BR13);
- OUT_BATCH((box.y1 << 16) | box.x1);
- OUT_BATCH((box.y2 << 16) | box.x2);
-
- OUT_RELOC(intelScreen->front.buffer,
- DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
- DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
- OUT_BATCH((sbox.y1 << 16) | sbox.x1);
- OUT_BATCH((srcpitch * cpp) & 0xffff);
- OUT_RELOC(dri_bo(surf->buffer),
- DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
- DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
-
- }
-
- if (intel->first_swap_fence)
- driFenceUnReference(&intel->first_swap_fence);
- intel->first_swap_fence = intel_be_batchbuffer_flush(intel->base.batch);
- }
-
- UNLOCK_HARDWARE(intel);
-
- if (intel->lastStamp != dPriv->lastStamp) {
- intelUpdateWindowSize(dPriv);
- intel->lastStamp = dPriv->lastStamp;
- }
-}
-
-
-
-/**
- * This will be called whenever the currently bound window is moved/resized.
- */
-void
-intelUpdateWindowSize(__DRIdrawablePrivate *dPriv)
-{
- struct intel_framebuffer *intelfb = intel_framebuffer(dPriv);
- assert(intelfb->stfb);
- st_resize_framebuffer(intelfb->stfb, dPriv->w, dPriv->h);
-}
-
-
-
-void
-intelSwapBuffers(__DRIdrawablePrivate * dPriv)
-{
- struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
- struct pipe_surface *back_surf;
-
- assert(intel_fb);
- assert(intel_fb->stfb);
-
- back_surf = st_get_framebuffer_surface(intel_fb->stfb,
- ST_SURFACE_BACK_LEFT);
- if (back_surf) {
- st_notify_swapbuffers(intel_fb->stfb);
- intelDisplaySurface(dPriv, back_surf, NULL);
- st_notify_swapbuffers_complete(intel_fb->stfb);
- }
-}
-
-
-/**
- * Called via glXCopySubBufferMESA() to copy a subrect of the back
- * buffer to the front buffer/screen.
- */
-void
-intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
-{
- struct intel_framebuffer *intel_fb = intel_framebuffer(dPriv);
- struct pipe_surface *back_surf;
-
- assert(intel_fb);
- assert(intel_fb->stfb);
-
- back_surf = st_get_framebuffer_surface(intel_fb->stfb,
- ST_SURFACE_BACK_LEFT);
- if (back_surf) {
- drm_clip_rect_t rect;
- rect.x1 = x;
- rect.y1 = y;
- rect.x2 = w;
- rect.y2 = h;
-
- st_notify_swapbuffers(intel_fb->stfb);
- intelDisplaySurface(dPriv, back_surf, &rect);
- }
-}
diff --git a/src/gallium/winsys/drm/intel/dri/server/i830_common.h b/src/gallium/winsys/drm/intel/dri/server/i830_common.h
deleted file mode 100644
index 3452ddb3c9..0000000000
--- a/src/gallium/winsys/drm/intel/dri/server/i830_common.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/**************************************************************************
-
-Copyright 2001 VA Linux Systems Inc., Fremont, California.
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-
-#ifndef _I830_COMMON_H_
-#define _I830_COMMON_H_
-
-
-#define I830_NR_TEX_REGIONS 255 /* maximum due to use of chars for next/prev */
-#define I830_LOG_MIN_TEX_REGION_SIZE 14
-
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_I830_INIT 0x00
-#define DRM_I830_FLUSH 0x01
-#define DRM_I830_FLIP 0x02
-#define DRM_I830_BATCHBUFFER 0x03
-#define DRM_I830_IRQ_EMIT 0x04
-#define DRM_I830_IRQ_WAIT 0x05
-#define DRM_I830_GETPARAM 0x06
-#define DRM_I830_SETPARAM 0x07
-#define DRM_I830_ALLOC 0x08
-#define DRM_I830_FREE 0x09
-#define DRM_I830_INIT_HEAP 0x0a
-#define DRM_I830_CMDBUFFER 0x0b
-#define DRM_I830_DESTROY_HEAP 0x0c
-#define DRM_I830_SET_VBLANK_PIPE 0x0d
-#define DRM_I830_GET_VBLANK_PIPE 0x0e
-#define DRM_I830_MMIO 0x10
-
-typedef struct {
- enum {
- I830_INIT_DMA = 0x01,
- I830_CLEANUP_DMA = 0x02,
- I830_RESUME_DMA = 0x03
- } func;
- unsigned int mmio_offset;
- int sarea_priv_offset;
- unsigned int ring_start;
- unsigned int ring_end;
- unsigned int ring_size;
- unsigned int front_offset;
- unsigned int back_offset;
- unsigned int depth_offset;
- unsigned int w;
- unsigned int h;
- unsigned int pitch;
- unsigned int pitch_bits;
- unsigned int back_pitch;
- unsigned int depth_pitch;
- unsigned int cpp;
- unsigned int chipset;
-} drmI830Init;
-
-typedef struct {
- drmTextureRegion texList[I830_NR_TEX_REGIONS+1];
- int last_upload; /* last time texture was uploaded */
- int last_enqueue; /* last time a buffer was enqueued */
- int last_dispatch; /* age of the most recently dispatched buffer */
- int ctxOwner; /* last context to upload state */
- /** Last context that used the buffer manager. */
- int texAge;
- int pf_enabled; /* is pageflipping allowed? */
- int pf_active;
- int pf_current_page; /* which buffer is being displayed? */
- int perf_boxes; /* performance boxes to be displayed */
- int width, height; /* screen size in pixels */
-
- drm_handle_t front_handle;
- int front_offset;
- int front_size;
-
- drm_handle_t back_handle;
- int back_offset;
- int back_size;
-
- drm_handle_t depth_handle;
- int depth_offset;
- int depth_size;
-
- drm_handle_t tex_handle;
- int tex_offset;
- int tex_size;
- int log_tex_granularity;
- int pitch;
- int rotation; /* 0, 90, 180 or 270 */
- int rotated_offset;
- int rotated_size;
- int rotated_pitch;
- int virtualX, virtualY;
-
- unsigned int front_tiled;
- unsigned int back_tiled;
- unsigned int depth_tiled;
- unsigned int rotated_tiled;
- unsigned int rotated2_tiled;
-
- int planeA_x;
- int planeA_y;
- int planeA_w;
- int planeA_h;
- int planeB_x;
- int planeB_y;
- int planeB_w;
- int planeB_h;
-
- /* Triple buffering */
- drm_handle_t third_handle;
- int third_offset;
- int third_size;
- unsigned int third_tiled;
-
- /* buffer object handles for the static buffers. May change
- * over the lifetime of the client, though it doesn't in our current
- * implementation.
- */
- unsigned int front_bo_handle;
- unsigned int back_bo_handle;
- unsigned int third_bo_handle;
- unsigned int depth_bo_handle;
-} drmI830Sarea;
-
-/* Flags for perf_boxes
- */
-#define I830_BOX_RING_EMPTY 0x1 /* populated by kernel */
-#define I830_BOX_FLIP 0x2 /* populated by kernel */
-#define I830_BOX_WAIT 0x4 /* populated by kernel & client */
-#define I830_BOX_TEXTURE_LOAD 0x8 /* populated by kernel */
-#define I830_BOX_LOST_CONTEXT 0x10 /* populated by client */
-
-
-typedef struct {
- int start; /* agp offset */
- int used; /* nr bytes in use */
- int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
- int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/
- int num_cliprects; /* mulitpass with multiple cliprects? */
- drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
-} drmI830BatchBuffer;
-
-typedef struct {
- char *buf; /* agp offset */
- int sz; /* nr bytes in use */
- int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
- int DR4; /* window origin for GFX_OP_DRAWRECT_INFO*/
- int num_cliprects; /* mulitpass with multiple cliprects? */
- drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
-} drmI830CmdBuffer;
-
-typedef struct {
- int *irq_seq;
-} drmI830IrqEmit;
-
-typedef struct {
- int irq_seq;
-} drmI830IrqWait;
-
-typedef struct {
- int param;
- int *value;
-} drmI830GetParam;
-
-#define I830_PARAM_IRQ_ACTIVE 1
-#define I830_PARAM_ALLOW_BATCHBUFFER 2
-
-typedef struct {
- int param;
- int value;
-} drmI830SetParam;
-
-#define I830_SETPARAM_USE_MI_BATCHBUFFER_START 1
-#define I830_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
-#define I830_SETPARAM_ALLOW_BATCHBUFFER 3
-
-
-/* A memory manager for regions of shared memory:
- */
-#define I830_MEM_REGION_AGP 1
-
-typedef struct {
- int region;
- int alignment;
- int size;
- int *region_offset; /* offset from start of fb or agp */
-} drmI830MemAlloc;
-
-typedef struct {
- int region;
- int region_offset;
-} drmI830MemFree;
-
-typedef struct {
- int region;
- int size;
- int start;
-} drmI830MemInitHeap;
-
-typedef struct {
- int region;
-} drmI830MemDestroyHeap;
-
-#define DRM_I830_VBLANK_PIPE_A 1
-#define DRM_I830_VBLANK_PIPE_B 2
-
-typedef struct {
- int pipe;
-} drmI830VBlankPipe;
-
-#define MMIO_READ 0
-#define MMIO_WRITE 1
-
-#define MMIO_REGS_IA_PRIMATIVES_COUNT 0
-#define MMIO_REGS_IA_VERTICES_COUNT 1
-#define MMIO_REGS_VS_INVOCATION_COUNT 2
-#define MMIO_REGS_GS_PRIMITIVES_COUNT 3
-#define MMIO_REGS_GS_INVOCATION_COUNT 4
-#define MMIO_REGS_CL_PRIMITIVES_COUNT 5
-#define MMIO_REGS_CL_INVOCATION_COUNT 6
-#define MMIO_REGS_PS_INVOCATION_COUNT 7
-#define MMIO_REGS_PS_DEPTH_COUNT 8
-
-typedef struct {
- unsigned int read_write:1;
- unsigned int reg:31;
- void __user *data;
-} drmI830MMIO;
-
-#endif /* _I830_DRM_H_ */
diff --git a/src/gallium/winsys/drm/intel/dri/server/i830_dri.h b/src/gallium/winsys/drm/intel/dri/server/i830_dri.h
deleted file mode 100644
index 0d514b6c38..0000000000
--- a/src/gallium/winsys/drm/intel/dri/server/i830_dri.h
+++ /dev/null
@@ -1,62 +0,0 @@
-
-#ifndef _I830_DRI_H
-#define _I830_DRI_H
-
-#include "xf86drm.h"
-#include "i830_common.h"
-
-#define I830_MAX_DRAWABLES 256
-
-#define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 7
-#define I830_PATCHLEVEL 2
-
-#define I830_REG_SIZE 0x80000
-
-typedef struct _I830DRIRec {
- drm_handle_t regs;
- drmSize regsSize;
-
- drmSize unused1; /* backbufferSize */
- drm_handle_t unused2; /* backbuffer */
-
- drmSize unused3; /* depthbufferSize */
- drm_handle_t unused4; /* depthbuffer */
-
- drmSize unused5; /* rotatedSize */
- drm_handle_t unused6; /* rotatedbuffer */
-
- drm_handle_t unused7; /* textures */
- int unused8; /* textureSize */
-
- drm_handle_t unused9; /* agp_buffers */
- drmSize unused10; /* agp_buf_size */
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
-
- int unused11[8]; /* was front/back/depth/rotated offset/pitch */
-
- int unused12; /* logTextureGranularity */
- int unused13; /* textureOffset */
-
- int irq;
- int sarea_priv_offset;
-} I830DRIRec, *I830DRIPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830ConfigPrivRec, *I830ConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830DRIContextRec, *I830DRIContextPtr;
-
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/egl/Makefile b/src/gallium/winsys/drm/intel/egl/Makefile
index 7147d89e0d..c5217ad2d6 100644
--- a/src/gallium/winsys/drm/intel/egl/Makefile
+++ b/src/gallium/winsys/drm/intel/egl/Makefile
@@ -1,19 +1,16 @@
TOP = ../../../../../..
+GALLIUMDIR = ../../../..
include $(TOP)/configs/current
LIBNAME = EGL_i915.so
PIPE_DRIVERS = \
- ../gem/libinteldrm.a \
- $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/i915simple/libi915simple.a \
$(TOP)/src/gallium/state_trackers/egl/libegldrm.a \
+ $(GALLIUMDIR)/winsys/drm/intel/gem/libinteldrm.a \
+ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/i915simple/libi915simple.a
-
-DRIVER_SOURCES = \
- intel_context.c \
- intel_device.c \
- intel_api.c
+DRIVER_SOURCES =
C_SOURCES = \
$(COMMON_GALLIUM_SOURCES) \
diff --git a/src/gallium/winsys/drm/intel/egl/intel_api.c b/src/gallium/winsys/drm/intel/egl/intel_api.c
deleted file mode 100644
index 5dc4a7b052..0000000000
--- a/src/gallium/winsys/drm/intel/egl/intel_api.c
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#include "intel_api.h"
-
-struct drm_api drm_api_hocks =
-{
- .create_screen = intel_create_screen,
- .create_context = intel_create_context,
- .buffer_from_handle = intel_be_buffer_from_handle,
- .handle_from_buffer = intel_be_handle_from_buffer,
-};
diff --git a/src/gallium/winsys/drm/intel/egl/intel_api.h b/src/gallium/winsys/drm/intel/egl/intel_api.h
deleted file mode 100644
index 8ec165ab01..0000000000
--- a/src/gallium/winsys/drm/intel/egl/intel_api.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#ifndef _INTEL_API_H_
-#define _INTEL_API_H_
-
-#include "pipe/p_compiler.h"
-
-#include "state_tracker/drm_api.h"
-
-#include "intel_be_device.h"
-
-struct pipe_screen *intel_create_screen(int drmFD, int pciID);
-struct pipe_context *intel_create_context(struct pipe_screen *screen);
-
-#endif
diff --git a/src/gallium/winsys/drm/intel/egl/intel_context.c b/src/gallium/winsys/drm/intel/egl/intel_context.c
deleted file mode 100644
index 57e5ff7bc1..0000000000
--- a/src/gallium/winsys/drm/intel/egl/intel_context.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#include "i915simple/i915_screen.h"
-
-#include "intel_be_device.h"
-#include "intel_be_context.h"
-
-#include "pipe/p_defines.h"
-#include "pipe/p_context.h"
-
-#include "intel_api.h"
-
-struct intel_context
-{
- struct intel_be_context base;
-
- /* stuff */
-};
-
-/*
- * Hardware lock functions.
- * Doesn't do anything in EGL
- */
-
-static void
-intel_lock_hardware(struct intel_be_context *context)
-{
- (void)context;
-}
-
-static void
-intel_unlock_hardware(struct intel_be_context *context)
-{
- (void)context;
-}
-
-static boolean
-intel_locked_hardware(struct intel_be_context *context)
-{
- (void)context;
- return FALSE;
-}
-
-
-/*
- * Misc functions.
- */
-static void
-intel_destroy_be_context(struct i915_winsys *winsys)
-{
- struct intel_context *intel = (struct intel_context *)winsys;
-
- intel_be_destroy_context(&intel->base);
- free(intel);
-}
-
-struct pipe_context *
-intel_create_context(struct pipe_screen *screen)
-{
- struct intel_context *intel;
- struct pipe_context *pipe;
- struct intel_be_device *device = (struct intel_be_device *)screen->winsys;
-
- intel = (struct intel_context *)malloc(sizeof(*intel));
- memset(intel, 0, sizeof(*intel));
-
- intel->base.hardware_lock = intel_lock_hardware;
- intel->base.hardware_unlock = intel_unlock_hardware;
- intel->base.hardware_locked = intel_locked_hardware;
-
- intel_be_init_context(&intel->base, device);
-
- intel->base.base.destroy = intel_destroy_be_context;
-
-#if 0
- pipe = intel_create_softpipe(intel, screen->winsys);
-#else
- pipe = i915_create_context(screen, &device->base, &intel->base.base);
-#endif
-
- pipe->priv = intel;
-
- return pipe;
-}
diff --git a/src/gallium/winsys/drm/intel/egl/intel_device.c b/src/gallium/winsys/drm/intel/egl/intel_device.c
deleted file mode 100644
index 6b281402d5..0000000000
--- a/src/gallium/winsys/drm/intel/egl/intel_device.c
+++ /dev/null
@@ -1,48 +0,0 @@
-
-#include <stdio.h>
-#include "pipe/p_defines.h"
-#include "intel_be_device.h"
-#include "i915simple/i915_screen.h"
-
-#include "intel_api.h"
-
-struct intel_device
-{
- struct intel_be_device base;
-
- int deviceID;
-};
-
-static void
-intel_destroy_winsys(struct pipe_winsys *winsys)
-{
- struct intel_device *dev = (struct intel_device *)winsys;
-
- intel_be_destroy_device(&dev->base);
-
- free(dev);
-}
-
-struct pipe_screen *
-intel_create_screen(int drmFD, int deviceID)
-{
- struct intel_device *dev;
- struct pipe_screen *screen;
-
- /* Allocate the private area */
- dev = malloc(sizeof(*dev));
- if (!dev)
- return NULL;
- memset(dev, 0, sizeof(*dev));
-
- dev->deviceID = deviceID;
-
- intel_be_init_device(&dev->base, drmFD, deviceID);
-
- /* we need to hock our own destroy function in here */
- dev->base.base.destroy = intel_destroy_winsys;
-
- screen = i915_create_screen(&dev->base.base, deviceID);
-
- return screen;
-}
diff --git a/src/gallium/winsys/drm/intel/gem/Makefile b/src/gallium/winsys/drm/intel/gem/Makefile
index b25fc258f4..7a85a3f149 100644
--- a/src/gallium/winsys/drm/intel/gem/Makefile
+++ b/src/gallium/winsys/drm/intel/gem/Makefile
@@ -6,7 +6,8 @@ LIBNAME = inteldrm
C_SOURCES = \
intel_be_batchbuffer.c \
intel_be_context.c \
- intel_be_device.c
+ intel_be_device.c \
+ intel_be_api.c
include ./Makefile.template
diff --git a/src/gallium/winsys/drm/intel/gem/Makefile.template b/src/gallium/winsys/drm/intel/gem/Makefile.template
index 557070ae02..b60e978894 100644
--- a/src/gallium/winsys/drm/intel/gem/Makefile.template
+++ b/src/gallium/winsys/drm/intel/gem/Makefile.template
@@ -36,11 +36,11 @@ INCLUDES = \
##### TARGETS #####
-default: depend symlinks $(LIBNAME)
+default: depend symlinks lib$(LIBNAME).a
-$(LIBNAME): $(OBJECTS) Makefile Makefile.template
- $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS)
+lib$(LIBNAME).a: $(OBJECTS) Makefile Makefile.template
+ $(TOP)/bin/mklib -o $(LIBNAME) -static $(OBJECTS) $(DRIVER_LIBS)
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
new file mode 100644
index 0000000000..6cffed5134
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c
@@ -0,0 +1,12 @@
+
+#include "intel_be_api.h"
+
+struct drm_api drm_api_hocks =
+{
+ /* intel_be_context.c */
+ .create_context = intel_be_create_context,
+ /* intel_be_screen.c */
+ .create_screen = intel_be_create_screen,
+ .buffer_from_handle = intel_be_buffer_from_handle,
+ .handle_from_buffer = intel_be_handle_from_buffer,
+};
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.h b/src/gallium/winsys/drm/intel/gem/intel_be_api.h
new file mode 100644
index 0000000000..73e458d4ba
--- /dev/null
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.h
@@ -0,0 +1,14 @@
+
+#ifndef _INTEL_BE_API_H_
+#define _INTEL_BE_API_H_
+
+#include "pipe/p_compiler.h"
+
+#include "state_tracker/drm_api.h"
+
+#include "intel_be_device.h"
+
+struct pipe_screen *intel_be_create_screen(int drmFD, int pciID);
+struct pipe_context *intel_be_create_context(struct pipe_screen *screen);
+
+#endif
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.c b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
index 95e761d78d..bb6f1b916c 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c
@@ -1,10 +1,14 @@
+#include "pipe/p_screen.h"
+
#include "intel_be_device.h"
#include "intel_be_context.h"
#include "intel_be_batchbuffer.h"
#include "i915_drm.h"
+#include "intel_be_api.h"
+
static struct i915_batchbuffer *
intel_be_batch_get(struct i915_winsys *sws)
{
@@ -57,6 +61,21 @@ intel_be_batch_flush(struct i915_winsys *sws,
intel_be_batchbuffer_flush(intel->batch, f);
}
+
+/*
+ * Misc functions.
+ */
+
+static void
+intel_be_destroy_context(struct i915_winsys *winsys)
+{
+ struct intel_be_context *intel = intel_be_context(winsys);
+
+ intel_be_batchbuffer_free(intel->batch);
+
+ free(intel);
+}
+
boolean
intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *device)
{
@@ -68,13 +87,32 @@ intel_be_init_context(struct intel_be_context *intel, struct intel_be_device *de
intel->base.batch_reloc = intel_be_batch_reloc;
intel->base.batch_flush = intel_be_batch_flush;
+ intel->base.destroy = intel_be_destroy_context;
+
intel->batch = intel_be_batchbuffer_alloc(intel);
return true;
}
-void
-intel_be_destroy_context(struct intel_be_context *intel)
+struct pipe_context *
+intel_be_create_context(struct pipe_screen *screen)
{
- intel_be_batchbuffer_free(intel->batch);
+ struct intel_be_context *intel;
+ struct pipe_context *pipe;
+ struct intel_be_device *device = intel_be_device(screen->winsys);
+
+ intel = (struct intel_be_context *)malloc(sizeof(*intel));
+ memset(intel, 0, sizeof(*intel));
+
+ intel_be_init_context(intel, device);
+
+#if 0
+ pipe = intel_create_softpipe(intel, screen->winsys);
+#else
+ pipe = i915_create_context(screen, &device->base, &intel->base);
+#endif
+
+ pipe->priv = intel;
+
+ return pipe;
}
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.h b/src/gallium/winsys/drm/intel/gem/intel_be_context.h
index 9cee1a4e52..5a369669c0 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_context.h
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.h
@@ -11,15 +11,6 @@ struct intel_be_context
struct intel_be_device *device;
struct intel_be_batchbuffer *batch;
-
- /*
- * Hardware lock functions.
- *
- * Needs to be filled in by the winsys.
- */
- void (*hardware_lock)(struct intel_be_context *context);
- void (*hardware_unlock)(struct intel_be_context *context);
- boolean (*hardware_locked)(struct intel_be_context *context);
};
static INLINE struct intel_be_context *
@@ -37,12 +28,4 @@ boolean
intel_be_init_context(struct intel_be_context *intel,
struct intel_be_device *device);
-/**
- * Destroy a intel_be_context.
- *
- * Does not free the struct that is up to the winsys.
- */
-void
-intel_be_destroy_context(struct intel_be_context *intel);
-
#endif
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
index 82c1cb2f32..a2163a1e6d 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
@@ -11,15 +11,7 @@
#include "i915simple/i915_screen.h"
-
-/**
- * Turn a pipe winsys into an intel/pipe winsys:
- */
-static INLINE struct intel_be_device *
-intel_be_device(struct pipe_winsys *winsys)
-{
- return (struct intel_be_device *)winsys;
-}
+#include "intel_be_api.h"
/*
* Buffer
@@ -233,10 +225,21 @@ intel_be_fence_finish(struct pipe_winsys *sws,
* Misc functions
*/
+static void
+intel_be_destroy_winsys(struct pipe_winsys *winsys)
+{
+ struct intel_be_device *dev = intel_be_device(winsys);
+
+ drm_intel_bufmgr_destroy(dev->pools.gem);
+
+ free(dev);
+}
+
boolean
intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id)
{
dev->fd = fd;
+ dev->id = id;
dev->max_batch_size = 16 * 4096;
dev->max_vertex_size = 128 * 4096;
@@ -253,13 +256,28 @@ intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id)
dev->base.fence_signalled = intel_be_fence_signalled;
dev->base.fence_finish = intel_be_fence_finish;
+ dev->base.destroy = intel_be_destroy_winsys;
+
dev->pools.gem = drm_intel_bufmgr_gem_init(dev->fd, dev->max_batch_size);
return true;
}
-void
-intel_be_destroy_device(struct intel_be_device *dev)
+struct pipe_screen *
+intel_be_create_screen(int drmFD, int deviceID)
{
- drm_intel_bufmgr_destroy(dev->pools.gem);
+ struct intel_be_device *dev;
+ struct pipe_screen *screen;
+
+ /* Allocate the private area */
+ dev = malloc(sizeof(*dev));
+ if (!dev)
+ return NULL;
+ memset(dev, 0, sizeof(*dev));
+
+ intel_be_init_device(dev, drmFD, deviceID);
+
+ screen = i915_create_screen(&dev->base, deviceID);
+
+ return screen;
}
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h
index f06890163c..c4837e65fa 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h
@@ -18,6 +18,8 @@ struct intel_be_device
int fd; /**< Drm file discriptor */
+ unsigned id;
+
size_t max_batch_size;
size_t max_vertex_size;
@@ -26,12 +28,15 @@ struct intel_be_device
} pools;
};
+static INLINE struct intel_be_device *
+intel_be_device(struct pipe_winsys *winsys)
+{
+ return (struct intel_be_device *)winsys;
+}
+
boolean
intel_be_init_device(struct intel_be_device *device, int fd, unsigned id);
-void
-intel_be_destroy_device(struct intel_be_device *dev);
-
/*
* Buffer
*/
diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile b/src/gallium/winsys/drm/nouveau/common/Makefile
index 06f558959d..c6dd6dd7f9 100644
--- a/src/gallium/winsys/drm/nouveau/common/Makefile
+++ b/src/gallium/winsys/drm/nouveau/common/Makefile
@@ -4,29 +4,19 @@ include $(TOP)/configs/current
LIBNAME = nouveaudrm
C_SOURCES = \
- nouveau_bo.c \
- nouveau_channel.c \
- nouveau_context.c \
- nouveau_device.c \
- nouveau_dma.c \
- nouveau_fence.c \
- nouveau_grobj.c \
+ nouveau_context.c \
nouveau_lock.c \
- nouveau_notifier.c \
- nouveau_pushbuf.c \
- nouveau_resource.c \
nouveau_screen.c \
nouveau_winsys.c \
nouveau_winsys_pipe.c \
- nouveau_winsys_softpipe.c \
- nv04_surface.c \
- nv50_surface.c
-
+ nouveau_winsys_softpipe.c
include ./Makefile.template
DRIVER_DEFINES = $(shell pkg-config libdrm --cflags \
&& pkg-config libdrm --atleast-version=2.3.1 \
+ && pkg-config libdrm_nouveau --exact-version=0.5 \
+ && pkg-config libdrm_nouveau --cflags \
&& echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
symlinks:
diff --git a/src/gallium/winsys/drm/nouveau/common/Makefile.template b/src/gallium/winsys/drm/nouveau/common/Makefile.template
index e40836e0a8..f0d098bb1c 100644
--- a/src/gallium/winsys/drm/nouveau/common/Makefile.template
+++ b/src/gallium/winsys/drm/nouveau/common/Makefile.template
@@ -31,11 +31,11 @@ INCLUDES = \
##### TARGETS #####
-default: depend symlinks $(LIBNAME)
+default: depend symlinks lib$(LIBNAME).a
-$(LIBNAME): $(OBJECTS) Makefile Makefile.template
- $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS)
+lib$(LIBNAME).a: $(OBJECTS) Makefile Makefile.template
+ $(TOP)/bin/mklib -o $(LIBNAME) -static $(OBJECTS) $(DRIVER_LIBS)
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c b/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c
deleted file mode 100644
index 76b98bed67..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_bo.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 <stdint.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
-#include "nouveau_local.h"
-
-static void
-nouveau_mem_free(struct nouveau_device *dev, struct drm_nouveau_mem_alloc *ma,
- void **map)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- struct drm_nouveau_mem_free mf;
-
- if (map && *map) {
- drmUnmap(*map, ma->size);
- *map = NULL;
- }
-
- if (ma->size) {
- mf.offset = ma->offset;
- mf.flags = ma->flags;
- drmCommandWrite(nvdev->fd, DRM_NOUVEAU_MEM_FREE,
- &mf, sizeof(mf));
- ma->size = 0;
- }
-}
-
-static int
-nouveau_mem_alloc(struct nouveau_device *dev, unsigned size, unsigned align,
- uint32_t flags, struct drm_nouveau_mem_alloc *ma, void **map)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- int ret;
-
- ma->alignment = align;
- ma->size = size;
- ma->flags = flags;
- if (map)
- ma->flags |= NOUVEAU_MEM_MAPPED;
- ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_MEM_ALLOC, ma,
- sizeof(struct drm_nouveau_mem_alloc));
- if (ret)
- return ret;
-
- if (map) {
- ret = drmMap(nvdev->fd, ma->map_handle, ma->size, map);
- if (ret) {
- *map = NULL;
- nouveau_mem_free(dev, ma, map);
- return ret;
- }
- }
-
- return 0;
-}
-
-static void
-nouveau_bo_tmp_del(void *priv)
-{
- struct nouveau_resource *r = priv;
-
- nouveau_fence_ref(NULL, (struct nouveau_fence **)&r->priv);
- nouveau_resource_free(&r);
-}
-
-static unsigned
-nouveau_bo_tmp_max(struct nouveau_device_priv *nvdev)
-{
- struct nouveau_resource *r = nvdev->sa_heap;
- unsigned max = 0;
-
- while (r) {
- if (r->in_use && !nouveau_fence(r->priv)->emitted) {
- r = r->next;
- continue;
- }
-
- if (max < r->size)
- max = r->size;
- r = r->next;
- }
-
- return max;
-}
-
-static struct nouveau_resource *
-nouveau_bo_tmp(struct nouveau_channel *chan, unsigned size,
- struct nouveau_fence *fence)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(chan->device);
- struct nouveau_resource *r = NULL;
- struct nouveau_fence *ref = NULL;
-
- if (fence)
- nouveau_fence_ref(fence, &ref);
- else
- nouveau_fence_new(chan, &ref);
- assert(ref);
-
- while (nouveau_resource_alloc(nvdev->sa_heap, size, ref, &r)) {
- if (nouveau_bo_tmp_max(nvdev) < size) {
- nouveau_fence_ref(NULL, &ref);
- return NULL;
- }
-
- nouveau_fence_flush(chan);
- }
- nouveau_fence_signal_cb(ref, nouveau_bo_tmp_del, r);
-
- return r;
-}
-
-int
-nouveau_bo_init(struct nouveau_device *dev)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- int ret;
-
- ret = nouveau_mem_alloc(dev, 128*1024, 0, NOUVEAU_MEM_AGP |
- NOUVEAU_MEM_PCI, &nvdev->sa, &nvdev->sa_map);
- if (ret)
- return ret;
-
- ret = nouveau_resource_init(&nvdev->sa_heap, 0, nvdev->sa.size);
- if (ret) {
- nouveau_mem_free(dev, &nvdev->sa, &nvdev->sa_map);
- return ret;
- }
-
- return 0;
-}
-
-void
-nouveau_bo_takedown(struct nouveau_device *dev)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
-
- nouveau_mem_free(dev, &nvdev->sa, &nvdev->sa_map);
-}
-
-int
-nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, int align,
- int size, struct nouveau_bo **bo)
-{
- struct nouveau_bo_priv *nvbo;
- int ret;
-
- if (!dev || !bo || *bo)
- return -EINVAL;
-
- nvbo = calloc(1, sizeof(struct nouveau_bo_priv));
- if (!nvbo)
- return -ENOMEM;
- nvbo->base.device = dev;
- nvbo->base.size = size;
- nvbo->base.handle = bo_to_ptr(nvbo);
- nvbo->drm.alignment = align;
- nvbo->refcount = 1;
-
- if (flags & NOUVEAU_BO_TILED) {
- nvbo->tiled = 1;
- if (flags & NOUVEAU_BO_ZTILE)
- nvbo->tiled |= 2;
- flags &= ~NOUVEAU_BO_TILED;
- }
-
- ret = nouveau_bo_set_status(&nvbo->base, flags);
- if (ret) {
- free(nvbo);
- return ret;
- }
-
- *bo = &nvbo->base;
- return 0;
-}
-
-int
-nouveau_bo_user(struct nouveau_device *dev, void *ptr, int size,
- struct nouveau_bo **bo)
-{
- struct nouveau_bo_priv *nvbo;
-
- if (!dev || !bo || *bo)
- return -EINVAL;
-
- nvbo = calloc(1, sizeof(*nvbo));
- if (!nvbo)
- return -ENOMEM;
- nvbo->base.device = dev;
-
- nvbo->sysmem = ptr;
- nvbo->user = 1;
-
- nvbo->base.size = size;
- nvbo->base.offset = nvbo->drm.offset;
- nvbo->base.handle = bo_to_ptr(nvbo);
- nvbo->refcount = 1;
- *bo = &nvbo->base;
- return 0;
-}
-
-int
-nouveau_bo_ref(struct nouveau_device *dev, uint64_t handle,
- struct nouveau_bo **bo)
-{
- struct nouveau_bo_priv *nvbo = ptr_to_bo(handle);
-
- if (!dev || !bo || *bo)
- return -EINVAL;
-
- nvbo->refcount++;
- *bo = &nvbo->base;
- return 0;
-}
-
-static void
-nouveau_bo_del_cb(void *priv)
-{
- struct nouveau_bo_priv *nvbo = priv;
-
- nouveau_fence_ref(NULL, &nvbo->fence);
- nouveau_mem_free(nvbo->base.device, &nvbo->drm, &nvbo->map);
- if (nvbo->sysmem && !nvbo->user)
- free(nvbo->sysmem);
- free(nvbo);
-}
-
-void
-nouveau_bo_del(struct nouveau_bo **bo)
-{
- struct nouveau_bo_priv *nvbo;
-
- if (!bo || !*bo)
- return;
- nvbo = nouveau_bo(*bo);
- *bo = NULL;
-
- if (--nvbo->refcount)
- return;
-
- if (nvbo->pending)
- nouveau_pushbuf_flush(nvbo->pending->channel, 0);
-
- if (nvbo->fence)
- nouveau_fence_signal_cb(nvbo->fence, nouveau_bo_del_cb, nvbo);
- else
- nouveau_bo_del_cb(nvbo);
-}
-
-int
-nouveau_bo_busy(struct nouveau_bo *bo, uint32_t flags)
-{
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- struct nouveau_fence *fence;
-
- if (!nvbo)
- return -EINVAL;
-
- /* If the buffer is pending it must be busy, unless
- * both are RD, in which case we can allow access */
- if (nvbo->pending) {
- if ((nvbo->pending->flags & NOUVEAU_BO_RDWR) == NOUVEAU_BO_RD &&
- (flags & NOUVEAU_BO_RDWR) == NOUVEAU_BO_RD)
- return 0;
- else
- return 1;
- }
-
- if (flags & NOUVEAU_BO_WR)
- fence = nvbo->fence;
- else
- fence = nvbo->wr_fence;
-
- /* If the buffer is not pending and doesn't have a fence
- * that conflicts with our flags then it can't be busy
- */
- if (!fence)
- return 0;
- else
- /* If the fence is signalled the buffer is not busy, else is busy */
- return !nouveau_fence(fence)->signalled;
-}
-
-int
-nouveau_bo_map(struct nouveau_bo *bo, uint32_t flags)
-{
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
-
- if (!nvbo)
- return -EINVAL;
-
- if (nvbo->pending &&
- (nvbo->pending->flags & NOUVEAU_BO_WR || flags & NOUVEAU_BO_WR)) {
- nouveau_pushbuf_flush(nvbo->pending->channel, 0);
- }
-
- if (flags & NOUVEAU_BO_WR)
- nouveau_fence_wait(&nvbo->fence);
- else
- nouveau_fence_wait(&nvbo->wr_fence);
-
- if (nvbo->sysmem)
- bo->map = nvbo->sysmem;
- else
- bo->map = nvbo->map;
- return 0;
-}
-
-void
-nouveau_bo_unmap(struct nouveau_bo *bo)
-{
- bo->map = NULL;
-}
-
-static int
-nouveau_bo_upload(struct nouveau_bo_priv *nvbo)
-{
- if (nvbo->fence)
- nouveau_fence_wait(&nvbo->fence);
- memcpy(nvbo->map, nvbo->sysmem, nvbo->drm.size);
- return 0;
-}
-
-int
-nouveau_bo_set_status(struct nouveau_bo *bo, uint32_t flags)
-{
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- struct drm_nouveau_mem_alloc new;
- void *new_map = NULL, *new_sysmem = NULL;
- unsigned new_flags = 0, ret;
-
- assert(!bo->map);
-
- /* Check current memtype vs requested, if they match do nothing */
- if ((nvbo->drm.flags & NOUVEAU_MEM_FB) && (flags & NOUVEAU_BO_VRAM))
- return 0;
- if ((nvbo->drm.flags & (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI)) &&
- (flags & NOUVEAU_BO_GART))
- return 0;
- if (nvbo->drm.size == 0 && nvbo->sysmem && (flags & NOUVEAU_BO_LOCAL))
- return 0;
-
- memset(&new, 0x00, sizeof(new));
-
- /* Allocate new memory */
- if (flags & NOUVEAU_BO_VRAM)
- new_flags |= NOUVEAU_MEM_FB;
- else
- if (flags & NOUVEAU_BO_GART)
- new_flags |= (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI);
-
- if (nvbo->tiled && flags) {
- new_flags |= NOUVEAU_MEM_TILE;
- if (nvbo->tiled & 2)
- new_flags |= NOUVEAU_MEM_TILE_ZETA;
- }
-
- if (new_flags) {
- ret = nouveau_mem_alloc(bo->device, bo->size,
- nvbo->drm.alignment, new_flags,
- &new, &new_map);
- if (ret)
- return ret;
- } else
- if (!nvbo->user) {
- new_sysmem = malloc(bo->size);
- }
-
- /* Copy old -> new */
- /*XXX: use M2MF */
- if (nvbo->sysmem || nvbo->map) {
- struct nouveau_pushbuf_bo *pbo = nvbo->pending;
- nvbo->pending = NULL;
- nouveau_bo_map(bo, NOUVEAU_BO_RD);
- memcpy(new_map, bo->map, bo->size);
- nouveau_bo_unmap(bo);
- nvbo->pending = pbo;
- }
-
- /* Free old memory */
- if (nvbo->fence)
- nouveau_fence_wait(&nvbo->fence);
- nouveau_mem_free(bo->device, &nvbo->drm, &nvbo->map);
- if (nvbo->sysmem && !nvbo->user)
- free(nvbo->sysmem);
-
- nvbo->drm = new;
- nvbo->map = new_map;
- if (!nvbo->user)
- nvbo->sysmem = new_sysmem;
- bo->flags = flags;
- bo->offset = nvbo->drm.offset;
- return 0;
-}
-
-static int
-nouveau_bo_validate_user(struct nouveau_channel *chan, struct nouveau_bo *bo,
- struct nouveau_fence *fence, uint32_t flags)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_device_priv *nvdev = nouveau_device(chan->device);
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- struct nouveau_resource *r;
-
- if (nvchan->user_charge + bo->size > nvdev->sa.size)
- return 1;
-
- if (!(flags & NOUVEAU_BO_GART))
- return 1;
-
- r = nouveau_bo_tmp(chan, bo->size, fence);
- if (!r)
- return 1;
- nvchan->user_charge += bo->size;
-
- memcpy(nvdev->sa_map + r->start, nvbo->sysmem, bo->size);
-
- nvbo->offset = nvdev->sa.offset + r->start;
- nvbo->flags = NOUVEAU_BO_GART;
- return 0;
-}
-
-static int
-nouveau_bo_validate_bo(struct nouveau_channel *chan, struct nouveau_bo *bo,
- struct nouveau_fence *fence, uint32_t flags)
-{
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- int ret;
-
- ret = nouveau_bo_set_status(bo, flags);
- if (ret) {
- nouveau_fence_flush(chan);
-
- ret = nouveau_bo_set_status(bo, flags);
- if (ret)
- return ret;
- }
-
- if (nvbo->user)
- nouveau_bo_upload(nvbo);
-
- nvbo->offset = nvbo->drm.offset;
- if (nvbo->drm.flags & (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI))
- nvbo->flags = NOUVEAU_BO_GART;
- else
- nvbo->flags = NOUVEAU_BO_VRAM;
-
- return 0;
-}
-
-int
-nouveau_bo_validate(struct nouveau_channel *chan, struct nouveau_bo *bo,
- uint32_t flags)
-{
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- struct nouveau_fence *fence = nouveau_pushbuf(chan->pushbuf)->fence;
- int ret;
-
- assert(bo->map == NULL);
-
- if (nvbo->user) {
- ret = nouveau_bo_validate_user(chan, bo, fence, flags);
- if (ret) {
- ret = nouveau_bo_validate_bo(chan, bo, fence, flags);
- if (ret)
- return ret;
- }
- } else {
- ret = nouveau_bo_validate_bo(chan, bo, fence, flags);
- if (ret)
- return ret;
- }
-
- if (flags & NOUVEAU_BO_WR)
- nouveau_fence_ref(fence, &nvbo->wr_fence);
- nouveau_fence_ref(fence, &nvbo->fence);
- return 0;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c b/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c
deleted file mode 100644
index b7298131c1..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_channel.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <util/u_memory.h>
-#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
-
-int
-nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma,
- uint32_t tt_ctxdma, struct nouveau_channel **chan)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- struct nouveau_channel_priv *nvchan;
- int ret;
-
- if (!nvdev || !chan || *chan)
- return -EINVAL;
-
- nvchan = CALLOC_STRUCT(nouveau_channel_priv);
- if (!nvchan)
- return -ENOMEM;
- nvchan->base.device = dev;
-
- nvchan->drm.fb_ctxdma_handle = fb_ctxdma;
- nvchan->drm.tt_ctxdma_handle = tt_ctxdma;
- ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
- &nvchan->drm, sizeof(nvchan->drm));
- if (ret) {
- FREE(nvchan);
- return ret;
- }
-
- nvchan->base.id = nvchan->drm.channel;
- if (nouveau_grobj_ref(&nvchan->base, nvchan->drm.fb_ctxdma_handle,
- &nvchan->base.vram) ||
- nouveau_grobj_ref(&nvchan->base, nvchan->drm.tt_ctxdma_handle,
- &nvchan->base.gart)) {
- nouveau_channel_free((void *)&nvchan);
- return -EINVAL;
- }
-
- ret = drmMap(nvdev->fd, nvchan->drm.ctrl, nvchan->drm.ctrl_size,
- (void*)&nvchan->user);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
- }
- nvchan->put = &nvchan->user[0x40/4];
- nvchan->get = &nvchan->user[0x44/4];
- nvchan->ref_cnt = &nvchan->user[0x48/4];
-
- ret = drmMap(nvdev->fd, nvchan->drm.notifier, nvchan->drm.notifier_size,
- (drmAddressPtr)&nvchan->notifier_block);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
- }
-
- ret = drmMap(nvdev->fd, nvchan->drm.cmdbuf, nvchan->drm.cmdbuf_size,
- (void*)&nvchan->pushbuf);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
- }
-
- ret = nouveau_grobj_alloc(&nvchan->base, 0x00000000, 0x0030,
- &nvchan->base.nullobj);
- if (ret) {
- nouveau_channel_free((void *)&nvchan);
- return ret;
- }
-
- nouveau_dma_channel_init(&nvchan->base);
- nouveau_pushbuf_init(&nvchan->base);
-
- *chan = &nvchan->base;
- return 0;
-}
-
-void
-nouveau_channel_free(struct nouveau_channel **chan)
-{
- struct nouveau_channel_priv *nvchan;
- struct nouveau_device_priv *nvdev;
- struct drm_nouveau_channel_free cf;
-
- if (!chan || !*chan)
- return;
- nvchan = nouveau_channel(*chan);
- *chan = NULL;
- nvdev = nouveau_device(nvchan->base.device);
-
- FIRE_RING_CH(&nvchan->base);
-
- nouveau_grobj_free(&nvchan->base.vram);
- nouveau_grobj_free(&nvchan->base.gart);
- nouveau_grobj_free(&nvchan->base.nullobj);
-
- FREE(nvchan->pb.buffers);
- FREE(nvchan->pb.relocs);
- cf.channel = nvchan->drm.channel;
- drmCommandWrite(nvdev->fd, DRM_NOUVEAU_CHANNEL_FREE, &cf, sizeof(cf));
- FREE(nvchan);
-}
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
index e093877381..d6ae0827cd 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
@@ -11,16 +11,6 @@
static void
nouveau_channel_context_destroy(struct nouveau_channel_context *nvc)
{
- nouveau_grobj_free(&nvc->NvCtxSurf2D);
- nouveau_grobj_free(&nvc->NvImageBlit);
- nouveau_grobj_free(&nvc->NvGdiRect);
- nouveau_grobj_free(&nvc->NvM2MF);
- nouveau_grobj_free(&nvc->Nv2D);
- nouveau_grobj_free(&nvc->NvSwzSurf);
- nouveau_grobj_free(&nvc->NvSIFM);
-
- nouveau_notifier_free(&nvc->sync_notifier);
-
nouveau_channel_free(&nvc->channel);
FREE(nvc);
@@ -43,32 +33,7 @@ nouveau_channel_context_create(struct nouveau_device *dev)
return NULL;
}
- nvc->next_handle = 0x80000000;
-
- if ((ret = nouveau_notifier_alloc(nvc->channel, nvc->next_handle++, 1,
- &nvc->sync_notifier))) {
- NOUVEAU_ERR("Error creating channel sync notifier: %d\n", ret);
- nouveau_channel_context_destroy(nvc);
- return NULL;
- }
-
- switch (dev->chipset & 0xf0) {
- case 0x50:
- case 0x80:
- case 0x90:
- ret = nouveau_surface_channel_create_nv50(nvc);
- break;
- default:
- ret = nouveau_surface_channel_create_nv04(nvc);
- break;
- }
-
- if (ret) {
- NOUVEAU_ERR("Error initialising surface objects: %d\n", ret);
- nouveau_channel_context_destroy(nvc);
- return NULL;
- }
-
+ nvc->next_handle = 0x77000000;
return nvc;
}
@@ -113,45 +78,6 @@ nouveau_context_init(struct nouveau_screen *nv_screen,
nvdev->lock = sarea_lock;
}
- /*XXX: Hack up a fake region and buffer object for front buffer.
- * This will go away with TTM, replaced with a simple reference
- * of the front buffer handle passed to us by the DDX.
- */
- {
- struct pipe_surface *fb_surf;
- struct nouveau_pipe_buffer *fb_buf;
- struct nouveau_bo_priv *fb_bo;
-
- fb_bo = calloc(1, sizeof(struct nouveau_bo_priv));
- fb_bo->drm.offset = nv_screen->front_offset;
- fb_bo->drm.flags = NOUVEAU_MEM_FB;
- fb_bo->drm.size = nv_screen->front_pitch *
- nv_screen->front_height;
- fb_bo->refcount = 1;
- fb_bo->base.flags = NOUVEAU_BO_PIN | NOUVEAU_BO_VRAM;
- fb_bo->base.offset = fb_bo->drm.offset;
- fb_bo->base.handle = (unsigned long)fb_bo;
- fb_bo->base.size = fb_bo->drm.size;
- fb_bo->base.device = nv_screen->device;
-
- fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer));
- fb_buf->bo = &fb_bo->base;
-
- fb_surf = calloc(1, sizeof(struct pipe_surface));
- if (nv_screen->front_cpp == 2)
- fb_surf->format = PIPE_FORMAT_R5G6B5_UNORM;
- else
- fb_surf->format = PIPE_FORMAT_A8R8G8B8_UNORM;
- pf_get_block(fb_surf->format, &fb_surf->block);
- fb_surf->width = nv_screen->front_pitch / nv_screen->front_cpp;
- fb_surf->height = nv_screen->front_height;
- fb_surf->stride = fb_surf->width * fb_surf->block.size;
- fb_surf->refcount = 1;
- fb_surf->buffer = &fb_buf->base;
-
- nv->frontbuffer = fb_surf;
- }
-
/* Attempt to share a single channel between multiple contexts from
* a single process.
*/
@@ -203,19 +129,6 @@ nouveau_context_init(struct nouveau_screen *nv_screen,
}
/* Create pipe */
- switch (dev->chipset & 0xf0) {
- case 0x50:
- case 0x80:
- case 0x90:
- if (nouveau_surface_init_nv50(nv))
- return 1;
- break;
- default:
- if (nouveau_surface_init_nv04(nv))
- return 1;
- break;
- }
-
if (!getenv("NOUVEAU_FORCE_SOFTPIPE")) {
struct pipe_screen *pscreen;
@@ -239,8 +152,37 @@ nouveau_context_init(struct nouveau_screen *nv_screen,
}
}
- pipe->priv = nv;
+ {
+ struct pipe_texture *fb_tex;
+ struct pipe_surface *fb_surf;
+ struct nouveau_pipe_buffer *fb_buf;
+ enum pipe_format format;
+
+ fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer));
+ fb_buf->base.refcount = 1;
+ fb_buf->base.usage = PIPE_BUFFER_USAGE_PIXEL;
+
+ nouveau_bo_fake(dev, nv_screen->front_offset, NOUVEAU_BO_VRAM,
+ nv_screen->front_pitch*nv_screen->front_height,
+ NULL, &fb_buf->bo);
+ if (nv_screen->front_cpp == 4)
+ format = PIPE_FORMAT_A8R8G8B8_UNORM;
+ else
+ format = PIPE_FORMAT_R5G6B5_UNORM;
+
+ fb_surf = nouveau_surface_buffer_ref(nv, &fb_buf->base, format,
+ nv_screen->front_pitch /
+ nv_screen->front_cpp,
+ nv_screen->front_height,
+ nv_screen->front_pitch,
+ &fb_tex);
+
+ nv->frontbuffer = fb_surf;
+ nv->frontbuffer_texture = fb_tex;
+ }
+
+ pipe->priv = nv;
return 0;
}
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h
index b1bdb01bdf..02d2745680 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.h
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.h
@@ -3,7 +3,14 @@
#include "nouveau/nouveau_winsys.h"
#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
+#include "nouveau_device.h"
+#include "nouveau_channel.h"
+#include "nouveau_pushbuf.h"
+#include "nouveau_bo.h"
+#include "nouveau_grobj.h"
+#include "nouveau_notifier.h"
+#include "nouveau_class.h"
+#include "nouveau_local.h"
struct nouveau_channel_context {
struct pipe_screen *pscreen;
@@ -14,29 +21,14 @@ struct nouveau_channel_context {
struct pipe_context **pctx;
struct nouveau_channel *channel;
-
- struct nouveau_notifier *sync_notifier;
-
- /* Common */
- struct nouveau_grobj *NvM2MF;
- /* NV04-NV40 */
- struct nouveau_grobj *NvCtxSurf2D;
- struct nouveau_grobj *NvSwzSurf;
- struct nouveau_grobj *NvImageBlit;
- struct nouveau_grobj *NvGdiRect;
- struct nouveau_grobj *NvSIFM;
- /* G80 */
- struct nouveau_grobj *Nv2D;
-
- uint32_t next_handle;
- uint32_t next_subchannel;
- uint32_t next_sequence;
+ unsigned next_handle;
};
struct nouveau_context {
int locked;
struct nouveau_screen *nv_screen;
struct pipe_surface *frontbuffer;
+ struct pipe_texture *frontbuffer_texture;
struct {
int hw_vertex_buffer;
@@ -46,18 +38,6 @@ struct nouveau_context {
/* Hardware context */
struct nouveau_channel_context *nvc;
int pctx_id;
-
- /* pipe_surface accel */
- struct pipe_surface *surf_src, *surf_dst;
- unsigned surf_src_offset, surf_dst_offset;
- int (*surface_copy_prep)(struct nouveau_context *,
- struct pipe_surface *dst,
- struct pipe_surface *src);
- void (*surface_copy)(struct nouveau_context *, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h);
- void (*surface_copy_done)(struct nouveau_context *);
- int (*surface_fill)(struct nouveau_context *, struct pipe_surface *,
- unsigned, unsigned, unsigned, unsigned, unsigned);
};
extern int nouveau_context_init(struct nouveau_screen *nv_screen,
@@ -69,13 +49,6 @@ extern void nouveau_context_cleanup(struct nouveau_context *nv);
extern void LOCK_HARDWARE(struct nouveau_context *);
extern void UNLOCK_HARDWARE(struct nouveau_context *);
-extern int
-nouveau_surface_channel_create_nv04(struct nouveau_channel_context *);
-extern int
-nouveau_surface_channel_create_nv50(struct nouveau_channel_context *);
-extern int nouveau_surface_init_nv04(struct nouveau_context *);
-extern int nouveau_surface_init_nv50(struct nouveau_context *);
-
extern uint32_t *nouveau_pipe_dma_beginp(struct nouveau_grobj *, int, int);
extern void nouveau_pipe_dma_kickoff(struct nouveau_channel *);
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_device.c b/src/gallium/winsys/drm/nouveau/common/nouveau_device.c
deleted file mode 100644
index 92b57b834b..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_device.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <util/u_memory.h>
-#include "nouveau_drmif.h"
-
-int
-nouveau_device_open_existing(struct nouveau_device **dev, int close,
- int fd, drm_context_t ctx)
-{
- struct nouveau_device_priv *nvdev;
- int ret;
-
- if (!dev || *dev)
- return -EINVAL;
-
- nvdev = CALLOC_STRUCT(nouveau_device_priv);
- if (!nvdev)
- return -ENOMEM;
- nvdev->fd = fd;
- nvdev->ctx = ctx;
- nvdev->needs_close = close;
-
- drmCommandNone(nvdev->fd, DRM_NOUVEAU_CARD_INIT);
-
- if ((ret = nouveau_bo_init(&nvdev->base))) {
- nouveau_device_close((void *)&nvdev);
- return ret;
- }
-
- {
- uint64_t value;
-
- ret = nouveau_device_get_param(&nvdev->base,
- NOUVEAU_GETPARAM_CHIPSET_ID,
- &value);
- if (ret) {
- nouveau_device_close((void *)&nvdev);
- return ret;
- }
- nvdev->base.chipset = value;
- }
-
- *dev = &nvdev->base;
- return 0;
-}
-
-int
-nouveau_device_open(struct nouveau_device **dev, const char *busid)
-{
- drm_context_t ctx;
- int fd, ret;
-
- if (!dev || *dev)
- return -EINVAL;
-
- fd = drmOpen("nouveau", busid);
- if (fd < 0)
- return -EINVAL;
-
- ret = drmCreateContext(fd, &ctx);
- if (ret) {
- drmClose(fd);
- return ret;
- }
-
- ret = nouveau_device_open_existing(dev, 1, fd, ctx);
- if (ret) {
- drmDestroyContext(fd, ctx);
- drmClose(fd);
- return ret;
- }
-
- return 0;
-}
-
-void
-nouveau_device_close(struct nouveau_device **dev)
-{
- struct nouveau_device_priv *nvdev;
-
- if (dev || !*dev)
- return;
- nvdev = nouveau_device(*dev);
- *dev = NULL;
-
- nouveau_bo_takedown(&nvdev->base);
-
- if (nvdev->needs_close) {
- drmDestroyContext(nvdev->fd, nvdev->ctx);
- drmClose(nvdev->fd);
- }
- FREE(nvdev);
-}
-
-int
-nouveau_device_get_param(struct nouveau_device *dev,
- uint64_t param, uint64_t *value)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- struct drm_nouveau_getparam g;
- int ret;
-
- if (!nvdev || !value)
- return -EINVAL;
-
- g.param = param;
- ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GETPARAM,
- &g, sizeof(g));
- if (ret)
- return ret;
-
- *value = g.value;
- return 0;
-}
-
-int
-nouveau_device_set_param(struct nouveau_device *dev,
- uint64_t param, uint64_t value)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
- struct drm_nouveau_setparam s;
- int ret;
-
- if (!nvdev)
- return -EINVAL;
-
- s.param = param;
- s.value = value;
- ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_SETPARAM,
- &s, sizeof(s));
- if (ret)
- return ret;
-
- return 0;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c b/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c
deleted file mode 100644
index f8a8ba04f6..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 <stdint.h>
-#include <assert.h>
-#include <errno.h>
-
-#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
-#include "nouveau_local.h"
-
-static inline uint32_t
-READ_GET(struct nouveau_channel_priv *nvchan)
-{
- return *nvchan->get;
-}
-
-static inline void
-WRITE_PUT(struct nouveau_channel_priv *nvchan, uint32_t val)
-{
- uint32_t put = ((val << 2) + nvchan->dma->base);
- volatile int dum;
-
- NOUVEAU_DMA_BARRIER;
- dum = READ_GET(nvchan);
-
- *nvchan->put = put;
- nvchan->dma->put = val;
-#ifdef NOUVEAU_DMA_TRACE
- NOUVEAU_MSG("WRITE_PUT %d/0x%08x\n", nvchan->drm.channel, put);
-#endif
-
- NOUVEAU_DMA_BARRIER;
-}
-
-static inline int
-LOCAL_GET(struct nouveau_dma_priv *dma, uint32_t *val)
-{
- uint32_t get = *val;
-
- if (get >= dma->base && get <= (dma->base + (dma->max << 2))) {
- *val = (get - dma->base) >> 2;
- return 1;
- }
-
- return 0;
-}
-
-void
-nouveau_dma_channel_init(struct nouveau_channel *chan)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- int i;
-
- nvchan->dma = &nvchan->dma_master;
- nvchan->dma->base = nvchan->drm.put_base;
- nvchan->dma->cur = nvchan->dma->put = 0;
- nvchan->dma->max = (nvchan->drm.cmdbuf_size >> 2) - 2;
- nvchan->dma->free = nvchan->dma->max - nvchan->dma->cur;
-
- RING_SPACE_CH(chan, RING_SKIPS);
- for (i = 0; i < RING_SKIPS; i++)
- OUT_RING_CH(chan, 0);
-}
-
-#define CHECK_TIMEOUT() do { \
- if ((NOUVEAU_TIME_MSEC() - t_start) > NOUVEAU_DMA_TIMEOUT) \
- return - EBUSY; \
-} while(0)
-
-int
-nouveau_dma_wait(struct nouveau_channel *chan, int size)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
- uint32_t get, t_start;
-
- FIRE_RING_CH(chan);
-
- t_start = NOUVEAU_TIME_MSEC();
- while (dma->free < size) {
- CHECK_TIMEOUT();
-
- get = READ_GET(nvchan);
- if (!LOCAL_GET(dma, &get))
- continue;
-
- if (dma->put >= get) {
- dma->free = dma->max - dma->cur;
-
- if (dma->free < size) {
-#ifdef NOUVEAU_DMA_DEBUG
- dma->push_free = 1;
-#endif
- OUT_RING_CH(chan, 0x20000000 | dma->base);
- if (get <= RING_SKIPS) {
- /*corner case - will be idle*/
- if (dma->put <= RING_SKIPS)
- WRITE_PUT(nvchan,
- RING_SKIPS + 1);
-
- do {
- CHECK_TIMEOUT();
- get = READ_GET(nvchan);
- if (!LOCAL_GET(dma, &get))
- get = 0;
- } while (get <= RING_SKIPS);
- }
-
- WRITE_PUT(nvchan, RING_SKIPS);
- dma->cur = dma->put = RING_SKIPS;
- dma->free = get - (RING_SKIPS + 1);
- }
- } else {
- dma->free = get - dma->cur - 1;
- }
- }
-
- return 0;
-}
-
-#ifdef NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF
-static void
-nouveau_dma_parse_pushbuf(struct nouveau_channel *chan, int get, int put)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- unsigned mthd_count = 0;
-
- while (get != put) {
- uint32_t gpuget = (get << 2) + nvchan->drm.put_base;
- uint32_t data;
-
- if (get < 0 || get >= nvchan->drm.cmdbuf_size) {
- NOUVEAU_ERR("DMA_PT 0x%08x\n", gpuget);
- assert(0);
- }
- data = nvchan->pushbuf[get++];
-
- if (mthd_count) {
- NOUVEAU_MSG("0x%08x 0x%08x\n", gpuget, data);
- mthd_count--;
- continue;
- }
-
- switch (data & 0x60000000) {
- case 0x00000000:
- mthd_count = (data >> 18) & 0x7ff;
- NOUVEAU_MSG("0x%08x 0x%08x MTHD "
- "Sc %d Mthd 0x%04x Size %d\n",
- gpuget, data, (data>>13) & 7, data & 0x1ffc,
- mthd_count);
- break;
- case 0x20000000:
- get = (data & 0x1ffffffc) >> 2;
- NOUVEAU_MSG("0x%08x 0x%08x JUMP 0x%08x\n",
- gpuget, data, data & 0x1ffffffc);
- continue;
- case 0x40000000:
- mthd_count = (data >> 18) & 0x7ff;
- NOUVEAU_MSG("0x%08x 0x%08x NINC "
- "Sc %d Mthd 0x%04x Size %d\n",
- gpuget, data, (data>>13) & 7, data & 0x1ffc,
- mthd_count);
- break;
- case 0x60000000:
- /* DMA_OPCODE_CALL apparently, doesn't seem to work on
- * my NV40 at least..
- */
- /* fall-through */
- default:
- NOUVEAU_MSG("DMA_PUSHER 0x%08x 0x%08x\n",
- gpuget, data);
- assert(0);
- }
- }
-}
-#endif
-
-void
-nouveau_dma_kickoff(struct nouveau_channel *chan)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
-
- if (dma->cur == dma->put)
- return;
-
-#ifdef NOUVEAU_DMA_DEBUG
- if (dma->push_free) {
- NOUVEAU_ERR("Packet incomplete: %d left\n", dma->push_free);
- return;
- }
-#endif
-
-#ifdef NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF
- nouveau_dma_parse_pushbuf(chan, dma->put, dma->cur);
-#endif
-
- WRITE_PUT(nvchan, dma->cur);
-}
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h b/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h
deleted file mode 100644
index cfa6d26e82..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_dma.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_DMA_H__
-#define __NOUVEAU_DMA_H__
-
-#include <string.h>
-#include "nouveau_drmif.h"
-#include "nouveau_local.h"
-
-#define RING_SKIPS 8
-
-extern int nouveau_dma_wait(struct nouveau_channel *chan, int size);
-extern void nouveau_dma_subc_bind(struct nouveau_grobj *);
-extern void nouveau_dma_channel_init(struct nouveau_channel *);
-extern void nouveau_dma_kickoff(struct nouveau_channel *);
-
-#ifdef NOUVEAU_DMA_DEBUG
-static char faulty[1024];
-#endif
-
-static inline void
-nouveau_dma_out(struct nouveau_channel *chan, uint32_t data)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
-
-#ifdef NOUVEAU_DMA_DEBUG
- if (dma->push_free == 0) {
- NOUVEAU_ERR("No space left in packet at %s\n", faulty);
- return;
- }
- dma->push_free--;
-#endif
-#ifdef NOUVEAU_DMA_TRACE
- {
- uint32_t offset = (dma->cur << 2) + dma->base;
- NOUVEAU_MSG("\tOUT_RING %d/0x%08x -> 0x%08x\n",
- nvchan->drm.channel, offset, data);
- }
-#endif
- nvchan->pushbuf[dma->cur + (dma->base - nvchan->drm.put_base)/4] = data;
- dma->cur++;
-}
-
-static inline void
-nouveau_dma_outp(struct nouveau_channel *chan, uint32_t *ptr, int size)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
- (void)dma;
-
-#ifdef NOUVEAU_DMA_DEBUG
- if (dma->push_free < size) {
- NOUVEAU_ERR("Packet too small. Free=%d, Need=%d\n",
- dma->push_free, size);
- return;
- }
-#endif
-#ifdef NOUVEAU_DMA_TRACE
- while (size--) {
- nouveau_dma_out(chan, *ptr);
- ptr++;
- }
-#else
- memcpy(&nvchan->pushbuf[dma->cur], ptr, size << 2);
-#ifdef NOUVEAU_DMA_DEBUG
- dma->push_free -= size;
-#endif
- dma->cur += size;
-#endif
-}
-
-static inline void
-nouveau_dma_space(struct nouveau_channel *chan, int size)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
-
- if (dma->free < size) {
- if (nouveau_dma_wait(chan, size) && chan->hang_notify)
- chan->hang_notify(chan);
- }
- dma->free -= size;
-#ifdef NOUVEAU_DMA_DEBUG
- dma->push_free = size;
-#endif
-}
-
-static inline void
-nouveau_dma_begin(struct nouveau_channel *chan, struct nouveau_grobj *grobj,
- int method, int size, const char* file, int line)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *dma = nvchan->dma;
- (void)dma;
-
-#ifdef NOUVEAU_DMA_TRACE
- NOUVEAU_MSG("BEGIN_RING %d/%08x/%d/0x%04x/%d\n", nvchan->drm.channel,
- grobj->handle, grobj->subc, method, size);
-#endif
-
-#ifdef NOUVEAU_DMA_DEBUG
- if (dma->push_free) {
- NOUVEAU_ERR("Previous packet incomplete: %d left at %s\n",
- dma->push_free, faulty);
- return;
- }
- sprintf(faulty,"%s:%d",file,line);
-#endif
-
- nouveau_dma_space(chan, (size + 1));
- nouveau_dma_out(chan, (size << 18) | (grobj->subc << 13) | method);
-}
-
-#define RING_SPACE_CH(ch,sz) nouveau_dma_space((ch), (sz))
-#define BEGIN_RING_CH(ch,gr,m,sz) nouveau_dma_begin((ch), (gr), (m), (sz), __FUNCTION__, __LINE__ )
-#define OUT_RING_CH(ch, data) nouveau_dma_out((ch), (data))
-#define OUT_RINGp_CH(ch,ptr,dwords) nouveau_dma_outp((ch), (void*)(ptr), \
- (dwords))
-#define FIRE_RING_CH(ch) nouveau_dma_kickoff((ch))
-#define WAIT_RING_CH(ch,sz) nouveau_dma_wait((ch), (sz))
-
-#endif
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h b/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h
deleted file mode 100644
index 5f72800676..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_drmif.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION 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 __NOUVEAU_DRMIF_H__
-#define __NOUVEAU_DRMIF_H__
-
-#include <stdint.h>
-#include <xf86drm.h>
-#include <nouveau_drm.h>
-
-#include "nouveau/nouveau_device.h"
-#include "nouveau/nouveau_channel.h"
-#include "nouveau/nouveau_grobj.h"
-#include "nouveau/nouveau_notifier.h"
-#include "nouveau/nouveau_bo.h"
-#include "nouveau/nouveau_resource.h"
-#include "nouveau/nouveau_pushbuf.h"
-
-struct nouveau_device_priv {
- struct nouveau_device base;
-
- int fd;
- drm_context_t ctx;
- drmLock *lock;
- int needs_close;
-
- struct drm_nouveau_mem_alloc sa;
- void *sa_map;
- struct nouveau_resource *sa_heap;
-};
-#define nouveau_device(n) ((struct nouveau_device_priv *)(n))
-
-extern int
-nouveau_device_open_existing(struct nouveau_device **, int close,
- int fd, drm_context_t ctx);
-
-extern int
-nouveau_device_open(struct nouveau_device **, const char *busid);
-
-extern void
-nouveau_device_close(struct nouveau_device **);
-
-extern int
-nouveau_device_get_param(struct nouveau_device *, uint64_t param, uint64_t *v);
-
-extern int
-nouveau_device_set_param(struct nouveau_device *, uint64_t param, uint64_t val);
-
-struct nouveau_fence {
- struct nouveau_channel *channel;
-};
-
-struct nouveau_fence_cb {
- struct nouveau_fence_cb *next;
- void (*func)(void *);
- void *priv;
-};
-
-struct nouveau_fence_priv {
- struct nouveau_fence base;
- int refcount;
-
- struct nouveau_fence *next;
- struct nouveau_fence_cb *signal_cb;
-
- uint32_t sequence;
- int emitted;
- int signalled;
-};
-#define nouveau_fence(n) ((struct nouveau_fence_priv *)(n))
-
-extern int
-nouveau_fence_new(struct nouveau_channel *, struct nouveau_fence **);
-
-extern int
-nouveau_fence_ref(struct nouveau_fence *, struct nouveau_fence **);
-
-extern int
-nouveau_fence_signal_cb(struct nouveau_fence *, void (*)(void *), void *);
-
-extern void
-nouveau_fence_emit(struct nouveau_fence *);
-
-extern int
-nouveau_fence_wait(struct nouveau_fence **);
-
-extern void
-nouveau_fence_flush(struct nouveau_channel *);
-
-struct nouveau_pushbuf_reloc {
- struct nouveau_pushbuf_bo *pbbo;
- uint32_t *ptr;
- uint32_t flags;
- uint32_t data;
- uint32_t vor;
- uint32_t tor;
-};
-
-struct nouveau_pushbuf_bo {
- struct nouveau_channel *channel;
- struct nouveau_bo *bo;
- unsigned flags;
- unsigned handled;
-};
-
-#define NOUVEAU_PUSHBUF_MAX_BUFFERS 1024
-#define NOUVEAU_PUSHBUF_MAX_RELOCS 1024
-struct nouveau_pushbuf_priv {
- struct nouveau_pushbuf base;
-
- struct nouveau_fence *fence;
-
- unsigned nop_jump;
- unsigned start;
- unsigned size;
-
- struct nouveau_pushbuf_bo *buffers;
- unsigned nr_buffers;
- struct nouveau_pushbuf_reloc *relocs;
- unsigned nr_relocs;
-};
-#define nouveau_pushbuf(n) ((struct nouveau_pushbuf_priv *)(n))
-
-#define pbbo_to_ptr(o) ((uint64_t)(unsigned long)(o))
-#define ptr_to_pbbo(h) ((struct nouveau_pushbuf_bo *)(unsigned long)(h))
-#define pbrel_to_ptr(o) ((uint64_t)(unsigned long)(o))
-#define ptr_to_pbrel(h) ((struct nouveau_pushbuf_reloc *)(unsigned long)(h))
-#define bo_to_ptr(o) ((uint64_t)(unsigned long)(o))
-#define ptr_to_bo(h) ((struct nouveau_bo_priv *)(unsigned long)(h))
-
-extern int
-nouveau_pushbuf_init(struct nouveau_channel *);
-
-extern int
-nouveau_pushbuf_flush(struct nouveau_channel *, unsigned min);
-
-extern int
-nouveau_pushbuf_emit_reloc(struct nouveau_channel *, void *ptr,
- struct nouveau_bo *, uint32_t data, uint32_t flags,
- uint32_t vor, uint32_t tor);
-
-struct nouveau_dma_priv {
- uint32_t base;
- uint32_t max;
- uint32_t cur;
- uint32_t put;
- uint32_t free;
-
- int push_free;
-} dma;
-
-struct nouveau_channel_priv {
- struct nouveau_channel base;
-
- struct drm_nouveau_channel_alloc drm;
-
- uint32_t *pushbuf;
- void *notifier_block;
-
- volatile uint32_t *user;
- volatile uint32_t *put;
- volatile uint32_t *get;
- volatile uint32_t *ref_cnt;
-
- struct nouveau_dma_priv dma_master;
- struct nouveau_dma_priv dma_bufmgr;
- struct nouveau_dma_priv *dma;
-
- struct nouveau_fence *fence_head;
- struct nouveau_fence *fence_tail;
- uint32_t fence_sequence;
-
- struct nouveau_pushbuf_priv pb;
-
- unsigned user_charge;
-};
-#define nouveau_channel(n) ((struct nouveau_channel_priv *)(n))
-
-extern int
-nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt,
- struct nouveau_channel **);
-
-extern void
-nouveau_channel_free(struct nouveau_channel **);
-
-struct nouveau_grobj_priv {
- struct nouveau_grobj base;
-};
-#define nouveau_grobj(n) ((struct nouveau_grobj_priv *)(n))
-
-extern int nouveau_grobj_alloc(struct nouveau_channel *, uint32_t handle,
- int class, struct nouveau_grobj **);
-extern int nouveau_grobj_ref(struct nouveau_channel *, uint32_t handle,
- struct nouveau_grobj **);
-extern void nouveau_grobj_free(struct nouveau_grobj **);
-
-
-struct nouveau_notifier_priv {
- struct nouveau_notifier base;
-
- struct drm_nouveau_notifierobj_alloc drm;
- volatile void *map;
-};
-#define nouveau_notifier(n) ((struct nouveau_notifier_priv *)(n))
-
-extern int
-nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int count,
- struct nouveau_notifier **);
-
-extern void
-nouveau_notifier_free(struct nouveau_notifier **);
-
-extern void
-nouveau_notifier_reset(struct nouveau_notifier *, int id);
-
-extern uint32_t
-nouveau_notifier_status(struct nouveau_notifier *, int id);
-
-extern uint32_t
-nouveau_notifier_return_val(struct nouveau_notifier *, int id);
-
-extern int
-nouveau_notifier_wait_status(struct nouveau_notifier *, int id, int status,
- int timeout);
-
-struct nouveau_bo_priv {
- struct nouveau_bo base;
-
- struct nouveau_pushbuf_bo *pending;
- struct nouveau_fence *fence;
- struct nouveau_fence *wr_fence;
-
- struct drm_nouveau_mem_alloc drm;
- void *map;
-
- void *sysmem;
- int user;
-
- int refcount;
-
- uint64_t offset;
- uint64_t flags;
- int tiled;
-};
-#define nouveau_bo(n) ((struct nouveau_bo_priv *)(n))
-
-extern int
-nouveau_bo_init(struct nouveau_device *);
-
-extern void
-nouveau_bo_takedown(struct nouveau_device *);
-
-extern int
-nouveau_bo_new(struct nouveau_device *, uint32_t flags, int align, int size,
- struct nouveau_bo **);
-
-extern int
-nouveau_bo_user(struct nouveau_device *, void *ptr, int size,
- struct nouveau_bo **);
-
-extern int
-nouveau_bo_ref(struct nouveau_device *, uint64_t handle, struct nouveau_bo **);
-
-extern int
-nouveau_bo_set_status(struct nouveau_bo *, uint32_t flags);
-
-extern void
-nouveau_bo_del(struct nouveau_bo **);
-
-extern int
-nouveau_bo_busy(struct nouveau_bo *bo, uint32_t flags);
-
-extern int
-nouveau_bo_map(struct nouveau_bo *, uint32_t flags);
-
-extern void
-nouveau_bo_unmap(struct nouveau_bo *);
-
-extern int
-nouveau_bo_validate(struct nouveau_channel *, struct nouveau_bo *,
- uint32_t flags);
-
-extern int
-nouveau_resource_init(struct nouveau_resource **heap, unsigned start,
- unsigned size);
-
-extern int
-nouveau_resource_alloc(struct nouveau_resource *heap, int size, void *priv,
- struct nouveau_resource **);
-
-extern void
-nouveau_resource_free(struct nouveau_resource **);
-
-#endif
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c b/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c
deleted file mode 100644
index 451011e112..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_fence.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
-#include "nouveau_local.h"
-
-static void
-nouveau_fence_del_unsignalled(struct nouveau_fence *fence)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(fence->channel);
- struct nouveau_fence *le;
-
- if (nvchan->fence_head == fence) {
- nvchan->fence_head = nouveau_fence(fence)->next;
- if (nvchan->fence_head == NULL)
- nvchan->fence_tail = NULL;
- return;
- }
-
- le = nvchan->fence_head;
- while (le && nouveau_fence(le)->next != fence)
- le = nouveau_fence(le)->next;
- assert(le && nouveau_fence(le)->next == fence);
- nouveau_fence(le)->next = nouveau_fence(fence)->next;
- if (nvchan->fence_tail == fence)
- nvchan->fence_tail = le;
-}
-
-static void
-nouveau_fence_del(struct nouveau_fence **fence)
-{
- struct nouveau_fence_priv *nvfence;
-
- if (!fence || !*fence)
- return;
- nvfence = nouveau_fence(*fence);
- *fence = NULL;
-
- if (--nvfence->refcount)
- return;
-
- if (nvfence->emitted && !nvfence->signalled) {
- if (nvfence->signal_cb) {
- nvfence->refcount++;
- nouveau_fence_wait((void *)&nvfence);
- return;
- }
-
- nouveau_fence_del_unsignalled(&nvfence->base);
- }
- free(nvfence);
-}
-
-int
-nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **fence)
-{
- struct nouveau_fence_priv *nvfence;
-
- if (!chan || !fence || *fence)
- return -EINVAL;
-
- nvfence = calloc(1, sizeof(struct nouveau_fence_priv));
- if (!nvfence)
- return -ENOMEM;
- nvfence->base.channel = chan;
- nvfence->refcount = 1;
-
- *fence = &nvfence->base;
- return 0;
-}
-
-int
-nouveau_fence_ref(struct nouveau_fence *ref, struct nouveau_fence **fence)
-{
- struct nouveau_fence_priv *nvfence;
-
- if (!fence)
- return -EINVAL;
-
- if (*fence) {
- nouveau_fence_del(fence);
- *fence = NULL;
- }
-
- if (ref) {
- nvfence = nouveau_fence(ref);
- nvfence->refcount++;
- *fence = &nvfence->base;
- }
-
- return 0;
-}
-
-int
-nouveau_fence_signal_cb(struct nouveau_fence *fence, void (*func)(void *),
- void *priv)
-{
- struct nouveau_fence_priv *nvfence = nouveau_fence(fence);
- struct nouveau_fence_cb *cb;
-
- if (!nvfence || !func)
- return -EINVAL;
-
- cb = malloc(sizeof(struct nouveau_fence_cb));
- if (!cb)
- return -ENOMEM;
-
- cb->func = func;
- cb->priv = priv;
- cb->next = nvfence->signal_cb;
- nvfence->signal_cb = cb;
- return 0;
-}
-
-void
-nouveau_fence_emit(struct nouveau_fence *fence)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(fence->channel);
- struct nouveau_fence_priv *nvfence = nouveau_fence(fence);
-
- nvfence->emitted = 1;
- nvfence->sequence = ++nvchan->fence_sequence;
- if (nvfence->sequence == 0xffffffff)
- NOUVEAU_ERR("AII wrap unhandled\n");
-
- /*XXX: assumes subc 0 is populated */
- /* Not the way to fence on nv4 */
- if (nvchan->base.device->chipset >= 0x10) {
- RING_SPACE_CH(fence->channel, 2);
- OUT_RING_CH (fence->channel, 0x00040050);
- OUT_RING_CH (fence->channel, nvfence->sequence);
- }
-
- if (nvchan->fence_tail) {
- nouveau_fence(nvchan->fence_tail)->next = fence;
- } else {
- nvchan->fence_head = fence;
- }
- nvchan->fence_tail = fence;
-}
-
-void
-nouveau_fence_flush(struct nouveau_channel *chan)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- uint32_t sequence = *nvchan->ref_cnt;
-
- while (nvchan->fence_head) {
- struct nouveau_fence_priv *nvfence;
-
- nvfence = nouveau_fence(nvchan->fence_head);
- if (nvfence->sequence > sequence)
- break;
- nouveau_fence_del_unsignalled(&nvfence->base);
- nvfence->signalled = 1;
-
- if (nvfence->signal_cb) {
- struct nouveau_fence *fence = NULL;
-
- nouveau_fence_ref(&nvfence->base, &fence);
-
- while (nvfence->signal_cb) {
- struct nouveau_fence_cb *cb;
-
- cb = nvfence->signal_cb;
- nvfence->signal_cb = cb->next;
- cb->func(cb->priv);
- free(cb);
- }
-
- nouveau_fence_ref(NULL, &fence);
- }
- }
-}
-
-int
-nouveau_fence_wait(struct nouveau_fence **fence)
-{
- struct nouveau_fence_priv *nvfence;
-
- if (!fence || !*fence)
- return -EINVAL;
- nvfence = nouveau_fence(*fence);
-
- if (nvfence->emitted) {
- while (!nvfence->signalled)
- nouveau_fence_flush(nvfence->base.channel);
- }
- nouveau_fence_ref(NULL, fence);
-
- return 0;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c b/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c
deleted file mode 100644
index fb430a25b8..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_grobj.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <util/u_memory.h>
-#include "nouveau_drmif.h"
-
-int
-nouveau_grobj_alloc(struct nouveau_channel *chan, uint32_t handle,
- int class, struct nouveau_grobj **grobj)
-{
- struct nouveau_device_priv *nvdev = nouveau_device(chan->device);
- struct nouveau_grobj_priv *nvgrobj;
- struct drm_nouveau_grobj_alloc g;
- int ret;
-
- if (!nvdev || !grobj || *grobj)
- return -EINVAL;
-
- nvgrobj = CALLOC_STRUCT(nouveau_grobj_priv);
- if (!nvgrobj)
- return -ENOMEM;
- nvgrobj->base.channel = chan;
- nvgrobj->base.handle = handle;
- nvgrobj->base.grclass = class;
-
- g.channel = chan->id;
- g.handle = handle;
- g.class = class;
- ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GROBJ_ALLOC,
- &g, sizeof(g));
- if (ret) {
- nouveau_grobj_free((void *)&nvgrobj);
- return ret;
- }
-
- *grobj = &nvgrobj->base;
- return 0;
-}
-
-int
-nouveau_grobj_ref(struct nouveau_channel *chan, uint32_t handle,
- struct nouveau_grobj **grobj)
-{
- struct nouveau_grobj_priv *nvgrobj;
-
- if (!chan || !grobj || *grobj)
- return -EINVAL;
-
- nvgrobj = CALLOC_STRUCT(nouveau_grobj_priv);
- if (!nvgrobj)
- return -ENOMEM;
- nvgrobj->base.channel = chan;
- nvgrobj->base.handle = handle;
- nvgrobj->base.grclass = 0;
-
- *grobj = &nvgrobj->base;
- return 0;
-}
-
-void
-nouveau_grobj_free(struct nouveau_grobj **grobj)
-{
- struct nouveau_device_priv *nvdev;
- struct nouveau_channel_priv *chan;
- struct nouveau_grobj_priv *nvgrobj;
-
- if (!grobj || !*grobj)
- return;
- nvgrobj = nouveau_grobj(*grobj);
- *grobj = NULL;
-
-
- chan = nouveau_channel(nvgrobj->base.channel);
- nvdev = nouveau_device(chan->base.device);
-
- if (nvgrobj->base.grclass) {
- struct drm_nouveau_gpuobj_free f;
-
- f.channel = chan->drm.channel;
- f.handle = nvgrobj->base.handle;
- drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
- &f, sizeof(f));
- }
- FREE(nvgrobj);
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_local.h b/src/gallium/winsys/drm/nouveau/common/nouveau_local.h
index 877c7a8c47..11175bce7a 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_local.h
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_local.h
@@ -16,100 +16,4 @@
fflush(stderr); \
} while(0)
-#define NOUVEAU_TIME_MSEC() 0
-
-/* User FIFO control */
-//#define NOUVEAU_DMA_TRACE
-//#define NOUVEAU_DMA_DEBUG
-//#define NOUVEAU_DMA_DUMP_POSTRELOC_PUSHBUF
-#define NOUVEAU_DMA_BARRIER
-#define NOUVEAU_DMA_TIMEOUT 2000
-
-/* Push buffer access macros */
-static INLINE void
-OUT_RING(struct nouveau_channel *chan, unsigned data)
-{
- *(chan->pushbuf->cur++) = (data);
-}
-
-static INLINE void
-OUT_RINGp(struct nouveau_channel *chan, uint32_t *data, unsigned size)
-{
- memcpy(chan->pushbuf->cur, data, size * 4);
- chan->pushbuf->cur += size;
-}
-
-static INLINE void
-OUT_RINGf(struct nouveau_channel *chan, float f)
-{
- union { uint32_t i; float f; } c;
- c.f = f;
- OUT_RING(chan, c.i);
-}
-
-static INLINE void
-BEGIN_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr,
- unsigned mthd, unsigned size)
-{
- if (chan->pushbuf->remaining < (size + 1))
- nouveau_pushbuf_flush(chan, (size + 1));
- OUT_RING(chan, (gr->subc << 13) | (size << 18) | mthd);
- chan->pushbuf->remaining -= (size + 1);
-}
-
-static INLINE void
-FIRE_RING(struct nouveau_channel *chan)
-{
- nouveau_pushbuf_flush(chan, 0);
-}
-
-static INLINE void
-BIND_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, unsigned subc)
-{
- gr->subc = subc;
- BEGIN_RING(chan, gr, 0x0000, 1);
- OUT_RING (chan, gr->handle);
-}
-
-static INLINE void
-OUT_RELOC(struct nouveau_channel *chan, struct nouveau_bo *bo,
- unsigned data, unsigned flags, unsigned vor, unsigned tor)
-{
- nouveau_pushbuf_emit_reloc(chan, chan->pushbuf->cur++, bo,
- data, flags, vor, tor);
-}
-
-/* Raw data + flags depending on FB/TT buffer */
-static INLINE void
-OUT_RELOCd(struct nouveau_channel *chan, struct nouveau_bo *bo,
- unsigned data, unsigned flags, unsigned vor, unsigned tor)
-{
- OUT_RELOC(chan, bo, data, flags | NOUVEAU_BO_OR, vor, tor);
-}
-
-/* FB/TT object handle */
-static INLINE void
-OUT_RELOCo(struct nouveau_channel *chan, struct nouveau_bo *bo,
- unsigned flags)
-{
- OUT_RELOC(chan, bo, 0, flags | NOUVEAU_BO_OR,
- chan->vram->handle, chan->gart->handle);
-}
-
-/* Low 32-bits of offset */
-static INLINE void
-OUT_RELOCl(struct nouveau_channel *chan, struct nouveau_bo *bo,
- unsigned delta, unsigned flags)
-{
- OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_LOW, 0, 0);
-}
-
-/* High 32-bits of offset */
-static INLINE void
-OUT_RELOCh(struct nouveau_channel *chan, struct nouveau_bo *bo,
- unsigned delta, unsigned flags)
-{
- OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_HIGH, 0, 0);
-}
-
#endif
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c b/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c
deleted file mode 100644
index 01e8f38440..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_notifier.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-
-#include "nouveau_drmif.h"
-#include "nouveau_local.h"
-
-#define NOTIFIER(__v) \
- struct nouveau_notifier_priv *nvnotify = nouveau_notifier(notifier); \
- volatile uint32_t *__v = (void*)nvnotify->map + (id * 32)
-
-int
-nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle,
- int count, struct nouveau_notifier **notifier)
-{
- struct nouveau_notifier_priv *nvnotify;
- int ret;
-
- if (!chan || !notifier || *notifier)
- return -EINVAL;
-
- nvnotify = calloc(1, sizeof(struct nouveau_notifier_priv));
- if (!nvnotify)
- return -ENOMEM;
- nvnotify->base.channel = chan;
- nvnotify->base.handle = handle;
-
- nvnotify->drm.channel = chan->id;
- nvnotify->drm.handle = handle;
- nvnotify->drm.count = count;
- if ((ret = drmCommandWriteRead(nouveau_device(chan->device)->fd,
- DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
- &nvnotify->drm,
- sizeof(nvnotify->drm)))) {
- nouveau_notifier_free((void *)&nvnotify);
- return ret;
- }
-
- nvnotify->map = (void *)nouveau_channel(chan)->notifier_block +
- nvnotify->drm.offset;
- *notifier = &nvnotify->base;
- return 0;
-}
-
-void
-nouveau_notifier_free(struct nouveau_notifier **notifier)
-{
-
- struct nouveau_notifier_priv *nvnotify;
- struct nouveau_channel_priv *nvchan;
- struct nouveau_device_priv *nvdev;
- struct drm_nouveau_gpuobj_free f;
-
- if (!notifier || !*notifier)
- return;
- nvnotify = nouveau_notifier(*notifier);
- *notifier = NULL;
-
- nvchan = nouveau_channel(nvnotify->base.channel);
- nvdev = nouveau_device(nvchan->base.device);
-
- f.channel = nvchan->drm.channel;
- f.handle = nvnotify->base.handle;
- drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, &f, sizeof(f));
- free(nvnotify);
-}
-
-void
-nouveau_notifier_reset(struct nouveau_notifier *notifier, int id)
-{
- NOTIFIER(n);
-
- n[NV_NOTIFY_TIME_0 /4] = 0x00000000;
- n[NV_NOTIFY_TIME_1 /4] = 0x00000000;
- n[NV_NOTIFY_RETURN_VALUE/4] = 0x00000000;
- n[NV_NOTIFY_STATE /4] = (NV_NOTIFY_STATE_STATUS_IN_PROCESS <<
- NV_NOTIFY_STATE_STATUS_SHIFT);
-}
-
-uint32_t
-nouveau_notifier_status(struct nouveau_notifier *notifier, int id)
-{
- NOTIFIER(n);
-
- return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT;
-}
-
-uint32_t
-nouveau_notifier_return_val(struct nouveau_notifier *notifier, int id)
-{
- NOTIFIER(n);
-
- return n[NV_NOTIFY_RETURN_VALUE/4];
-}
-
-int
-nouveau_notifier_wait_status(struct nouveau_notifier *notifier, int id,
- int status, int timeout)
-{
- NOTIFIER(n);
- uint32_t time = 0, t_start = NOUVEAU_TIME_MSEC();
-
- while (time <= timeout) {
- uint32_t v;
-
- v = n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT;
- if (v == status)
- return 0;
-
- if (timeout)
- time = NOUVEAU_TIME_MSEC() - t_start;
- }
-
- return -EBUSY;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c b/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c
deleted file mode 100644
index 7c094eb795..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_pushbuf.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-#include <util/u_memory.h>
-#include "nouveau_drmif.h"
-#include "nouveau_dma.h"
-
-#define PB_BUFMGR_DWORDS (4096 / 2)
-#define PB_MIN_USER_DWORDS 2048
-
-static int
-nouveau_pushbuf_space(struct nouveau_channel *chan, unsigned min)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
-
- assert((min + 1) <= nvchan->dma->max);
-
- /* Wait for enough space in push buffer */
- min = min < PB_MIN_USER_DWORDS ? PB_MIN_USER_DWORDS : min;
- min += 1; /* a bit extra for the NOP */
- if (nvchan->dma->free < min)
- WAIT_RING_CH(chan, min);
-
- /* Insert NOP, may turn into a jump later */
- RING_SPACE_CH(chan, 1);
- nvpb->nop_jump = nvchan->dma->cur;
- OUT_RING_CH(chan, 0);
-
- /* Any remaining space is available to the user */
- nvpb->start = nvchan->dma->cur;
- nvpb->size = nvchan->dma->free;
- nvpb->base.channel = chan;
- nvpb->base.remaining = nvpb->size;
- nvpb->base.cur = &nvchan->pushbuf[nvpb->start];
-
- /* Create a new fence object for this "frame" */
- nouveau_fence_ref(NULL, &nvpb->fence);
- nouveau_fence_new(chan, &nvpb->fence);
-
- return 0;
-}
-
-int
-nouveau_pushbuf_init(struct nouveau_channel *chan)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_dma_priv *m = &nvchan->dma_master;
- struct nouveau_dma_priv *b = &nvchan->dma_bufmgr;
- int i;
-
- if (!nvchan)
- return -EINVAL;
-
- /* Reassign last bit of push buffer for a "separate" bufmgr
- * ring buffer
- */
- m->max -= PB_BUFMGR_DWORDS;
- m->free -= PB_BUFMGR_DWORDS;
-
- b->base = m->base + ((m->max + 2) << 2);
- b->max = PB_BUFMGR_DWORDS - 2;
- b->cur = b->put = 0;
- b->free = b->max - b->cur;
-
- /* Some NOPs just to be safe
- *XXX: RING_SKIPS
- */
- nvchan->dma = b;
- RING_SPACE_CH(chan, 8);
- for (i = 0; i < 8; i++)
- OUT_RING_CH(chan, 0);
- nvchan->dma = m;
-
- nouveau_pushbuf_space(chan, 0);
- chan->pushbuf = &nvchan->pb.base;
-
- nvchan->pb.buffers = CALLOC(NOUVEAU_PUSHBUF_MAX_BUFFERS,
- sizeof(struct nouveau_pushbuf_bo));
- nvchan->pb.relocs = CALLOC(NOUVEAU_PUSHBUF_MAX_RELOCS,
- sizeof(struct nouveau_pushbuf_reloc));
- return 0;
-}
-
-static uint32_t
-nouveau_pushbuf_calc_reloc(struct nouveau_bo *bo,
- struct nouveau_pushbuf_reloc *r)
-{
- uint32_t push;
-
- if (r->flags & NOUVEAU_BO_LOW) {
- push = bo->offset + r->data;
- } else
- if (r->flags & NOUVEAU_BO_HIGH) {
- push = (bo->offset + r->data) >> 32;
- } else {
- push = r->data;
- }
-
- if (r->flags & NOUVEAU_BO_OR) {
- if (bo->flags & NOUVEAU_BO_VRAM)
- push |= r->vor;
- else
- push |= r->tor;
- }
-
- return push;
-}
-
-/* This would be our TTM "superioctl" */
-int
-nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
-{
- struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
- struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
- int ret, i;
-
- if (nvpb->base.remaining == nvpb->size)
- return 0;
-
- nouveau_fence_flush(chan);
-
- nvpb->size -= nvpb->base.remaining;
- nvchan->dma->cur += nvpb->size;
- nvchan->dma->free -= nvpb->size;
- assert(nvchan->dma->cur <= nvchan->dma->max);
-
- nvchan->dma = &nvchan->dma_bufmgr;
- nvchan->pushbuf[nvpb->nop_jump] = 0x20000000 |
- (nvchan->dma->base + (nvchan->dma->cur << 2));
-
- /* Validate buffers + apply relocations */
- nvchan->user_charge = 0;
- for (i = 0; i < nvpb->nr_relocs; i++) {
- struct nouveau_pushbuf_reloc *r = &nvpb->relocs[i];
- struct nouveau_pushbuf_bo *pbbo = r->pbbo;
- struct nouveau_bo *bo = pbbo->bo;
-
- /* Validated, mem matches presumed, no relocation necessary */
- if (pbbo->handled & 2) {
- if (!(pbbo->handled & 1))
- assert(0);
- continue;
- }
-
- /* Not yet validated, do it now */
- if (!(pbbo->handled & 1)) {
- ret = nouveau_bo_validate(chan, bo, pbbo->flags);
- if (ret) {
- assert(0);
- return ret;
- }
- pbbo->handled |= 1;
-
- if (bo->offset == nouveau_bo(bo)->offset &&
- bo->flags == nouveau_bo(bo)->flags) {
- pbbo->handled |= 2;
- continue;
- }
- bo->offset = nouveau_bo(bo)->offset;
- bo->flags = nouveau_bo(bo)->flags;
- }
-
- /* Apply the relocation */
- *r->ptr = nouveau_pushbuf_calc_reloc(bo, r);
- }
- nvpb->nr_relocs = 0;
-
- /* Dereference all buffers on validate list */
- for (i = 0; i < nvpb->nr_buffers; i++) {
- struct nouveau_pushbuf_bo *pbbo = &nvpb->buffers[i];
-
- nouveau_bo(pbbo->bo)->pending = NULL;
- nouveau_bo_del(&pbbo->bo);
- }
- nvpb->nr_buffers = 0;
-
- /* Switch back to user's ring */
- RING_SPACE_CH(chan, 1);
- OUT_RING_CH(chan, 0x20000000 | ((nvpb->start << 2) +
- nvchan->dma_master.base));
- nvchan->dma = &nvchan->dma_master;
-
- /* Fence + kickoff */
- nouveau_fence_emit(nvpb->fence);
- FIRE_RING_CH(chan);
-
- /* Allocate space for next push buffer */
- ret = nouveau_pushbuf_space(chan, min);
- assert(!ret);
-
- return 0;
-}
-
-static struct nouveau_pushbuf_bo *
-nouveau_pushbuf_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo)
-{
- struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf);
- struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
- struct nouveau_pushbuf_bo *pbbo;
-
- if (nvbo->pending)
- return nvbo->pending;
-
- if (nvpb->nr_buffers >= NOUVEAU_PUSHBUF_MAX_BUFFERS)
- return NULL;
- pbbo = nvpb->buffers + nvpb->nr_buffers++;
- nvbo->pending = pbbo;
-
- nouveau_bo_ref(bo->device, bo->handle, &pbbo->bo);
- pbbo->channel = chan;
- pbbo->flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART;
- pbbo->handled = 0;
- return pbbo;
-}
-
-int
-nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr,
- struct nouveau_bo *bo, uint32_t data, uint32_t flags,
- uint32_t vor, uint32_t tor)
-{
- struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf);
- struct nouveau_pushbuf_bo *pbbo;
- struct nouveau_pushbuf_reloc *r;
-
- if (nvpb->nr_relocs >= NOUVEAU_PUSHBUF_MAX_RELOCS)
- return -ENOMEM;
-
- pbbo = nouveau_pushbuf_emit_buffer(chan, bo);
- if (!pbbo)
- return -ENOMEM;
- pbbo->flags |= (flags & NOUVEAU_BO_RDWR);
- pbbo->flags &= (flags | NOUVEAU_BO_RDWR);
-
- r = nvpb->relocs + nvpb->nr_relocs++;
- r->pbbo = pbbo;
- r->ptr = ptr;
- r->flags = flags;
- r->data = data;
- r->vor = vor;
- r->tor = tor;
-
- if (flags & NOUVEAU_BO_DUMMY)
- *(uint32_t *)ptr = 0;
- else
- *(uint32_t *)ptr = nouveau_pushbuf_calc_reloc(bo, r);
- return 0;
-}
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c b/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c
deleted file mode 100644
index 766fd279fe..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_resource.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2007 Nouveau Project
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <util/u_memory.h>
-#include "nouveau_drmif.h"
-#include "nouveau_local.h"
-
-int
-nouveau_resource_init(struct nouveau_resource **heap,
- unsigned start, unsigned size)
-{
- struct nouveau_resource *r;
-
- r = CALLOC_STRUCT(nouveau_resource);
- if (!r)
- return 1;
-
- r->start = start;
- r->size = size;
- *heap = r;
- return 0;
-}
-
-int
-nouveau_resource_alloc(struct nouveau_resource *heap, int size, void *priv,
- struct nouveau_resource **res)
-{
- struct nouveau_resource *r;
-
- if (!heap || !size || !res || *res)
- return 1;
-
- while (heap) {
- if (!heap->in_use && heap->size >= size) {
- r = CALLOC_STRUCT(nouveau_resource);
- if (!r)
- return 1;
-
- r->start = (heap->start + heap->size) - size;
- r->size = size;
- r->in_use = 1;
- r->priv = priv;
-
- heap->size -= size;
-
- r->next = heap->next;
- if (heap->next)
- heap->next->prev = r;
- r->prev = heap;
- heap->next = r;
-
- *res = r;
- return 0;
- }
-
- heap = heap->next;
- }
-
- return 1;
-}
-
-void
-nouveau_resource_free(struct nouveau_resource **res)
-{
- struct nouveau_resource *r;
-
- if (!res || !*res)
- return;
- r = *res;
- *res = NULL;
-
- r->in_use = 0;
-
- if (r->next && !r->next->in_use) {
- struct nouveau_resource *new = r->next;
-
- new->prev = r->prev;
- if (r->prev)
- r->prev->next = new;
- new->size += r->size;
- new->start = r->start;
-
- free(r);
- r = new;
- }
-
- if (r->prev && !r->prev->in_use) {
- r->prev->next = r->next;
- if (r->next)
- r->next->prev = r->prev;
- r->prev->size += r->size;
- FREE(r);
- }
-
-}
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
index 722694e4a4..b6199f8e6d 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
@@ -29,33 +29,9 @@ nouveau_pipe_grobj_alloc(struct nouveau_winsys *nvws, int grclass,
if (ret)
return ret;
- assert(nv->nvc->next_subchannel < 7);
- BIND_RING(chan, *grobj, nv->nvc->next_subchannel++);
- return 0;
-}
-
-static int
-nouveau_pipe_surface_copy(struct nouveau_winsys *nvws, struct pipe_surface *dst,
- unsigned dx, unsigned dy, struct pipe_surface *src,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- struct nouveau_context *nv = nvws->nv;
-
- if (nv->surface_copy_prep(nv, dst, src))
- return 1;
- nv->surface_copy(nv, dx, dy, sx, sy, w, h);
- nv->surface_copy_done(nv);
-
- return 0;
-}
-
-static int
-nouveau_pipe_surface_fill(struct nouveau_winsys *nvws, struct pipe_surface *dst,
- unsigned dx, unsigned dy, unsigned w, unsigned h,
- unsigned value)
-{
- if (nvws->nv->surface_fill(nvws->nv, dst, dx, dy, w, h, value))
- return 1;
+ BEGIN_RING(chan, *grobj, 0x0000, 1);
+ OUT_RING (chan, (*grobj)->handle);
+ (*grobj)->bound = NOUVEAU_GROBJ_BOUND_EXPLICIT;
return 0;
}
@@ -64,8 +40,9 @@ nouveau_pipe_push_reloc(struct nouveau_winsys *nvws, void *ptr,
struct pipe_buffer *buf, uint32_t data,
uint32_t flags, uint32_t vor, uint32_t tor)
{
- return nouveau_pushbuf_emit_reloc(nvws->channel, ptr,
- nouveau_buffer(buf)->bo,
+ struct nouveau_bo *bo = nouveau_pipe_buffer(buf)->bo;
+
+ return nouveau_pushbuf_emit_reloc(nvws->channel, ptr, bo,
data, flags, vor, tor);
}
@@ -73,18 +50,18 @@ static int
nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size,
struct pipe_fence_handle **fence)
{
- if (fence) {
- struct nouveau_pushbuf *pb = nvws->channel->pushbuf;
- struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(pb);
- struct nouveau_fence *ref = NULL;
-
- nouveau_fence_ref(nvpb->fence, &ref);
- *fence = (struct pipe_fence_handle *)ref;
- }
+ if (fence)
+ *fence = NULL;
return nouveau_pushbuf_flush(nvws->channel, size);
}
+static struct nouveau_bo *
+nouveau_pipe_get_bo(struct pipe_buffer *pb)
+{
+ return nouveau_pipe_buffer(pb)->bo;
+}
+
struct pipe_context *
nouveau_pipe_create(struct nouveau_context *nv)
{
@@ -152,8 +129,7 @@ nouveau_pipe_create(struct nouveau_context *nv)
nvws->notifier_retval = nouveau_notifier_return_val;
nvws->notifier_wait = nouveau_notifier_wait_status;
- nvws->surface_copy = nouveau_pipe_surface_copy;
- nvws->surface_fill = nouveau_pipe_surface_fill;
+ nvws->get_bo = nouveau_pipe_get_bo;
ws = nouveau_create_pipe_winsys(nv);
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c
index 8e889b9f36..881df98556 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c
@@ -103,9 +103,9 @@ nouveau_pipe_bo_user_create(struct pipe_winsys *pws, void *ptr, unsigned bytes)
static void
nouveau_pipe_bo_del(struct pipe_winsys *ws, struct pipe_buffer *buf)
{
- struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
+ struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
- nouveau_bo_del(&nvbuf->bo);
+ nouveau_bo_ref(NULL, &nvbuf->bo);
FREE(nvbuf);
}
@@ -113,7 +113,7 @@ static void *
nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
unsigned flags)
{
- struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
+ struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
uint32_t map_flags = 0;
if (flags & PIPE_BUFFER_USAGE_CPU_READ)
@@ -121,6 +121,7 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
if (flags & PIPE_BUFFER_USAGE_CPU_WRITE)
map_flags |= NOUVEAU_BO_WR;
+#if 0
if (flags & PIPE_BUFFER_USAGE_DISCARD &&
!(flags & PIPE_BUFFER_USAGE_CPU_READ) &&
nouveau_bo_busy(nvbuf->bo, map_flags)) {
@@ -131,10 +132,11 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
uint32_t flags = nouveau_flags_from_usage(nv, buf->usage);
if (!nouveau_bo_new(dev, flags, buf->alignment, buf->size, &rename)) {
- nouveau_bo_del(&nvbuf->bo);
+ nouveau_bo_ref(NULL, &nvbuf->bo);
nvbuf->bo = rename;
}
}
+#endif
if (nouveau_bo_map(nvbuf->bo, map_flags))
return NULL;
@@ -144,47 +146,63 @@ nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
static void
nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf)
{
- struct nouveau_pipe_buffer *nvbuf = nouveau_buffer(buf);
+ struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
nouveau_bo_unmap(nvbuf->bo);
}
-static INLINE struct nouveau_fence *
-nouveau_pipe_fence(struct pipe_fence_handle *pfence)
-{
- return (struct nouveau_fence *)pfence;
-}
-
static void
nouveau_pipe_fence_reference(struct pipe_winsys *ws,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *pfence)
{
- nouveau_fence_ref((void *)pfence, (void *)ptr);
+ *ptr = pfence;
}
static int
nouveau_pipe_fence_signalled(struct pipe_winsys *ws,
struct pipe_fence_handle *pfence, unsigned flag)
{
- struct nouveau_pipe_winsys *nvpws = (struct nouveau_pipe_winsys *)ws;
- struct nouveau_fence *fence = nouveau_pipe_fence(pfence);
-
- if (nouveau_fence(fence)->signalled == 0)
- nouveau_fence_flush(nvpws->nv->nvc->channel);
-
- return !nouveau_fence(fence)->signalled;
+ return 0;
}
static int
nouveau_pipe_fence_finish(struct pipe_winsys *ws,
struct pipe_fence_handle *pfence, unsigned flag)
{
- struct nouveau_fence *fence = nouveau_pipe_fence(pfence);
- struct nouveau_fence *ref = NULL;
+ return 0;
+}
+
+struct pipe_surface *
+nouveau_surface_buffer_ref(struct nouveau_context *nv, struct pipe_buffer *pb,
+ enum pipe_format format, int w, int h,
+ unsigned pitch, struct pipe_texture **ppt)
+{
+ struct pipe_screen *pscreen = nv->nvc->pscreen;
+ struct pipe_texture tmpl, *pt;
+ struct pipe_surface *ps;
+
+ memset(&tmpl, 0, sizeof(tmpl));
+ tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+ NOUVEAU_TEXTURE_USAGE_LINEAR;
+ tmpl.target = PIPE_TEXTURE_2D;
+ tmpl.width[0] = w;
+ tmpl.height[0] = h;
+ tmpl.depth[0] = 1;
+ tmpl.format = format;
+ pf_get_block(tmpl.format, &tmpl.block);
+ tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w);
+ tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h);
+
+ pt = pscreen->texture_blanket(pscreen, &tmpl, &pitch, pb);
+ if (!pt)
+ return NULL;
+
+ ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0,
+ PIPE_BUFFER_USAGE_GPU_WRITE);
- nouveau_fence_ref(fence, &ref);
- return nouveau_fence_wait(&ref);
+ *ppt = pt;
+ return ps;
}
static void
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h
index d97ffdf337..1eb8043478 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h
@@ -10,8 +10,8 @@ struct nouveau_pipe_buffer {
struct nouveau_bo *bo;
};
-static inline struct nouveau_pipe_buffer *
-nouveau_buffer(struct pipe_buffer *buf)
+static INLINE struct nouveau_pipe_buffer *
+nouveau_pipe_buffer(struct pipe_buffer *buf)
{
return (struct nouveau_pipe_buffer *)buf;
}
@@ -36,4 +36,9 @@ extern void
nouveau_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *surf,
void *context_private);
+struct pipe_surface *
+nouveau_surface_buffer_ref(struct nouveau_context *nv, struct pipe_buffer *pb,
+ enum pipe_format format, int w, int h,
+ unsigned pitch, struct pipe_texture **ppt);
+
#endif
diff --git a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c b/src/gallium/winsys/drm/nouveau/common/nv04_surface.c
deleted file mode 100644
index e9a8a2ac1c..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nv04_surface.c
+++ /dev/null
@@ -1,466 +0,0 @@
-#include "pipe/p_context.h"
-#include "pipe/p_format.h"
-
-#include "nouveau_context.h"
-
-static INLINE int log2i(int i)
-{
- int r = 0;
-
- if (i & 0xffff0000) {
- i >>= 16;
- r += 16;
- }
- if (i & 0x0000ff00) {
- i >>= 8;
- r += 8;
- }
- if (i & 0x000000f0) {
- i >>= 4;
- r += 4;
- }
- if (i & 0x0000000c) {
- i >>= 2;
- r += 2;
- }
- if (i & 0x00000002) {
- r += 1;
- }
- return r;
-}
-
-static INLINE int
-nv04_surface_format(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_A8_UNORM:
- return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
- case PIPE_FORMAT_R16_SNORM:
- case PIPE_FORMAT_R5G6B5_UNORM:
- return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
- case PIPE_FORMAT_X8R8G8B8_UNORM:
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8;
- case PIPE_FORMAT_Z24S8_UNORM:
- return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32;
- default:
- return -1;
- }
-}
-
-static INLINE int
-nv04_rect_format(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_A8_UNORM:
- return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
- case PIPE_FORMAT_R5G6B5_UNORM:
- return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_Z24S8_UNORM:
- return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
- default:
- return -1;
- }
-}
-
-static INLINE int
-nv04_scaled_image_format(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_A1R5G5B5_UNORM:
- return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5;
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8;
- case PIPE_FORMAT_X8R8G8B8_UNORM:
- return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8;
- case PIPE_FORMAT_R5G6B5_UNORM:
- case PIPE_FORMAT_R16_SNORM:
- return NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
- default:
- return -1;
- }
-}
-
-static INLINE unsigned
-nv04_swizzle_bits(unsigned x, unsigned y)
-{
- unsigned u = (x & 0x001) << 0 |
- (x & 0x002) << 1 |
- (x & 0x004) << 2 |
- (x & 0x008) << 3 |
- (x & 0x010) << 4 |
- (x & 0x020) << 5 |
- (x & 0x040) << 6 |
- (x & 0x080) << 7 |
- (x & 0x100) << 8 |
- (x & 0x200) << 9 |
- (x & 0x400) << 10 |
- (x & 0x800) << 11;
-
- unsigned v = (y & 0x001) << 1 |
- (y & 0x002) << 2 |
- (y & 0x004) << 3 |
- (y & 0x008) << 4 |
- (y & 0x010) << 5 |
- (y & 0x020) << 6 |
- (y & 0x040) << 7 |
- (y & 0x080) << 8 |
- (y & 0x100) << 9 |
- (y & 0x200) << 10 |
- (y & 0x400) << 11 |
- (y & 0x800) << 12;
- return v | u;
-}
-
-static void
-nv04_surface_copy_swizzle(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct pipe_surface *dst = nv->surf_dst;
- struct pipe_surface *src = nv->surf_src;
-
- const unsigned max_w = 1024;
- const unsigned max_h = 1024;
- const unsigned sub_w = w > max_w ? max_w : w;
- const unsigned sub_h = h > max_h ? max_h : h;
- unsigned cx = 0;
- unsigned cy = 0;
-
- /* POT or GTFO */
- assert(!(w & (w - 1)) && !(h & (h - 1)));
-
- BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1);
- OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_FORMAT, 1);
- OUT_RING (chan, nv04_surface_format(dst->format) |
- log2i(w) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_U_SHIFT |
- log2i(h) << NV04_SWIZZLED_SURFACE_FORMAT_BASE_SIZE_V_SHIFT);
-
- BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, 1);
- OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE, 1);
- OUT_RING (chan, nv->nvc->NvSwzSurf->handle);
-
- for (cy = 0; cy < h; cy += sub_h) {
- for (cx = 0; cx < w; cx += sub_w) {
- BEGIN_RING(chan, nv->nvc->NvSwzSurf, NV04_SWIZZLED_SURFACE_OFFSET, 1);
- OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo,
- dst->offset + nv04_swizzle_bits(cx, cy) * dst->block.size,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
-
- BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9);
- OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION_TRUNCATE);
- OUT_RING (chan, nv04_scaled_image_format(src->format));
- OUT_RING (chan, NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION_SRCCOPY);
- OUT_RING (chan, 0);
- OUT_RING (chan, sub_h << 16 | sub_w);
- OUT_RING (chan, 0);
- OUT_RING (chan, sub_h << 16 | sub_w);
- OUT_RING (chan, 1 << 20);
- OUT_RING (chan, 1 << 20);
-
- BEGIN_RING(chan, nv->nvc->NvSIFM, NV04_SCALED_IMAGE_FROM_MEMORY_SIZE, 4);
- OUT_RING (chan, sub_h << 16 | sub_w);
- OUT_RING (chan, src->stride |
- NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER |
- NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE);
- OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo,
- src->offset + cy * src->stride + cx * src->block.size,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RING (chan, 0);
- }
- }
-}
-
-static void
-nv04_surface_copy_m2mf(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct pipe_surface *dst = nv->surf_dst;
- struct pipe_surface *src = nv->surf_src;
- unsigned dst_offset, src_offset;
-
- dst_offset = dst->offset + (dy * dst->stride) + (dx * dst->block.size);
- src_offset = src->offset + (sy * src->stride) + (sx * src->block.size);
-
- while (h) {
- int count = (h > 2047) ? 2047 : h;
-
- BEGIN_RING(chan, nv->nvc->NvM2MF,
- NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
- OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo, src_offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD);
- OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst_offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR);
- OUT_RING (chan, src->stride);
- OUT_RING (chan, dst->stride);
- OUT_RING (chan, w * src->block.size);
- OUT_RING (chan, count);
- OUT_RING (chan, 0x0101);
- OUT_RING (chan, 0);
-
- h -= count;
- src_offset += src->stride * count;
- dst_offset += dst->stride * count;
- }
-}
-
-static void
-nv04_surface_copy_blit(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
-
- BEGIN_RING(chan, nv->nvc->NvImageBlit, 0x0300, 3);
- OUT_RING (chan, (sy << 16) | sx);
- OUT_RING (chan, (dy << 16) | dx);
- OUT_RING (chan, ( h << 16) | w);
-}
-
-static int
-nv04_surface_copy_prep(struct nouveau_context *nv, struct pipe_surface *dst,
- struct pipe_surface *src)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- int format;
-
- if (src->format != dst->format)
- return 1;
-
- /* Setup transfer to swizzle the texture to vram if needed */
- /* FIXME/TODO: check proper limits of this operation */
- if (src->texture && dst->texture) {
- unsigned int src_linear = src->texture->tex_usage &
- NOUVEAU_TEXTURE_USAGE_LINEAR;
- unsigned int dst_linear = dst->texture->tex_usage &
- NOUVEAU_TEXTURE_USAGE_LINEAR;
- if (src_linear ^ dst_linear) {
- nv->surface_copy = nv04_surface_copy_swizzle;
- nv->surf_dst = dst;
- nv->surf_src = src;
- return 0;
- }
- }
-
- /* NV_CONTEXT_SURFACES_2D has buffer alignment restrictions, fallback
- * to NV_MEMORY_TO_MEMORY_FORMAT in this case.
- */
- if ((src->offset & 63) || (dst->offset & 63)) {
- BEGIN_RING(nv->nvc->channel, nv->nvc->NvM2MF,
- NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2);
- OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo,
- NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
-
- nv->surface_copy = nv04_surface_copy_m2mf;
- nv->surf_dst = dst;
- nv->surf_src = src;
- return 0;
-
- }
-
- if ((format = nv04_surface_format(dst->format)) < 0) {
- NOUVEAU_ERR("Bad surface format 0x%x\n", dst->format);
- return 1;
- }
- nv->surface_copy = nv04_surface_copy_blit;
-
- BEGIN_RING(chan, nv->nvc->NvCtxSurf2D,
- NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
- OUT_RELOCo(chan, nouveau_buffer(src->buffer)->bo,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
-
- BEGIN_RING(chan, nv->nvc->NvCtxSurf2D,
- NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
- OUT_RING (chan, format);
- OUT_RING (chan, (dst->stride << 16) | src->stride);
- OUT_RELOCl(chan, nouveau_buffer(src->buffer)->bo, src->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
- OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
-
- return 0;
-}
-
-static void
-nv04_surface_copy_done(struct nouveau_context *nv)
-{
- FIRE_RING(nv->nvc->channel);
-}
-
-static int
-nv04_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst,
- unsigned dx, unsigned dy, unsigned w, unsigned h,
- unsigned value)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct nouveau_grobj *surf2d = nv->nvc->NvCtxSurf2D;
- struct nouveau_grobj *rect = nv->nvc->NvGdiRect;
- int cs2d_format, gdirect_format;
-
- if ((cs2d_format = nv04_surface_format(dst->format)) < 0) {
- NOUVEAU_ERR("Bad format = %d\n", dst->format);
- return 1;
- }
-
- if ((gdirect_format = nv04_rect_format(dst->format)) < 0) {
- NOUVEAU_ERR("Bad format = %d\n", dst->format);
- return 1;
- }
-
- BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
- OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCo(chan, nouveau_buffer(dst->buffer)->bo,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_FORMAT, 4);
- OUT_RING (chan, cs2d_format);
- OUT_RING (chan, (dst->stride << 16) | dst->stride);
- OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
- OUT_RELOCl(chan, nouveau_buffer(dst->buffer)->bo, dst->offset,
- NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
-
- BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1);
- OUT_RING (chan, gdirect_format);
- BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR1_A, 1);
- OUT_RING (chan, value);
- BEGIN_RING(chan, rect,
- NV04_GDI_RECTANGLE_TEXT_UNCLIPPED_RECTANGLE_POINT(0), 2);
- OUT_RING (chan, (dx << 16) | dy);
- OUT_RING (chan, ( w << 16) | h);
-
- FIRE_RING(chan);
- return 0;
-}
-
-int
-nouveau_surface_channel_create_nv04(struct nouveau_channel_context *nvc)
-{
- struct nouveau_channel *chan = nvc->channel;
- unsigned chipset = nvc->channel->device->chipset, class;
- int ret;
-
- if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, 0x39,
- &nvc->NvM2MF))) {
- NOUVEAU_ERR("Error creating m2mf object: %d\n", ret);
- return 1;
- }
- BIND_RING (chan, nvc->NvM2MF, nvc->next_subchannel++);
- BEGIN_RING(chan, nvc->NvM2MF,
- NV04_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1);
- OUT_RING (chan, nvc->sync_notifier->handle);
-
- class = chipset < 0x10 ? NV04_CONTEXT_SURFACES_2D :
- NV10_CONTEXT_SURFACES_2D;
- if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class,
- &nvc->NvCtxSurf2D))) {
- NOUVEAU_ERR("Error creating 2D surface object: %d\n", ret);
- return 1;
- }
- BIND_RING (chan, nvc->NvCtxSurf2D, nvc->next_subchannel++);
- BEGIN_RING(chan, nvc->NvCtxSurf2D,
- NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2);
- OUT_RING (chan, nvc->channel->vram->handle);
- OUT_RING (chan, nvc->channel->vram->handle);
-
- class = chipset < 0x10 ? NV04_IMAGE_BLIT : NV12_IMAGE_BLIT;
- if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class,
- &nvc->NvImageBlit))) {
- NOUVEAU_ERR("Error creating blit object: %d\n", ret);
- return 1;
- }
- BIND_RING (chan, nvc->NvImageBlit, nvc->next_subchannel++);
- BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_DMA_NOTIFY, 1);
- OUT_RING (chan, nvc->sync_notifier->handle);
- BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_SURFACE, 1);
- OUT_RING (chan, nvc->NvCtxSurf2D->handle);
- BEGIN_RING(chan, nvc->NvImageBlit, NV04_IMAGE_BLIT_OPERATION, 1);
- OUT_RING (chan, NV04_IMAGE_BLIT_OPERATION_SRCCOPY);
-
- class = NV04_GDI_RECTANGLE_TEXT;
- if ((ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class,
- &nvc->NvGdiRect))) {
- NOUVEAU_ERR("Error creating rect object: %d\n", ret);
- return 1;
- }
- BIND_RING (chan, nvc->NvGdiRect, nvc->next_subchannel++);
- BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_DMA_NOTIFY, 1);
- OUT_RING (chan, nvc->sync_notifier->handle);
- BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1);
- OUT_RING (chan, nvc->NvCtxSurf2D->handle);
- BEGIN_RING(chan, nvc->NvGdiRect, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1);
- OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_OPERATION_SRCCOPY);
- BEGIN_RING(chan, nvc->NvGdiRect,
- NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT, 1);
- OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE);
-
- switch (chipset & 0xf0) {
- case 0x00:
- case 0x10:
- class = NV04_SWIZZLED_SURFACE;
- break;
- case 0x20:
- class = NV20_SWIZZLED_SURFACE;
- break;
- case 0x30:
- class = NV30_SWIZZLED_SURFACE;
- break;
- case 0x40:
- case 0x60:
- class = NV40_SWIZZLED_SURFACE;
- break;
- default:
- /* Famous last words: this really can't happen.. */
- assert(0);
- break;
- }
-
- ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class,
- &nvc->NvSwzSurf);
- if (ret) {
- NOUVEAU_ERR("Error creating swizzled surface: %d\n", ret);
- return 1;
- }
-
- BIND_RING (chan, nvc->NvSwzSurf, nvc->next_subchannel++);
-
- if (chipset < 0x10) {
- class = NV04_SCALED_IMAGE_FROM_MEMORY;
- } else
- if (chipset < 0x40) {
- class = NV10_SCALED_IMAGE_FROM_MEMORY;
- } else {
- class = NV40_SCALED_IMAGE_FROM_MEMORY;
- }
-
- ret = nouveau_grobj_alloc(chan, nvc->next_handle++, class,
- &nvc->NvSIFM);
- if (ret) {
- NOUVEAU_ERR("Error creating scaled image object: %d\n", ret);
- return 1;
- }
-
- BIND_RING (chan, nvc->NvSIFM, nvc->next_subchannel++);
-
- return 0;
-}
-
-int
-nouveau_surface_init_nv04(struct nouveau_context *nv)
-{
- nv->surface_copy_prep = nv04_surface_copy_prep;
- nv->surface_copy = nv04_surface_copy_blit;
- nv->surface_copy_done = nv04_surface_copy_done;
- nv->surface_fill = nv04_surface_fill;
- return 0;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c b/src/gallium/winsys/drm/nouveau/common/nv50_surface.c
deleted file mode 100644
index c8ab7f690f..0000000000
--- a/src/gallium/winsys/drm/nouveau/common/nv50_surface.c
+++ /dev/null
@@ -1,194 +0,0 @@
-#include "pipe/p_context.h"
-#include "pipe/p_format.h"
-
-#include "nouveau_context.h"
-
-static INLINE int
-nv50_format(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_Z24S8_UNORM:
- return NV50_2D_DST_FORMAT_32BPP;
- case PIPE_FORMAT_X8R8G8B8_UNORM:
- return NV50_2D_DST_FORMAT_24BPP;
- case PIPE_FORMAT_R5G6B5_UNORM:
- return NV50_2D_DST_FORMAT_16BPP;
- case PIPE_FORMAT_A8_UNORM:
- return NV50_2D_DST_FORMAT_8BPP;
- default:
- return -1;
- }
-}
-
-static int
-nv50_surface_set(struct nouveau_context *nv, struct pipe_surface *surf, int dst)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct nouveau_grobj *eng2d = nv->nvc->Nv2D;
- struct nouveau_bo *bo = nouveau_buffer(surf->buffer)->bo;
- int surf_format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT;
- int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD);
-
- surf_format = nv50_format(surf->format);
- if (surf_format < 0)
- return 1;
-
- if (!nouveau_bo(bo)->tiled) {
- BEGIN_RING(chan, eng2d, mthd, 2);
- OUT_RING (chan, surf_format);
- OUT_RING (chan, 1);
- BEGIN_RING(chan, eng2d, mthd + 0x14, 5);
- OUT_RING (chan, surf->stride);
- OUT_RING (chan, surf->width);
- OUT_RING (chan, surf->height);
- OUT_RELOCh(chan, bo, surf->offset, flags);
- OUT_RELOCl(chan, bo, surf->offset, flags);
- } else {
- BEGIN_RING(chan, eng2d, mthd, 5);
- OUT_RING (chan, surf_format);
- OUT_RING (chan, 0);
- OUT_RING (chan, 0);
- OUT_RING (chan, 1);
- OUT_RING (chan, 0);
- BEGIN_RING(chan, eng2d, mthd + 0x18, 4);
- OUT_RING (chan, surf->width);
- OUT_RING (chan, surf->height);
- OUT_RELOCh(chan, bo, surf->offset, flags);
- OUT_RELOCl(chan, bo, surf->offset, flags);
- }
-
-#if 0
- if (dst) {
- BEGIN_RING(chan, eng2d, NV50_2D_CLIP_X, 4);
- OUT_RING (chan, 0);
- OUT_RING (chan, 0);
- OUT_RING (chan, surf->width);
- OUT_RING (chan, surf->height);
- }
-#endif
-
- return 0;
-}
-
-static int
-nv50_surface_copy_prep(struct nouveau_context *nv,
- struct pipe_surface *dst, struct pipe_surface *src)
-{
- int ret;
-
- assert(src->format == dst->format);
-
- ret = nv50_surface_set(nv, dst, 1);
- if (ret)
- return ret;
-
- ret = nv50_surface_set(nv, src, 0);
- if (ret)
- return ret;
-
- return 0;
-}
-
-static void
-nv50_surface_copy(struct nouveau_context *nv, unsigned dx, unsigned dy,
- unsigned sx, unsigned sy, unsigned w, unsigned h)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct nouveau_grobj *eng2d = nv->nvc->Nv2D;
-
- BEGIN_RING(chan, eng2d, 0x088c, 1);
- OUT_RING (chan, 0);
- BEGIN_RING(chan, eng2d, NV50_2D_BLIT_DST_X, 4);
- OUT_RING (chan, dx);
- OUT_RING (chan, dy);
- OUT_RING (chan, w);
- OUT_RING (chan, h);
- BEGIN_RING(chan, eng2d, 0x08c0, 4);
- OUT_RING (chan, 0);
- OUT_RING (chan, 1);
- OUT_RING (chan, 0);
- OUT_RING (chan, 1);
- BEGIN_RING(chan, eng2d, 0x08d0, 4);
- OUT_RING (chan, 0);
- OUT_RING (chan, sx);
- OUT_RING (chan, 0);
- OUT_RING (chan, sy);
-}
-
-static void
-nv50_surface_copy_done(struct nouveau_context *nv)
-{
- FIRE_RING(nv->nvc->channel);
-}
-
-static int
-nv50_surface_fill(struct nouveau_context *nv, struct pipe_surface *dst,
- unsigned dx, unsigned dy, unsigned w, unsigned h,
- unsigned value)
-{
- struct nouveau_channel *chan = nv->nvc->channel;
- struct nouveau_grobj *eng2d = nv->nvc->Nv2D;
- int rect_format, ret;
-
- rect_format = nv50_format(dst->format);
- if (rect_format < 0)
- return 1;
-
- ret = nv50_surface_set(nv, dst, 1);
- if (ret)
- return ret;
-
- BEGIN_RING(chan, eng2d, 0x0580, 3);
- OUT_RING (chan, 4);
- OUT_RING (chan, rect_format);
- OUT_RING (chan, value);
-
- BEGIN_RING(chan, eng2d, NV50_2D_RECT_X1, 4);
- OUT_RING (chan, dx);
- OUT_RING (chan, dy);
- OUT_RING (chan, dx + w);
- OUT_RING (chan, dy + h);
-
- FIRE_RING(chan);
- return 0;
-}
-
-int
-nouveau_surface_channel_create_nv50(struct nouveau_channel_context *nvc)
-{
- struct nouveau_channel *chan = nvc->channel;
- struct nouveau_grobj *eng2d = NULL;
- int ret;
-
- ret = nouveau_grobj_alloc(chan, nvc->next_handle++, NV50_2D, &eng2d);
- if (ret)
- return ret;
- nvc->Nv2D = eng2d;
-
- BIND_RING (chan, eng2d, nvc->next_subchannel++);
- BEGIN_RING(chan, eng2d, NV50_2D_DMA_NOTIFY, 4);
- OUT_RING (chan, nvc->sync_notifier->handle);
- OUT_RING (chan, chan->vram->handle);
- OUT_RING (chan, chan->vram->handle);
- OUT_RING (chan, chan->vram->handle);
- BEGIN_RING(chan, eng2d, NV50_2D_OPERATION, 1);
- OUT_RING (chan, NV50_2D_OPERATION_SRCCOPY);
- BEGIN_RING(chan, eng2d, 0x0290, 1);
- OUT_RING (chan, 0);
- BEGIN_RING(chan, eng2d, 0x0888, 1);
- OUT_RING (chan, 1);
-
- return 0;
-}
-
-int
-nouveau_surface_init_nv50(struct nouveau_context *nv)
-{
- nv->surface_copy_prep = nv50_surface_copy_prep;
- nv->surface_copy = nv50_surface_copy;
- nv->surface_copy_done = nv50_surface_copy_done;
- nv->surface_fill = nv50_surface_fill;
- return 0;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/dri/Makefile b/src/gallium/winsys/drm/nouveau/dri/Makefile
index e129e42e97..3f3553b61d 100644
--- a/src/gallium/winsys/drm/nouveau/dri/Makefile
+++ b/src/gallium/winsys/drm/nouveau/dri/Makefile
@@ -26,6 +26,9 @@ C_SOURCES = \
ASM_SOURCES =
+DRIVER_DEFINES = $(shell pkg-config libdrm_nouveau --cflags)
+DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs)
+
include ../../Makefile.template
symlinks:
diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h b/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h
index 8257790d47..64cf326411 100644
--- a/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h
+++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h
@@ -5,8 +5,6 @@
#include <xmlconfig.h>
#include <nouveau/nouveau_winsys.h>
#include "../common/nouveau_context.h"
-#include "../common/nouveau_drmif.h"
-#include "../common/nouveau_dma.h"
struct nouveau_framebuffer {
struct st_framebuffer *stfb;
diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c
index 1d7c92376f..964a9028aa 100644
--- a/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c
+++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c
@@ -12,7 +12,7 @@
#include "nouveau_screen_dri.h"
#include "nouveau_swapbuffers.h"
-#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 11
+#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 12
#error nouveau_drm.h version does not match expected version
#endif
diff --git a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
index e111eec932..58cb6f7265 100644
--- a/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
+++ b/src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c
@@ -17,6 +17,7 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
const drm_clip_rect_t *rect)
{
struct nouveau_context_dri *nv = dPriv->driContextPriv->driverPrivate;
+ struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id];
drm_clip_rect_t *pbox;
int nbox, i;
@@ -28,7 +29,6 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
pbox = dPriv->pClipRects;
nbox = dPriv->numClipRects;
- nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf);
for (i = 0; i < nbox; i++, pbox++) {
int sx, sy, dx, dy, w, h;
@@ -39,7 +39,8 @@ nouveau_copy_buffer(__DRIdrawablePrivate *dPriv, struct pipe_surface *surf,
w = pbox->x2 - pbox->x1;
h = pbox->y2 - pbox->y1;
- nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h);
+ pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer,
+ dx, dy, surf, sx, sy, w, h);
}
FIRE_RING(nv->base.nvc->channel);
diff --git a/src/gallium/winsys/drm/radeon/Makefile b/src/gallium/winsys/drm/radeon/Makefile
new file mode 100644
index 0000000000..dca1e3233a
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/Makefile
@@ -0,0 +1,32 @@
+
+TOP = ../../../../..
+include $(TOP)/configs/current
+
+LIBNAME = radeon_dri.so
+
+MINIGLX_SOURCES =
+
+PIPE_DRIVERS = \
+ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/r300/libr300.a
+
+DRIVER_SOURCES = \
+ radeon_buffer.c \
+ radeon_context.c \
+ radeon_r300.c \
+ radeon_screen.c \
+ radeon_winsys_softpipe.c
+
+C_SOURCES = \
+ $(COMMON_GALLIUM_SOURCES) \
+ $(DRIVER_SOURCES)
+
+ASM_SOURCES =
+
+DRIVER_DEFINES = -I../../../drivers/r300
+
+include ../Makefile.template
+
+DRI_LIB_DEPS += -ldrm_radeon
+
+symlinks:
diff --git a/src/gallium/winsys/drm/radeon/SConscript b/src/gallium/winsys/drm/radeon/SConscript
new file mode 100644
index 0000000000..2435211a32
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/SConscript
@@ -0,0 +1,29 @@
+Import('*')
+
+if 'mesa' in env['statetrackers']:
+
+ env = drienv.Clone()
+
+ DRIVER_SOURCES = [
+ 'radeon_buffer.c',
+ 'radeon_context.c',
+ 'radeon_screen.c',
+ 'radeon_winsys_softpipe.c',
+ ]
+
+ sources = \
+ COMMON_GALLIUM_SOURCES + \
+ DRIVER_SOURCES
+
+ drivers = [
+ softpipe,
+ r300
+ ]
+
+ # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
+ env.SharedLibrary(
+ target ='radeon_dri.so',
+ source = sources,
+ LIBS = drivers + mesa + auxiliaries + env['LIBS'],
+ )
+
diff --git a/src/gallium/winsys/drm/radeon/radeon_buffer.c b/src/gallium/winsys/drm/radeon/radeon_buffer.c
new file mode 100644
index 0000000000..259a505c0a
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_buffer.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#include <stdio.h>
+#include "dri_util.h"
+#include "state_tracker/st_public.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_inlines.h"
+#include "radeon_buffer.h"
+#include "radeon_screen.h"
+#include "radeon_context.h"
+#include "radeon_bo.h"
+#include "radeon_drm.h"
+
+static const char *radeon_get_name(struct pipe_winsys *ws)
+{
+ return "RADEON/DRI2";
+}
+
+static struct pipe_buffer *radeon_buffer_create(struct pipe_winsys *ws,
+ unsigned alignment,
+ unsigned usage,
+ unsigned size)
+{
+ struct radeon_pipe_winsys *radeon_ws = (struct radeon_pipe_winsys *)ws;
+ struct radeon_pipe_buffer *radeon_buffer;
+ uint32_t domain;
+
+ radeon_buffer = calloc(1, sizeof(*radeon_buffer));
+ if (radeon_buffer == NULL) {
+ return NULL;
+ }
+ radeon_buffer->base.refcount = 1;
+ radeon_buffer->base.alignment = alignment;
+ radeon_buffer->base.usage = usage;
+ radeon_buffer->base.size = size;
+
+ domain = 0;
+
+ if (usage & PIPE_BUFFER_USAGE_PIXEL) {
+ domain |= RADEON_GEM_DOMAIN_VRAM;
+ }
+ if (usage & PIPE_BUFFER_USAGE_VERTEX) {
+ domain |= RADEON_GEM_DOMAIN_GTT;
+ }
+
+ if (usage & PIPE_BUFFER_USAGE_INDEX) {
+ domain |= RADEON_GEM_DOMAIN_GTT;
+ }
+ radeon_buffer->bo = radeon_bo_open(radeon_ws->radeon_screen->bom, 0,
+ size, alignment, domain, 0);
+ if (radeon_buffer->bo == NULL) {
+ free(radeon_buffer);
+ }
+ return &radeon_buffer->base;
+}
+
+static struct pipe_buffer *radeon_buffer_user_create(struct pipe_winsys *ws,
+ void *ptr,
+ unsigned bytes)
+{
+ struct radeon_pipe_buffer *radeon_buffer;
+
+ radeon_buffer = (struct radeon_pipe_buffer*)radeon_buffer_create(ws, 0, 0, bytes);
+ if (radeon_buffer == NULL) {
+ return NULL;
+ }
+ radeon_bo_map(radeon_buffer->bo, 1);
+ memcpy(radeon_buffer->bo->ptr, ptr, bytes);
+ radeon_bo_unmap(radeon_buffer->bo);
+ return &radeon_buffer->base;
+}
+
+static void radeon_buffer_del(struct pipe_winsys *ws, struct pipe_buffer *buffer)
+{
+ struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer;
+
+ radeon_bo_unref(radeon_buffer->bo);
+ free(radeon_buffer);
+}
+
+static void *radeon_buffer_map(struct pipe_winsys *ws,
+ struct pipe_buffer *buffer,
+ unsigned flags)
+{
+ struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer;
+ int write = 0;
+
+ if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) {
+ write = 1;
+ }
+ if (radeon_bo_map(radeon_buffer->bo, write))
+ return NULL;
+ return radeon_buffer->bo->ptr;
+}
+
+static void radeon_buffer_unmap(struct pipe_winsys *ws, struct pipe_buffer *buffer)
+{
+ struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer;
+
+ radeon_bo_unmap(radeon_buffer->bo);
+}
+
+static void radeon_fence_reference(struct pipe_winsys *ws,
+ struct pipe_fence_handle **ptr,
+ struct pipe_fence_handle *pfence)
+{
+}
+
+static int radeon_fence_signalled(struct pipe_winsys *ws,
+ struct pipe_fence_handle *pfence,
+ unsigned flag)
+{
+ return 1;
+}
+
+static int radeon_fence_finish(struct pipe_winsys *ws,
+ struct pipe_fence_handle *pfence,
+ unsigned flag)
+{
+ return 0;
+}
+
+static void radeon_flush_frontbuffer(struct pipe_winsys *pipe_winsys,
+ struct pipe_surface *pipe_surface,
+ void *context_private)
+{
+ /* TODO: call dri2CopyRegion */
+}
+
+struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen)
+{
+ struct radeon_pipe_winsys *radeon_ws;
+
+ radeon_ws = calloc(1, sizeof(struct radeon_pipe_winsys));
+ if (radeon_ws == NULL) {
+ return NULL;
+ }
+ radeon_ws->radeon_screen = radeon_screen;
+
+ radeon_ws->winsys.flush_frontbuffer = radeon_flush_frontbuffer;
+
+ radeon_ws->winsys.buffer_create = radeon_buffer_create;
+ radeon_ws->winsys.buffer_destroy = radeon_buffer_del;
+ radeon_ws->winsys.user_buffer_create = radeon_buffer_user_create;
+ radeon_ws->winsys.buffer_map = radeon_buffer_map;
+ radeon_ws->winsys.buffer_unmap = radeon_buffer_unmap;
+
+ radeon_ws->winsys.fence_reference = radeon_fence_reference;
+ radeon_ws->winsys.fence_signalled = radeon_fence_signalled;
+ radeon_ws->winsys.fence_finish = radeon_fence_finish;
+
+ radeon_ws->winsys.get_name = radeon_get_name;
+
+ return &radeon_ws->winsys;
+}
+
+static struct pipe_buffer *radeon_buffer_from_handle(struct radeon_screen *radeon_screen,
+ uint32_t handle)
+{
+ struct radeon_pipe_buffer *radeon_buffer;
+ struct radeon_bo *bo = NULL;
+
+ bo = radeon_bo_open(radeon_screen->bom, handle, 0, 0, 0, 0);
+ if (bo == NULL) {
+ return NULL;
+ }
+ radeon_buffer = calloc(1, sizeof(struct radeon_pipe_buffer));
+ if (radeon_buffer == NULL) {
+ radeon_bo_unref(bo);
+ return NULL;
+ }
+ radeon_buffer->base.refcount = 1;
+ radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL;
+ radeon_buffer->bo = bo;
+ return &radeon_buffer->base;
+}
+
+struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context,
+ uint32_t handle,
+ enum pipe_format format,
+ int w, int h, int pitch)
+{
+ struct pipe_screen *pipe_screen = radeon_context->pipe_screen;
+ struct pipe_winsys *pipe_winsys = radeon_context->pipe_winsys;
+ struct pipe_texture tmpl;
+ struct pipe_surface *ps;
+ struct pipe_texture *pt;
+ struct pipe_buffer *pb;
+
+ pb = radeon_buffer_from_handle(radeon_context->radeon_screen, handle);
+ if (pb == NULL) {
+ return NULL;
+ }
+ memset(&tmpl, 0, sizeof(tmpl));
+ tmpl.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
+ tmpl.target = PIPE_TEXTURE_2D;
+ tmpl.width[0] = w;
+ tmpl.height[0] = h;
+ tmpl.depth[0] = 1;
+ tmpl.format = format;
+ pf_get_block(tmpl.format, &tmpl.block);
+ tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w);
+ tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h);
+
+ pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb);
+ if (pt == NULL) {
+ pipe_buffer_reference(pipe_screen, &pb, NULL);
+ }
+ ps = pipe_screen->get_tex_surface(pipe_screen, pt, 0, 0, 0,
+ PIPE_BUFFER_USAGE_GPU_WRITE);
+ return ps;
+}
diff --git a/src/gallium/winsys/drm/radeon/radeon_buffer.h b/src/gallium/winsys/drm/radeon/radeon_buffer.h
new file mode 100644
index 0000000000..c626c20229
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_buffer.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#ifndef RADEON_BUFFER_H
+#define RADEON_BUFFER_H
+
+#include "pipe/internal/p_winsys_screen.h"
+#include "radeon_screen.h"
+#include "radeon_context.h"
+#include "radeon_bo.h"
+
+struct radeon_pipe_buffer {
+ struct pipe_buffer base;
+ struct radeon_bo *bo;
+};
+
+struct radeon_pipe_winsys {
+ struct pipe_winsys winsys;
+ struct radeon_screen *radeon_screen;
+};
+
+struct pipe_winsys *radeon_pipe_winsys(struct radeon_screen *radeon_screen);
+struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context,
+ uint32_t handle,
+ enum pipe_format format,
+ int w, int h, int pitch);
+
+#endif
diff --git a/src/gallium/winsys/drm/radeon/radeon_context.c b/src/gallium/winsys/drm/radeon/radeon_context.c
new file mode 100644
index 0000000000..13a7035fec
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_context.c
@@ -0,0 +1,272 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#include <stdio.h>
+#include "dri_util.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_inlines.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "radeon_screen.h"
+#include "radeon_context.h"
+#include "radeon_buffer.h"
+#include "radeon_winsys_softpipe.h"
+
+#define need_GL_ARB_point_parameters
+#define need_GL_ARB_vertex_buffer_object
+#define need_GL_EXT_cull_vertex
+#define need_GL_EXT_compiled_vertex_array
+#include "extension_helper.h"
+
+/**
+ * Extension strings exported by the radeon driver.
+ */
+const struct dri_extension radeon_card_extensions[] = {
+/* XXX these are technically not supported
+ {"GL_ARB_texture_rectangle", NULL},
+ {"GL_ARB_pixel_buffer_object", NULL}, */
+ {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
+ {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
+ {"GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions},
+ {"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
+ {NULL, NULL}
+};
+
+static void radeon_update_renderbuffers(__DRIcontext *dri_context,
+ __DRIdrawable *dri_drawable)
+{
+ struct radeon_framebuffer *radeon_fb;
+ struct radeon_context *radeon_context;
+ unsigned attachments[10];
+ __DRIbuffer *buffers;
+ __DRIscreen *screen;
+ int i, count;
+
+ radeon_context = dri_context->driverPrivate;
+ screen = dri_drawable->driScreenPriv;
+ radeon_fb = dri_drawable->driverPrivate;
+ for (count = 0, i = 0; count < 6; count++) {
+ if (radeon_fb->attachments & (1 << count)) {
+ attachments[i++] = count;
+ }
+ }
+
+ buffers = (*screen->dri2.loader->getBuffers)(dri_drawable,
+ &dri_drawable->w,
+ &dri_drawable->h,
+ attachments,
+ i,
+ &count,
+ dri_drawable->loaderPrivate);
+ if (buffers == NULL) {
+ return;
+ }
+
+ /* set one cliprect to cover the whole dri_drawable */
+ dri_drawable->x = 0;
+ dri_drawable->y = 0;
+ dri_drawable->backX = 0;
+ dri_drawable->backY = 0;
+ dri_drawable->numClipRects = 1;
+ dri_drawable->pClipRects[0].x1 = 0;
+ dri_drawable->pClipRects[0].y1 = 0;
+ dri_drawable->pClipRects[0].x2 = dri_drawable->w;
+ dri_drawable->pClipRects[0].y2 = dri_drawable->h;
+ dri_drawable->numBackClipRects = 1;
+ dri_drawable->pBackClipRects[0].x1 = 0;
+ dri_drawable->pBackClipRects[0].y1 = 0;
+ dri_drawable->pBackClipRects[0].x2 = dri_drawable->w;
+ dri_drawable->pBackClipRects[0].y2 = dri_drawable->h;
+
+ for (i = 0; i < count; i++) {
+ struct pipe_surface *ps;
+ enum pipe_format format = 0;
+ int index = 0;
+
+ switch (buffers[i].attachment) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ index = ST_SURFACE_FRONT_LEFT;
+ switch (buffers[i].cpp) {
+ case 4:
+ format = PIPE_FORMAT_A8R8G8B8_UNORM;
+ break;
+ case 2:
+ format = PIPE_FORMAT_R5G6B5_UNORM;
+ break;
+ default:
+ /* FIXME: error */
+ return;
+ }
+ break;
+ case __DRI_BUFFER_BACK_LEFT:
+ index = ST_SURFACE_BACK_LEFT;
+ switch (buffers[i].cpp) {
+ case 4:
+ format = PIPE_FORMAT_A8R8G8B8_UNORM;
+ break;
+ case 2:
+ format = PIPE_FORMAT_R5G6B5_UNORM;
+ break;
+ default:
+ /* FIXME: error */
+ return;
+ }
+ break;
+ case __DRI_BUFFER_STENCIL:
+ case __DRI_BUFFER_DEPTH:
+ index = ST_SURFACE_DEPTH;
+ switch (buffers[i].cpp) {
+ case 4:
+ format = PIPE_FORMAT_Z24S8_UNORM;
+ break;
+ case 2:
+ format = PIPE_FORMAT_Z16_UNORM;
+ break;
+ default:
+ /* FIXME: error */
+ return;
+ }
+ break;
+ case __DRI_BUFFER_ACCUM:
+ default:
+ fprintf(stderr,
+ "unhandled buffer attach event, attacment type %d\n",
+ buffers[i].attachment);
+ return;
+ }
+
+ ps = radeon_surface_from_handle(radeon_context,
+ buffers[i].name,
+ format,
+ dri_drawable->w,
+ dri_drawable->h,
+ buffers[i].pitch);
+ assert(ps);
+ st_set_framebuffer_surface(radeon_fb->st_framebuffer, index, ps);
+ }
+ st_resize_framebuffer(radeon_fb->st_framebuffer,
+ dri_drawable->w,
+ dri_drawable->h);
+}
+
+GLboolean radeon_context_create(const __GLcontextModes *visual,
+ __DRIcontextPrivate *dri_context,
+ void *shared_context)
+{
+ __DRIscreenPrivate *dri_screen;
+ struct radeon_context *radeon_context;
+ struct radeon_screen *radeon_screen;
+ struct pipe_context *pipe;
+ struct st_context *shared_st_context = NULL;
+
+ dri_context->driverPrivate = NULL;
+ radeon_context = calloc(1, sizeof(struct radeon_context));
+ if (radeon_context == NULL) {
+ return GL_FALSE;
+ }
+
+ if (shared_context) {
+ shared_st_context = ((struct radeon_context*)shared_context)->st_context;
+ }
+
+ dri_screen = dri_context->driScreenPriv;
+ radeon_screen = dri_screen->private;
+ radeon_context->dri_screen = dri_screen;
+ radeon_context->radeon_screen = radeon_screen;
+ radeon_context->drm_fd = dri_screen->fd;
+
+ radeon_context->pipe_winsys = radeon_pipe_winsys(radeon_screen);
+ if (radeon_context->pipe_winsys == NULL) {
+ free(radeon_context);
+ return GL_FALSE;
+ }
+
+ if (!getenv("RADEON_SOFTPIPE")) {
+ fprintf(stderr, "Creating r300 context...\n");
+ pipe =
+ r300_create_context(NULL,
+ radeon_context->pipe_winsys,
+ radeon_create_r300_winsys(radeon_context->drm_fd));
+ radeon_context->pipe_screen = pipe->screen;
+ } else {
+ pipe = radeon_create_softpipe(radeon_context);
+ }
+ radeon_context->st_context = st_create_context(pipe, visual,
+ shared_st_context);
+ driInitExtensions(radeon_context->st_context->ctx,
+ radeon_card_extensions, GL_TRUE);
+ dri_context->driverPrivate = radeon_context;
+ return GL_TRUE;
+}
+
+void radeon_context_destroy(__DRIcontextPrivate *dri_context)
+{
+ struct radeon_context *radeon_context;
+
+ radeon_context = dri_context->driverPrivate;
+ st_finish(radeon_context->st_context);
+ st_destroy_context(radeon_context->st_context);
+ free(radeon_context);
+}
+
+GLboolean radeon_context_bind(__DRIcontextPrivate *dri_context,
+ __DRIdrawablePrivate *dri_drawable,
+ __DRIdrawablePrivate *dri_readable)
+{
+ struct radeon_framebuffer *drawable;
+ struct radeon_framebuffer *readable;
+ struct radeon_context *radeon_context;
+
+ if (dri_context == NULL) {
+ st_make_current(NULL, NULL, NULL);
+ return GL_TRUE;
+ }
+
+ radeon_context = dri_context->driverPrivate;
+ drawable = dri_drawable->driverPrivate;
+ readable = dri_readable->driverPrivate;
+ st_make_current(radeon_context->st_context,
+ drawable->st_framebuffer,
+ readable->st_framebuffer);
+
+ radeon_update_renderbuffers(dri_context, dri_drawable);
+ if (dri_drawable != dri_readable) {
+ radeon_update_renderbuffers(dri_context, dri_readable);
+ }
+ return GL_TRUE;
+}
+
+GLboolean radeon_context_unbind(__DRIcontextPrivate *dri_context)
+{
+ struct radeon_context *radeon_context;
+
+ radeon_context = dri_context->driverPrivate;
+ st_flush(radeon_context->st_context, PIPE_FLUSH_RENDER_CACHE, NULL);
+ return GL_TRUE;
+}
diff --git a/src/gallium/winsys/drm/radeon/radeon_context.h b/src/gallium/winsys/drm/radeon/radeon_context.h
new file mode 100644
index 0000000000..d7222b4469
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_context.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#ifndef RADEON_CONTEXT_H
+#define RADEON_CONTEXT_H
+
+#include "dri_util.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "radeon_screen.h"
+
+#include "radeon_r300.h"
+
+struct radeon_framebuffer {
+ struct st_framebuffer *st_framebuffer;
+ unsigned attachments;
+};
+
+struct radeon_context {
+ /* st */
+ struct st_context *st_context;
+ /* pipe */
+ struct pipe_screen *pipe_screen;
+ struct pipe_winsys *pipe_winsys;
+ /* DRI */
+ __DRIscreenPrivate *dri_screen;
+ __DRIdrawablePrivate *dri_drawable;
+ __DRIdrawablePrivate *dri_readable;
+ /* DRM */
+ int drm_fd;
+ /* RADEON */
+ struct radeon_screen *radeon_screen;
+};
+
+GLboolean radeon_context_create(const __GLcontextModes*,
+ __DRIcontextPrivate*,
+ void*);
+void radeon_context_destroy(__DRIcontextPrivate*);
+GLboolean radeon_context_bind(__DRIcontextPrivate*,
+ __DRIdrawablePrivate*,
+ __DRIdrawablePrivate*);
+GLboolean radeon_context_unbind(__DRIcontextPrivate*);
+
+#endif
diff --git a/src/gallium/winsys/drm/radeon/radeon_r300.c b/src/gallium/winsys/drm/radeon/radeon_r300.c
new file mode 100644
index 0000000000..8fe2375e34
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_r300.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "radeon_r300.h"
+
+static boolean radeon_r300_check_cs(struct radeon_cs* cs, int size)
+{
+ /* XXX check size here, lazy ass! */
+ return TRUE;
+}
+
+static void radeon_r300_write_cs_reloc(struct radeon_cs* cs,
+ struct pipe_buffer* pbuffer,
+ uint32_t rd,
+ uint32_t wd,
+ uint32_t flags)
+{
+ radeon_cs_write_reloc(cs, ((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags);
+}
+
+static void radeon_r300_flush_cs(struct radeon_cs* cs)
+{
+ radeon_cs_emit(cs);
+ radeon_cs_erase(cs);
+}
+
+/* Helper function to do the ioctls needed for setup and init. */
+static void do_ioctls(struct r300_winsys* winsys, int fd)
+{
+ drm_radeon_getparam_t gp;
+ uint32_t target;
+ int retval;
+
+ /* XXX is this cast safe? */
+ gp.value = (int*)&target;
+
+ /* First, get PCI ID */
+ gp.param = RADEON_PARAM_DEVICE_ID;
+ retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp));
+ if (retval) {
+ fprintf(stderr, "%s: Failed to get PCI ID, error number %d",
+ __FUNCTION__, retval);
+ exit(1);
+ }
+ winsys->pci_id = target;
+
+ /* Then, get the number of pixel pipes */
+ gp.param = RADEON_PARAM_NUM_GB_PIPES;
+ retval = drmCommandWriteRead(fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp));
+ if (retval) {
+ fprintf(stderr, "%s: Failed to get GB pipe count, error number %d",
+ __FUNCTION__, retval);
+ exit(1);
+ }
+ winsys->gb_pipes = target;
+
+}
+
+struct r300_winsys* radeon_create_r300_winsys(int fd)
+{
+ struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys));
+
+ do_ioctls(winsys, fd);
+
+ struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
+
+ winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4);
+
+ winsys->check_cs = radeon_r300_check_cs;
+ winsys->begin_cs = radeon_cs_begin;
+ winsys->write_cs_dword = radeon_cs_write_dword;
+ winsys->write_cs_reloc = radeon_r300_write_cs_reloc;
+ winsys->end_cs = radeon_cs_end;
+ winsys->flush_cs = radeon_r300_flush_cs;
+
+ return winsys;
+}
diff --git a/src/gallium/winsys/drm/radeon/radeon_r300.h b/src/gallium/winsys/drm/radeon/radeon_r300.h
new file mode 100644
index 0000000000..8ed95a3a9b
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_r300.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+/* XXX WTF is this! I shouldn't have to include those first three! FUCK! */
+#include <stdint.h>
+#include <stdlib.h>
+#include "drm.h"
+#include "radeon_drm.h"
+#include "radeon_cs.h"
+
+#include "r300_winsys.h"
+
+#include "radeon_buffer.h"
+
+struct r300_winsys* radeon_create_r300_winsys(int fd);
diff --git a/src/gallium/winsys/drm/radeon/radeon_screen.c b/src/gallium/winsys/drm/radeon/radeon_screen.c
new file mode 100644
index 0000000000..e31caff0bf
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_screen.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#include <stdio.h>
+#include "pipe/p_screen.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_inlines.h"
+#include "pipe/p_context.h"
+#include "pipe/p_state.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "utils.h"
+#include "xf86drm.h"
+#include "drm.h"
+#include "dri_util.h"
+#include "radeon_screen.h"
+#include "radeon_context.h"
+#include "radeon_buffer.h"
+#include "radeon_bo.h"
+#include "radeon_bo_gem.h"
+#include "radeon_drm.h"
+
+extern const struct dri_extension radeon_card_extensions[];
+
+static const __DRIextension *radeon_screen_extensions[] = {
+ &driReadDrawableExtension,
+ &driCopySubBufferExtension.base,
+ &driSwapControlExtension.base,
+ &driFrameTrackingExtension.base,
+ &driMediaStreamCounterExtension.base,
+ NULL
+};
+
+static __DRIconfig **radeon_fill_in_modes(unsigned pixel_bits,
+ unsigned depth_bits,
+ GLboolean have_back_buffer)
+{
+ __DRIconfig **configs;
+ unsigned depth_buffer_factor;
+ unsigned back_buffer_factor;
+ unsigned num_modes;
+ GLenum fb_format;
+ GLenum fb_type;
+ uint8_t depth_bits_array[3];
+ uint8_t stencil_bits_array[3];
+ uint8_t msaa_samples_array[1];
+ /* TODO: pageflipping ? */
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ stencil_bits_array[0] = 0;
+ stencil_bits_array[1] = 0;
+ if (depth_bits == 24) {
+ stencil_bits_array[2] = 8;
+ num_modes = 3;
+ }
+
+ depth_bits_array[0] = 0;
+ depth_bits_array[1] = depth_bits;
+ depth_bits_array[2] = depth_bits;
+ depth_buffer_factor = (depth_bits == 24) ? 3 : 2;
+
+ back_buffer_factor = (have_back_buffer) ? 3 : 1;
+
+ msaa_samples_array[0] = 0;
+
+ if (pixel_bits == 16) {
+ fb_format = GL_RGB;
+ fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ } else {
+ fb_format = GL_BGRA;
+ fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ }
+
+ configs = (__DRIconfig **)driCreateConfigs(fb_format,
+ fb_type,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array,
+ 1);
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
+ __FILE__, __LINE__);
+ return NULL;
+ }
+ return configs;
+}
+
+static void radeon_screen_destroy(__DRIscreenPrivate *dri_screen)
+{
+ struct radeon_screen *radeon_screen = (struct radeon_screen*)dri_screen->private;
+
+ radeon_bo_manager_gem_dtor(radeon_screen->bom);
+ dri_screen = NULL;
+ free(radeon_screen);
+}
+
+static const __DRIconfig **radeon_screen_init(__DRIscreenPrivate *dri_screen)
+{
+ struct radeon_screen *radeon_screen;
+
+ /* Calling driInitExtensions here, with a NULL context pointer,
+ * does not actually enable the extensions. It just makes sure
+ * that all the dispatch offsets for all the extensions that
+ * *might* be enables are known. This is needed because the
+ * dispatch offsets need to be known when _mesa_context_create is
+ * called, but we can't enable the extensions until we have a
+ * context pointer.
+ *
+ * Hello chicken. Hello egg. How are you two today?
+ */
+ driInitExtensions(NULL, radeon_card_extensions, GL_FALSE);
+
+ radeon_screen = calloc(1, sizeof(struct radeon_screen));
+ if (radeon_screen == NULL) {
+ fprintf(stderr, "\nERROR! Allocating private area failed\n");
+ return NULL;
+ }
+ dri_screen->private = (void*)radeon_screen;
+ dri_screen->extensions = radeon_screen_extensions;
+ radeon_screen->dri_screen = dri_screen;
+
+ radeon_screen->bom = radeon_bo_manager_gem_ctor(dri_screen->fd);
+ if (radeon_screen->bom == NULL) {
+ radeon_screen_destroy(dri_screen);
+ return NULL;
+ }
+
+ return driConcatConfigs(radeon_fill_in_modes(16, 16, 1),
+ radeon_fill_in_modes(32, 24, 1));
+}
+
+static boolean radeon_buffer_create(__DRIscreenPrivate *dri_screen,
+ __DRIdrawablePrivate *dri_drawable,
+ const __GLcontextModes *visual,
+ boolean is_pixmap)
+{
+ if (is_pixmap) {
+ /* TODO: implement ? */
+ return GL_FALSE;
+ } else {
+ enum pipe_format color_format, depth_format, stencil_format;
+ struct radeon_framebuffer *radeon_fb;
+
+ radeon_fb = calloc(1, sizeof(struct radeon_framebuffer));
+ if (radeon_fb == NULL) {
+ return GL_FALSE;
+ }
+
+ switch (visual->redBits) {
+ case 5:
+ color_format = PIPE_FORMAT_R5G6B5_UNORM;
+ break;
+ default:
+ color_format = PIPE_FORMAT_A8R8G8B8_UNORM;
+ break;
+ }
+
+ switch (visual->depthBits) {
+ case 24:
+ depth_format = PIPE_FORMAT_S8Z24_UNORM;
+ break;
+ case 16:
+ depth_format = PIPE_FORMAT_Z16_UNORM;
+ break;
+ default:
+ depth_format = PIPE_FORMAT_NONE;
+ break;
+ }
+
+ switch (visual->stencilBits) {
+ case 8:
+ /* force depth format */
+ depth_format = PIPE_FORMAT_S8Z24_UNORM;
+ stencil_format = PIPE_FORMAT_S8Z24_UNORM;
+ break;
+ default:
+ stencil_format = PIPE_FORMAT_NONE;
+ break;
+ }
+
+ radeon_fb->st_framebuffer = st_create_framebuffer(visual,
+ color_format,
+ depth_format,
+ stencil_format,
+ dri_drawable->w,
+ dri_drawable->h,
+ (void*)radeon_fb);
+ if (radeon_fb->st_framebuffer == NULL) {
+ free(radeon_fb);
+ return GL_FALSE;
+ }
+ dri_drawable->driverPrivate = (void *) radeon_fb;
+
+ radeon_fb->attachments = (1 << __DRI_BUFFER_FRONT_LEFT);
+ if (visual->doubleBufferMode) {
+ radeon_fb->attachments |= (1 << __DRI_BUFFER_BACK_LEFT);
+ }
+ if (visual->depthBits || visual->stencilBits) {
+ radeon_fb->attachments |= (1 << __DRI_BUFFER_DEPTH);
+ }
+
+ return GL_TRUE;
+ }
+}
+
+static void radeon_buffer_destroy(__DRIdrawablePrivate * dri_drawable)
+{
+ struct radeon_framebuffer *radeon_fb;
+
+ radeon_fb = dri_drawable->driverPrivate;
+ assert(radeon_fb->st_framebuffer);
+ st_unreference_framebuffer(radeon_fb->st_framebuffer);
+ free(radeon_fb);
+}
+
+static void radeon_swap_buffers(__DRIdrawablePrivate *dri_drawable)
+{
+ struct radeon_framebuffer *radeon_fb;
+ struct pipe_surface *back_surf = NULL;
+
+ radeon_fb = dri_drawable->driverPrivate;
+ assert(radeon_fb);
+ assert(radeon_fb->st_framebuffer);
+
+ st_get_framebuffer_surface(radeon_fb->st_framebuffer,
+ ST_SURFACE_BACK_LEFT,
+ &back_surf);
+ if (back_surf) {
+ st_notify_swapbuffers(radeon_fb->st_framebuffer);
+ /* TODO: do we want to do anythings ? */
+ st_notify_swapbuffers_complete(radeon_fb->st_framebuffer);
+ }
+}
+
+/**
+ * Called via glXCopySubBufferMESA() to copy a subrect of the back
+ * buffer to the front buffer/screen.
+ */
+static void radeon_copy_sub_buffer(__DRIdrawablePrivate *dri_drawable,
+ int x, int y, int w, int h)
+{
+ /* TODO: ... */
+}
+
+const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = NULL,
+ .DestroyScreen = radeon_screen_destroy,
+ .CreateContext = radeon_context_create,
+ .DestroyContext = radeon_context_destroy,
+ .CreateBuffer = radeon_buffer_create,
+ .DestroyBuffer = radeon_buffer_destroy,
+ .SwapBuffers = radeon_swap_buffers,
+ .MakeCurrent = radeon_context_bind,
+ .UnbindContext = radeon_context_unbind,
+ .CopySubBuffer = radeon_copy_sub_buffer,
+ .InitScreen2 = radeon_screen_init,
+};
diff --git a/src/gallium/winsys/drm/radeon/radeon_screen.h b/src/gallium/winsys/drm/radeon/radeon_screen.h
new file mode 100644
index 0000000000..01b7fa6531
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_screen.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#ifndef RADEON_SCREEN_H
+#define RADEON_SCREEN_H
+
+#include "dri_util.h"
+#include "radeon_bo.h"
+
+struct radeon_screen {
+ __DRIscreenPrivate *dri_screen;
+ struct radeon_bo_manager *bom;
+};
+
+#endif
diff --git a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c
index 20920a2052..8402e1fa5a 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c
+++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,73 +10,68 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
- *
+ *
+ *
**************************************************************************/
/*
* Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
*/
-
-#include "intel_context.h"
-#include "intel_winsys_softpipe.h"
+#include <stdio.h>
+#include "imports.h"
#include "pipe/p_defines.h"
#include "pipe/p_format.h"
-#include "util/u_memory.h"
#include "softpipe/sp_winsys.h"
+#include "radeon_context.h"
+#include "radeon_winsys_softpipe.h"
-
-struct intel_softpipe_winsys {
- struct softpipe_winsys sws;
- struct intel_context *intel;
+struct radeon_softpipe_winsys {
+ struct softpipe_winsys sp_winsys;
+ struct radeon_context *radeon_context;
};
/**
* Return list of surface formats supported by this driver.
*/
-static boolean
-intel_is_format_supported(struct softpipe_winsys *sws,
- enum pipe_format format)
+static boolean radeon_is_format_supported(struct softpipe_winsys *sws, uint format)
{
- switch(format) {
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_R5G6B5_UNORM:
- case PIPE_FORMAT_S8Z24_UNORM:
- return TRUE;
- default:
- return FALSE;
- }
+ switch (format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_R5G6B5_UNORM:
+ case PIPE_FORMAT_Z24S8_UNORM:
+ return TRUE;
+ default:
+ break;
+ };
+ return FALSE;
}
-
-/**
- * Create rendering context which uses software rendering.
- */
-struct pipe_context *
-intel_create_softpipe( struct intel_context *intel,
- struct pipe_winsys *winsys )
+struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context)
{
- struct intel_softpipe_winsys *isws = CALLOC_STRUCT( intel_softpipe_winsys );
- struct pipe_screen *screen = softpipe_create_screen(winsys);
+ struct radeon_softpipe_winsys *radeon_sp_ws;
+ struct pipe_screen *pipe_screen;
- /* Fill in this struct with callbacks that softpipe will need to
- * communicate with the window system, buffer manager, etc.
- */
- isws->sws.is_format_supported = intel_is_format_supported;
- isws->intel = intel;
+ pipe_screen = softpipe_create_screen(radeon_context->pipe_winsys);
- /* Create the softpipe context:
- */
- return softpipe_create( screen, winsys, &isws->sws );
+ radeon_sp_ws = CALLOC_STRUCT(radeon_softpipe_winsys);
+ if (radeon_sp_ws == NULL) {
+ return NULL;
+ }
+ radeon_context->pipe_screen = pipe_screen;
+ radeon_sp_ws->radeon_context = radeon_context;
+ radeon_sp_ws->sp_winsys.is_format_supported = radeon_is_format_supported;
+ return softpipe_create(pipe_screen,
+ radeon_context->pipe_winsys,
+ &radeon_sp_ws->sp_winsys);
}
diff --git a/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h
new file mode 100644
index 0000000000..519eab769c
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Jérôme Glisse <glisse@freedesktop.org>
+ */
+#ifndef RADEON_WINSYS_SOFTPIPE_H
+#define RADEON_WINSYS_SOFTPIPE_H
+
+#include "radeon_context.h"
+
+struct pipe_context *radeon_create_softpipe(struct radeon_context *radeon_context);
+
+#endif
diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile
index 76f1b56da4..02ac47caa4 100644
--- a/src/gallium/winsys/egl_xlib/Makefile
+++ b/src/gallium/winsys/egl_xlib/Makefile
@@ -34,7 +34,7 @@ LIBS = \
# mesa code, as done for ES 1.x, 2.x, OpenVG, etc)
UNUSED_LIBS = \
$(TOP)/src/mesa/libglapi.a \
- $(TOP)/src/mesa/libmesa.a \
+ $(TOP)/src/mesa/libmesagallium.a \
LOCAL_CFLAGS = -D_EGL_PLATFORM_X=1
diff --git a/src/gallium/winsys/g3dvl/nouveau/Makefile b/src/gallium/winsys/g3dvl/nouveau/Makefile
index 22d925b643..2997f6b79c 100644
--- a/src/gallium/winsys/g3dvl/nouveau/Makefile
+++ b/src/gallium/winsys/g3dvl/nouveau/Makefile
@@ -11,6 +11,7 @@ CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \
-I${GALLIUMDIR}/winsys/drm/nouveau \
-I${DRMDIR}/include \
-I${DRMDIR}/include/drm \
+ -I${DRMDIR}/include/nouveau \
-I${GALLIUMDIR}/drivers \
-I${GALLIUMDIR}/auxiliary \
-I${DRIDIR}/include
@@ -23,13 +24,14 @@ LDFLAGS += -L${DRMDIR}/lib \
-L${GALLIUMDIR}/auxiliary/translate \
-L${GALLIUMDIR}/auxiliary/rtasm \
-L${GALLIUMDIR}/auxiliary/cso_cache \
+ -L${GALLIUMDIR}/drivers/nv04 \
-L${GALLIUMDIR}/drivers/nv10 \
-L${GALLIUMDIR}/drivers/nv20 \
-L${GALLIUMDIR}/drivers/nv30 \
-L${GALLIUMDIR}/drivers/nv40 \
-L${GALLIUMDIR}/drivers/nv50
-LIBS += -lnouveaudrm -ldriclient -ldrm -lnv10 -lnv20 -lnv30 -lnv40 -lnv50 -ldraw -ltgsi -ltranslate -lrtasm -lcso_cache -lm
+LIBS += -lnouveaudrm -ldriclient -ldrm_nouveau -ldrm -lnv04 -lnv10 -lnv20 -lnv30 -lnv40 -lnv50 -ldraw -ltgsi -ltranslate -lrtasm -lcso_cache -lm
#############################################
diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c
index 658dafd910..b7c74f8299 100644
--- a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c
+++ b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c
@@ -4,7 +4,7 @@
#include <common/nouveau_dri.h>
#include <common/nouveau_local.h>
-#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 11
+#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 12
#error nouveau_drm.h version does not match expected version
#endif
diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c
index 16e6d5543c..864be37871 100644
--- a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c
+++ b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c
@@ -9,6 +9,7 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf,
const drm_clip_rect_t *rect)
{
struct nouveau_context_vl *nv = dri_drawable->private;
+ struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id];
drm_clip_rect_t *pbox;
int nbox, i;
@@ -20,7 +21,6 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf,
pbox = dri_drawable->cliprects;
nbox = dri_drawable->num_cliprects;
- nv->base.surface_copy_prep(&nv->base, nv->base.frontbuffer, surf);
for (i = 0; i < nbox; i++, pbox++) {
int sx, sy, dx, dy, w, h;
@@ -31,7 +31,8 @@ nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf,
w = pbox->x2 - pbox->x1;
h = pbox->y2 - pbox->y1;
- nv->base.surface_copy(&nv->base, dx, dy, sx, sy, w, h);
+ pipe->surface_copy(pipe, FALSE, nv->base.frontbuffer,
+ dx, dy, surf, sx, sy, w, h);
}
FIRE_RING(nv->base.nvc->channel);
diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index 8c2892d49b..bb187cc14a 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -47,7 +47,7 @@ LIBS = \
$(GALLIUM_DRIVERS) \
$(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
$(TOP)/src/mesa/libglapi.a \
- $(TOP)/src/mesa/libmesa.a \
+ $(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES) \
$(CELL_SPU_LIB) \
@@ -62,15 +62,17 @@ LIBS = \
-default: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
+default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME)
+$(TOP)/$(LIB_DIR)/gallium:
+ @ mkdir -p $(TOP)/$(LIB_DIR)/gallium
# Make the libGL.so library
-$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefile
+$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefile
$(TOP)/bin/mklib -o $(GL_LIB) \
-linker "$(CC)" \
-major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
- -install $(TOP)/$(LIB_DIR) \
+ -install $(TOP)/$(LIB_DIR)/gallium \
$(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \
--start-group $(LIBS) --end-group $(GL_LIB_DEPS)
diff --git a/src/gallium/winsys/xlib/xlib_brw_screen.c b/src/gallium/winsys/xlib/xlib_brw_screen.c
index 51740a9af6..8e1bfab2f5 100644
--- a/src/gallium/winsys/xlib/xlib_brw_screen.c
+++ b/src/gallium/winsys/xlib/xlib_brw_screen.c
@@ -325,6 +325,7 @@ xlib_create_brw_winsys( void )
static struct pipe_screen *
xlib_create_brw_screen( void )
{
+#ifndef GALLIUM_CELL
struct pipe_winsys *winsys;
struct pipe_screen *screen;
@@ -342,6 +343,7 @@ fail:
if (winsys)
winsys->destroy( winsys );
+#endif
return NULL;
}
diff --git a/src/glew/Makefile b/src/glew/Makefile
index 49ee8b6594..8e6ccb4f7c 100644
--- a/src/glew/Makefile
+++ b/src/glew/Makefile
@@ -37,6 +37,9 @@ $(TOP)/$(LIB_DIR)/$(GLEW_LIB_NAME): depend $(OBJECTS)
$(MKLIB) -o $(GLEW_LIB) -static -install $(TOP)/$(LIB_DIR) $(OBJECTS)
+install:
+
+
clean:
-rm -f *.o *~
-rm -f depend depend.bak
diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript
index cb442ba027..938fec03df 100644
--- a/src/glut/glx/SConscript
+++ b/src/glut/glx/SConscript
@@ -10,7 +10,6 @@ target = 'glut32'
env.Replace(CPPDEFINES = [
'BUILD_GLUT32',
'GLUT_BUILDING_LIB',
- 'MESA',
'NDEBUG',
'GLUT_NO_WARNING_DISABLE',
])
diff --git a/src/glut/glx/glut.def b/src/glut/glx/glut.def
index d5e0e0cf2a..90010815e4 100644
--- a/src/glut/glx/glut.def
+++ b/src/glut/glx/glut.def
@@ -1,9 +1,4 @@
-DESCRIPTION 'OpenGL Utility Toolkit for Win32'
-
-VERSION 3.7
-
EXPORTS
-
glutAddMenuEntry
glutAddSubMenu
glutAttachMenu
@@ -128,4 +123,3 @@ EXPORTS
glutBitmapTimesRoman24
; __glutSetFCB
; __glutGetFCB
-
diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h
index fe4e038add..ba30af60f0 100644
--- a/src/glut/glx/glutint.h
+++ b/src/glut/glx/glutint.h
@@ -32,10 +32,6 @@
#include <GL/glut.h>
-#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
-#include <GL/mesa_wgl.h>
-#endif
-
#ifndef _WIN32
/* added by BrianP: */
#ifndef APIENTRY
@@ -48,24 +44,6 @@
/* GLUT_BUILDING_LIB is used by <GL/glut.h> to 1) not #pragma link
with the GLUT library, and 2) avoid the Win32 atexit hack. */
-/* This must be done after <GL/gl.h> is included. MESA is defined
- if the <GL/gl.h> is supplied by Brian Paul's Mesa library. */
-#if defined(MESA) && defined(_WIN32)
-/* Mesa implements "wgl" versions of GDI entry points needed for
- using OpenGL. Map these "wgl" versions to the GDI names via
- macros. */
-#define ChoosePixelFormat wglChoosePixelFormat
-#define DescribePixelFormat wglDescribePixelFormat
-#define GetPixelFormat wglGetPixelFormat
-#define SetPixelFormat wglSetPixelFormat
-#define SwapBuffers wglSwapBuffers
-#define GetCurrentContext wglGetCurrentContext
-#define GetCurrentDC wglGetCurrentDC
-#define MakeCurrent wglMakeCurrent
-#define CreateContext wglCreateContext
-#define DeleteContext wglDeleteContext
-#endif /* MESA */
-
#ifdef SUPPORT_FORTRAN
#include <GL/glutf90.h>
#endif
@@ -572,27 +550,27 @@ typedef struct {
#ifdef _WIN32
#define MAKE_CURRENT_LAYER(window) \
{ \
- HGLRC currentContext = GetCurrentContext(); \
- HDC currentDc = GetCurrentDC(); \
+ HGLRC currentContext = wglGetCurrentContext(); \
+ HDC currentDc = wglGetCurrentDC(); \
\
if (currentContext != window->renderCtx \
|| currentDc != window->renderDc) { \
- MakeCurrent(window->renderDc, window->renderCtx); \
+ wglMakeCurrent(window->renderDc, window->renderCtx); \
} \
}
#define MAKE_CURRENT_WINDOW(window) \
{ \
- HGLRC currentContext = GetCurrentContext(); \
- HDC currentDc = GetCurrentDC(); \
+ HGLRC currentContext = wglGetCurrentContext(); \
+ HDC currentDc = wglGetCurrentDC(); \
\
if (currentContext != window->ctx || currentDc != window->hdc) { \
- MakeCurrent(window->hdc, window->ctx); \
+ wglMakeCurrent(window->hdc, window->ctx); \
} \
}
#define MAKE_CURRENT_OVERLAY(overlay) \
- MakeCurrent(overlay->hdc, overlay->ctx)
+ wglMakeCurrent(overlay->hdc, overlay->ctx)
#define UNMAKE_CURRENT() \
- MakeCurrent(NULL, NULL)
+ wglMakeCurrent(NULL, NULL)
#define SWAP_BUFFERS_WINDOW(window) \
SwapBuffers(window->hdc)
#define SWAP_BUFFERS_LAYER(window) \
diff --git a/src/glut/glx/win32_glx.c b/src/glut/glx/win32_glx.c
index ecfff44b93..3522e606ec 100644
--- a/src/glut/glx/win32_glx.c
+++ b/src/glut/glx/win32_glx.c
@@ -22,7 +22,7 @@ glXCreateContext(Display * display, XVisualInfo * visinfo,
routine. */
HGLRC context;
- context = CreateContext(XHDC);
+ context = wglCreateContext(XHDC);
#if 0
/* XXX GLUT doesn't support it now, so don't worry about display list
diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c
index 3b48cd9c1c..f967432b99 100644
--- a/src/glx/x11/dri2.c
+++ b/src/glx/x11/dri2.c
@@ -253,7 +253,7 @@ DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable,
*height = rep.height;
*outCount = rep.count;
- buffers = Xmalloc(count * sizeof buffers[0]);
+ buffers = Xmalloc(rep.count * sizeof buffers[0]);
if (buffers == NULL) {
_XEatData(dpy, rep.count * sizeof repBuffer);
UnlockDisplay(dpy);
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index 2bee67780b..776a14f614 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -60,6 +60,9 @@ struct __GLXDRIdisplayPrivateRec {
int driMajor;
int driMinor;
int driPatch;
+
+ unsigned long configureSeqno;
+ Bool (*oldConfigProc)(Display *, XEvent *, xEvent *);
};
struct __GLXDRIcontextPrivateRec {
@@ -73,6 +76,10 @@ struct __GLXDRIdrawablePrivateRec {
__DRIbuffer buffers[5];
int bufferCount;
int width, height;
+ unsigned long configureSeqno;
+ int have_back;
+ int have_front;
+ int have_fake_front;
};
static void dri2DestroyContext(__GLXDRIcontext *context,
@@ -166,6 +173,8 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc,
pdraw->base.xDrawable = xDrawable;
pdraw->base.drawable = drawable;
pdraw->base.psc = psc;
+ pdraw->bufferCount = 0;
+ pdraw->configureSeqno = ~0;
DRI2CreateDrawable(psc->dpy, xDrawable);
@@ -190,6 +199,10 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
XRectangle xrect;
XserverRegion region;
+ /* Check we have the right attachments */
+ if (!(priv->have_front && priv->have_back))
+ return;
+
xrect.x = x;
xrect.y = priv->height - y - height;
xrect.width = width;
@@ -208,6 +221,47 @@ static void dri2SwapBuffers(__GLXDRIdrawable *pdraw)
dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height);
}
+static void dri2WaitX(__GLXDRIdrawable *pdraw)
+{
+ __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ XRectangle xrect;
+ XserverRegion region;
+
+ /* Check we have the right attachments */
+ if (!(priv->have_fake_front && priv->have_front))
+ return;
+
+ xrect.x = 0;
+ xrect.y = 0;
+ xrect.width = priv->width;
+ xrect.height = priv->height;
+
+ region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1);
+ DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region,
+ DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
+ XFixesDestroyRegion(pdraw->psc->dpy, region);
+}
+
+static void dri2WaitGL(__GLXDRIdrawable *pdraw)
+{
+ __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
+ XRectangle xrect;
+ XserverRegion region;
+
+ if (!(priv->have_fake_front && priv->have_front))
+ return;
+
+ xrect.x = 0;
+ xrect.y = 0;
+ xrect.width = priv->width;
+ xrect.height = priv->height;
+
+ region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1);
+ DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region,
+ DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
+ XFixesDestroyRegion(pdraw->psc->dpy, region);
+}
+
static void dri2DestroyScreen(__GLXscreenConfigs *psc)
{
/* Free the direct rendering per screen data */
@@ -223,9 +277,30 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
int *out_count, void *loaderPrivate)
{
__GLXDRIdrawablePrivate *pdraw = loaderPrivate;
+ __GLXdisplayPrivate *dpyPriv = __glXInitialize(pdraw->base.psc->dpy);
+ __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;
DRI2Buffer *buffers;
int i;
+ /**
+ * Check if a ConfigureNotify has come in since we last asked for the
+ * buffers associated with this drawable. If not, we can assume that they're
+ * the same set at glViewport time, and save a synchronous round-trip to the
+ * X Server.
+ */
+ if (pdraw->configureSeqno == pdp->configureSeqno &&
+ count == pdraw->bufferCount) {
+ for (i = 0; i < count; i++) {
+ if (pdraw->buffers[i].attachment != attachments[i])
+ break;
+ }
+ if (i == count) {
+ *out_count = pdraw->bufferCount;
+ return pdraw->buffers;
+ }
+ }
+ pdraw->configureSeqno = pdp->configureSeqno;
+
buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable,
width, height, attachments, count, out_count);
if (buffers == NULL)
@@ -233,6 +308,10 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
pdraw->width = *width;
pdraw->height = *height;
+ pdraw->bufferCount = *out_count;
+ pdraw->have_front = 0;
+ pdraw->have_fake_front = 0;
+ pdraw->have_back = 0;
/* This assumes the DRI2 buffer attachment tokens matches the
* __DRIbuffer tokens. */
@@ -242,6 +321,12 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
pdraw->buffers[i].pitch = buffers[i].pitch;
pdraw->buffers[i].cpp = buffers[i].cpp;
pdraw->buffers[i].flags = buffers[i].flags;
+ if (pdraw->buffers[i].attachment == __DRI_BUFFER_FRONT_LEFT)
+ pdraw->have_front = 1;
+ if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
+ pdraw->have_fake_front = 1;
+ if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)
+ pdraw->have_back = 1;
}
Xfree(buffers);
@@ -282,8 +367,10 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
return NULL;
psc->driver = driOpenDriver(driverName);
- if (psc->driver == NULL)
+ if (psc->driver == NULL) {
+ ErrorMessageF("driver pointer missing\n");
goto handle_error;
+ }
extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
@@ -309,11 +396,15 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
return NULL;
}
- if (drmGetMagic(psc->fd, &magic))
+ if (drmGetMagic(psc->fd, &magic)) {
+ ErrorMessageF("failed to get magic\n");
return NULL;
+ }
- if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic))
+ if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) {
+ ErrorMessageF("failed to authenticate magic %d\n", magic);
return NULL;
+ }
psc->__driScreen =
psc->dri2->createNewScreen(screen, psc->fd,
@@ -332,6 +423,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
psp->createContext = dri2CreateContext;
psp->createDrawable = dri2CreateDrawable;
psp->swapBuffers = dri2SwapBuffers;
+ psp->waitGL = dri2WaitGL;
+ psp->waitX = dri2WaitX;
/* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always
* available.*/
@@ -359,6 +452,28 @@ static void dri2DestroyDisplay(__GLXDRIdisplay *dpy)
Xfree(dpy);
}
+/**
+ * Makes a note on receiving ConfigureNotify that we need to re-check the
+ * DRI2 buffers, as window sizes may have resulted in reallocation.
+ */
+static Bool dri2ConfigureNotifyProc(Display *dpy, XEvent *re, xEvent *event)
+{
+ __GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy);
+ __GLXDRIdisplayPrivate *pdp;
+ Bool ret;
+
+ /* We should always be able to find our pdp, as it only gets torn down
+ * when the Display is torn down.
+ */
+ pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;
+
+ ret = pdp->oldConfigProc(dpy, re, event);
+
+ pdp->configureSeqno = re->xconfigure.serial;
+
+ return ret;
+}
+
/*
* Allocate, initialize and return a __DRIdisplayPrivate object.
* This is called from __glXInitialize() when we are given a new
@@ -381,7 +496,11 @@ _X_HIDDEN __GLXDRIdisplay *dri2CreateDisplay(Display *dpy)
return NULL;
}
+ pdp->oldConfigProc = XESetWireToEvent(dpy, ConfigureNotify,
+ dri2ConfigureNotifyProc);
+
pdp->driPatch = 0;
+ pdp->configureSeqno = 0;
pdp->base.destroyDisplay = dri2DestroyDisplay;
pdp->base.createScreen = dri2CreateScreen;
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index 44724d2c7d..3089aa1728 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -655,6 +655,8 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
psp->createContext = driCreateContext;
psp->createDrawable = driCreateDrawable;
psp->swapBuffers = driSwapBuffers;
+ psp->waitX = NULL;
+ psp->waitGL = NULL;
return psp;
}
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index 467b0ebb7f..3e70759a6c 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -139,6 +139,8 @@ struct __GLXDRIscreenRec {
void (*swapBuffers)(__GLXDRIdrawable *pdraw);
void (*copySubBuffer)(__GLXDRIdrawable *pdraw,
int x, int y, int width, int height);
+ void (*waitX)(__GLXDRIdrawable *pdraw);
+ void (*waitGL)(__GLXDRIdrawable *pdraw);
};
struct __GLXDRIcontextRec {
@@ -602,6 +604,7 @@ extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
const GLvoid *, GLint);
/* Initialize the GLX extension for dpy */
+extern __GLXdisplayPrivate * __glXGetPrivateFromDisplay(Display *dpy);
extern __GLXdisplayPrivate *__glXInitialize(Display*);
extern void __glXPreferEGL(int state);
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index c68b6ac4ef..fc0e593cb3 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -611,11 +611,15 @@ PUBLIC void glXWaitGL(void)
#ifdef GLX_DIRECT_RENDERING
if (gc->driContext) {
-/* This bit of ugliness unwraps the glFinish function */
-#ifdef glFinish
-#undef glFinish
-#endif
- glFinish();
+ int screen;
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen);
+
+ if ( pdraw != NULL ) {
+ __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
+ glFlush();
+ if (psc->driScreen->waitGL != NULL)
+ (*psc->driScreen->waitGL)(pdraw);
+ }
return;
}
#endif
@@ -647,7 +651,15 @@ PUBLIC void glXWaitX(void)
#ifdef GLX_DIRECT_RENDERING
if (gc->driContext) {
- XSync(dpy, False);
+ int screen;
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen);
+
+ if ( pdraw != NULL ) {
+ __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
+ if (psc->driScreen->waitX != NULL)
+ (*psc->driScreen->waitX)(pdraw);
+ } else
+ XSync(dpy, False);
return;
}
#endif
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index d061fa9333..051433a006 100644
--- a/src/glx/x11/glxextensions.c
+++ b/src/glx/x11/glxextensions.c
@@ -99,7 +99,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(SGIS_color_range), VER(0,0), N, N, N, N },
{ GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
{ GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N },
- { GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
+ { GLX(SGIX_pbuffer), VER(1,3), Y, Y, N, N },
{ GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
{ GLX(SGIX_swap_group), VER(0,0), N, N, N, N },
{ GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N },
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 552c20e0b9..78b71d4676 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -21,7 +21,8 @@ include sources.mak
# Default: build dependencies, then asm_subdirs, then convenience
# libs (.a) and finally the device drivers:
-default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
+default: depend asm_subdirs libmesa.a libmesagallium.a libglapi.a \
+ driver_subdirs
@@ -32,6 +33,10 @@ default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
libmesa.a: $(MESA_OBJECTS)
@ $(MKLIB) -o mesa -static $(MESA_OBJECTS)
+# Make archive of subset of core mesa object files for gallium
+libmesagallium.a: $(MESA_GALLIUM_OBJECTS)
+ @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS)
+
# Make archive of gl* API dispatcher functions only
libglapi.a: $(GLAPI_OBJECTS)
@if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \
diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c
index a9d8f62f92..0744677d2b 100644
--- a/src/mesa/drivers/allegro/amesa.c
+++ b/src/mesa/drivers/allegro/amesa.c
@@ -338,7 +338,7 @@ void AMesaDestroyBuffer(AMesaBuffer buffer)
{
if (buffer->Screen) destroy_bitmap(buffer->Screen);
if (buffer->Background) destroy_bitmap(buffer->Background);
- _mesa_unreference_framebuffer(&buffer->GLBuffer);
+ _mesa_reference_framebuffer(&buffer->GLBuffer, NULL);
free(buffer);
}
diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile
index 9e49fb16f5..32db097861 100644
--- a/src/mesa/drivers/dri/Makefile
+++ b/src/mesa/drivers/dri/Makefile
@@ -6,7 +6,7 @@ include $(TOP)/configs/current
-default: $(TOP)/$(LIB_DIR) subdirs
+default: $(TOP)/$(LIB_DIR) subdirs dri.pc
$(TOP)/$(LIB_DIR):
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index b977ebf015..0d641f25f7 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -119,9 +119,10 @@ static const char ActiveTextureARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_blit)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_blit)
static const char BlitFramebufferEXT_names[] =
"iiiiiiiiii\0" /* Parameter signature */
+ "glBlitFramebuffer\0"
"glBlitFramebufferEXT\0"
"";
#endif
@@ -433,17 +434,18 @@ static const char Color4ubVertex3fvSUN_names[] =
"";
#endif
-#if defined(need_GL_EXT_texture_array)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_texture_array)
static const char FramebufferTextureLayerEXT_names[] =
"iiiii\0" /* Parameter signature */
+ "glFramebufferTextureLayer\0"
"glFramebufferTextureLayerEXT\0"
"";
#endif
#if defined(need_GL_SGIX_list_priority)
-static const char GetListParameterivSGIX_names[] =
+static const char GetListParameterfvSGIX_names[] =
"iip\0" /* Parameter signature */
- "glGetListParameterivSGIX\0"
+ "glGetListParameterfvSGIX\0"
"";
#endif
@@ -777,6 +779,13 @@ static const char VertexAttribs4fvNV_names[] =
"";
#endif
+#if defined(need_GL_NV_vertex_array_range)
+static const char VertexArrayRangeNV_names[] =
+ "ip\0" /* Parameter signature */
+ "glVertexArrayRangeNV\0"
+ "";
+#endif
+
#if defined(need_GL_SGIX_fragment_lighting)
static const char FragmentLightiSGIX_names[] =
"iii\0" /* Parameter signature */
@@ -946,9 +955,10 @@ static const char VertexAttribs3fvNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char GenerateMipmapEXT_names[] =
"i\0" /* Parameter signature */
+ "glGenerateMipmap\0"
"glGenerateMipmapEXT\0"
"";
#endif
@@ -1077,13 +1087,6 @@ static const char AreTexturesResident_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
-static const char IsRenderbufferEXT_names[] =
- "i\0" /* Parameter signature */
- "glIsRenderbufferEXT\0"
- "";
-#endif
-
#if defined(need_GL_VERSION_2_0) || defined(need_GL_ATI_separate_stencil)
static const char StencilOpSeparate_names[] =
"iiii\0" /* Parameter signature */
@@ -1171,9 +1174,10 @@ static const char TexCoord2fNormal3fVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char RenderbufferStorageEXT_names[] =
"iiii\0" /* Parameter signature */
+ "glRenderbufferStorage\0"
"glRenderbufferStorageEXT\0"
"";
#endif
@@ -1364,9 +1368,10 @@ static const char SpriteParameterfvSGIX_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char CheckFramebufferStatusEXT_names[] =
"i\0" /* Parameter signature */
+ "glCheckFramebufferStatus\0"
"glCheckFramebufferStatusEXT\0"
"";
#endif
@@ -1554,13 +1559,6 @@ static const char FragmentLightivSGIX_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
-static const char DeleteRenderbuffersEXT_names[] =
- "ip\0" /* Parameter signature */
- "glDeleteRenderbuffersEXT\0"
- "";
-#endif
-
#if defined(need_GL_EXT_pixel_transform)
static const char PixelTransformParameterfvEXT_names[] =
"iip\0" /* Parameter signature */
@@ -1621,9 +1619,10 @@ static const char WindowPos2dMESA_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char FramebufferTexture3DEXT_names[] =
"iiiiii\0" /* Parameter signature */
+ "glFramebufferTexture3D\0"
"glFramebufferTexture3DEXT\0"
"";
#endif
@@ -1673,10 +1672,11 @@ static const char IndexFuncEXT_names[] =
"";
#endif
-#if defined(need_GL_SGIX_list_priority)
-static const char GetListParameterfvSGIX_names[] =
- "iip\0" /* Parameter signature */
- "glGetListParameterfvSGIX\0"
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
+static const char FramebufferTexture2DEXT_names[] =
+ "iiiii\0" /* Parameter signature */
+ "glFramebufferTexture2D\0"
+ "glFramebufferTexture2DEXT\0"
"";
#endif
@@ -1763,13 +1763,6 @@ static const char DeleteFencesNV_names[] =
"";
#endif
-#if defined(need_GL_SGIX_polynomial_ffd)
-static const char DeformationMap3dSGIX_names[] =
- "iddiiddiiddiip\0" /* Parameter signature */
- "glDeformationMap3dSGIX\0"
- "";
-#endif
-
#if defined(need_GL_VERSION_2_0)
static const char IsShader_names[] =
"i\0" /* Parameter signature */
@@ -1894,6 +1887,13 @@ static const char MatrixIndexuivARB_names[] =
"";
#endif
+#if defined(need_GL_ARB_framebuffer_object)
+static const char RenderbufferStorageMultisample_names[] =
+ "iiiii\0" /* Parameter signature */
+ "glRenderbufferStorageMultisample\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_coordinate_frame)
static const char Tangent3sEXT_names[] =
"iii\0" /* Parameter signature */
@@ -1944,9 +1944,10 @@ static const char VertexAttrib2dvNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char FramebufferRenderbufferEXT_names[] =
"iiii\0" /* Parameter signature */
+ "glFramebufferRenderbuffer\0"
"glFramebufferRenderbufferEXT\0"
"";
#endif
@@ -1973,9 +1974,10 @@ static const char SetFenceNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char FramebufferTexture1DEXT_names[] =
"iiiii\0" /* Parameter signature */
+ "glFramebufferTexture1D\0"
"glFramebufferTexture1DEXT\0"
"";
#endif
@@ -2105,9 +2107,10 @@ static const char Tangent3fvEXT_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char BindFramebufferEXT_names[] =
"ii\0" /* Parameter signature */
+ "glBindFramebuffer\0"
"glBindFramebufferEXT\0"
"";
#endif
@@ -2488,9 +2491,10 @@ static const char MapParameterivNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char GenRenderbuffersEXT_names[] =
"ip\0" /* Parameter signature */
+ "glGenRenderbuffers\0"
"glGenRenderbuffersEXT\0"
"";
#endif
@@ -2952,9 +2956,10 @@ static const char WindowPos2ivMESA_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char IsFramebufferEXT_names[] =
"i\0" /* Parameter signature */
+ "glIsFramebuffer\0"
"glIsFramebufferEXT\0"
"";
#endif
@@ -3125,13 +3130,6 @@ static const char ReplacementCodeuiSUN_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
-static const char FramebufferTexture2DEXT_names[] =
- "iiiii\0" /* Parameter signature */
- "glFramebufferTexture2DEXT\0"
- "";
-#endif
-
#if defined(need_GL_NV_vertex_program)
static const char VertexAttribPointerNV_names[] =
"iiiip\0" /* Parameter signature */
@@ -3139,13 +3137,21 @@ static const char VertexAttribPointerNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char GetFramebufferAttachmentParameterivEXT_names[] =
"iiip\0" /* Parameter signature */
+ "glGetFramebufferAttachmentParameteriv\0"
"glGetFramebufferAttachmentParameterivEXT\0"
"";
#endif
+#if defined(need_GL_EXT_pixel_transform)
+static const char PixelTransformParameterfEXT_names[] =
+ "iif\0" /* Parameter signature */
+ "glPixelTransformParameterfEXT\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_3)
static const char MultiTexCoord4dvARB_names[] =
"ip\0" /* Parameter signature */
@@ -3264,9 +3270,10 @@ static const char VertexAttrib3fvARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char DeleteFramebuffersEXT_names[] =
"ip\0" /* Parameter signature */
+ "glDeleteFramebuffers\0"
"glDeleteFramebuffersEXT\0"
"";
#endif
@@ -3360,9 +3367,10 @@ static const char GetPixelTexGenParameterfvSGIS_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char GenFramebuffersEXT_names[] =
"ip\0" /* Parameter signature */
+ "glGenFramebuffers\0"
"glGenFramebuffersEXT\0"
"";
#endif
@@ -3374,10 +3382,10 @@ static const char GetProgramParameterdvNV_names[] =
"";
#endif
-#if defined(need_GL_EXT_pixel_transform)
-static const char PixelTransformParameterfEXT_names[] =
- "iif\0" /* Parameter signature */
- "glPixelTransformParameterfEXT\0"
+#if defined(need_GL_SGIX_instruments)
+static const char PollInstrumentsSGIX_names[] =
+ "p\0" /* Parameter signature */
+ "glPollInstrumentsSGIX\0"
"";
#endif
@@ -3709,9 +3717,10 @@ static const char MultiDrawArraysEXT_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char BindRenderbufferEXT_names[] =
"ii\0" /* Parameter signature */
+ "glBindRenderbuffer\0"
"glBindRenderbufferEXT\0"
"";
#endif
@@ -4530,6 +4539,13 @@ static const char Minmax_names[] =
"";
#endif
+#if defined(need_GL_SGIX_polynomial_ffd)
+static const char DeformationMap3dSGIX_names[] =
+ "iddiiddiiddiip\0" /* Parameter signature */
+ "glDeformationMap3dSGIX\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord)
static const char FogCoorddvEXT_names[] =
"p\0" /* Parameter signature */
@@ -4605,10 +4621,11 @@ static const char WeightdvARB_names[] =
"";
#endif
-#if defined(need_GL_SGIX_instruments)
-static const char PollInstrumentsSGIX_names[] =
- "p\0" /* Parameter signature */
- "glPollInstrumentsSGIX\0"
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
+static const char DeleteRenderbuffersEXT_names[] =
+ "ip\0" /* Parameter signature */
+ "glDeleteRenderbuffers\0"
+ "glDeleteRenderbuffersEXT\0"
"";
#endif
@@ -4684,9 +4701,10 @@ static const char MultiTexCoord2fvARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_framebuffer_object)
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
static const char GetRenderbufferParameterivEXT_names[] =
"iip\0" /* Parameter signature */
+ "glGetRenderbufferParameteriv\0"
"glGetRenderbufferParameterivEXT\0"
"";
#endif
@@ -4742,6 +4760,13 @@ static const char Tangent3svEXT_names[] =
"";
#endif
+#if defined(need_GL_SGIX_list_priority)
+static const char GetListParameterivSGIX_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetListParameterivSGIX\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object)
static const char BindBufferARB_names[] =
"ii\0" /* Parameter signature */
@@ -4823,10 +4848,11 @@ static const char FragmentMaterialivSGIX_names[] =
"";
#endif
-#if defined(need_GL_NV_vertex_array_range)
-static const char VertexArrayRangeNV_names[] =
- "ip\0" /* Parameter signature */
- "glVertexArrayRangeNV\0"
+#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object)
+static const char IsRenderbufferEXT_names[] =
+ "i\0" /* Parameter signature */
+ "glIsRenderbuffer\0"
+ "glIsRenderbufferEXT\0"
"";
#endif
@@ -4892,6 +4918,32 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = {
};
#endif
+#if defined(need_GL_ARB_framebuffer_object)
+static const struct dri_extension_function GL_ARB_framebuffer_object_functions[] = {
+ { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 },
+ { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 },
+ { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 },
+ { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 },
+ { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 },
+ { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 },
+ { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 },
+ { RenderbufferStorageMultisample_names, RenderbufferStorageMultisample_remap_index, -1 },
+ { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 },
+ { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 },
+ { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 },
+ { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 },
+ { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 },
+ { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 },
+ { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 },
+ { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 },
+ { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 },
+ { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 },
+ { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 },
+ { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 },
+ { NULL, 0, 0 }
+};
+#endif
+
#if defined(need_GL_ARB_matrix_palette)
static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = {
{ MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 },
@@ -5319,22 +5371,22 @@ static const struct dri_extension_function GL_EXT_framebuffer_blit_functions[] =
#if defined(need_GL_EXT_framebuffer_object)
static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = {
{ GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 },
- { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 },
{ RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 },
{ CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 },
- { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 },
{ FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 },
+ { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 },
{ FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 },
{ FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 },
{ BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 },
{ GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 },
{ IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 },
- { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 },
{ GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 },
{ DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 },
{ GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 },
{ BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 },
+ { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 },
{ GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 },
+ { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5415,8 +5467,8 @@ static const struct dri_extension_function GL_EXT_paletted_texture_functions[] =
#if defined(need_GL_EXT_pixel_transform)
static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = {
{ PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 },
- { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 },
{ PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 },
+ { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 },
{ PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 },
{ NULL, 0, 0 }
};
@@ -5716,8 +5768,8 @@ static const struct dri_extension_function GL_NV_register_combiners2_functions[]
#if defined(need_GL_NV_vertex_array_range)
static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = {
- { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 },
{ VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, -1 },
+ { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5946,11 +5998,11 @@ static const struct dri_extension_function GL_SGIX_instruments_functions[] = {
#if defined(need_GL_SGIX_list_priority)
static const struct dri_extension_function GL_SGIX_list_priority_functions[] = {
{ ListParameterfSGIX_names, ListParameterfSGIX_remap_index, -1 },
- { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, -1 },
{ GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, -1 },
{ ListParameteriSGIX_names, ListParameteriSGIX_remap_index, -1 },
{ ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, -1 },
{ ListParameterivSGIX_names, ListParameterivSGIX_remap_index, -1 },
+ { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5965,9 +6017,9 @@ static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = {
#if defined(need_GL_SGIX_polynomial_ffd)
static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = {
{ LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 },
- { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 },
{ DeformSGIX_names, DeformSGIX_remap_index, -1 },
{ DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 },
+ { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 2a1ded3871..6b44ed9a67 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -179,13 +179,18 @@ driGetRendererString( char * buffer, const char * hardware_name,
+#define need_GL_ARB_draw_buffers
#define need_GL_ARB_multisample
+#define need_GL_ARB_texture_compression
#define need_GL_ARB_transpose_matrix
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_window_pos
#define need_GL_EXT_compiled_vertex_array
+#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_polygon_offset
#define need_GL_EXT_texture_object
#define need_GL_EXT_vertex_array
+#define need_GL_IBM_multimode_draw_arrays
#define need_GL_MESA_window_pos
/* These are needed in *all* drivers because Mesa internally implements
@@ -198,14 +203,19 @@ driGetRendererString( char * buffer, const char * hardware_name,
#include "extension_helper.h"
static const struct dri_extension all_mesa_extensions[] = {
+ { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions },
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
+ { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions },
+ { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions },
{ "GL_EXT_texture_object", GL_EXT_texture_object_functions },
{ "GL_EXT_vertex_array", GL_EXT_vertex_array_functions },
+ { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
{ "GL_MESA_window_pos", GL_MESA_window_pos_functions },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ NULL, NULL }
@@ -744,9 +754,10 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
return configs;
}
-const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b)
+__DRIconfig **driConcatConfigs(__DRIconfig **a,
+ __DRIconfig **b)
{
- const __DRIconfig **all;
+ __DRIconfig **all;
int i, j, index;
i = 0;
diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h
index 4e27bd21a1..9e9e5bc224 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -134,7 +134,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
const GLenum * db_modes, unsigned num_db_modes,
const uint8_t * msaa_samples, unsigned num_msaa_modes);
-const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b);
+__DRIconfig **driConcatConfigs(__DRIconfig **a,
+ __DRIconfig **b);
int
driGetConfigAttrib(const __DRIconfig *config,
diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
index 679f8561d2..00bdcec7a6 100644
--- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c
+++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
@@ -260,6 +260,8 @@ ffbCreateContext(const __GLcontextModes *mesaVis,
ctx->Const.MaxLineWidthAA = 1.0;
ctx->Const.LineWidthGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Instead of having GCC emit these constants a zillion times
* everywhere in the driver, put them here.
*/
@@ -626,6 +628,7 @@ ffbFillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[3];
uint8_t stencil_bits_array[3];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = 0;
depth_bits_array[1] = depth_bits;
@@ -639,6 +642,8 @@ ffbFillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[1] = 0;
stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
back_buffer_factor = (have_back_buffer) ? 3 : 1;
@@ -654,9 +659,10 @@ ffbFillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
+ back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
return NULL;
}
diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c
index c91bedce3a..b0ac299daa 100644
--- a/src/mesa/drivers/dri/gamma/gamma_context.c
+++ b/src/mesa/drivers/dri/gamma/gamma_context.c
@@ -133,6 +133,8 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
ctx->Const.MaxPointSizeAA = 16.0;
ctx->Const.PointSizeGranularity = 0.25;
+ ctx->Const.MaxDrawBuffers = 1;
+
gmesa->texHeap = mmInit( 0, gmesa->gammaScreen->textureSize );
make_empty_list(&gmesa->TexObjList);
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index c281a4990e..6785655686 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -63,11 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "drirenderbuffer.h"
#include "utils.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#include "extension_helper.h"
-
#ifndef I810_DEBUG
int I810_DEBUG = (0);
#endif
@@ -123,14 +118,11 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
*/
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index 48603f5d79..9a5a39c1db 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -77,6 +77,7 @@ i810FillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[2];
uint8_t stencil_bits_array[2];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
@@ -88,13 +89,16 @@ i810FillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[0] = 0;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
depth_bits_array, stencil_bits_array,
depth_buffer_factor,
- back_buffer_modes, back_buffer_factor);
+ back_buffer_modes, back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile
index 5858e0ee9f..954a7e2af1 100644
--- a/src/mesa/drivers/dri/i915/Makefile
+++ b/src/mesa/drivers/dri/i915/Makefile
@@ -18,8 +18,9 @@ DRIVER_SOURCES = \
intel_regions.c \
intel_buffer_objects.c \
intel_batchbuffer.c \
+ intel_clear.c \
+ intel_extensions.c \
intel_mipmap_tree.c \
- i915_tex_layout.c \
intel_tex_layout.c \
intel_tex_image.c \
intel_tex_subimage.c \
@@ -34,7 +35,9 @@ DRIVER_SOURCES = \
intel_pixel_read.c \
intel_buffers.c \
intel_blit.c \
+ intel_swapbuffers.c \
i915_tex.c \
+ i915_tex_layout.c \
i915_texstate.c \
i915_context.c \
i915_debug.c \
@@ -50,8 +53,7 @@ DRIVER_SOURCES = \
intel_span.c \
intel_state.c \
intel_tris.c \
- intel_fbo.c \
- intel_depthstencil.c
+ intel_fbo.c
C_SOURCES = \
$(COMMON_SOURCES) \
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c
index 09b1ec922f..fdce8af31f 100644
--- a/src/mesa/drivers/dri/i915/i830_context.c
+++ b/src/mesa/drivers/dri/i915/i830_context.c
@@ -97,6 +97,8 @@ i830CreateContext(const __GLcontextModes * mesaVis,
ctx->Const.MaxTextureRectSize = (1 << 11);
ctx->Const.MaxTextureUnits = I830_TEX_UNITS;
+ ctx->Const.MaxDrawBuffers = 1;
+
_tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12,
18 * sizeof(GLfloat));
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 3d6af38057..6e2d41e19a 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -50,16 +50,6 @@
* Mesa's Driver Functions
***************************************/
-static const struct dri_extension i915_extensions[] = {
- {"GL_ARB_depth_texture", NULL},
- {"GL_ARB_fragment_program", NULL},
- {"GL_ARB_shadow", NULL},
- {"GL_ARB_texture_non_power_of_two", NULL},
- {"GL_ATI_texture_env_combine3", NULL},
- {"GL_EXT_shadow_funcs", NULL},
- {NULL, NULL}
-};
-
/* Override intel default.
*/
static void
@@ -172,8 +162,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- driInitExtensions(ctx, i915_extensions, GL_FALSE);
-
+ ctx->Const.MaxDrawBuffers = 1;
_tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12,
36 * sizeof(GLfloat));
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index a53f120a81..814fb59fd3 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -41,6 +41,7 @@
#include "intel_fbo.h"
#include "intel_screen.h"
#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
#include "i915_context.h"
#include "i915_reg.h"
@@ -301,6 +302,65 @@ i915DepthMask(GLcontext * ctx, GLboolean flag)
i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_WRITE_ENABLE;
}
+
+
+/**
+ * Update the viewport transformation matrix. Depends on:
+ * - viewport pos/size
+ * - depthrange
+ * - window pos/size or FBO size
+ */
+void
+intelCalcViewport(GLcontext * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+ const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
+ GLfloat *m = intel->ViewportMatrix.m;
+ GLfloat yScale, yBias;
+
+ if (ctx->DrawBuffer->Name) {
+ /* User created FBO */
+ /* y=0=bottom */
+ yScale = 1.0;
+ yBias = 0.0;
+ }
+ else {
+ /* window buffer, y=0=top */
+ yScale = -1.0;
+ yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F;
+ }
+
+ m[MAT_SX] = v[MAT_SX];
+ m[MAT_TX] = v[MAT_TX];
+
+ m[MAT_SY] = v[MAT_SY] * yScale;
+ m[MAT_TY] = v[MAT_TY] * yScale + yBias;
+
+ m[MAT_SZ] = v[MAT_SZ] * depthScale;
+ m[MAT_TZ] = v[MAT_TZ] * depthScale;
+}
+
+
+/** Called from ctx->Driver.Viewport() */
+static void
+i915Viewport(GLcontext * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ intelCalcViewport(ctx);
+
+ intel_viewport(ctx, x, y, width, height);
+}
+
+
+/** Called from ctx->Driver.DepthRange() */
+static void
+i915DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval)
+{
+ intelCalcViewport(ctx);
+}
+
+
/* =============================================================
* Polygon stipple
*
@@ -964,6 +1024,8 @@ i915InitStateFunctions(struct dd_function_table *functions)
functions->StencilFuncSeparate = i915StencilFuncSeparate;
functions->StencilMaskSeparate = i915StencilMaskSeparate;
functions->StencilOpSeparate = i915StencilOpSeparate;
+ functions->DepthRange = i915DepthRange;
+ functions->Viewport = i915Viewport;
}
diff --git a/src/mesa/drivers/dri/i915/intel_clear.c b/src/mesa/drivers/dri/i915/intel_clear.c
new file mode 120000
index 0000000000..9a2a742a0d
--- /dev/null
+++ b/src/mesa/drivers/dri/i915/intel_clear.c
@@ -0,0 +1 @@
+../intel/intel_clear.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i915/intel_depthstencil.c b/src/mesa/drivers/dri/i915/intel_depthstencil.c
deleted file mode 120000
index 4ac4ae690a..0000000000
--- a/src/mesa/drivers/dri/i915/intel_depthstencil.c
+++ /dev/null
@@ -1 +0,0 @@
-../intel/intel_depthstencil.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c
new file mode 120000
index 0000000000..a2f3e8cd20
--- /dev/null
+++ b/src/mesa/drivers/dri/i915/intel_extensions.c
@@ -0,0 +1 @@
+../intel/intel_extensions.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c
index 4aa43e5f3a..519672fc35 100644..120000
--- a/src/mesa/drivers/dri/i915/intel_state.c
+++ b/src/mesa/drivers/dri/i915/intel_state.c
@@ -1,297 +1 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "main/enums.h"
-#include "main/colormac.h"
-#include "main/dd.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_fbo.h"
-#include "intel_regions.h"
-#include "swrast/swrast.h"
-
-int
-intel_translate_shadow_compare_func( GLenum func )
-{
- switch(func) {
- case GL_NEVER:
- return COMPAREFUNC_ALWAYS;
- case GL_LESS:
- return COMPAREFUNC_LEQUAL;
- case GL_LEQUAL:
- return COMPAREFUNC_LESS;
- case GL_GREATER:
- return COMPAREFUNC_GEQUAL;
- case GL_GEQUAL:
- return COMPAREFUNC_GREATER;
- case GL_NOTEQUAL:
- return COMPAREFUNC_EQUAL;
- case GL_EQUAL:
- return COMPAREFUNC_NOTEQUAL;
- case GL_ALWAYS:
- return COMPAREFUNC_NEVER;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
- return COMPAREFUNC_NEVER;
-}
-
-int
-intel_translate_compare_func(GLenum func)
-{
- switch (func) {
- case GL_NEVER:
- return COMPAREFUNC_NEVER;
- case GL_LESS:
- return COMPAREFUNC_LESS;
- case GL_LEQUAL:
- return COMPAREFUNC_LEQUAL;
- case GL_GREATER:
- return COMPAREFUNC_GREATER;
- case GL_GEQUAL:
- return COMPAREFUNC_GEQUAL;
- case GL_NOTEQUAL:
- return COMPAREFUNC_NOTEQUAL;
- case GL_EQUAL:
- return COMPAREFUNC_EQUAL;
- case GL_ALWAYS:
- return COMPAREFUNC_ALWAYS;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
- return COMPAREFUNC_ALWAYS;
-}
-
-int
-intel_translate_stencil_op(GLenum op)
-{
- switch (op) {
- case GL_KEEP:
- return STENCILOP_KEEP;
- case GL_ZERO:
- return STENCILOP_ZERO;
- case GL_REPLACE:
- return STENCILOP_REPLACE;
- case GL_INCR:
- return STENCILOP_INCRSAT;
- case GL_DECR:
- return STENCILOP_DECRSAT;
- case GL_INCR_WRAP:
- return STENCILOP_INCR;
- case GL_DECR_WRAP:
- return STENCILOP_DECR;
- case GL_INVERT:
- return STENCILOP_INVERT;
- default:
- return STENCILOP_ZERO;
- }
-}
-
-int
-intel_translate_blend_factor(GLenum factor)
-{
- switch (factor) {
- case GL_ZERO:
- return BLENDFACT_ZERO;
- case GL_SRC_ALPHA:
- return BLENDFACT_SRC_ALPHA;
- case GL_ONE:
- return BLENDFACT_ONE;
- case GL_SRC_COLOR:
- return BLENDFACT_SRC_COLR;
- case GL_ONE_MINUS_SRC_COLOR:
- return BLENDFACT_INV_SRC_COLR;
- case GL_DST_COLOR:
- return BLENDFACT_DST_COLR;
- case GL_ONE_MINUS_DST_COLOR:
- return BLENDFACT_INV_DST_COLR;
- case GL_ONE_MINUS_SRC_ALPHA:
- return BLENDFACT_INV_SRC_ALPHA;
- case GL_DST_ALPHA:
- return BLENDFACT_DST_ALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return BLENDFACT_INV_DST_ALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return BLENDFACT_SRC_ALPHA_SATURATE;
- case GL_CONSTANT_COLOR:
- return BLENDFACT_CONST_COLOR;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- return BLENDFACT_INV_CONST_COLOR;
- case GL_CONSTANT_ALPHA:
- return BLENDFACT_CONST_ALPHA;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- return BLENDFACT_INV_CONST_ALPHA;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
- return BLENDFACT_ZERO;
-}
-
-int
-intel_translate_logic_op(GLenum opcode)
-{
- switch (opcode) {
- case GL_CLEAR:
- return LOGICOP_CLEAR;
- case GL_AND:
- return LOGICOP_AND;
- case GL_AND_REVERSE:
- return LOGICOP_AND_RVRSE;
- case GL_COPY:
- return LOGICOP_COPY;
- case GL_COPY_INVERTED:
- return LOGICOP_COPY_INV;
- case GL_AND_INVERTED:
- return LOGICOP_AND_INV;
- case GL_NOOP:
- return LOGICOP_NOOP;
- case GL_XOR:
- return LOGICOP_XOR;
- case GL_OR:
- return LOGICOP_OR;
- case GL_OR_INVERTED:
- return LOGICOP_OR_INV;
- case GL_NOR:
- return LOGICOP_NOR;
- case GL_EQUIV:
- return LOGICOP_EQUIV;
- case GL_INVERT:
- return LOGICOP_INV;
- case GL_OR_REVERSE:
- return LOGICOP_OR_RVRSE;
- case GL_NAND:
- return LOGICOP_NAND;
- case GL_SET:
- return LOGICOP_SET;
- default:
- return LOGICOP_SET;
- }
-}
-
-
-static void
-intelClearColor(GLcontext * ctx, const GLfloat color[4])
-{
- struct intel_context *intel = intel_context(ctx);
- GLubyte clear[4];
-
- CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]);
- CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]);
-
- /* compute both 32 and 16-bit clear values */
- intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1],
- clear[2], clear[3]);
- intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]);
-}
-
-
-/**
- * Update the viewport transformation matrix. Depends on:
- * - viewport pos/size
- * - depthrange
- * - window pos/size or FBO size
- */
-static void
-intelCalcViewport(GLcontext * ctx)
-{
- struct intel_context *intel = intel_context(ctx);
- const GLfloat *v = ctx->Viewport._WindowMap.m;
- const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
- GLfloat *m = intel->ViewportMatrix.m;
- GLfloat yScale, yBias;
-
- if (ctx->DrawBuffer->Name) {
- /* User created FBO */
- struct intel_renderbuffer *irb
- = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
- if (irb && !irb->RenderToTexture) {
- /* y=0=top */
- yScale = -1.0;
- yBias = irb->Base.Height;
- }
- else {
- /* y=0=bottom */
- yScale = 1.0;
- yBias = 0.0;
- }
- }
- else {
- /* window buffer, y=0=top */
- yScale = -1.0;
- yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F;
- }
-
- m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX];
-
- m[MAT_SY] = v[MAT_SY] * yScale;
- m[MAT_TY] = v[MAT_TY] * yScale + yBias;
-
- m[MAT_SZ] = v[MAT_SZ] * depthScale;
- m[MAT_TZ] = v[MAT_TZ] * depthScale;
-}
-
-static void
-intelViewport(GLcontext * ctx,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- intelCalcViewport(ctx);
-
- intel_viewport(ctx, x, y, width, height);
-}
-
-static void
-intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval)
-{
- intelCalcViewport(ctx);
-}
-
-/* Fallback to swrast for select and feedback.
- */
-static void
-intelRenderMode(GLcontext * ctx, GLenum mode)
-{
- struct intel_context *intel = intel_context(ctx);
- FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER));
-}
-
-
-void
-intelInitStateFuncs(struct dd_function_table *functions)
-{
- functions->RenderMode = intelRenderMode;
- functions->Viewport = intelViewport;
- functions->DepthRange = intelDepthRange;
- functions->ClearColor = intelClearColor;
-}
+../intel/intel_state.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i915/intel_swapbuffers.c b/src/mesa/drivers/dri/i915/intel_swapbuffers.c
new file mode 120000
index 0000000000..148d5215aa
--- /dev/null
+++ b/src/mesa/drivers/dri/i915/intel_swapbuffers.c
@@ -0,0 +1 @@
+../intel/intel_swapbuffers.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile
index 37a470f2e2..2934414d99 100644
--- a/src/mesa/drivers/dri/i965/Makefile
+++ b/src/mesa/drivers/dri/i965/Makefile
@@ -9,9 +9,10 @@ DRIVER_SOURCES = \
intel_blit.c \
intel_buffer_objects.c \
intel_buffers.c \
+ intel_clear.c \
intel_context.c \
intel_decode.c \
- intel_depthstencil.c \
+ intel_extensions.c \
intel_fbo.c \
intel_mipmap_tree.c \
intel_regions.c \
@@ -22,6 +23,7 @@ DRIVER_SOURCES = \
intel_pixel_copy.c \
intel_pixel_draw.c \
intel_state.c \
+ intel_swapbuffers.c \
intel_tex.c \
intel_tex_copy.c \
intel_tex_format.c \
@@ -49,7 +51,6 @@ DRIVER_SOURCES = \
brw_gs.c \
brw_gs_emit.c \
brw_gs_state.c \
- brw_metaops.c \
brw_misc_state.c \
brw_program.c \
brw_queryobj.c \
diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c
index fa8121e02d..82370162f5 100644
--- a/src/mesa/drivers/dri/i965/brw_cc.c
+++ b/src/mesa/drivers/dri/i965/brw_cc.c
@@ -83,59 +83,60 @@ struct brw_cc_unit_key {
static void
cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key)
{
- struct gl_stencil_attrib *stencil = brw->attribs.Stencil;
+ GLcontext *ctx = &brw->intel.ctx;
+ const unsigned back = ctx->Stencil._BackFace;
memset(key, 0, sizeof(*key));
- key->stencil = stencil->Enabled;
- key->stencil_two_side = stencil->_TestTwoSide;
+ key->stencil = ctx->Stencil.Enabled;
+ key->stencil_two_side = ctx->Stencil._TestTwoSide;
if (key->stencil) {
- key->stencil_func[0] = stencil->Function[0];
- key->stencil_fail_op[0] = stencil->FailFunc[0];
- key->stencil_pass_depth_fail_op[0] = stencil->ZFailFunc[0];
- key->stencil_pass_depth_pass_op[0] = stencil->ZPassFunc[0];
- key->stencil_ref[0] = stencil->Ref[0];
- key->stencil_write_mask[0] = stencil->WriteMask[0];
- key->stencil_test_mask[0] = stencil->ValueMask[0];
+ key->stencil_func[0] = ctx->Stencil.Function[0];
+ key->stencil_fail_op[0] = ctx->Stencil.FailFunc[0];
+ key->stencil_pass_depth_fail_op[0] = ctx->Stencil.ZFailFunc[0];
+ key->stencil_pass_depth_pass_op[0] = ctx->Stencil.ZPassFunc[0];
+ key->stencil_ref[0] = ctx->Stencil.Ref[0];
+ key->stencil_write_mask[0] = ctx->Stencil.WriteMask[0];
+ key->stencil_test_mask[0] = ctx->Stencil.ValueMask[0];
}
if (key->stencil_two_side) {
- key->stencil_func[1] = stencil->Function[1];
- key->stencil_fail_op[1] = stencil->FailFunc[1];
- key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[1];
- key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[1];
- key->stencil_ref[1] = stencil->Ref[1];
- key->stencil_write_mask[1] = stencil->WriteMask[1];
- key->stencil_test_mask[1] = stencil->ValueMask[1];
+ key->stencil_func[1] = ctx->Stencil.Function[back];
+ key->stencil_fail_op[1] = ctx->Stencil.FailFunc[back];
+ key->stencil_pass_depth_fail_op[1] = ctx->Stencil.ZFailFunc[back];
+ key->stencil_pass_depth_pass_op[1] = ctx->Stencil.ZPassFunc[back];
+ key->stencil_ref[1] = ctx->Stencil.Ref[back];
+ key->stencil_write_mask[1] = ctx->Stencil.WriteMask[back];
+ key->stencil_test_mask[1] = ctx->Stencil.ValueMask[back];
}
- if (brw->attribs.Color->_LogicOpEnabled)
- key->logic_op = brw->attribs.Color->LogicOp;
+ if (ctx->Color._LogicOpEnabled)
+ key->logic_op = ctx->Color.LogicOp;
else
key->logic_op = GL_COPY;
- key->color_blend = brw->attribs.Color->BlendEnabled;
+ key->color_blend = ctx->Color.BlendEnabled;
if (key->color_blend) {
- key->blend_eq_rgb = brw->attribs.Color->BlendEquationRGB;
- key->blend_eq_a = brw->attribs.Color->BlendEquationA;
- key->blend_src_rgb = brw->attribs.Color->BlendSrcRGB;
- key->blend_dst_rgb = brw->attribs.Color->BlendDstRGB;
- key->blend_src_a = brw->attribs.Color->BlendSrcA;
- key->blend_dst_a = brw->attribs.Color->BlendDstA;
+ key->blend_eq_rgb = ctx->Color.BlendEquationRGB;
+ key->blend_eq_a = ctx->Color.BlendEquationA;
+ key->blend_src_rgb = ctx->Color.BlendSrcRGB;
+ key->blend_dst_rgb = ctx->Color.BlendDstRGB;
+ key->blend_src_a = ctx->Color.BlendSrcA;
+ key->blend_dst_a = ctx->Color.BlendDstA;
}
- key->alpha_enabled = brw->attribs.Color->AlphaEnabled;
+ key->alpha_enabled = ctx->Color.AlphaEnabled;
if (key->alpha_enabled) {
- key->alpha_func = brw->attribs.Color->AlphaFunc;
- key->alpha_ref = brw->attribs.Color->AlphaRef;
+ key->alpha_func = ctx->Color.AlphaFunc;
+ key->alpha_ref = ctx->Color.AlphaRef;
}
- key->dither = brw->attribs.Color->DitherFlag;
+ key->dither = ctx->Color.DitherFlag;
- key->depth_test = brw->attribs.Depth->Test;
+ key->depth_test = ctx->Depth.Test;
if (key->depth_test) {
- key->depth_func = brw->attribs.Depth->Func;
- key->depth_write = brw->attribs.Depth->Mask;
+ key->depth_func = ctx->Depth.Func;
+ key->depth_write = ctx->Depth.Mask;
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 38d8b704d7..5cffcebde4 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -145,14 +145,14 @@ static void upload_clip_prog(struct brw_context *brw)
/* CACHE_NEW_VS_PROG */
key.attrs = brw->vs.prog_data->outputs_written;
/* _NEW_LIGHT */
- key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT);
+ key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
/* _NEW_TRANSFORM */
- key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled);
+ key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled);
key.clip_mode = BRW_CLIPMODE_NORMAL;
/* _NEW_POLYGON */
if (key.primitive == GL_TRIANGLES) {
- if (brw->attribs.Polygon->CullFaceMode == GL_FRONT_AND_BACK)
+ if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
key.clip_mode = BRW_CLIPMODE_REJECT_ALL;
else {
GLuint fill_front = CLIP_CULL;
@@ -160,44 +160,44 @@ static void upload_clip_prog(struct brw_context *brw)
GLuint offset_front = 0;
GLuint offset_back = 0;
- if (!brw->attribs.Polygon->CullFlag ||
- brw->attribs.Polygon->CullFaceMode != GL_FRONT) {
- switch (brw->attribs.Polygon->FrontMode) {
+ if (!ctx->Polygon.CullFlag ||
+ ctx->Polygon.CullFaceMode != GL_FRONT) {
+ switch (ctx->Polygon.FrontMode) {
case GL_FILL:
fill_front = CLIP_FILL;
offset_front = 0;
break;
case GL_LINE:
fill_front = CLIP_LINE;
- offset_front = brw->attribs.Polygon->OffsetLine;
+ offset_front = ctx->Polygon.OffsetLine;
break;
case GL_POINT:
fill_front = CLIP_POINT;
- offset_front = brw->attribs.Polygon->OffsetPoint;
+ offset_front = ctx->Polygon.OffsetPoint;
break;
}
}
- if (!brw->attribs.Polygon->CullFlag ||
- brw->attribs.Polygon->CullFaceMode != GL_BACK) {
- switch (brw->attribs.Polygon->BackMode) {
+ if (!ctx->Polygon.CullFlag ||
+ ctx->Polygon.CullFaceMode != GL_BACK) {
+ switch (ctx->Polygon.BackMode) {
case GL_FILL:
fill_back = CLIP_FILL;
offset_back = 0;
break;
case GL_LINE:
fill_back = CLIP_LINE;
- offset_back = brw->attribs.Polygon->OffsetLine;
+ offset_back = ctx->Polygon.OffsetLine;
break;
case GL_POINT:
fill_back = CLIP_POINT;
- offset_back = brw->attribs.Polygon->OffsetPoint;
+ offset_back = ctx->Polygon.OffsetPoint;
break;
}
}
- if (brw->attribs.Polygon->BackMode != GL_FILL ||
- brw->attribs.Polygon->FrontMode != GL_FILL) {
+ if (ctx->Polygon.BackMode != GL_FILL ||
+ ctx->Polygon.FrontMode != GL_FILL) {
key.do_unfilled = 1;
/* Most cases the fixed function units will handle. Cases where
@@ -207,17 +207,17 @@ static void upload_clip_prog(struct brw_context *brw)
if (offset_back || offset_front) {
/* _NEW_POLYGON, _NEW_BUFFERS */
- key.offset_units = brw->attribs.Polygon->OffsetUnits * brw->intel.polygon_offset_scale;
- key.offset_factor = brw->attribs.Polygon->OffsetFactor * ctx->DrawBuffer->_MRD;
+ key.offset_units = ctx->Polygon.OffsetUnits * brw->intel.polygon_offset_scale;
+ key.offset_factor = ctx->Polygon.OffsetFactor * ctx->DrawBuffer->_MRD;
}
- switch (brw->attribs.Polygon->FrontFace) {
+ switch (ctx->Polygon.FrontFace) {
case GL_CCW:
key.fill_ccw = fill_front;
key.fill_cw = fill_back;
key.offset_ccw = offset_front;
key.offset_cw = offset_back;
- if (brw->attribs.Light->Model.TwoSide &&
+ if (ctx->Light.Model.TwoSide &&
key.fill_cw != CLIP_CULL)
key.copy_bfc_cw = 1;
break;
@@ -226,7 +226,7 @@ static void upload_clip_prog(struct brw_context *brw)
key.fill_ccw = fill_back;
key.offset_cw = offset_front;
key.offset_ccw = offset_back;
- if (brw->attribs.Light->Model.TwoSide &&
+ if (ctx->Light.Model.TwoSide &&
key.fill_ccw != CLIP_CULL)
key.copy_bfc_ccw = 1;
break;
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index d7a2bd95ee..d96ff29310 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -76,30 +76,6 @@ static void brwInitDriverFunctions( struct dd_function_table *functions )
functions->Viewport = intel_viewport;
}
-
-static void brw_init_attribs( struct brw_context *brw )
-{
- GLcontext *ctx = &brw->intel.ctx;
-
- brw->attribs.Color = &ctx->Color;
- brw->attribs.Depth = &ctx->Depth;
- brw->attribs.Fog = &ctx->Fog;
- brw->attribs.Hint = &ctx->Hint;
- brw->attribs.Light = &ctx->Light;
- brw->attribs.Line = &ctx->Line;
- brw->attribs.Point = &ctx->Point;
- brw->attribs.Polygon = &ctx->Polygon;
- brw->attribs.Scissor = &ctx->Scissor;
- brw->attribs.Stencil = &ctx->Stencil;
- brw->attribs.Texture = &ctx->Texture;
- brw->attribs.Transform = &ctx->Transform;
- brw->attribs.Viewport = &ctx->Viewport;
- brw->attribs.VertexProgram = &ctx->VertexProgram;
- brw->attribs.FragmentProgram = &ctx->FragmentProgram;
- brw->attribs.PolygonStipple = &ctx->PolygonStipple[0];
-}
-
-
GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate)
@@ -135,21 +111,21 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxTextureImageUnits);
ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */
- /* Advertise the full hardware capabilities. The new memory
- * manager should cope much better with overload situations:
+ /* Mesa limits textures to 4kx4k; it would be nice to fix that someday
*/
- ctx->Const.MaxTextureLevels = 12;
+ ctx->Const.MaxTextureLevels = 13;
ctx->Const.Max3DTextureLevels = 9;
ctx->Const.MaxCubeTextureLevels = 12;
- ctx->Const.MaxTextureRectSize = (1<<11);
+ ctx->Const.MaxTextureRectSize = (1<<12);
/* if conformance mode is set, swrast can handle any size AA point */
ctx->Const.MaxPointSizeAA = 255.0;
+ /* We want the GLSL compiler to emit code that uses condition codes */
+ ctx->Shader.EmitCondCodes = GL_TRUE;
+
/* ctx->Const.MaxNativeVertexProgramTemps = 32; */
- brw_init_attribs( brw );
- brw_init_metaops( brw );
brw_init_state( brw );
brw->state.dirty.mesa = ~0;
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5d3f99e025..df90c2027f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -131,7 +131,6 @@ struct brw_context;
#define BRW_NEW_WM_INPUT_DIMENSIONS 0x100
#define BRW_NEW_INPUT_VARYING 0x200
#define BRW_NEW_PSP 0x800
-#define BRW_NEW_METAOPS 0x1000
#define BRW_NEW_FENCE 0x2000
#define BRW_NEW_INDICES 0x4000
#define BRW_NEW_VERTICES 0x8000
@@ -303,26 +302,6 @@ struct brw_cache {
};
-
-struct brw_state_pointers {
- struct gl_colorbuffer_attrib *Color;
- struct gl_depthbuffer_attrib *Depth;
- struct gl_fog_attrib *Fog;
- struct gl_hint_attrib *Hint;
- struct gl_light_attrib *Light;
- struct gl_line_attrib *Line;
- struct gl_point_attrib *Point;
- struct gl_polygon_attrib *Polygon;
- GLuint *PolygonStipple;
- struct gl_scissor_attrib *Scissor;
- struct gl_stencil_attrib *Stencil;
- struct gl_texture_attrib *Texture;
- struct gl_transform_attrib *Transform;
- struct gl_viewport_attrib *Viewport;
- struct gl_vertex_program_state *VertexProgram;
- struct gl_fragment_program_state *FragmentProgram;
-};
-
/* Considered adding a member to this struct to document which flags
* an update might raise so that ordering of the state atoms can be
* checked or derived at runtime. Dropped the idea in favor of having
@@ -457,7 +436,6 @@ struct brw_context
int validated_bo_count;
} state;
- struct brw_state_pointers attribs;
struct brw_cache cache;
struct brw_cached_batch_item *cached_batch_items;
@@ -491,28 +469,6 @@ struct brw_context
unsigned int offset;
} ib;
- struct {
- /* Will be allocated on demand if needed.
- */
- struct brw_state_pointers attribs;
- struct gl_vertex_program *vp;
- struct gl_fragment_program *fp, *fp_tex;
-
- struct gl_buffer_object *vbo;
-
- struct intel_region *saved_draw_region;
- GLuint saved_nr_draw_regions;
- struct intel_region *saved_depth_region;
-
- GLuint restore_draw_buffers[MAX_DRAW_BUFFERS];
- GLuint restore_num_draw_buffers;
-
- struct gl_fragment_program *restore_fp;
-
- GLboolean active;
- } metaops;
-
-
/* Active vertex program:
*/
const struct gl_vertex_program *vertex_program;
@@ -703,13 +659,6 @@ void brw_FrameBufferTexInit( struct brw_context *brw,
void brw_FrameBufferTexDestroy( struct brw_context *brw );
void brw_validate_textures( struct brw_context *brw );
-/*======================================================================
- * brw_metaops.c
- */
-
-void brw_init_metaops( struct brw_context *brw );
-void brw_destroy_metaops( struct brw_context *brw );
-
/*======================================================================
* brw_program.c
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index fbf473abf6..4eaaa5f871 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -48,6 +48,7 @@
*/
static void calculate_curbe_offsets( struct brw_context *brw )
{
+ GLcontext *ctx = &brw->intel.ctx;
/* CACHE_NEW_WM_PROG */
GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16;
@@ -58,8 +59,8 @@ static void calculate_curbe_offsets( struct brw_context *brw )
GLuint total_regs;
/* _NEW_TRANSFORM */
- if (brw->attribs.Transform->ClipPlanesEnabled) {
- GLuint nr_planes = 6 + brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled);
+ if (ctx->Transform.ClipPlanesEnabled) {
+ GLuint nr_planes = 6 + brw_count_bits(ctx->Transform.ClipPlanesEnabled);
nr_clip_regs = (nr_planes * 4 + 15) / 16;
}
@@ -233,11 +234,11 @@ static void prepare_constant_buffer(struct brw_context *brw)
*/
assert(MAX_CLIP_PLANES == 6);
for (j = 0; j < MAX_CLIP_PLANES; j++) {
- if (brw->attribs.Transform->ClipPlanesEnabled & (1<<j)) {
- buf[offset + i * 4 + 0] = brw->attribs.Transform->_ClipUserPlane[j][0];
- buf[offset + i * 4 + 1] = brw->attribs.Transform->_ClipUserPlane[j][1];
- buf[offset + i * 4 + 2] = brw->attribs.Transform->_ClipUserPlane[j][2];
- buf[offset + i * 4 + 3] = brw->attribs.Transform->_ClipUserPlane[j][3];
+ if (ctx->Transform.ClipPlanesEnabled & (1<<j)) {
+ buf[offset + i * 4 + 0] = ctx->Transform._ClipUserPlane[j][0];
+ buf[offset + i * 4 + 1] = ctx->Transform._ClipUserPlane[j][1];
+ buf[offset + i * 4 + 2] = ctx->Transform._ClipUserPlane[j][2];
+ buf[offset + i * 4 + 3] = ctx->Transform._ClipUserPlane[j][3];
i++;
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 785fb784ca..99fd587e9f 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -84,15 +84,17 @@ static const GLenum reduced_prim[GL_POLYGON+1] = {
*/
static GLuint brw_set_prim(struct brw_context *brw, GLenum prim)
{
+ GLcontext *ctx = &brw->intel.ctx;
+
if (INTEL_DEBUG & DEBUG_PRIMS)
_mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim));
/* Slight optimization to avoid the GS program when not needed:
*/
if (prim == GL_QUAD_STRIP &&
- brw->attribs.Light->ShadeModel != GL_FLAT &&
- brw->attribs.Polygon->FrontMode == GL_FILL &&
- brw->attribs.Polygon->BackMode == GL_FILL)
+ ctx->Light.ShadeModel != GL_FLAT &&
+ ctx->Polygon.FrontMode == GL_FILL &&
+ ctx->Polygon.BackMode == GL_FILL)
prim = GL_TRIANGLE_STRIP;
if (prim != brw->primitive) {
@@ -166,14 +168,11 @@ static void brw_merge_inputs( struct brw_context *brw,
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
brw->vb.inputs[i].glarray = arrays[i];
- /* XXX: metaops passes null arrays */
- if (arrays[i]) {
- if (arrays[i]->StrideB != 0)
- brw->vb.info.varying |= 1 << i;
+ if (arrays[i]->StrideB != 0)
+ brw->vb.info.varying |= 1 << i;
brw->vb.info.sizes[i/16] |= (brw->vb.inputs[i].glarray->Size - 1) <<
((i%16) * 2);
- }
}
/* Raise statechanges if input sizes and varying have changed:
@@ -192,12 +191,13 @@ static GLboolean check_fallbacks( struct brw_context *brw,
const struct _mesa_prim *prim,
GLuint nr_prims )
{
+ GLcontext *ctx = &brw->intel.ctx;
GLuint i;
if (!brw->intel.strict_conformance)
return GL_FALSE;
- if (brw->attribs.Polygon->SmoothFlag) {
+ if (ctx->Polygon.SmoothFlag) {
for (i = 0; i < nr_prims; i++)
if (reduced_prim[prim[i].mode] == GL_TRIANGLES)
return GL_TRUE;
@@ -206,7 +206,7 @@ static GLboolean check_fallbacks( struct brw_context *brw,
/* BRW hardware will do AA lines, but they are non-conformant it
* seems. TBD whether we keep this fallback:
*/
- if (brw->attribs.Line->SmoothFlag) {
+ if (ctx->Line.SmoothFlag) {
for (i = 0; i < nr_prims; i++)
if (reduced_prim[prim[i].mode] == GL_LINES)
return GL_TRUE;
@@ -215,7 +215,7 @@ static GLboolean check_fallbacks( struct brw_context *brw,
/* Stipple -- these fallbacks could be resolved with a little
* bit of work?
*/
- if (brw->attribs.Line->StippleFlag) {
+ if (ctx->Line.StippleFlag) {
for (i = 0; i < nr_prims; i++) {
/* GS doesn't get enough information to know when to reset
* the stipple counter?!?
@@ -224,14 +224,14 @@ static GLboolean check_fallbacks( struct brw_context *brw,
return GL_TRUE;
if (prim[i].mode == GL_POLYGON &&
- (brw->attribs.Polygon->FrontMode == GL_LINE ||
- brw->attribs.Polygon->BackMode == GL_LINE))
+ (ctx->Polygon.FrontMode == GL_LINE ||
+ ctx->Polygon.BackMode == GL_LINE))
return GL_TRUE;
}
}
- if (brw->attribs.Point->SmoothFlag) {
+ if (ctx->Point.SmoothFlag) {
for (i = 0; i < nr_prims; i++)
if (prim[i].mode == GL_POINTS)
return GL_TRUE;
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 73d6dea01e..02998d5957 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -156,7 +156,13 @@ static GLuint byte_types_scale[5] = {
};
-static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized )
+/**
+ * Given vertex array type/size/format/normalized info, return
+ * the appopriate hardware surface type.
+ * Format will be GL_RGBA or possibly GL_BGRA for GLubyte[4] color arrays.
+ */
+static GLuint get_surface_type( GLenum type, GLuint size,
+ GLenum format, GLboolean normalized )
{
if (INTEL_DEBUG & DEBUG_VERTS)
_mesa_printf("type %s size %d normalized %d\n",
@@ -171,11 +177,20 @@ static GLuint get_surface_type( GLenum type, GLuint size, GLboolean normalized )
case GL_BYTE: return byte_types_norm[size];
case GL_UNSIGNED_INT: return uint_types_norm[size];
case GL_UNSIGNED_SHORT: return ushort_types_norm[size];
- case GL_UNSIGNED_BYTE: return ubyte_types_norm[size];
+ case GL_UNSIGNED_BYTE:
+ if (format == GL_BGRA) {
+ /* See GL_EXT_vertex_array_bgra */
+ assert(size == 4);
+ return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
+ }
+ else {
+ return ubyte_types_norm[size];
+ }
default: assert(0); return 0;
}
}
else {
+ assert(format == GL_RGBA); /* sanity check */
switch (type) {
case GL_DOUBLE: return double_types[size];
case GL_FLOAT: return float_types[size];
@@ -281,7 +296,7 @@ copy_array_to_vbo_array( struct brw_context *brw,
} else {
void *data;
char *dest;
- const char *src = element->glarray->Ptr;
+ const unsigned char *src = element->glarray->Ptr;
int i;
data = _mesa_malloc(dst_stride * element->count);
@@ -484,6 +499,7 @@ static void brw_emit_vertices(struct brw_context *brw)
struct brw_vertex_element *input = enabled[i];
uint32_t format = get_surface_type(input->glarray->Type,
input->glarray->Size,
+ input->glarray->Format,
input->glarray->Normalized);
uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC;
uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC;
@@ -549,7 +565,7 @@ static void brw_prepare_indices(struct brw_context *brw)
*/
dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr);
} else {
- offset = (GLuint)index_buffer->ptr;
+ offset = (GLuint) (unsigned long) index_buffer->ptr;
/* If the index buffer isn't aligned to its element size, we have to
* rebase it into a temporary.
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index b3ae4eef33..c53efba599 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -129,3 +129,126 @@ const GLuint *brw_get_program( struct brw_compile *p,
return (const GLuint *)p->store;
}
+
+
+/**
+ * Subroutine calls require special attention.
+ * Mesa instructions may be expanded into multiple hardware instructions
+ * so the prog_instruction::BranchTarget field can't be used as an index
+ * into the hardware instructions.
+ *
+ * The BranchTarget field isn't needed, however. Mesa's GLSL compiler
+ * emits CAL and BGNSUB instructions with labels that can be used to map
+ * subroutine calls to actual subroutine code blocks.
+ *
+ * The structures and function here implement patching of CAL instructions
+ * so they jump to the right subroutine code...
+ */
+
+
+/**
+ * For each OPCODE_BGNSUB we create one of these.
+ */
+struct brw_glsl_label
+{
+ const char *name; /**< the label string */
+ GLuint position; /**< the position of the brw instruction for this label */
+ struct brw_glsl_label *next; /**< next in linked list */
+};
+
+
+/**
+ * For each OPCODE_CAL we create one of these.
+ */
+struct brw_glsl_call
+{
+ GLuint call_inst_pos; /**< location of the CAL instruction */
+ const char *sub_name; /**< name of subroutine to call */
+ struct brw_glsl_call *next; /**< next in linked list */
+};
+
+
+/**
+ * Called for each OPCODE_BGNSUB.
+ */
+void
+brw_save_label(struct brw_compile *c, const char *name, GLuint position)
+{
+ struct brw_glsl_label *label = CALLOC_STRUCT(brw_glsl_label);
+ label->name = name;
+ label->position = position;
+ label->next = c->first_label;
+ c->first_label = label;
+}
+
+
+/**
+ * Called for each OPCODE_CAL.
+ */
+void
+brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos)
+{
+ struct brw_glsl_call *call = CALLOC_STRUCT(brw_glsl_call);
+ call->call_inst_pos = call_pos;
+ call->sub_name = name;
+ call->next = c->first_call;
+ c->first_call = call;
+}
+
+
+/**
+ * Lookup a label, return label's position/offset.
+ */
+static GLuint
+brw_lookup_label(struct brw_compile *c, const char *name)
+{
+ const struct brw_glsl_label *label;
+ for (label = c->first_label; label; label = label->next) {
+ if (strcmp(name, label->name) == 0) {
+ return label->position;
+ }
+ }
+ abort(); /* should never happen */
+ return ~0;
+}
+
+
+/**
+ * When we're done generating code, this function is called to resolve
+ * subroutine calls.
+ */
+void
+brw_resolve_cals(struct brw_compile *c)
+{
+ const struct brw_glsl_call *call;
+
+ for (call = c->first_call; call; call = call->next) {
+ const GLuint sub_loc = brw_lookup_label(c, call->sub_name);
+ struct brw_instruction *brw_call_inst = &c->store[call->call_inst_pos];
+ struct brw_instruction *brw_sub_inst = &c->store[sub_loc];
+ GLint offset = brw_sub_inst - brw_call_inst;
+
+ /* patch brw_inst1 to point to brw_inst2 */
+ brw_set_src1(brw_call_inst, brw_imm_d(offset * 16));
+ }
+
+ /* free linked list of calls */
+ {
+ struct brw_glsl_call *call, *next;
+ for (call = c->first_call; call; call = next) {
+ next = call->next;
+ _mesa_free(call);
+ }
+ c->first_call = NULL;
+ }
+
+ /* free linked list of labels */
+ {
+ struct brw_glsl_label *label, *next;
+ for (label = c->first_label; label; label = next) {
+ next = label->next;
+ _mesa_free(label);
+ }
+ c->first_label = NULL;
+ }
+}
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 9e2b39af9b..b36a1976ef 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -91,6 +91,11 @@ struct brw_indirect {
};
+struct brw_glsl_label;
+struct brw_glsl_call;
+
+
+
#define BRW_EU_MAX_INSN_STACK 5
#define BRW_EU_MAX_INSN 1200
@@ -106,9 +111,22 @@ struct brw_compile {
GLuint flag_value;
GLboolean single_program_flow;
struct brw_context *brw;
+
+ struct brw_glsl_label *first_label; /**< linked list of labels */
+ struct brw_glsl_call *first_call; /**< linked list of CALs */
};
+void
+brw_save_label(struct brw_compile *c, const char *name, GLuint position);
+
+void
+brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos);
+
+void
+brw_resolve_cals(struct brw_compile *c);
+
+
static INLINE int type_sz( GLuint type )
{
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 4e099b5945..bac7135bab 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -96,7 +96,7 @@ static void brw_set_dest( struct brw_instruction *insn,
}
static void brw_set_src0( struct brw_instruction *insn,
- struct brw_reg reg )
+ struct brw_reg reg )
{
assert(reg.file != BRW_MESSAGE_REGISTER_FILE);
@@ -169,7 +169,7 @@ static void brw_set_src0( struct brw_instruction *insn,
void brw_set_src1( struct brw_instruction *insn,
- struct brw_reg reg )
+ struct brw_reg reg )
{
assert(reg.file != BRW_MESSAGE_REGISTER_FILE);
@@ -323,13 +323,13 @@ static void brw_set_dp_read_message( struct brw_instruction *insn,
}
static void brw_set_sampler_message(struct brw_context *brw,
- struct brw_instruction *insn,
- GLuint binding_table_index,
- GLuint sampler,
- GLuint msg_type,
- GLuint response_length,
- GLuint msg_length,
- GLboolean eot)
+ struct brw_instruction *insn,
+ GLuint binding_table_index,
+ GLuint sampler,
+ GLuint msg_type,
+ GLuint response_length,
+ GLuint msg_length,
+ GLboolean eot)
{
brw_set_src1(insn, brw_imm_d(0));
@@ -407,7 +407,7 @@ static struct brw_instruction *brw_alu2(struct brw_compile *p,
* Convenience routines.
*/
#define ALU1(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+struct brw_instruction *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0) \
{ \
@@ -415,7 +415,7 @@ struct brw_instruction *brw_##OP(struct brw_compile *p, \
}
#define ALU2(OP) \
-struct brw_instruction *brw_##OP(struct brw_compile *p, \
+struct brw_instruction *brw_##OP(struct brw_compile *p, \
struct brw_reg dest, \
struct brw_reg src0, \
struct brw_reg src1) \
@@ -469,9 +469,9 @@ void brw_NOP(struct brw_compile *p)
*/
struct brw_instruction *brw_JMPI(struct brw_compile *p,
- struct brw_reg dest,
- struct brw_reg src0,
- struct brw_reg src1)
+ struct brw_reg dest,
+ struct brw_reg src0,
+ struct brw_reg src1)
{
struct brw_instruction *insn = brw_alu2(p, BRW_OPCODE_JMPI, dest, src0, src1);
@@ -674,7 +674,7 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size)
struct brw_instruction *brw_WHILE(struct brw_compile *p,
- struct brw_instruction *do_insn)
+ struct brw_instruction *do_insn)
{
struct brw_instruction *insn;
@@ -931,13 +931,13 @@ void brw_dp_READ_16( struct brw_compile *p,
void brw_fb_WRITE(struct brw_compile *p,
- struct brw_reg dest,
- GLuint msg_reg_nr,
- struct brw_reg src0,
- GLuint binding_table_index,
- GLuint msg_length,
- GLuint response_length,
- GLboolean eot)
+ struct brw_reg dest,
+ GLuint msg_reg_nr,
+ struct brw_reg src0,
+ GLuint binding_table_index,
+ GLuint msg_length,
+ GLuint response_length,
+ GLboolean eot)
{
struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND);
@@ -973,8 +973,8 @@ void brw_SAMPLE(struct brw_compile *p,
{
GLboolean need_stall = 0;
- if(writemask == 0) {
-/* _mesa_printf("%s: zero writemask??\n", __FUNCTION__); */
+ if (writemask == 0) {
+ /*_mesa_printf("%s: zero writemask??\n", __FUNCTION__); */
return;
}
@@ -1006,7 +1006,7 @@ void brw_SAMPLE(struct brw_compile *p,
if (newmask != writemask) {
need_stall = 1;
-/* _mesa_printf("need stall %x %x\n", newmask , writemask); */
+ /* _mesa_printf("need stall %x %x\n", newmask , writemask); */
}
else {
struct brw_reg m1 = brw_message_reg(msg_reg_nr);
@@ -1047,8 +1047,7 @@ void brw_SAMPLE(struct brw_compile *p,
eot);
}
- if (need_stall)
- {
+ if (need_stall) {
struct brw_reg reg = vec8(offset(dest, response_length-1));
/* mov (8) r9.0<1>:f r9.0<8;8,1>:f { Align1 }
diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c
index 4ea660a51a..e63098fdd4 100644
--- a/src/mesa/drivers/dri/i965/brw_fallback.c
+++ b/src/mesa/drivers/dri/i965/brw_fallback.c
@@ -47,20 +47,12 @@ static GLboolean do_check_fallback(struct brw_context *brw)
GLcontext *ctx = &brw->intel.ctx;
GLuint i;
- /* BRW_NEW_METAOPS
- */
- if (brw->metaops.active)
- return GL_FALSE;
-
if (brw->intel.no_rast) {
DBG("FALLBACK: rasterization disabled\n");
return GL_TRUE;
}
/* _NEW_RENDERMODE
- *
- * XXX: need to save/restore RenderMode in metaops state, or
- * somehow move to a new attribs pointer:
*/
if (ctx->RenderMode != GL_RENDER) {
DBG("FALLBACK: render mode\n");
@@ -70,7 +62,7 @@ static GLboolean do_check_fallback(struct brw_context *brw)
/* _NEW_TEXTURE:
*/
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i];
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
if (texUnit->_ReallyEnabled) {
struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current);
struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel];
@@ -83,7 +75,7 @@ static GLboolean do_check_fallback(struct brw_context *brw)
/* _NEW_STENCIL
*/
- if (brw->attribs.Stencil->Enabled &&
+ if (ctx->Stencil.Enabled &&
!brw->intel.hw_stencil) {
DBG("FALLBACK: stencil\n");
return GL_TRUE;
@@ -101,7 +93,7 @@ static void check_fallback(struct brw_context *brw)
const struct brw_tracked_state brw_check_fallback = {
.dirty = {
.mesa = _NEW_BUFFERS | _NEW_RENDERMODE | _NEW_TEXTURE | _NEW_STENCIL,
- .brw = BRW_NEW_METAOPS,
+ .brw = 0,
.cache = 0
},
.prepare = check_fallback
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
deleted file mode 100644
index 41bfa2e256..0000000000
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- Copyright (C) Intel Corp. 2006. All Rights Reserved.
- Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
- develop this 3D driver.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice (including the
- next paragraph) shall be included in all copies or substantial
- portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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>
- * frame buffer texture by Gary Wong <gtw@gnu.org>
- */
-
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/macros.h"
-
-#include "shader/arbprogparse.h"
-
-#include "intel_screen.h"
-#include "intel_batchbuffer.h"
-#include "intel_regions.h"
-#include "intel_buffers.h"
-
-#include "brw_context.h"
-#include "brw_defines.h"
-#include "brw_draw.h"
-#include "brw_fallback.h"
-
-#define INIT(brw, STRUCT, ATTRIB) \
-do { \
- brw->attribs.ATTRIB = &ctx->ATTRIB; \
-} while (0)
-
-#define DUP(brw, STRUCT, ATTRIB) \
-do { \
- brw->metaops.attribs.ATTRIB = MALLOC_STRUCT(STRUCT); \
- memcpy(brw->metaops.attribs.ATTRIB, \
- brw->attribs.ATTRIB, \
- sizeof(struct STRUCT)); \
-} while (0)
-
-
-#define INSTALL(brw, ATTRIB, STATE) \
-do { \
- brw->attribs.ATTRIB = brw->metaops.attribs.ATTRIB; \
- brw->state.dirty.mesa |= STATE; \
-} while (0)
-
-#define RESTORE(brw, ATTRIB, STATE) \
-do { \
- brw->attribs.ATTRIB = &brw->intel.ctx.ATTRIB; \
- brw->state.dirty.mesa |= STATE; \
-} while (0)
-
-static void init_attribs( struct brw_context *brw )
-{
- DUP(brw, gl_colorbuffer_attrib, Color);
- DUP(brw, gl_depthbuffer_attrib, Depth);
- DUP(brw, gl_fog_attrib, Fog);
- DUP(brw, gl_hint_attrib, Hint);
- DUP(brw, gl_light_attrib, Light);
- DUP(brw, gl_line_attrib, Line);
- DUP(brw, gl_point_attrib, Point);
- DUP(brw, gl_polygon_attrib, Polygon);
- DUP(brw, gl_scissor_attrib, Scissor);
- DUP(brw, gl_stencil_attrib, Stencil);
- DUP(brw, gl_texture_attrib, Texture);
- DUP(brw, gl_transform_attrib, Transform);
- DUP(brw, gl_viewport_attrib, Viewport);
- DUP(brw, gl_vertex_program_state, VertexProgram);
- DUP(brw, gl_fragment_program_state, FragmentProgram);
-}
-
-static void install_attribs( struct brw_context *brw )
-{
- INSTALL(brw, Color, _NEW_COLOR);
- INSTALL(brw, Depth, _NEW_DEPTH);
- INSTALL(brw, Fog, _NEW_FOG);
- INSTALL(brw, Hint, _NEW_HINT);
- INSTALL(brw, Light, _NEW_LIGHT);
- INSTALL(brw, Line, _NEW_LINE);
- INSTALL(brw, Point, _NEW_POINT);
- INSTALL(brw, Polygon, _NEW_POLYGON);
- INSTALL(brw, Scissor, _NEW_SCISSOR);
- INSTALL(brw, Stencil, _NEW_STENCIL);
- INSTALL(brw, Texture, _NEW_TEXTURE);
- INSTALL(brw, Transform, _NEW_TRANSFORM);
- INSTALL(brw, Viewport, _NEW_VIEWPORT);
- INSTALL(brw, VertexProgram, _NEW_PROGRAM);
- INSTALL(brw, FragmentProgram, _NEW_PROGRAM);
-}
-
-static void restore_attribs( struct brw_context *brw )
-{
- RESTORE(brw, Color, _NEW_COLOR);
- RESTORE(brw, Depth, _NEW_DEPTH);
- RESTORE(brw, Fog, _NEW_FOG);
- RESTORE(brw, Hint, _NEW_HINT);
- RESTORE(brw, Light, _NEW_LIGHT);
- RESTORE(brw, Line, _NEW_LINE);
- RESTORE(brw, Point, _NEW_POINT);
- RESTORE(brw, Polygon, _NEW_POLYGON);
- RESTORE(brw, Scissor, _NEW_SCISSOR);
- RESTORE(brw, Stencil, _NEW_STENCIL);
- RESTORE(brw, Texture, _NEW_TEXTURE);
- RESTORE(brw, Transform, _NEW_TRANSFORM);
- RESTORE(brw, Viewport, _NEW_VIEWPORT);
- RESTORE(brw, VertexProgram, _NEW_PROGRAM);
- RESTORE(brw, FragmentProgram, _NEW_PROGRAM);
-}
-
-
-static const char *vp_prog =
- "!!ARBvp1.0\n"
- "MOV result.color, vertex.color;\n"
- "MOV result.position, vertex.position;\n"
- "END\n";
-
-static const char *fp_prog =
- "!!ARBfp1.0\n"
- "MOV result.color, fragment.color;\n"
- "END\n";
-
-static const char *fp_tex_prog =
- "!!ARBfp1.0\n"
- "TEMP a;\n"
- "ADD a, fragment.position, program.local[0];\n"
- "MUL a, a, program.local[1];\n"
- "TEX result.color, a, texture[0], 2D;\n"
- "MOV result.depth.z, fragment.position;\n"
- "END\n";
-
-/* Derived values of importance:
- *
- * FragmentProgram->_Current
- * VertexProgram->_Enabled
- * brw->vertex_program
- * DrawBuffer->_ColorDrawBufferIndexes[0]
- *
- *
- * More if drawpixels-through-texture is added.
- */
-static void init_metaops_state( struct brw_context *brw )
-{
- GLcontext *ctx = &brw->intel.ctx;
-
- brw->metaops.vbo = ctx->Driver.NewBufferObject(ctx, 1, GL_ARRAY_BUFFER_ARB);
-
- ctx->Driver.BufferData(ctx,
- GL_ARRAY_BUFFER_ARB,
- 4096,
- NULL,
- GL_DYNAMIC_DRAW_ARB,
- brw->metaops.vbo);
-
- brw->metaops.fp = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
-
- brw->metaops.fp_tex = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
-
- brw->metaops.vp = (struct gl_vertex_program *)
- ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 );
-
- _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,
- fp_prog, strlen(fp_prog),
- brw->metaops.fp);
-
- _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,
- fp_tex_prog, strlen(fp_tex_prog),
- brw->metaops.fp_tex);
-
- _mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB,
- vp_prog, strlen(vp_prog),
- brw->metaops.vp);
-
- brw->metaops.attribs.VertexProgram->_Current = brw->metaops.vp;
- brw->metaops.attribs.VertexProgram->_Enabled = GL_TRUE;
-
- brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp;
-}
-
-static void meta_flat_shade( struct intel_context *intel )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.Light->ShadeModel = GL_FLAT;
- brw->state.dirty.mesa |= _NEW_LIGHT;
-}
-
-
-static void meta_no_stencil_write( struct intel_context *intel )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.Stencil->Enabled = GL_FALSE;
- brw->metaops.attribs.Stencil->WriteMask[0] = GL_FALSE;
- brw->state.dirty.mesa |= _NEW_STENCIL;
-}
-
-static void meta_no_depth_write( struct intel_context *intel )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.Depth->Test = GL_FALSE;
- brw->metaops.attribs.Depth->Mask = GL_FALSE;
- brw->state.dirty.mesa |= _NEW_DEPTH;
-}
-
-
-static void meta_depth_replace( struct intel_context *intel )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE )
- * ctx->Driver.DepthMask( ctx, GL_TRUE )
- */
- brw->metaops.attribs.Depth->Test = GL_TRUE;
- brw->metaops.attribs.Depth->Mask = GL_TRUE;
- brw->state.dirty.mesa |= _NEW_DEPTH;
-
- /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS )
- */
- brw->metaops.attribs.Depth->Func = GL_ALWAYS;
-
- brw->state.dirty.mesa |= _NEW_DEPTH;
-}
-
-
-static void meta_stencil_replace( struct intel_context *intel,
- GLuint s_mask,
- GLuint s_clear)
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.Stencil->Enabled = GL_TRUE;
- brw->metaops.attribs.Stencil->WriteMask[0] = s_mask;
- brw->metaops.attribs.Stencil->ValueMask[0] = 0xff;
- brw->metaops.attribs.Stencil->Ref[0] = s_clear;
- brw->metaops.attribs.Stencil->Function[0] = GL_ALWAYS;
- brw->metaops.attribs.Stencil->FailFunc[0] = GL_REPLACE;
- brw->metaops.attribs.Stencil->ZPassFunc[0] = GL_REPLACE;
- brw->metaops.attribs.Stencil->ZFailFunc[0] = GL_REPLACE;
- brw->state.dirty.mesa |= _NEW_STENCIL;
-}
-
-
-static void meta_color_mask( struct intel_context *intel, GLboolean state )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- if (state)
- COPY_4V(brw->metaops.attribs.Color->ColorMask,
- brw->intel.ctx.Color.ColorMask);
- else
- ASSIGN_4V(brw->metaops.attribs.Color->ColorMask, 0, 0, 0, 0);
-
- brw->state.dirty.mesa |= _NEW_COLOR;
-}
-
-static void meta_no_texture( struct intel_context *intel )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp;
-
- brw->metaops.attribs.Texture->CurrentUnit = 0;
- brw->metaops.attribs.Texture->_EnabledUnits = 0;
- brw->metaops.attribs.Texture->_EnabledCoordUnits = 0;
- brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0;
- brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0;
-
- brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
-}
-
-static void meta_texture_blend_replace(struct intel_context *intel)
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- brw->metaops.attribs.Texture->CurrentUnit = 0;
- brw->metaops.attribs.Texture->_EnabledUnits = 1;
- brw->metaops.attribs.Texture->_EnabledCoordUnits = 1;
- brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT;
- brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT;
- brw->metaops.attribs.Texture->Unit[ 0 ].Current2D =
- intel->frame_buffer_texobj;
- brw->metaops.attribs.Texture->Unit[ 0 ]._Current =
- intel->frame_buffer_texobj;
-
- brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
-}
-
-static void meta_import_pixel_state(struct intel_context *intel)
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- RESTORE(brw, Color, _NEW_COLOR);
- RESTORE(brw, Depth, _NEW_DEPTH);
- RESTORE(brw, Fog, _NEW_FOG);
- RESTORE(brw, Scissor, _NEW_SCISSOR);
- RESTORE(brw, Stencil, _NEW_STENCIL);
- RESTORE(brw, Texture, _NEW_TEXTURE);
- RESTORE(brw, FragmentProgram, _NEW_PROGRAM);
-}
-
-static void meta_frame_buffer_texture( struct intel_context *intel,
- GLint xoff, GLint yoff )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
- struct intel_region *region = intel_drawbuf_region( intel );
-
- INSTALL(brw, FragmentProgram, _NEW_PROGRAM);
-
- brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex;
- /* This is unfortunate, but seems to be necessary, since later on we
- will end up calling _mesa_load_state_parameters to lookup the
- local params (below), and that will want to look in ctx.FragmentProgram
- instead of brw->attribs.FragmentProgram. */
- intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex;
-
- brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff;
- brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff;
- brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0;
- brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0;
- brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] =
- 1.0 / region->pitch;
- brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] =
- -1.0 / region->height;
- brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0;
- brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0;
-
- brw->state.dirty.mesa |= _NEW_PROGRAM;
-}
-
-
-static void meta_draw_region( struct intel_context *intel,
- struct intel_region *draw_region,
- struct intel_region *depth_region )
-{
- struct brw_context *brw = brw_context(&intel->ctx);
-
- if (!brw->metaops.saved_draw_region) {
- brw->metaops.saved_draw_region = brw->state.draw_regions[0];
- brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions;
- brw->metaops.saved_depth_region = brw->state.depth_region;
- }
-
- brw->state.draw_regions[0] = draw_region;
- brw->state.nr_draw_regions = 1;
- brw->state.depth_region = depth_region;
-
- if (intel->frame_buffer_texobj != NULL)
- brw_FrameBufferTexDestroy(brw);
-
- if (draw_region)
- brw_FrameBufferTexInit(brw, draw_region);
-
- brw->state.dirty.mesa |= _NEW_BUFFERS;
-}
-
-
-static void meta_draw_quad(struct intel_context *intel,
- GLfloat x0, GLfloat x1,
- GLfloat y0, GLfloat y1,
- GLfloat z,
- GLuint color,
- GLfloat s0, GLfloat s1,
- GLfloat t0, GLfloat t1)
-{
- GLcontext *ctx = &intel->ctx;
- struct brw_context *brw = brw_context(&intel->ctx);
- struct gl_client_array pos_array;
- struct gl_client_array color_array;
- struct gl_client_array *attribs[VERT_ATTRIB_MAX];
- struct _mesa_prim prim[1];
- GLfloat pos[4][3];
-
- ctx->Driver.BufferData(ctx,
- GL_ARRAY_BUFFER_ARB,
- sizeof(pos) + sizeof(color),
- NULL,
- GL_DYNAMIC_DRAW_ARB,
- brw->metaops.vbo);
-
- pos[0][0] = x0;
- pos[0][1] = y0;
- pos[0][2] = z;
-
- pos[1][0] = x1;
- pos[1][1] = y0;
- pos[1][2] = z;
-
- pos[2][0] = x1;
- pos[2][1] = y1;
- pos[2][2] = z;
-
- pos[3][0] = x0;
- pos[3][1] = y1;
- pos[3][2] = z;
-
- ctx->Driver.BufferSubData(ctx,
- GL_ARRAY_BUFFER_ARB,
- 0,
- sizeof(pos),
- pos,
- brw->metaops.vbo);
-
- /* Convert incoming ARGB to required RGBA */
- /* Note this color is stored as GL_UNSIGNED_BYTE */
- color = (color & 0xff00ff00) | (((color >> 16) | (color << 16)) & 0xff00ff);
-
- ctx->Driver.BufferSubData(ctx,
- GL_ARRAY_BUFFER_ARB,
- sizeof(pos),
- sizeof(color),
- &color,
- brw->metaops.vbo);
-
- /* Ignoring texture coords.
- */
-
- memset(attribs, 0, VERT_ATTRIB_MAX * sizeof(*attribs));
-
- attribs[VERT_ATTRIB_POS] = &pos_array;
- attribs[VERT_ATTRIB_POS]->Ptr = 0;
- attribs[VERT_ATTRIB_POS]->Type = GL_FLOAT;
- attribs[VERT_ATTRIB_POS]->Enabled = 1;
- attribs[VERT_ATTRIB_POS]->Size = 3;
- attribs[VERT_ATTRIB_POS]->StrideB = 3 * sizeof(GLfloat);
- attribs[VERT_ATTRIB_POS]->Stride = 3 * sizeof(GLfloat);
- attribs[VERT_ATTRIB_POS]->_MaxElement = 4;
- attribs[VERT_ATTRIB_POS]->Normalized = 0;
- attribs[VERT_ATTRIB_POS]->BufferObj = brw->metaops.vbo;
-
- attribs[VERT_ATTRIB_COLOR0] = &color_array;
- attribs[VERT_ATTRIB_COLOR0]->Ptr = (const GLubyte *)sizeof(pos);
- attribs[VERT_ATTRIB_COLOR0]->Type = GL_UNSIGNED_BYTE;
- attribs[VERT_ATTRIB_COLOR0]->Enabled = 1;
- attribs[VERT_ATTRIB_COLOR0]->Size = 4;
- attribs[VERT_ATTRIB_COLOR0]->StrideB = 0;
- attribs[VERT_ATTRIB_COLOR0]->Stride = 0;
- attribs[VERT_ATTRIB_COLOR0]->_MaxElement = 1;
- attribs[VERT_ATTRIB_COLOR0]->Normalized = 1;
- attribs[VERT_ATTRIB_COLOR0]->BufferObj = brw->metaops.vbo;
-
- /* Just ignoring texture coordinates for now.
- */
-
- memset(prim, 0, sizeof(*prim));
-
- prim[0].mode = GL_TRIANGLE_FAN;
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].weak = 0;
- prim[0].pad = 0;
- prim[0].start = 0;
- prim[0].count = 4;
-
- brw_draw_prims(&brw->intel.ctx,
- (const struct gl_client_array **)attribs,
- prim, 1,
- NULL,
- 0,
- 3 );
-}
-
-
-static void install_meta_state( struct intel_context *intel )
-{
- GLcontext *ctx = &intel->ctx;
- struct brw_context *brw = brw_context(ctx);
- GLuint i;
-
- if (!brw->metaops.vbo) {
- init_metaops_state(brw);
- }
-
- install_attribs(brw);
-
- meta_no_texture(&brw->intel);
- meta_flat_shade(&brw->intel);
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- brw->metaops.restore_draw_buffers[i]
- = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
- }
- brw->metaops.restore_num_draw_buffers = ctx->DrawBuffer->_NumColorDrawBuffers;
-
- brw->metaops.restore_fp = ctx->FragmentProgram.Current;
-
- /* This works without adjusting refcounts. Fix later?
- */
- brw->metaops.saved_draw_region = brw->state.draw_regions[0];
- brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions;
- brw->metaops.saved_depth_region = brw->state.depth_region;
- brw->metaops.active = 1;
-
- brw->state.dirty.brw |= BRW_NEW_METAOPS;
-}
-
-static void leave_meta_state( struct intel_context *intel )
-{
- GLcontext *ctx = &intel->ctx;
- struct brw_context *brw = brw_context(ctx);
- GLuint i;
-
- restore_attribs(brw);
-
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- ctx->DrawBuffer->_ColorDrawBufferIndexes[i]
- = brw->metaops.restore_draw_buffers[i];
- }
- ctx->DrawBuffer->_NumColorDrawBuffers = brw->metaops.restore_num_draw_buffers;
-
- ctx->FragmentProgram.Current = brw->metaops.restore_fp;
-
- brw->state.draw_regions[0] = brw->metaops.saved_draw_region;
- brw->state.nr_draw_regions = brw->metaops.saved_nr_draw_regions;
- brw->state.depth_region = brw->metaops.saved_depth_region;
- brw->metaops.saved_draw_region = NULL;
- brw->metaops.saved_depth_region = NULL;
- brw->metaops.active = 0;
-
- brw->state.dirty.mesa |= _NEW_BUFFERS;
- brw->state.dirty.brw |= BRW_NEW_METAOPS;
-}
-
-
-
-void brw_init_metaops( struct brw_context *brw )
-{
- init_attribs(brw);
-
-
- brw->intel.vtbl.install_meta_state = install_meta_state;
- brw->intel.vtbl.leave_meta_state = leave_meta_state;
- brw->intel.vtbl.meta_no_depth_write = meta_no_depth_write;
- brw->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write;
- brw->intel.vtbl.meta_stencil_replace = meta_stencil_replace;
- brw->intel.vtbl.meta_depth_replace = meta_depth_replace;
- brw->intel.vtbl.meta_color_mask = meta_color_mask;
- brw->intel.vtbl.meta_no_texture = meta_no_texture;
- brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
- brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture;
- brw->intel.vtbl.meta_draw_region = meta_draw_region;
- brw->intel.vtbl.meta_draw_quad = meta_draw_quad;
- brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace;
-/* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */
-/* brw->intel.vtbl.meta_draw_format = set_draw_format; */
-}
-
-void brw_destroy_metaops( struct brw_context *brw )
-{
- GLcontext *ctx = &brw->intel.ctx;
-
- if (brw->metaops.vbo)
- ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo );
-
-/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */
-/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */
-/* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */
-}
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 627705fa9b..9dcdad7b4e 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -48,15 +48,16 @@
static void upload_blend_constant_color(struct brw_context *brw)
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_blend_constant_color bcc;
memset(&bcc, 0, sizeof(bcc));
bcc.header.opcode = CMD_BLEND_CONSTANT_COLOR;
bcc.header.length = sizeof(bcc)/4-2;
- bcc.blend_constant_color[0] = brw->attribs.Color->BlendColor[0];
- bcc.blend_constant_color[1] = brw->attribs.Color->BlendColor[1];
- bcc.blend_constant_color[2] = brw->attribs.Color->BlendColor[2];
- bcc.blend_constant_color[3] = brw->attribs.Color->BlendColor[3];
+ bcc.blend_constant_color[0] = ctx->Color.BlendColor[0];
+ bcc.blend_constant_color[1] = ctx->Color.BlendColor[1];
+ bcc.blend_constant_color[2] = ctx->Color.BlendColor[2];
+ bcc.blend_constant_color[3] = ctx->Color.BlendColor[3];
BRW_CACHED_BATCH_STRUCT(brw, &bcc);
}
@@ -154,10 +155,7 @@ static void upload_pipelined_state_pointers(struct brw_context *brw )
OUT_RELOC(brw->gs.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1);
else
OUT_BATCH(0);
- if (!brw->metaops.active)
- OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1);
- else
- OUT_BATCH(0);
+ OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1);
OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
OUT_RELOC(brw->wm.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
@@ -186,7 +184,7 @@ static void upload_psp_urb_cbs(struct brw_context *brw )
const struct brw_tracked_state brw_psp_urb_cbs = {
.dirty = {
.mesa = 0,
- .brw = BRW_NEW_URB_FENCE | BRW_NEW_METAOPS | BRW_NEW_BATCH,
+ .brw = BRW_NEW_URB_FENCE | BRW_NEW_BATCH,
.cache = (CACHE_NEW_VS_UNIT |
CACHE_NEW_GS_UNIT |
CACHE_NEW_GS_PROG |
@@ -284,6 +282,7 @@ const struct brw_tracked_state brw_depthbuffer = {
static void upload_polygon_stipple(struct brw_context *brw)
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_polygon_stipple bps;
GLuint i;
@@ -292,7 +291,7 @@ static void upload_polygon_stipple(struct brw_context *brw)
bps.header.length = sizeof(bps)/4-2;
for (i = 0; i < 32; i++)
- bps.stipple[i] = brw->attribs.PolygonStipple[31 - i]; /* invert */
+ bps.stipple[i] = ctx->PolygonStipple[31 - i]; /* invert */
BRW_CACHED_BATCH_STRUCT(brw, &bps);
}
@@ -370,6 +369,7 @@ const struct brw_tracked_state brw_aa_line_parameters = {
static void upload_line_stipple(struct brw_context *brw)
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_line_stipple bls;
GLfloat tmp;
GLint tmpi;
@@ -378,10 +378,10 @@ static void upload_line_stipple(struct brw_context *brw)
bls.header.opcode = CMD_LINE_STIPPLE_PATTERN;
bls.header.length = sizeof(bls)/4 - 2;
- bls.bits0.pattern = brw->attribs.Line->StipplePattern;
- bls.bits1.repeat_count = brw->attribs.Line->StippleFactor;
+ bls.bits0.pattern = ctx->Line.StipplePattern;
+ bls.bits1.repeat_count = ctx->Line.StippleFactor;
- tmp = 1.0 / (GLfloat) brw->attribs.Line->StippleFactor;
+ tmp = 1.0 / (GLfloat) ctx->Line.StippleFactor;
tmpi = tmp * (1<<13);
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index 1a11d54621..8c1711538a 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -46,6 +46,7 @@
static void compile_sf_prog( struct brw_context *brw,
struct brw_sf_prog_key *key )
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_sf_compile c;
const GLuint *program;
GLuint program_size;
@@ -74,7 +75,7 @@ static void compile_sf_prog( struct brw_context *brw,
c.idx_to_attr[idx] = i;
if (i >= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) {
c.point_attrs[i].CoordReplace =
- brw->attribs.Point->CoordReplace[i - VERT_RESULT_TEX0];
+ ctx->Point.CoordReplace[i - VERT_RESULT_TEX0];
}
else {
c.point_attrs[i].CoordReplace = GL_FALSE;
@@ -128,6 +129,7 @@ static void compile_sf_prog( struct brw_context *brw,
*/
static void upload_sf_prog(struct brw_context *brw)
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_sf_prog_key key;
memset(&key, 0, sizeof(key));
@@ -158,15 +160,15 @@ static void upload_sf_prog(struct brw_context *brw)
break;
}
- key.do_point_sprite = brw->attribs.Point->PointSprite;
- key.SpriteOrigin = brw->attribs.Point->SpriteOrigin;
+ key.do_point_sprite = ctx->Point.PointSprite;
+ key.SpriteOrigin = ctx->Point.SpriteOrigin;
/* _NEW_LIGHT */
- key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT);
- key.do_twoside_color = (brw->attribs.Light->Enabled && brw->attribs.Light->Model.TwoSide);
+ key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
+ key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
/* _NEW_POLYGON */
if (key.do_twoside_color)
- key.frontface_ccw = (brw->attribs.Polygon->FrontFace == GL_CCW);
+ key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW);
dri_bo_unreference(brw->sf.prog_bo);
brw->sf.prog_bo = brw_search_cache(&brw->cache, BRW_SF_PROG,
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c
index 242b7047a1..e96d5354b3 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_state.c
@@ -43,10 +43,11 @@ static void upload_sf_vp(struct brw_context *brw)
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
struct brw_sf_viewport sfv;
GLfloat y_scale, y_bias;
+ const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0);
memset(&sfv, 0, sizeof(sfv));
- if (intel_rendering_to_texture(ctx)) {
+ if (render_to_fbo) {
y_scale = 1.0;
y_bias = 0;
}
@@ -55,25 +56,16 @@ static void upload_sf_vp(struct brw_context *brw)
y_bias = ctx->DrawBuffer->Height;
}
- /* _NEW_VIEWPORT, BRW_NEW_METAOPS */
-
- if (!brw->metaops.active) {
- const GLfloat *v = ctx->Viewport._WindowMap.m;
-
- sfv.viewport.m00 = v[MAT_SX];
- sfv.viewport.m11 = v[MAT_SY] * y_scale;
- sfv.viewport.m22 = v[MAT_SZ] * depth_scale;
- sfv.viewport.m30 = v[MAT_TX];
- sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias;
- sfv.viewport.m32 = v[MAT_TZ] * depth_scale;
- } else {
- sfv.viewport.m00 = 1;
- sfv.viewport.m11 = - 1;
- sfv.viewport.m22 = 1;
- sfv.viewport.m30 = 0;
- sfv.viewport.m31 = ctx->DrawBuffer->Height;
- sfv.viewport.m32 = 0;
- }
+ /* _NEW_VIEWPORT */
+
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+
+ sfv.viewport.m00 = v[MAT_SX];
+ sfv.viewport.m11 = v[MAT_SY] * y_scale;
+ sfv.viewport.m22 = v[MAT_SZ] * depth_scale;
+ sfv.viewport.m30 = v[MAT_TX];
+ sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias;
+ sfv.viewport.m32 = v[MAT_TZ] * depth_scale;
/* _NEW_SCISSOR */
@@ -84,10 +76,20 @@ static void upload_sf_vp(struct brw_context *brw)
* Note that the hardware's coordinates are inclusive, while Mesa's min is
* inclusive but max is exclusive.
*/
- sfv.scissor.xmin = ctx->DrawBuffer->_Xmin;
- sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1;
- sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax;
- sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1;
+ if (render_to_fbo) {
+ /* texmemory: Y=0=bottom */
+ sfv.scissor.xmin = ctx->DrawBuffer->_Xmin;
+ sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1;
+ sfv.scissor.ymin = ctx->DrawBuffer->_Ymin;
+ sfv.scissor.ymax = ctx->DrawBuffer->_Ymax - 1;
+ }
+ else {
+ /* memory: Y=0=top */
+ sfv.scissor.xmin = ctx->DrawBuffer->_Xmin;
+ sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1;
+ sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax;
+ sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1;
+ }
dri_bo_unreference(brw->sf.vp_bo);
brw->sf.vp_bo = brw_cache_data( &brw->cache, BRW_SF_VP, &sfv, NULL, 0 );
@@ -97,7 +99,7 @@ const struct brw_tracked_state brw_sf_vp = {
.dirty = {
.mesa = (_NEW_VIEWPORT |
_NEW_SCISSOR),
- .brw = BRW_NEW_METAOPS,
+ .brw = 0,
.cache = 0
},
.prepare = upload_sf_vp
@@ -110,15 +112,19 @@ struct brw_sf_unit_key {
unsigned int nr_urb_entries, urb_size, sfsize;
GLenum front_face, cull_face;
- GLboolean scissor, line_smooth, point_sprite, point_attenuated;
+ unsigned scissor:1;
+ unsigned line_smooth:1;
+ unsigned point_sprite:1;
+ unsigned point_attenuated:1;
+ unsigned render_to_fbo:1;
float line_width;
float point_size;
- GLboolean render_to_texture;
};
static void
sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key)
{
+ GLcontext *ctx = &brw->intel.ctx;
memset(key, 0, sizeof(*key));
/* CACHE_NEW_SF_PROG */
@@ -130,22 +136,22 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key)
key->urb_size = brw->urb.vsize;
key->sfsize = brw->urb.sfsize;
- key->scissor = brw->attribs.Scissor->Enabled;
- key->front_face = brw->attribs.Polygon->FrontFace;
+ key->scissor = ctx->Scissor.Enabled;
+ key->front_face = ctx->Polygon.FrontFace;
- if (brw->attribs.Polygon->CullFlag)
- key->cull_face = brw->attribs.Polygon->CullFaceMode;
+ if (ctx->Polygon.CullFlag)
+ key->cull_face = ctx->Polygon.CullFaceMode;
else
key->cull_face = GL_NONE;
- key->line_width = brw->attribs.Line->Width;
- key->line_smooth = brw->attribs.Line->SmoothFlag;
+ key->line_width = ctx->Line.Width;
+ key->line_smooth = ctx->Line.SmoothFlag;
- key->point_sprite = brw->attribs.Point->PointSprite;
- key->point_size = brw->attribs.Point->Size;
- key->point_attenuated = brw->attribs.Point->_Attenuated;
+ key->point_sprite = ctx->Point.PointSprite;
+ key->point_size = ctx->Point.Size;
+ key->point_attenuated = ctx->Point._Attenuated;
- key->render_to_texture = intel_rendering_to_texture(&brw->intel.ctx);
+ key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
}
static dri_bo *
@@ -192,10 +198,10 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
else
sf.sf5.front_winding = BRW_FRONTWINDING_CW;
- /* The viewport is inverted for rendering to texture, and that inverts
+ /* The viewport is inverted for rendering to a FBO, and that inverts
* polygon front/back orientation.
*/
- sf.sf5.front_winding ^= key->render_to_texture;
+ sf.sf5.front_winding ^= key->render_to_fbo;
switch (key->cull_face) {
case GL_FRONT:
@@ -295,8 +301,7 @@ const struct brw_tracked_state brw_sf_unit = {
_NEW_LINE |
_NEW_POINT |
_NEW_SCISSOR),
- .brw = (BRW_NEW_URB_FENCE |
- BRW_NEW_METAOPS),
+ .brw = BRW_NEW_URB_FENCE,
.cache = (CACHE_NEW_SF_VP |
CACHE_NEW_SF_PROG)
},
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 4845859b3e..5de1450e61 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -233,7 +233,6 @@ static struct dirty_bit_map brw_bits[] = {
DEFINE_BIT(BRW_NEW_WM_INPUT_DIMENSIONS),
DEFINE_BIT(BRW_NEW_INPUT_VARYING),
DEFINE_BIT(BRW_NEW_PSP),
- DEFINE_BIT(BRW_NEW_METAOPS),
DEFINE_BIT(BRW_NEW_FENCE),
DEFINE_BIT(BRW_NEW_INDICES),
DEFINE_BIT(BRW_NEW_VERTICES),
@@ -298,6 +297,7 @@ brw_print_dirty_count(struct dirty_bit_map *bit_map, int32_t bits)
*/
void brw_validate_state( struct brw_context *brw )
{
+ GLcontext *ctx = &brw->intel.ctx;
struct intel_context *intel = &brw->intel;
struct brw_state_flags *state = &brw->state.dirty;
GLuint i;
@@ -314,13 +314,13 @@ void brw_validate_state( struct brw_context *brw )
state->brw |= ~0;
}
- if (brw->fragment_program != brw->attribs.FragmentProgram->_Current) {
- brw->fragment_program = brw->attribs.FragmentProgram->_Current;
+ if (brw->fragment_program != ctx->FragmentProgram._Current) {
+ brw->fragment_program = ctx->FragmentProgram._Current;
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
}
- if (brw->vertex_program != brw->attribs.VertexProgram->_Current) {
- brw->vertex_program = brw->attribs.VertexProgram->_Current;
+ if (brw->vertex_program != ctx->VertexProgram._Current) {
+ brw->vertex_program = ctx->VertexProgram._Current;
brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
}
diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h
index 4e577d0f6a..d97ff27f0a 100644
--- a/src/mesa/drivers/dri/i965/brw_structs.h
+++ b/src/mesa/drivers/dri/i965/brw_structs.h
@@ -1031,10 +1031,10 @@ struct brw_surface_state
GLuint writedisable_green:1;
GLuint writedisable_red:1;
GLuint writedisable_alpha:1;
- GLuint surface_format:9;
+ GLuint surface_format:9; /**< BRW_SURFACEFORMAT_x */
GLuint data_return_format:1;
GLuint pad0:1;
- GLuint surface_type:3;
+ GLuint surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */
} ss0;
struct {
diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c
index 0bb6f176a0..ef99e9c1ae 100644
--- a/src/mesa/drivers/dri/i965/brw_tex.c
+++ b/src/mesa/drivers/dri/i965/brw_tex.c
@@ -86,11 +86,12 @@ void brw_FrameBufferTexDestroy( struct brw_context *brw )
*/
void brw_validate_textures( struct brw_context *brw )
{
+ GLcontext *ctx = &brw->intel.ctx;
struct intel_context *intel = &brw->intel;
int i;
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i];
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
if (texUnit->_ReallyEnabled) {
intel_finalize_mipmap_tree(intel, i);
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 1db7ceebcf..e3111c6680 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -85,6 +85,7 @@ static void do_vs_prog( struct brw_context *brw,
static void brw_upload_vs_prog(struct brw_context *brw)
{
+ GLcontext *ctx = &brw->intel.ctx;
struct brw_vs_prog_key key;
struct brw_vertex_program *vp =
(struct brw_vertex_program *)brw->vertex_program;
@@ -97,14 +98,9 @@ static void brw_upload_vs_prog(struct brw_context *brw)
* the inputs it asks for, whether they are varying or not.
*/
key.program_string_id = vp->id;
- key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled);
- key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL ||
- brw->attribs.Polygon->BackMode != GL_FILL);
-
- /* BRW_NEW_METAOPS
- */
- if (brw->metaops.active)
- key.know_w_is_one = 1;
+ key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled);
+ key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL ||
+ ctx->Polygon.BackMode != GL_FILL);
/* Make an early check for the key.
*/
@@ -123,7 +119,7 @@ static void brw_upload_vs_prog(struct brw_context *brw)
const struct brw_tracked_state brw_vs_prog = {
.dirty = {
.mesa = _NEW_TRANSFORM | _NEW_POLYGON,
- .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_METAOPS,
+ .brw = BRW_NEW_VERTEX_PROGRAM,
.cache = 0
},
.prepare = brw_upload_vs_prog
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
index 22388ec99d..99d0e93722 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.h
+++ b/src/mesa/drivers/dri/i965/brw_vs.h
@@ -43,7 +43,6 @@ struct brw_vs_prog_key {
GLuint program_string_id;
GLuint nr_userclip:4;
GLuint copy_edgeflag:1;
- GLuint know_w_is_one:1;
GLuint pad:26;
};
diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c
index 6fbac02de6..9977677fd7 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_constval.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c
@@ -168,6 +168,7 @@ static GLuint get_input_size(struct brw_context *brw,
*/
static void calc_wm_input_sizes( struct brw_context *brw )
{
+ GLcontext *ctx = &brw->intel.ctx;
/* BRW_NEW_VERTEX_PROGRAM */
struct brw_vertex_program *vp =
(struct brw_vertex_program *)brw->vertex_program;
@@ -179,7 +180,7 @@ static void calc_wm_input_sizes( struct brw_context *brw )
memset(&t, 0, sizeof(t));
/* _NEW_LIGHT */
- if (brw->attribs.Light->Model.TwoSide)
+ if (ctx->Light.Model.TwoSide)
t.twoside = 1;
for (i = 0; i < VERT_ATTRIB_MAX; i++)
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 174331a765..235f826812 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -871,21 +871,15 @@ static void emit_vertex_write( struct brw_vs_compile *c)
}
/* Build ndc coords */
- if (!c->key.know_w_is_one) {
- ndc = get_tmp(c);
- emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL);
- brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc);
- }
- else {
- ndc = pos;
- }
+ ndc = get_tmp(c);
+ emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL);
+ brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc);
/* Update the header for point size, user clipping flags, and -ve rhw
* workaround.
*/
if ((c->prog_data.outputs_written & (1<<VERT_RESULT_PSIZ)) ||
- c->key.nr_userclip ||
- (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one))
+ c->key.nr_userclip || !BRW_IS_G4X(p->brw))
{
struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD);
GLuint i;
@@ -916,7 +910,7 @@ static void emit_vertex_write( struct brw_vs_compile *c)
* Later, clipping will detect ucp[6] and ensure the primitive is
* clipped against all fixed planes.
*/
- if (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one) {
+ if (!BRW_IS_G4X(p->brw)) {
brw_CMP(p,
vec8(brw_null_reg()),
BRW_CONDITIONAL_L,
@@ -960,36 +954,27 @@ static void emit_vertex_write( struct brw_vs_compile *c)
}
+/**
+ * Called after code generation to resolve subroutine calls and the
+ * END instruction.
+ * \param end_inst points to brw code for END instruction
+ * \param last_inst points to last instruction emitted before vertex write
+ */
static void
-post_vs_emit( struct brw_vs_compile *c, struct brw_instruction *end_inst )
+post_vs_emit( struct brw_vs_compile *c,
+ struct brw_instruction *end_inst,
+ struct brw_instruction *last_inst )
{
- GLuint nr_insns = c->vp->program.Base.NumInstructions;
- GLuint insn, target_insn;
- struct prog_instruction *inst1, *inst2;
- struct brw_instruction *brw_inst1, *brw_inst2;
- int offset;
- for (insn = 0; insn < nr_insns; insn++) {
- inst1 = &c->vp->program.Base.Instructions[insn];
- brw_inst1 = inst1->Data;
- switch (inst1->Opcode) {
- case OPCODE_CAL:
- case OPCODE_BRA:
- target_insn = inst1->BranchTarget;
- inst2 = &c->vp->program.Base.Instructions[target_insn];
- brw_inst2 = inst2->Data;
- offset = brw_inst2 - brw_inst1;
- brw_set_src1(brw_inst1, brw_imm_d(offset*16));
- break;
- case OPCODE_END:
- offset = end_inst - brw_inst1;
- brw_set_src1(brw_inst1, brw_imm_d(offset*16));
- break;
- default:
- break;
- }
- }
+ GLint offset;
+
+ brw_resolve_cals(&c->func);
+
+ /* patch up the END code to jump past subroutines, etc */
+ offset = last_inst - end_inst;
+ brw_set_src1(end_inst, brw_imm_d(offset * 16));
}
+
/* Emit the fragment program instructions here.
*/
void brw_vs_emit(struct brw_vs_compile *c )
@@ -998,7 +983,8 @@ void brw_vs_emit(struct brw_vs_compile *c )
struct brw_compile *p = &c->func;
GLuint nr_insns = c->vp->program.Base.NumInstructions;
GLuint insn, if_insn = 0;
- struct brw_instruction *end_inst;
+ GLuint end_offset = 0;
+ struct brw_instruction *end_inst, *last_inst;
struct brw_instruction *if_inst[MAX_IFSN];
struct brw_indirect stack_index = brw_indirect(0, 0);
@@ -1041,7 +1027,6 @@ void brw_vs_emit(struct brw_vs_compile *c )
/* Get argument regs. SWZ is special and does this itself.
*/
- inst->Data = &p->store[p->nr_insn];
if (inst->Opcode != OPCODE_SWZ)
for (i = 0; i < 3; i++) {
struct prog_src_register *src = &inst->SrcReg[i];
@@ -1209,7 +1194,7 @@ void brw_vs_emit(struct brw_vs_compile *c )
brw_set_access_mode(p, BRW_ALIGN_16);
brw_ADD(p, get_addr_reg(stack_index),
get_addr_reg(stack_index), brw_imm_d(4));
- inst->Data = &p->store[p->nr_insn];
+ brw_save_call(p, inst->Comment, p->nr_insn);
brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16));
break;
case OPCODE_RET:
@@ -1218,14 +1203,23 @@ void brw_vs_emit(struct brw_vs_compile *c )
brw_set_access_mode(p, BRW_ALIGN_1);
brw_MOV(p, brw_ip_reg(), deref_1d(stack_index, 0));
brw_set_access_mode(p, BRW_ALIGN_16);
+ break;
case OPCODE_END:
+ end_offset = p->nr_insn;
+ /* this instruction will get patched later to jump past subroutine
+ * code, etc.
+ */
brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16));
break;
case OPCODE_PRINT:
+ /* no-op */
+ break;
case OPCODE_BGNSUB:
+ brw_save_label(p, inst->Comment, p->nr_insn);
+ break;
case OPCODE_ENDSUB:
- /* no-op instructions */
- break;
+ /* no-op */
+ break;
default:
_mesa_problem(NULL, "Unsupported opcode %i (%s) in vertex shader",
inst->Opcode, inst->Opcode < MAX_OPCODE ?
@@ -1263,9 +1257,11 @@ void brw_vs_emit(struct brw_vs_compile *c )
release_tmps(c);
}
- end_inst = &p->store[p->nr_insn];
+ end_inst = &p->store[end_offset];
+ last_inst = &p->store[p->nr_insn];
+
+ /* The END instruction will be patched to jump to this code */
emit_vertex_write(c);
- post_vs_emit(c, end_inst);
- for (insn = 0; insn < nr_insns; insn++)
- c->vp->program.Base.Instructions[insn].Data = NULL;
+
+ post_vs_emit(c, end_inst, last_inst);
}
diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c
index 942581696d..1a63766ea1 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_state.c
@@ -49,6 +49,8 @@ struct brw_vs_unit_key {
static void
vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key)
{
+ GLcontext *ctx = &brw->intel.ctx;
+
memset(key, 0, sizeof(*key));
/* CACHE_NEW_VS_PROG */
@@ -61,7 +63,7 @@ vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key)
key->urb_size = brw->urb.vsize;
/* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM */
- if (brw->attribs.Transform->ClipPlanesEnabled) {
+ if (ctx->Transform.ClipPlanesEnabled) {
/* Note that we read in the userclip planes as well, hence
* clip_start:
*/
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index f7293ef423..b501a59ccd 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -23,14 +23,12 @@
OF 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>
- */
-
-
+**********************************************************************/
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
#include "main/glheader.h"
#include "main/mtypes.h"
@@ -44,12 +42,11 @@
#include "brw_context.h"
#include "brw_defines.h"
#include "brw_state.h"
-
#include "brw_draw.h"
#include "brw_state.h"
#include "brw_fallback.h"
#include "brw_vs.h"
-#include <stdarg.h>
+
static void
dri_bo_release(dri_bo **bo)
@@ -58,21 +55,22 @@ dri_bo_release(dri_bo **bo)
*bo = NULL;
}
-/* called from intelDestroyContext()
+
+/**
+ * called from intelDestroyContext()
*/
static void brw_destroy_context( struct intel_context *intel )
{
struct brw_context *brw = brw_context(&intel->ctx);
int i;
- brw_destroy_metaops(brw);
brw_destroy_state(brw);
brw_draw_destroy( brw );
brw_FrameBufferTexDestroy( brw );
for (i = 0; i < brw->state.nr_draw_regions; i++)
- intel_region_release(&brw->state.draw_regions[i]);
+ intel_region_release(&brw->state.draw_regions[i]);
brw->state.nr_draw_regions = 0;
intel_region_release(&brw->state.depth_region);
@@ -99,37 +97,46 @@ static void brw_destroy_context( struct intel_context *intel )
dri_bo_release(&brw->cc.vp_bo);
}
-/* called from intelDrawBuffer()
+
+/**
+ * called from intelDrawBuffer()
*/
static void brw_set_draw_region( struct intel_context *intel,
- struct intel_region *draw_regions[],
- struct intel_region *depth_region,
- GLuint num_regions)
+ struct intel_region *draw_regions[],
+ struct intel_region *depth_region,
+ GLuint num_regions)
{
struct brw_context *brw = brw_context(&intel->ctx);
int i;
+
+ /* release old color/depth regions */
if (brw->state.depth_region != depth_region)
brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
for (i = 0; i < brw->state.nr_draw_regions; i++)
intel_region_release(&brw->state.draw_regions[i]);
intel_region_release(&brw->state.depth_region);
+
+ /* reference new color/depth regions */
for (i = 0; i < num_regions; i++)
intel_region_reference(&brw->state.draw_regions[i], draw_regions[i]);
intel_region_reference(&brw->state.depth_region, depth_region);
brw->state.nr_draw_regions = num_regions;
}
-/* called from intel_batchbuffer_flush and children before sending a
+
+/**
+ * called from intel_batchbuffer_flush and children before sending a
* batchbuffer off.
*/
static void brw_finish_batch(struct intel_context *intel)
{
struct brw_context *brw = brw_context(&intel->ctx);
-
brw_emit_query_end(brw);
}
-/* called from intelFlushBatchLocked
+
+/**
+ * called from intelFlushBatchLocked
*/
static void brw_new_batch( struct intel_context *intel )
{
@@ -160,22 +167,21 @@ static void brw_new_batch( struct intel_context *intel )
}
}
-static void brw_note_fence( struct intel_context *intel,
- GLuint fence )
+
+static void brw_note_fence( struct intel_context *intel, GLuint fence )
{
brw_context(&intel->ctx)->state.dirty.brw |= BRW_NEW_FENCE;
}
-
+
+
static void brw_note_unlock( struct intel_context *intel )
{
struct brw_context *brw = brw_context(&intel->ctx);
-
brw_state_cache_check_size(brw);
}
-void brw_do_flush( struct brw_context *brw,
- GLuint flags )
+void brw_do_flush( struct brw_context *brw, GLuint flags )
{
struct brw_mi_flush flush;
memset(&flush, 0, sizeof(flush));
@@ -185,8 +191,7 @@ void brw_do_flush( struct brw_context *brw,
}
-static void brw_emit_flush( struct intel_context *intel,
- GLuint unused )
+static void brw_emit_flush( struct intel_context *intel, GLuint unused )
{
brw_do_flush(brw_context(&intel->ctx),
BRW_FLUSH_STATE_CACHE|BRW_FLUSH_READ_CACHE);
@@ -206,6 +211,7 @@ static GLuint brw_flush_cmd( void )
return *(GLuint *)&flush;
}
+
static void brw_invalidate_state( struct intel_context *intel, GLuint new_state )
{
/* nothing */
@@ -215,14 +221,14 @@ static void brw_invalidate_state( struct intel_context *intel, GLuint new_state
void brwInitVtbl( struct brw_context *brw )
{
brw->intel.vtbl.check_vertex_size = 0;
- brw->intel.vtbl.emit_state = 0;
- brw->intel.vtbl.reduced_primitive_state = 0;
+ brw->intel.vtbl.emit_state = 0;
+ brw->intel.vtbl.reduced_primitive_state = 0;
brw->intel.vtbl.render_start = 0;
- brw->intel.vtbl.update_texture_state = 0;
+ brw->intel.vtbl.update_texture_state = 0;
- brw->intel.vtbl.invalidate_state = brw_invalidate_state;
- brw->intel.vtbl.note_fence = brw_note_fence;
- brw->intel.vtbl.note_unlock = brw_note_unlock;
+ brw->intel.vtbl.invalidate_state = brw_invalidate_state;
+ brw->intel.vtbl.note_fence = brw_note_fence;
+ brw->intel.vtbl.note_unlock = brw_note_unlock;
brw->intel.vtbl.new_batch = brw_new_batch;
brw->intel.vtbl.finish_batch = brw_finish_batch;
brw->intel.vtbl.destroy = brw_destroy_context;
@@ -231,4 +237,3 @@ void brwInitVtbl( struct brw_context *brw )
brw->intel.vtbl.emit_flush = brw_emit_flush;
brw->intel.vtbl.debug_batch = brw_debug_batch;
}
-
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index c50b0d2dd9..4501e0472f 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -80,6 +80,53 @@ GLuint brw_wm_is_scalar_result( GLuint opcode )
}
+/**
+ * Do GPU code generation for non-GLSL shader. non-GLSL shaders have
+ * no flow control instructions so we can more readily do SSA-style
+ * optimizations.
+ */
+static void
+brw_wm_non_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c)
+{
+ /* Augment fragment program. Add instructions for pre- and
+ * post-fragment-program tasks such as interpolation and fogging.
+ */
+ brw_wm_pass_fp(c);
+
+ /* Translate to intermediate representation. Build register usage
+ * chains.
+ */
+ brw_wm_pass0(c);
+
+ /* Dead code removal.
+ */
+ brw_wm_pass1(c);
+
+ /* Register allocation.
+ */
+ c->grf_limit = BRW_WM_MAX_GRF / 2;
+
+ brw_wm_pass2(c);
+
+ c->prog_data.total_grf = c->max_wm_grf;
+ if (c->last_scratch) {
+ c->prog_data.total_scratch = c->last_scratch + 0x40;
+ }
+ else {
+ c->prog_data.total_scratch = 0;
+ }
+
+ /* Emit GEN4 code.
+ */
+ brw_wm_emit(c);
+}
+
+
+/**
+ * All Mesa program -> GPU code generation goes through this function.
+ * Depending on the instructions used (i.e. flow control instructions)
+ * we'll use one of two code generators.
+ */
static void do_wm_prog( struct brw_context *brw,
struct brw_fragment_program *fp,
struct brw_wm_prog_key *key)
@@ -90,52 +137,29 @@ static void do_wm_prog( struct brw_context *brw,
c = brw->wm.compile_data;
if (c == NULL) {
- brw->wm.compile_data = calloc(1, sizeof(*brw->wm.compile_data));
- c = brw->wm.compile_data;
+ brw->wm.compile_data = calloc(1, sizeof(*brw->wm.compile_data));
+ c = brw->wm.compile_data;
} else {
- memset(c, 0, sizeof(*brw->wm.compile_data));
+ memset(c, 0, sizeof(*brw->wm.compile_data));
}
memcpy(&c->key, key, sizeof(*key));
c->fp = fp;
c->env_param = brw->intel.ctx.FragmentProgram.Parameters;
- brw_init_compile(brw, &c->func);
+ brw_init_compile(brw, &c->func);
+
+ /*
+ * Shader which use GLSL features such as flow control are handled
+ * differently from "simple" shaders.
+ */
if (brw_wm_is_glsl(&c->fp->program)) {
- brw_wm_glsl_emit(brw, c);
- } else {
- /* Augment fragment program. Add instructions for pre- and
- * post-fragment-program tasks such as interpolation and fogging.
- */
- brw_wm_pass_fp(c);
-
- /* Translate to intermediate representation. Build register usage
- * chains.
- */
- brw_wm_pass0(c);
-
- /* Dead code removal.
- */
- brw_wm_pass1(c);
-
- /* Register allocation.
- */
- c->grf_limit = BRW_WM_MAX_GRF/2;
-
- brw_wm_pass2(c);
-
- c->prog_data.total_grf = c->max_wm_grf;
- if (c->last_scratch) {
- c->prog_data.total_scratch =
- c->last_scratch + 0x40;
- } else {
- c->prog_data.total_scratch = 0;
- }
-
- /* Emit GEN4 code.
- */
- brw_wm_emit(c);
+ brw_wm_glsl_emit(brw, c);
}
+ else {
+ brw_wm_non_glsl_emit(brw, c);
+ }
+
if (INTEL_DEBUG & DEBUG_WM)
fprintf(stderr, "\n");
@@ -157,6 +181,7 @@ static void do_wm_prog( struct brw_context *brw,
static void brw_wm_populate_key( struct brw_context *brw,
struct brw_wm_prog_key *key )
{
+ GLcontext *ctx = &brw->intel.ctx;
/* BRW_NEW_FRAGMENT_PROGRAM */
struct brw_fragment_program *fp =
(struct brw_fragment_program *)brw->fragment_program;
@@ -170,51 +195,50 @@ static void brw_wm_populate_key( struct brw_context *brw,
*/
/* _NEW_COLOR */
if (fp->program.UsesKill ||
- brw->attribs.Color->AlphaEnabled)
+ ctx->Color.AlphaEnabled)
lookup |= IZ_PS_KILL_ALPHATEST_BIT;
if (fp->program.Base.OutputsWritten & (1<<FRAG_RESULT_DEPR))
lookup |= IZ_PS_COMPUTES_DEPTH_BIT;
/* _NEW_DEPTH */
- if (brw->attribs.Depth->Test)
+ if (ctx->Depth.Test)
lookup |= IZ_DEPTH_TEST_ENABLE_BIT;
- if (brw->attribs.Depth->Test &&
- brw->attribs.Depth->Mask) /* ?? */
+ if (ctx->Depth.Test &&
+ ctx->Depth.Mask) /* ?? */
lookup |= IZ_DEPTH_WRITE_ENABLE_BIT;
/* _NEW_STENCIL */
- if (brw->attribs.Stencil->Enabled) {
+ if (ctx->Stencil.Enabled) {
lookup |= IZ_STENCIL_TEST_ENABLE_BIT;
- if (brw->attribs.Stencil->WriteMask[0] ||
- (brw->attribs.Stencil->_TestTwoSide &&
- brw->attribs.Stencil->WriteMask[1]))
+ if (ctx->Stencil.WriteMask[0] ||
+ ctx->Stencil.WriteMask[ctx->Stencil._BackFace])
lookup |= IZ_STENCIL_WRITE_ENABLE_BIT;
}
line_aa = AA_NEVER;
/* _NEW_LINE, _NEW_POLYGON, BRW_NEW_REDUCED_PRIMITIVE */
- if (brw->attribs.Line->SmoothFlag) {
+ if (ctx->Line.SmoothFlag) {
if (brw->intel.reduced_primitive == GL_LINES) {
line_aa = AA_ALWAYS;
}
else if (brw->intel.reduced_primitive == GL_TRIANGLES) {
- if (brw->attribs.Polygon->FrontMode == GL_LINE) {
+ if (ctx->Polygon.FrontMode == GL_LINE) {
line_aa = AA_SOMETIMES;
- if (brw->attribs.Polygon->BackMode == GL_LINE ||
- (brw->attribs.Polygon->CullFlag &&
- brw->attribs.Polygon->CullFaceMode == GL_BACK))
+ if (ctx->Polygon.BackMode == GL_LINE ||
+ (ctx->Polygon.CullFlag &&
+ ctx->Polygon.CullFaceMode == GL_BACK))
line_aa = AA_ALWAYS;
}
- else if (brw->attribs.Polygon->BackMode == GL_LINE) {
+ else if (ctx->Polygon.BackMode == GL_LINE) {
line_aa = AA_SOMETIMES;
- if ((brw->attribs.Polygon->CullFlag &&
- brw->attribs.Polygon->CullFaceMode == GL_FRONT))
+ if ((ctx->Polygon.CullFlag &&
+ ctx->Polygon.CullFaceMode == GL_FRONT))
line_aa = AA_ALWAYS;
}
}
@@ -229,20 +253,25 @@ static void brw_wm_populate_key( struct brw_context *brw,
key->projtex_mask = brw->wm.input_size_masks[4-1] >> (FRAG_ATTRIB_TEX0 - FRAG_ATTRIB_WPOS);
/* _NEW_LIGHT */
- key->flat_shade = (brw->attribs.Light->ShadeModel == GL_FLAT);
+ key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT);
/* _NEW_TEXTURE */
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- const struct gl_texture_unit *unit = &brw->attribs.Texture->Unit[i];
- const struct gl_texture_object *t = unit->_Current;
+ const struct gl_texture_unit *unit = &ctx->Texture.Unit[i];
if (unit->_ReallyEnabled) {
- if (t->Image[0][t->BaseLevel]->InternalFormat == GL_YCBCR_MESA) {
- key->yuvtex_mask |= 1<<i;
- if (t->Image[0][t->BaseLevel]->TexFormat->MesaFormat ==
- MESA_FORMAT_YCBCR)
- key->yuvtex_swap_mask |= 1<< i;
+ const struct gl_texture_object *t = unit->_Current;
+ const struct gl_texture_image *img = t->Image[0][t->BaseLevel];
+ if (img->InternalFormat == GL_YCBCR_MESA) {
+ key->yuvtex_mask |= 1 << i;
+ if (img->TexFormat->MesaFormat == MESA_FORMAT_YCBCR)
+ key->yuvtex_swap_mask |= 1 << i;
}
+
+ key->tex_swizzles[i] = t->_Swizzle;
+ }
+ else {
+ key->tex_swizzles[i] = SWIZZLE_NOOP;
}
}
@@ -300,8 +329,6 @@ static void brw_prepare_wm_prog(struct brw_context *brw)
}
-/* See brw_wm.c:
- */
const struct brw_tracked_state brw_wm_prog = {
.dirty = {
.mesa = (_NEW_COLOR |
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h
index f990bde839..582031f5f6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -69,7 +69,8 @@ struct brw_wm_prog_key {
GLuint shadowtex_mask:16;
GLuint yuvtex_mask:16;
GLuint yuvtex_swap_mask:16; /* UV swaped */
- // GLuint pad1:16;
+
+ GLuint tex_swizzles[BRW_MAX_TEX_UNIT];
GLuint program_string_id:32;
GLuint origin_x, origin_y;
@@ -280,4 +281,6 @@ void brw_wm_lookup_iz( GLuint line_aa,
GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp);
void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c);
+
+
#endif
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index 6df2c95d80..8b5ccdba93 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -111,6 +111,12 @@ static struct prog_src_register src_swizzle1( struct prog_src_register reg, int
return src_swizzle(reg, x, x, x, x);
}
+static struct prog_src_register src_swizzle4( struct prog_src_register reg, uint swizzle )
+{
+ reg.Swizzle = swizzle;
+ return reg;
+}
+
/***********************************************************************
* Dest regs
@@ -177,7 +183,6 @@ static struct prog_instruction *emit_insn(struct brw_wm_compile *c,
{
struct prog_instruction *inst = get_fp_inst(c);
*inst = *inst0;
- inst->Data = (void *)inst0;
return inst;
}
@@ -554,12 +559,19 @@ static void precalc_lit( struct brw_wm_compile *c,
}
}
+
+/**
+ * Some TEX instructions require extra code, cube map coordinate
+ * normalization, or coordinate scaling for RECT textures, etc.
+ * This function emits those extra instructions and the TEX
+ * instruction itself.
+ */
static void precalc_tex( struct brw_wm_compile *c,
const struct prog_instruction *inst )
{
struct prog_src_register coord;
struct prog_dst_register tmpcoord;
- GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
+ const GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) {
struct prog_instruction *out;
@@ -569,9 +581,11 @@ static void precalc_tex( struct brw_wm_compile *c,
struct prog_src_register tmp1src = src_reg_from_dst(tmp1);
struct prog_src_register src0 = inst->SrcReg[0];
+ /* find longest component of coord vector and normalize it */
tmpcoord = get_temp(c);
coord = src_reg_from_dst(tmpcoord);
+ /* tmpcoord = src0 (i.e.: coord = src0) */
out = emit_op(c, OPCODE_MOV,
tmpcoord,
0, 0, 0,
@@ -581,6 +595,7 @@ static void precalc_tex( struct brw_wm_compile *c,
out->SrcReg[0].NegateBase = 0;
out->SrcReg[0].Abs = 1;
+ /* tmp0 = MAX(coord.X, coord.Y) */
emit_op(c, OPCODE_MAX,
tmp0,
0, 0, 0,
@@ -588,6 +603,7 @@ static void precalc_tex( struct brw_wm_compile *c,
src_swizzle1(coord, Y),
src_undef());
+ /* tmp1 = MAX(tmp0, coord.Z) */
emit_op(c, OPCODE_MAX,
tmp1,
0, 0, 0,
@@ -595,6 +611,7 @@ static void precalc_tex( struct brw_wm_compile *c,
src_swizzle1(coord, Z),
src_undef());
+ /* tmp0 = 1 / tmp1 */
emit_op(c, OPCODE_RCP,
tmp0,
0, 0, 0,
@@ -602,6 +619,7 @@ static void precalc_tex( struct brw_wm_compile *c,
src_undef(),
src_undef());
+ /* tmpCoord = src0 * tmp0 */
emit_op(c, OPCODE_MUL,
tmpcoord,
0, 0, 0,
@@ -611,7 +629,8 @@ static void precalc_tex( struct brw_wm_compile *c,
release_temp(c, tmp0);
release_temp(c, tmp1);
- } else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
+ }
+ else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
struct prog_src_register scale =
search_or_add_param5( c,
STATE_INTERNAL,
@@ -642,19 +661,9 @@ static void precalc_tex( struct brw_wm_compile *c,
* conversion requires allocating a temporary variable which we
* don't have the facility to do that late in the compilation.
*/
- if (!(c->key.yuvtex_mask & (1<<unit))) {
- emit_op(c,
- OPCODE_TEX,
- inst->DstReg,
- inst->SaturateMode,
- unit,
- inst->TexSrcTarget,
- coord,
- src_undef(),
- src_undef());
- }
- else {
- GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit);
+ if (c->key.yuvtex_mask & (1 << unit)) {
+ /* convert ycbcr to RGBA */
+ GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit);
/*
CONST C0 = { -.5, -.0625, -.5, 1.164 }
@@ -734,6 +743,31 @@ static void precalc_tex( struct brw_wm_compile *c,
release_temp(c, tmp);
}
+ else {
+ /* ordinary RGBA tex instruction */
+ emit_op(c,
+ OPCODE_TEX,
+ inst->DstReg,
+ inst->SaturateMode,
+ unit,
+ inst->TexSrcTarget,
+ coord,
+ src_undef(),
+ src_undef());
+ }
+
+ /* For GL_EXT_texture_swizzle: */
+ if (c->key.tex_swizzles[unit] != SWIZZLE_NOOP) {
+ /* swizzle the result of the TEX instruction */
+ struct prog_src_register tmpsrc = src_reg_from_dst(inst->DstReg);
+ emit_op(c, OPCODE_SWZ,
+ inst->DstReg,
+ SATURATE_OFF, /* saturate already done above */
+ 0, 0, /* tex unit, target N/A */
+ src_swizzle4(tmpsrc, c->key.tex_swizzles[unit]),
+ src_undef(),
+ src_undef());
+ }
if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) ||
(inst->TexSrcTarget == TEXTURE_CUBE_INDEX))
@@ -907,6 +941,11 @@ static void print_insns( const struct prog_instruction *insn,
}
}
+
+/**
+ * Initial pass for fragment program code generation.
+ * This function is used by both the GLSL and non-GLSL paths.
+ */
void brw_wm_pass_fp( struct brw_wm_compile *c )
{
struct brw_fragment_program *fp = c->fp;
@@ -923,15 +962,19 @@ void brw_wm_pass_fp( struct brw_wm_compile *c )
c->pixel_w = src_undef();
c->nr_fp_insns = 0;
- /* Emit preamble instructions:
+ /* Emit preamble instructions. This is where special instructions such as
+ * WM_CINTERP, WM_LINTERP, WM_PINTERP and WM_WPOSXY are emitted to
+ * compute shader inputs from varying vars.
*/
-
-
for (insn = 0; insn < fp->program.Base.NumInstructions; insn++) {
const struct prog_instruction *inst = &fp->program.Base.Instructions[insn];
validate_src_regs(c, inst);
validate_dst_regs(c, inst);
}
+
+ /* Loop over all instructions doing assorted simplifications and
+ * transformations.
+ */
for (insn = 0; insn < fp->program.Base.NumInstructions; insn++) {
const struct prog_instruction *inst = &fp->program.Base.Instructions[insn];
struct prog_instruction *out;
@@ -940,7 +983,6 @@ void brw_wm_pass_fp( struct brw_wm_compile *c )
* necessary:
*/
-
switch (inst->Opcode) {
case OPCODE_SWZ:
out = emit_insn(c, inst);
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index 8fd776ac39..d99aa372a9 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -8,12 +8,17 @@ enum _subroutine {
SUB_NOISE1, SUB_NOISE2, SUB_NOISE3, SUB_NOISE4
};
-/* Only guess, need a flag in gl_fragment_program later */
+
+/**
+ * Determine if the given fragment program uses GLSL features such
+ * as flow conditionals, loops, subroutines.
+ * Some GLSL shaders may use these features, others might not.
+ */
GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp)
{
int i;
for (i = 0; i < fp->Base.NumInstructions; i++) {
- struct prog_instruction *inst = &fp->Base.Instructions[i];
+ const struct prog_instruction *inst = &fp->Base.Instructions[i];
switch (inst->Opcode) {
case OPCODE_IF:
case OPCODE_TRUNC:
@@ -176,13 +181,15 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c,
src->NegateBase, src->Abs);
}
-/* Subroutines are minimal support for resusable instruction sequences.
- They are implemented as simply as possible to minimise overhead: there
- is no explicit support for communication between the caller and callee
- other than saving the return address in a temporary register, nor is
- there any automatic local storage. This implies that great care is
- required before attempting reentrancy or any kind of nested
- subroutine invocations. */
+/**
+ * Subroutines are minimal support for resusable instruction sequences.
+ * They are implemented as simply as possible to minimise overhead: there
+ * is no explicit support for communication between the caller and callee
+ * other than saving the return address in a temporary register, nor is
+ * there any automatic local storage. This implies that great care is
+ * required before attempting reentrancy or any kind of nested
+ * subroutine invocations.
+ */
static void invoke_subroutine( struct brw_wm_compile *c,
enum _subroutine subroutine,
void (*emit)( struct brw_wm_compile * ) )
@@ -319,11 +326,10 @@ static void emit_pixel_xy(struct brw_wm_compile *c,
stride(suboffset(r1_uw, 5), 2, 4, 0),
brw_imm_v(0x11001100));
}
-
}
static void emit_delta_xy(struct brw_wm_compile *c,
- struct prog_instruction *inst)
+ struct prog_instruction *inst)
{
struct brw_reg r1 = brw_vec1_grf(1, 0);
struct brw_reg dst0, dst1, src0, src1;
@@ -351,10 +357,8 @@ static void emit_delta_xy(struct brw_wm_compile *c,
negate(suboffset(r1,1)));
}
-
}
-
static void fire_fb_write( struct brw_wm_compile *c,
GLuint base_reg,
GLuint nr,
@@ -397,31 +401,31 @@ static void emit_fb_write(struct brw_wm_compile *c,
*/
if (c->key.aa_dest_stencil_reg)
nr += 1;
- {
- brw_push_insn_state(p);
- for (channel = 0; channel < 4; channel++) {
- src0 = get_src_reg(c, &inst->SrcReg[0], channel, 1);
- /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */
- /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */
- brw_MOV(p, brw_message_reg(nr + channel), src0);
- }
- /* skip over the regs populated above: */
- nr += 8;
- brw_pop_insn_state(p);
+
+ brw_push_insn_state(p);
+ for (channel = 0; channel < 4; channel++) {
+ src0 = get_src_reg(c, &inst->SrcReg[0], channel, 1);
+ /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */
+ /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */
+ brw_MOV(p, brw_message_reg(nr + channel), src0);
+ }
+ /* skip over the regs populated above: */
+ nr += 8;
+ brw_pop_insn_state(p);
+
+ if (c->key.source_depth_to_render_target) {
+ if (c->key.computes_depth) {
+ src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1);
+ brw_MOV(p, brw_message_reg(nr), src0);
+ }
+ else {
+ src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1);
+ brw_MOV(p, brw_message_reg(nr), src0);
+ }
+
+ nr += 2;
}
- if (c->key.source_depth_to_render_target)
- {
- if (c->key.computes_depth) {
- src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1);
- brw_MOV(p, brw_message_reg(nr), src0);
- } else {
- src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1);
- brw_MOV(p, brw_message_reg(nr), src0);
- }
-
- nr += 2;
- }
target = inst->Sampler >> 1;
eot = inst->Sampler & 1;
fire_fb_write(c, 0, nr, target, eot);
@@ -1045,23 +1049,23 @@ static void emit_ddy(struct brw_wm_compile *c,
brw_set_saturate(p, 0);
}
-static __inline struct brw_reg high_words( struct brw_reg reg )
+static INLINE struct brw_reg high_words( struct brw_reg reg )
{
return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ),
0, 8, 2 );
}
-static __inline struct brw_reg low_words( struct brw_reg reg )
+static INLINE struct brw_reg low_words( struct brw_reg reg )
{
return stride( retype( reg, BRW_REGISTER_TYPE_W ), 0, 8, 2 );
}
-static __inline struct brw_reg even_bytes( struct brw_reg reg )
+static INLINE struct brw_reg even_bytes( struct brw_reg reg )
{
return stride( retype( reg, BRW_REGISTER_TYPE_B ), 0, 16, 2 );
}
-static __inline struct brw_reg odd_bytes( struct brw_reg reg )
+static INLINE struct brw_reg odd_bytes( struct brw_reg reg )
{
return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_B ), 1 ),
0, 16, 2 );
@@ -1366,9 +1370,11 @@ static void emit_noise2( struct brw_wm_compile *c,
release_tmps( c, mark );
}
-/* The three-dimensional case is much like the one- and two- versions above,
- but since the number of corners is rapidly growing we now pack 16 16-bit
- hashes into each register to extract more parallelism from the EUs. */
+/**
+ * The three-dimensional case is much like the one- and two- versions above,
+ * but since the number of corners is rapidly growing we now pack 16 16-bit
+ * hashes into each register to extract more parallelism from the EUs.
+ */
static void noise3_sub( struct brw_wm_compile *c ) {
struct brw_compile *p = &c->func;
@@ -1670,13 +1676,15 @@ static void emit_noise3( struct brw_wm_compile *c,
release_tmps( c, mark );
}
-/* For the four-dimensional case, the little micro-optimisation benefits
- we obtain by unrolling all the loops aren't worth the massive bloat it
- now causes. Instead, we loop twice around performing a similar operation
- to noise3, once for the w=0 cube and once for the w=1, with a bit more
- code to glue it all together. */
-static void noise4_sub( struct brw_wm_compile *c ) {
-
+/**
+ * For the four-dimensional case, the little micro-optimisation benefits
+ * we obtain by unrolling all the loops aren't worth the massive bloat it
+ * now causes. Instead, we loop twice around performing a similar operation
+ * to noise3, once for the w=0 cube and once for the w=1, with a bit more
+ * code to glue it all together.
+ */
+static void noise4_sub( struct brw_wm_compile *c )
+{
struct brw_compile *p = &c->func;
struct brw_reg param[ 4 ],
x0y0, x0y1, x1y0, x1y1, /* gradients at four of the corners */
@@ -2244,28 +2252,12 @@ static void emit_tex(struct brw_wm_compile *c,
brw_MOV(p, dst[3], brw_imm_f(1.0));
}
+/**
+ * Resolve subroutine calls after code emit is done.
+ */
static void post_wm_emit( struct brw_wm_compile *c )
{
- GLuint nr_insns = c->fp->program.Base.NumInstructions;
- GLuint insn, target_insn;
- struct prog_instruction *inst1, *inst2;
- struct brw_instruction *brw_inst1, *brw_inst2;
- int offset;
- for (insn = 0; insn < nr_insns; insn++) {
- inst1 = &c->fp->program.Base.Instructions[insn];
- brw_inst1 = inst1->Data;
- switch (inst1->Opcode) {
- case OPCODE_CAL:
- target_insn = inst1->BranchTarget;
- inst2 = &c->fp->program.Base.Instructions[target_insn];
- brw_inst2 = inst2->Data;
- offset = brw_inst2 - brw_inst1;
- brw_set_src1(brw_inst1, brw_imm_d(offset*16));
- break;
- default:
- break;
- }
- }
+ brw_resolve_cals(&c->func);
}
static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
@@ -2285,10 +2277,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
for (i = 0; i < c->nr_fp_insns; i++) {
struct prog_instruction *inst = &c->prog_instructions[i];
- struct prog_instruction *orig_inst;
-
- if ((orig_inst = inst->Data) != 0)
- orig_inst->Data = current_insn(p);
if (inst->CondUpdate)
brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ);
@@ -2446,7 +2434,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
brw_ENDIF(p, if_inst[--if_insn]);
break;
case OPCODE_BGNSUB:
+ brw_save_label(p, inst->Comment, p->nr_insn);
+ break;
case OPCODE_ENDSUB:
+ /* no-op */
break;
case OPCODE_CAL:
brw_push_insn_state(p);
@@ -2456,8 +2447,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
brw_set_access_mode(p, BRW_ALIGN_16);
brw_ADD(p, get_addr_reg(stack_index),
get_addr_reg(stack_index), brw_imm_d(4));
- orig_inst = inst->Data;
- orig_inst->Data = &p->store[p->nr_insn];
+ brw_save_call(&c->func, inst->Comment, p->nr_insn);
brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16));
brw_pop_insn_state(p);
break;
@@ -2510,14 +2500,21 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c)
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
}
post_wm_emit(c);
- for (i = 0; i < c->fp->program.Base.NumInstructions; i++)
- c->fp->program.Base.Instructions[i].Data = NULL;
}
+
+/**
+ * Do GPU code generation for shaders that use GLSL features such as
+ * flow control. Other shaders will be compiled with the
+ */
void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c)
{
+ /* initial instruction translation/simplification */
brw_wm_pass_fp(c);
+
+ /* actual code generation */
brw_wm_emit_glsl(brw, c);
+
c->prog_data.total_grf = c->reg_index;
c->prog_data.total_scratch = 0;
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c
index fca7b7a50c..3ade6aa6c3 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c
@@ -51,6 +51,7 @@ static struct brw_wm_value *get_value( struct brw_wm_compile *c)
return &c->vreg[c->nr_vreg++];
}
+/** return pointer to a newly allocated instruction */
static struct brw_wm_instruction *get_instruction( struct brw_wm_compile *c )
{
assert(c->nr_insns < BRW_WM_MAX_INSN);
@@ -60,6 +61,7 @@ static struct brw_wm_instruction *get_instruction( struct brw_wm_compile *c )
/***********************************************************************
*/
+/** Init the "undef" register */
static void pass0_init_undef( struct brw_wm_compile *c)
{
struct brw_wm_ref *ref = &c->undef_ref;
@@ -69,6 +71,7 @@ static void pass0_init_undef( struct brw_wm_compile *c)
ref->prevuse = NULL;
}
+/** Set a FP register to a value */
static void pass0_set_fpreg_value( struct brw_wm_compile *c,
GLuint file,
GLuint idx,
@@ -83,6 +86,7 @@ static void pass0_set_fpreg_value( struct brw_wm_compile *c,
c->pass0_fp_reg[file][idx][component] = ref;
}
+/** Set a FP register to a ref */
static void pass0_set_fpreg_ref( struct brw_wm_compile *c,
GLuint file,
GLuint idx,
@@ -115,12 +119,13 @@ static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c,
ref->value = &c->creg[i/16];
ref->insn = 0;
ref->prevuse = NULL;
-
+
return ref;
}
}
+/** Return a ref to a constant/literal value */
static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c,
const GLfloat *constval )
{
@@ -142,7 +147,7 @@ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c,
*/
c->constref[i].constval = *constval;
c->constref[i].ref = get_param_ref(c, constval);
-
+
return c->constref[i].ref;
}
else {
@@ -187,7 +192,7 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c,
/* There's something really hokey about parameters parsed in
* arb programs - they all end up in here, whether they be
- * state values, paramters or constants. This duplicates the
+ * state values, parameters or constants. This duplicates the
* structure above & also seems to subvert the limits set for
* each type of constant/param.
*/
@@ -198,7 +203,7 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c,
*/
ref = get_const_ref(c, &plist->ParameterValues[idx][component]);
break;
-
+
case PROGRAM_STATE_VAR:
case PROGRAM_UNIFORM:
/* These may change from run to run:
@@ -229,14 +234,13 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c,
-
/***********************************************************************
* Straight translation to internal instruction format
*/
static void pass0_set_dst( struct brw_wm_compile *c,
- struct brw_wm_instruction *out,
- const struct prog_instruction *inst,
+ struct brw_wm_instruction *out,
+ const struct prog_instruction *inst,
GLuint writemask )
{
const struct prog_dst_register *dst = &inst->DstReg;
@@ -245,18 +249,17 @@ static void pass0_set_dst( struct brw_wm_compile *c,
for (i = 0; i < 4; i++) {
if (writemask & (1<<i)) {
out->dst[i] = get_value(c);
-
pass0_set_fpreg_value(c, dst->File, dst->Index, i, out->dst[i]);
}
}
-
+
out->writemask = writemask;
}
static void pass0_set_dst_scalar( struct brw_wm_compile *c,
- struct brw_wm_instruction *out,
- const struct prog_instruction *inst,
+ struct brw_wm_instruction *out,
+ const struct prog_instruction *inst,
GLuint writemask )
{
if (writemask) {
@@ -282,7 +285,6 @@ static void pass0_set_dst_scalar( struct brw_wm_compile *c,
}
-
static const struct brw_wm_ref *get_fp_src_reg_ref( struct brw_wm_compile *c,
struct prog_src_register src,
GLuint i )
@@ -292,14 +294,13 @@ static const struct brw_wm_ref *get_fp_src_reg_ref( struct brw_wm_compile *c,
static const GLfloat const_zero = 0.0;
static const GLfloat const_one = 1.0;
-
if (component == SWIZZLE_ZERO)
src_ref = get_const_ref(c, &const_zero);
else if (component == SWIZZLE_ONE)
src_ref = get_const_ref(c, &const_one);
else
src_ref = pass0_get_reg(c, src.File, src.Index, component);
-
+
return src_ref;
}
@@ -311,19 +312,19 @@ static struct brw_wm_ref *get_new_ref( struct brw_wm_compile *c,
{
const struct brw_wm_ref *ref = get_fp_src_reg_ref(c, src, i);
struct brw_wm_ref *newref = get_ref(c);
-
+
newref->value = ref->value;
newref->hw_reg = ref->hw_reg;
- if (insn) {
+ if (insn) {
newref->insn = insn - c->instruction;
newref->prevuse = newref->value->lastuse;
newref->value->lastuse = newref;
}
- if (src.NegateBase & (1<<i))
+ if (src.NegateBase & (1<<i))
newref->hw_reg.negate ^= 1;
-
+
if (src.Abs) {
newref->hw_reg.negate = 0;
newref->hw_reg.abs = 1;
@@ -333,9 +334,9 @@ static struct brw_wm_ref *get_new_ref( struct brw_wm_compile *c,
}
-
-static struct brw_wm_instruction *translate_insn( struct brw_wm_compile *c,
- const struct prog_instruction *inst )
+static void
+translate_insn(struct brw_wm_compile *c,
+ const struct prog_instruction *inst)
{
struct brw_wm_instruction *out = get_instruction(c);
GLuint writemask = inst->DstReg.WriteMask;
@@ -365,8 +366,6 @@ static struct brw_wm_instruction *translate_insn( struct brw_wm_compile *c,
pass0_set_dst_scalar(c, out, inst, writemask);
else
pass0_set_dst(c, out, inst, writemask);
-
- return out;
}
@@ -426,6 +425,7 @@ static void pass0_init_payload( struct brw_wm_compile *c )
&c->payload.input_interp[i] );
}
+
/***********************************************************************
* PASS 0
*
@@ -448,7 +448,6 @@ void brw_wm_pass0( struct brw_wm_compile *c )
for (insn = 0; insn < c->nr_fp_insns; insn++) {
const struct prog_instruction *inst = &c->prog_instructions[insn];
-
/* Optimize away moves, otherwise emit translated instruction:
*/
switch (inst->Opcode) {
@@ -461,8 +460,6 @@ void brw_wm_pass0( struct brw_wm_compile *c )
translate_insn(c, inst);
}
break;
-
-
default:
translate_insn(c, inst);
break;
@@ -473,4 +470,3 @@ void brw_wm_pass0( struct brw_wm_compile *c )
brw_wm_print_program(c, "pass0");
}
}
-
diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c
index f6f3a38e9e..6eaed8a665 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c
@@ -58,7 +58,8 @@ static void unlink_ref(struct brw_wm_ref *ref)
if (ref == value->lastuse) {
value->lastuse = ref->prevuse;
- } else {
+ }
+ else {
struct brw_wm_ref *i = value->lastuse;
while (i->prevuse != ref) i = i->prevuse;
i->prevuse = ref->prevuse;
@@ -75,8 +76,9 @@ static void track_arg(struct brw_wm_compile *c,
for (i = 0; i < 4; i++) {
struct brw_wm_ref *ref = inst->src[arg][i];
if (ref) {
- if (readmask & (1<<i))
+ if (readmask & (1<<i)) {
ref->value->contributes_to_output = 1;
+ }
else {
unlink_ref(ref);
inst->src[arg][i] = NULL;
@@ -88,15 +90,21 @@ static void track_arg(struct brw_wm_compile *c,
static GLuint get_texcoord_mask( GLuint tex_idx )
{
switch (tex_idx) {
- case TEXTURE_1D_INDEX: return WRITEMASK_X;
- case TEXTURE_2D_INDEX: return WRITEMASK_XY;
- case TEXTURE_3D_INDEX: return WRITEMASK_XYZ;
- case TEXTURE_CUBE_INDEX: return WRITEMASK_XYZ;
- case TEXTURE_RECT_INDEX: return WRITEMASK_XY;
+ case TEXTURE_1D_INDEX:
+ return WRITEMASK_X;
+ case TEXTURE_2D_INDEX:
+ return WRITEMASK_XY;
+ case TEXTURE_3D_INDEX:
+ return WRITEMASK_XYZ;
+ case TEXTURE_CUBE_INDEX:
+ return WRITEMASK_XYZ;
+ case TEXTURE_RECT_INDEX:
+ return WRITEMASK_XY;
default: return 0;
}
}
+
/* Step two: Basically this is dead code elimination.
*
* Iterate backwards over instructions, noting which values
@@ -273,6 +281,3 @@ void brw_wm_pass1( struct brw_wm_compile *c )
brw_wm_print_program(c, "pass1");
}
}
-
-
-
diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c
index 6fca9ad220..780edbc42e 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c
@@ -84,7 +84,7 @@ static void init_registers( struct brw_wm_compile *c )
for (j = 0; j < c->nr_creg; j++)
prealloc_reg(c, &c->creg[j], i++);
- for (j = 0; j < FRAG_ATTRIB_MAX; j++)
+ for (j = 0; j < FRAG_ATTRIB_MAX; j++) {
if (inputs & (1<<j)) {
/* index for vs output and ps input are not the same
in shader varying */
@@ -96,6 +96,7 @@ static void init_registers( struct brw_wm_compile *c )
nr_interp_regs++;
prealloc_reg(c, &c->payload.input_interp[index], i++);
}
+ }
assert(nr_interp_regs >= 1);
@@ -120,7 +121,7 @@ static void update_register_usage(struct brw_wm_compile *c,
/* Only search those which can change:
*/
if (grf->nextuse < thisinsn) {
- struct brw_wm_ref *ref = grf->value->lastuse;
+ const struct brw_wm_ref *ref = grf->value->lastuse;
/* Has last use of value been passed?
*/
@@ -148,7 +149,7 @@ static void spill_value(struct brw_wm_compile *c,
/* Allocate a spill slot. Note that allocations start from 0x40 -
* the first slot is reserved to mean "undef" in brw_wm_emit.c
*/
- if (!value->spill_slot) {
+ if (!value->spill_slot) {
c->last_scratch += 0x40;
value->spill_slot = c->last_scratch;
}
@@ -189,7 +190,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c,
if (grf[i+j].nextuse < group_nextuse)
group_nextuse = grf[i+j].nextuse;
}
-
+
if (group_nextuse > furthest) {
furthest = group_nextuse;
reg = i;
@@ -197,7 +198,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c,
}
assert(furthest != thisinsn);
-
+
/* Any non-empty regs will need to be spilled:
*/
for (j = 0; j < nr; j++)
@@ -243,7 +244,7 @@ static void alloc_contiguous_dest(struct brw_wm_compile *c,
static void load_args(struct brw_wm_compile *c,
struct brw_wm_instruction *inst)
-{
+{
GLuint thisinsn = inst - c->instruction;
GLuint i,j;
@@ -258,17 +259,17 @@ static void load_args(struct brw_wm_compile *c,
* register allocation and mark the ref as requiring a fill.
*/
GLuint reg = search_contiguous_regs(c, 1, thisinsn);
-
+
c->pass2_grf[reg].value = ref->value;
c->pass2_grf[reg].nextuse = thisinsn;
-
+
ref->value->resident = &c->pass2_grf[reg];
/* Note that a fill is required:
*/
ref->unspill_reg = reg*2;
}
-
+
/* Adjust the hw_reg to point at the value's current location:
*/
assert(ref->value == ref->value->resident->value);
@@ -294,7 +295,7 @@ void brw_wm_pass2( struct brw_wm_compile *c )
for (insn = 0; insn < c->nr_insns; insn++) {
struct brw_wm_instruction *inst = &c->instruction[insn];
-
+
/* Update registers' nextuse values:
*/
update_register_usage(c, insn);
@@ -322,11 +323,11 @@ void brw_wm_pass2( struct brw_wm_compile *c )
break;
}
- if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY)
+ if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY) {
for (i = 0; i < 4; i++)
if (inst->dst[i])
spill_value(c, inst->dst[i]);
-
+ }
}
if (INTEL_DEBUG & DEBUG_WM) {
@@ -339,6 +340,3 @@ void brw_wm_pass2( struct brw_wm_compile *c )
brw_wm_print_program(c, "pass2/done");
}
}
-
-
-
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index 8c9cb78945..b6dac0d698 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -220,14 +220,15 @@ static void
brw_wm_sampler_populate_key(struct brw_context *brw,
struct wm_sampler_key *key)
{
+ GLcontext *ctx = &brw->intel.ctx;
int unit;
memset(key, 0, sizeof(*key));
for (unit = 0; unit < BRW_MAX_TEX_UNIT; unit++) {
- if (brw->attribs.Texture->Unit[unit]._ReallyEnabled) {
+ if (ctx->Texture.Unit[unit]._ReallyEnabled) {
struct wm_sampler_entry *entry = &key->sampler[unit];
- struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[unit];
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
struct gl_texture_object *texObj = texUnit->_Current;
struct intel_texture_object *intelObj = intel_texture_object(texObj);
struct gl_texture_image *firstImage =
@@ -274,6 +275,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
*/
static void upload_wm_samplers( struct brw_context *brw )
{
+ GLcontext *ctx = &brw->intel.ctx;
struct wm_sampler_key key;
int i;
@@ -317,7 +319,7 @@ static void upload_wm_samplers( struct brw_context *brw )
/* Emit SDC relocations */
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- if (!brw->attribs.Texture->Unit[i]._ReallyEnabled)
+ if (!ctx->Texture.Unit[i]._ReallyEnabled)
continue;
dri_bo_emit_reloc(brw->wm.sampler_bo,
diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c
index 5302405eda..3c3b3473d6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_state.c
@@ -60,6 +60,7 @@ struct brw_wm_unit_key {
static void
wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
{
+ GLcontext *ctx = &brw->intel.ctx;
const struct gl_fragment_program *fp = brw->fragment_program;
struct intel_context *intel = &brw->intel;
@@ -95,7 +96,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
key->sampler_count = brw->wm.sampler_count;
/* _NEW_POLYGONSTIPPLE */
- key->polygon_stipple = brw->attribs.Polygon->StippleFlag;
+ key->polygon_stipple = ctx->Polygon.StippleFlag;
/* BRW_NEW_FRAGMENT_PROGRAM */
key->uses_depth = (fp->Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0;
@@ -105,19 +106,19 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
(fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) != 0;
/* _NEW_COLOR */
- key->uses_kill = fp->UsesKill || brw->attribs.Color->AlphaEnabled;
+ key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
key->is_glsl = brw_wm_is_glsl(fp);
/* XXX: This needs a flag to indicate when it changes. */
key->stats_wm = intel->stats_wm;
/* _NEW_LINE */
- key->line_stipple = brw->attribs.Line->StippleFlag;
+ key->line_stipple = ctx->Line.StippleFlag;
/* _NEW_POLYGON */
- key->offset_enable = brw->attribs.Polygon->OffsetFill;
- key->offset_units = brw->attribs.Polygon->OffsetUnits;
- key->offset_factor = brw->attribs.Polygon->OffsetFactor;
+ key->offset_enable = ctx->Polygon.OffsetFill;
+ key->offset_units = ctx->Polygon.OffsetUnits;
+ key->offset_factor = ctx->Polygon.OffsetFactor;
}
static dri_bo *
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 06e71e6d69..d70f9c646c 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -253,7 +253,7 @@ static void
brw_update_texture_surface( GLcontext *ctx, GLuint unit )
{
struct brw_context *brw = brw_context(ctx);
- struct gl_texture_object *tObj = brw->attribs.Texture->Unit[unit]._Current;
+ struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel];
struct brw_wm_surface_key key;
@@ -301,6 +301,7 @@ static void
brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
unsigned int unit, GLboolean cached)
{
+ GLcontext *ctx = &brw->intel.ctx;
dri_bo *region_bo = NULL;
struct {
unsigned int surface_type;
@@ -333,10 +334,10 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
key.height = 1;
key.cpp = 4;
}
- memcpy(key.color_mask, brw->attribs.Color->ColorMask,
+ memcpy(key.color_mask, ctx->Color.ColorMask,
sizeof(key.color_mask));
- key.color_blend = (!brw->attribs.Color->_LogicOpEnabled &&
- brw->attribs.Color->BlendEnabled);
+ key.color_blend = (!ctx->Color._LogicOpEnabled &&
+ ctx->Color.BlendEnabled);
dri_bo_unreference(brw->wm.surf_bo[unit]);
brw->wm.surf_bo[unit] = NULL;
@@ -459,7 +460,7 @@ static void prepare_wm_surfaces(struct brw_context *brw )
brw->wm.nr_surfaces = MAX_DRAW_BUFFERS;
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i];
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
/* _NEW_TEXTURE, BRW_NEW_TEXDATA */
if(texUnit->_ReallyEnabled) {
diff --git a/src/mesa/drivers/dri/i965/intel_clear.c b/src/mesa/drivers/dri/i965/intel_clear.c
new file mode 120000
index 0000000000..9a2a742a0d
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_clear.c
@@ -0,0 +1 @@
+../intel/intel_clear.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/intel_depthstencil.c b/src/mesa/drivers/dri/i965/intel_depthstencil.c
deleted file mode 120000
index 4ac4ae690a..0000000000
--- a/src/mesa/drivers/dri/i965/intel_depthstencil.c
+++ /dev/null
@@ -1 +0,0 @@
-../intel/intel_depthstencil.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
new file mode 120000
index 0000000000..a2f3e8cd20
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -0,0 +1 @@
+../intel/intel_extensions.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c
index 67ef5f78c1..519672fc35 100644..120000
--- a/src/mesa/drivers/dri/i965/intel_state.c
+++ b/src/mesa/drivers/dri/i965/intel_state.c
@@ -1,225 +1 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "main/enums.h"
-#include "main/colormac.h"
-#include "main/dd.h"
-
-#include "intel_screen.h"
-#include "intel_context.h"
-#include "intel_regions.h"
-#include "swrast/swrast.h"
-
-int intel_translate_shadow_compare_func( GLenum func )
-{
- switch(func) {
- case GL_NEVER:
- return COMPAREFUNC_ALWAYS;
- case GL_LESS:
- return COMPAREFUNC_LEQUAL;
- case GL_LEQUAL:
- return COMPAREFUNC_LESS;
- case GL_GREATER:
- return COMPAREFUNC_GEQUAL;
- case GL_GEQUAL:
- return COMPAREFUNC_GREATER;
- case GL_NOTEQUAL:
- return COMPAREFUNC_EQUAL;
- case GL_EQUAL:
- return COMPAREFUNC_NOTEQUAL;
- case GL_ALWAYS:
- return COMPAREFUNC_NEVER;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
- return COMPAREFUNC_NEVER;
-}
-
-int intel_translate_compare_func( GLenum func )
-{
- switch(func) {
- case GL_NEVER:
- return COMPAREFUNC_NEVER;
- case GL_LESS:
- return COMPAREFUNC_LESS;
- case GL_LEQUAL:
- return COMPAREFUNC_LEQUAL;
- case GL_GREATER:
- return COMPAREFUNC_GREATER;
- case GL_GEQUAL:
- return COMPAREFUNC_GEQUAL;
- case GL_NOTEQUAL:
- return COMPAREFUNC_NOTEQUAL;
- case GL_EQUAL:
- return COMPAREFUNC_EQUAL;
- case GL_ALWAYS:
- return COMPAREFUNC_ALWAYS;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
- return COMPAREFUNC_ALWAYS;
-}
-
-int intel_translate_stencil_op( GLenum op )
-{
- switch(op) {
- case GL_KEEP:
- return STENCILOP_KEEP;
- case GL_ZERO:
- return STENCILOP_ZERO;
- case GL_REPLACE:
- return STENCILOP_REPLACE;
- case GL_INCR:
- return STENCILOP_INCRSAT;
- case GL_DECR:
- return STENCILOP_DECRSAT;
- case GL_INCR_WRAP:
- return STENCILOP_INCR;
- case GL_DECR_WRAP:
- return STENCILOP_DECR;
- case GL_INVERT:
- return STENCILOP_INVERT;
- default:
- return STENCILOP_ZERO;
- }
-}
-
-int intel_translate_blend_factor( GLenum factor )
-{
- switch(factor) {
- case GL_ZERO:
- return BLENDFACT_ZERO;
- case GL_SRC_ALPHA:
- return BLENDFACT_SRC_ALPHA;
- case GL_ONE:
- return BLENDFACT_ONE;
- case GL_SRC_COLOR:
- return BLENDFACT_SRC_COLR;
- case GL_ONE_MINUS_SRC_COLOR:
- return BLENDFACT_INV_SRC_COLR;
- case GL_DST_COLOR:
- return BLENDFACT_DST_COLR;
- case GL_ONE_MINUS_DST_COLOR:
- return BLENDFACT_INV_DST_COLR;
- case GL_ONE_MINUS_SRC_ALPHA:
- return BLENDFACT_INV_SRC_ALPHA;
- case GL_DST_ALPHA:
- return BLENDFACT_DST_ALPHA;
- case GL_ONE_MINUS_DST_ALPHA:
- return BLENDFACT_INV_DST_ALPHA;
- case GL_SRC_ALPHA_SATURATE:
- return BLENDFACT_SRC_ALPHA_SATURATE;
- case GL_CONSTANT_COLOR:
- return BLENDFACT_CONST_COLOR;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- return BLENDFACT_INV_CONST_COLOR;
- case GL_CONSTANT_ALPHA:
- return BLENDFACT_CONST_ALPHA;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- return BLENDFACT_INV_CONST_ALPHA;
- }
-
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
- return BLENDFACT_ZERO;
-}
-
-int intel_translate_logic_op( GLenum opcode )
-{
- switch(opcode) {
- case GL_CLEAR:
- return LOGICOP_CLEAR;
- case GL_AND:
- return LOGICOP_AND;
- case GL_AND_REVERSE:
- return LOGICOP_AND_RVRSE;
- case GL_COPY:
- return LOGICOP_COPY;
- case GL_COPY_INVERTED:
- return LOGICOP_COPY_INV;
- case GL_AND_INVERTED:
- return LOGICOP_AND_INV;
- case GL_NOOP:
- return LOGICOP_NOOP;
- case GL_XOR:
- return LOGICOP_XOR;
- case GL_OR:
- return LOGICOP_OR;
- case GL_OR_INVERTED:
- return LOGICOP_OR_INV;
- case GL_NOR:
- return LOGICOP_NOR;
- case GL_EQUIV:
- return LOGICOP_EQUIV;
- case GL_INVERT:
- return LOGICOP_INV;
- case GL_OR_REVERSE:
- return LOGICOP_OR_RVRSE;
- case GL_NAND:
- return LOGICOP_NAND;
- case GL_SET:
- return LOGICOP_SET;
- default:
- return LOGICOP_SET;
- }
-}
-
-
-static void intelClearColor(GLcontext *ctx, const GLfloat color[4])
-{
- struct intel_context *intel = intel_context(ctx);
-
- UNCLAMPED_FLOAT_TO_RGBA_CHAN(intel->clear_chan, color);
-
- intel->ClearColor8888 = INTEL_PACKCOLOR8888(intel->clear_chan[0],
- intel->clear_chan[1],
- intel->clear_chan[2],
- intel->clear_chan[3]);
- intel->ClearColor565 = INTEL_PACKCOLOR565(intel->clear_chan[0],
- intel->clear_chan[1],
- intel->clear_chan[2]);
-}
-
-
-
-/* Fallback to swrast for select and feedback.
- */
-static void intelRenderMode( GLcontext *ctx, GLenum mode )
-{
- struct intel_context *intel = intel_context(ctx);
- FALLBACK( intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER) );
-}
-
-
-void intelInitStateFuncs( struct dd_function_table *functions )
-{
- functions->RenderMode = intelRenderMode;
- functions->ClearColor = intelClearColor;
-}
+../intel/intel_state.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/intel_swapbuffers.c b/src/mesa/drivers/dri/i965/intel_swapbuffers.c
new file mode 120000
index 0000000000..148d5215aa
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_swapbuffers.c
@@ -0,0 +1 @@
+../intel/intel_swapbuffers.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 0fd2f16a8f..7f2144abd4 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -25,25 +25,14 @@
*
**************************************************************************/
-#include "intel_screen.h"
#include "intel_context.h"
-#include "intel_blit.h"
#include "intel_buffers.h"
-#include "intel_chipset.h"
-#include "intel_depthstencil.h"
#include "intel_fbo.h"
#include "intel_regions.h"
#include "intel_batchbuffer.h"
-#include "intel_reg.h"
-#include "main/context.h"
#include "main/framebuffer.h"
-#include "swrast/swrast.h"
-#include "utils.h"
#include "drirenderbuffer.h"
-#include "vblank.h"
-#include "i915_drm.h"
-#define FILE_DEBUG_FLAG DEBUG_BLIT
/**
* XXX move this into a new dri/common/cliprects.c file.
@@ -114,7 +103,6 @@ intel_get_cliprects(struct intel_context *intel,
int *x_off, int *y_off)
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
- struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
if (intel->constant_cliprect) {
/* FBO or DRI2 rendering, which can just use the fb's size. */
@@ -143,399 +131,6 @@ intel_get_cliprects(struct intel_context *intel,
}
}
-/**
- * This will be called whenever the currently bound window is moved/resized.
- * XXX: actually, it seems to NOT be called when the window is only moved (BP).
- */
-void
-intelWindowMoved(struct intel_context *intel)
-{
- GLcontext *ctx = &intel->ctx;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
- struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
-
- if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
- intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
- volatile drm_i915_sarea_t *sarea = intel->sarea;
- drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
- .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
- drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y,
- .x2 = sarea->planeA_x + sarea->planeA_w,
- .y2 = sarea->planeA_y + sarea->planeA_h };
- drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y,
- .x2 = sarea->planeB_x + sarea->planeB_w,
- .y2 = sarea->planeB_y + sarea->planeB_h };
- GLint areaA = driIntersectArea( drw_rect, planeA_rect );
- GLint areaB = driIntersectArea( drw_rect, planeB_rect );
- GLuint flags = dPriv->vblFlags;
-
- /* Update vblank info
- */
- if (areaB > areaA || (areaA == areaB && areaB > 0)) {
- flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
- } else {
- flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
- }
-
- /* Check to see if we changed pipes */
- if (flags != dPriv->vblFlags && dPriv->vblFlags &&
- !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
- int64_t count;
- drmVBlank vbl;
- int i;
-
- /*
- * Deal with page flipping
- */
- vbl.request.type = DRM_VBLANK_ABSOLUTE;
-
- if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) {
- vbl.request.type |= DRM_VBLANK_SECONDARY;
- }
-
- for (i = 0; i < 2; i++) {
- if (!intel_fb->color_rb[i] ||
- (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <=
- (1<<23))
- continue;
-
- vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
- drmWaitVBlank(intel->driFd, &vbl);
- }
-
- /*
- * Update msc_base from old pipe
- */
- driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count);
- dPriv->msc_base = count;
- /*
- * Then get new vblank_base and vblSeq values
- */
- dPriv->vblFlags = flags;
- driGetCurrentVBlank(dPriv);
- dPriv->vblank_base = dPriv->vblSeq;
-
- intel_fb->vbl_waited = dPriv->vblSeq;
-
- for (i = 0; i < 2; i++) {
- if (intel_fb->color_rb[i])
- intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited;
- }
- }
- } else {
- dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY;
- }
-
- /* Update Mesa's notion of window size */
- driUpdateFramebufferSize(ctx, dPriv);
- intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
-
- /* Update hardware scissor */
- if (ctx->Driver.Scissor != NULL) {
- ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height);
- }
-
- /* Re-calculate viewport related state */
- if (ctx->Driver.DepthRange != NULL)
- ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far );
-}
-
-
-
-/* A true meta version of this would be very simple and additionally
- * machine independent. Maybe we'll get there one day.
- */
-static void
-intelClearWithTris(struct intel_context *intel, GLbitfield mask)
-{
- GLcontext *ctx = &intel->ctx;
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- GLuint buf;
-
- intel->vtbl.install_meta_state(intel);
-
- /* Back and stencil cliprects are the same. Try and do both
- * buffers at once:
- */
- if (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) {
- struct intel_region *backRegion =
- intel_get_rb_region(fb, BUFFER_BACK_LEFT);
- struct intel_region *depthRegion =
- intel_get_rb_region(fb, BUFFER_DEPTH);
-
- intel->vtbl.meta_draw_region(intel, backRegion, depthRegion);
-
- if (mask & BUFFER_BIT_BACK_LEFT)
- intel->vtbl.meta_color_mask(intel, GL_TRUE);
- else
- intel->vtbl.meta_color_mask(intel, GL_FALSE);
-
- if (mask & BUFFER_BIT_STENCIL)
- intel->vtbl.meta_stencil_replace(intel,
- intel->ctx.Stencil.WriteMask[0],
- intel->ctx.Stencil.Clear);
- else
- intel->vtbl.meta_no_stencil_write(intel);
-
- if (mask & BUFFER_BIT_DEPTH)
- intel->vtbl.meta_depth_replace(intel);
- else
- intel->vtbl.meta_no_depth_write(intel);
-
- intel->vtbl.meta_draw_quad(intel,
- fb->_Xmin,
- fb->_Xmax,
- fb->_Ymin,
- fb->_Ymax,
- intel->ctx.Depth.Clear,
- intel->ClearColor8888,
- 0, 0, 0, 0); /* texcoords */
-
- mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH);
- }
-
- /* clear the remaining (color) renderbuffers */
- for (buf = 0; buf < BUFFER_COUNT && mask; buf++) {
- const GLuint bufBit = 1 << buf;
- if (mask & bufBit) {
- struct intel_renderbuffer *irbColor =
- intel_renderbuffer(fb->Attachment[buf].Renderbuffer);
-
- ASSERT(irbColor);
-
- intel->vtbl.meta_no_depth_write(intel);
- intel->vtbl.meta_no_stencil_write(intel);
- intel->vtbl.meta_color_mask(intel, GL_TRUE);
- intel->vtbl.meta_draw_region(intel, irbColor->region, NULL);
-
- intel->vtbl.meta_draw_quad(intel,
- fb->_Xmin,
- fb->_Xmax,
- fb->_Ymin,
- fb->_Ymax,
- 0, intel->ClearColor8888,
- 0, 0, 0, 0); /* texcoords */
-
- mask &= ~bufBit;
- }
- }
-
- intel->vtbl.leave_meta_state(intel);
-}
-
-static const char *buffer_names[] = {
- [BUFFER_FRONT_LEFT] = "front",
- [BUFFER_BACK_LEFT] = "back",
- [BUFFER_FRONT_RIGHT] = "front right",
- [BUFFER_BACK_RIGHT] = "back right",
- [BUFFER_AUX0] = "aux0",
- [BUFFER_AUX1] = "aux1",
- [BUFFER_AUX2] = "aux2",
- [BUFFER_AUX3] = "aux3",
- [BUFFER_DEPTH] = "depth",
- [BUFFER_STENCIL] = "stencil",
- [BUFFER_ACCUM] = "accum",
- [BUFFER_COLOR0] = "color0",
- [BUFFER_COLOR1] = "color1",
- [BUFFER_COLOR2] = "color2",
- [BUFFER_COLOR3] = "color3",
- [BUFFER_COLOR4] = "color4",
- [BUFFER_COLOR5] = "color5",
- [BUFFER_COLOR6] = "color6",
- [BUFFER_COLOR7] = "color7",
-};
-
-/**
- * Called by ctx->Driver.Clear.
- */
-static void
-intelClear(GLcontext *ctx, GLbitfield mask)
-{
- struct intel_context *intel = intel_context(ctx);
- const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
- GLbitfield tri_mask = 0;
- GLbitfield blit_mask = 0;
- GLbitfield swrast_mask = 0;
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- GLuint i;
-
- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* HW color buffers (front, back, aux, generic FBO, etc) */
- if (colorMask == ~0) {
- /* clear all R,G,B,A */
- /* XXX FBO: need to check if colorbuffers are software RBOs! */
- blit_mask |= (mask & BUFFER_BITS_COLOR);
- }
- else {
- /* glColorMask in effect */
- tri_mask |= (mask & BUFFER_BITS_COLOR);
- }
-
- /* HW stencil */
- if (mask & BUFFER_BIT_STENCIL) {
- const struct intel_region *stencilRegion
- = intel_get_rb_region(fb, BUFFER_STENCIL);
- if (stencilRegion) {
- /* have hw stencil */
- if (IS_965(intel->intelScreen->deviceID) ||
- (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) {
- /* We have to use the 3D engine if we're clearing a partial mask
- * of the stencil buffer, or if we're on a 965 which has a tiled
- * depth/stencil buffer in a layout we can't blit to.
- */
- tri_mask |= BUFFER_BIT_STENCIL;
- }
- else {
- /* clearing all stencil bits, use blitting */
- blit_mask |= BUFFER_BIT_STENCIL;
- }
- }
- }
-
- /* HW depth */
- if (mask & BUFFER_BIT_DEPTH) {
- /* clear depth with whatever method is used for stencil (see above) */
- if (IS_965(intel->intelScreen->deviceID) ||
- tri_mask & BUFFER_BIT_STENCIL)
- tri_mask |= BUFFER_BIT_DEPTH;
- else
- blit_mask |= BUFFER_BIT_DEPTH;
- }
-
- /* SW fallback clearing */
- swrast_mask = mask & ~tri_mask & ~blit_mask;
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- GLuint bufBit = 1 << i;
- if ((blit_mask | tri_mask) & bufBit) {
- if (!fb->Attachment[i].Renderbuffer->ClassID) {
- blit_mask &= ~bufBit;
- tri_mask &= ~bufBit;
- swrast_mask |= bufBit;
- }
- }
- }
-
- if (blit_mask) {
- if (INTEL_DEBUG & DEBUG_BLIT) {
- DBG("blit clear:");
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (blit_mask & (1 << i))
- DBG(" %s", buffer_names[i]);
- }
- DBG("\n");
- }
- intelClearWithBlit(ctx, blit_mask);
- }
-
- if (tri_mask) {
- if (INTEL_DEBUG & DEBUG_BLIT) {
- DBG("tri clear:");
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (tri_mask & (1 << i))
- DBG(" %s", buffer_names[i]);
- }
- DBG("\n");
- }
- intelClearWithTris(intel, tri_mask);
- }
-
- if (swrast_mask) {
- if (INTEL_DEBUG & DEBUG_BLIT) {
- DBG("swrast clear:");
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (swrast_mask & (1 << i))
- DBG(" %s", buffer_names[i]);
- }
- DBG("\n");
- }
- _swrast_Clear(ctx, swrast_mask);
- }
-}
-
-void
-intelSwapBuffers(__DRIdrawablePrivate * dPriv)
-{
- __DRIscreenPrivate *psp = dPriv->driScreenPriv;
-
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- GET_CURRENT_CONTEXT(ctx);
- struct intel_context *intel;
-
- if (ctx == NULL)
- return;
-
- intel = intel_context(ctx);
-
- if (ctx->Visual.doubleBufferMode) {
- GLboolean missed_target;
- struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
- int64_t ust;
-
- _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
-
- /*
- * The old swapping ioctl was incredibly racy, just wait for vblank
- * and do the swap ourselves.
- */
- driWaitForVBlank(dPriv, &missed_target);
-
- /*
- * Update each buffer's vbl_pending so we don't get too out of
- * sync
- */
- intel_get_renderbuffer(&intel_fb->Base,
- BUFFER_BACK_LEFT)->vbl_pending = dPriv->vblSeq;
- intel_get_renderbuffer(&intel_fb->Base,
- BUFFER_FRONT_LEFT)->vbl_pending = dPriv->vblSeq;
-
- intelCopyBuffer(dPriv, NULL);
-
- intel_fb->swap_count++;
- (*psp->systemTime->getUST) (&ust);
- if (missed_target) {
- intel_fb->swap_missed_count++;
- intel_fb->swap_missed_ust = ust - intel_fb->swap_ust;
- }
-
- intel_fb->swap_ust = ust;
- }
- drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE);
-
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__);
- }
-}
-
-void
-intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
-{
- if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
- struct intel_context *intel =
- (struct intel_context *) dPriv->driContextPriv->driverPrivate;
- GLcontext *ctx = &intel->ctx;
-
- if (ctx->Visual.doubleBufferMode) {
- drm_clip_rect_t rect;
- rect.x1 = x + dPriv->x;
- rect.y1 = (dPriv->h - y - h) + dPriv->y;
- rect.x2 = rect.x1 + w;
- rect.y2 = rect.y1 + h;
- _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
- intelCopyBuffer(dPriv, &rect);
- }
- }
- else {
- /* XXX this shouldn't be an error but we can't handle it for now */
- fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__);
- }
-}
-
/**
* Update the hardware state for drawing into a window or framebuffer object.
@@ -559,7 +154,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
return;
}
- /* Do this here, note core Mesa, since this function is called from
+ /* Do this here, not core Mesa, since this function is called from
* many places within the driver.
*/
if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
@@ -577,9 +172,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
return;
}
- if (fb->Name)
- intel_validate_paired_depth_stencil(ctx, fb);
-
/*
* How many color buffers are we drawing into?
*/
@@ -587,7 +179,8 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
/* writing to 0 */
colorRegions[0] = NULL;
intel->constant_cliprect = GL_TRUE;
- } else if (fb->_NumColorDrawBuffers > 1) {
+ }
+ else if (fb->_NumColorDrawBuffers > 1) {
int i;
struct intel_renderbuffer *irb;
@@ -626,14 +219,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
}
}
- /* Update culling direction which changes depending on the
- * orientation of the buffer:
- */
- if (ctx->Driver.FrontFace)
- ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
- else
- ctx->NewState |= _NEW_POLYGON;
-
if (!colorRegions[0]) {
FALLBACK(intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE);
}
@@ -665,20 +250,13 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
/***
*** Stencil buffer
*** This can only be hardware accelerated if we're using a
- *** combined DEPTH_STENCIL buffer (for now anyway).
+ *** combined DEPTH_STENCIL buffer.
***/
if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) {
irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped);
if (irbStencil && irbStencil->region) {
ASSERT(irbStencil->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE);
- /* need to re-compute stencil hw state */
- if (ctx->Driver.Enable != NULL)
- ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
- else
- ctx->NewState |= _NEW_STENCIL;
- if (!depthRegion)
- depthRegion = irbStencil->region;
}
else {
FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_TRUE);
@@ -687,37 +265,30 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
else {
/* XXX FBO: instead of FALSE, pass ctx->Stencil.Enabled ??? */
FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE);
- /* need to re-compute stencil hw state */
- if (ctx->Driver.Enable != NULL)
- ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
- else
- ctx->NewState |= _NEW_STENCIL;
}
/*
- * Update depth test state
+ * Update depth and stencil test state
*/
if (ctx->Driver.Enable) {
- if (ctx->Depth.Test && fb->Visual.depthBits > 0) {
- ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_TRUE);
- } else {
- ctx->Driver.Enable(ctx, GL_DEPTH_TEST, GL_FALSE);
- }
- } else {
- ctx->NewState |= _NEW_DEPTH;
+ ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
+ (ctx->Depth.Test && fb->Visual.depthBits > 0));
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
+ (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
+ }
+ else {
+ ctx->NewState |= (_NEW_DEPTH | _NEW_STENCIL);
}
intel->vtbl.set_draw_region(intel, colorRegions, depthRegion,
- fb->_NumColorDrawBuffers);
+ fb->_NumColorDrawBuffers);
/* update viewport since it depends on window size */
- if (ctx->Driver.Viewport) {
- ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y,
- ctx->Viewport.Width, ctx->Viewport.Height);
- } else {
- ctx->NewState |= _NEW_VIEWPORT;
- }
-
+#ifdef I915
+ intelCalcViewport(ctx);
+#else
+ ctx->NewState |= _NEW_VIEWPORT;
+#endif
/* Set state we know depends on drawable parameters:
*/
if (ctx->Driver.Scissor)
@@ -729,6 +300,14 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
ctx->Driver.DepthRange(ctx,
ctx->Viewport.Near,
ctx->Viewport.Far);
+
+ /* Update culling direction which changes depending on the
+ * orientation of the buffer:
+ */
+ if (ctx->Driver.FrontFace)
+ ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
+ else
+ ctx->NewState |= _NEW_POLYGON;
}
@@ -759,7 +338,6 @@ intelReadBuffer(GLcontext * ctx, GLenum mode)
void
intelInitBufferFuncs(struct dd_function_table *functions)
{
- functions->Clear = intelClear;
functions->DrawBuffer = intelDrawBuffer;
functions->ReadBuffer = intelReadBuffer;
}
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h
index 0be1cee091..6069d38e9e 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.h
+++ b/src/mesa/drivers/dri/intel/intel_buffers.h
@@ -45,10 +45,6 @@ extern struct intel_region *intel_readbuf_region(struct intel_context *intel);
extern struct intel_region *intel_drawbuf_region(struct intel_context *intel);
-extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
-
-extern void intelWindowMoved(struct intel_context *intel);
-
extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb);
extern void intelInitBufferFuncs(struct dd_function_table *functions);
@@ -57,5 +53,8 @@ void intel_get_cliprects(struct intel_context *intel,
struct drm_clip_rect **cliprects,
unsigned int *num_cliprects,
int *x_off, int *y_off);
+#ifdef I915
+void intelCalcViewport(GLcontext * ctx);
+#endif
#endif /* INTEL_BUFFERS_H */
diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c
new file mode 100644
index 0000000000..b229136316
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_clear.c
@@ -0,0 +1,376 @@
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009 Intel Corporation.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mtypes.h"
+#include "main/attrib.h"
+#include "main/blend.h"
+#include "main/bufferobj.h"
+#include "main/buffers.h"
+#include "main/depth.h"
+#include "main/enable.h"
+#include "main/macros.h"
+#include "main/matrix.h"
+#include "main/texstate.h"
+#include "main/shaders.h"
+#include "main/stencil.h"
+#include "main/varray.h"
+#include "glapi/dispatch.h"
+#include "swrast/swrast.h"
+
+#include "intel_context.h"
+#include "intel_blit.h"
+#include "intel_chipset.h"
+#include "intel_clear.h"
+#include "intel_fbo.h"
+#include "intel_pixel.h"
+
+#define FILE_DEBUG_FLAG DEBUG_BLIT
+
+/**
+ * Perform glClear where mask contains only color, depth, and/or stencil.
+ *
+ * The implementation is based on calling into Mesa to set GL state and
+ * performing normal triangle rendering. The intent of this path is to
+ * have as generic a path as possible, so that any driver could make use of
+ * it.
+ */
+void
+intel_clear_tris(GLcontext *ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLfloat vertices[4][3];
+ GLfloat color[4][4];
+ GLfloat dst_z;
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ int i;
+ GLboolean saved_fp_enable = GL_FALSE, saved_vp_enable = GL_FALSE;
+ GLboolean saved_shader_program = 0;
+ unsigned int saved_active_texture;
+
+ assert((mask & ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT |
+ BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) == 0);
+
+ _mesa_PushAttrib(GL_COLOR_BUFFER_BIT |
+ GL_CURRENT_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_ENABLE_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_TRANSFORM_BIT |
+ GL_CURRENT_BIT);
+ _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
+ saved_active_texture = ctx->Texture.CurrentUnit;
+
+ /* Disable existing GL state we don't want to apply to a clear. */
+ _mesa_Disable(GL_ALPHA_TEST);
+ _mesa_Disable(GL_BLEND);
+ _mesa_Disable(GL_CULL_FACE);
+ _mesa_Disable(GL_FOG);
+ _mesa_Disable(GL_POLYGON_SMOOTH);
+ _mesa_Disable(GL_POLYGON_STIPPLE);
+ _mesa_Disable(GL_POLYGON_OFFSET_FILL);
+ _mesa_Disable(GL_LIGHTING);
+ _mesa_Disable(GL_CLIP_PLANE0);
+ _mesa_Disable(GL_CLIP_PLANE1);
+ _mesa_Disable(GL_CLIP_PLANE2);
+ _mesa_Disable(GL_CLIP_PLANE3);
+ _mesa_Disable(GL_CLIP_PLANE4);
+ _mesa_Disable(GL_CLIP_PLANE5);
+ if (ctx->Extensions.ARB_fragment_program && ctx->FragmentProgram.Enabled) {
+ saved_fp_enable = GL_TRUE;
+ _mesa_Disable(GL_FRAGMENT_PROGRAM_ARB);
+ }
+ if (ctx->Extensions.ARB_vertex_program && ctx->VertexProgram.Enabled) {
+ saved_vp_enable = GL_TRUE;
+ _mesa_Disable(GL_VERTEX_PROGRAM_ARB);
+ }
+ if (ctx->Extensions.ARB_shader_objects && ctx->Shader.CurrentProgram) {
+ saved_shader_program = ctx->Shader.CurrentProgram->Name;
+ _mesa_UseProgramObjectARB(0);
+ }
+
+ if (ctx->Texture._EnabledUnits != 0) {
+ int i;
+
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ _mesa_ActiveTextureARB(GL_TEXTURE0 + i);
+ _mesa_Disable(GL_TEXTURE_1D);
+ _mesa_Disable(GL_TEXTURE_2D);
+ _mesa_Disable(GL_TEXTURE_3D);
+ if (ctx->Extensions.ARB_texture_cube_map)
+ _mesa_Disable(GL_TEXTURE_CUBE_MAP_ARB);
+ if (ctx->Extensions.NV_texture_rectangle)
+ _mesa_Disable(GL_TEXTURE_RECTANGLE_NV);
+ if (ctx->Extensions.MESA_texture_array) {
+ _mesa_Disable(GL_TEXTURE_1D_ARRAY_EXT);
+ _mesa_Disable(GL_TEXTURE_2D_ARRAY_EXT);
+ }
+ }
+ }
+
+ intel_meta_set_passthrough_transform(intel);
+
+ for (i = 0; i < 4; i++) {
+ color[i][0] = ctx->Color.ClearColor[0];
+ color[i][1] = ctx->Color.ClearColor[1];
+ color[i][2] = ctx->Color.ClearColor[2];
+ color[i][3] = ctx->Color.ClearColor[3];
+ }
+
+ /* convert clear Z from [0,1] to NDC coord in [-1,1] */
+ dst_z = -1.0 + 2.0 * ctx->Depth.Clear;
+
+ /* Prepare the vertices, which are the same regardless of which buffer we're
+ * drawing to.
+ */
+ vertices[0][0] = fb->_Xmin;
+ vertices[0][1] = fb->_Ymin;
+ vertices[0][2] = dst_z;
+ vertices[1][0] = fb->_Xmax;
+ vertices[1][1] = fb->_Ymin;
+ vertices[1][2] = dst_z;
+ vertices[2][0] = fb->_Xmax;
+ vertices[2][1] = fb->_Ymax;
+ vertices[2][2] = dst_z;
+ vertices[3][0] = fb->_Xmin;
+ vertices[3][1] = fb->_Ymax;
+ vertices[3][2] = dst_z;
+
+ _mesa_ColorPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &color);
+ _mesa_VertexPointer(3, GL_FLOAT, 3 * sizeof(GLfloat), &vertices);
+ _mesa_Enable(GL_COLOR_ARRAY);
+ _mesa_Enable(GL_VERTEX_ARRAY);
+
+ while (mask != 0) {
+ GLuint this_mask = 0;
+
+ if (mask & BUFFER_BIT_BACK_LEFT)
+ this_mask = BUFFER_BIT_BACK_LEFT;
+ else if (mask & BUFFER_BIT_FRONT_LEFT)
+ this_mask = BUFFER_BIT_FRONT_LEFT;
+
+ /* Clear depth/stencil in the same pass as color. */
+ this_mask |= (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL));
+
+ /* Select the current color buffer and use the color write mask if
+ * we have one, otherwise don't write any color channels.
+ */
+ if (this_mask & BUFFER_BIT_FRONT_LEFT)
+ _mesa_DrawBuffer(GL_FRONT_LEFT);
+ else if (this_mask & BUFFER_BIT_BACK_LEFT)
+ _mesa_DrawBuffer(GL_BACK_LEFT);
+ else
+ _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+
+ /* Control writing of the depth clear value to depth. */
+ if (this_mask & BUFFER_BIT_DEPTH) {
+ _mesa_DepthFunc(GL_ALWAYS);
+ _mesa_Enable(GL_DEPTH_TEST);
+ } else {
+ _mesa_Disable(GL_DEPTH_TEST);
+ _mesa_DepthMask(GL_FALSE);
+ }
+
+ /* Control writing of the stencil clear value to stencil. */
+ if (this_mask & BUFFER_BIT_STENCIL) {
+ _mesa_Enable(GL_STENCIL_TEST);
+ _mesa_StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+ _mesa_StencilFuncSeparate(GL_FRONT, GL_ALWAYS, ctx->Stencil.Clear,
+ ctx->Stencil.WriteMask[0]);
+ } else {
+ _mesa_Disable(GL_STENCIL_TEST);
+ }
+
+ CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4));
+
+ mask &= ~this_mask;
+ }
+
+ intel_meta_restore_transform(intel);
+
+ _mesa_ActiveTextureARB(GL_TEXTURE0 + saved_active_texture);
+ if (saved_fp_enable)
+ _mesa_Enable(GL_FRAGMENT_PROGRAM_ARB);
+ if (saved_vp_enable)
+ _mesa_Enable(GL_VERTEX_PROGRAM_ARB);
+
+ if (saved_shader_program)
+ _mesa_UseProgramObjectARB(saved_shader_program);
+
+ _mesa_PopClientAttrib();
+ _mesa_PopAttrib();
+}
+
+static const char *buffer_names[] = {
+ [BUFFER_FRONT_LEFT] = "front",
+ [BUFFER_BACK_LEFT] = "back",
+ [BUFFER_FRONT_RIGHT] = "front right",
+ [BUFFER_BACK_RIGHT] = "back right",
+ [BUFFER_AUX0] = "aux0",
+ [BUFFER_AUX1] = "aux1",
+ [BUFFER_AUX2] = "aux2",
+ [BUFFER_AUX3] = "aux3",
+ [BUFFER_DEPTH] = "depth",
+ [BUFFER_STENCIL] = "stencil",
+ [BUFFER_ACCUM] = "accum",
+ [BUFFER_COLOR0] = "color0",
+ [BUFFER_COLOR1] = "color1",
+ [BUFFER_COLOR2] = "color2",
+ [BUFFER_COLOR3] = "color3",
+ [BUFFER_COLOR4] = "color4",
+ [BUFFER_COLOR5] = "color5",
+ [BUFFER_COLOR6] = "color6",
+ [BUFFER_COLOR7] = "color7",
+};
+
+/**
+ * Called by ctx->Driver.Clear.
+ */
+static void
+intelClear(GLcontext *ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
+ GLbitfield tri_mask = 0;
+ GLbitfield blit_mask = 0;
+ GLbitfield swrast_mask = 0;
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLuint i;
+
+ if (0)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ /* HW color buffers (front, back, aux, generic FBO, etc) */
+ if (colorMask == ~0) {
+ /* clear all R,G,B,A */
+ /* XXX FBO: need to check if colorbuffers are software RBOs! */
+ blit_mask |= (mask & BUFFER_BITS_COLOR);
+ }
+ else {
+ /* glColorMask in effect */
+ tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT));
+ }
+
+ /* HW stencil */
+ if (mask & BUFFER_BIT_STENCIL) {
+ const struct intel_region *stencilRegion
+ = intel_get_rb_region(fb, BUFFER_STENCIL);
+ if (stencilRegion) {
+ /* have hw stencil */
+ if (IS_965(intel->intelScreen->deviceID) ||
+ (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) {
+ /* We have to use the 3D engine if we're clearing a partial mask
+ * of the stencil buffer, or if we're on a 965 which has a tiled
+ * depth/stencil buffer in a layout we can't blit to.
+ */
+ tri_mask |= BUFFER_BIT_STENCIL;
+ }
+ else {
+ /* clearing all stencil bits, use blitting */
+ blit_mask |= BUFFER_BIT_STENCIL;
+ }
+ }
+ }
+
+ /* HW depth */
+ if (mask & BUFFER_BIT_DEPTH) {
+ /* clear depth with whatever method is used for stencil (see above) */
+ if (IS_965(intel->intelScreen->deviceID) ||
+ tri_mask & BUFFER_BIT_STENCIL)
+ tri_mask |= BUFFER_BIT_DEPTH;
+ else
+ blit_mask |= BUFFER_BIT_DEPTH;
+ }
+
+ /* If we're doing a tri pass for depth/stencil, include a likely color
+ * buffer with it.
+ */
+ if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) {
+ tri_mask |= blit_mask & BUFFER_BIT_BACK_LEFT;
+ blit_mask &= ~BUFFER_BIT_BACK_LEFT;
+ }
+
+ /* SW fallback clearing */
+ swrast_mask = mask & ~tri_mask & ~blit_mask;
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ GLuint bufBit = 1 << i;
+ if ((blit_mask | tri_mask) & bufBit) {
+ if (!fb->Attachment[i].Renderbuffer->ClassID) {
+ blit_mask &= ~bufBit;
+ tri_mask &= ~bufBit;
+ swrast_mask |= bufBit;
+ }
+ }
+ }
+
+ if (blit_mask) {
+ if (INTEL_DEBUG & DEBUG_BLIT) {
+ DBG("blit clear:");
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (blit_mask & (1 << i))
+ DBG(" %s", buffer_names[i]);
+ }
+ DBG("\n");
+ }
+ intelClearWithBlit(ctx, blit_mask);
+ }
+
+ if (tri_mask) {
+ if (INTEL_DEBUG & DEBUG_BLIT) {
+ DBG("tri clear:");
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (tri_mask & (1 << i))
+ DBG(" %s", buffer_names[i]);
+ }
+ DBG("\n");
+ }
+ intel_clear_tris(ctx, tri_mask);
+ }
+
+ if (swrast_mask) {
+ if (INTEL_DEBUG & DEBUG_BLIT) {
+ DBG("swrast clear:");
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (swrast_mask & (1 << i))
+ DBG(" %s", buffer_names[i]);
+ }
+ DBG("\n");
+ }
+ _swrast_Clear(ctx, swrast_mask);
+ }
+}
+
+
+void
+intelInitClearFuncs(struct dd_function_table *functions)
+{
+ functions->Clear = intelClear;
+}
diff --git a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h b/src/mesa/drivers/dri/intel/intel_clear.h
index 5fa14cb749..7fd6b310a9 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h
+++ b/src/mesa/drivers/dri/intel/intel_clear.h
@@ -1,8 +1,9 @@
+
/**************************************************************************
- *
+ *
* Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +11,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,18 +23,16 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
-#ifndef INTEL_SOFTPIPE_H
-#define INTEL_SOFTPIPE_H
+#ifndef INTEL_CLEAR_H
+#define INTEL_CLEAR_H
+
+struct dd_function_table;
-struct pipe_winsys;
-struct pipe_context;
-struct intel_context;
+extern void
+intelInitClearFuncs(struct dd_function_table *functions);
-struct pipe_context *
-intel_create_softpipe( struct intel_context *intel,
- struct pipe_winsys *winsys );
-#endif
+#endif /* INTEL_CLEAR_H */
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index c4a24d7397..d7ccfa0605 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -28,8 +28,6 @@
#include "main/glheader.h"
#include "main/context.h"
-#include "main/matrix.h"
-#include "main/simple_list.h"
#include "main/extensions.h"
#include "main/framebuffer.h"
#include "main/imports.h"
@@ -38,66 +36,40 @@
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-
-#include "tnl/t_pipeline.h"
-#include "tnl/t_vertex.h"
-
#include "drivers/common/driverfuncs.h"
-#include "intel_screen.h"
-
#include "i830_dri.h"
#include "intel_chipset.h"
#include "intel_buffers.h"
#include "intel_tex.h"
#include "intel_batchbuffer.h"
-#include "intel_blit.h"
+#include "intel_clear.h"
+#include "intel_extensions.h"
#include "intel_pixel.h"
#include "intel_regions.h"
#include "intel_buffer_objects.h"
#include "intel_fbo.h"
#include "intel_decode.h"
#include "intel_bufmgr.h"
+#include "intel_screen.h"
+#include "intel_swapbuffers.h"
#include "drirenderbuffer.h"
#include "vblank.h"
#include "utils.h"
#include "xmlpool.h" /* for symbolic values of enum-type options */
+
+
#ifndef INTEL_DEBUG
int INTEL_DEBUG = (0);
#endif
-#define need_GL_ARB_multisample
-#define need_GL_ARB_occlusion_query
-#define need_GL_ARB_point_parameters
-#define need_GL_ARB_shader_objects
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
-#define need_GL_ARB_vertex_program
-#define need_GL_ARB_vertex_shader
-#define need_GL_ARB_window_pos
-#define need_GL_EXT_blend_color
-#define need_GL_EXT_blend_equation_separate
-#define need_GL_EXT_blend_func_separate
-#define need_GL_EXT_blend_minmax
-#define need_GL_EXT_cull_vertex
-#define need_GL_EXT_fog_coord
-#define need_GL_EXT_framebuffer_object
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_point_parameters
-#define need_GL_EXT_secondary_color
-#define need_GL_ATI_separate_stencil
-#define need_GL_NV_point_sprite
-#define need_GL_NV_vertex_program
-#define need_GL_VERSION_2_0
-#define need_GL_VERSION_2_1
-
-#include "extension_helper.h"
#define DRIVER_DATE "20090114"
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
+
static const GLubyte *
intelGetString(GLcontext * ctx, GLenum name)
{
@@ -282,6 +254,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
return;
}
+ if (rb == NULL)
+ continue;
+
if (rb->region) {
dri_bo_flink(rb->region->buffer, &name);
if (name == buffers[i].name)
@@ -340,112 +315,6 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
ctx->Driver.Viewport = old_viewport;
}
-/**
- * Extension strings exported by the intel driver.
- *
- * Extensions supported by all chips supported by i830_dri, i915_dri, or
- * i965_dri.
- */
-static const struct dri_extension card_extensions[] = {
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_multitexture", NULL },
- { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
- { "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_texture_cube_map", NULL },
- { "GL_ARB_texture_env_add", NULL },
- { "GL_ARB_texture_env_combine", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { "GL_ARB_texture_env_dot3", NULL },
- { "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_texture_rectangle", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
- { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
- { "GL_ARB_window_pos", GL_ARB_window_pos_functions },
- { "GL_EXT_blend_color", GL_EXT_blend_color_functions },
- { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
- { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
- { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
- { "GL_EXT_blend_logic_op", NULL },
- { "GL_EXT_blend_subtract", NULL },
- { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
- { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
- { "GL_EXT_packed_depth_stencil", NULL },
- { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
- { "GL_EXT_stencil_wrap", NULL },
- { "GL_EXT_texture_edge_clamp", NULL },
- { "GL_EXT_texture_env_combine", NULL },
- { "GL_EXT_texture_env_dot3", NULL },
- { "GL_EXT_texture_filter_anisotropic", NULL },
- { "GL_EXT_texture_lod_bias", NULL },
- { "GL_3DFX_texture_compression_FXT1", NULL },
- { "GL_APPLE_client_storage", NULL },
- { "GL_MESA_pack_invert", NULL },
- { "GL_MESA_ycbcr_texture", NULL },
- { "GL_NV_blend_square", NULL },
- { "GL_NV_point_sprite", GL_NV_point_sprite_functions },
- { "GL_NV_vertex_program", GL_NV_vertex_program_functions },
- { "GL_NV_vertex_program1_1", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_extension brw_extensions[] = {
- { "GL_ARB_depth_texture", NULL },
- { "GL_ARB_draw_buffers", NULL },
- { "GL_ARB_fragment_program", NULL },
- { "GL_ARB_fragment_program_shadow", NULL },
- { "GL_ARB_fragment_shader", NULL },
- { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
- { "GL_ARB_point_sprite", NULL },
- { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
- { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
-#if 0
- /* Support for GLSL 1.20 is currently broken in core Mesa.
- */
- { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
-#endif
- { "GL_ARB_shadow", NULL },
- { "GL_ARB_texture_non_power_of_two", NULL },
- { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions },
- { "GL_EXT_shadow_funcs", NULL },
- { "GL_EXT_texture_sRGB", NULL },
- { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions },
- { "GL_ATI_texture_env_combine3", NULL },
- { NULL, NULL }
-};
-
-static const struct dri_extension arb_oq_extensions[] = {
- { NULL, NULL }
-};
-
-static const struct dri_extension ttm_extensions[] = {
- { "GL_ARB_pixel_buffer_object", NULL },
- { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
- { NULL, NULL }
-};
-
-/**
- * Initializes potential list of extensions if ctx == NULL, or actually enables
- * extensions for a context.
- */
-void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
-{
- struct intel_context *intel = ctx?intel_context(ctx):NULL;
-
- /* Disable imaging extension until convolution is working in teximage paths.
- */
- enable_imaging = GL_FALSE;
-
- driInitExtensions(ctx, card_extensions, enable_imaging);
-
- if (intel == NULL || intel->ttm)
- driInitExtensions(ctx, ttm_extensions, GL_FALSE);
-
- if (intel == NULL || IS_965(intel->intelScreen->deviceID))
- driInitExtensions(ctx, brw_extensions, GL_FALSE);
-}
static const struct dri_debug_control debug_control[] = {
{ "tex", DEBUG_TEXTURE},
@@ -496,9 +365,8 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state)
intel->vtbl.invalidate_state( intel, new_state );
}
-
-void
-intelFlush(GLcontext * ctx)
+static void
+intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
{
struct intel_context *intel = intel_context(ctx);
@@ -512,13 +380,26 @@ intelFlush(GLcontext * ctx)
* lands onscreen in a timely manner, even if the X Server doesn't trigger
* a flush for us.
*/
- intel_batchbuffer_emit_mi_flush(intel->batch);
+ if (needs_mi_flush)
+ intel_batchbuffer_emit_mi_flush(intel->batch);
if (intel->batch->map != intel->batch->ptr)
intel_batchbuffer_flush(intel->batch);
}
void
+intelFlush(GLcontext * ctx)
+{
+ intel_flush(ctx, GL_FALSE);
+}
+
+static void
+intel_glFlush(GLcontext *ctx)
+{
+ intel_flush(ctx, GL_TRUE);
+}
+
+void
intelFinish(GLcontext * ctx)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -544,7 +425,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
{
_mesa_init_driver_functions(functions);
- functions->Flush = intelFlush;
+ functions->Flush = intel_glFlush;
functions->Finish = intelFinish;
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;
@@ -556,6 +437,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
intelInitTextureFuncs(functions);
intelInitStateFuncs(functions);
+ intelInitClearFuncs(functions);
intelInitBufferFuncs(functions);
intelInitPixelFuncs(functions);
}
@@ -858,6 +740,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
+ /* Prevent error printf if one crtc is disabled, this will
+ * be properly calculated in intelWindowMoved() next.
+ */
+ driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
+
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv);
intel_fb->vbl_waited = driDrawPriv->vblSeq;
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 348da347dd..18dc43c4a4 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -210,7 +210,6 @@ struct intel_context
char *prevLockFile;
int prevLockLine;
- GLubyte clear_chan[4];
GLuint ClearColor565;
GLuint ClearColor8888;
@@ -438,7 +437,6 @@ extern void intelFinish(GLcontext * ctx);
extern void intelFlush(GLcontext * ctx);
extern void intelInitDriverFunctions(struct dd_function_table *functions);
-extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging);
/* ================================================================
diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c
index 5f90ca22ec..136221c37f 100644
--- a/src/mesa/drivers/dri/intel/intel_decode.c
+++ b/src/mesa/drivers/dri/intel/intel_decode.c
@@ -87,27 +87,28 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
struct {
uint32_t opcode;
+ int len_mask;
int min_len;
int max_len;
char *name;
} opcodes_mi[] = {
- { 0x08, 1, 1, "MI_ARB_ON_OFF" },
- { 0x0a, 1, 1, "MI_BATCH_BUFFER_END" },
- { 0x31, 2, 2, "MI_BATCH_BUFFER_START" },
- { 0x14, 3, 3, "MI_DISPLAY_BUFFER_INFO" },
- { 0x04, 1, 1, "MI_FLUSH" },
- { 0x22, 3, 3, "MI_LOAD_REGISTER_IMM" },
- { 0x13, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" },
- { 0x12, 2, 2, "MI_LOAD_SCAN_LINES_INCL" },
- { 0x00, 1, 1, "MI_NOOP" },
- { 0x11, 2, 2, "MI_OVERLAY_FLIP" },
- { 0x07, 1, 1, "MI_REPORT_HEAD" },
- { 0x18, 2, 2, "MI_SET_CONTEXT" },
- { 0x20, 3, 4, "MI_STORE_DATA_IMM" },
- { 0x21, 3, 4, "MI_STORE_DATA_INDEX" },
- { 0x24, 3, 3, "MI_STORE_REGISTER_MEM" },
- { 0x02, 1, 1, "MI_USER_INTERRUPT" },
- { 0x03, 1, 1, "MI_WAIT_FOR_EVENT" },
+ { 0x08, 0, 1, 1, "MI_ARB_ON_OFF" },
+ { 0x0a, 0, 1, 1, "MI_BATCH_BUFFER_END" },
+ { 0x31, 0x3f, 2, 2, "MI_BATCH_BUFFER_START" },
+ { 0x14, 0x3f, 3, 3, "MI_DISPLAY_BUFFER_INFO" },
+ { 0x04, 0, 1, 1, "MI_FLUSH" },
+ { 0x22, 0, 3, 3, "MI_LOAD_REGISTER_IMM" },
+ { 0x13, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" },
+ { 0x12, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_INCL" },
+ { 0x00, 0, 1, 1, "MI_NOOP" },
+ { 0x11, 0x3f, 2, 2, "MI_OVERLAY_FLIP" },
+ { 0x07, 0, 1, 1, "MI_REPORT_HEAD" },
+ { 0x18, 0x3f, 2, 2, "MI_SET_CONTEXT" },
+ { 0x20, 0x3f, 3, 4, "MI_STORE_DATA_IMM" },
+ { 0x21, 0x3f, 3, 4, "MI_STORE_DATA_INDEX" },
+ { 0x24, 0x3f, 3, 3, "MI_STORE_REGISTER_MEM" },
+ { 0x02, 0, 1, 1, "MI_USER_INTERRUPT" },
+ { 0x03, 0, 1, 1, "MI_WAIT_FOR_EVENT" },
};
@@ -118,12 +119,14 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
instr_out(data, hw_offset, 0, "%s\n", opcodes_mi[opcode].name);
if (opcodes_mi[opcode].max_len > 1) {
- len = (data[0] & 0x000000ff) + 2;
+ len = (data[0] & opcodes_mi[opcode].len_mask) + 2;
if (len < opcodes_mi[opcode].min_len ||
len > opcodes_mi[opcode].max_len)
{
- fprintf(out, "Bad length in %s\n",
- opcodes_mi[opcode].name);
+ fprintf(out, "Bad length (%d) in %s, [%d, %d]\n",
+ len, opcodes_mi[opcode].name,
+ opcodes_mi[opcode].min_len,
+ opcodes_mi[opcode].max_len);
}
}
@@ -932,7 +935,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i
instr_out(data, hw_offset, 0, "3DSTATE_PIXEL_SHADER_CONSTANTS\n");
len = (data[0] & 0x000000ff) + 2;
- i = 1;
+ i = 2;
for (c = 0; c <= 31; c++) {
if (data[1] & (1 << c)) {
if (i + 4 >= count)
@@ -952,7 +955,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i
}
}
if (len != i) {
- fprintf(out, "Bad count in 3DSTATE_MAP_STATE\n");
+ fprintf(out, "Bad count in 3DSTATE_PIXEL_SHADER_CONSTANTS\n");
(*failures)++;
}
return len;
diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.c b/src/mesa/drivers/dri/intel/intel_depthstencil.c
deleted file mode 100644
index 354b3bf0d7..0000000000
--- a/src/mesa/drivers/dri/intel/intel_depthstencil.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/context.h"
-#include "main/depthstencil.h"
-#include "main/fbobject.h"
-#include "main/framebuffer.h"
-#include "main/hash.h"
-#include "main/mtypes.h"
-#include "main/renderbuffer.h"
-
-#include "intel_context.h"
-#include "intel_fbo.h"
-#include "intel_depthstencil.h"
-#include "intel_regions.h"
-#include "intel_span.h"
-
-/**
- * The GL_EXT_framebuffer_object allows the user to create their own
- * framebuffer objects consisting of color renderbuffers (0 or more),
- * depth renderbuffers (0 or 1) and stencil renderbuffers (0 or 1).
- *
- * The spec considers depth and stencil renderbuffers to be totally independent
- * buffers. In reality, most graphics hardware today uses a combined
- * depth+stencil buffer (one 32-bit pixel = 24 bits of Z + 8 bits of stencil).
- *
- * This causes difficulty because the user may create some number of depth
- * renderbuffers and some number of stencil renderbuffers and bind them
- * together in framebuffers in any combination.
- *
- * This code manages all that.
- *
- * 1. Depth renderbuffers are always allocated in hardware as 32bpp
- * GL_DEPTH24_STENCIL8 buffers.
- *
- * 2. Stencil renderbuffers are initially allocated in software as 8bpp
- * GL_STENCIL_INDEX8 buffers.
- *
- * 3. Depth and Stencil renderbuffers use the PairedStencil and PairedDepth
- * fields (respectively) to indicate if the buffer's currently paired
- * with another stencil or depth buffer (respectively).
- *
- * 4. When a depth and stencil buffer are initially both attached to the
- * current framebuffer, we merge the stencil buffer values into the
- * depth buffer (really a depth+stencil buffer). The then hardware uses
- * the combined buffer.
- *
- * 5. Whenever a depth or stencil buffer is reallocated (with
- * glRenderbufferStorage) we undo the pairing and copy the stencil values
- * from the combined depth/stencil buffer back to the stencil-only buffer.
- *
- * 6. We also undo the pairing when we find a change in buffer bindings.
- *
- * 7. If a framebuffer is only using a depth renderbuffer (no stencil), we
- * just use the combined depth/stencil buffer and ignore the stencil values.
- *
- * 8. If a framebuffer is only using a stencil renderbuffer (no depth) we have
- * to promote the 8bpp software stencil buffer to a 32bpp hardware
- * depth+stencil buffer.
- *
- */
-
-/**
- * Undo the pairing/interleaving between depth and stencil buffers.
- * irb should be a depth/stencil or stencil renderbuffer.
- */
-void
-intel_unpair_depth_stencil(GLcontext *ctx, struct intel_renderbuffer *irb)
-{
- struct intel_context *intel = intel_context(ctx);
- struct gl_renderbuffer *rb = &irb->Base;
-
- if (irb->PairedStencil) {
- /* irb is a depth/stencil buffer */
- struct gl_renderbuffer *stencilRb;
- struct intel_renderbuffer *stencilIrb;
-
- ASSERT(rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT);
-
- stencilRb = _mesa_lookup_renderbuffer(ctx, irb->PairedStencil);
- stencilIrb = intel_renderbuffer(stencilRb);
- if (stencilIrb) {
- /* need to extract stencil values from the depth buffer */
- ASSERT(stencilIrb->PairedDepth == rb->Name);
- intel_renderbuffer_map(intel, rb);
- intel_renderbuffer_map(intel, stencilRb);
-#if 0
- /* disable for now */
- _mesa_extract_stencil(ctx, rb, stencilRb);
-#endif
- intel_renderbuffer_unmap(intel, stencilRb);
- intel_renderbuffer_unmap(intel, rb);
- stencilIrb->PairedDepth = 0;
- }
- irb->PairedStencil = 0;
- }
- else if (irb->PairedDepth) {
- /* irb is a stencil buffer */
- struct gl_renderbuffer *depthRb;
- struct intel_renderbuffer *depthIrb;
-
- ASSERT(rb->_ActualFormat == GL_STENCIL_INDEX8_EXT ||
- rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT);
-
- depthRb = _mesa_lookup_renderbuffer(ctx, irb->PairedDepth);
- depthIrb = intel_renderbuffer(depthRb);
- if (depthIrb) {
- /* need to extract stencil values from the depth buffer */
- ASSERT(depthIrb->PairedStencil == rb->Name);
- intel_renderbuffer_map(intel, rb);
- intel_renderbuffer_map(intel, depthRb);
-#if 0
- /* disable for now */
- _mesa_extract_stencil(ctx, depthRb, rb);
-#endif
- intel_renderbuffer_unmap(intel, depthRb);
- intel_renderbuffer_unmap(intel, rb);
- depthIrb->PairedStencil = 0;
- }
- irb->PairedDepth = 0;
- }
- else {
- _mesa_problem(ctx, "Problem in undo_depth_stencil_pairing");
- }
-
- ASSERT(irb->PairedStencil == 0);
- ASSERT(irb->PairedDepth == 0);
-}
-
-
-/**
- * Examine the depth and stencil renderbuffers which are attached to the
- * framebuffer. If both depth and stencil are attached, make sure that the
- * renderbuffers are 'paired' (combined). If only depth or only stencil is
- * attached, undo any previous pairing.
- *
- * Must be called if NewState & _NEW_BUFFER (when renderbuffer attachments
- * change, for example).
- */
-void
-intel_validate_paired_depth_stencil(GLcontext * ctx,
- struct gl_framebuffer *fb)
-{
- struct intel_context *intel = intel_context(ctx);
- struct intel_renderbuffer *depthRb, *stencilRb;
-
- depthRb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
- stencilRb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
-
- if (depthRb && stencilRb) {
- if (depthRb == stencilRb) {
- /* Using a user-created combined depth/stencil buffer.
- * Nothing to do.
- */
- ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_STENCIL_EXT);
- ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
- }
- else {
- /* Separate depth/stencil buffers, need to interleave now */
- ASSERT(depthRb->Base._BaseFormat == GL_DEPTH_COMPONENT ||
- depthRb->Base._BaseFormat == GL_DEPTH_STENCIL);
- ASSERT(stencilRb->Base._BaseFormat == GL_STENCIL_INDEX ||
- stencilRb->Base._BaseFormat == GL_DEPTH_STENCIL);
-
- /* may need to interleave depth/stencil now */
- if (depthRb->PairedStencil == stencilRb->Base.Name) {
- /* OK, the depth and stencil buffers are already interleaved */
- ASSERT(stencilRb->PairedDepth == depthRb->Base.Name);
- }
- else {
- /* need to setup new pairing/interleaving */
- if (depthRb->PairedStencil) {
- intel_unpair_depth_stencil(ctx, depthRb);
- }
- if (stencilRb->PairedDepth) {
- intel_unpair_depth_stencil(ctx, stencilRb);
- }
-
- ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
- ASSERT(stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT ||
- stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
-
- /* establish new pairing: interleave stencil into depth buffer */
- intel_renderbuffer_map(intel, &depthRb->Base);
- intel_renderbuffer_map(intel, &stencilRb->Base);
- _mesa_insert_stencil(ctx, &depthRb->Base, &stencilRb->Base);
- intel_renderbuffer_unmap(intel, &stencilRb->Base);
- intel_renderbuffer_unmap(intel, &depthRb->Base);
- depthRb->PairedStencil = stencilRb->Base.Name;
- stencilRb->PairedDepth = depthRb->Base.Name;
- }
-
- }
- }
- else if (depthRb) {
- /* Depth buffer but no stencil buffer.
- * We'll use a GL_DEPTH24_STENCIL8 buffer and ignore the stencil bits.
- */
- /* can't assert this until storage is allocated:
- ASSERT(depthRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
- */
- /* intel_undo any previous pairing */
- if (depthRb->PairedStencil) {
- intel_unpair_depth_stencil(ctx, depthRb);
- }
- }
- else if (stencilRb) {
- /* Stencil buffer but no depth buffer.
- * Since h/w doesn't typically support just 8bpp stencil w/out Z,
- * we'll use a GL_DEPTH24_STENCIL8 buffer and ignore the depth bits.
- */
- /* undo any previous pairing */
- if (stencilRb->PairedDepth) {
- intel_unpair_depth_stencil(ctx, stencilRb);
- }
- if (stencilRb->Base._ActualFormat == GL_STENCIL_INDEX8_EXT) {
- /* promote buffer to GL_DEPTH24_STENCIL8 for hw rendering */
- _mesa_promote_stencil(ctx, &stencilRb->Base);
- ASSERT(stencilRb->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT);
- }
- }
-
- /* Finally, update the fb->_DepthBuffer and fb->_StencilBuffer fields */
- _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
- if (depthRb && depthRb->PairedStencil)
- _mesa_update_stencil_buffer(ctx, fb, BUFFER_DEPTH);
- else
- _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
-
-
- /* The hardware should use fb->Attachment[BUFFER_DEPTH].Renderbuffer
- * first, if present, then fb->Attachment[BUFFER_STENCIL].Renderbuffer
- * if present.
- */
-}
diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.h b/src/mesa/drivers/dri/intel/intel_depthstencil.h
deleted file mode 100644
index 740eb0d989..0000000000
--- a/src/mesa/drivers/dri/intel/intel_depthstencil.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-#ifndef INTEL_DEPTH_STENCIL_H
-#define INTEL_DEPTH_STENCIL_H
-
-#include "intel_fbo.h"
-
-extern void
-intel_unpair_depth_stencil(GLcontext * ctx, struct intel_renderbuffer *irb);
-
-extern void
-intel_validate_paired_depth_stencil(GLcontext * ctx,
- struct gl_framebuffer *fb);
-
-
-#endif /* INTEL_DEPTH_STENCIL_H */
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
new file mode 100644
index 0000000000..9058e48bc5
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -0,0 +1,185 @@
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_chipset.h"
+#include "intel_context.h"
+#include "intel_extensions.h"
+
+
+#define need_GL_ARB_framebuffer_object
+#define need_GL_ARB_occlusion_query
+#define need_GL_ARB_point_parameters
+#define need_GL_ARB_shader_objects
+#define need_GL_ARB_vertex_program
+#define need_GL_ARB_vertex_shader
+#define need_GL_ARB_window_pos
+#define need_GL_EXT_blend_color
+#define need_GL_EXT_blend_equation_separate
+#define need_GL_EXT_blend_func_separate
+#define need_GL_EXT_blend_minmax
+#define need_GL_EXT_cull_vertex
+#define need_GL_EXT_fog_coord
+#define need_GL_EXT_framebuffer_object
+#define need_GL_EXT_framebuffer_blit
+#define need_GL_EXT_point_parameters
+#define need_GL_EXT_secondary_color
+#define need_GL_EXT_stencil_two_side
+#define need_GL_ATI_separate_stencil
+#define need_GL_NV_point_sprite
+#define need_GL_NV_vertex_program
+#define need_GL_VERSION_2_0
+#define need_GL_VERSION_2_1
+
+#include "extension_helper.h"
+
+
+/**
+ * Extension strings exported by the intel driver.
+ *
+ * Extensions supported by all chips supported by i830_dri, i915_dri, or
+ * i965_dri.
+ */
+static const struct dri_extension card_extensions[] = {
+ { "GL_ARB_multitexture", NULL },
+ { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
+ { "GL_ARB_texture_border_clamp", NULL },
+ { "GL_ARB_texture_cube_map", NULL },
+ { "GL_ARB_texture_env_add", NULL },
+ { "GL_ARB_texture_env_combine", NULL },
+ { "GL_ARB_texture_env_crossbar", NULL },
+ { "GL_ARB_texture_env_dot3", NULL },
+ { "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_texture_rectangle", NULL },
+ { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
+ { "GL_ARB_window_pos", GL_ARB_window_pos_functions },
+ { "GL_EXT_blend_color", GL_EXT_blend_color_functions },
+ { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
+ { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
+ { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
+ { "GL_EXT_blend_logic_op", NULL },
+ { "GL_EXT_blend_subtract", NULL },
+ { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
+ { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
+ { "GL_EXT_packed_depth_stencil", NULL },
+ { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
+ { "GL_EXT_stencil_wrap", NULL },
+ { "GL_EXT_texture_edge_clamp", NULL },
+ { "GL_EXT_texture_env_combine", NULL },
+ { "GL_EXT_texture_env_dot3", NULL },
+ { "GL_EXT_texture_filter_anisotropic", NULL },
+ { "GL_EXT_texture_lod_bias", NULL },
+ { "GL_3DFX_texture_compression_FXT1", NULL },
+ { "GL_APPLE_client_storage", NULL },
+ { "GL_MESA_pack_invert", NULL },
+ { "GL_MESA_ycbcr_texture", NULL },
+ { "GL_NV_blend_square", NULL },
+ { "GL_NV_point_sprite", GL_NV_point_sprite_functions },
+ { "GL_NV_vertex_program", GL_NV_vertex_program_functions },
+ { "GL_NV_vertex_program1_1", NULL },
+ { "GL_SGIS_generate_mipmap", NULL },
+ { NULL, NULL }
+};
+
+
+/** i915 / i945-only extensions */
+static const struct dri_extension i915_extensions[] = {
+ { "GL_ARB_depth_texture", NULL },
+ { "GL_ARB_fragment_program", NULL },
+ { "GL_ARB_shadow", NULL },
+ { "GL_ARB_texture_non_power_of_two", NULL },
+ { "GL_ATI_texture_env_combine3", NULL },
+ { "GL_EXT_shadow_funcs", NULL },
+ { "GL_NV_texture_env_combine4", NULL },
+ { NULL, NULL }
+};
+
+
+/** i965-only extensions */
+static const struct dri_extension brw_extensions[] = {
+ { "GL_ARB_depth_texture", NULL },
+ { "GL_ARB_fragment_program", NULL },
+ { "GL_ARB_fragment_program_shadow", NULL },
+ { "GL_ARB_fragment_shader", NULL },
+ { "GL_ARB_framebuffer_object", GL_ARB_framebuffer_object_functions},
+ { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
+ { "GL_ARB_point_sprite", NULL },
+ { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
+ { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
+ { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions },
+ { "GL_ARB_shadow", NULL },
+ { "GL_ARB_texture_non_power_of_two", NULL },
+ { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions },
+ { "GL_EXT_shadow_funcs", NULL },
+ { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions },
+ { "GL_EXT_texture_sRGB", NULL },
+ { "GL_EXT_texture_swizzle", NULL },
+ { "GL_EXT_vertex_array_bgra", NULL },
+ { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions },
+ { "GL_ATI_texture_env_combine3", NULL },
+ { "GL_NV_texture_env_combine4", NULL },
+ { NULL, NULL }
+};
+
+
+static const struct dri_extension arb_oq_extensions[] = {
+ { NULL, NULL }
+};
+
+
+static const struct dri_extension ttm_extensions[] = {
+ { "GL_ARB_pixel_buffer_object", NULL },
+ { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
+ { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
+ { NULL, NULL }
+};
+
+
+/**
+ * Initializes potential list of extensions if ctx == NULL, or actually enables
+ * extensions for a context.
+ */
+void
+intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
+{
+ struct intel_context *intel = ctx?intel_context(ctx):NULL;
+
+ /* Disable imaging extension until convolution is working in teximage paths.
+ */
+ enable_imaging = GL_FALSE;
+
+ driInitExtensions(ctx, card_extensions, enable_imaging);
+
+ if (intel == NULL || intel->ttm)
+ driInitExtensions(ctx, ttm_extensions, GL_FALSE);
+
+ if (intel == NULL || IS_965(intel->intelScreen->deviceID))
+ driInitExtensions(ctx, brw_extensions, GL_FALSE);
+
+ if (intel == NULL || IS_915(intel->intelScreen->deviceID)
+ || IS_945(intel->intelScreen->deviceID))
+ driInitExtensions(ctx, i915_extensions, GL_FALSE);
+}
diff --git a/src/gallium/winsys/drm/intel/dri/intel_reg.h b/src/mesa/drivers/dri/intel/intel_extensions.h
index 4f33bee438..97147ecdb0 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_reg.h
+++ b/src/mesa/drivers/dri/intel/intel_extensions.h
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,32 +22,15 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
+#ifndef INTEL_EXTENSIONS_H
+#define INTEL_EXTENSIONS_H
-#ifndef _INTEL_REG_H_
-#define _INTEL_REG_H_
-
-#define BR00_BITBLT_CLIENT 0x40000000
-#define BR00_OP_COLOR_BLT 0x10000000
-#define BR00_OP_SRC_COPY_BLT 0x10C00000
-#define BR13_SOLID_PATTERN 0x80000000
-
-#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|0x4)
-#define XY_COLOR_BLT_WRITE_ALPHA (1<<21)
-#define XY_COLOR_BLT_WRITE_RGB (1<<20)
-
-#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6)
-#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
-#define XY_SRC_COPY_BLT_WRITE_RGB (1<<20)
-
-#define MI_WAIT_FOR_EVENT ((0x3<<23))
-#define MI_WAIT_FOR_PLANE_B_FLIP (1<<6)
-#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2)
-
-#define MI_BATCH_BUFFER_END (0xA<<23)
+extern void
+intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging);
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 7cf12619d6..54d6044ad3 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -27,6 +27,7 @@
#include "main/imports.h"
+#include "main/macros.h"
#include "main/mtypes.h"
#include "main/fbobject.h"
#include "main/framebuffer.h"
@@ -37,58 +38,13 @@
#include "intel_context.h"
#include "intel_buffers.h"
-#include "intel_depthstencil.h"
#include "intel_fbo.h"
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
-#include "intel_span.h"
#define FILE_DEBUG_FLAG DEBUG_FBO
-#define INTEL_RB_CLASS 0x12345678
-
-
-/* XXX FBO: move this to intel_context.h (inlined) */
-/**
- * Return a gl_renderbuffer ptr casted to intel_renderbuffer.
- * NULL will be returned if the rb isn't really an intel_renderbuffer.
- * This is determiend by checking the ClassID.
- */
-struct intel_renderbuffer *
-intel_renderbuffer(struct gl_renderbuffer *rb)
-{
- struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb;
- if (irb && irb->Base.ClassID == INTEL_RB_CLASS) {
- /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/
- return irb;
- }
- else
- return NULL;
-}
-
-
-struct intel_renderbuffer *
-intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex)
-{
- if (attIndex >= 0)
- return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
- else
- return NULL;
-}
-
-struct intel_region *
-intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
-{
- struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
-
- if (irb)
- return irb->region;
- else
- return NULL;
-}
-
-
/**
* Create a new framebuffer object.
@@ -103,6 +59,7 @@ intel_new_framebuffer(GLcontext * ctx, GLuint name)
}
+/** Called by gl_renderbuffer::Delete() */
static void
intel_delete_renderbuffer(struct gl_renderbuffer *rb)
{
@@ -112,10 +69,6 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb)
ASSERT(irb);
- if (irb->PairedStencil || irb->PairedDepth) {
- intel_unpair_depth_stencil(ctx, irb);
- }
-
if (irb->span_cache != NULL)
_mesa_free(irb->span_cache);
@@ -127,7 +80,6 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb)
}
-
/**
* Return a pointer to a specific pixel in a renderbuffer.
*/
@@ -142,7 +94,6 @@ intel_get_pointer(GLcontext * ctx, struct gl_renderbuffer *rb,
}
-
/**
* Called via glRenderbufferStorageEXT() to set the format and allocate
* storage for a user-created renderbuffer.
@@ -211,18 +162,11 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
cpp = 4;
break;
case GL_DEPTH_COMPONENT16:
-#if 0
rb->_ActualFormat = GL_DEPTH_COMPONENT16;
rb->DataType = GL_UNSIGNED_SHORT;
rb->DepthBits = 16;
cpp = 2;
break;
-#else
- /* fall-through.
- * 16bpp depth renderbuffer can't be paired with a stencil buffer so
- * always used combined depth/stencil format.
- */
-#endif
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
@@ -280,7 +224,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
}
-
/**
* Called for each hardware renderbuffer when a _window_ is resized.
* Just update fields.
@@ -298,6 +241,7 @@ intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
return GL_TRUE;
}
+
static void
intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
GLuint width, GLuint height)
@@ -324,6 +268,8 @@ intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
}
}
+
+/** Dummy function for gl_renderbuffer::AllocStorage() */
static GLboolean
intel_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
@@ -343,10 +289,9 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb,
rb->region = NULL;
intel_region_reference(&rb->region, region);
intel_region_release(&old);
-
- rb->pfPitch = region->pitch;
}
+
/**
* Create a new intel_renderbuffer which corresponds to an on-screen window,
* not a user-created renderbuffer.
@@ -466,9 +411,6 @@ intel_bind_framebuffer(GLcontext * ctx, GLenum target,
{
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
intel_draw_buffer(ctx, fb);
- /* Integer depth range depends on depth buffer bits */
- if (ctx->Driver.DepthRange != NULL)
- ctx->Driver.DepthRange(ctx, ctx->Viewport.Near, ctx->Viewport.Far);
}
else {
/* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
@@ -492,6 +434,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx,
intel_draw_buffer(ctx, fb);
}
+
static GLboolean
intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
struct gl_texture_image *texImage)
@@ -538,11 +481,10 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
irb->Base.Delete = intel_delete_renderbuffer;
irb->Base.AllocStorage = intel_nop_alloc_storage;
- irb->RenderToTexture = GL_TRUE;
-
return GL_TRUE;
}
+
/**
* When glFramebufferTexture[123]D is called this function sets up the
* gl_renderbuffer wrapper around the texture image.
@@ -551,7 +493,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
static struct intel_renderbuffer *
intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
{
- const GLuint name = ~0; /* not significant, but distinct for debugging */
+ const GLuint name = ~0; /* not significant, but distinct for debugging */
struct intel_renderbuffer *irb;
/* make an intel_renderbuffer to wrap the texture image */
@@ -598,10 +540,11 @@ intel_render_texture(GLcontext * ctx,
/* Fallback on drawing to a texture with a border, which won't have a
* miptree.
*/
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
- _mesa_render_texture(ctx, fb, att);
- return;
- } else if (!irb) {
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _mesa_render_texture(ctx, fb, att);
+ return;
+ }
+ else if (!irb) {
irb = intel_wrap_texture(ctx, newImage);
if (irb) {
/* bind the wrapper to the attachment point */
@@ -612,7 +555,9 @@ intel_render_texture(GLcontext * ctx,
_mesa_render_texture(ctx, fb, att);
return;
}
- } if (!intel_update_wrapper(ctx, irb, newImage)) {
+ }
+
+ if (!intel_update_wrapper(ctx, irb, newImage)) {
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
_mesa_render_texture(ctx, fb, att);
return;
@@ -674,6 +619,94 @@ intel_finish_render_texture(GLcontext * ctx,
/**
+ * Do additional "completeness" testing of a framebuffer object.
+ */
+static void
+intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
+{
+ const struct intel_renderbuffer *depthRb =
+ intel_get_renderbuffer(fb, BUFFER_DEPTH);
+ const struct intel_renderbuffer *stencilRb =
+ intel_get_renderbuffer(fb, BUFFER_STENCIL);
+
+ if (stencilRb && stencilRb != depthRb) {
+ /* we only support combined depth/stencil buffers, not separate
+ * stencil buffers.
+ */
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+}
+
+
+/**
+ * Called from glBlitFramebuffer().
+ * For now, we're doing an approximation with glCopyPixels().
+ * XXX we need to bypass all the per-fragment operations, except scissor.
+ */
+static void
+intel_blit_framebuffer(GLcontext *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ const GLfloat xZoomSave = ctx->Pixel.ZoomX;
+ const GLfloat yZoomSave = ctx->Pixel.ZoomY;
+ GLsizei width, height;
+ GLfloat xFlip = 1.0F, yFlip = 1.0F;
+
+ if (srcX1 < srcX0) {
+ GLint tmp = srcX1;
+ srcX1 = srcX0;
+ srcX0 = tmp;
+ xFlip = -1.0F;
+ }
+
+ if (srcY1 < srcY0) {
+ GLint tmp = srcY1;
+ srcY1 = srcY0;
+ srcY0 = tmp;
+ yFlip = -1.0F;
+ }
+
+ width = srcX1 - srcX0;
+ height = srcY1 - srcY0;
+
+ ctx->Pixel.ZoomX = xFlip * (dstX1 - dstX0) / (srcX1 - srcY0);
+ ctx->Pixel.ZoomY = yFlip * (dstY1 - dstY0) / (srcY1 - srcY0);
+
+ if (ctx->Pixel.ZoomX < 0.0F) {
+ dstX0 = MAX2(dstX0, dstX1);
+ }
+ else {
+ dstX0 = MIN2(dstX0, dstX1);
+ }
+
+ if (ctx->Pixel.ZoomY < 0.0F) {
+ dstY0 = MAX2(dstY0, dstY1);
+ }
+ else {
+ dstY0 = MIN2(dstY0, dstY1);
+ }
+
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height,
+ dstX0, dstY0, GL_COLOR);
+ }
+ if (mask & GL_DEPTH_BUFFER_BIT) {
+ ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height,
+ dstX0, dstY0, GL_DEPTH);
+ }
+ if (mask & GL_STENCIL_BUFFER_BIT) {
+ ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height,
+ dstX0, dstY0, GL_STENCIL);
+ }
+
+ ctx->Pixel.ZoomX = xZoomSave;
+ ctx->Pixel.ZoomY = yZoomSave;
+}
+
+
+/**
* Do one-time context initializations related to GL_EXT_framebuffer_object.
* Hook in device driver functions.
*/
@@ -687,4 +720,6 @@ intel_fbo_init(struct intel_context *intel)
intel->ctx.Driver.RenderTexture = intel_render_texture;
intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
+ intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer;
+ intel->ctx.Driver.BlitFramebuffer = intel_blit_framebuffer;
}
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index b7e9280e8c..7226ee026f 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -55,19 +55,11 @@ struct intel_framebuffer
/**
* Intel renderbuffer, derived from gl_renderbuffer.
- * Note: The PairedDepth and PairedStencil fields use renderbuffer IDs,
- * not pointers because in some circumstances a deleted renderbuffer could
- * result in a dangling pointer here.
*/
struct intel_renderbuffer
{
struct gl_renderbuffer Base;
struct intel_region *region;
- GLuint pfPitch; /* possibly paged flipped pitch */
- GLboolean RenderToTexture; /* RTT? */
-
- GLuint PairedDepth; /**< only used if this is a depth renderbuffer */
- GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */
GLuint vbl_pending; /**< vblank sequence number of pending flip */
@@ -75,48 +67,70 @@ struct intel_renderbuffer
unsigned long span_cache_offset;
};
-extern struct intel_renderbuffer *intel_renderbuffer(struct gl_renderbuffer
- *rb);
+
+/**
+ * gl_renderbuffer is a base class which we subclass. The Class field
+ * is used for simple run-time type checking.
+ */
+#define INTEL_RB_CLASS 0x12345678
+
+
+/**
+ * Return a gl_renderbuffer ptr casted to intel_renderbuffer.
+ * NULL will be returned if the rb isn't really an intel_renderbuffer.
+ * This is determined by checking the ClassID.
+ */
+static INLINE struct intel_renderbuffer *
+intel_renderbuffer(struct gl_renderbuffer *rb)
+{
+ struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb;
+ if (irb && irb->Base.ClassID == INTEL_RB_CLASS) {
+ /*_mesa_warning(NULL, "Returning non-intel Rb\n");*/
+ return irb;
+ }
+ else
+ return NULL;
+}
+
+
+/**
+ * Return a framebuffer's renderbuffer, named by a BUFFER_x index.
+ */
+static INLINE struct intel_renderbuffer *
+intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex)
+{
+ if (attIndex >= 0)
+ return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
+ else
+ return NULL;
+}
+
extern void
intel_renderbuffer_set_region(struct intel_renderbuffer *irb,
struct intel_region *region);
+
extern struct intel_renderbuffer *
intel_create_renderbuffer(GLenum intFormat);
-extern void intel_fbo_init(struct intel_context *intel);
-
-
-/* XXX make inline or macro */
-extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer
- *fb,
- int attIndex);
-
-extern void intel_flip_renderbuffers(struct intel_framebuffer *intel_fb);
+extern void
+intel_fbo_init(struct intel_context *intel);
-/* XXX make inline or macro */
-extern struct intel_region *intel_get_rb_region(struct gl_framebuffer *fb,
- GLuint attIndex);
+extern void
+intel_flip_renderbuffers(struct intel_framebuffer *intel_fb);
-/**
- * Are we currently rendering into a texture?
- */
-static INLINE GLboolean
-intel_rendering_to_texture(const GLcontext *ctx)
+static INLINE struct intel_region *
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
{
- if (ctx->DrawBuffer->Name) {
- /* User-created FBO */
- const struct intel_renderbuffer *irb =
- intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
- return irb && irb->RenderToTexture;
- }
- else {
- return GL_FALSE;
- }
+ struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
+ if (irb)
+ return irb->region;
+ else
+ return NULL;
}
diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h
index 76b8781316..cb41fa182c 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel.h
+++ b/src/mesa/drivers/dri/intel/intel_pixel.h
@@ -76,4 +76,6 @@ void intelBitmap(GLcontext * ctx,
const struct gl_pixelstore_attrib *unpack,
const GLubyte * pixels);
+void intel_clear_tris(GLcontext *ctx, GLbitfield mask);
+
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index 3a01f63dc7..1db7f5594e 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -495,6 +495,7 @@ intel_texture_bitmap(GLcontext * ctx,
texcoords[3][1] = 1.0;
_mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices);
+ _mesa_ClientActiveTextureARB(GL_TEXTURE0);
_mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords);
_mesa_Enable(GL_VERTEX_ARRAY);
_mesa_Enable(GL_TEXTURE_COORD_ARRAY);
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index bb36649dac..7be7ea82b3 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -72,6 +72,8 @@ intel_texture_drawpixels(GLcontext * ctx,
GLfloat vertices[4][4];
GLfloat texcoords[4][2];
GLfloat z;
+ GLint old_active_texture;
+ GLenum internalFormat;
/* We're going to mess with texturing with no regard to existing texture
* state, so if there is some set up we have to bail.
@@ -125,6 +127,7 @@ intel_texture_drawpixels(GLcontext * ctx,
/* XXX: pixel store stuff */
_mesa_Disable(GL_POLYGON_STIPPLE);
+ old_active_texture = ctx->Texture.CurrentUnit;
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB);
_mesa_Enable(GL_TEXTURE_2D);
_mesa_GenTextures(1, &texname);
@@ -132,11 +135,11 @@ intel_texture_drawpixels(GLcontext * ctx,
_mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
_mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
_mesa_TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- /*
- _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
- _mesa_TexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
- */
- _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, format,
+ if (type == GL_ALPHA)
+ internalFormat = GL_ALPHA;
+ else
+ internalFormat = GL_RGBA;
+ _mesa_TexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, 0, format,
type, pixels);
intel_meta_set_passthrough_transform(intel);
@@ -176,12 +179,15 @@ intel_texture_drawpixels(GLcontext * ctx,
texcoords[3][1] = 1.0;
_mesa_VertexPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &vertices);
+ _mesa_ClientActiveTextureARB(GL_TEXTURE0);
_mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords);
_mesa_Enable(GL_VERTEX_ARRAY);
_mesa_Enable(GL_TEXTURE_COORD_ARRAY);
CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4));
intel_meta_restore_transform(intel);
+
+ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture);
_mesa_PopClientAttrib();
_mesa_PopAttrib();
@@ -209,6 +215,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
struct gl_pixelstore_attrib old_unpack;
GLstencil *stencil_pixels;
int row;
+ GLint old_active_texture;
if (format != GL_STENCIL_INDEX)
return GL_FALSE;
@@ -270,6 +277,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
_mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
old_fb_name = ctx->DrawBuffer->Name;
+ old_active_texture = ctx->Texture.CurrentUnit;
_mesa_Disable(GL_POLYGON_STIPPLE);
_mesa_Disable(GL_DEPTH_TEST);
@@ -355,6 +363,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
texcoords[3][1] = 1.0;
_mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices);
+ _mesa_ClientActiveTextureARB(GL_TEXTURE0);
_mesa_TexCoordPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &texcoords);
_mesa_Enable(GL_VERTEX_ARRAY);
_mesa_Enable(GL_TEXTURE_COORD_ARRAY);
@@ -362,6 +371,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
intel_meta_restore_transform(intel);
+ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture);
_mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, old_fb_name);
_mesa_PopClientAttrib();
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 51ce32a967..ec85c4131a 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -152,7 +152,7 @@ void
intel_region_reference(struct intel_region **dst, struct intel_region *src)
{
if (src)
- DBG("%s %d\n", __FUNCTION__, src->refcount);
+ DBG("%s %p %d\n", __FUNCTION__, src, src->refcount);
assert(*dst == NULL);
if (src) {
@@ -169,7 +169,7 @@ intel_region_release(struct intel_region **region_handle)
if (region == NULL)
return;
- DBG("%s %d\n", __FUNCTION__, region->refcount - 1);
+ DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1);
ASSERT(region->refcount > 0);
region->refcount--;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 7042c25564..a52271158c 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -28,27 +28,27 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/framebuffer.h"
-#include "main/matrix.h"
#include "main/renderbuffer.h"
-#include "main/simple_list.h"
+
#include "utils.h"
#include "vblank.h"
#include "xmlpool.h"
-
-#include "intel_screen.h"
-
+#include "intel_batchbuffer.h"
#include "intel_buffers.h"
-#include "intel_tex.h"
-#include "intel_span.h"
-#include "intel_fbo.h"
+#include "intel_bufmgr.h"
#include "intel_chipset.h"
+#include "intel_extensions.h"
+#include "intel_fbo.h"
+#include "intel_regions.h"
+#include "intel_swapbuffers.h"
+#include "intel_screen.h"
+#include "intel_span.h"
+#include "intel_tex.h"
#include "i915_drm.h"
#include "i830_dri.h"
-#include "intel_regions.h"
-#include "intel_batchbuffer.h"
-#include "intel_bufmgr.h"
+
PUBLIC const char __driConfigOptions[] =
DRI_CONF_BEGIN
@@ -159,7 +159,7 @@ intelPrintSAREA(const drm_i915_sarea_t * sarea)
* A number of the screen parameters are obtained/computed from
* information in the SAREA. This function updates those parameters.
*/
-void
+static void
intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
drm_i915_sarea_t * sarea)
{
@@ -316,8 +316,6 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
__DRIdrawablePrivate * driDrawPriv,
const __GLcontextModes * mesaVis, GLboolean isPixmap)
{
- intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private;
-
if (isPixmap) {
return GL_FALSE; /* not implemented */
}
@@ -467,8 +465,6 @@ intelFillInModes(__DRIscreenPrivate *psp,
__GLcontextModes *m;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
int i;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
@@ -480,6 +476,7 @@ intelFillInModes(__DRIscreenPrivate *psp,
uint8_t depth_bits_array[3];
uint8_t stencil_bits_array[3];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = 0;
depth_bits_array[1] = depth_bits;
@@ -496,22 +493,39 @@ intelFillInModes(__DRIscreenPrivate *psp,
stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
back_buffer_factor = (have_back_buffer) ? 3 : 1;
if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
}
else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ __DRIconfig **configs_a8r8g8b8;
+ __DRIconfig **configs_x8r8g8b8;
+
+ configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
+ configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
+ configs = driConcatConfigs(configs_a8r8g8b8, configs_x8r8g8b8);
}
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
@@ -673,6 +687,17 @@ static const
__DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
{
intelScreenPrivate *intelScreen;
+ GLenum fb_format[3];
+ GLenum fb_type[3];
+ /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
+ * support pageflipping at all.
+ */
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+ uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
+ int color;
+ __DRIconfig **configs = NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
@@ -712,8 +737,50 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
intelScreen->irq_active = 1;
psp->extensions = intelScreenExtensions;
- return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1),
- intelFillInModes(psp, 32, 24, 8, 1));
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ depth_bits[2] = 24;
+ stencil_bits[2] = 0;
+ depth_bits[3] = 24;
+ stencil_bits[3] = 8;
+
+ msaa_samples_array[0] = 0;
+
+ fb_format[0] = GL_RGB;
+ fb_type[0] = GL_UNSIGNED_SHORT_5_6_5;
+
+ fb_format[1] = GL_BGR;
+ fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ fb_format[2] = GL_BGRA;
+ fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
+ __DRIconfig **new_configs;
+
+ new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+ depth_bits,
+ stencil_bits,
+ ARRAY_SIZE(depth_bits),
+ back_buffer_modes,
+ ARRAY_SIZE(back_buffer_modes),
+ msaa_samples_array,
+ ARRAY_SIZE(msaa_samples_array));
+ if (configs == NULL)
+ configs = new_configs;
+ else
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
+
+ return (const __DRIconfig **)configs;
}
const struct __DriverAPIRec driDriverAPI = {
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h
index fcd0d9c28c..e1036de4db 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -92,10 +92,6 @@ extern GLboolean intelMapScreenRegions(__DRIscreenPrivate * sPriv);
extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen);
-extern void
-intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
- drm_i915_sarea_t * sarea);
-
extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv);
extern GLboolean intelUnbindContext(__DRIcontextPrivate * driContextPriv);
@@ -105,11 +101,6 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
__DRIdrawablePrivate * driDrawPriv,
__DRIdrawablePrivate * driReadPriv);
-extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
-
-extern void
-intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h);
-
extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen);
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index d9315043e6..bdd2fd9e85 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -150,7 +150,7 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
int x_tile_number, y_tile_number;
int tile_off, tile_base;
- tile_stride = (irb->pfPitch * irb->region->cpp) << 3;
+ tile_stride = (irb->region->pitch * irb->region->cpp) << 3;
xbyte = x * irb->region->cpp;
@@ -190,7 +190,7 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb,
printf("(%d,%d) -> %d + %d = %d (pitch = %d, tstride = %d)\n",
x, y, tile_off, tile_base,
tile_off + tile_base,
- irb->pfPitch, tile_stride);
+ irb->region->pitch, tile_stride);
#endif
return tile_base + tile_off;
@@ -205,7 +205,7 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
int x_tile_number, y_tile_number;
int tile_off, tile_base;
- tile_stride = (irb->pfPitch * irb->region->cpp) << 5;
+ tile_stride = (irb->region->pitch * irb->region->cpp) << 5;
xbyte = x * irb->region->cpp;
@@ -255,8 +255,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define LOCAL_VARS \
struct intel_context *intel = intel_context(ctx); \
struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
- const GLint yScale = irb->RenderToTexture ? 1 : -1; \
- const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
+ const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \
+ const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\
unsigned int num_cliprects; \
struct drm_clip_rect *cliprects; \
int x_off, y_off; \
@@ -392,8 +392,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb,
#define LOCAL_DEPTH_VARS \
struct intel_context *intel = intel_context(ctx); \
struct intel_renderbuffer *irb = intel_renderbuffer(rb); \
- const GLint yScale = irb->RenderToTexture ? 1 : -1; \
- const GLint yBias = irb->RenderToTexture ? 0 : irb->Base.Height - 1; \
+ const GLint yScale = ctx->DrawBuffer->Name ? 1 : -1; \
+ const GLint yBias = ctx->DrawBuffer->Name ? 0 : irb->Base.Height - 1;\
unsigned int num_cliprects; \
struct drm_clip_rect *cliprects; \
int x_off, y_off; \
@@ -528,8 +528,6 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
if (irb == NULL || irb->region == NULL)
return;
- irb->pfPitch = irb->region->pitch;
-
intel_set_span_functions(intel, rb);
}
@@ -543,7 +541,6 @@ intel_renderbuffer_unmap(struct intel_context *intel,
return;
clear_span_cache(irb);
- irb->pfPitch = 0;
rb->GetRow = NULL;
rb->PutRow = NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_state.c b/src/mesa/drivers/dri/intel/intel_state.c
new file mode 100644
index 0000000000..4ee742377d
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_state.c
@@ -0,0 +1,233 @@
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/dd.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_regions.h"
+#include "swrast/swrast.h"
+
+int
+intel_translate_shadow_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_ALWAYS;
+ case GL_LESS:
+ return COMPAREFUNC_LEQUAL;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LESS;
+ case GL_GREATER:
+ return COMPAREFUNC_GEQUAL;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GREATER;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_NEVER;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_NEVER;
+}
+
+int
+intel_translate_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_NEVER;
+ case GL_LESS:
+ return COMPAREFUNC_LESS;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LEQUAL;
+ case GL_GREATER:
+ return COMPAREFUNC_GREATER;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GEQUAL;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_ALWAYS;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_ALWAYS;
+}
+
+int
+intel_translate_stencil_op(GLenum op)
+{
+ switch (op) {
+ case GL_KEEP:
+ return STENCILOP_KEEP;
+ case GL_ZERO:
+ return STENCILOP_ZERO;
+ case GL_REPLACE:
+ return STENCILOP_REPLACE;
+ case GL_INCR:
+ return STENCILOP_INCRSAT;
+ case GL_DECR:
+ return STENCILOP_DECRSAT;
+ case GL_INCR_WRAP:
+ return STENCILOP_INCR;
+ case GL_DECR_WRAP:
+ return STENCILOP_DECR;
+ case GL_INVERT:
+ return STENCILOP_INVERT;
+ default:
+ return STENCILOP_ZERO;
+ }
+}
+
+int
+intel_translate_blend_factor(GLenum factor)
+{
+ switch (factor) {
+ case GL_ZERO:
+ return BLENDFACT_ZERO;
+ case GL_SRC_ALPHA:
+ return BLENDFACT_SRC_ALPHA;
+ case GL_ONE:
+ return BLENDFACT_ONE;
+ case GL_SRC_COLOR:
+ return BLENDFACT_SRC_COLR;
+ case GL_ONE_MINUS_SRC_COLOR:
+ return BLENDFACT_INV_SRC_COLR;
+ case GL_DST_COLOR:
+ return BLENDFACT_DST_COLR;
+ case GL_ONE_MINUS_DST_COLOR:
+ return BLENDFACT_INV_DST_COLR;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ return BLENDFACT_INV_SRC_ALPHA;
+ case GL_DST_ALPHA:
+ return BLENDFACT_DST_ALPHA;
+ case GL_ONE_MINUS_DST_ALPHA:
+ return BLENDFACT_INV_DST_ALPHA;
+ case GL_SRC_ALPHA_SATURATE:
+ return BLENDFACT_SRC_ALPHA_SATURATE;
+ case GL_CONSTANT_COLOR:
+ return BLENDFACT_CONST_COLOR;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ return BLENDFACT_INV_CONST_COLOR;
+ case GL_CONSTANT_ALPHA:
+ return BLENDFACT_CONST_ALPHA;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ return BLENDFACT_INV_CONST_ALPHA;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
+ return BLENDFACT_ZERO;
+}
+
+int
+intel_translate_logic_op(GLenum opcode)
+{
+ switch (opcode) {
+ case GL_CLEAR:
+ return LOGICOP_CLEAR;
+ case GL_AND:
+ return LOGICOP_AND;
+ case GL_AND_REVERSE:
+ return LOGICOP_AND_RVRSE;
+ case GL_COPY:
+ return LOGICOP_COPY;
+ case GL_COPY_INVERTED:
+ return LOGICOP_COPY_INV;
+ case GL_AND_INVERTED:
+ return LOGICOP_AND_INV;
+ case GL_NOOP:
+ return LOGICOP_NOOP;
+ case GL_XOR:
+ return LOGICOP_XOR;
+ case GL_OR:
+ return LOGICOP_OR;
+ case GL_OR_INVERTED:
+ return LOGICOP_OR_INV;
+ case GL_NOR:
+ return LOGICOP_NOR;
+ case GL_EQUIV:
+ return LOGICOP_EQUIV;
+ case GL_INVERT:
+ return LOGICOP_INV;
+ case GL_OR_REVERSE:
+ return LOGICOP_OR_RVRSE;
+ case GL_NAND:
+ return LOGICOP_NAND;
+ case GL_SET:
+ return LOGICOP_SET;
+ default:
+ return LOGICOP_SET;
+ }
+}
+
+
+static void
+intelClearColor(GLcontext *ctx, const GLfloat color[4])
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLubyte clear[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]);
+
+ /* compute both 32 and 16-bit clear values */
+ intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1],
+ clear[2], clear[3]);
+ intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]);
+}
+
+
+/* Fallback to swrast for select and feedback.
+ */
+static void
+intelRenderMode(GLcontext *ctx, GLenum mode)
+{
+ struct intel_context *intel = intel_context(ctx);
+ FALLBACK(intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER));
+}
+
+
+void
+intelInitStateFuncs(struct dd_function_table *functions)
+{
+ functions->RenderMode = intelRenderMode;
+ functions->ClearColor = intelClearColor;
+}
diff --git a/src/mesa/drivers/dri/intel/intel_swapbuffers.c b/src/mesa/drivers/dri/intel/intel_swapbuffers.c
new file mode 100644
index 0000000000..7d035b9f6e
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_swapbuffers.c
@@ -0,0 +1,248 @@
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_swapbuffers.h"
+#include "intel_fbo.h"
+#include "intel_batchbuffer.h"
+#include "drirenderbuffer.h"
+#include "vblank.h"
+#include "i915_drm.h"
+
+
+
+/*
+ * Correct a drawablePrivate's set of vblank flags WRT the current context.
+ * When considering multiple crtcs.
+ */
+GLuint
+intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv)
+{
+ if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
+ intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
+ volatile drm_i915_sarea_t *sarea = intel->sarea;
+ drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
+ .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
+ drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y,
+ .x2 = sarea->planeA_x + sarea->planeA_w,
+ .y2 = sarea->planeA_y + sarea->planeA_h };
+ drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y,
+ .x2 = sarea->planeB_x + sarea->planeB_w,
+ .y2 = sarea->planeB_y + sarea->planeB_h };
+ GLint areaA = driIntersectArea( drw_rect, planeA_rect );
+ GLint areaB = driIntersectArea( drw_rect, planeB_rect );
+ GLuint flags = dPriv->vblFlags;
+
+ /* Update vblank info
+ */
+ if (areaB > areaA || (areaA == areaB && areaB > 0)) {
+ flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
+ } else {
+ flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ /* Do the stupid test: Is one of them actually disabled?
+ */
+ if (sarea->planeA_w == 0 || sarea->planeA_h == 0) {
+ flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
+ } else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) {
+ flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ return flags;
+ } else {
+ return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+}
+
+
+/**
+ * Called from driSwapBuffers()
+ */
+void
+intelSwapBuffers(__DRIdrawablePrivate * dPriv)
+{
+ __DRIscreenPrivate *psp = dPriv->driScreenPriv;
+
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ GET_CURRENT_CONTEXT(ctx);
+ struct intel_context *intel;
+
+ if (ctx == NULL)
+ return;
+
+ intel = intel_context(ctx);
+
+ if (ctx->Visual.doubleBufferMode) {
+ GLboolean missed_target;
+ struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
+ int64_t ust;
+
+ _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
+
+ /*
+ * The old swapping ioctl was incredibly racy, just wait for vblank
+ * and do the swap ourselves.
+ */
+ driWaitForVBlank(dPriv, &missed_target);
+
+ /*
+ * Update each buffer's vbl_pending so we don't get too out of
+ * sync
+ */
+ intel_get_renderbuffer(&intel_fb->Base,
+ BUFFER_BACK_LEFT)->vbl_pending = dPriv->vblSeq;
+ intel_get_renderbuffer(&intel_fb->Base,
+ BUFFER_FRONT_LEFT)->vbl_pending = dPriv->vblSeq;
+
+ intelCopyBuffer(dPriv, NULL);
+
+ intel_fb->swap_count++;
+ (*psp->systemTime->getUST) (&ust);
+ if (missed_target) {
+ intel_fb->swap_missed_count++;
+ intel_fb->swap_missed_ust = ust - intel_fb->swap_ust;
+ }
+
+ intel_fb->swap_ust = ust;
+ }
+ drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE);
+ }
+ else {
+ /* XXX this shouldn't be an error but we can't handle it for now */
+ fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__);
+ }
+}
+
+
+/**
+ * Called from driCopySubBuffer()
+ */
+void
+intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
+{
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ struct intel_context *intel =
+ (struct intel_context *) dPriv->driContextPriv->driverPrivate;
+ GLcontext *ctx = &intel->ctx;
+
+ if (ctx->Visual.doubleBufferMode) {
+ drm_clip_rect_t rect;
+ rect.x1 = x + dPriv->x;
+ rect.y1 = (dPriv->h - y - h) + dPriv->y;
+ rect.x2 = rect.x1 + w;
+ rect.y2 = rect.y1 + h;
+ _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */
+ intelCopyBuffer(dPriv, &rect);
+ }
+ }
+ else {
+ /* XXX this shouldn't be an error but we can't handle it for now */
+ fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__);
+ }
+}
+
+
+/**
+ * This will be called whenever the currently bound window is moved/resized.
+ * XXX: actually, it seems to NOT be called when the window is only moved (BP).
+ */
+void
+intelWindowMoved(struct intel_context *intel)
+{
+ GLcontext *ctx = &intel->ctx;
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
+
+ if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
+ intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
+ GLuint flags = intelFixupVblank(intel, dPriv);
+
+ /* Check to see if we changed pipes */
+ if (flags != dPriv->vblFlags && dPriv->vblFlags &&
+ !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
+ int64_t count;
+ drmVBlank vbl;
+ int i;
+
+ /*
+ * Deal with page flipping
+ */
+ vbl.request.type = DRM_VBLANK_ABSOLUTE;
+
+ if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) {
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ }
+
+ for (i = 0; i < 2; i++) {
+ if (!intel_fb->color_rb[i] ||
+ (intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <=
+ (1<<23))
+ continue;
+
+ vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
+ drmWaitVBlank(intel->driFd, &vbl);
+ }
+
+ /*
+ * Update msc_base from old pipe
+ */
+ driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count);
+ dPriv->msc_base = count;
+ /*
+ * Then get new vblank_base and vblSeq values
+ */
+ dPriv->vblFlags = flags;
+ driGetCurrentVBlank(dPriv);
+ dPriv->vblank_base = dPriv->vblSeq;
+
+ intel_fb->vbl_waited = dPriv->vblSeq;
+
+ for (i = 0; i < 2; i++) {
+ if (intel_fb->color_rb[i])
+ intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited;
+ }
+ }
+ } else {
+ dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY;
+ }
+
+ /* Update Mesa's notion of window size */
+ driUpdateFramebufferSize(ctx, dPriv);
+ intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
+
+ /* Update hardware scissor */
+ if (ctx->Driver.Scissor != NULL) {
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+ }
+
+ /* Re-calculate viewport related state */
+ if (ctx->Driver.DepthRange != NULL)
+ ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far );
+}
diff --git a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h b/src/mesa/drivers/dri/intel/intel_swapbuffers.h
index 46c9bab3af..75bb6242ff 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h
+++ b/src/mesa/drivers/dri/intel/intel_swapbuffers.h
@@ -1,8 +1,9 @@
+
/**************************************************************************
- *
+ *
* Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +11,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,26 +23,30 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
#ifndef INTEL_SWAPBUFFERS_H
#define INTEL_SWAPBUFFERS_H
+#include "dri_util.h"
+#include "drm.h"
-struct pipe_surface;
+struct intel_context;
+struct intel_framebuffer;
-extern void intelDisplaySurface(__DRIdrawablePrivate * dPriv,
- struct pipe_surface *surf,
- const drm_clip_rect_t * rect);
+extern void
+intelSwapBuffers(__DRIdrawablePrivate * dPriv);
-extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
+extern void
+intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h);
-extern void intelCopySubBuffer(__DRIdrawablePrivate * dPriv,
- int x, int y, int w, int h);
+extern GLuint
+intelFixupVblank(struct intel_context *intel, __DRIdrawablePrivate *dPriv);
-extern void intelUpdateWindowSize(__DRIdrawablePrivate *dPriv);
+extern void
+intelWindowMoved(struct intel_context *intel);
#endif /* INTEL_SWAPBUFFERS_H */
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index e64d8a1556..ae0994b183 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -93,7 +93,7 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
static void *
do_memcpy(void *dest, const void *src, size_t n)
{
- if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) {
+ if ((((unsigned long) src) & 63) || (((unsigned long) dest) & 63)) {
return __memcpy(dest, src, n);
}
else
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index 5e418ac446..2715a540d0 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -16,7 +16,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
GLenum format, GLenum type)
{
struct intel_context *intel = intel_context(ctx);
- const GLboolean do32bpt = (intel->ctx.Visual.rgbBits == 32);
+ const GLboolean do32bpt = (intel->ctx.Visual.rgbBits >= 24);
switch (internalFormat) {
case 4:
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 2ac7dceb0f..866022d0ce 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -209,7 +209,8 @@ try_pbo_upload(struct intel_context *intel,
return GL_FALSE;
}
- src_offset = (GLuint) pixels;
+ /* note: potential 64-bit ptr to 32-bit int cast */
+ src_offset = (GLuint) (unsigned long) pixels;
if (unpack->RowLength > 0)
src_stride = unpack->RowLength;
@@ -264,7 +265,8 @@ try_pbo_zcopy(struct intel_context *intel,
return GL_FALSE;
}
- src_offset = (GLuint) pixels;
+ /* note: potential 64-bit ptr to 32-bit int cast */
+ src_offset = (GLuint) (unsigned long) pixels;
if (unpack->RowLength > 0)
src_stride = unpack->RowLength;
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index 99abd209b6..9c7f513c6f 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -57,10 +57,6 @@
#include "utils.h"
#include "vblank.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_vertex_buffer_object
-#include "extension_helper.h"
-
#ifndef MACH64_DEBUG
int MACH64_DEBUG = (0);
#endif
@@ -82,9 +78,7 @@ static const struct dri_debug_control debug_control[] =
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
@@ -196,6 +190,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
ctx->Const.MaxTextureUnits = 2;
ctx->Const.MaxTextureImageUnits = 2;
ctx->Const.MaxTextureCoordUnits = 2;
+ ctx->Const.MaxDrawBuffers = 1;
heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP;
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index 6bfb4c32b1..43e59594dd 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -93,6 +93,7 @@ mach64FillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[2];
uint8_t stencil_bits_array[2];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
@@ -104,6 +105,8 @@ mach64FillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[0] = 0;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
@@ -119,7 +122,8 @@ mach64FillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
+ back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__);
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 1f9d3c57eb..9fe267eafd 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -152,6 +152,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
+ case GL_COMPRESSED_ALPHA:
case 2:
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE4_ALPHA4:
@@ -160,9 +161,11 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
case 4:
case GL_RGBA:
case GL_RGBA2:
+ case GL_COMPRESSED_RGBA:
if (mmesa->mach64Screen->cpp == 4)
return &_mesa_texformat_argb8888;
else
@@ -193,6 +196,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+ case GL_COMPRESSED_RGB:
if (mmesa->mach64Screen->cpp == 4)
return &_mesa_texformat_argb8888;
else
@@ -204,6 +208,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
+ case GL_COMPRESSED_LUMINANCE:
if (mmesa->mach64Screen->cpp == 4)
return &_mesa_texformat_argb8888; /* inefficient but accurate */
else
@@ -214,6 +219,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
+ case GL_COMPRESSED_INTENSITY:
if (mmesa->mach64Screen->cpp == 4)
return &_mesa_texformat_argb8888; /* inefficient but accurate */
else
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 86da3a2cac..926534d6df 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -69,13 +69,9 @@
#include "GL/internal/dri_interface.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_EXT_fog_coord
#define need_GL_EXT_gpu_program_parameters
-#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#if 0
#define need_GL_EXT_paletted_texture
@@ -133,6 +129,7 @@ mgaFillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[3];
uint8_t stencil_bits_array[3];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = 0;
@@ -147,6 +144,8 @@ mgaFillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[1] = 0;
stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
@@ -162,7 +161,8 @@ mgaFillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor,
- back_buffer_modes, back_buffer_factor);
+ back_buffer_modes, back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
@@ -385,13 +385,9 @@ static const struct dri_extension g400_extensions[] =
static const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_rectangle", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
/* paletted_textures currently doesn't work, but we could fix them later */
#if defined( need_GL_EXT_paletted_texture )
{ "GL_EXT_shared_texture_palette", NULL },
@@ -539,6 +535,8 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxLineWidthAA = 10.0;
ctx->Const.LineWidthGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
mmesa->texture_depth = driQueryOptioni (&mmesa->optionCache,
"texture_depth");
if (mmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 535a98cc01..f511a67bad 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -65,9 +65,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
int R128_DEBUG = 0;
#endif
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
@@ -75,12 +72,9 @@ int R128_DEBUG = 0;
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
@@ -229,6 +223,8 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual,
ctx->Const.MaxLineWidthAA = 1.0;
ctx->Const.LineWidthGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
#if ENABLE_PERF_BOXES
rmesa->boxes = driQueryOptionb(&rmesa->optionCache, "performance_boxes");
#endif
diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c
index cb3a147dba..7cda4ca5d3 100644
--- a/src/mesa/drivers/dri/r128/r128_screen.c
+++ b/src/mesa/drivers/dri/r128/r128_screen.c
@@ -422,7 +422,7 @@ r128FillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[2];
uint8_t stencil_bits_array[2];
-
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
@@ -434,6 +434,8 @@ r128FillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[0] = 0;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
@@ -446,26 +448,27 @@ r128FillInModes( __DRIscreenPrivate *psp,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
- if (configs == NULL) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
+ configs = driCreateConfigs(fb_format, fb_type,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
- /* Mark the visual as slow if there are "fake" stencil bits.
- */
- for (i = 0; configs[i]; i++) {
- m = &configs[i]->modes;
- if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
- m->visualRating = GLX_SLOW_CONFIG;
- }
- }
+ /* Mark the visual as slow if there are "fake" stencil bits.
+ */
+ for (i = 0; configs[i]; i++) {
+ m = &configs[i]->modes;
+ if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
+ m->visualRating = GLX_SLOW_CONFIG;
+ }
+ }
- return (const __DRIconfig **) configs;
+ return (const __DRIconfig **) configs;
}
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 5531e0a739..c06751516e 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -62,14 +62,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_maos.h"
#include "r200_vertprog.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_ATI_fragment_shader
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
@@ -120,20 +116,16 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
*/
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
@@ -411,6 +403,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
ctx->Const.VertexProgram.MaxNativeParameters = R200_VSF_MAX_PARAM;
ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext( ctx );
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 37436275e3..4c14c7eefe 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -77,19 +77,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int future_hw_tcl_on = 1;
int hw_tcl_on = 1;
-#define need_GL_EXT_stencil_two_side
-#define need_GL_ARB_multisample
+#define need_GL_VERSION_2_0
#define need_GL_ARB_point_parameters
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
-#define need_GL_EXT_blend_minmax
-//#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
-#define need_GL_EXT_secondary_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
+#define need_GL_EXT_blend_minmax
+//#define need_GL_EXT_fog_coord
#define need_GL_EXT_gpu_program_parameters
+#define need_GL_EXT_secondary_color
+#define need_GL_EXT_stencil_two_side
+#define need_GL_ATI_separate_stencil
#define need_GL_NV_vertex_program
#include "extension_helper.h"
@@ -97,27 +95,23 @@ const struct dri_extension card_extensions[] = {
/* *INDENT-OFF* */
{"GL_ARB_depth_texture", NULL},
{"GL_ARB_fragment_program", NULL},
- {"GL_ARB_multisample", GL_ARB_multisample_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
{"GL_ARB_shadow", NULL},
{"GL_ARB_shadow_ambient", NULL},
{"GL_ARB_texture_border_clamp", NULL},
- {"GL_ARB_texture_compression", GL_ARB_texture_compression_functions},
{"GL_ARB_texture_cube_map", NULL},
{"GL_ARB_texture_env_add", NULL},
{"GL_ARB_texture_env_combine", NULL},
{"GL_ARB_texture_env_crossbar", NULL},
{"GL_ARB_texture_env_dot3", NULL},
{"GL_ARB_texture_mirrored_repeat", NULL},
- {"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
{"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
{"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
{"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
{"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
{"GL_EXT_blend_subtract", NULL},
// {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- {"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
{"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions},
{"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
{"GL_EXT_shadow_funcs", NULL},
@@ -130,6 +124,7 @@ const struct dri_extension card_extensions[] = {
{"GL_EXT_texture_lod_bias", NULL},
{"GL_EXT_texture_mirror_clamp", NULL},
{"GL_EXT_texture_rectangle", NULL},
+ {"GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions},
{"GL_ATI_texture_env_combine3", NULL},
{"GL_ATI_texture_mirror_once", NULL},
{"GL_MESA_pack_invert", NULL},
@@ -142,6 +137,16 @@ const struct dri_extension card_extensions[] = {
/* *INDENT-ON* */
};
+
+/**
+ * The GL 2.0 functions are needed to make display lists work with
+ * functions added by GL_ATI_separate_stencil.
+ */
+const struct dri_extension gl_20_extension[] = {
+ {"GL_VERSION_2_0", GL_VERSION_2_0_functions },
+};
+
+
extern struct tnl_pipeline_stage _r300_render_stage;
extern const struct tnl_pipeline_stage _r300_tcl_stage;
@@ -306,6 +311,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
#endif
#endif
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(ctx);
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index 4ef7f2bd78..8d030c63fb 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -163,6 +163,19 @@ static GLboolean transform_TEX(
}
}
+ if (inst.SrcReg[0].File != PROGRAM_TEMPORARY && inst.SrcReg[0].File != PROGRAM_INPUT) {
+ int tmpreg = radeonFindFreeTemporary(t);
+ tgt = radeonAppendInstructions(t->Program, 1);
+ tgt->Opcode = OPCODE_MOV;
+ tgt->DstReg.File = PROGRAM_TEMPORARY;
+ tgt->DstReg.Index = tmpreg;
+ tgt->SrcReg[0] = inst.SrcReg[0];
+
+ reset_srcreg(&inst.SrcReg[0]);
+ inst.SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst.SrcReg[0].Index = tmpreg;
+ }
+
tgt = radeonAppendInstructions(t->Program, 1);
_mesa_copy_instructions(tgt, &inst, 1);
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 7c6485ef60..872a33e258 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -656,7 +656,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_GB_FOG_SELECT_C3A (3 << 0)
# define R300_GB_FOG_SELECT_1_1_W (4 << 0)
# define R300_GB_FOG_SELECT_Z (5 << 0)
-# define R300_GB_DEPTH_SELECT_Z (0 << 3
+# define R300_GB_DEPTH_SELECT_Z (0 << 3)
# define R300_GB_DEPTH_SELECT_1_1_W (1 << 3)
# define R300_GB_W_SELECT_1_W (0 << 4)
# define R300_GB_W_SELECT_1 (1 << 4)
@@ -730,8 +730,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R500_RS_IP_TEX_PTR_Q_SHIFT 18
#define R500_RS_IP_COL_PTR_SHIFT 24
#define R500_RS_IP_COL_FMT_SHIFT 27
-# define R500_RS_COL_PTR(x) (x << 24)
-# define R500_RS_COL_FMT(x) (x << 27)
+# define R500_RS_COL_PTR(x) ((x) << 24)
+# define R500_RS_COL_FMT(x) ((x) << 27)
/* gap */
#define R500_RS_IP_OFFSET_DIS (0 << 31)
#define R500_RS_IP_OFFSET_EN (1 << 31)
@@ -1172,9 +1172,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define R300_RS_IP_3 0x431C
# define R300_RS_INTERP_SRC_SHIFT 2 /* TODO: check for removal */
# define R300_RS_INTERP_SRC_MASK (7 << 2) /* TODO: check for removal */
-# define R300_RS_TEX_PTR(x) (x << 0)
-# define R300_RS_COL_PTR(x) (x << 6)
-# define R300_RS_COL_FMT(x) (x << 9)
+# define R300_RS_TEX_PTR(x) ((x) << 0)
+# define R300_RS_COL_PTR(x) ((x) << 6)
+# define R300_RS_COL_FMT(x) ((x) << 9)
# define R300_RS_COL_FMT_RGBA 0
# define R300_RS_COL_FMT_RGB0 1
# define R300_RS_COL_FMT_RGB1 2
@@ -1184,10 +1184,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_RS_COL_FMT_111A 8
# define R300_RS_COL_FMT_1110 9
# define R300_RS_COL_FMT_1111 10
-# define R300_RS_SEL_S(x) (x << 13)
-# define R300_RS_SEL_T(x) (x << 16)
-# define R300_RS_SEL_R(x) (x << 19)
-# define R300_RS_SEL_Q(x) (x << 22)
+# define R300_RS_SEL_S(x) ((x) << 13)
+# define R300_RS_SEL_T(x) ((x) << 16)
+# define R300_RS_SEL_R(x) ((x) << 19)
+# define R300_RS_SEL_Q(x) ((x) << 22)
# define R300_RS_SEL_C0 0
# define R300_RS_SEL_C1 1
# define R300_RS_SEL_C2 2
@@ -2705,7 +2705,7 @@ enum {
# define R500_ALPHA_OP_COS 13
# define R500_ALPHA_OP_MDH 14
# define R500_ALPHA_OP_MDV 15
-# define R500_ALPHA_ADDRD(x) (x << 4)
+# define R500_ALPHA_ADDRD(x) ((x) << 4)
# define R500_ALPHA_ADDRD_REL (1 << 11)
# define R500_ALPHA_SEL_A_SHIFT 12
# define R500_ALPHA_SEL_A_SRC0 (0 << 12)
@@ -2749,16 +2749,16 @@ enum {
# define R500_ALPHA_OMOD_DIV_4 (5 << 26)
# define R500_ALPHA_OMOD_DIV_8 (6 << 26)
# define R500_ALPHA_OMOD_DISABLE (7 << 26)
-# define R500_ALPHA_TARGET(x) (x << 29)
+# define R500_ALPHA_TARGET(x) ((x) << 29)
# define R500_ALPHA_W_OMASK (1 << 31)
#define R500_US_ALU_ALPHA_ADDR_0 0x9800
-# define R500_ALPHA_ADDR0(x) (x << 0)
+# define R500_ALPHA_ADDR0(x) ((x) << 0)
# define R500_ALPHA_ADDR0_CONST (1 << 8)
# define R500_ALPHA_ADDR0_REL (1 << 9)
-# define R500_ALPHA_ADDR1(x) (x << 10)
+# define R500_ALPHA_ADDR1(x) ((x) << 10)
# define R500_ALPHA_ADDR1_CONST (1 << 18)
# define R500_ALPHA_ADDR1_REL (1 << 19)
-# define R500_ALPHA_ADDR2(x) (x << 20)
+# define R500_ALPHA_ADDR2(x) ((x) << 20)
# define R500_ALPHA_ADDR2_CONST (1 << 28)
# define R500_ALPHA_ADDR2_REL (1 << 29)
# define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30)
@@ -2779,7 +2779,7 @@ enum {
# define R500_ALU_RGBA_OP_SOP (10 << 0)
# define R500_ALU_RGBA_OP_MDH (11 << 0)
# define R500_ALU_RGBA_OP_MDV (12 << 0)
-# define R500_ALU_RGBA_ADDRD(x) (x << 4)
+# define R500_ALU_RGBA_ADDRD(x) ((x) << 4)
# define R500_ALU_RGBA_ADDRD_REL (1 << 11)
# define R500_ALU_RGBA_SEL_C_SHIFT 12
# define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12)
@@ -2906,16 +2906,16 @@ enum {
# define R500_ALU_RGB_OMOD_DIV_4 (5 << 26)
# define R500_ALU_RGB_OMOD_DIV_8 (6 << 26)
# define R500_ALU_RGB_OMOD_DISABLE (7 << 26)
-# define R500_ALU_RGB_TARGET(x) (x << 29)
+# define R500_ALU_RGB_TARGET(x) ((x) << 29)
# define R500_ALU_RGB_WMASK (1 << 31)
#define R500_US_ALU_RGB_ADDR_0 0x9000
-# define R500_RGB_ADDR0(x) (x << 0)
+# define R500_RGB_ADDR0(x) ((x) << 0)
# define R500_RGB_ADDR0_CONST (1 << 8)
# define R500_RGB_ADDR0_REL (1 << 9)
-# define R500_RGB_ADDR1(x) (x << 10)
+# define R500_RGB_ADDR1(x) ((x) << 10)
# define R500_RGB_ADDR1_CONST (1 << 18)
# define R500_RGB_ADDR1_REL (1 << 19)
-# define R500_RGB_ADDR2(x) (x << 20)
+# define R500_RGB_ADDR2(x) ((x) << 20)
# define R500_RGB_ADDR2_CONST (1 << 28)
# define R500_RGB_ADDR2_REL (1 << 29)
# define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30)
@@ -2970,19 +2970,19 @@ enum {
/* note that these are 8 bit lengths, despite the offsets, at least for R500 */
#define R500_US_CODE_ADDR 0x4630
-# define R500_US_CODE_START_ADDR(x) (x << 0)
-# define R500_US_CODE_END_ADDR(x) (x << 16)
+# define R500_US_CODE_START_ADDR(x) ((x) << 0)
+# define R500_US_CODE_END_ADDR(x) ((x) << 16)
#define R500_US_CODE_OFFSET 0x4638
-# define R500_US_CODE_OFFSET_ADDR(x) (x << 0)
+# define R500_US_CODE_OFFSET_ADDR(x) ((x) << 0)
#define R500_US_CODE_RANGE 0x4634
-# define R500_US_CODE_RANGE_ADDR(x) (x << 0)
-# define R500_US_CODE_RANGE_SIZE(x) (x << 16)
+# define R500_US_CODE_RANGE_ADDR(x) ((x) << 0)
+# define R500_US_CODE_RANGE_SIZE(x) ((x) << 16)
#define R500_US_CONFIG 0x4600
# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1)
#define R500_US_FC_ADDR_0 0xa000
-# define R500_FC_BOOL_ADDR(x) (x << 0)
-# define R500_FC_INT_ADDR(x) (x << 8)
-# define R500_FC_JUMP_ADDR(x) (x << 16)
+# define R500_FC_BOOL_ADDR(x) ((x) << 0)
+# define R500_FC_INT_ADDR(x) ((x) << 8)
+# define R500_FC_JUMP_ADDR(x) ((x) << 16)
# define R500_FC_JUMP_GLOBAL (1 << 31)
#define R500_US_FC_BOOL_CONST 0x4620
# define R500_FC_KBOOL(x) (x)
@@ -3003,8 +3003,8 @@ enum {
# define R500_FC_A_OP_NONE (0 << 6)
# define R500_FC_A_OP_POP (1 << 6)
# define R500_FC_A_OP_PUSH (2 << 6)
-# define R500_FC_JUMP_FUNC(x) (x << 8)
-# define R500_FC_B_POP_CNT(x) (x << 16)
+# define R500_FC_JUMP_FUNC(x) ((x) << 8)
+# define R500_FC_B_POP_CNT(x) ((x) << 16)
# define R500_FC_B_OP0_NONE (0 << 24)
# define R500_FC_B_OP0_DECR (1 << 24)
# define R500_FC_B_OP0_INCR (2 << 24)
@@ -3013,14 +3013,14 @@ enum {
# define R500_FC_B_OP1_INCR (2 << 26)
# define R500_FC_IGNORE_UNCOVERED (1 << 28)
#define R500_US_FC_INT_CONST_0 0x4c00
-# define R500_FC_INT_CONST_KR(x) (x << 0)
-# define R500_FC_INT_CONST_KG(x) (x << 8)
-# define R500_FC_INT_CONST_KB(x) (x << 16)
+# define R500_FC_INT_CONST_KR(x) ((x) << 0)
+# define R500_FC_INT_CONST_KG(x) ((x) << 8)
+# define R500_FC_INT_CONST_KB(x) ((x) << 16)
/* _0 through _15 */
#define R500_US_FORMAT0_0 0x4640
-# define R500_FORMAT_TXWIDTH(x) (x << 0)
-# define R500_FORMAT_TXHEIGHT(x) (x << 11)
-# define R500_FORMAT_TXDEPTH(x) (x << 22)
+# define R500_FORMAT_TXWIDTH(x) ((x) << 0)
+# define R500_FORMAT_TXHEIGHT(x) ((x) << 11)
+# define R500_FORMAT_TXDEPTH(x) ((x) << 22)
/* _0 through _3 */
#define R500_US_OUT_FMT_0 0x46a4
# define R500_OUT_FMT_C4_8 (0 << 0)
@@ -3061,12 +3061,12 @@ enum {
# define R500_C3_SEL_R (1 << 14)
# define R500_C3_SEL_G (2 << 14)
# define R500_C3_SEL_B (3 << 14)
-# define R500_OUT_SIGN(x) (x << 16)
+# define R500_OUT_SIGN(x) ((x) << 16)
# define R500_ROUND_ADJ (1 << 20)
#define R500_US_PIXSIZE 0x4604
# define R500_PIX_SIZE(x) (x)
#define R500_US_TEX_ADDR_0 0x9800
-# define R500_TEX_SRC_ADDR(x) (x << 0)
+# define R500_TEX_SRC_ADDR(x) ((x) << 0)
# define R500_TEX_SRC_ADDR_REL (1 << 7)
# define R500_TEX_SRC_S_SWIZ_R (0 << 8)
# define R500_TEX_SRC_S_SWIZ_G (1 << 8)
@@ -3084,7 +3084,7 @@ enum {
# define R500_TEX_SRC_Q_SWIZ_G (1 << 14)
# define R500_TEX_SRC_Q_SWIZ_B (2 << 14)
# define R500_TEX_SRC_Q_SWIZ_A (3 << 14)
-# define R500_TEX_DST_ADDR(x) (x << 16)
+# define R500_TEX_DST_ADDR(x) ((x) << 16)
# define R500_TEX_DST_ADDR_REL (1 << 23)
# define R500_TEX_DST_R_SWIZ_R (0 << 24)
# define R500_TEX_DST_R_SWIZ_G (1 << 24)
@@ -3103,7 +3103,7 @@ enum {
# define R500_TEX_DST_A_SWIZ_B (2 << 30)
# define R500_TEX_DST_A_SWIZ_A (3 << 30)
#define R500_US_TEX_ADDR_DXDY_0 0xa000
-# define R500_DX_ADDR(x) (x << 0)
+# define R500_DX_ADDR(x) ((x) << 0)
# define R500_DX_ADDR_REL (1 << 7)
# define R500_DX_S_SWIZ_R (0 << 8)
# define R500_DX_S_SWIZ_G (1 << 8)
@@ -3121,7 +3121,7 @@ enum {
# define R500_DX_Q_SWIZ_G (1 << 14)
# define R500_DX_Q_SWIZ_B (2 << 14)
# define R500_DX_Q_SWIZ_A (3 << 14)
-# define R500_DY_ADDR(x) (x << 16)
+# define R500_DY_ADDR(x) ((x) << 16)
# define R500_DY_ADDR_REL (1 << 17)
# define R500_DY_S_SWIZ_R (0 << 24)
# define R500_DY_S_SWIZ_G (1 << 24)
@@ -3140,7 +3140,7 @@ enum {
# define R500_DY_Q_SWIZ_B (2 << 30)
# define R500_DY_Q_SWIZ_A (3 << 30)
#define R500_US_TEX_INST_0 0x9000
-# define R500_TEX_ID(x) (x << 16)
+# define R500_TEX_ID(x) ((x) << 16)
# define R500_TEX_INST_NOP (0 << 22)
# define R500_TEX_INST_LD (1 << 22)
# define R500_TEX_INST_TEXKILL (2 << 22)
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index f9266e44c1..16ce4a1199 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -347,6 +347,8 @@ static GLboolean r300RunRender(GLcontext * ctx,
static int r300Fallback(GLcontext * ctx)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
+ const unsigned back = ctx->Stencil._BackFace;
+
/* Do we need to use new-style shaders?
* Also is there a better way to do this? */
if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
@@ -371,12 +373,14 @@ static int r300Fallback(GLcontext * ctx)
FALLBACK_IF(ctx->RenderMode != GL_RENDER);
- FALLBACK_IF(ctx->Stencil._TestTwoSide
- && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1]
- || ctx->Stencil.ValueMask[0] !=
- ctx->Stencil.ValueMask[1]
- || ctx->Stencil.WriteMask[0] !=
- ctx->Stencil.WriteMask[1]));
+ /* If GL_EXT_stencil_two_side is disabled, this fallback check can
+ * be removed.
+ */
+ FALLBACK_IF(ctx->Stencil.Ref[0] != ctx->Stencil.Ref[back]
+ || ctx->Stencil.ValueMask[0] !=
+ ctx->Stencil.ValueMask[back]
+ || ctx->Stencil.WriteMask[0] !=
+ ctx->Stencil.WriteMask[back]);
if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite)
FALLBACK_IF(ctx->Point.PointSprite);
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index a63dbac343..c192fecca4 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -783,6 +783,7 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
R300_FG_FOG_BLEND_FN_EXP2;
fogScale.f = 0.3 * ctx->Fog.Density;
fogStart.f = 0.0;
+ break;
default:
return;
}
@@ -974,15 +975,9 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face,
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
GLuint refmask =
- (((ctx->Stencil.
- Ref[0] & 0xff) << R300_STENCILREF_SHIFT) | ((ctx->
- Stencil.
- ValueMask
- [0] &
- 0xff)
- <<
- R300_STENCILMASK_SHIFT));
-
+ ((ctx->Stencil.Ref[0] & 0xff) << R300_STENCILREF_SHIFT)
+ | ((ctx->Stencil.ValueMask[0] & 0xff) << R300_STENCILMASK_SHIFT);
+ const unsigned back = ctx->Stencil._BackFace;
GLuint flag;
R300_STATECHANGE(rmesa, zs);
@@ -1000,8 +995,7 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face,
rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
(flag << R300_S_FRONT_FUNC_SHIFT);
- if (ctx->Stencil._TestTwoSide)
- flag = translate_func(ctx->Stencil.Function[1]);
+ flag = translate_func(ctx->Stencil.Function[back]);
rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
(flag << R300_S_BACK_FUNC_SHIFT);
@@ -1026,6 +1020,7 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face,
GLenum fail, GLenum zfail, GLenum zpass)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
+ const unsigned back = ctx->Stencil._BackFace;
R300_STATECHANGE(rmesa, zs);
/* It is easier to mask what's left.. */
@@ -1042,23 +1037,13 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face,
| (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) <<
R300_S_FRONT_ZPASS_OP_SHIFT);
- if (ctx->Stencil._TestTwoSide) {
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
- (translate_stencil_op(ctx->Stencil.FailFunc[1]) <<
- R300_S_BACK_SFAIL_OP_SHIFT)
- | (translate_stencil_op(ctx->Stencil.ZFailFunc[1]) <<
- R300_S_BACK_ZFAIL_OP_SHIFT)
- | (translate_stencil_op(ctx->Stencil.ZPassFunc[1]) <<
- R300_S_BACK_ZPASS_OP_SHIFT);
- } else {
- rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
- (translate_stencil_op(ctx->Stencil.FailFunc[0]) <<
- R300_S_BACK_SFAIL_OP_SHIFT)
- | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) <<
- R300_S_BACK_ZFAIL_OP_SHIFT)
- | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) <<
- R300_S_BACK_ZPASS_OP_SHIFT);
- }
+ rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
+ (translate_stencil_op(ctx->Stencil.FailFunc[back]) <<
+ R300_S_BACK_SFAIL_OP_SHIFT)
+ | (translate_stencil_op(ctx->Stencil.ZFailFunc[back]) <<
+ R300_S_BACK_ZFAIL_OP_SHIFT)
+ | (translate_stencil_op(ctx->Stencil.ZPassFunc[back]) <<
+ R300_S_BACK_ZPASS_OP_SHIFT);
}
/* =============================================================
diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c
index 75dae86fa8..926ddd5964 100644
--- a/src/mesa/drivers/dri/r300/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r500_fragprog.c
@@ -31,6 +31,12 @@
#include "radeon_program_alu.h"
+static void reset_srcreg(struct prog_src_register* reg)
+{
+ _mesa_bzero(reg, sizeof(*reg));
+ reg->Swizzle = SWIZZLE_NOOP;
+}
+
static struct prog_src_register shadow_ambient(struct gl_program *program, int tmu)
{
gl_state_index fail_value_tokens[STATE_LENGTH] = {
@@ -99,6 +105,19 @@ static GLboolean transform_TEX(
destredirect = GL_TRUE;
}
+ if (inst.SrcReg[0].File != PROGRAM_TEMPORARY && inst.SrcReg[0].File != PROGRAM_INPUT) {
+ int tmpreg = radeonFindFreeTemporary(t);
+ tgt = radeonAppendInstructions(t->Program, 1);
+ tgt->Opcode = OPCODE_MOV;
+ tgt->DstReg.File = PROGRAM_TEMPORARY;
+ tgt->DstReg.Index = tmpreg;
+ tgt->SrcReg[0] = inst.SrcReg[0];
+
+ reset_srcreg(&inst.SrcReg[0]);
+ inst.SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst.SrcReg[0].Index = tmpreg;
+ }
+
tgt = radeonAppendInstructions(t->Program, 1);
_mesa_copy_instructions(tgt, &inst, 1);
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 1e992c0b3d..ea81a3250b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -62,9 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_tcl.h"
#include "radeon_maos.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
@@ -114,16 +111,13 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
*/
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
@@ -359,6 +353,8 @@ radeonCreateContext( const __GLcontextModes *glVisual,
rmesa->boxes = 0;
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext( ctx );
diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
index de3c3a15a7..31eea13f4e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
+++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
@@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
#include "tnl/tnl.h"
-#include "tnl/tcontext.h"
#include "radeon_context.h"
#include "radeon_ioctl.h"
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 5f32dd575e..56c22faafa 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -206,6 +206,8 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 17;
+extern const struct dri_extension gl_20_extension[];
+
#ifndef RADEON_DEBUG
int RADEON_DEBUG = 0;
@@ -274,7 +276,7 @@ radeonFillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[2];
uint8_t stencil_bits_array[2];
-
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
@@ -286,6 +288,8 @@ radeonFillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[0] = 0;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
@@ -301,7 +305,8 @@ radeonFillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor,
- back_buffer_modes, back_buffer_factor);
+ back_buffer_modes, back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
@@ -1140,6 +1145,7 @@ static void radeonDestroyContext(__DRIcontextPrivate * driContextPriv)
#endif
+
/**
* This is the driver specific part of the createNewScreen entry point.
*
@@ -1192,6 +1198,8 @@ radeonInitScreen(__DRIscreenPrivate *psp)
driInitSingleExtension( NULL, NV_vp_extension );
driInitSingleExtension( NULL, ATI_fs_extension );
driInitExtensions( NULL, point_extensions, GL_FALSE );
+#elif defined(RADEON_COMMON_FOR_R300)
+ driInitSingleExtension( NULL, gl_20_extension );
#endif
if (!radeonInitDriver(psp))
diff --git a/src/mesa/drivers/dri/s3v/s3v_context.c b/src/mesa/drivers/dri/s3v/s3v_context.c
index 14502f95ae..0a3bf7258d 100644
--- a/src/mesa/drivers/dri/s3v/s3v_context.c
+++ b/src/mesa/drivers/dri/s3v/s3v_context.c
@@ -108,6 +108,8 @@ GLboolean s3vCreateContext(const __GLcontextModes *glVisual,
ctx->Const.MaxLineWidthAA = 1.0;
ctx->Const.LineWidthGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
vmesa->texHeap = mmInit( 0, vmesa->s3vScreen->textureSize );
DEBUG(("vmesa->s3vScreen->textureSize = 0x%x\n",
vmesa->s3vScreen->textureSize));
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index a344aab71b..326d595352 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -59,9 +59,6 @@
#include "drirenderbuffer.h"
#include "texmem.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -133,10 +130,7 @@ struct timeval tv_s1,tv_f1;
static const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
@@ -350,7 +344,9 @@ savageCreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxLineWidthAA = 3.0;
ctx->Const.LineWidthGranularity = 1.0;
#endif
-
+
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Dri stuff
*/
imesa->hHWContext = driContextPriv->hHWContext;
@@ -914,7 +910,7 @@ savageFillInModes( __DRIscreenPrivate *psp,
uint8_t depth_bits_array[2];
uint8_t stencil_bits_array[2];
-
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
@@ -926,6 +922,8 @@ savageFillInModes( __DRIscreenPrivate *psp,
stencil_bits_array[0] = 0;
stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
back_buffer_factor = (have_back_buffer) ? 2 : 1;
@@ -941,7 +939,8 @@ savageFillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor,
- back_buffer_modes, back_buffer_factor);
+ back_buffer_modes, back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
diff --git a/src/mesa/drivers/dri/sis/sis_alloc.c b/src/mesa/drivers/dri/sis/sis_alloc.c
index 4ca4052803..ce34e44da2 100644
--- a/src/mesa/drivers/dri/sis/sis_alloc.c
+++ b/src/mesa/drivers/dri/sis/sis_alloc.c
@@ -137,7 +137,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa )
{
int cpp = ( smesa->glCtx->Visual.depthBits +
smesa->glCtx->Visual.stencilBits ) / 8;
- unsigned char *addr;
+ char *addr;
smesa->depth.bpp = cpp * 8;
smesa->depth.pitch = ALIGNMENT(smesa->driDrawable->w * cpp, 4);
@@ -150,7 +150,7 @@ sisAllocZStencilBuffer( sisContextPtr smesa )
addr = (char *)ALIGNMENT((unsigned long)addr, Z_BUFFER_HW_ALIGNMENT);
smesa->depth.map = addr;
- smesa->depth.offset = addr - smesa->FbBase;
+ smesa->depth.offset = addr - (char *)smesa->FbBase;
/* stencil buffer is same as depth buffer */
smesa->stencil.size = smesa->depth.size;
@@ -173,7 +173,7 @@ void
sisAllocBackbuffer( sisContextPtr smesa )
{
int cpp = smesa->bytesPerPixel;
- unsigned char *addr;
+ char *addr;
smesa->back.bpp = smesa->bytesPerPixel * 8;
smesa->back.pitch = ALIGNMENT(smesa->driDrawable->w * cpp, 4);
@@ -186,7 +186,7 @@ sisAllocBackbuffer( sisContextPtr smesa )
addr = (char *)ALIGNMENT((unsigned long)addr, DRAW_BUFFER_HW_ALIGNMENT);
smesa->back.map = addr;
- smesa->back.offset = addr - smesa->FbBase;
+ smesa->back.offset = addr - (char *)smesa->FbBase;
}
void
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index 00d17da3ba..a070fe3d79 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -57,9 +57,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
-#define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -74,12 +71,9 @@ int GlobalCmdQueueLen = 0;
struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
/*{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },*/
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
@@ -91,9 +85,7 @@ struct dri_extension card_extensions[] =
struct dri_extension card_extensions_6326[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
/*{ "GL_ARB_texture_border_clamp", NULL },*/
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
/*{ "GL_ARB_texture_mirrored_repeat", NULL },*/
/*{ "GL_MESA_ycbcr_texture", NULL },*/
{ NULL, NULL }
diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c
index b1a5d15236..9eb27fef08 100644
--- a/src/mesa/drivers/dri/sis/sis_screen.c
+++ b/src/mesa/drivers/dri/sis/sis_screen.c
@@ -77,6 +77,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
};
uint8_t depth_bits_array[4];
uint8_t stencil_bits_array[4];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = 0;
stencil_bits_array[0] = 0;
@@ -87,6 +88,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
depth_bits_array[3] = 32;
stencil_bits_array[3] = 0;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = 4;
back_buffer_factor = 2;
@@ -100,7 +103,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
configs = driCreateConfigs(fb_format, fb_type, depth_bits_array,
stencil_bits_array, depth_buffer_factor,
- back_buffer_modes, back_buffer_factor);
+ back_buffer_modes, back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
return NULL;
diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c
index 095941aea2..76d12d07b3 100644
--- a/src/mesa/drivers/dri/sis/sis_tris.c
+++ b/src/mesa/drivers/dri/sis/sis_tris.c
@@ -994,7 +994,7 @@ sisFlushPrimsLocked(sisContextPtr smesa)
MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet);
}
while (smesa->vb_last < smesa->vb_cur) {
- sis_emit_func(smesa, smesa->vb_last);
+ sis_emit_func(smesa, (char *)smesa->vb_last);
smesa->vb_last += incr;
}
mWait3DCmdQueue(1);
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 15b57244dc..2e7f11327e 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -72,7 +72,7 @@
#define need_GL_EXT_framebuffer_blit
#define need_GL_EXT_gpu_program_parameters
#define need_GL_EXT_paletted_texture
-#define need_GL_IBM_multimode_draw_arrays
+#define need_GL_EXT_stencil_two_side
#define need_GL_MESA_resize_buffers
#define need_GL_NV_vertex_program
#define need_GL_NV_fragment_program
@@ -103,7 +103,7 @@ const struct dri_extension card_extensions[] =
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
- { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
+ { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions },
{ "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_fragment_program", GL_NV_fragment_program_functions },
@@ -147,6 +147,7 @@ swrastFillInModes(__DRIscreen *psp,
uint8_t depth_bits_array[4];
uint8_t stencil_bits_array[4];
+ uint8_t msaa_samples_array[1];
depth_bits_array[0] = 0;
depth_bits_array[1] = 0;
@@ -161,26 +162,38 @@ swrastFillInModes(__DRIscreen *psp,
stencil_bits_array[2] = 0;
stencil_bits_array[3] = (stencil_bits == 0) ? 8 : stencil_bits;
+ msaa_samples_array[0] = 0;
+
depth_buffer_factor = 4;
back_buffer_factor = 2;
- if (pixel_bits == 8) {
+ switch (pixel_bits) {
+ case 8:
fb_format = GL_RGB;
fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
- }
- else if (pixel_bits == 16) {
+ break;
+ case 16:
fb_format = GL_RGB;
fb_type = GL_UNSIGNED_SHORT_5_6_5;
- }
- else {
+ break;
+ case 24:
+ fb_format = GL_BGR;
+ fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ case 32:
fb_format = GL_BGRA;
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ default:
+ fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
+ pixel_bits);
+ return NULL;
}
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
+ back_buffer_factor, msaa_samples_array, 1);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
@@ -196,7 +209,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
{
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
- __DRIconfig **configs8, **configs16, **configs32;
+ __DRIconfig **configs8, **configs16, **configs24, **configs32;
(void) data;
@@ -213,11 +226,13 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
configs8 = swrastFillInModes(psp, 8, 8, 0, 1);
configs16 = swrastFillInModes(psp, 16, 16, 0, 1);
+ configs24 = swrastFillInModes(psp, 24, 24, 8, 1);
configs32 = swrastFillInModes(psp, 32, 24, 8, 1);
- configs16 = (__DRIconfig **)driConcatConfigs(configs8, configs16);
-
- *driver_configs = driConcatConfigs(configs16, configs32);
+ configs16 = driConcatConfigs(configs8, configs16);
+ configs24 = driConcatConfigs(configs16, configs24);
+ *driver_configs = (const __DRIconfig **)
+ driConcatConfigs(configs24, configs32);
driInitExtensions( NULL, card_extensions, GL_FALSE );
@@ -249,19 +264,24 @@ static GLuint
choose_pixel_format(const GLvisual *v)
{
if (v->rgbMode) {
- int bpp = v->rgbBits;
+ int depth = v->rgbBits;
- if (bpp == 32
+ if (depth == 32
&& v->redMask == 0xff0000
&& v->greenMask == 0x00ff00
&& v->blueMask == 0x0000ff)
return PF_A8R8G8B8;
- else if (bpp == 16
+ else if (depth == 24
+ && v->redMask == 0xff0000
+ && v->greenMask == 0x00ff00
+ && v->blueMask == 0x0000ff)
+ return PF_X8R8G8B8;
+ else if (depth == 16
&& v->redMask == 0xf800
&& v->greenMask == 0x07e0
&& v->blueMask == 0x001f)
return PF_R5G6B5;
- else if (bpp == 8
+ else if (depth == 8
&& v->redMask == 0x07
&& v->greenMask == 0x38
&& v->blueMask == 0xc0)
@@ -290,7 +310,6 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
- int bpp;
unsigned mask = PITCH_ALIGN_BITS - 1;
TRACE;
@@ -299,23 +318,8 @@ swrast_alloc_front_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->Width = width;
rb->Height = height;
- switch (internalFormat) {
- case GL_RGB:
- bpp = rb->RedBits + rb->GreenBits + rb->BlueBits;
- break;
- case GL_RGBA:
- bpp = rb->RedBits + rb->GreenBits + rb->BlueBits + rb->AlphaBits;
- break;
- case GL_COLOR_INDEX8_EXT:
- bpp = rb->IndexBits;
- break;
- default:
- _mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ );
- return GL_FALSE;
- }
-
/* always pad to PITCH_ALIGN_BITS */
- xrb->pitch = ((width * bpp + mask) & ~mask) / 8;
+ xrb->pitch = ((width * xrb->bpp + mask) & ~mask) / 8;
return GL_TRUE;
}
@@ -371,6 +375,17 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
xrb->Base.GreenBits = 8 * sizeof(GLubyte);
xrb->Base.BlueBits = 8 * sizeof(GLubyte);
xrb->Base.AlphaBits = 8 * sizeof(GLubyte);
+ xrb->bpp = 32;
+ break;
+ case PF_X8R8G8B8:
+ xrb->Base.InternalFormat = GL_RGB;
+ xrb->Base._BaseFormat = GL_RGB;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->Base.RedBits = 8 * sizeof(GLubyte);
+ xrb->Base.GreenBits = 8 * sizeof(GLubyte);
+ xrb->Base.BlueBits = 8 * sizeof(GLubyte);
+ xrb->Base.AlphaBits = 0;
+ xrb->bpp = 32;
break;
case PF_R5G6B5:
xrb->Base.InternalFormat = GL_RGB;
@@ -380,6 +395,7 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
xrb->Base.GreenBits = 6 * sizeof(GLubyte);
xrb->Base.BlueBits = 5 * sizeof(GLubyte);
xrb->Base.AlphaBits = 0;
+ xrb->bpp = 16;
break;
case PF_R3G3B2:
xrb->Base.InternalFormat = GL_RGB;
@@ -389,12 +405,14 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
xrb->Base.GreenBits = 3 * sizeof(GLubyte);
xrb->Base.BlueBits = 2 * sizeof(GLubyte);
xrb->Base.AlphaBits = 0;
+ xrb->bpp = 8;
break;
case PF_CI8:
xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT;
xrb->Base._BaseFormat = GL_COLOR_INDEX;
xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->Base.IndexBits = 8 * sizeof(GLubyte);
+ xrb->bpp = 8;
break;
default:
return NULL;
diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h
index a707ffc40a..1a5fb31d5a 100644
--- a/src/mesa/drivers/dri/swrast/swrast_priv.h
+++ b/src/mesa/drivers/dri/swrast/swrast_priv.h
@@ -90,6 +90,8 @@ struct swrast_renderbuffer {
/* renderbuffer pitch (in bytes) */
GLuint pitch;
+ /* bits per pixel of storage */
+ GLuint bpp;
};
static INLINE __DRIcontext *
@@ -115,10 +117,10 @@ swrast_renderbuffer(struct gl_renderbuffer *rb)
* Pixel formats we support
*/
#define PF_CI8 1 /**< Color Index mode */
-#define PF_A8R8G8B8 2 /**< 32-bit TrueColor: 8-A, 8-R, 8-G, 8-B bits */
-#define PF_R5G6B5 3 /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */
-#define PF_R3G3B2 4 /**< 8-bit TrueColor: 3-R, 3-G, 2-B bits */
-
+#define PF_A8R8G8B8 2 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */
+#define PF_R5G6B5 3 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */
+#define PF_R3G3B2 4 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */
+#define PF_X8R8G8B8 5 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */
/**
* Renderbuffer pitch alignment (in bits).
diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c
index 5e990368b2..2d3c25dcbe 100644
--- a/src/mesa/drivers/dri/swrast/swrast_span.c
+++ b/src/mesa/drivers/dri/swrast/swrast_span.c
@@ -79,6 +79,24 @@ static const GLubyte kernel[16] = {
DST[BCOMP] = SRC[0]
+/* 32-bit BGRX */
+#define STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) \
+ DST[3] = 0xff; \
+ DST[2] = VALUE[RCOMP]; \
+ DST[1] = VALUE[GCOMP]; \
+ DST[0] = VALUE[BCOMP]
+#define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \
+ DST[3] = 0xff; \
+ DST[2] = VALUE[RCOMP]; \
+ DST[1] = VALUE[GCOMP]; \
+ DST[0] = VALUE[BCOMP]
+#define FETCH_PIXEL_X8R8G8B8(DST, SRC) \
+ DST[ACOMP] = 0xff; \
+ DST[RCOMP] = SRC[2]; \
+ DST[GCOMP] = SRC[1]; \
+ DST[BCOMP] = SRC[0]
+
+
/* 16-bit BGR */
#define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \
do { \
@@ -139,6 +157,24 @@ static const GLubyte kernel[16] = {
#include "swrast/s_spantemp.h"
+/* 32-bit BGRX */
+#define NAME(FUNC) FUNC##_X8R8G8B8
+#define RB_TYPE GLubyte
+#define SPAN_VARS \
+ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
+#define INIT_PIXEL_PTR(P, X, Y) \
+ GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4;
+#define INC_PIXEL_PTR(P) P += 4
+#define STORE_PIXEL(DST, X, Y, VALUE) \
+ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE)
+#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
+ STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE)
+#define FETCH_PIXEL(DST, SRC) \
+ FETCH_PIXEL_X8R8G8B8(DST, SRC)
+
+#include "swrast/s_spantemp.h"
+
+
/* 16-bit BGR */
#define NAME(FUNC) FUNC##_R5G6B5
#define RB_TYPE GLubyte
@@ -210,6 +246,24 @@ static const GLubyte kernel[16] = {
#include "swrast_spantemp.h"
+/* 32-bit BGRX */
+#define NAME(FUNC) FUNC##_X8R8G8B8_front
+#define RB_TYPE GLubyte
+#define SPAN_VARS \
+ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
+#define INIT_PIXEL_PTR(P, X, Y) \
+ GLubyte *P = (GLubyte *)row;
+#define INC_PIXEL_PTR(P) P += 4
+#define STORE_PIXEL(DST, X, Y, VALUE) \
+ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE)
+#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
+ STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE)
+#define FETCH_PIXEL(DST, SRC) \
+ FETCH_PIXEL_X8R8G8B8(DST, SRC)
+
+#include "swrast_spantemp.h"
+
+
/* 16-bit BGR */
#define NAME(FUNC) FUNC##_R5G6B5_front
#define RB_TYPE GLubyte
@@ -279,6 +333,15 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
xrb->Base.PutValues = put_values_A8R8G8B8;
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8;
break;
+ case PF_X8R8G8B8:
+ xrb->Base.GetRow = get_row_X8R8G8B8;
+ xrb->Base.GetValues = get_values_X8R8G8B8;
+ xrb->Base.PutRow = put_row_X8R8G8B8;
+ xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8;
+ xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8;
+ xrb->Base.PutValues = put_values_X8R8G8B8;
+ xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8;
+ break;
case PF_R5G6B5:
xrb->Base.GetRow = get_row_R5G6B5;
xrb->Base.GetValues = get_values_R5G6B5;
@@ -334,6 +397,15 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
xrb->Base.PutValues = put_values_A8R8G8B8_front;
xrb->Base.PutMonoValues = put_mono_values_A8R8G8B8_front;
break;
+ case PF_X8R8G8B8:
+ xrb->Base.GetRow = get_row_X8R8G8B8_front;
+ xrb->Base.GetValues = get_values_X8R8G8B8_front;
+ xrb->Base.PutRow = put_row_X8R8G8B8_front;
+ xrb->Base.PutRowRGB = put_row_rgb_X8R8G8B8_front;
+ xrb->Base.PutMonoRow = put_mono_row_X8R8G8B8_front;
+ xrb->Base.PutValues = put_values_X8R8G8B8_front;
+ xrb->Base.PutMonoValues = put_mono_values_X8R8G8B8_front;
+ break;
case PF_R5G6B5:
xrb->Base.GetRow = get_row_R5G6B5_front;
xrb->Base.GetValues = get_values_R5G6B5_front;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index ef688d103d..20046fcb3a 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -58,20 +58,15 @@
#include "utils.h"
-#define need_GL_ARB_multisample
/* #define need_GL_ARB_point_parameters */
#define need_GL_ARB_occlusion_query
-#define need_GL_ARB_texture_compression
-#define need_GL_ARB_vertex_buffer_object
/* #define need_GL_ARB_vertex_program */
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
-#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_paletted_texture
/* #define need_GL_EXT_secondary_color */
-#define need_GL_IBM_multimode_draw_arrays
/* #define need_GL_MESA_program_debug */
/* #define need_GL_NV_vertex_program */
#include "extension_helper.h"
@@ -82,20 +77,16 @@
*/
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
- { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
{ "GL_EXT_shared_texture_palette", NULL },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_env_add", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
- { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
#ifdef need_GL_ARB_point_parameters
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
@@ -122,7 +113,6 @@ const struct dri_extension card_extensions[] =
*/
const struct dri_extension napalm_extensions[] =
{
- { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
@@ -319,6 +309,8 @@ GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxLineWidthAA = 1.0;
ctx->Const.LineWidthGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext( ctx );
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
index 2cef079515..8472df607a 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
@@ -110,13 +110,13 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
static void
-tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+tdfxBeginQuery(GLcontext *ctx, struct gl_query_object *q)
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
(void) q;
- if (target == GL_SAMPLES_PASSED_ARB) {
+ if (q->Target == GL_SAMPLES_PASSED_ARB) {
LOCK_HARDWARE(fxMesa);
fxMesa->Glide.grFinish();
fxMesa->Glide.grReset(GR_STATS_PIXELS);
@@ -126,14 +126,14 @@ tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
static void
-tdfxEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+tdfxEndQuery(GLcontext *ctx, struct gl_query_object *q)
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FxI32 total_pixels;
FxI32 z_fail_pixels;
- if (target == GL_SAMPLES_PASSED_ARB) {
+ if (q->Target == GL_SAMPLES_PASSED_ARB) {
LOCK_HARDWARE(fxMesa);
fxMesa->Glide.grFinish();
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index cd22b84951..5f2f5cfff5 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -361,6 +361,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
static const GLenum db_modes[2] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML };
uint8_t depth_bits_array[4];
uint8_t stencil_bits_array[4];
+ uint8_t msaa_samples_array[1];
if(deep) {
depth_bits_array[0] = 0;
depth_bits_array[1] = 24;
@@ -377,13 +378,17 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
stencil_bits_array[3] = 8;
}
- return driCreateConfigs(
- deep ? GL_RGBA : GL_RGB,
- deep ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_5_6_5,
- depth_bits_array,
- stencil_bits_array,
- deep ? 2 : 4,
- db_modes, 2);
+ msaa_samples_array[0] = 0;
+
+ return (const __DRIconfig **)
+ driCreateConfigs(deep ? GL_RGBA : GL_RGB,
+ deep ? GL_UNSIGNED_INT_8_8_8_8 :
+ GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array,
+ stencil_bits_array,
+ deep ? 2 : 4,
+ db_modes, 2,
+ msaa_samples_array, 1);
}
/**
diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c
index e134cfcf8e..aefd8a243f 100644
--- a/src/mesa/drivers/dri/trident/trident_context.c
+++ b/src/mesa/drivers/dri/trident/trident_context.c
@@ -128,6 +128,8 @@ tridentCreateContext( const __GLcontextModes *glVisual,
ctx->Const.MaxPointSizeAA = 16.0;
ctx->Const.PointSizeGranularity = 0.25;
+ ctx->Const.MaxDrawBuffers = 1;
+
#if 0
tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize );
diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c
index b231f5ef15..055a914595 100644
--- a/src/mesa/drivers/dri/trident/trident_vb.c
+++ b/src/mesa/drivers/dri/trident/trident_vb.c
@@ -402,7 +402,7 @@ void tridentInitVB( GLcontext *ctx )
tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx);
GLuint size = TNL_CONTEXT(ctx)->vb.Size;
- tmesa->verts = (char *)ALIGN_MALLOC( size * 16 * 4, 32 );
+ tmesa->verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 );
{
static int firsttime = 1;
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index f5bdb65eb0..6eb19ac079 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -62,9 +62,7 @@
#include "main/macros.h"
#include "drirenderbuffer.h"
-#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
-#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -366,14 +364,12 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
*/
const struct dri_extension card_extensions[] =
{
- { "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
/* { "GL_ARB_texture_env_dot3", NULL }, */
{ "GL_ARB_texture_mirrored_repeat", NULL },
- { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
@@ -577,6 +573,8 @@ viaCreateContext(const __GLcontextModes *visual,
ctx->Const.MaxPointSizeAA = 1.0;
ctx->Const.PointSizeGranularity = 1.0;
+ ctx->Const.MaxDrawBuffers = 1;
+
ctx->Driver.GetString = viaGetString;
ctx->DriverCtx = (void *)vmesa;
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index 988f9935ac..e9f566161c 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -342,6 +342,7 @@ viaFillInModes( __DRIscreenPrivate *psp,
*/
static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 };
static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 };
+ uint8_t msaa_samples_array[1] = { 0 };
const unsigned depth_buffer_factor = 3;
if ( pixel_bits == 16 ) {
@@ -356,7 +357,8 @@ viaFillInModes( __DRIscreenPrivate *psp,
configs = driCreateConfigs(fb_format, fb_type,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
+ back_buffer_factor,
+ msaa_samples_array, 1);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 3c874ba57a..531558dc4d 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -685,7 +685,7 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer )
}
{
struct gl_framebuffer *fb = &buffer->glframebuffer;
- _mesa_unreference_framebuffer(&fb);
+ _mesa_reference_framebuffer(&fb, NULL);
}
}
}
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index b7708fd636..238f491599 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -728,7 +728,7 @@ errorhandler:
FREE(fxMesa->fogTable);
}
if (fxMesa->glBuffer) {
- _mesa_unreference_framebuffer(&fxMesa->glBuffer);
+ _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL);
}
if (fxMesa->glVis) {
_mesa_destroy_visual(fxMesa->glVis);
@@ -828,7 +828,7 @@ fxMesaDestroyContext(fxMesaContext fxMesa)
fxDDDestroyFxMesaContext(fxMesa); /* must be before _mesa_destroy_context */
_mesa_destroy_visual(fxMesa->glVis);
_mesa_destroy_context(fxMesa->glCtx);
- _mesa_unreference_framebuffer(&fxMesa->glBuffer);
+ _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL);
fxTMClose(fxMesa); /* must be after _mesa_destroy_context */
FREE(fxMesa);
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 213ef2382f..338cd37382 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -1773,6 +1773,8 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1;
ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits);
+ ctx->Const.MaxDrawBuffers = 1;
+
fxMesa->new_state = _NEW_ALL;
if (!fxMesa->haveHwStencil) {
/* don't touch stencil if there is none */
@@ -1862,7 +1864,6 @@ fxDDInitExtensions(GLcontext * ctx)
}
if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
- _mesa_enable_extension(ctx, "GL_ARB_texture_compression");
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
_mesa_enable_extension(ctx, "GL_S3_s3tc");
@@ -1894,7 +1895,6 @@ fxDDInitExtensions(GLcontext * ctx)
* fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock:
* grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette));
*/
- /*_mesa_enable_extension(ctx, "GL_ARB_texture_compression");*/
_mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap");
}
@@ -1917,9 +1917,6 @@ fxDDInitExtensions(GLcontext * ctx)
}
/* core-level extensions */
- _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays");
- _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays");
- _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
/* dangerous */
if (getenv("MESA_FX_ALLOW_VP")) {
_mesa_enable_extension(ctx, "GL_ARB_vertex_program");
diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c
index 34cce977c8..918ec41856 100644
--- a/src/mesa/drivers/glslcompiler/glslcompiler.c
+++ b/src/mesa/drivers/glslcompiler/glslcompiler.c
@@ -227,7 +227,7 @@ PrintShaderInstructions(GLuint shader, FILE *f)
GET_CURRENT_CONTEXT(ctx);
struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
struct gl_program *prog = sh->Program;
- _mesa_print_program_opt(prog, Options.Mode, Options.LineNumbers);
+ _mesa_fprint_program_opt(stdout, prog, Options.Mode, Options.LineNumbers);
}
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index f2367bbbb7..904659e345 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1310,7 +1310,7 @@ OSMesaDestroyContext( OSMesaContext osmesa )
_swrast_DestroyContext( &osmesa->mesa );
_mesa_destroy_visual( osmesa->gl_visual );
- _mesa_unreference_framebuffer( &osmesa->gl_buffer );
+ _mesa_reference_framebuffer( &osmesa->gl_buffer, NULL );
_mesa_free_context_data( &osmesa->mesa );
_mesa_free( osmesa );
diff --git a/src/mesa/drivers/windows/gldirect/dglcontext.c b/src/mesa/drivers/windows/gldirect/dglcontext.c
index 4ad7a76e67..e9c23d1ccb 100644
--- a/src/mesa/drivers/windows/gldirect/dglcontext.c
+++ b/src/mesa/drivers/windows/gldirect/dglcontext.c
@@ -1482,6 +1482,7 @@ SkipPrimaryCreate:
#else
lpCtx->glCtx->Const.MaxTextureSize = 1024;
#endif
+ lpCtx->glCtx->Const.MaxDrawBuffers = 1;
// Setup the Display Driver pointers
dglSetupDDPointers(lpCtx->glCtx);
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c
index 0f8fe33eb1..fa44a952a0 100644
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c
+++ b/src/mesa/drivers/windows/gldirect/dx7/gld_wgl_dx7.c
@@ -1422,6 +1422,8 @@ BOOL gldInitialiseMesa_DX(
lpCtx->glCtx->Const.MaxTextureUnits = 1;
}
+ lpCtx->glCtx->Const.MaxDrawBuffers = 1;
+
// max texture size
// MaxTextureSize = min(gld->d3dCaps8.MaxTextureHeight, gld->d3dCaps8.MaxTextureWidth);
MaxTextureSize = min(gld->d3dCaps.dwMaxTextureHeight, gld->d3dCaps.dwMaxTextureWidth);
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c
index 690f68b68f..011d810e97 100644
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c
+++ b/src/mesa/drivers/windows/gldirect/dx8/gld_wgl_dx8.c
@@ -1204,6 +1204,7 @@ BOOL gldInitialiseMesa_DX(
MaxTextureSize >>= 1;
}
lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
+ lpCtx->glCtx->Const.MaxDrawBuffers = 1;
IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE);
IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
index dc465c5418..a03b865bb4 100644
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
+++ b/src/mesa/drivers/windows/gldirect/dx9/gld_wgl_dx9.c
@@ -1206,6 +1206,7 @@ BOOL gldInitialiseMesa_DX(
MaxTextureSize >>= 1;
}
lpCtx->glCtx->Const.MaxTextureLevels = (TextureLevels) ? TextureLevels : 8;
+ lpCtx->glCtx->Const.MaxDrawBuffers = 1;
IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_LIGHTING, FALSE);
IDirect3DDevice9_SetRenderState(gld->pDev, D3DRS_CULLMODE, D3DCULL_NONE);
diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
index b590dc795a..342a742867 100644
--- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
+++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
@@ -1625,6 +1625,7 @@ BOOL gldInitialiseMesa_MesaSW(
// Added this to force max texture diminsion to 256. KeithH
ctx->Const.MaxTextureLevels = 8;
+ ctx->Const.MaxDrawBuffers = 1;
_mesa_enable_sw_extensions(ctx);
_mesa_enable_imaging_extensions(ctx);
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index ea3585258d..3b004a3ee2 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,8 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.5
*
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1392,6 +1393,25 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
}
+/**
+ * Init basic fields of a new fake_glx_context.
+ */
+static void
+init_glx_context(struct fake_glx_context *glxCtx, Display *dpy)
+{
+ /* Always return True. See if anyone's confused... */
+ GLboolean direct = GL_TRUE;
+
+ glxCtx->xmesaContext->direct = direct;
+ glxCtx->glxContext.isDirect = direct;
+ glxCtx->glxContext.currentDpy = dpy;
+ glxCtx->glxContext.xid = (XID) glxCtx; /* self pointer */
+
+ assert((void *) glxCtx == (void *) &(glxCtx->glxContext));
+}
+
+
+
static GLXContext
Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
GLXContext share_list, Bool direct )
@@ -1430,12 +1450,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
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));
+ init_glx_context(glxCtx, dpy);
return (GLXContext) glxCtx;
}
@@ -2441,12 +2456,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
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));
+ init_glx_context(glxCtx, dpy);
return (GLXContext) glxCtx;
}
@@ -2664,12 +2674,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re
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));
+ init_glx_context(glxCtx, dpy);
return (GLXContext) glxCtx;
}
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 18aa8bcc09..2a8c3a4fd3 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -492,7 +492,7 @@ xmesa_free_buffer(XMesaBuffer buffer)
b->frontxrb->drawable = 0;
/* Unreference. If count = zero we'll really delete the buffer */
- _mesa_unreference_framebuffer(&fb);
+ _mesa_reference_framebuffer(&fb, NULL);
return;
}
@@ -1325,7 +1325,6 @@ xmesa_convert_from_x_visual_type( int visualType )
#define need_GL_EXT_framebuffer_blit
#define need_GL_EXT_gpu_program_parameters
#define need_GL_EXT_paletted_texture
-#define need_GL_IBM_multimode_draw_arrays
#define need_GL_MESA_resize_buffers
#define need_GL_NV_vertex_program
#define need_GL_NV_fragment_program
@@ -1355,7 +1354,6 @@ const struct dri_extension card_extensions[] =
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
- { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
{ "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_fragment_program", GL_NV_fragment_program_functions },
diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml
new file mode 100644
index 0000000000..b700e7e77d
--- /dev/null
+++ b/src/mesa/glapi/ARB_framebuffer_object.xml
@@ -0,0 +1,269 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+
+<OpenGLAPI>
+<category name="GL_ARB_framebuffer_object" number="45">
+ <enum name="FRAMEBUFFER" value="0x8D40"/>
+ <enum name="READ_FRAMEBUFFER" value="0x8CA8"/>
+ <enum name="DRAW_FRAMEBUFFER" value="0x8CA9"/>
+
+ <enum name="RENDERBUFFER" value="0x8D41"/>
+
+ <enum name="STENCIL_INDEX1_EXT" value="0x8D46"/>
+ <enum name="STENCIL_INDEX4_EXT" value="0x8D47"/>
+ <enum name="STENCIL_INDEX8_EXT" value="0x8D48"/>
+ <enum name="STENCIL_INDEX16_EXT" value="0x8D49"/>
+
+ <enum name="RENDERBUFFER_WIDTH" value="0x8D42"/>
+ <enum name="RENDERBUFFER_HEIGHT" value="0x8D43"/>
+ <enum name="RENDERBUFFER_INTERNAL_FORMAT" value="0x8D44"/>
+ <enum name="RENDERBUFFER_RED_SIZE" value="0x8D50"/>
+ <enum name="RENDERBUFFER_GREEN_SIZE" value="0x8D51"/>
+ <enum name="RENDERBUFFER_BLUE_SIZE" value="0x8D52"/>
+ <enum name="RENDERBUFFER_ALPHA_SIZE" value="0x8D53"/>
+ <enum name="RENDERBUFFER_DEPTH_SIZE" value="0x8D54"/>
+ <enum name="RENDERBUFFER_STENCIL_SIZE" value="0x8D55"/>
+ <enum name="RENDERBUFFER_SAMPLES" value="0x8CAB"/>
+
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" count="1" value="0x8CD0">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" count="1" value="0x8CD1">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" count="1" value="0x8CD2">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" count="1" value="0x8CD3">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" count="1" value="0x8CD4">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" count="1" value="0x8210">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" count="1" value="0x8211">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_RED_SIZE" count="1" value="0x8212">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" count="1" value="0x8213">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" count="1" value="0x8214">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" count="1" value="0x8215">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" count="1" value="0x8216">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+ <enum name="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" count="1" value="0x8217">
+ <size name="GetFramebufferAttachmentParameteriv" mode="get"/>
+ </enum>
+
+ <enum name="SRGB" value="0x8C40"/>
+ <enum name="UNSIGNED_NORMALIZED" value="0x8C17"/>
+ <enum name="FRAMEBUFFER_DEFAULT" value="0x8218"/>
+ <enum name="INDEX" value="0x8222"/>
+
+ <enum name="COLOR_ATTACHMENT0" value="0x8CE0"/>
+ <enum name="COLOR_ATTACHMENT1" value="0x8CE1"/>
+ <enum name="COLOR_ATTACHMENT2" value="0x8CE2"/>
+ <enum name="COLOR_ATTACHMENT3" value="0x8CE3"/>
+ <enum name="COLOR_ATTACHMENT4" value="0x8CE4"/>
+ <enum name="COLOR_ATTACHMENT5" value="0x8CE5"/>
+ <enum name="COLOR_ATTACHMENT6" value="0x8CE6"/>
+ <enum name="COLOR_ATTACHMENT7" value="0x8CE7"/>
+ <enum name="COLOR_ATTACHMENT8" value="0x8CE8"/>
+ <enum name="COLOR_ATTACHMENT9" value="0x8CE9"/>
+ <enum name="COLOR_ATTACHMENT10" value="0x8CEA"/>
+ <enum name="COLOR_ATTACHMENT11" value="0x8CEB"/>
+ <enum name="COLOR_ATTACHMENT12" value="0x8CEC"/>
+ <enum name="COLOR_ATTACHMENT13" value="0x8CED"/>
+ <enum name="COLOR_ATTACHMENT14" value="0x8CEE"/>
+ <enum name="COLOR_ATTACHMENT15" value="0x8CEF"/>
+ <enum name="DEPTH_ATTACHMENT" value="0x8D00"/>
+ <enum name="STENCIL_ATTACHMENT" value="0x8D20"/>
+ <enum name="DEPTH_STENCIL_ATTACHMENT" value="0x821A"/>
+
+ <enum name="MAX_SAMPLES" value="0x8D57"/>
+
+ <enum name="FRAMEBUFFER_COMPLETE" value="0x8CD5"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT" value="0x8CD6"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" value="0x8CD7"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" value="0x8CDB"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" value="0x8CDC"/>
+ <enum name="FRAMEBUFFER_UNSUPPORTED" value="0x8CDD"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" value="0x8D56"/>
+ <enum name="FRAMEBUFFER_UNDEFINED" value="0x8219"/>
+
+ <enum name="FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="READ_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CAA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RENDERBUFFER_BINDING_EXT" count="1" value="0x8CA7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_COLOR_ATTACHMENTS_EXT" count="1" value="0x8CDF">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_RENDERBUFFER_SIZE_EXT" count="1" value="0x84E8">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <enum name="INVALID_FRAMEBUFFER_OPERATION" value="0x0506"/>
+
+ <enum name="DEPTH_STENCIL" value="0x84F9"/>
+
+ <enum name="UNSIGNED_INT_24_8" value="0x84FA"/>
+
+ <enum name="DEPTH24_STENCIL8" value="0x88F0"/>
+
+ <enum name="TEXTURE_STENCIL_SIZE" value="0x88F1"/>
+
+
+
+ <function name="IsRenderbuffer" alias="IsRenderbufferEXT">
+ <param name="renderbuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="BindRenderbuffer" alias="BindRenderbufferEXT">
+ <param name="target" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="DeleteRenderbuffers" alias="DeleteRenderbuffersEXT">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="GenRenderbuffers" alias="GenRenderbuffersEXT">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="renderbuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="RenderbufferStorage" alias="RenderbufferStorageEXT">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+
+ <function name="RenderbufferStorageMultisample" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="samples" type="GLsizei"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+
+ <function name="GetRenderbufferParameteriv" alias="GetRenderbufferParameterivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="IsFramebuffer" alias="IsFramebufferEXT">
+ <param name="framebuffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="BindFramebuffer" alias="BindFramebufferEXT">
+ <param name="target" type="GLenum"/>
+ <param name="framebuffer" type="GLuint"/>
+ </function>
+
+ <function name="DeleteFramebuffers" alias="DeleteFramebuffersEXT">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="const GLuint *" count="n"/>
+ </function>
+
+ <function name="GenFramebuffers" alias="GenFramebuffersEXT">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="framebuffers" type="GLuint *" count="n" output="true"/>
+ </function>
+
+ <function name="CheckFramebufferStatus" alias="CheckFramebufferStatusEXT">
+ <param name="target" type="GLenum"/>
+ <return type="GLenum"/>
+ </function>
+
+ <function name="FramebufferTexture1D" alias="FramebufferTexture1DEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </function>
+
+ <function name="FramebufferTexture2D" alias="FramebufferTexture2DEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </function>
+
+ <function name="FramebufferTexture3D" alias="FramebufferTexture3DEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="textarget" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ </function>
+
+ <function name="FramebufferTextureLayer" alias="FramebufferTextureLayerEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ <param name="layer" type="GLint"/>
+ </function>
+
+ <function name="FramebufferRenderbuffer" alias="FramebufferRenderbufferEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="renderbuffertarget" type="GLenum"/>
+ <param name="renderbuffer" type="GLuint"/>
+ </function>
+
+ <function name="GetFramebufferAttachmentParameteriv" alias="GetFramebufferAttachmentParameterivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="BlitFramebuffer" alias="BlitFramebufferEXT">
+ <param name="srcX0" type="GLint"/>
+ <param name="srcY0" type="GLint"/>
+ <param name="srcX1" type="GLint"/>
+ <param name="srcY1" type="GLint"/>
+ <param name="dstX0" type="GLint"/>
+ <param name="dstY0" type="GLint"/>
+ <param name="dstX1" type="GLint"/>
+ <param name="dstY1" type="GLint"/>
+ <param name="mask" type="GLbitfield"/>
+ <param name="filter" type="GLenum"/>
+ </function>
+
+ <function name="GenerateMipmap" alias="GenerateMipmapEXT">
+ <param name="target" type="GLenum"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile
index adc53d9249..f524167a47 100644
--- a/src/mesa/glapi/Makefile
+++ b/src/mesa/glapi/Makefile
@@ -47,6 +47,7 @@ SERVER_OUTPUTS = \
API_XML = gl_API.xml \
EXT_framebuffer_object.xml \
+ ARB_framebuffer_object.xml \
APPLE_vertex_array_object.xml
COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index f019aa6aaf..d7f21692ed 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -1743,6 +1743,9 @@
#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters
#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB)
#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn)
+#define CALL_RenderbufferStorageMultisample(disp, parameters) (*((disp)->RenderbufferStorageMultisample)) parameters
+#define GET_RenderbufferStorageMultisample(disp) ((disp)->RenderbufferStorageMultisample)
+#define SET_RenderbufferStorageMultisample(disp, fn) ((disp)->RenderbufferStorageMultisample = fn)
#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters
#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT)
#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn)
@@ -2373,7 +2376,7 @@
#else
-#define driDispatchRemapTable_size 362
+#define driDispatchRemapTable_size 363
extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define AttachShader_remap_index 0
@@ -2529,215 +2532,216 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define GetActiveAttribARB_remap_index 150
#define GetAttribLocationARB_remap_index 151
#define DrawBuffersARB_remap_index 152
-#define PolygonOffsetEXT_remap_index 153
-#define GetPixelTexGenParameterfvSGIS_remap_index 154
-#define GetPixelTexGenParameterivSGIS_remap_index 155
-#define PixelTexGenParameterfSGIS_remap_index 156
-#define PixelTexGenParameterfvSGIS_remap_index 157
-#define PixelTexGenParameteriSGIS_remap_index 158
-#define PixelTexGenParameterivSGIS_remap_index 159
-#define SampleMaskSGIS_remap_index 160
-#define SamplePatternSGIS_remap_index 161
-#define ColorPointerEXT_remap_index 162
-#define EdgeFlagPointerEXT_remap_index 163
-#define IndexPointerEXT_remap_index 164
-#define NormalPointerEXT_remap_index 165
-#define TexCoordPointerEXT_remap_index 166
-#define VertexPointerEXT_remap_index 167
-#define PointParameterfEXT_remap_index 168
-#define PointParameterfvEXT_remap_index 169
-#define LockArraysEXT_remap_index 170
-#define UnlockArraysEXT_remap_index 171
-#define CullParameterdvEXT_remap_index 172
-#define CullParameterfvEXT_remap_index 173
-#define SecondaryColor3bEXT_remap_index 174
-#define SecondaryColor3bvEXT_remap_index 175
-#define SecondaryColor3dEXT_remap_index 176
-#define SecondaryColor3dvEXT_remap_index 177
-#define SecondaryColor3fEXT_remap_index 178
-#define SecondaryColor3fvEXT_remap_index 179
-#define SecondaryColor3iEXT_remap_index 180
-#define SecondaryColor3ivEXT_remap_index 181
-#define SecondaryColor3sEXT_remap_index 182
-#define SecondaryColor3svEXT_remap_index 183
-#define SecondaryColor3ubEXT_remap_index 184
-#define SecondaryColor3ubvEXT_remap_index 185
-#define SecondaryColor3uiEXT_remap_index 186
-#define SecondaryColor3uivEXT_remap_index 187
-#define SecondaryColor3usEXT_remap_index 188
-#define SecondaryColor3usvEXT_remap_index 189
-#define SecondaryColorPointerEXT_remap_index 190
-#define MultiDrawArraysEXT_remap_index 191
-#define MultiDrawElementsEXT_remap_index 192
-#define FogCoordPointerEXT_remap_index 193
-#define FogCoorddEXT_remap_index 194
-#define FogCoorddvEXT_remap_index 195
-#define FogCoordfEXT_remap_index 196
-#define FogCoordfvEXT_remap_index 197
-#define PixelTexGenSGIX_remap_index 198
-#define BlendFuncSeparateEXT_remap_index 199
-#define FlushVertexArrayRangeNV_remap_index 200
-#define VertexArrayRangeNV_remap_index 201
-#define CombinerInputNV_remap_index 202
-#define CombinerOutputNV_remap_index 203
-#define CombinerParameterfNV_remap_index 204
-#define CombinerParameterfvNV_remap_index 205
-#define CombinerParameteriNV_remap_index 206
-#define CombinerParameterivNV_remap_index 207
-#define FinalCombinerInputNV_remap_index 208
-#define GetCombinerInputParameterfvNV_remap_index 209
-#define GetCombinerInputParameterivNV_remap_index 210
-#define GetCombinerOutputParameterfvNV_remap_index 211
-#define GetCombinerOutputParameterivNV_remap_index 212
-#define GetFinalCombinerInputParameterfvNV_remap_index 213
-#define GetFinalCombinerInputParameterivNV_remap_index 214
-#define ResizeBuffersMESA_remap_index 215
-#define WindowPos2dMESA_remap_index 216
-#define WindowPos2dvMESA_remap_index 217
-#define WindowPos2fMESA_remap_index 218
-#define WindowPos2fvMESA_remap_index 219
-#define WindowPos2iMESA_remap_index 220
-#define WindowPos2ivMESA_remap_index 221
-#define WindowPos2sMESA_remap_index 222
-#define WindowPos2svMESA_remap_index 223
-#define WindowPos3dMESA_remap_index 224
-#define WindowPos3dvMESA_remap_index 225
-#define WindowPos3fMESA_remap_index 226
-#define WindowPos3fvMESA_remap_index 227
-#define WindowPos3iMESA_remap_index 228
-#define WindowPos3ivMESA_remap_index 229
-#define WindowPos3sMESA_remap_index 230
-#define WindowPos3svMESA_remap_index 231
-#define WindowPos4dMESA_remap_index 232
-#define WindowPos4dvMESA_remap_index 233
-#define WindowPos4fMESA_remap_index 234
-#define WindowPos4fvMESA_remap_index 235
-#define WindowPos4iMESA_remap_index 236
-#define WindowPos4ivMESA_remap_index 237
-#define WindowPos4sMESA_remap_index 238
-#define WindowPos4svMESA_remap_index 239
-#define MultiModeDrawArraysIBM_remap_index 240
-#define MultiModeDrawElementsIBM_remap_index 241
-#define DeleteFencesNV_remap_index 242
-#define FinishFenceNV_remap_index 243
-#define GenFencesNV_remap_index 244
-#define GetFenceivNV_remap_index 245
-#define IsFenceNV_remap_index 246
-#define SetFenceNV_remap_index 247
-#define TestFenceNV_remap_index 248
-#define AreProgramsResidentNV_remap_index 249
-#define BindProgramNV_remap_index 250
-#define DeleteProgramsNV_remap_index 251
-#define ExecuteProgramNV_remap_index 252
-#define GenProgramsNV_remap_index 253
-#define GetProgramParameterdvNV_remap_index 254
-#define GetProgramParameterfvNV_remap_index 255
-#define GetProgramStringNV_remap_index 256
-#define GetProgramivNV_remap_index 257
-#define GetTrackMatrixivNV_remap_index 258
-#define GetVertexAttribPointervNV_remap_index 259
-#define GetVertexAttribdvNV_remap_index 260
-#define GetVertexAttribfvNV_remap_index 261
-#define GetVertexAttribivNV_remap_index 262
-#define IsProgramNV_remap_index 263
-#define LoadProgramNV_remap_index 264
-#define ProgramParameters4dvNV_remap_index 265
-#define ProgramParameters4fvNV_remap_index 266
-#define RequestResidentProgramsNV_remap_index 267
-#define TrackMatrixNV_remap_index 268
-#define VertexAttrib1dNV_remap_index 269
-#define VertexAttrib1dvNV_remap_index 270
-#define VertexAttrib1fNV_remap_index 271
-#define VertexAttrib1fvNV_remap_index 272
-#define VertexAttrib1sNV_remap_index 273
-#define VertexAttrib1svNV_remap_index 274
-#define VertexAttrib2dNV_remap_index 275
-#define VertexAttrib2dvNV_remap_index 276
-#define VertexAttrib2fNV_remap_index 277
-#define VertexAttrib2fvNV_remap_index 278
-#define VertexAttrib2sNV_remap_index 279
-#define VertexAttrib2svNV_remap_index 280
-#define VertexAttrib3dNV_remap_index 281
-#define VertexAttrib3dvNV_remap_index 282
-#define VertexAttrib3fNV_remap_index 283
-#define VertexAttrib3fvNV_remap_index 284
-#define VertexAttrib3sNV_remap_index 285
-#define VertexAttrib3svNV_remap_index 286
-#define VertexAttrib4dNV_remap_index 287
-#define VertexAttrib4dvNV_remap_index 288
-#define VertexAttrib4fNV_remap_index 289
-#define VertexAttrib4fvNV_remap_index 290
-#define VertexAttrib4sNV_remap_index 291
-#define VertexAttrib4svNV_remap_index 292
-#define VertexAttrib4ubNV_remap_index 293
-#define VertexAttrib4ubvNV_remap_index 294
-#define VertexAttribPointerNV_remap_index 295
-#define VertexAttribs1dvNV_remap_index 296
-#define VertexAttribs1fvNV_remap_index 297
-#define VertexAttribs1svNV_remap_index 298
-#define VertexAttribs2dvNV_remap_index 299
-#define VertexAttribs2fvNV_remap_index 300
-#define VertexAttribs2svNV_remap_index 301
-#define VertexAttribs3dvNV_remap_index 302
-#define VertexAttribs3fvNV_remap_index 303
-#define VertexAttribs3svNV_remap_index 304
-#define VertexAttribs4dvNV_remap_index 305
-#define VertexAttribs4fvNV_remap_index 306
-#define VertexAttribs4svNV_remap_index 307
-#define VertexAttribs4ubvNV_remap_index 308
-#define AlphaFragmentOp1ATI_remap_index 309
-#define AlphaFragmentOp2ATI_remap_index 310
-#define AlphaFragmentOp3ATI_remap_index 311
-#define BeginFragmentShaderATI_remap_index 312
-#define BindFragmentShaderATI_remap_index 313
-#define ColorFragmentOp1ATI_remap_index 314
-#define ColorFragmentOp2ATI_remap_index 315
-#define ColorFragmentOp3ATI_remap_index 316
-#define DeleteFragmentShaderATI_remap_index 317
-#define EndFragmentShaderATI_remap_index 318
-#define GenFragmentShadersATI_remap_index 319
-#define PassTexCoordATI_remap_index 320
-#define SampleMapATI_remap_index 321
-#define SetFragmentShaderConstantATI_remap_index 322
-#define PointParameteriNV_remap_index 323
-#define PointParameterivNV_remap_index 324
-#define ActiveStencilFaceEXT_remap_index 325
-#define BindVertexArrayAPPLE_remap_index 326
-#define DeleteVertexArraysAPPLE_remap_index 327
-#define GenVertexArraysAPPLE_remap_index 328
-#define IsVertexArrayAPPLE_remap_index 329
-#define GetProgramNamedParameterdvNV_remap_index 330
-#define GetProgramNamedParameterfvNV_remap_index 331
-#define ProgramNamedParameter4dNV_remap_index 332
-#define ProgramNamedParameter4dvNV_remap_index 333
-#define ProgramNamedParameter4fNV_remap_index 334
-#define ProgramNamedParameter4fvNV_remap_index 335
-#define DepthBoundsEXT_remap_index 336
-#define BlendEquationSeparateEXT_remap_index 337
-#define BindFramebufferEXT_remap_index 338
-#define BindRenderbufferEXT_remap_index 339
-#define CheckFramebufferStatusEXT_remap_index 340
-#define DeleteFramebuffersEXT_remap_index 341
-#define DeleteRenderbuffersEXT_remap_index 342
-#define FramebufferRenderbufferEXT_remap_index 343
-#define FramebufferTexture1DEXT_remap_index 344
-#define FramebufferTexture2DEXT_remap_index 345
-#define FramebufferTexture3DEXT_remap_index 346
-#define GenFramebuffersEXT_remap_index 347
-#define GenRenderbuffersEXT_remap_index 348
-#define GenerateMipmapEXT_remap_index 349
-#define GetFramebufferAttachmentParameterivEXT_remap_index 350
-#define GetRenderbufferParameterivEXT_remap_index 351
-#define IsFramebufferEXT_remap_index 352
-#define IsRenderbufferEXT_remap_index 353
-#define RenderbufferStorageEXT_remap_index 354
-#define BlitFramebufferEXT_remap_index 355
-#define FramebufferTextureLayerEXT_remap_index 356
-#define StencilFuncSeparateATI_remap_index 357
-#define ProgramEnvParameters4fvEXT_remap_index 358
-#define ProgramLocalParameters4fvEXT_remap_index 359
-#define GetQueryObjecti64vEXT_remap_index 360
-#define GetQueryObjectui64vEXT_remap_index 361
+#define RenderbufferStorageMultisample_remap_index 153
+#define PolygonOffsetEXT_remap_index 154
+#define GetPixelTexGenParameterfvSGIS_remap_index 155
+#define GetPixelTexGenParameterivSGIS_remap_index 156
+#define PixelTexGenParameterfSGIS_remap_index 157
+#define PixelTexGenParameterfvSGIS_remap_index 158
+#define PixelTexGenParameteriSGIS_remap_index 159
+#define PixelTexGenParameterivSGIS_remap_index 160
+#define SampleMaskSGIS_remap_index 161
+#define SamplePatternSGIS_remap_index 162
+#define ColorPointerEXT_remap_index 163
+#define EdgeFlagPointerEXT_remap_index 164
+#define IndexPointerEXT_remap_index 165
+#define NormalPointerEXT_remap_index 166
+#define TexCoordPointerEXT_remap_index 167
+#define VertexPointerEXT_remap_index 168
+#define PointParameterfEXT_remap_index 169
+#define PointParameterfvEXT_remap_index 170
+#define LockArraysEXT_remap_index 171
+#define UnlockArraysEXT_remap_index 172
+#define CullParameterdvEXT_remap_index 173
+#define CullParameterfvEXT_remap_index 174
+#define SecondaryColor3bEXT_remap_index 175
+#define SecondaryColor3bvEXT_remap_index 176
+#define SecondaryColor3dEXT_remap_index 177
+#define SecondaryColor3dvEXT_remap_index 178
+#define SecondaryColor3fEXT_remap_index 179
+#define SecondaryColor3fvEXT_remap_index 180
+#define SecondaryColor3iEXT_remap_index 181
+#define SecondaryColor3ivEXT_remap_index 182
+#define SecondaryColor3sEXT_remap_index 183
+#define SecondaryColor3svEXT_remap_index 184
+#define SecondaryColor3ubEXT_remap_index 185
+#define SecondaryColor3ubvEXT_remap_index 186
+#define SecondaryColor3uiEXT_remap_index 187
+#define SecondaryColor3uivEXT_remap_index 188
+#define SecondaryColor3usEXT_remap_index 189
+#define SecondaryColor3usvEXT_remap_index 190
+#define SecondaryColorPointerEXT_remap_index 191
+#define MultiDrawArraysEXT_remap_index 192
+#define MultiDrawElementsEXT_remap_index 193
+#define FogCoordPointerEXT_remap_index 194
+#define FogCoorddEXT_remap_index 195
+#define FogCoorddvEXT_remap_index 196
+#define FogCoordfEXT_remap_index 197
+#define FogCoordfvEXT_remap_index 198
+#define PixelTexGenSGIX_remap_index 199
+#define BlendFuncSeparateEXT_remap_index 200
+#define FlushVertexArrayRangeNV_remap_index 201
+#define VertexArrayRangeNV_remap_index 202
+#define CombinerInputNV_remap_index 203
+#define CombinerOutputNV_remap_index 204
+#define CombinerParameterfNV_remap_index 205
+#define CombinerParameterfvNV_remap_index 206
+#define CombinerParameteriNV_remap_index 207
+#define CombinerParameterivNV_remap_index 208
+#define FinalCombinerInputNV_remap_index 209
+#define GetCombinerInputParameterfvNV_remap_index 210
+#define GetCombinerInputParameterivNV_remap_index 211
+#define GetCombinerOutputParameterfvNV_remap_index 212
+#define GetCombinerOutputParameterivNV_remap_index 213
+#define GetFinalCombinerInputParameterfvNV_remap_index 214
+#define GetFinalCombinerInputParameterivNV_remap_index 215
+#define ResizeBuffersMESA_remap_index 216
+#define WindowPos2dMESA_remap_index 217
+#define WindowPos2dvMESA_remap_index 218
+#define WindowPos2fMESA_remap_index 219
+#define WindowPos2fvMESA_remap_index 220
+#define WindowPos2iMESA_remap_index 221
+#define WindowPos2ivMESA_remap_index 222
+#define WindowPos2sMESA_remap_index 223
+#define WindowPos2svMESA_remap_index 224
+#define WindowPos3dMESA_remap_index 225
+#define WindowPos3dvMESA_remap_index 226
+#define WindowPos3fMESA_remap_index 227
+#define WindowPos3fvMESA_remap_index 228
+#define WindowPos3iMESA_remap_index 229
+#define WindowPos3ivMESA_remap_index 230
+#define WindowPos3sMESA_remap_index 231
+#define WindowPos3svMESA_remap_index 232
+#define WindowPos4dMESA_remap_index 233
+#define WindowPos4dvMESA_remap_index 234
+#define WindowPos4fMESA_remap_index 235
+#define WindowPos4fvMESA_remap_index 236
+#define WindowPos4iMESA_remap_index 237
+#define WindowPos4ivMESA_remap_index 238
+#define WindowPos4sMESA_remap_index 239
+#define WindowPos4svMESA_remap_index 240
+#define MultiModeDrawArraysIBM_remap_index 241
+#define MultiModeDrawElementsIBM_remap_index 242
+#define DeleteFencesNV_remap_index 243
+#define FinishFenceNV_remap_index 244
+#define GenFencesNV_remap_index 245
+#define GetFenceivNV_remap_index 246
+#define IsFenceNV_remap_index 247
+#define SetFenceNV_remap_index 248
+#define TestFenceNV_remap_index 249
+#define AreProgramsResidentNV_remap_index 250
+#define BindProgramNV_remap_index 251
+#define DeleteProgramsNV_remap_index 252
+#define ExecuteProgramNV_remap_index 253
+#define GenProgramsNV_remap_index 254
+#define GetProgramParameterdvNV_remap_index 255
+#define GetProgramParameterfvNV_remap_index 256
+#define GetProgramStringNV_remap_index 257
+#define GetProgramivNV_remap_index 258
+#define GetTrackMatrixivNV_remap_index 259
+#define GetVertexAttribPointervNV_remap_index 260
+#define GetVertexAttribdvNV_remap_index 261
+#define GetVertexAttribfvNV_remap_index 262
+#define GetVertexAttribivNV_remap_index 263
+#define IsProgramNV_remap_index 264
+#define LoadProgramNV_remap_index 265
+#define ProgramParameters4dvNV_remap_index 266
+#define ProgramParameters4fvNV_remap_index 267
+#define RequestResidentProgramsNV_remap_index 268
+#define TrackMatrixNV_remap_index 269
+#define VertexAttrib1dNV_remap_index 270
+#define VertexAttrib1dvNV_remap_index 271
+#define VertexAttrib1fNV_remap_index 272
+#define VertexAttrib1fvNV_remap_index 273
+#define VertexAttrib1sNV_remap_index 274
+#define VertexAttrib1svNV_remap_index 275
+#define VertexAttrib2dNV_remap_index 276
+#define VertexAttrib2dvNV_remap_index 277
+#define VertexAttrib2fNV_remap_index 278
+#define VertexAttrib2fvNV_remap_index 279
+#define VertexAttrib2sNV_remap_index 280
+#define VertexAttrib2svNV_remap_index 281
+#define VertexAttrib3dNV_remap_index 282
+#define VertexAttrib3dvNV_remap_index 283
+#define VertexAttrib3fNV_remap_index 284
+#define VertexAttrib3fvNV_remap_index 285
+#define VertexAttrib3sNV_remap_index 286
+#define VertexAttrib3svNV_remap_index 287
+#define VertexAttrib4dNV_remap_index 288
+#define VertexAttrib4dvNV_remap_index 289
+#define VertexAttrib4fNV_remap_index 290
+#define VertexAttrib4fvNV_remap_index 291
+#define VertexAttrib4sNV_remap_index 292
+#define VertexAttrib4svNV_remap_index 293
+#define VertexAttrib4ubNV_remap_index 294
+#define VertexAttrib4ubvNV_remap_index 295
+#define VertexAttribPointerNV_remap_index 296
+#define VertexAttribs1dvNV_remap_index 297
+#define VertexAttribs1fvNV_remap_index 298
+#define VertexAttribs1svNV_remap_index 299
+#define VertexAttribs2dvNV_remap_index 300
+#define VertexAttribs2fvNV_remap_index 301
+#define VertexAttribs2svNV_remap_index 302
+#define VertexAttribs3dvNV_remap_index 303
+#define VertexAttribs3fvNV_remap_index 304
+#define VertexAttribs3svNV_remap_index 305
+#define VertexAttribs4dvNV_remap_index 306
+#define VertexAttribs4fvNV_remap_index 307
+#define VertexAttribs4svNV_remap_index 308
+#define VertexAttribs4ubvNV_remap_index 309
+#define AlphaFragmentOp1ATI_remap_index 310
+#define AlphaFragmentOp2ATI_remap_index 311
+#define AlphaFragmentOp3ATI_remap_index 312
+#define BeginFragmentShaderATI_remap_index 313
+#define BindFragmentShaderATI_remap_index 314
+#define ColorFragmentOp1ATI_remap_index 315
+#define ColorFragmentOp2ATI_remap_index 316
+#define ColorFragmentOp3ATI_remap_index 317
+#define DeleteFragmentShaderATI_remap_index 318
+#define EndFragmentShaderATI_remap_index 319
+#define GenFragmentShadersATI_remap_index 320
+#define PassTexCoordATI_remap_index 321
+#define SampleMapATI_remap_index 322
+#define SetFragmentShaderConstantATI_remap_index 323
+#define PointParameteriNV_remap_index 324
+#define PointParameterivNV_remap_index 325
+#define ActiveStencilFaceEXT_remap_index 326
+#define BindVertexArrayAPPLE_remap_index 327
+#define DeleteVertexArraysAPPLE_remap_index 328
+#define GenVertexArraysAPPLE_remap_index 329
+#define IsVertexArrayAPPLE_remap_index 330
+#define GetProgramNamedParameterdvNV_remap_index 331
+#define GetProgramNamedParameterfvNV_remap_index 332
+#define ProgramNamedParameter4dNV_remap_index 333
+#define ProgramNamedParameter4dvNV_remap_index 334
+#define ProgramNamedParameter4fNV_remap_index 335
+#define ProgramNamedParameter4fvNV_remap_index 336
+#define DepthBoundsEXT_remap_index 337
+#define BlendEquationSeparateEXT_remap_index 338
+#define BindFramebufferEXT_remap_index 339
+#define BindRenderbufferEXT_remap_index 340
+#define CheckFramebufferStatusEXT_remap_index 341
+#define DeleteFramebuffersEXT_remap_index 342
+#define DeleteRenderbuffersEXT_remap_index 343
+#define FramebufferRenderbufferEXT_remap_index 344
+#define FramebufferTexture1DEXT_remap_index 345
+#define FramebufferTexture2DEXT_remap_index 346
+#define FramebufferTexture3DEXT_remap_index 347
+#define GenFramebuffersEXT_remap_index 348
+#define GenRenderbuffersEXT_remap_index 349
+#define GenerateMipmapEXT_remap_index 350
+#define GetFramebufferAttachmentParameterivEXT_remap_index 351
+#define GetRenderbufferParameterivEXT_remap_index 352
+#define IsFramebufferEXT_remap_index 353
+#define IsRenderbufferEXT_remap_index 354
+#define RenderbufferStorageEXT_remap_index 355
+#define BlitFramebufferEXT_remap_index 356
+#define FramebufferTextureLayerEXT_remap_index 357
+#define StencilFuncSeparateATI_remap_index 358
+#define ProgramEnvParameters4fvEXT_remap_index 359
+#define ProgramLocalParameters4fvEXT_remap_index 360
+#define GetQueryObjecti64vEXT_remap_index 361
+#define GetQueryObjectui64vEXT_remap_index 362
#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters)
#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index])
@@ -3198,6 +3202,9 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters)
#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index])
#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn)
+#define CALL_RenderbufferStorageMultisample(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], parameters)
+#define GET_RenderbufferStorageMultisample(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index])
+#define SET_RenderbufferStorageMultisample(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], fn)
#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters)
#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index])
#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn)
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index 951fd95799..8212fc2477 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -7946,6 +7946,9 @@
</enum>
</category>
+<xi:include href="ARB_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+
<!-- Non-ARB extensions sorted by extension number. -->
<category name="GL_EXT_blend_color" number="2">
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index 43c265924b..f412234ac5 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -593,216 +593,217 @@
#define _gloffset_GetActiveAttribARB 558
#define _gloffset_GetAttribLocationARB 559
#define _gloffset_DrawBuffersARB 560
-#define _gloffset_PolygonOffsetEXT 561
-#define _gloffset_GetPixelTexGenParameterfvSGIS 562
-#define _gloffset_GetPixelTexGenParameterivSGIS 563
-#define _gloffset_PixelTexGenParameterfSGIS 564
-#define _gloffset_PixelTexGenParameterfvSGIS 565
-#define _gloffset_PixelTexGenParameteriSGIS 566
-#define _gloffset_PixelTexGenParameterivSGIS 567
-#define _gloffset_SampleMaskSGIS 568
-#define _gloffset_SamplePatternSGIS 569
-#define _gloffset_ColorPointerEXT 570
-#define _gloffset_EdgeFlagPointerEXT 571
-#define _gloffset_IndexPointerEXT 572
-#define _gloffset_NormalPointerEXT 573
-#define _gloffset_TexCoordPointerEXT 574
-#define _gloffset_VertexPointerEXT 575
-#define _gloffset_PointParameterfEXT 576
-#define _gloffset_PointParameterfvEXT 577
-#define _gloffset_LockArraysEXT 578
-#define _gloffset_UnlockArraysEXT 579
-#define _gloffset_CullParameterdvEXT 580
-#define _gloffset_CullParameterfvEXT 581
-#define _gloffset_SecondaryColor3bEXT 582
-#define _gloffset_SecondaryColor3bvEXT 583
-#define _gloffset_SecondaryColor3dEXT 584
-#define _gloffset_SecondaryColor3dvEXT 585
-#define _gloffset_SecondaryColor3fEXT 586
-#define _gloffset_SecondaryColor3fvEXT 587
-#define _gloffset_SecondaryColor3iEXT 588
-#define _gloffset_SecondaryColor3ivEXT 589
-#define _gloffset_SecondaryColor3sEXT 590
-#define _gloffset_SecondaryColor3svEXT 591
-#define _gloffset_SecondaryColor3ubEXT 592
-#define _gloffset_SecondaryColor3ubvEXT 593
-#define _gloffset_SecondaryColor3uiEXT 594
-#define _gloffset_SecondaryColor3uivEXT 595
-#define _gloffset_SecondaryColor3usEXT 596
-#define _gloffset_SecondaryColor3usvEXT 597
-#define _gloffset_SecondaryColorPointerEXT 598
-#define _gloffset_MultiDrawArraysEXT 599
-#define _gloffset_MultiDrawElementsEXT 600
-#define _gloffset_FogCoordPointerEXT 601
-#define _gloffset_FogCoorddEXT 602
-#define _gloffset_FogCoorddvEXT 603
-#define _gloffset_FogCoordfEXT 604
-#define _gloffset_FogCoordfvEXT 605
-#define _gloffset_PixelTexGenSGIX 606
-#define _gloffset_BlendFuncSeparateEXT 607
-#define _gloffset_FlushVertexArrayRangeNV 608
-#define _gloffset_VertexArrayRangeNV 609
-#define _gloffset_CombinerInputNV 610
-#define _gloffset_CombinerOutputNV 611
-#define _gloffset_CombinerParameterfNV 612
-#define _gloffset_CombinerParameterfvNV 613
-#define _gloffset_CombinerParameteriNV 614
-#define _gloffset_CombinerParameterivNV 615
-#define _gloffset_FinalCombinerInputNV 616
-#define _gloffset_GetCombinerInputParameterfvNV 617
-#define _gloffset_GetCombinerInputParameterivNV 618
-#define _gloffset_GetCombinerOutputParameterfvNV 619
-#define _gloffset_GetCombinerOutputParameterivNV 620
-#define _gloffset_GetFinalCombinerInputParameterfvNV 621
-#define _gloffset_GetFinalCombinerInputParameterivNV 622
-#define _gloffset_ResizeBuffersMESA 623
-#define _gloffset_WindowPos2dMESA 624
-#define _gloffset_WindowPos2dvMESA 625
-#define _gloffset_WindowPos2fMESA 626
-#define _gloffset_WindowPos2fvMESA 627
-#define _gloffset_WindowPos2iMESA 628
-#define _gloffset_WindowPos2ivMESA 629
-#define _gloffset_WindowPos2sMESA 630
-#define _gloffset_WindowPos2svMESA 631
-#define _gloffset_WindowPos3dMESA 632
-#define _gloffset_WindowPos3dvMESA 633
-#define _gloffset_WindowPos3fMESA 634
-#define _gloffset_WindowPos3fvMESA 635
-#define _gloffset_WindowPos3iMESA 636
-#define _gloffset_WindowPos3ivMESA 637
-#define _gloffset_WindowPos3sMESA 638
-#define _gloffset_WindowPos3svMESA 639
-#define _gloffset_WindowPos4dMESA 640
-#define _gloffset_WindowPos4dvMESA 641
-#define _gloffset_WindowPos4fMESA 642
-#define _gloffset_WindowPos4fvMESA 643
-#define _gloffset_WindowPos4iMESA 644
-#define _gloffset_WindowPos4ivMESA 645
-#define _gloffset_WindowPos4sMESA 646
-#define _gloffset_WindowPos4svMESA 647
-#define _gloffset_MultiModeDrawArraysIBM 648
-#define _gloffset_MultiModeDrawElementsIBM 649
-#define _gloffset_DeleteFencesNV 650
-#define _gloffset_FinishFenceNV 651
-#define _gloffset_GenFencesNV 652
-#define _gloffset_GetFenceivNV 653
-#define _gloffset_IsFenceNV 654
-#define _gloffset_SetFenceNV 655
-#define _gloffset_TestFenceNV 656
-#define _gloffset_AreProgramsResidentNV 657
-#define _gloffset_BindProgramNV 658
-#define _gloffset_DeleteProgramsNV 659
-#define _gloffset_ExecuteProgramNV 660
-#define _gloffset_GenProgramsNV 661
-#define _gloffset_GetProgramParameterdvNV 662
-#define _gloffset_GetProgramParameterfvNV 663
-#define _gloffset_GetProgramStringNV 664
-#define _gloffset_GetProgramivNV 665
-#define _gloffset_GetTrackMatrixivNV 666
-#define _gloffset_GetVertexAttribPointervNV 667
-#define _gloffset_GetVertexAttribdvNV 668
-#define _gloffset_GetVertexAttribfvNV 669
-#define _gloffset_GetVertexAttribivNV 670
-#define _gloffset_IsProgramNV 671
-#define _gloffset_LoadProgramNV 672
-#define _gloffset_ProgramParameters4dvNV 673
-#define _gloffset_ProgramParameters4fvNV 674
-#define _gloffset_RequestResidentProgramsNV 675
-#define _gloffset_TrackMatrixNV 676
-#define _gloffset_VertexAttrib1dNV 677
-#define _gloffset_VertexAttrib1dvNV 678
-#define _gloffset_VertexAttrib1fNV 679
-#define _gloffset_VertexAttrib1fvNV 680
-#define _gloffset_VertexAttrib1sNV 681
-#define _gloffset_VertexAttrib1svNV 682
-#define _gloffset_VertexAttrib2dNV 683
-#define _gloffset_VertexAttrib2dvNV 684
-#define _gloffset_VertexAttrib2fNV 685
-#define _gloffset_VertexAttrib2fvNV 686
-#define _gloffset_VertexAttrib2sNV 687
-#define _gloffset_VertexAttrib2svNV 688
-#define _gloffset_VertexAttrib3dNV 689
-#define _gloffset_VertexAttrib3dvNV 690
-#define _gloffset_VertexAttrib3fNV 691
-#define _gloffset_VertexAttrib3fvNV 692
-#define _gloffset_VertexAttrib3sNV 693
-#define _gloffset_VertexAttrib3svNV 694
-#define _gloffset_VertexAttrib4dNV 695
-#define _gloffset_VertexAttrib4dvNV 696
-#define _gloffset_VertexAttrib4fNV 697
-#define _gloffset_VertexAttrib4fvNV 698
-#define _gloffset_VertexAttrib4sNV 699
-#define _gloffset_VertexAttrib4svNV 700
-#define _gloffset_VertexAttrib4ubNV 701
-#define _gloffset_VertexAttrib4ubvNV 702
-#define _gloffset_VertexAttribPointerNV 703
-#define _gloffset_VertexAttribs1dvNV 704
-#define _gloffset_VertexAttribs1fvNV 705
-#define _gloffset_VertexAttribs1svNV 706
-#define _gloffset_VertexAttribs2dvNV 707
-#define _gloffset_VertexAttribs2fvNV 708
-#define _gloffset_VertexAttribs2svNV 709
-#define _gloffset_VertexAttribs3dvNV 710
-#define _gloffset_VertexAttribs3fvNV 711
-#define _gloffset_VertexAttribs3svNV 712
-#define _gloffset_VertexAttribs4dvNV 713
-#define _gloffset_VertexAttribs4fvNV 714
-#define _gloffset_VertexAttribs4svNV 715
-#define _gloffset_VertexAttribs4ubvNV 716
-#define _gloffset_AlphaFragmentOp1ATI 717
-#define _gloffset_AlphaFragmentOp2ATI 718
-#define _gloffset_AlphaFragmentOp3ATI 719
-#define _gloffset_BeginFragmentShaderATI 720
-#define _gloffset_BindFragmentShaderATI 721
-#define _gloffset_ColorFragmentOp1ATI 722
-#define _gloffset_ColorFragmentOp2ATI 723
-#define _gloffset_ColorFragmentOp3ATI 724
-#define _gloffset_DeleteFragmentShaderATI 725
-#define _gloffset_EndFragmentShaderATI 726
-#define _gloffset_GenFragmentShadersATI 727
-#define _gloffset_PassTexCoordATI 728
-#define _gloffset_SampleMapATI 729
-#define _gloffset_SetFragmentShaderConstantATI 730
-#define _gloffset_PointParameteriNV 731
-#define _gloffset_PointParameterivNV 732
-#define _gloffset_ActiveStencilFaceEXT 733
-#define _gloffset_BindVertexArrayAPPLE 734
-#define _gloffset_DeleteVertexArraysAPPLE 735
-#define _gloffset_GenVertexArraysAPPLE 736
-#define _gloffset_IsVertexArrayAPPLE 737
-#define _gloffset_GetProgramNamedParameterdvNV 738
-#define _gloffset_GetProgramNamedParameterfvNV 739
-#define _gloffset_ProgramNamedParameter4dNV 740
-#define _gloffset_ProgramNamedParameter4dvNV 741
-#define _gloffset_ProgramNamedParameter4fNV 742
-#define _gloffset_ProgramNamedParameter4fvNV 743
-#define _gloffset_DepthBoundsEXT 744
-#define _gloffset_BlendEquationSeparateEXT 745
-#define _gloffset_BindFramebufferEXT 746
-#define _gloffset_BindRenderbufferEXT 747
-#define _gloffset_CheckFramebufferStatusEXT 748
-#define _gloffset_DeleteFramebuffersEXT 749
-#define _gloffset_DeleteRenderbuffersEXT 750
-#define _gloffset_FramebufferRenderbufferEXT 751
-#define _gloffset_FramebufferTexture1DEXT 752
-#define _gloffset_FramebufferTexture2DEXT 753
-#define _gloffset_FramebufferTexture3DEXT 754
-#define _gloffset_GenFramebuffersEXT 755
-#define _gloffset_GenRenderbuffersEXT 756
-#define _gloffset_GenerateMipmapEXT 757
-#define _gloffset_GetFramebufferAttachmentParameterivEXT 758
-#define _gloffset_GetRenderbufferParameterivEXT 759
-#define _gloffset_IsFramebufferEXT 760
-#define _gloffset_IsRenderbufferEXT 761
-#define _gloffset_RenderbufferStorageEXT 762
-#define _gloffset_BlitFramebufferEXT 763
-#define _gloffset_FramebufferTextureLayerEXT 764
-#define _gloffset_StencilFuncSeparateATI 765
-#define _gloffset_ProgramEnvParameters4fvEXT 766
-#define _gloffset_ProgramLocalParameters4fvEXT 767
-#define _gloffset_GetQueryObjecti64vEXT 768
-#define _gloffset_GetQueryObjectui64vEXT 769
-#define _gloffset_FIRST_DYNAMIC 770
+#define _gloffset_RenderbufferStorageMultisample 561
+#define _gloffset_PolygonOffsetEXT 562
+#define _gloffset_GetPixelTexGenParameterfvSGIS 563
+#define _gloffset_GetPixelTexGenParameterivSGIS 564
+#define _gloffset_PixelTexGenParameterfSGIS 565
+#define _gloffset_PixelTexGenParameterfvSGIS 566
+#define _gloffset_PixelTexGenParameteriSGIS 567
+#define _gloffset_PixelTexGenParameterivSGIS 568
+#define _gloffset_SampleMaskSGIS 569
+#define _gloffset_SamplePatternSGIS 570
+#define _gloffset_ColorPointerEXT 571
+#define _gloffset_EdgeFlagPointerEXT 572
+#define _gloffset_IndexPointerEXT 573
+#define _gloffset_NormalPointerEXT 574
+#define _gloffset_TexCoordPointerEXT 575
+#define _gloffset_VertexPointerEXT 576
+#define _gloffset_PointParameterfEXT 577
+#define _gloffset_PointParameterfvEXT 578
+#define _gloffset_LockArraysEXT 579
+#define _gloffset_UnlockArraysEXT 580
+#define _gloffset_CullParameterdvEXT 581
+#define _gloffset_CullParameterfvEXT 582
+#define _gloffset_SecondaryColor3bEXT 583
+#define _gloffset_SecondaryColor3bvEXT 584
+#define _gloffset_SecondaryColor3dEXT 585
+#define _gloffset_SecondaryColor3dvEXT 586
+#define _gloffset_SecondaryColor3fEXT 587
+#define _gloffset_SecondaryColor3fvEXT 588
+#define _gloffset_SecondaryColor3iEXT 589
+#define _gloffset_SecondaryColor3ivEXT 590
+#define _gloffset_SecondaryColor3sEXT 591
+#define _gloffset_SecondaryColor3svEXT 592
+#define _gloffset_SecondaryColor3ubEXT 593
+#define _gloffset_SecondaryColor3ubvEXT 594
+#define _gloffset_SecondaryColor3uiEXT 595
+#define _gloffset_SecondaryColor3uivEXT 596
+#define _gloffset_SecondaryColor3usEXT 597
+#define _gloffset_SecondaryColor3usvEXT 598
+#define _gloffset_SecondaryColorPointerEXT 599
+#define _gloffset_MultiDrawArraysEXT 600
+#define _gloffset_MultiDrawElementsEXT 601
+#define _gloffset_FogCoordPointerEXT 602
+#define _gloffset_FogCoorddEXT 603
+#define _gloffset_FogCoorddvEXT 604
+#define _gloffset_FogCoordfEXT 605
+#define _gloffset_FogCoordfvEXT 606
+#define _gloffset_PixelTexGenSGIX 607
+#define _gloffset_BlendFuncSeparateEXT 608
+#define _gloffset_FlushVertexArrayRangeNV 609
+#define _gloffset_VertexArrayRangeNV 610
+#define _gloffset_CombinerInputNV 611
+#define _gloffset_CombinerOutputNV 612
+#define _gloffset_CombinerParameterfNV 613
+#define _gloffset_CombinerParameterfvNV 614
+#define _gloffset_CombinerParameteriNV 615
+#define _gloffset_CombinerParameterivNV 616
+#define _gloffset_FinalCombinerInputNV 617
+#define _gloffset_GetCombinerInputParameterfvNV 618
+#define _gloffset_GetCombinerInputParameterivNV 619
+#define _gloffset_GetCombinerOutputParameterfvNV 620
+#define _gloffset_GetCombinerOutputParameterivNV 621
+#define _gloffset_GetFinalCombinerInputParameterfvNV 622
+#define _gloffset_GetFinalCombinerInputParameterivNV 623
+#define _gloffset_ResizeBuffersMESA 624
+#define _gloffset_WindowPos2dMESA 625
+#define _gloffset_WindowPos2dvMESA 626
+#define _gloffset_WindowPos2fMESA 627
+#define _gloffset_WindowPos2fvMESA 628
+#define _gloffset_WindowPos2iMESA 629
+#define _gloffset_WindowPos2ivMESA 630
+#define _gloffset_WindowPos2sMESA 631
+#define _gloffset_WindowPos2svMESA 632
+#define _gloffset_WindowPos3dMESA 633
+#define _gloffset_WindowPos3dvMESA 634
+#define _gloffset_WindowPos3fMESA 635
+#define _gloffset_WindowPos3fvMESA 636
+#define _gloffset_WindowPos3iMESA 637
+#define _gloffset_WindowPos3ivMESA 638
+#define _gloffset_WindowPos3sMESA 639
+#define _gloffset_WindowPos3svMESA 640
+#define _gloffset_WindowPos4dMESA 641
+#define _gloffset_WindowPos4dvMESA 642
+#define _gloffset_WindowPos4fMESA 643
+#define _gloffset_WindowPos4fvMESA 644
+#define _gloffset_WindowPos4iMESA 645
+#define _gloffset_WindowPos4ivMESA 646
+#define _gloffset_WindowPos4sMESA 647
+#define _gloffset_WindowPos4svMESA 648
+#define _gloffset_MultiModeDrawArraysIBM 649
+#define _gloffset_MultiModeDrawElementsIBM 650
+#define _gloffset_DeleteFencesNV 651
+#define _gloffset_FinishFenceNV 652
+#define _gloffset_GenFencesNV 653
+#define _gloffset_GetFenceivNV 654
+#define _gloffset_IsFenceNV 655
+#define _gloffset_SetFenceNV 656
+#define _gloffset_TestFenceNV 657
+#define _gloffset_AreProgramsResidentNV 658
+#define _gloffset_BindProgramNV 659
+#define _gloffset_DeleteProgramsNV 660
+#define _gloffset_ExecuteProgramNV 661
+#define _gloffset_GenProgramsNV 662
+#define _gloffset_GetProgramParameterdvNV 663
+#define _gloffset_GetProgramParameterfvNV 664
+#define _gloffset_GetProgramStringNV 665
+#define _gloffset_GetProgramivNV 666
+#define _gloffset_GetTrackMatrixivNV 667
+#define _gloffset_GetVertexAttribPointervNV 668
+#define _gloffset_GetVertexAttribdvNV 669
+#define _gloffset_GetVertexAttribfvNV 670
+#define _gloffset_GetVertexAttribivNV 671
+#define _gloffset_IsProgramNV 672
+#define _gloffset_LoadProgramNV 673
+#define _gloffset_ProgramParameters4dvNV 674
+#define _gloffset_ProgramParameters4fvNV 675
+#define _gloffset_RequestResidentProgramsNV 676
+#define _gloffset_TrackMatrixNV 677
+#define _gloffset_VertexAttrib1dNV 678
+#define _gloffset_VertexAttrib1dvNV 679
+#define _gloffset_VertexAttrib1fNV 680
+#define _gloffset_VertexAttrib1fvNV 681
+#define _gloffset_VertexAttrib1sNV 682
+#define _gloffset_VertexAttrib1svNV 683
+#define _gloffset_VertexAttrib2dNV 684
+#define _gloffset_VertexAttrib2dvNV 685
+#define _gloffset_VertexAttrib2fNV 686
+#define _gloffset_VertexAttrib2fvNV 687
+#define _gloffset_VertexAttrib2sNV 688
+#define _gloffset_VertexAttrib2svNV 689
+#define _gloffset_VertexAttrib3dNV 690
+#define _gloffset_VertexAttrib3dvNV 691
+#define _gloffset_VertexAttrib3fNV 692
+#define _gloffset_VertexAttrib3fvNV 693
+#define _gloffset_VertexAttrib3sNV 694
+#define _gloffset_VertexAttrib3svNV 695
+#define _gloffset_VertexAttrib4dNV 696
+#define _gloffset_VertexAttrib4dvNV 697
+#define _gloffset_VertexAttrib4fNV 698
+#define _gloffset_VertexAttrib4fvNV 699
+#define _gloffset_VertexAttrib4sNV 700
+#define _gloffset_VertexAttrib4svNV 701
+#define _gloffset_VertexAttrib4ubNV 702
+#define _gloffset_VertexAttrib4ubvNV 703
+#define _gloffset_VertexAttribPointerNV 704
+#define _gloffset_VertexAttribs1dvNV 705
+#define _gloffset_VertexAttribs1fvNV 706
+#define _gloffset_VertexAttribs1svNV 707
+#define _gloffset_VertexAttribs2dvNV 708
+#define _gloffset_VertexAttribs2fvNV 709
+#define _gloffset_VertexAttribs2svNV 710
+#define _gloffset_VertexAttribs3dvNV 711
+#define _gloffset_VertexAttribs3fvNV 712
+#define _gloffset_VertexAttribs3svNV 713
+#define _gloffset_VertexAttribs4dvNV 714
+#define _gloffset_VertexAttribs4fvNV 715
+#define _gloffset_VertexAttribs4svNV 716
+#define _gloffset_VertexAttribs4ubvNV 717
+#define _gloffset_AlphaFragmentOp1ATI 718
+#define _gloffset_AlphaFragmentOp2ATI 719
+#define _gloffset_AlphaFragmentOp3ATI 720
+#define _gloffset_BeginFragmentShaderATI 721
+#define _gloffset_BindFragmentShaderATI 722
+#define _gloffset_ColorFragmentOp1ATI 723
+#define _gloffset_ColorFragmentOp2ATI 724
+#define _gloffset_ColorFragmentOp3ATI 725
+#define _gloffset_DeleteFragmentShaderATI 726
+#define _gloffset_EndFragmentShaderATI 727
+#define _gloffset_GenFragmentShadersATI 728
+#define _gloffset_PassTexCoordATI 729
+#define _gloffset_SampleMapATI 730
+#define _gloffset_SetFragmentShaderConstantATI 731
+#define _gloffset_PointParameteriNV 732
+#define _gloffset_PointParameterivNV 733
+#define _gloffset_ActiveStencilFaceEXT 734
+#define _gloffset_BindVertexArrayAPPLE 735
+#define _gloffset_DeleteVertexArraysAPPLE 736
+#define _gloffset_GenVertexArraysAPPLE 737
+#define _gloffset_IsVertexArrayAPPLE 738
+#define _gloffset_GetProgramNamedParameterdvNV 739
+#define _gloffset_GetProgramNamedParameterfvNV 740
+#define _gloffset_ProgramNamedParameter4dNV 741
+#define _gloffset_ProgramNamedParameter4dvNV 742
+#define _gloffset_ProgramNamedParameter4fNV 743
+#define _gloffset_ProgramNamedParameter4fvNV 744
+#define _gloffset_DepthBoundsEXT 745
+#define _gloffset_BlendEquationSeparateEXT 746
+#define _gloffset_BindFramebufferEXT 747
+#define _gloffset_BindRenderbufferEXT 748
+#define _gloffset_CheckFramebufferStatusEXT 749
+#define _gloffset_DeleteFramebuffersEXT 750
+#define _gloffset_DeleteRenderbuffersEXT 751
+#define _gloffset_FramebufferRenderbufferEXT 752
+#define _gloffset_FramebufferTexture1DEXT 753
+#define _gloffset_FramebufferTexture2DEXT 754
+#define _gloffset_FramebufferTexture3DEXT 755
+#define _gloffset_GenFramebuffersEXT 756
+#define _gloffset_GenRenderbuffersEXT 757
+#define _gloffset_GenerateMipmapEXT 758
+#define _gloffset_GetFramebufferAttachmentParameterivEXT 759
+#define _gloffset_GetRenderbufferParameterivEXT 760
+#define _gloffset_IsFramebufferEXT 761
+#define _gloffset_IsRenderbufferEXT 762
+#define _gloffset_RenderbufferStorageEXT 763
+#define _gloffset_BlitFramebufferEXT 764
+#define _gloffset_FramebufferTextureLayerEXT 765
+#define _gloffset_StencilFuncSeparateATI 766
+#define _gloffset_ProgramEnvParameters4fvEXT 767
+#define _gloffset_ProgramLocalParameters4fvEXT 768
+#define _gloffset_GetQueryObjecti64vEXT 769
+#define _gloffset_GetQueryObjectui64vEXT 770
+#define _gloffset_FIRST_DYNAMIC 771
#else
@@ -959,6 +960,7 @@
#define _gloffset_GetActiveAttribARB driDispatchRemapTable[GetActiveAttribARB_remap_index]
#define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index]
#define _gloffset_DrawBuffersARB driDispatchRemapTable[DrawBuffersARB_remap_index]
+#define _gloffset_RenderbufferStorageMultisample driDispatchRemapTable[RenderbufferStorageMultisample_remap_index]
#define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index]
#define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]
#define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]
diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h
index 5d9d40a8a2..2ae9bf6738 100644
--- a/src/mesa/glapi/glapitable.h
+++ b/src/mesa/glapi/glapitable.h
@@ -601,215 +601,216 @@ struct _glapi_table
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
- void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
- void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
- void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
- void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
- void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
- void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
- void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
- void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
- void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
- void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
- void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
- void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
- void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
- void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
- void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
- void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
- void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
- void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
- void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
- void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
- void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
- void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
- void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
- void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
- void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
- void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
- void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
- void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
- void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
- void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
- void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
- void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
- void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
- void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
- void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
- void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
- void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
- void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
- void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
- void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
- void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
- void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
- void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
- void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
- void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
- void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
- void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
- void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
- void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
- void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
- void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
- void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
- void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
- void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
- void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
- void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
- void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
- void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
- void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
- void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
- void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
- void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
- void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
- void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
- void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
- void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
- void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
- void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
- void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
- void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
- void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
- void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
- void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
- void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
- void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
- void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
- void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
- void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
- void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
- void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
- void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
- void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
- void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
- void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
- void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
- void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
- void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
- void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
- void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
- void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
- void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
- GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
- void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
- GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
- GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
- void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
- void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
- void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
- void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
- void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
- void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
- void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
- void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
- void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
- void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 667 */
- void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
- void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
- void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
- GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
- void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
- void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */
- void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */
- void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */
- void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */
- void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */
- void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */
- void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */
- void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */
- void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */
- void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */
- void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */
- void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */
- void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */
- void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */
- void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */
- void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */
- void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */
- void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */
- void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */
- void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */
- void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */
- void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */
- void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */
- void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */
- void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */
- void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */
- void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */
- void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */
- void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */
- void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */
- void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */
- void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */
- void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */
- void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */
- void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */
- void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */
- void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */
- void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */
- void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */
- void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */
- void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */
- void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */
- void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */
- void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */
- void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */
- void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */
- void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */
- void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */
- void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */
- void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */
- void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */
- void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */
- void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */
- void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */
- GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */
- void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */
- void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */
- void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */
- void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */
- void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */
- void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */
- void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */
- void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */
- void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */
- GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */
- void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */
- void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */
- void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */
- void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */
- void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */
- void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */
- void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */
- void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */
- void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */
- void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */
- GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */
- void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */
- void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */
- void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */
- void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */
- void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
- void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */
- void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */
- void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */
- void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */
- void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */
- void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */
- GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */
- GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */
- void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */
- void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */
- void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */
- void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */
- void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */
- void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
- void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */
- void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */
+ void (GLAPIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); /* 561 */
+ void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 562 */
+ void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 563 */
+ void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 564 */
+ void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 565 */
+ void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 566 */
+ void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 567 */
+ void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 568 */
+ void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 569 */
+ void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 570 */
+ void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 571 */
+ void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 572 */
+ void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
+ void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
+ void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
+ void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 576 */
+ void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 577 */
+ void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 578 */
+ void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 579 */
+ void (GLAPIENTRYP UnlockArraysEXT)(void); /* 580 */
+ void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 581 */
+ void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 582 */
+ void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 583 */
+ void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 584 */
+ void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 585 */
+ void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 586 */
+ void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 587 */
+ void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 588 */
+ void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 589 */
+ void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 590 */
+ void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 591 */
+ void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 592 */
+ void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 593 */
+ void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 594 */
+ void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 595 */
+ void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 596 */
+ void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 597 */
+ void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 598 */
+ void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 599 */
+ void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 600 */
+ void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 601 */
+ void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 602 */
+ void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 603 */
+ void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 604 */
+ void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 605 */
+ void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 606 */
+ void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 607 */
+ void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 608 */
+ void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 609 */
+ void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 610 */
+ void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 611 */
+ void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 612 */
+ void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 613 */
+ void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 614 */
+ void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 615 */
+ void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 616 */
+ void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 617 */
+ void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 618 */
+ void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 619 */
+ void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 620 */
+ void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 621 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 622 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 623 */
+ void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 624 */
+ void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 625 */
+ void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 626 */
+ void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 627 */
+ void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 628 */
+ void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 629 */
+ void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 630 */
+ void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 631 */
+ void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 632 */
+ void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 633 */
+ void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 634 */
+ void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 635 */
+ void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 636 */
+ void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 637 */
+ void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 638 */
+ void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 639 */
+ void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 640 */
+ void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 641 */
+ void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 642 */
+ void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 643 */
+ void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 644 */
+ void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 645 */
+ void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 646 */
+ void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 647 */
+ void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 648 */
+ void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 649 */
+ void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 650 */
+ void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 651 */
+ void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 652 */
+ void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 653 */
+ void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 654 */
+ GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 655 */
+ void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 656 */
+ GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 657 */
+ GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 658 */
+ void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 659 */
+ void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 660 */
+ void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 661 */
+ void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 662 */
+ void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 663 */
+ void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 664 */
+ void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 665 */
+ void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 666 */
+ void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 667 */
+ void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 668 */
+ void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 669 */
+ void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 670 */
+ void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 671 */
+ GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 672 */
+ void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 673 */
+ void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 674 */
+ void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 675 */
+ void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 676 */
+ void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 677 */
+ void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 678 */
+ void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 679 */
+ void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 680 */
+ void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 681 */
+ void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 682 */
+ void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 683 */
+ void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 684 */
+ void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 685 */
+ void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 686 */
+ void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 687 */
+ void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 688 */
+ void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 689 */
+ void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 690 */
+ void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 691 */
+ void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 692 */
+ void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 693 */
+ void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 694 */
+ void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 695 */
+ void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 696 */
+ void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 697 */
+ void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 698 */
+ void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 699 */
+ void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 700 */
+ void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 701 */
+ void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 702 */
+ void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 703 */
+ void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 704 */
+ void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 705 */
+ void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 706 */
+ void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 707 */
+ void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
+ void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
+ void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
+ void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
+ void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
+ void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
+ void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
+ void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
+ void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
+ void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 717 */
+ void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 718 */
+ void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 719 */
+ void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 720 */
+ void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 721 */
+ void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 722 */
+ void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 723 */
+ void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 724 */
+ void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 725 */
+ void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 726 */
+ void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 727 */
+ GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 728 */
+ void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 729 */
+ void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 730 */
+ void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 731 */
+ void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 732 */
+ void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 733 */
+ void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 734 */
+ void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 735 */
+ void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 736 */
+ void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 737 */
+ GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 738 */
+ void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 739 */
+ void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 740 */
+ void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 741 */
+ void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 742 */
+ void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 743 */
+ void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 744 */
+ void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 745 */
+ void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 746 */
+ void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 747 */
+ void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 748 */
+ GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 749 */
+ void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 750 */
+ void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 751 */
+ void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 752 */
+ void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
+ void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 754 */
+ void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 755 */
+ void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 756 */
+ void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 757 */
+ void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 758 */
+ void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 759 */
+ void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 760 */
+ GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 761 */
+ GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 762 */
+ void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 763 */
+ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 764 */
+ void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 765 */
+ void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 766 */
+ void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
+ void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */
+ void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 769 */
+ void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 770 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index 09259f4704..960d70e081 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -4006,63 +4006,68 @@ KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
}
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisample(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height));
+}
+
KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
{
DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLfloat * params)
{
DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLint * params)
{
DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, GLfloat param)
{
DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, const GLfloat * params)
{
DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, GLint param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, GLint param)
{
DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLenum pname, const GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLenum pname, const GLint * params)
{
DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLclampf value, GLboolean invert);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLclampf value, GLboolean invert)
{
DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_570)(GLenum pattern);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_570)(GLenum pattern)
{
DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
}
@@ -4112,9 +4117,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param)
{
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
}
@@ -4134,9 +4139,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params)
{
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
@@ -4151,16 +4156,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLdouble * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLdouble * params)
{
DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLfloat * params)
{
DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
@@ -4405,9 +4410,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum mode);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum mode)
{
DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
}
@@ -4422,9 +4427,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_608)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_608)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
@@ -4789,65 +4794,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLsizei n, const GLuint * fences);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLsizei n, const GLuint * fences)
{
DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLuint fence)
{
DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLsizei n, GLuint * fences);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLsizei n, GLuint * fences)
{
DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence, GLenum pname, GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence, GLenum pname, GLint * params)
{
DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence)
{
RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence, GLenum condition);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence, GLenum condition)
{
DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_657)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_657)(GLuint fence)
{
RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
}
@@ -5272,37 +5277,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para
DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLenum face)
{
DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLuint array)
{
DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, const GLuint * arrays)
{
DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLsizei n, GLuint * arrays)
{
DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_738)(GLuint array)
{
RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
}
@@ -5337,9 +5342,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len,
DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLclampd zmin, GLclampd zmax)
{
DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
}
@@ -5349,141 +5354,236 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_746)(GLenum modeRGB, GLenum modeA)
{
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
}
+KEYWORD1 void KEYWORD2 NAME(BindFramebuffer)(GLenum target, GLuint framebuffer)
+{
+ DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebuffer(0x%x, %d);\n", target, framebuffer));
+}
+
KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
{
DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer));
}
+KEYWORD1 void KEYWORD2 NAME(BindRenderbuffer)(GLenum target, GLuint renderbuffer)
+{
+ DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbuffer(0x%x, %d);\n", target, renderbuffer));
+}
+
KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
{
DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer));
}
+KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatus)(GLenum target)
+{
+ RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatus(0x%x);\n", target));
+}
+
KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target)
{
RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target));
}
+KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers)
+{
+ DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
+}
+
KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers)
{
DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
}
+KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers)
+{
+ DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers)
{
DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
}
+KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbuffer(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
+}
+
KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
}
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
}
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
}
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3D(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
+}
+
KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
{
DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
}
+KEYWORD1 void KEYWORD2 NAME(GenFramebuffers)(GLsizei n, GLuint * framebuffers)
+{
+ DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
+}
+
KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers)
{
DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
}
+KEYWORD1 void KEYWORD2 NAME(GenRenderbuffers)(GLsizei n, GLuint * renderbuffers)
+{
+ DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers)
{
DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
}
+KEYWORD1 void KEYWORD2 NAME(GenerateMipmap)(GLenum target)
+{
+ DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmap(0x%x);\n", target));
+}
+
KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target)
{
DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target));
}
+KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameteriv(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
{
DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params)
{
DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebuffer)(GLuint framebuffer)
+{
+ RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebuffer(%d);\n", framebuffer));
+}
+
KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer)
{
RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer));
}
+KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbuffer)(GLuint renderbuffer)
+{
+ RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbuffer(%d);\n", renderbuffer));
+}
+
KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer)
{
RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer));
}
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorage(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
+}
+
KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{
DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
{
DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
}
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayer(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
+}
+
KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
{
DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
{
DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLint64EXT * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLint64EXT * params)
{
DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLuint64EXT * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLuint64EXT * params)
{
DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
}
@@ -6063,8 +6163,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GetActiveAttribARB),
TABLE_ENTRY(GetAttribLocationARB),
TABLE_ENTRY(DrawBuffersARB),
+ TABLE_ENTRY(RenderbufferStorageMultisample),
TABLE_ENTRY(PolygonOffsetEXT),
- TABLE_ENTRY(_dispatch_stub_562),
TABLE_ENTRY(_dispatch_stub_563),
TABLE_ENTRY(_dispatch_stub_564),
TABLE_ENTRY(_dispatch_stub_565),
@@ -6072,6 +6172,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(_dispatch_stub_567),
TABLE_ENTRY(_dispatch_stub_568),
TABLE_ENTRY(_dispatch_stub_569),
+ TABLE_ENTRY(_dispatch_stub_570),
TABLE_ENTRY(ColorPointerEXT),
TABLE_ENTRY(EdgeFlagPointerEXT),
TABLE_ENTRY(IndexPointerEXT),
@@ -6082,8 +6183,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(PointParameterfvEXT),
TABLE_ENTRY(LockArraysEXT),
TABLE_ENTRY(UnlockArraysEXT),
- TABLE_ENTRY(_dispatch_stub_580),
TABLE_ENTRY(_dispatch_stub_581),
+ TABLE_ENTRY(_dispatch_stub_582),
TABLE_ENTRY(SecondaryColor3bEXT),
TABLE_ENTRY(SecondaryColor3bvEXT),
TABLE_ENTRY(SecondaryColor3dEXT),
@@ -6108,7 +6209,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(FogCoorddvEXT),
TABLE_ENTRY(FogCoordfEXT),
TABLE_ENTRY(FogCoordfvEXT),
- TABLE_ENTRY(_dispatch_stub_606),
+ TABLE_ENTRY(_dispatch_stub_607),
TABLE_ENTRY(BlendFuncSeparateEXT),
TABLE_ENTRY(FlushVertexArrayRangeNV),
TABLE_ENTRY(VertexArrayRangeNV),
@@ -6150,7 +6251,6 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(WindowPos4ivMESA),
TABLE_ENTRY(WindowPos4sMESA),
TABLE_ENTRY(WindowPos4svMESA),
- TABLE_ENTRY(_dispatch_stub_648),
TABLE_ENTRY(_dispatch_stub_649),
TABLE_ENTRY(_dispatch_stub_650),
TABLE_ENTRY(_dispatch_stub_651),
@@ -6159,6 +6259,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(_dispatch_stub_654),
TABLE_ENTRY(_dispatch_stub_655),
TABLE_ENTRY(_dispatch_stub_656),
+ TABLE_ENTRY(_dispatch_stub_657),
TABLE_ENTRY(AreProgramsResidentNV),
TABLE_ENTRY(BindProgramNV),
TABLE_ENTRY(DeleteProgramsNV),
@@ -6235,19 +6336,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(SetFragmentShaderConstantATI),
TABLE_ENTRY(PointParameteriNV),
TABLE_ENTRY(PointParameterivNV),
- TABLE_ENTRY(_dispatch_stub_733),
TABLE_ENTRY(_dispatch_stub_734),
TABLE_ENTRY(_dispatch_stub_735),
TABLE_ENTRY(_dispatch_stub_736),
TABLE_ENTRY(_dispatch_stub_737),
+ TABLE_ENTRY(_dispatch_stub_738),
TABLE_ENTRY(GetProgramNamedParameterdvNV),
TABLE_ENTRY(GetProgramNamedParameterfvNV),
TABLE_ENTRY(ProgramNamedParameter4dNV),
TABLE_ENTRY(ProgramNamedParameter4dvNV),
TABLE_ENTRY(ProgramNamedParameter4fNV),
TABLE_ENTRY(ProgramNamedParameter4fvNV),
- TABLE_ENTRY(_dispatch_stub_744),
TABLE_ENTRY(_dispatch_stub_745),
+ TABLE_ENTRY(_dispatch_stub_746),
TABLE_ENTRY(BindFramebufferEXT),
TABLE_ENTRY(BindRenderbufferEXT),
TABLE_ENTRY(CheckFramebufferStatusEXT),
@@ -6265,13 +6366,13 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(IsFramebufferEXT),
TABLE_ENTRY(IsRenderbufferEXT),
TABLE_ENTRY(RenderbufferStorageEXT),
- TABLE_ENTRY(_dispatch_stub_763),
+ TABLE_ENTRY(_dispatch_stub_764),
TABLE_ENTRY(FramebufferTextureLayerEXT),
- TABLE_ENTRY(_dispatch_stub_765),
TABLE_ENTRY(_dispatch_stub_766),
TABLE_ENTRY(_dispatch_stub_767),
TABLE_ENTRY(_dispatch_stub_768),
TABLE_ENTRY(_dispatch_stub_769),
+ TABLE_ENTRY(_dispatch_stub_770),
/* 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.
@@ -6639,6 +6740,25 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(PointParameteri),
TABLE_ENTRY(PointParameteriv),
TABLE_ENTRY(BlendEquationSeparate),
+ TABLE_ENTRY(BindFramebuffer),
+ TABLE_ENTRY(BindRenderbuffer),
+ TABLE_ENTRY(CheckFramebufferStatus),
+ TABLE_ENTRY(DeleteFramebuffers),
+ TABLE_ENTRY(DeleteRenderbuffers),
+ TABLE_ENTRY(FramebufferRenderbuffer),
+ TABLE_ENTRY(FramebufferTexture1D),
+ TABLE_ENTRY(FramebufferTexture2D),
+ TABLE_ENTRY(FramebufferTexture3D),
+ TABLE_ENTRY(GenFramebuffers),
+ TABLE_ENTRY(GenRenderbuffers),
+ TABLE_ENTRY(GenerateMipmap),
+ TABLE_ENTRY(GetFramebufferAttachmentParameteriv),
+ TABLE_ENTRY(GetRenderbufferParameteriv),
+ TABLE_ENTRY(IsFramebuffer),
+ TABLE_ENTRY(IsRenderbuffer),
+ TABLE_ENTRY(RenderbufferStorage),
+ TABLE_ENTRY(BlitFramebuffer),
+ TABLE_ENTRY(FramebufferTextureLayer),
};
#endif /*UNUSED_TABLE_NAME*/
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index 5a99d505ec..ba652bc3c6 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -613,6 +613,7 @@ static const char gl_string_table[] =
"glGetActiveAttribARB\0"
"glGetAttribLocationARB\0"
"glDrawBuffersARB\0"
+ "glRenderbufferStorageMultisample\0"
"glPolygonOffsetEXT\0"
"glGetPixelTexGenParameterfvSGIS\0"
"glGetPixelTexGenParameterivSGIS\0"
@@ -1101,6 +1102,25 @@ static const char gl_string_table[] =
"glPointParameteriv\0"
"glBlendEquationSeparate\0"
"glBlendEquationSeparateATI\0"
+ "glBindFramebuffer\0"
+ "glBindRenderbuffer\0"
+ "glCheckFramebufferStatus\0"
+ "glDeleteFramebuffers\0"
+ "glDeleteRenderbuffers\0"
+ "glFramebufferRenderbuffer\0"
+ "glFramebufferTexture1D\0"
+ "glFramebufferTexture2D\0"
+ "glFramebufferTexture3D\0"
+ "glGenFramebuffers\0"
+ "glGenRenderbuffers\0"
+ "glGenerateMipmap\0"
+ "glGetFramebufferAttachmentParameteriv\0"
+ "glGetRenderbufferParameteriv\0"
+ "glIsFramebuffer\0"
+ "glIsRenderbuffer\0"
+ "glRenderbufferStorage\0"
+ "glBlitFramebuffer\0"
+ "glFramebufferTextureLayer\0"
;
@@ -1118,7 +1138,6 @@ static const char gl_string_table[] =
#define gl_dispatch_stub_364 mgl_dispatch_stub_364
#define gl_dispatch_stub_365 mgl_dispatch_stub_365
#define gl_dispatch_stub_366 mgl_dispatch_stub_366
-#define gl_dispatch_stub_562 mgl_dispatch_stub_562
#define gl_dispatch_stub_563 mgl_dispatch_stub_563
#define gl_dispatch_stub_564 mgl_dispatch_stub_564
#define gl_dispatch_stub_565 mgl_dispatch_stub_565
@@ -1126,10 +1145,10 @@ static const char gl_string_table[] =
#define gl_dispatch_stub_567 mgl_dispatch_stub_567
#define gl_dispatch_stub_568 mgl_dispatch_stub_568
#define gl_dispatch_stub_569 mgl_dispatch_stub_569
-#define gl_dispatch_stub_580 mgl_dispatch_stub_580
+#define gl_dispatch_stub_570 mgl_dispatch_stub_570
#define gl_dispatch_stub_581 mgl_dispatch_stub_581
-#define gl_dispatch_stub_606 mgl_dispatch_stub_606
-#define gl_dispatch_stub_648 mgl_dispatch_stub_648
+#define gl_dispatch_stub_582 mgl_dispatch_stub_582
+#define gl_dispatch_stub_607 mgl_dispatch_stub_607
#define gl_dispatch_stub_649 mgl_dispatch_stub_649
#define gl_dispatch_stub_650 mgl_dispatch_stub_650
#define gl_dispatch_stub_651 mgl_dispatch_stub_651
@@ -1138,19 +1157,20 @@ static const char gl_string_table[] =
#define gl_dispatch_stub_654 mgl_dispatch_stub_654
#define gl_dispatch_stub_655 mgl_dispatch_stub_655
#define gl_dispatch_stub_656 mgl_dispatch_stub_656
-#define gl_dispatch_stub_733 mgl_dispatch_stub_733
+#define gl_dispatch_stub_657 mgl_dispatch_stub_657
#define gl_dispatch_stub_734 mgl_dispatch_stub_734
#define gl_dispatch_stub_735 mgl_dispatch_stub_735
#define gl_dispatch_stub_736 mgl_dispatch_stub_736
#define gl_dispatch_stub_737 mgl_dispatch_stub_737
-#define gl_dispatch_stub_744 mgl_dispatch_stub_744
+#define gl_dispatch_stub_738 mgl_dispatch_stub_738
#define gl_dispatch_stub_745 mgl_dispatch_stub_745
-#define gl_dispatch_stub_763 mgl_dispatch_stub_763
-#define gl_dispatch_stub_765 mgl_dispatch_stub_765
+#define gl_dispatch_stub_746 mgl_dispatch_stub_746
+#define gl_dispatch_stub_764 mgl_dispatch_stub_764
#define gl_dispatch_stub_766 mgl_dispatch_stub_766
#define gl_dispatch_stub_767 mgl_dispatch_stub_767
#define gl_dispatch_stub_768 mgl_dispatch_stub_768
#define gl_dispatch_stub_769 mgl_dispatch_stub_769
+#define gl_dispatch_stub_770 mgl_dispatch_stub_770
#endif /* USE_MGL_NAMESPACE */
@@ -1169,7 +1189,6 @@ extern void gl_dispatch_stub_363(void);
extern void gl_dispatch_stub_364(void);
extern void gl_dispatch_stub_365(void);
extern void gl_dispatch_stub_366(void);
-extern void gl_dispatch_stub_562(void);
extern void gl_dispatch_stub_563(void);
extern void gl_dispatch_stub_564(void);
extern void gl_dispatch_stub_565(void);
@@ -1177,10 +1196,10 @@ extern void gl_dispatch_stub_566(void);
extern void gl_dispatch_stub_567(void);
extern void gl_dispatch_stub_568(void);
extern void gl_dispatch_stub_569(void);
-extern void gl_dispatch_stub_580(void);
+extern void gl_dispatch_stub_570(void);
extern void gl_dispatch_stub_581(void);
-extern void gl_dispatch_stub_606(void);
-extern void gl_dispatch_stub_648(void);
+extern void gl_dispatch_stub_582(void);
+extern void gl_dispatch_stub_607(void);
extern void gl_dispatch_stub_649(void);
extern void gl_dispatch_stub_650(void);
extern void gl_dispatch_stub_651(void);
@@ -1189,19 +1208,20 @@ extern void gl_dispatch_stub_653(void);
extern void gl_dispatch_stub_654(void);
extern void gl_dispatch_stub_655(void);
extern void gl_dispatch_stub_656(void);
-extern void gl_dispatch_stub_733(void);
+extern void gl_dispatch_stub_657(void);
extern void gl_dispatch_stub_734(void);
extern void gl_dispatch_stub_735(void);
extern void gl_dispatch_stub_736(void);
extern void gl_dispatch_stub_737(void);
-extern void gl_dispatch_stub_744(void);
+extern void gl_dispatch_stub_738(void);
extern void gl_dispatch_stub_745(void);
-extern void gl_dispatch_stub_763(void);
-extern void gl_dispatch_stub_765(void);
+extern void gl_dispatch_stub_746(void);
+extern void gl_dispatch_stub_764(void);
extern void gl_dispatch_stub_766(void);
extern void gl_dispatch_stub_767(void);
extern void gl_dispatch_stub_768(void);
extern void gl_dispatch_stub_769(void);
+extern void gl_dispatch_stub_770(void);
#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
static const glprocs_table_t static_functions[] = {
@@ -1766,494 +1786,514 @@ static const glprocs_table_t static_functions[] = {
NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT),
- NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS),
- NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS),
- NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS),
- NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS),
- NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS),
- NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS),
- NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
- NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
- NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT),
- NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT),
- NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT),
- NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT),
- NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT),
- NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT),
- NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT),
- NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT),
- NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT),
- NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT),
- NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
- NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
- NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
- NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
- NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
- NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
- NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
- NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
- NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
- NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
- NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
- NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
- NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
- NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
- NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
- NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
- NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
- NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
- NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
- NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
- NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
- NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
- NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
- NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
- NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX),
- NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV),
- NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV),
- NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV),
- NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV),
- NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV),
- NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV),
- NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV),
- NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV),
- NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV),
- NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV),
- NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV),
- NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV),
- NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV),
- NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV),
- NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV),
- NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA),
- NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA),
- NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA),
- NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA),
- NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA),
- NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA),
- NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA),
- NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA),
- NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA),
- NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM),
- NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM),
- NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV),
- NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV),
- NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV),
- NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV),
- NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV),
- NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV),
- NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV),
- NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV),
- NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
- NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
- NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV),
- NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
- NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV),
- NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV),
- NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV),
- NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV),
- NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV),
- NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV),
- NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV),
- NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
- NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
- NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
- NAME_FUNC_OFFSET(11332, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
- NAME_FUNC_OFFSET(11357, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
- NAME_FUNC_OFFSET(11382, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
- NAME_FUNC_OFFSET(11410, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
- NAME_FUNC_OFFSET(11426, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
- NAME_FUNC_OFFSET(11445, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
- NAME_FUNC_OFFSET(11465, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
- NAME_FUNC_OFFSET(11484, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
- NAME_FUNC_OFFSET(11504, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
- NAME_FUNC_OFFSET(11523, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
- NAME_FUNC_OFFSET(11543, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
- NAME_FUNC_OFFSET(11562, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
- NAME_FUNC_OFFSET(11582, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
- NAME_FUNC_OFFSET(11601, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
- NAME_FUNC_OFFSET(11621, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
- NAME_FUNC_OFFSET(11640, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
- NAME_FUNC_OFFSET(11660, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
- NAME_FUNC_OFFSET(11679, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
- NAME_FUNC_OFFSET(11699, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
- NAME_FUNC_OFFSET(11718, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
- NAME_FUNC_OFFSET(11738, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
- NAME_FUNC_OFFSET(11757, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
- NAME_FUNC_OFFSET(11777, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
- NAME_FUNC_OFFSET(11796, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
- NAME_FUNC_OFFSET(11816, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
- NAME_FUNC_OFFSET(11835, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
- NAME_FUNC_OFFSET(11855, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
- NAME_FUNC_OFFSET(11874, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
- NAME_FUNC_OFFSET(11894, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
- NAME_FUNC_OFFSET(11914, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
- NAME_FUNC_OFFSET(11935, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
- NAME_FUNC_OFFSET(11959, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
- NAME_FUNC_OFFSET(11980, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
- NAME_FUNC_OFFSET(12001, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
- NAME_FUNC_OFFSET(12022, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
- NAME_FUNC_OFFSET(12043, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
- NAME_FUNC_OFFSET(12064, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
- NAME_FUNC_OFFSET(12085, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
- NAME_FUNC_OFFSET(12106, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
- NAME_FUNC_OFFSET(12127, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
- NAME_FUNC_OFFSET(12148, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
- NAME_FUNC_OFFSET(12169, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
- NAME_FUNC_OFFSET(12190, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
- NAME_FUNC_OFFSET(12211, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
- NAME_FUNC_OFFSET(12233, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
- NAME_FUNC_OFFSET(12255, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
- NAME_FUNC_OFFSET(12277, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
- NAME_FUNC_OFFSET(12299, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
- NAME_FUNC_OFFSET(12324, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
- NAME_FUNC_OFFSET(12348, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
- NAME_FUNC_OFFSET(12370, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
- NAME_FUNC_OFFSET(12392, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
- NAME_FUNC_OFFSET(12414, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
- NAME_FUNC_OFFSET(12440, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
- NAME_FUNC_OFFSET(12463, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
- NAME_FUNC_OFFSET(12487, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
- NAME_FUNC_OFFSET(12505, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
- NAME_FUNC_OFFSET(12520, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
- NAME_FUNC_OFFSET(12551, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
- NAME_FUNC_OFFSET(12571, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
- NAME_FUNC_OFFSET(12592, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, _gloffset_ActiveStencilFaceEXT),
- NAME_FUNC_OFFSET(12615, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_BindVertexArrayAPPLE),
- NAME_FUNC_OFFSET(12638, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_DeleteVertexArraysAPPLE),
- NAME_FUNC_OFFSET(12664, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_GenVertexArraysAPPLE),
- NAME_FUNC_OFFSET(12687, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_IsVertexArrayAPPLE),
- NAME_FUNC_OFFSET(12708, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
- NAME_FUNC_OFFSET(12739, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
- NAME_FUNC_OFFSET(12770, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
- NAME_FUNC_OFFSET(12798, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
- NAME_FUNC_OFFSET(12827, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
- NAME_FUNC_OFFSET(12855, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
- NAME_FUNC_OFFSET(12884, gl_dispatch_stub_744, gl_dispatch_stub_744, NULL, _gloffset_DepthBoundsEXT),
- NAME_FUNC_OFFSET(12901, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
- NAME_FUNC_OFFSET(12928, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
- NAME_FUNC_OFFSET(12949, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
- NAME_FUNC_OFFSET(12971, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
- NAME_FUNC_OFFSET(12999, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
- NAME_FUNC_OFFSET(13023, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
- NAME_FUNC_OFFSET(13048, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
- NAME_FUNC_OFFSET(13077, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
- NAME_FUNC_OFFSET(13103, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
- NAME_FUNC_OFFSET(13129, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
- NAME_FUNC_OFFSET(13155, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
- NAME_FUNC_OFFSET(13176, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
- NAME_FUNC_OFFSET(13198, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
- NAME_FUNC_OFFSET(13218, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
- NAME_FUNC_OFFSET(13259, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
- NAME_FUNC_OFFSET(13291, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
- NAME_FUNC_OFFSET(13310, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
- NAME_FUNC_OFFSET(13330, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
- NAME_FUNC_OFFSET(13355, gl_dispatch_stub_763, gl_dispatch_stub_763, NULL, _gloffset_BlitFramebufferEXT),
- NAME_FUNC_OFFSET(13376, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT),
- NAME_FUNC_OFFSET(13405, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_StencilFuncSeparateATI),
- NAME_FUNC_OFFSET(13430, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_ProgramEnvParameters4fvEXT),
- NAME_FUNC_OFFSET(13459, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramLocalParameters4fvEXT),
- NAME_FUNC_OFFSET(13490, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_GetQueryObjecti64vEXT),
- NAME_FUNC_OFFSET(13514, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjectui64vEXT),
- NAME_FUNC_OFFSET(13539, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
- NAME_FUNC_OFFSET(13557, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
- NAME_FUNC_OFFSET(13574, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
- NAME_FUNC_OFFSET(13590, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
- NAME_FUNC_OFFSET(13615, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
- NAME_FUNC_OFFSET(13635, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
- NAME_FUNC_OFFSET(13655, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
- NAME_FUNC_OFFSET(13678, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
- NAME_FUNC_OFFSET(13701, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
- NAME_FUNC_OFFSET(13721, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
- NAME_FUNC_OFFSET(13738, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
- NAME_FUNC_OFFSET(13755, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
- NAME_FUNC_OFFSET(13770, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
- NAME_FUNC_OFFSET(13794, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
- NAME_FUNC_OFFSET(13813, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
- NAME_FUNC_OFFSET(13832, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
- NAME_FUNC_OFFSET(13848, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
- NAME_FUNC_OFFSET(13867, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
- NAME_FUNC_OFFSET(13890, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
- NAME_FUNC_OFFSET(13906, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
- NAME_FUNC_OFFSET(13922, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
- NAME_FUNC_OFFSET(13949, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
- NAME_FUNC_OFFSET(13976, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
- NAME_FUNC_OFFSET(13996, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
- NAME_FUNC_OFFSET(14015, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
- NAME_FUNC_OFFSET(14034, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
- NAME_FUNC_OFFSET(14064, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
- NAME_FUNC_OFFSET(14094, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
- NAME_FUNC_OFFSET(14124, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
- NAME_FUNC_OFFSET(14154, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
- NAME_FUNC_OFFSET(14173, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
- NAME_FUNC_OFFSET(14196, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
- NAME_FUNC_OFFSET(14221, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
- NAME_FUNC_OFFSET(14246, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
- NAME_FUNC_OFFSET(14273, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
- NAME_FUNC_OFFSET(14301, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
- NAME_FUNC_OFFSET(14328, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
- NAME_FUNC_OFFSET(14356, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
- NAME_FUNC_OFFSET(14385, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
- NAME_FUNC_OFFSET(14414, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
- NAME_FUNC_OFFSET(14440, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
- NAME_FUNC_OFFSET(14471, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
- NAME_FUNC_OFFSET(14502, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
- NAME_FUNC_OFFSET(14526, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
- NAME_FUNC_OFFSET(14549, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
- NAME_FUNC_OFFSET(14567, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
- NAME_FUNC_OFFSET(14596, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
- NAME_FUNC_OFFSET(14625, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
- NAME_FUNC_OFFSET(14640, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
- NAME_FUNC_OFFSET(14666, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
- NAME_FUNC_OFFSET(14692, glHistogram, glHistogram, NULL, _gloffset_Histogram),
- NAME_FUNC_OFFSET(14707, glMinmax, glMinmax, NULL, _gloffset_Minmax),
- NAME_FUNC_OFFSET(14719, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
- NAME_FUNC_OFFSET(14739, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
- NAME_FUNC_OFFSET(14756, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
- NAME_FUNC_OFFSET(14772, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
- NAME_FUNC_OFFSET(14791, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
- NAME_FUNC_OFFSET(14814, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
- NAME_FUNC_OFFSET(14830, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
- NAME_FUNC_OFFSET(14852, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
- NAME_FUNC_OFFSET(14870, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
- NAME_FUNC_OFFSET(14889, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
- NAME_FUNC_OFFSET(14907, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
- NAME_FUNC_OFFSET(14926, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
- NAME_FUNC_OFFSET(14944, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
- NAME_FUNC_OFFSET(14963, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
- NAME_FUNC_OFFSET(14981, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
- NAME_FUNC_OFFSET(15000, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
- NAME_FUNC_OFFSET(15018, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
- NAME_FUNC_OFFSET(15037, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
- NAME_FUNC_OFFSET(15055, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
- NAME_FUNC_OFFSET(15074, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
- NAME_FUNC_OFFSET(15092, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
- NAME_FUNC_OFFSET(15111, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
- NAME_FUNC_OFFSET(15129, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
- NAME_FUNC_OFFSET(15148, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
- NAME_FUNC_OFFSET(15166, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
- NAME_FUNC_OFFSET(15185, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
- NAME_FUNC_OFFSET(15203, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
- NAME_FUNC_OFFSET(15222, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
- NAME_FUNC_OFFSET(15240, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
- NAME_FUNC_OFFSET(15259, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
- NAME_FUNC_OFFSET(15277, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
- NAME_FUNC_OFFSET(15296, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
- NAME_FUNC_OFFSET(15314, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
- NAME_FUNC_OFFSET(15333, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
- NAME_FUNC_OFFSET(15351, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
- NAME_FUNC_OFFSET(15370, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
- NAME_FUNC_OFFSET(15388, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
- NAME_FUNC_OFFSET(15407, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
- NAME_FUNC_OFFSET(15425, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
- NAME_FUNC_OFFSET(15444, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
- NAME_FUNC_OFFSET(15467, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
- NAME_FUNC_OFFSET(15490, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
- NAME_FUNC_OFFSET(15513, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
- NAME_FUNC_OFFSET(15536, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
- NAME_FUNC_OFFSET(15559, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
- NAME_FUNC_OFFSET(15576, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
- NAME_FUNC_OFFSET(15599, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
- NAME_FUNC_OFFSET(15622, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
- NAME_FUNC_OFFSET(15645, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
- NAME_FUNC_OFFSET(15671, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
- NAME_FUNC_OFFSET(15697, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
- NAME_FUNC_OFFSET(15723, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
- NAME_FUNC_OFFSET(15747, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
- NAME_FUNC_OFFSET(15774, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
- NAME_FUNC_OFFSET(15800, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
- NAME_FUNC_OFFSET(15820, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
- NAME_FUNC_OFFSET(15840, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
- NAME_FUNC_OFFSET(15860, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
- NAME_FUNC_OFFSET(15883, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
- NAME_FUNC_OFFSET(15907, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
- NAME_FUNC_OFFSET(15930, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
- NAME_FUNC_OFFSET(15954, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
- NAME_FUNC_OFFSET(15971, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
- NAME_FUNC_OFFSET(15989, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
- NAME_FUNC_OFFSET(16006, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
- NAME_FUNC_OFFSET(16024, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
- NAME_FUNC_OFFSET(16041, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
- NAME_FUNC_OFFSET(16059, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
- NAME_FUNC_OFFSET(16076, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
- NAME_FUNC_OFFSET(16094, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
- NAME_FUNC_OFFSET(16111, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
- NAME_FUNC_OFFSET(16129, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
- NAME_FUNC_OFFSET(16146, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
- NAME_FUNC_OFFSET(16164, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
- NAME_FUNC_OFFSET(16181, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
- NAME_FUNC_OFFSET(16199, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
- NAME_FUNC_OFFSET(16216, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
- NAME_FUNC_OFFSET(16234, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
- NAME_FUNC_OFFSET(16251, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
- NAME_FUNC_OFFSET(16269, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
- NAME_FUNC_OFFSET(16288, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
- NAME_FUNC_OFFSET(16307, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
- NAME_FUNC_OFFSET(16326, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
- NAME_FUNC_OFFSET(16345, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
- NAME_FUNC_OFFSET(16365, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
- NAME_FUNC_OFFSET(16385, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
- NAME_FUNC_OFFSET(16405, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
- NAME_FUNC_OFFSET(16423, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
- NAME_FUNC_OFFSET(16440, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
- NAME_FUNC_OFFSET(16458, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
- NAME_FUNC_OFFSET(16475, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
- NAME_FUNC_OFFSET(16493, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
- NAME_FUNC_OFFSET(16511, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
- NAME_FUNC_OFFSET(16528, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
- NAME_FUNC_OFFSET(16546, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
- NAME_FUNC_OFFSET(16565, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
- NAME_FUNC_OFFSET(16584, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
- NAME_FUNC_OFFSET(16603, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
- NAME_FUNC_OFFSET(16625, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
- NAME_FUNC_OFFSET(16638, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
- NAME_FUNC_OFFSET(16651, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
- NAME_FUNC_OFFSET(16667, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
- NAME_FUNC_OFFSET(16683, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
- NAME_FUNC_OFFSET(16696, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
- NAME_FUNC_OFFSET(16719, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
- NAME_FUNC_OFFSET(16739, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
- NAME_FUNC_OFFSET(16758, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
- NAME_FUNC_OFFSET(16769, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
- NAME_FUNC_OFFSET(16781, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
- NAME_FUNC_OFFSET(16795, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
- NAME_FUNC_OFFSET(16808, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
- NAME_FUNC_OFFSET(16824, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
- NAME_FUNC_OFFSET(16835, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
- NAME_FUNC_OFFSET(16848, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
- NAME_FUNC_OFFSET(16867, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
- NAME_FUNC_OFFSET(16887, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
- NAME_FUNC_OFFSET(16900, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
- NAME_FUNC_OFFSET(16910, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
- NAME_FUNC_OFFSET(16926, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
- NAME_FUNC_OFFSET(16945, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
- NAME_FUNC_OFFSET(16963, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
- NAME_FUNC_OFFSET(16984, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
- NAME_FUNC_OFFSET(16999, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
- NAME_FUNC_OFFSET(17014, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
- NAME_FUNC_OFFSET(17028, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
- NAME_FUNC_OFFSET(17043, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
- NAME_FUNC_OFFSET(17055, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
- NAME_FUNC_OFFSET(17068, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
- NAME_FUNC_OFFSET(17080, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
- NAME_FUNC_OFFSET(17093, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
- NAME_FUNC_OFFSET(17105, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
- NAME_FUNC_OFFSET(17118, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
- NAME_FUNC_OFFSET(17130, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
- NAME_FUNC_OFFSET(17143, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
- NAME_FUNC_OFFSET(17155, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
- NAME_FUNC_OFFSET(17168, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
- NAME_FUNC_OFFSET(17180, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
- NAME_FUNC_OFFSET(17193, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
- NAME_FUNC_OFFSET(17205, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
- NAME_FUNC_OFFSET(17218, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
- NAME_FUNC_OFFSET(17230, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
- NAME_FUNC_OFFSET(17243, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
- NAME_FUNC_OFFSET(17262, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
- NAME_FUNC_OFFSET(17281, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
- NAME_FUNC_OFFSET(17300, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
- NAME_FUNC_OFFSET(17313, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
- NAME_FUNC_OFFSET(17331, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
- NAME_FUNC_OFFSET(17352, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
- NAME_FUNC_OFFSET(17370, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
- NAME_FUNC_OFFSET(17390, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(17404, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(17421, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
- NAME_FUNC_OFFSET(17437, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
- NAME_FUNC_OFFSET(17456, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17474, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17495, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17517, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17536, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17558, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17581, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
- NAME_FUNC_OFFSET(17600, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
- NAME_FUNC_OFFSET(17620, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
- NAME_FUNC_OFFSET(17639, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
- NAME_FUNC_OFFSET(17659, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
- NAME_FUNC_OFFSET(17678, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
- NAME_FUNC_OFFSET(17698, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
- NAME_FUNC_OFFSET(17717, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
- NAME_FUNC_OFFSET(17737, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
- NAME_FUNC_OFFSET(17756, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
- NAME_FUNC_OFFSET(17776, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
- NAME_FUNC_OFFSET(17796, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
- NAME_FUNC_OFFSET(17817, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
- NAME_FUNC_OFFSET(17837, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
- NAME_FUNC_OFFSET(17858, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
- NAME_FUNC_OFFSET(17878, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
- NAME_FUNC_OFFSET(17899, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
- NAME_FUNC_OFFSET(17923, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
- NAME_FUNC_OFFSET(17941, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
- NAME_FUNC_OFFSET(17961, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
- NAME_FUNC_OFFSET(17979, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
- NAME_FUNC_OFFSET(17991, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
- NAME_FUNC_OFFSET(18004, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
- NAME_FUNC_OFFSET(18016, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
- NAME_FUNC_OFFSET(18029, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(18049, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(18073, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(18087, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(18104, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(18119, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(18137, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(18151, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(18168, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(18183, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(18201, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(18215, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(18232, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(18247, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(18265, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(18279, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(18296, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(18311, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(18329, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(18343, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(18360, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(18375, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(18393, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(18407, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(18424, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(18439, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(18457, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(18471, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(18488, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(18503, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(18521, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(18535, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(18552, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(18567, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(18585, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
- NAME_FUNC_OFFSET(18602, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
- NAME_FUNC_OFFSET(18622, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
- NAME_FUNC_OFFSET(18639, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(18665, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(18694, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
- NAME_FUNC_OFFSET(18709, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
- NAME_FUNC_OFFSET(18727, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
- NAME_FUNC_OFFSET(18746, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
- NAME_FUNC_OFFSET(18770, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET( 8951, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample),
+ NAME_FUNC_OFFSET( 8984, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT),
+ NAME_FUNC_OFFSET( 9003, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9035, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_GetPixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9067, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfSGIS),
+ NAME_FUNC_OFFSET( 9095, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9124, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameteriSGIS),
+ NAME_FUNC_OFFSET( 9152, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_PixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9181, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET( 9198, gl_dispatch_stub_570, gl_dispatch_stub_570, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET( 9218, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT),
+ NAME_FUNC_OFFSET( 9236, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT),
+ NAME_FUNC_OFFSET( 9257, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT),
+ NAME_FUNC_OFFSET( 9275, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT),
+ NAME_FUNC_OFFSET( 9294, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9315, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT),
+ NAME_FUNC_OFFSET( 9334, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET( 9355, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET( 9377, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT),
+ NAME_FUNC_OFFSET( 9393, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT),
+ NAME_FUNC_OFFSET( 9411, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterdvEXT),
+ NAME_FUNC_OFFSET( 9432, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_CullParameterfvEXT),
+ NAME_FUNC_OFFSET( 9453, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET( 9475, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET( 9498, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET( 9520, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET( 9543, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET( 9565, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET( 9588, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET( 9610, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET( 9633, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET( 9655, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET( 9678, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET( 9701, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET( 9725, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET( 9748, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET( 9772, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET( 9795, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET( 9819, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET( 9846, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET( 9867, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET( 9890, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9911, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET( 9926, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET( 9942, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET( 9957, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET( 9973, gl_dispatch_stub_607, gl_dispatch_stub_607, NULL, _gloffset_PixelTexGenSGIX),
+ NAME_FUNC_OFFSET( 9991, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(10014, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10040, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10061, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV),
+ NAME_FUNC_OFFSET(10079, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV),
+ NAME_FUNC_OFFSET(10098, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV),
+ NAME_FUNC_OFFSET(10121, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV),
+ NAME_FUNC_OFFSET(10145, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV),
+ NAME_FUNC_OFFSET(10168, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV),
+ NAME_FUNC_OFFSET(10192, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV),
+ NAME_FUNC_OFFSET(10215, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10247, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV),
+ NAME_FUNC_OFFSET(10312, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV),
+ NAME_FUNC_OFFSET(10345, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10382, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10419, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA),
+ NAME_FUNC_OFFSET(10439, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(10457, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(10476, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(10494, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(10513, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(10531, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(10550, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(10568, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(10587, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(10605, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(10624, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(10642, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(10661, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(10679, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(10698, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(10716, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(10735, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA),
+ NAME_FUNC_OFFSET(10753, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA),
+ NAME_FUNC_OFFSET(10772, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA),
+ NAME_FUNC_OFFSET(10790, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA),
+ NAME_FUNC_OFFSET(10809, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA),
+ NAME_FUNC_OFFSET(10827, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA),
+ NAME_FUNC_OFFSET(10846, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA),
+ NAME_FUNC_OFFSET(10864, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA),
+ NAME_FUNC_OFFSET(10883, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawArraysIBM),
+ NAME_FUNC_OFFSET(10908, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_MultiModeDrawElementsIBM),
+ NAME_FUNC_OFFSET(10935, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_DeleteFencesNV),
+ NAME_FUNC_OFFSET(10952, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_FinishFenceNV),
+ NAME_FUNC_OFFSET(10968, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GenFencesNV),
+ NAME_FUNC_OFFSET(10982, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_GetFenceivNV),
+ NAME_FUNC_OFFSET(10997, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_IsFenceNV),
+ NAME_FUNC_OFFSET(11009, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_SetFenceNV),
+ NAME_FUNC_OFFSET(11022, gl_dispatch_stub_657, gl_dispatch_stub_657, NULL, _gloffset_TestFenceNV),
+ NAME_FUNC_OFFSET(11036, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV),
+ NAME_FUNC_OFFSET(11060, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(11076, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(11095, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV),
+ NAME_FUNC_OFFSET(11114, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(11130, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV),
+ NAME_FUNC_OFFSET(11156, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV),
+ NAME_FUNC_OFFSET(11182, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV),
+ NAME_FUNC_OFFSET(11203, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV),
+ NAME_FUNC_OFFSET(11220, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV),
+ NAME_FUNC_OFFSET(11241, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(11269, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV),
+ NAME_FUNC_OFFSET(11291, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV),
+ NAME_FUNC_OFFSET(11313, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
+ NAME_FUNC_OFFSET(11335, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(11349, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
+ NAME_FUNC_OFFSET(11365, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
+ NAME_FUNC_OFFSET(11390, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
+ NAME_FUNC_OFFSET(11415, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
+ NAME_FUNC_OFFSET(11443, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
+ NAME_FUNC_OFFSET(11459, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
+ NAME_FUNC_OFFSET(11478, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
+ NAME_FUNC_OFFSET(11498, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
+ NAME_FUNC_OFFSET(11517, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
+ NAME_FUNC_OFFSET(11537, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
+ NAME_FUNC_OFFSET(11556, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
+ NAME_FUNC_OFFSET(11576, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
+ NAME_FUNC_OFFSET(11595, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
+ NAME_FUNC_OFFSET(11615, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
+ NAME_FUNC_OFFSET(11634, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
+ NAME_FUNC_OFFSET(11654, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
+ NAME_FUNC_OFFSET(11673, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
+ NAME_FUNC_OFFSET(11693, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
+ NAME_FUNC_OFFSET(11712, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
+ NAME_FUNC_OFFSET(11732, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
+ NAME_FUNC_OFFSET(11751, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
+ NAME_FUNC_OFFSET(11771, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
+ NAME_FUNC_OFFSET(11790, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
+ NAME_FUNC_OFFSET(11810, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
+ NAME_FUNC_OFFSET(11829, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
+ NAME_FUNC_OFFSET(11849, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
+ NAME_FUNC_OFFSET(11868, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
+ NAME_FUNC_OFFSET(11888, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
+ NAME_FUNC_OFFSET(11907, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
+ NAME_FUNC_OFFSET(11927, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
+ NAME_FUNC_OFFSET(11947, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
+ NAME_FUNC_OFFSET(11968, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
+ NAME_FUNC_OFFSET(11992, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
+ NAME_FUNC_OFFSET(12013, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
+ NAME_FUNC_OFFSET(12034, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
+ NAME_FUNC_OFFSET(12055, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
+ NAME_FUNC_OFFSET(12076, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
+ NAME_FUNC_OFFSET(12097, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
+ NAME_FUNC_OFFSET(12118, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
+ NAME_FUNC_OFFSET(12139, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
+ NAME_FUNC_OFFSET(12160, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
+ NAME_FUNC_OFFSET(12181, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
+ NAME_FUNC_OFFSET(12202, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
+ NAME_FUNC_OFFSET(12223, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
+ NAME_FUNC_OFFSET(12244, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
+ NAME_FUNC_OFFSET(12266, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12288, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12310, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12332, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
+ NAME_FUNC_OFFSET(12357, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
+ NAME_FUNC_OFFSET(12381, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12403, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12425, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12447, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
+ NAME_FUNC_OFFSET(12473, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
+ NAME_FUNC_OFFSET(12496, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
+ NAME_FUNC_OFFSET(12520, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
+ NAME_FUNC_OFFSET(12538, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
+ NAME_FUNC_OFFSET(12553, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
+ NAME_FUNC_OFFSET(12584, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(12604, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(12625, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, _gloffset_ActiveStencilFaceEXT),
+ NAME_FUNC_OFFSET(12648, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, _gloffset_BindVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12671, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, _gloffset_DeleteVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12697, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_GenVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12720, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_IsVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12741, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
+ NAME_FUNC_OFFSET(12772, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
+ NAME_FUNC_OFFSET(12803, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
+ NAME_FUNC_OFFSET(12831, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
+ NAME_FUNC_OFFSET(12860, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
+ NAME_FUNC_OFFSET(12888, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
+ NAME_FUNC_OFFSET(12917, gl_dispatch_stub_745, gl_dispatch_stub_745, NULL, _gloffset_DepthBoundsEXT),
+ NAME_FUNC_OFFSET(12934, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(12961, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
+ NAME_FUNC_OFFSET(12982, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
+ NAME_FUNC_OFFSET(13004, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
+ NAME_FUNC_OFFSET(13032, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
+ NAME_FUNC_OFFSET(13056, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13081, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
+ NAME_FUNC_OFFSET(13110, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
+ NAME_FUNC_OFFSET(13136, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
+ NAME_FUNC_OFFSET(13162, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
+ NAME_FUNC_OFFSET(13188, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
+ NAME_FUNC_OFFSET(13209, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13231, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
+ NAME_FUNC_OFFSET(13251, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
+ NAME_FUNC_OFFSET(13292, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
+ NAME_FUNC_OFFSET(13324, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
+ NAME_FUNC_OFFSET(13343, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
+ NAME_FUNC_OFFSET(13363, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
+ NAME_FUNC_OFFSET(13388, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_BlitFramebufferEXT),
+ NAME_FUNC_OFFSET(13409, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT),
+ NAME_FUNC_OFFSET(13438, gl_dispatch_stub_766, gl_dispatch_stub_766, NULL, _gloffset_StencilFuncSeparateATI),
+ NAME_FUNC_OFFSET(13463, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_ProgramEnvParameters4fvEXT),
+ NAME_FUNC_OFFSET(13492, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramLocalParameters4fvEXT),
+ NAME_FUNC_OFFSET(13523, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_GetQueryObjecti64vEXT),
+ NAME_FUNC_OFFSET(13547, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjectui64vEXT),
+ NAME_FUNC_OFFSET(13572, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
+ NAME_FUNC_OFFSET(13590, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
+ NAME_FUNC_OFFSET(13607, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
+ NAME_FUNC_OFFSET(13623, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
+ NAME_FUNC_OFFSET(13648, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
+ NAME_FUNC_OFFSET(13668, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
+ NAME_FUNC_OFFSET(13688, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
+ NAME_FUNC_OFFSET(13711, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
+ NAME_FUNC_OFFSET(13734, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
+ NAME_FUNC_OFFSET(13754, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
+ NAME_FUNC_OFFSET(13771, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
+ NAME_FUNC_OFFSET(13788, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
+ NAME_FUNC_OFFSET(13803, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
+ NAME_FUNC_OFFSET(13827, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
+ NAME_FUNC_OFFSET(13846, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
+ NAME_FUNC_OFFSET(13865, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
+ NAME_FUNC_OFFSET(13881, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
+ NAME_FUNC_OFFSET(13900, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
+ NAME_FUNC_OFFSET(13923, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13939, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13955, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
+ NAME_FUNC_OFFSET(13982, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
+ NAME_FUNC_OFFSET(14009, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
+ NAME_FUNC_OFFSET(14029, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14048, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14067, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14097, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14127, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14157, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14187, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
+ NAME_FUNC_OFFSET(14206, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
+ NAME_FUNC_OFFSET(14229, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14254, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14279, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
+ NAME_FUNC_OFFSET(14306, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14334, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
+ NAME_FUNC_OFFSET(14361, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14389, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14418, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14447, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
+ NAME_FUNC_OFFSET(14473, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14504, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14535, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
+ NAME_FUNC_OFFSET(14559, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
+ NAME_FUNC_OFFSET(14582, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
+ NAME_FUNC_OFFSET(14600, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
+ NAME_FUNC_OFFSET(14629, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
+ NAME_FUNC_OFFSET(14658, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
+ NAME_FUNC_OFFSET(14673, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
+ NAME_FUNC_OFFSET(14699, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
+ NAME_FUNC_OFFSET(14725, glHistogram, glHistogram, NULL, _gloffset_Histogram),
+ NAME_FUNC_OFFSET(14740, glMinmax, glMinmax, NULL, _gloffset_Minmax),
+ NAME_FUNC_OFFSET(14752, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
+ NAME_FUNC_OFFSET(14772, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
+ NAME_FUNC_OFFSET(14789, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
+ NAME_FUNC_OFFSET(14805, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
+ NAME_FUNC_OFFSET(14824, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
+ NAME_FUNC_OFFSET(14847, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
+ NAME_FUNC_OFFSET(14863, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
+ NAME_FUNC_OFFSET(14885, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
+ NAME_FUNC_OFFSET(14903, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
+ NAME_FUNC_OFFSET(14922, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
+ NAME_FUNC_OFFSET(14940, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
+ NAME_FUNC_OFFSET(14959, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
+ NAME_FUNC_OFFSET(14977, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
+ NAME_FUNC_OFFSET(14996, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
+ NAME_FUNC_OFFSET(15014, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
+ NAME_FUNC_OFFSET(15033, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
+ NAME_FUNC_OFFSET(15051, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
+ NAME_FUNC_OFFSET(15070, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
+ NAME_FUNC_OFFSET(15088, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
+ NAME_FUNC_OFFSET(15107, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
+ NAME_FUNC_OFFSET(15125, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
+ NAME_FUNC_OFFSET(15144, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
+ NAME_FUNC_OFFSET(15162, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
+ NAME_FUNC_OFFSET(15181, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
+ NAME_FUNC_OFFSET(15199, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
+ NAME_FUNC_OFFSET(15218, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
+ NAME_FUNC_OFFSET(15236, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
+ NAME_FUNC_OFFSET(15255, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
+ NAME_FUNC_OFFSET(15273, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
+ NAME_FUNC_OFFSET(15292, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
+ NAME_FUNC_OFFSET(15310, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
+ NAME_FUNC_OFFSET(15329, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
+ NAME_FUNC_OFFSET(15347, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
+ NAME_FUNC_OFFSET(15366, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
+ NAME_FUNC_OFFSET(15384, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
+ NAME_FUNC_OFFSET(15403, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
+ NAME_FUNC_OFFSET(15421, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
+ NAME_FUNC_OFFSET(15440, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
+ NAME_FUNC_OFFSET(15458, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
+ NAME_FUNC_OFFSET(15477, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
+ NAME_FUNC_OFFSET(15500, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15523, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15546, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15569, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15592, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+ NAME_FUNC_OFFSET(15609, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+ NAME_FUNC_OFFSET(15632, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+ NAME_FUNC_OFFSET(15655, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+ NAME_FUNC_OFFSET(15678, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+ NAME_FUNC_OFFSET(15704, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+ NAME_FUNC_OFFSET(15730, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+ NAME_FUNC_OFFSET(15756, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+ NAME_FUNC_OFFSET(15780, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15807, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15833, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+ NAME_FUNC_OFFSET(15853, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+ NAME_FUNC_OFFSET(15873, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+ NAME_FUNC_OFFSET(15893, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
+ NAME_FUNC_OFFSET(15916, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
+ NAME_FUNC_OFFSET(15940, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
+ NAME_FUNC_OFFSET(15963, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
+ NAME_FUNC_OFFSET(15987, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
+ NAME_FUNC_OFFSET(16004, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
+ NAME_FUNC_OFFSET(16022, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
+ NAME_FUNC_OFFSET(16039, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
+ NAME_FUNC_OFFSET(16057, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
+ NAME_FUNC_OFFSET(16074, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
+ NAME_FUNC_OFFSET(16092, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
+ NAME_FUNC_OFFSET(16109, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
+ NAME_FUNC_OFFSET(16127, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
+ NAME_FUNC_OFFSET(16144, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
+ NAME_FUNC_OFFSET(16162, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
+ NAME_FUNC_OFFSET(16179, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
+ NAME_FUNC_OFFSET(16197, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
+ NAME_FUNC_OFFSET(16214, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
+ NAME_FUNC_OFFSET(16232, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
+ NAME_FUNC_OFFSET(16249, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
+ NAME_FUNC_OFFSET(16267, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
+ NAME_FUNC_OFFSET(16284, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
+ NAME_FUNC_OFFSET(16302, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
+ NAME_FUNC_OFFSET(16321, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
+ NAME_FUNC_OFFSET(16340, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
+ NAME_FUNC_OFFSET(16359, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
+ NAME_FUNC_OFFSET(16378, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
+ NAME_FUNC_OFFSET(16398, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
+ NAME_FUNC_OFFSET(16418, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
+ NAME_FUNC_OFFSET(16438, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
+ NAME_FUNC_OFFSET(16456, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET(16473, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET(16491, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET(16508, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET(16526, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
+ NAME_FUNC_OFFSET(16544, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET(16561, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET(16579, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
+ NAME_FUNC_OFFSET(16598, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
+ NAME_FUNC_OFFSET(16617, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
+ NAME_FUNC_OFFSET(16636, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET(16658, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET(16671, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET(16684, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET(16700, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET(16716, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET(16729, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET(16752, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET(16772, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET(16791, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET(16802, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET(16814, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET(16828, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET(16841, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET(16857, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET(16868, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET(16881, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET(16900, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET(16920, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET(16933, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET(16943, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET(16959, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET(16978, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET(16996, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET(17017, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET(17032, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET(17047, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET(17061, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET(17076, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET(17088, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET(17101, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET(17113, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET(17126, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET(17138, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET(17151, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET(17163, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET(17176, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET(17188, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET(17201, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET(17213, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET(17226, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET(17238, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET(17251, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET(17263, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET(17276, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET(17295, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET(17314, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET(17333, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET(17346, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET(17364, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET(17385, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET(17403, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET(17423, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17437, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17454, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET(17470, gl_dispatch_stub_570, gl_dispatch_stub_570, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET(17489, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17507, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17528, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17550, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17569, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17591, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17614, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET(17633, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET(17653, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET(17672, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET(17692, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET(17711, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET(17731, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET(17750, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET(17770, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET(17789, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET(17809, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET(17829, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET(17850, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET(17870, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET(17891, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET(17911, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET(17932, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET(17956, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET(17974, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET(17994, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET(18012, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET(18024, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET(18037, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET(18049, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET(18062, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(18082, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(18106, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(18120, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(18137, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(18152, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(18170, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(18184, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(18201, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18216, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18234, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18248, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18265, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18280, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18298, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18312, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18329, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18344, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18362, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18376, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18393, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18408, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18426, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18440, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18457, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18472, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18490, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18504, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18521, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18536, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18554, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18568, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18585, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18600, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18618, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(18635, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(18655, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(18672, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18698, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18727, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(18742, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(18760, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(18779, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(18803, gl_dispatch_stub_746, gl_dispatch_stub_746, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(18830, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
+ NAME_FUNC_OFFSET(18848, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
+ NAME_FUNC_OFFSET(18867, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
+ NAME_FUNC_OFFSET(18892, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
+ NAME_FUNC_OFFSET(18913, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
+ NAME_FUNC_OFFSET(18935, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
+ NAME_FUNC_OFFSET(18961, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
+ NAME_FUNC_OFFSET(18984, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
+ NAME_FUNC_OFFSET(19007, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
+ NAME_FUNC_OFFSET(19030, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
+ NAME_FUNC_OFFSET(19048, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
+ NAME_FUNC_OFFSET(19067, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
+ NAME_FUNC_OFFSET(19084, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
+ NAME_FUNC_OFFSET(19122, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
+ NAME_FUNC_OFFSET(19151, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
+ NAME_FUNC_OFFSET(19167, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
+ NAME_FUNC_OFFSET(19184, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
+ NAME_FUNC_OFFSET(19206, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_BlitFramebufferEXT),
+ NAME_FUNC_OFFSET(19224, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT),
NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
};
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index bae3bf11cb..f8ee0d59dd 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -880,5 +880,12 @@ _mesa_init_exec_table(struct _glapi_table *exec)
/* GL_ATI_separate_stencil */
SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI);
+
+#if FEATURE_ARB_framebuffer_object
+ /* The ARB_fbo functions are the union of
+ * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
+ */
+ SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
+#endif
}
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index f3f482f8c8..b04095fd16 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -98,6 +98,28 @@ _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj )
}
+static void
+init_array(GLcontext *ctx,
+ struct gl_client_array *array, GLint size, GLint type)
+{
+ array->Size = size;
+ array->Type = type;
+ array->Format = GL_RGBA; /* only significant for GL_EXT_vertex_array_bgra */
+ array->Stride = 0;
+ array->StrideB = 0;
+ array->Ptr = NULL;
+ array->Enabled = GL_FALSE;
+ array->Normalized = GL_FALSE;
+#if FEATURE_ARB_vertex_buffer_object
+ /* Vertex array buffers */
+ array->BufferObj = ctx->Array.NullBufferObj;
+#endif
+}
+
+
+/**
+ * Initialize a gl_array_object's arrays.
+ */
void
_mesa_initialize_array_object( GLcontext *ctx,
struct gl_array_object *obj,
@@ -107,87 +129,23 @@ _mesa_initialize_array_object( GLcontext *ctx,
obj->Name = name;
- /* Vertex arrays */
- obj->Vertex.Size = 4;
- obj->Vertex.Type = GL_FLOAT;
- obj->Vertex.Stride = 0;
- obj->Vertex.StrideB = 0;
- obj->Vertex.Ptr = NULL;
- obj->Vertex.Enabled = GL_FALSE;
- obj->Normal.Type = GL_FLOAT;
- obj->Normal.Stride = 0;
- obj->Normal.StrideB = 0;
- obj->Normal.Ptr = NULL;
- obj->Normal.Enabled = GL_FALSE;
- obj->Color.Size = 4;
- obj->Color.Type = GL_FLOAT;
- obj->Color.Stride = 0;
- obj->Color.StrideB = 0;
- obj->Color.Ptr = NULL;
- obj->Color.Enabled = GL_FALSE;
- obj->SecondaryColor.Size = 4;
- obj->SecondaryColor.Type = GL_FLOAT;
- obj->SecondaryColor.Stride = 0;
- obj->SecondaryColor.StrideB = 0;
- obj->SecondaryColor.Ptr = NULL;
- obj->SecondaryColor.Enabled = GL_FALSE;
- obj->FogCoord.Size = 1;
- obj->FogCoord.Type = GL_FLOAT;
- obj->FogCoord.Stride = 0;
- obj->FogCoord.StrideB = 0;
- obj->FogCoord.Ptr = NULL;
- obj->FogCoord.Enabled = GL_FALSE;
- obj->Index.Type = GL_FLOAT;
- obj->Index.Stride = 0;
- obj->Index.StrideB = 0;
- obj->Index.Ptr = NULL;
- obj->Index.Enabled = GL_FALSE;
+ /* Init the individual arrays */
+ init_array(ctx, &obj->Vertex, 4, GL_FLOAT);
+ init_array(ctx, &obj->Normal, 3, GL_FLOAT);
+ init_array(ctx, &obj->Color, 4, GL_FLOAT);
+ init_array(ctx, &obj->SecondaryColor, 4, GL_FLOAT);
+ init_array(ctx, &obj->FogCoord, 1, GL_FLOAT);
+ init_array(ctx, &obj->Index, 1, GL_FLOAT);
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
- obj->TexCoord[i].Size = 4;
- obj->TexCoord[i].Type = GL_FLOAT;
- obj->TexCoord[i].Stride = 0;
- obj->TexCoord[i].StrideB = 0;
- obj->TexCoord[i].Ptr = NULL;
- obj->TexCoord[i].Enabled = GL_FALSE;
+ init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT);
}
- obj->EdgeFlag.Stride = 0;
- obj->EdgeFlag.StrideB = 0;
- obj->EdgeFlag.Ptr = NULL;
- obj->EdgeFlag.Enabled = GL_FALSE;
+ init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL);
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- obj->VertexAttrib[i].Size = 4;
- obj->VertexAttrib[i].Type = GL_FLOAT;
- obj->VertexAttrib[i].Stride = 0;
- obj->VertexAttrib[i].StrideB = 0;
- obj->VertexAttrib[i].Ptr = NULL;
- obj->VertexAttrib[i].Enabled = GL_FALSE;
- obj->VertexAttrib[i].Normalized = GL_FALSE;
+ init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT);
}
#if FEATURE_point_size_array
- obj->PointSize.Type = GL_FLOAT;
- obj->PointSize.Stride = 0;
- obj->PointSize.StrideB = 0;
- obj->PointSize.Ptr = NULL;
- obj->PointSize.Enabled = GL_FALSE;
- obj->PointSize.BufferObj = ctx->Array.NullBufferObj;
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object
- /* Vertex array buffers */
- obj->Vertex.BufferObj = ctx->Array.NullBufferObj;
- obj->Normal.BufferObj = ctx->Array.NullBufferObj;
- obj->Color.BufferObj = ctx->Array.NullBufferObj;
- obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
- obj->FogCoord.BufferObj = ctx->Array.NullBufferObj;
- obj->Index.BufferObj = ctx->Array.NullBufferObj;
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
- obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj;
- }
- obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj;
- }
+ init_array(ctx, &obj->PointSize, 1, GL_FLOAT);
#endif
}
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 825c841ee2..add0045959 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -56,7 +56,7 @@
#include "texstate.h"
#include "varray.h"
#include "mtypes.h"
-#include "math/m_xform.h"
+
/**
* Special struct for saving/restoring texture state (GL_TEXTURE_BIT)
@@ -820,15 +820,9 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate)
_mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
obj->MaxAnisotropy);
}
- if (ctx->Extensions.SGIX_shadow) {
- _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_SGIX,
- obj->CompareFlag);
- _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_OPERATOR_SGIX,
- obj->CompareOperator);
- }
- if (ctx->Extensions.SGIX_shadow_ambient) {
- _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX,
- obj->ShadowAmbient);
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
+ obj->CompareFailValue);
}
}
@@ -909,14 +903,13 @@ _mesa_PopAttrib(void)
* function, but legal for the later.
*/
GLboolean multipleBuffers = GL_FALSE;
- if (ctx->Extensions.ARB_draw_buffers) {
- GLuint i;
- for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
- if (color->DrawBuffer[i] != GL_NONE) {
- multipleBuffers = GL_TRUE;
- break;
- }
- }
+ GLuint i;
+
+ for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
+ if (color->DrawBuffer[i] != GL_NONE) {
+ multipleBuffers = GL_TRUE;
+ break;
+ }
}
/* Call the API_level functions, not _mesa_drawbuffers()
* since we need to do error checking on the pop'd
@@ -1012,9 +1005,8 @@ _mesa_PopAttrib(void)
_mesa_Hint(GL_FOG_HINT, hint->Fog);
_mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT,
hint->ClipVolumeClipping);
- if (ctx->Extensions.ARB_texture_compression)
- _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
- hint->TextureCompression);
+ _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
+ hint->TextureCompression);
}
break;
case GL_LIGHTING_BIT:
@@ -1275,9 +1267,6 @@ adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step)
array->ArrayObj->TexCoord[i].BufferObj->RefCount += step;
for (i = 0; i < VERT_ATTRIB_MAX; i++)
array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step;
-
- array->ArrayBufferObj->RefCount += step;
- array->ElementArrayBufferObj->RefCount += step;
}
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 5dd85de272..85db3868c4 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -247,13 +247,14 @@ _mesa_DrawBuffer(GLenum buffer)
destMask = draw_buffer_enum_to_bitmask(buffer);
if (destMask == BAD_MASK) {
/* totally bogus buffer */
- _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer=0x%x)", buffer);
return;
}
destMask &= supportedMask;
if (destMask == 0x0) {
/* none of the named color buffers exist! */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(buffer)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawBuffer(buffer=0x%x)", buffer);
return;
}
}
@@ -289,11 +290,10 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (!ctx->Extensions.ARB_draw_buffers) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB");
- return;
- }
- if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) {
+ /* Turns out n==0 is a valid input that should not produce an error.
+ * The remaining code below correctly handles the n==0 case.
+ */
+ if (n < 0 || n > (GLsizei) ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)");
return;
}
@@ -335,12 +335,14 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
_mesa_drawbuffers(ctx, n, buffers, destMask);
/*
- * Call device driver function.
+ * Call device driver function. Note that n can be equal to 0,
+ * in which case we don't want to reference buffers[0], which
+ * may not be valid.
*/
if (ctx->Driver.DrawBuffers)
ctx->Driver.DrawBuffers(ctx, n, buffers);
else if (ctx->Driver.DrawBuffer)
- ctx->Driver.DrawBuffer(ctx, buffers[0]);
+ ctx->Driver.DrawBuffer(ctx, n>0? buffers[0]:GL_NONE);
}
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index 43ef55ee3b..96c80e6ef8 100644
--- a/src/mesa/main/clip.c
+++ b/src/mesa/main/clip.c
@@ -29,7 +29,6 @@
#include "macros.h"
#include "mtypes.h"
-#include "math/m_xform.h"
#include "math/m_matrix.h"
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index c3feffda98..9d0cd18e05 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -101,16 +101,16 @@
#define MAX_COLOR_TABLE_SIZE 256
/** Number of 1D/2D texture mipmap levels */
-#define MAX_TEXTURE_LEVELS 12
+#define MAX_TEXTURE_LEVELS 13
/** Number of 3D texture mipmap levels */
#define MAX_3D_TEXTURE_LEVELS 9
/** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */
-#define MAX_CUBE_TEXTURE_LEVELS 12
+#define MAX_CUBE_TEXTURE_LEVELS 13
/** Maximum rectangular texture size - GL_NV_texture_rectangle */
-#define MAX_TEXTURE_RECT_SIZE 2048
+#define MAX_TEXTURE_RECT_SIZE 4096
/** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */
#define MAX_ARRAY_TEXTURE_LAYERS 64
@@ -166,7 +166,7 @@
#define MAX_TEXTURE_MAX_ANISOTROPY 16.0
/** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
-#define MAX_TEXTURE_LOD_BIAS 11.0
+#define MAX_TEXTURE_LOD_BIAS 12.0
/** For GL_ARB_vertex_program */
/*@{*/
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8299628218..9705fd8a98 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -151,10 +151,7 @@
#include "shader/atifragshader.h"
#endif
#if _HAVE_FULL_GL
-#include "math/m_translate.h"
#include "math/m_matrix.h"
-#include "math/m_xform.h"
-#include "math/mathmod.h"
#endif
#ifdef USE_SPARC_ASM
@@ -186,6 +183,7 @@ GLfloat _mesa_ubyte_to_float_color_tab[256];
void
_mesa_notifySwapBuffers(__GLcontext *ctx)
{
+ FLUSH_VERTICES( ctx, 0 );
if (ctx->Driver.Flush) {
ctx->Driver.Flush(ctx);
}
@@ -387,13 +385,9 @@ one_time_init( GLcontext *ctx )
_mesa_init_sqrt_table();
-#if _HAVE_FULL_GL
- _math_init();
-
for (i = 0; i < 256; i++) {
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
-#endif
#ifdef USE_SPARC_ASM
_mesa_init_sparc_glapi_relocs();
@@ -581,7 +575,7 @@ static void
delete_displaylist_cb(GLuint id, void *data, void *userData)
{
#if FEATURE_dlist
- struct mesa_display_list *list = (struct mesa_display_list *) data;
+ struct gl_display_list *list = (struct gl_display_list *) data;
GLcontext *ctx = (GLcontext *) userData;
_mesa_delete_list(ctx, list);
#endif
@@ -870,6 +864,9 @@ _mesa_init_constants(GLcontext *ctx)
assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
+ /* Max texture size should be <= max viewport size (render to texture) */
+ assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
+
/* Constants, may be overriden (usually only reduced) by device drivers */
ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
@@ -932,6 +929,9 @@ _mesa_init_constants(GLcontext *ctx)
ctx->Const.MaxVarying = MAX_VARYING;
#endif
+ /* GL_ARB_framebuffer_object */
+ ctx->Const.MaxSamples = 0;
+
/* sanity checks */
ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
ctx->Const.MaxTextureCoordUnits));
@@ -963,13 +963,18 @@ check_context_limits(GLcontext *ctx)
/* number of coord units cannot be greater than number of image units */
assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
- assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
- assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
+ assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS);
+ assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS);
+ assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS);
+ assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE);
/* make sure largest texture image is <= MAX_WIDTH in size */
- assert((1 << (ctx->Const.MaxTextureLevels -1 )) <= MAX_WIDTH);
- assert((1 << (ctx->Const.MaxCubeTextureLevels -1 )) <= MAX_WIDTH);
- assert((1 << (ctx->Const.Max3DTextureLevels -1 )) <= MAX_WIDTH);
+ assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
+ assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH);
+ assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
+
+ assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
+ assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS);
@@ -1302,10 +1307,10 @@ _mesa_free_context_data( GLcontext *ctx )
}
/* unreference WinSysDraw/Read buffers */
- _mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer);
- _mesa_unreference_framebuffer(&ctx->WinSysReadBuffer);
- _mesa_unreference_framebuffer(&ctx->DrawBuffer);
- _mesa_unreference_framebuffer(&ctx->ReadBuffer);
+ _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->DrawBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL);
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
_mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index ddb38030bf..411b6a7b21 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -34,7 +34,7 @@
/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
struct gl_pixelstore_attrib;
-struct mesa_display_list;
+struct gl_display_list;
/**
* Device driver function table.
@@ -808,6 +808,8 @@ struct dd_function_table {
struct gl_renderbuffer_attachment *att);
void (*FinishRenderTexture)(GLcontext *ctx,
struct gl_renderbuffer_attachment *att);
+ void (*ValidateFramebuffer)(GLcontext *ctx,
+ struct gl_framebuffer *fb);
/*@}*/
#endif
#if FEATURE_EXT_framebuffer_blit
@@ -997,7 +999,7 @@ struct dd_function_table {
* Notify the T&L component before and after calling a display list.
*/
void (*BeginCallList)( GLcontext *ctx,
- struct mesa_display_list *dlist );
+ struct gl_display_list *dlist );
/**
* Called by glEndCallList().
*
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 77fef32558..fcef093ac3 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -24,9 +24,13 @@
#include "mtypes.h"
#include "context.h"
+#include "hash.h"
#include "imports.h"
#include "debug.h"
#include "get.h"
+#include "texobj.h"
+#include "texformat.h"
+
/**
* Primitive names
@@ -164,9 +168,7 @@ static void add_debug_flags( const char *debug )
{ "api", VERBOSE_API },
{ "list", VERBOSE_DISPLAY_LIST },
{ "lighting", VERBOSE_LIGHTING },
- { "disassem", VERBOSE_DISASSEM },
- { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */
- { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */
+ { "disassem", VERBOSE_DISASSEM }
};
GLuint i;
@@ -221,3 +223,98 @@ _mesa_init_debug( GLcontext *ctx )
add_debug_flags(c);
}
+
+/*
+ * Write ppm file
+ */
+static void
+write_ppm(const char *filename, const GLubyte *buffer, int width, int height,
+ int comps, int rcomp, int gcomp, int bcomp)
+{
+ FILE *f = fopen( filename, "w" );
+ if (f) {
+ int i, x, y;
+ const GLubyte *ptr = buffer;
+ fprintf(f,"P6\n");
+ fprintf(f,"# ppm-file created by osdemo.c\n");
+ fprintf(f,"%i %i\n", width,height);
+ fprintf(f,"255\n");
+ fclose(f);
+ f = fopen( filename, "ab" ); /* reopen in binary append mode */
+ for (y=height-1; y>=0; y--) {
+ for (x=0; x<width; x++) {
+ i = (y*width + x) * comps;
+ fputc(ptr[i+rcomp], f); /* write red */
+ fputc(ptr[i+gcomp], f); /* write green */
+ fputc(ptr[i+bcomp], f); /* write blue */
+ }
+ }
+ fclose(f);
+ }
+}
+
+
+/**
+ * Write level[0] image to a ppm file.
+ */
+static void
+write_texture_image(struct gl_texture_object *texObj)
+{
+ const struct gl_texture_image *img = texObj->Image[0][0];
+ if (img) {
+ char s[100];
+
+ /* make filename */
+ sprintf(s, "/tmp/teximage%u.ppm", texObj->Name);
+
+ switch (img->TexFormat->MesaFormat) {
+ case MESA_FORMAT_RGBA8888:
+ write_ppm(s, img->Data, img->Width, img->Height, 4, 3, 2, 1);
+ break;
+ case MESA_FORMAT_ARGB8888:
+ write_ppm(s, img->Data, img->Width, img->Height, 4, 2, 1, 0);
+ break;
+ default:
+ printf("XXXX unsupported mesa tex format %d in %s\n",
+ img->TexFormat->MesaFormat, __FUNCTION__);
+ }
+ }
+}
+
+
+static GLboolean DumpImages;
+
+
+static void
+dump_texture_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_texture_object *texObj = (struct gl_texture_object *) data;
+ int i;
+ (void) userData;
+
+ printf("Texture %u\n", texObj->Name);
+ printf(" Target 0x%x\n", texObj->Target);
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ struct gl_texture_image *texImg = texObj->Image[0][i];
+ if (texImg) {
+ printf(" Image %u: %d x %d x %d at %p\n", i,
+ texImg->Width, texImg->Height, texImg->Depth, texImg->Data);
+ if (DumpImages && i == 0) {
+ write_texture_image(texObj);
+ }
+ }
+ }
+}
+
+
+/**
+ * Print basic info about all texture objext to stdout.
+ * If dumpImages is true, write PPM of level[0] image to a file.
+ */
+void
+_mesa_dump_textures(GLboolean dumpImages)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DumpImages = dumpImages;
+ _mesa_HashDeleteAll(ctx->Shared->TexObjects, dump_texture_cb, ctx);
+}
diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h
index 94d99c384b..1862ec75b7 100644
--- a/src/mesa/main/debug.h
+++ b/src/mesa/main/debug.h
@@ -57,4 +57,7 @@ extern void _mesa_init_debug( GLcontext *ctx );
#endif
+extern void
+_mesa_dump_textures(GLboolean dumpImages);
+
#endif
diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c
index 9d208e2997..7be2aacaf2 100644
--- a/src/mesa/main/depthstencil.c
+++ b/src/mesa/main/depthstencil.c
@@ -62,15 +62,9 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
static void
delete_wrapper(struct gl_renderbuffer *rb)
{
- struct gl_renderbuffer *dsrb = rb->Wrapped;
- ASSERT(dsrb);
ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 ||
rb->_ActualFormat == GL_STENCIL_INDEX8_EXT);
- /* decrement refcount on the wrapped buffer and delete it if necessary */
- dsrb->RefCount--;
- if (dsrb->RefCount <= 0) {
- dsrb->Delete(dsrb);
- }
+ _mesa_reference_renderbuffer(&rb->Wrapped, NULL);
_mesa_free(rb);
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index d3aee196c7..76b3315034 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -85,7 +85,6 @@
#endif
#include "math/m_matrix.h"
-#include "math/m_xform.h"
#include "glapi/dispatch.h"
@@ -370,7 +369,7 @@ typedef enum
* contiguous nodes in memory.
* Each node is the union of a variety of data types.
*/
-union node
+union gl_dlist_node
{
OpCode opcode;
GLboolean b;
@@ -387,6 +386,9 @@ union node
};
+typedef union gl_dlist_node Node;
+
+
/**
* How many nodes to allocate at a time.
*
@@ -414,13 +416,13 @@ void mesa_print_display_list(GLuint list);
* Make an empty display list. This is used by glGenLists() to
* reserve display list IDs.
*/
-static struct mesa_display_list *
-make_list(GLuint list, GLuint count)
+static struct gl_display_list *
+make_list(GLuint name, GLuint count)
{
- struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list);
- dlist->id = list;
- dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count);
- dlist->node[0].opcode = OPCODE_END_OF_LIST;
+ struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
+ dlist->Name = name;
+ dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count);
+ dlist->Head[0].opcode = OPCODE_END_OF_LIST;
return dlist;
}
@@ -428,10 +430,10 @@ make_list(GLuint list, GLuint count)
/**
* Lookup function to just encapsulate casting.
*/
-static INLINE struct mesa_display_list *
+static INLINE struct gl_display_list *
lookup_list(GLcontext *ctx, GLuint list)
{
- return (struct mesa_display_list *)
+ return (struct gl_display_list *)
_mesa_HashLookup(ctx->Shared->DisplayList, list);
}
@@ -442,12 +444,12 @@ lookup_list(GLcontext *ctx, GLuint list)
* \param dlist - display list pointer
*/
void
-_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
+_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist)
{
Node *n, *block;
GLboolean done;
- n = block = dlist->node;
+ n = block = dlist->Head;
done = block ? GL_FALSE : GL_TRUE;
while (!done) {
@@ -596,7 +598,7 @@ _mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
static void
destroy_list(GLcontext *ctx, GLuint list)
{
- struct mesa_display_list *dlist;
+ struct gl_display_list *dlist;
if (list == 0)
return;
@@ -2521,12 +2523,12 @@ save_MultMatrixd(const GLdouble * m)
static void GLAPIENTRY
-save_NewList(GLuint list, GLenum mode)
+save_NewList(GLuint name, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
/* It's an error to call this function while building a display list */
_mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
- (void) list;
+ (void) name;
(void) mode;
}
@@ -5731,7 +5733,7 @@ islist(GLcontext *ctx, GLuint list)
static void
execute_list(GLcontext *ctx, GLuint list)
{
- struct mesa_display_list *dlist;
+ struct gl_display_list *dlist;
Node *n;
GLboolean done;
@@ -5752,7 +5754,7 @@ execute_list(GLcontext *ctx, GLuint list)
if (ctx->Driver.BeginCallList)
ctx->Driver.BeginCallList(ctx, dlist);
- n = dlist->node;
+ n = dlist->Head;
done = GL_FALSE;
while (!done) {
@@ -6723,7 +6725,7 @@ _mesa_GenLists(GLsizei range)
* Begin a new display list.
*/
void GLAPIENTRY
-_mesa_NewList(GLuint list, GLenum mode)
+_mesa_NewList(GLuint name, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
@@ -6732,10 +6734,10 @@ _mesa_NewList(GLuint list, GLenum mode)
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glNewList %u %s\n", list,
+ _mesa_debug(ctx, "glNewList %u %s\n", name,
_mesa_lookup_enum_by_nr(mode));
- if (list == 0) {
+ if (name == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
return;
}
@@ -6745,7 +6747,7 @@ _mesa_NewList(GLuint list, GLenum mode)
return;
}
- if (ctx->ListState.CurrentListPtr) {
+ if (ctx->ListState.CurrentList) {
/* already compiling a display list */
_mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
return;
@@ -6755,10 +6757,8 @@ _mesa_NewList(GLuint list, GLenum mode)
ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
/* Allocate new display list */
- ctx->ListState.CurrentListNum = list;
- ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE);
- ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node;
- ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock;
+ ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE);
+ ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
ctx->ListState.CurrentPos = 0;
/* Reset acumulated list state:
@@ -6770,7 +6770,7 @@ _mesa_NewList(GLuint list, GLenum mode)
ctx->ListState.ActiveMaterialSize[i] = 0;
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
- ctx->Driver.NewList(ctx, list, mode);
+ ctx->Driver.NewList(ctx, name, mode);
ctx->CurrentDispatch = ctx->Save;
_glapi_set_dispatch(ctx->CurrentDispatch);
@@ -6791,7 +6791,7 @@ _mesa_EndList(void)
_mesa_debug(ctx, "glEndList\n");
/* Check that a list is under construction */
- if (!ctx->ListState.CurrentListPtr) {
+ if (!ctx->ListState.CurrentList) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
return;
}
@@ -6804,18 +6804,18 @@ _mesa_EndList(void)
(void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
/* Destroy old list, if any */
- destroy_list(ctx, ctx->ListState.CurrentListNum);
- /* Install the list */
- _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum,
+ destroy_list(ctx, ctx->ListState.CurrentList->Name);
+
+ /* Install the new list */
+ _mesa_HashInsert(ctx->Shared->DisplayList,
+ ctx->ListState.CurrentList->Name,
ctx->ListState.CurrentList);
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
- mesa_print_display_list(ctx->ListState.CurrentListNum);
+ mesa_print_display_list(ctx->ListState.CurrentList->Name);
ctx->ListState.CurrentList = NULL;
- ctx->ListState.CurrentListNum = 0;
- ctx->ListState.CurrentListPtr = NULL;
ctx->ExecuteFlag = GL_TRUE;
ctx->CompileFlag = GL_FALSE;
@@ -8209,7 +8209,7 @@ enum_string(GLenum k)
static void GLAPIENTRY
print_list(GLcontext *ctx, GLuint list)
{
- struct mesa_display_list *dlist;
+ struct gl_display_list *dlist;
Node *n;
GLboolean done;
@@ -8222,7 +8222,7 @@ print_list(GLcontext *ctx, GLuint list)
if (!dlist)
return;
- n = dlist->node;
+ n = dlist->Head;
_mesa_printf("START-LIST %u, address %p\n", list, (void *) n);
@@ -8584,9 +8584,7 @@ _mesa_init_display_list(GLcontext *ctx)
ctx->ListState.CallDepth = 0;
ctx->ExecuteFlag = GL_TRUE;
ctx->CompileFlag = GL_FALSE;
- ctx->ListState.CurrentListPtr = NULL;
ctx->ListState.CurrentBlock = NULL;
- ctx->ListState.CurrentListNum = 0;
ctx->ListState.CurrentPos = 0;
/* Display List group */
diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h
index ef6a10af83..ab7ec2c8db 100644
--- a/src/mesa/main/dlist.h
+++ b/src/mesa/main/dlist.h
@@ -39,7 +39,7 @@
#if _HAVE_FULL_GL
extern void
-_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist);
+_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist);
extern void GLAPIENTRY _mesa_CallList( GLuint list );
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 2ef4b1b207..7ff3b15c84 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -37,7 +37,6 @@
#include "mtypes.h"
#include "enums.h"
#include "math/m_matrix.h"
-#include "math/m_xform.h"
#include "api_arrayelt.h"
@@ -772,35 +771,30 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
/* GL_ARB_multisample */
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);
@@ -922,10 +916,13 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.TestTwoSide = state;
- if (state)
+ if (state) {
+ ctx->Stencil._BackFace = 2;
ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
- else
+ } else {
+ ctx->Stencil._BackFace = 1;
ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL;
+ }
break;
#if FEATURE_ARB_fragment_program
@@ -1283,19 +1280,14 @@ _mesa_IsEnabled( GLenum cap )
/* GL_ARB_multisample */
case GL_MULTISAMPLE_ARB:
- CHECK_EXTENSION(ARB_multisample);
return ctx->Multisample.Enabled;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- CHECK_EXTENSION(ARB_multisample);
return ctx->Multisample.SampleAlphaToCoverage;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- CHECK_EXTENSION(ARB_multisample);
return ctx->Multisample.SampleAlphaToOne;
case GL_SAMPLE_COVERAGE_ARB:
- CHECK_EXTENSION(ARB_multisample);
return ctx->Multisample.SampleCoverage;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- CHECK_EXTENSION(ARB_multisample);
return ctx->Multisample.SampleCoverageInvert;
/* GL_IBM_rasterpos_clip */
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index 4796f3027a..a864f5a070 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -180,21 +180,37 @@ LONGSTRING static const char enum_string_table[] =
"GL_COLOR_ARRAY_SIZE\0"
"GL_COLOR_ARRAY_STRIDE\0"
"GL_COLOR_ARRAY_TYPE\0"
+ "GL_COLOR_ATTACHMENT0\0"
"GL_COLOR_ATTACHMENT0_EXT\0"
+ "GL_COLOR_ATTACHMENT1\0"
+ "GL_COLOR_ATTACHMENT10\0"
"GL_COLOR_ATTACHMENT10_EXT\0"
+ "GL_COLOR_ATTACHMENT11\0"
"GL_COLOR_ATTACHMENT11_EXT\0"
+ "GL_COLOR_ATTACHMENT12\0"
"GL_COLOR_ATTACHMENT12_EXT\0"
+ "GL_COLOR_ATTACHMENT13\0"
"GL_COLOR_ATTACHMENT13_EXT\0"
+ "GL_COLOR_ATTACHMENT14\0"
"GL_COLOR_ATTACHMENT14_EXT\0"
+ "GL_COLOR_ATTACHMENT15\0"
"GL_COLOR_ATTACHMENT15_EXT\0"
"GL_COLOR_ATTACHMENT1_EXT\0"
+ "GL_COLOR_ATTACHMENT2\0"
"GL_COLOR_ATTACHMENT2_EXT\0"
+ "GL_COLOR_ATTACHMENT3\0"
"GL_COLOR_ATTACHMENT3_EXT\0"
+ "GL_COLOR_ATTACHMENT4\0"
"GL_COLOR_ATTACHMENT4_EXT\0"
+ "GL_COLOR_ATTACHMENT5\0"
"GL_COLOR_ATTACHMENT5_EXT\0"
+ "GL_COLOR_ATTACHMENT6\0"
"GL_COLOR_ATTACHMENT6_EXT\0"
+ "GL_COLOR_ATTACHMENT7\0"
"GL_COLOR_ATTACHMENT7_EXT\0"
+ "GL_COLOR_ATTACHMENT8\0"
"GL_COLOR_ATTACHMENT8_EXT\0"
+ "GL_COLOR_ATTACHMENT9\0"
"GL_COLOR_ATTACHMENT9_EXT\0"
"GL_COLOR_BUFFER_BIT\0"
"GL_COLOR_CLEAR_VALUE\0"
@@ -348,6 +364,8 @@ LONGSTRING static const char enum_string_table[] =
"GL_DECR_WRAP_EXT\0"
"GL_DELETE_STATUS\0"
"GL_DEPTH\0"
+ "GL_DEPTH24_STENCIL8\0"
+ "GL_DEPTH_ATTACHMENT\0"
"GL_DEPTH_ATTACHMENT_EXT\0"
"GL_DEPTH_BIAS\0"
"GL_DEPTH_BITS\0"
@@ -369,6 +387,8 @@ LONGSTRING static const char enum_string_table[] =
"GL_DEPTH_FUNC\0"
"GL_DEPTH_RANGE\0"
"GL_DEPTH_SCALE\0"
+ "GL_DEPTH_STENCIL\0"
+ "GL_DEPTH_STENCIL_ATTACHMENT\0"
"GL_DEPTH_STENCIL_NV\0"
"GL_DEPTH_STENCIL_TO_BGRA_NV\0"
"GL_DEPTH_STENCIL_TO_RGBA_NV\0"
@@ -437,6 +457,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_DRAW_BUFFER9\0"
"GL_DRAW_BUFFER9_ARB\0"
"GL_DRAW_BUFFER9_ATI\0"
+ "GL_DRAW_FRAMEBUFFER\0"
"GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
"GL_DRAW_FRAMEBUFFER_EXT\0"
"GL_DRAW_PIXEL_TOKEN\0"
@@ -522,23 +543,44 @@ LONGSTRING static const char enum_string_table[] =
"GL_FRAGMENT_SHADER\0"
"GL_FRAGMENT_SHADER_ARB\0"
"GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0"
+ "GL_FRAMEBUFFER\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0"
"GL_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_FRAMEBUFFER_COMPLETE\0"
"GL_FRAMEBUFFER_COMPLETE_EXT\0"
+ "GL_FRAMEBUFFER_DEFAULT\0"
"GL_FRAMEBUFFER_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0"
"GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0"
"GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0"
"GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0"
"GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0"
"GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0"
"GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\0"
"GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0"
"GL_FRAMEBUFFER_STATUS_ERROR_EXT\0"
+ "GL_FRAMEBUFFER_UNDEFINED\0"
+ "GL_FRAMEBUFFER_UNSUPPORTED\0"
"GL_FRAMEBUFFER_UNSUPPORTED_EXT\0"
"GL_FRONT\0"
"GL_FRONT_AND_BACK\0"
@@ -611,6 +653,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_INCR\0"
"GL_INCR_WRAP\0"
"GL_INCR_WRAP_EXT\0"
+ "GL_INDEX\0"
"GL_INDEX_ARRAY\0"
"GL_INDEX_ARRAY_BUFFER_BINDING\0"
"GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0"
@@ -646,6 +689,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_INT_VEC4\0"
"GL_INT_VEC4_ARB\0"
"GL_INVALID_ENUM\0"
+ "GL_INVALID_FRAMEBUFFER_OPERATION\0"
"GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0"
"GL_INVALID_OPERATION\0"
"GL_INVALID_VALUE\0"
@@ -890,6 +934,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0"
"GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0"
"GL_MAX_RENDERBUFFER_SIZE_EXT\0"
+ "GL_MAX_SAMPLES\0"
"GL_MAX_SHININESS_NV\0"
"GL_MAX_SPOT_EXPONENT_NV\0"
"GL_MAX_TEXTURE_COORDS\0"
@@ -1257,6 +1302,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_R3_G3_B2\0"
"GL_RASTER_POSITION_UNCLIPPED_IBM\0"
"GL_READ_BUFFER\0"
+ "GL_READ_FRAMEBUFFER\0"
"GL_READ_FRAMEBUFFER_BINDING_EXT\0"
"GL_READ_FRAMEBUFFER_EXT\0"
"GL_READ_ONLY\0"
@@ -1273,10 +1319,21 @@ LONGSTRING static const char enum_string_table[] =
"GL_REFLECTION_MAP_ARB\0"
"GL_REFLECTION_MAP_NV\0"
"GL_RENDER\0"
+ "GL_RENDERBUFFER\0"
+ "GL_RENDERBUFFER_ALPHA_SIZE\0"
"GL_RENDERBUFFER_BINDING_EXT\0"
+ "GL_RENDERBUFFER_BLUE_SIZE\0"
+ "GL_RENDERBUFFER_DEPTH_SIZE\0"
"GL_RENDERBUFFER_EXT\0"
+ "GL_RENDERBUFFER_GREEN_SIZE\0"
+ "GL_RENDERBUFFER_HEIGHT\0"
"GL_RENDERBUFFER_HEIGHT_EXT\0"
+ "GL_RENDERBUFFER_INTERNAL_FORMAT\0"
"GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0"
+ "GL_RENDERBUFFER_RED_SIZE\0"
+ "GL_RENDERBUFFER_SAMPLES\0"
+ "GL_RENDERBUFFER_STENCIL_SIZE\0"
+ "GL_RENDERBUFFER_WIDTH\0"
"GL_RENDERBUFFER_WIDTH_EXT\0"
"GL_RENDERER\0"
"GL_RENDER_MODE\0"
@@ -1420,6 +1477,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_SRC_ALPHA\0"
"GL_SRC_ALPHA_SATURATE\0"
"GL_SRC_COLOR\0"
+ "GL_SRGB\0"
"GL_STACK_OVERFLOW\0"
"GL_STACK_UNDERFLOW\0"
"GL_STATIC_COPY\0"
@@ -1429,6 +1487,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_STATIC_READ\0"
"GL_STATIC_READ_ARB\0"
"GL_STENCIL\0"
+ "GL_STENCIL_ATTACHMENT\0"
"GL_STENCIL_ATTACHMENT_EXT\0"
"GL_STENCIL_BACK_FAIL\0"
"GL_STENCIL_BACK_FAIL_ATI\0"
@@ -1654,6 +1713,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_TEXTURE_RED_SIZE_EXT\0"
"GL_TEXTURE_RESIDENT\0"
"GL_TEXTURE_STACK_DEPTH\0"
+ "GL_TEXTURE_STENCIL_SIZE\0"
"GL_TEXTURE_TOO_LARGE_EXT\0"
"GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0"
"GL_TEXTURE_WIDTH\0"
@@ -1692,10 +1752,12 @@ LONGSTRING static const char enum_string_table[] =
"GL_UNSIGNED_BYTE_3_3_2\0"
"GL_UNSIGNED_INT\0"
"GL_UNSIGNED_INT_10_10_10_2\0"
+ "GL_UNSIGNED_INT_24_8\0"
"GL_UNSIGNED_INT_24_8_NV\0"
"GL_UNSIGNED_INT_2_10_10_10_REV\0"
"GL_UNSIGNED_INT_8_8_8_8\0"
"GL_UNSIGNED_INT_8_8_8_8_REV\0"
+ "GL_UNSIGNED_NORMALIZED\0"
"GL_UNSIGNED_SHORT\0"
"GL_UNSIGNED_SHORT_1_5_5_5_REV\0"
"GL_UNSIGNED_SHORT_4_4_4_4\0"
@@ -1785,7 +1847,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[1748] =
+static const enum_elt all_enums[1810] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -1932,2896 +1994,2982 @@ static const enum_elt all_enums[1748] =
{ 2414, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
{ 2434, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
{ 2456, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
- { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
- { 2501, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
- { 2527, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
- { 2553, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
- { 2579, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
- { 2605, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
- { 2631, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
- { 2657, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
- { 2682, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
- { 2707, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
- { 2732, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
- { 2757, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
- { 2782, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
- { 2807, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
- { 2832, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
- { 2857, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
- { 2882, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
- { 2902, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
- { 2923, 0x00001900 }, /* GL_COLOR_INDEX */
- { 2938, 0x00001603 }, /* GL_COLOR_INDEXES */
- { 2955, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
- { 2973, 0x00000B57 }, /* GL_COLOR_MATERIAL */
- { 2991, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
- { 3014, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
- { 3042, 0x000080B1 }, /* GL_COLOR_MATRIX */
- { 3058, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
- { 3078, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
- { 3106, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 3138, 0x00008458 }, /* GL_COLOR_SUM */
- { 3151, 0x00008458 }, /* GL_COLOR_SUM_ARB */
- { 3168, 0x000080D0 }, /* GL_COLOR_TABLE */
- { 3183, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
- { 3209, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
- { 3239, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
- { 3269, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
- { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
- { 3313, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
- { 3338, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
- { 3367, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
- { 3396, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
- { 3418, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
- { 3444, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
- { 3470, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
- { 3496, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
- { 3526, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
- { 3556, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- { 3586, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
- { 3620, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
- { 3654, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- { 3684, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
- { 3718, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
- { 3752, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
- { 3776, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
- { 3804, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
- { 3832, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
- { 3853, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
- { 3878, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
- { 3899, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
- { 3924, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
- { 3949, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
- { 3968, 0x00008570 }, /* GL_COMBINE */
- { 3979, 0x00008503 }, /* GL_COMBINE4 */
- { 3991, 0x00008572 }, /* GL_COMBINE_ALPHA */
- { 4008, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
- { 4029, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
- { 4050, 0x00008570 }, /* GL_COMBINE_ARB */
- { 4065, 0x00008570 }, /* GL_COMBINE_EXT */
- { 4080, 0x00008571 }, /* GL_COMBINE_RGB */
- { 4095, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
- { 4114, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
- { 4133, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */
- { 4169, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
- { 4193, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
- { 4221, 0x00001300 }, /* GL_COMPILE */
- { 4232, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
- { 4255, 0x00008B81 }, /* GL_COMPILE_STATUS */
- { 4273, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
- { 4293, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
- { 4317, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
- { 4341, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
- { 4369, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
- { 4393, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- { 4423, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
- { 4457, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
- { 4485, 0x000084ED }, /* GL_COMPRESSED_RGB */
- { 4503, 0x000084EE }, /* GL_COMPRESSED_RGBA */
- { 4522, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
- { 4545, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- { 4574, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- { 4607, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- { 4640, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- { 4673, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
- { 4695, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- { 4723, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- { 4755, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
- { 4785, 0x00008576 }, /* GL_CONSTANT */
- { 4797, 0x00008003 }, /* GL_CONSTANT_ALPHA */
- { 4815, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
- { 4837, 0x00008576 }, /* GL_CONSTANT_ARB */
- { 4853, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
- { 4877, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
- { 4899, 0x00008001 }, /* GL_CONSTANT_COLOR */
- { 4917, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
- { 4939, 0x00008576 }, /* GL_CONSTANT_EXT */
- { 4955, 0x00008010 }, /* GL_CONVOLUTION_1D */
- { 4973, 0x00008011 }, /* GL_CONVOLUTION_2D */
- { 4991, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
- { 5019, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
- { 5050, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
- { 5077, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
- { 5108, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
- { 5135, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
- { 5166, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
- { 5194, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
- { 5226, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
- { 5248, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
- { 5274, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
- { 5296, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
- { 5322, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
- { 5343, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
- { 5368, 0x00008862 }, /* GL_COORD_REPLACE */
- { 5385, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
- { 5406, 0x00008862 }, /* GL_COORD_REPLACE_NV */
- { 5426, 0x00001503 }, /* GL_COPY */
- { 5434, 0x0000150C }, /* GL_COPY_INVERTED */
- { 5451, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
- { 5471, 0x00000B44 }, /* GL_CULL_FACE */
- { 5484, 0x00000B45 }, /* GL_CULL_FACE_MODE */
- { 5502, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
- { 5521, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- { 5553, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- { 5588, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
- { 5609, 0x00000001 }, /* GL_CURRENT_BIT */
- { 5624, 0x00000B00 }, /* GL_CURRENT_COLOR */
- { 5641, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
- { 5662, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
- { 5688, 0x00000B01 }, /* GL_CURRENT_INDEX */
- { 5705, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
- { 5727, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
- { 5755, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
- { 5776, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- { 5810, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
- { 5843, 0x00000B02 }, /* GL_CURRENT_NORMAL */
- { 5861, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- { 5891, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
- { 5910, 0x00008865 }, /* GL_CURRENT_QUERY */
- { 5927, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
- { 5948, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
- { 5972, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
- { 5999, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
- { 6023, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
- { 6050, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
- { 6083, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- { 6116, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
- { 6143, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
- { 6169, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
- { 6194, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- { 6223, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
- { 6245, 0x00000900 }, /* GL_CW */
- { 6251, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
- { 6272, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
- { 6293, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
- { 6313, 0x00002101 }, /* GL_DECAL */
- { 6322, 0x00001E03 }, /* GL_DECR */
- { 6330, 0x00008508 }, /* GL_DECR_WRAP */
- { 6343, 0x00008508 }, /* GL_DECR_WRAP_EXT */
- { 6360, 0x00008B80 }, /* GL_DELETE_STATUS */
- { 6377, 0x00001801 }, /* GL_DEPTH */
- { 6386, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
- { 6410, 0x00000D1F }, /* GL_DEPTH_BIAS */
- { 6424, 0x00000D56 }, /* GL_DEPTH_BITS */
- { 6438, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
- { 6458, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
- { 6483, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
- { 6503, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
- { 6521, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
- { 6542, 0x00001902 }, /* GL_DEPTH_COMPONENT */
- { 6561, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
- { 6582, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
- { 6607, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
- { 6633, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
- { 6654, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
- { 6679, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
- { 6705, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
- { 6726, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
- { 6751, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
- { 6777, 0x00000B74 }, /* GL_DEPTH_FUNC */
- { 6791, 0x00000B70 }, /* GL_DEPTH_RANGE */
- { 6806, 0x00000D1E }, /* GL_DEPTH_SCALE */
- { 6821, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
- { 6841, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- { 6869, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- { 6897, 0x00000B71 }, /* GL_DEPTH_TEST */
- { 6911, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
- { 6933, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
- { 6959, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
- { 6978, 0x00001201 }, /* GL_DIFFUSE */
- { 6989, 0x00000BD0 }, /* GL_DITHER */
- { 6999, 0x00000A02 }, /* GL_DOMAIN */
- { 7009, 0x00001100 }, /* GL_DONT_CARE */
- { 7022, 0x000086AE }, /* GL_DOT3_RGB */
- { 7034, 0x000086AF }, /* GL_DOT3_RGBA */
- { 7047, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
- { 7064, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
- { 7081, 0x000086AE }, /* GL_DOT3_RGB_ARB */
- { 7097, 0x00008740 }, /* GL_DOT3_RGB_EXT */
- { 7113, 0x0000140A }, /* GL_DOUBLE */
- { 7123, 0x00000C32 }, /* GL_DOUBLEBUFFER */
- { 7139, 0x00000C01 }, /* GL_DRAW_BUFFER */
- { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0 */
- { 7170, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
- { 7190, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
- { 7210, 0x00008826 }, /* GL_DRAW_BUFFER1 */
- { 7226, 0x0000882F }, /* GL_DRAW_BUFFER10 */
- { 7243, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
- { 7264, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
- { 7285, 0x00008830 }, /* GL_DRAW_BUFFER11 */
- { 7302, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
- { 7323, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
- { 7344, 0x00008831 }, /* GL_DRAW_BUFFER12 */
- { 7361, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
- { 7382, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
- { 7403, 0x00008832 }, /* GL_DRAW_BUFFER13 */
- { 7420, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
- { 7441, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
- { 7462, 0x00008833 }, /* GL_DRAW_BUFFER14 */
- { 7479, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
- { 7500, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
- { 7521, 0x00008834 }, /* GL_DRAW_BUFFER15 */
- { 7538, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
- { 7559, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
- { 7580, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
- { 7600, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
- { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2 */
- { 7636, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
- { 7656, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
- { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3 */
- { 7692, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
- { 7712, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
- { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4 */
- { 7748, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
- { 7768, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
- { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5 */
- { 7804, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
- { 7824, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
- { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6 */
- { 7860, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
- { 7880, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
- { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7 */
- { 7916, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
- { 7936, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
- { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8 */
- { 7972, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
- { 7992, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
- { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9 */
- { 8028, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
- { 8048, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
- { 8068, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- { 8100, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
- { 8124, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
- { 8144, 0x00000304 }, /* GL_DST_ALPHA */
- { 8157, 0x00000306 }, /* GL_DST_COLOR */
- { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY */
- { 8186, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
- { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
- { 8222, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
- { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ */
- { 8258, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
- { 8278, 0x00000B43 }, /* GL_EDGE_FLAG */
- { 8291, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
- { 8310, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- { 8344, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
- { 8382, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
- { 8409, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- { 8435, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
- { 8459, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- { 8491, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
- { 8527, 0x00001600 }, /* GL_EMISSION */
- { 8539, 0x00002000 }, /* GL_ENABLE_BIT */
- { 8553, 0x00000202 }, /* GL_EQUAL */
- { 8562, 0x00001509 }, /* GL_EQUIV */
- { 8571, 0x00010000 }, /* GL_EVAL_BIT */
- { 8583, 0x00000800 }, /* GL_EXP */
- { 8590, 0x00000801 }, /* GL_EXP2 */
- { 8598, 0x00001F03 }, /* GL_EXTENSIONS */
- { 8612, 0x00002400 }, /* GL_EYE_LINEAR */
- { 8626, 0x00002502 }, /* GL_EYE_PLANE */
- { 8639, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
- { 8664, 0x0000855B }, /* GL_EYE_RADIAL_NV */
- { 8681, 0x00000000 }, /* GL_FALSE */
- { 8690, 0x00001101 }, /* GL_FASTEST */
- { 8701, 0x00001C01 }, /* GL_FEEDBACK */
- { 8713, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
- { 8740, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
- { 8764, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
- { 8788, 0x00001B02 }, /* GL_FILL */
- { 8796, 0x00001D00 }, /* GL_FLAT */
- { 8804, 0x00001406 }, /* GL_FLOAT */
- { 8813, 0x00008B5A }, /* GL_FLOAT_MAT2 */
- { 8827, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
- { 8845, 0x00008B5B }, /* GL_FLOAT_MAT3 */
- { 8859, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
- { 8877, 0x00008B5C }, /* GL_FLOAT_MAT4 */
- { 8891, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
- { 8909, 0x00008B50 }, /* GL_FLOAT_VEC2 */
- { 8923, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
- { 8941, 0x00008B51 }, /* GL_FLOAT_VEC3 */
- { 8955, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
- { 8973, 0x00008B52 }, /* GL_FLOAT_VEC4 */
- { 8987, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
- { 9005, 0x00000B60 }, /* GL_FOG */
- { 9012, 0x00000080 }, /* GL_FOG_BIT */
- { 9023, 0x00000B66 }, /* GL_FOG_COLOR */
- { 9036, 0x00008451 }, /* GL_FOG_COORD */
- { 9049, 0x00008451 }, /* GL_FOG_COORDINATE */
- { 9067, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
- { 9091, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- { 9130, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
- { 9173, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- { 9205, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- { 9236, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- { 9265, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
- { 9290, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
- { 9309, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
- { 9343, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
- { 9370, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
- { 9396, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
- { 9420, 0x00008450 }, /* GL_FOG_COORD_SRC */
- { 9437, 0x00000B62 }, /* GL_FOG_DENSITY */
- { 9452, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
- { 9476, 0x00000B64 }, /* GL_FOG_END */
- { 9487, 0x00000C54 }, /* GL_FOG_HINT */
- { 9499, 0x00000B61 }, /* GL_FOG_INDEX */
- { 9512, 0x00000B65 }, /* GL_FOG_MODE */
- { 9524, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
- { 9543, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
- { 9568, 0x00000B63 }, /* GL_FOG_START */
- { 9581, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
- { 9599, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
- { 9623, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
- { 9642, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
- { 9665, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- { 9700, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- { 9742, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- { 9784, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- { 9833, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- { 9885, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
- { 9929, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- { 9973, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
- { 10000, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- { 10028, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
- { 10047, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- { 10088, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- { 10129, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- { 10171, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- { 10222, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- { 10260, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- { 10309, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- { 10351, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- { 10383, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- { 10414, 0x00000404 }, /* GL_FRONT */
- { 10423, 0x00000408 }, /* GL_FRONT_AND_BACK */
- { 10441, 0x00000B46 }, /* GL_FRONT_FACE */
- { 10455, 0x00000400 }, /* GL_FRONT_LEFT */
- { 10469, 0x00000401 }, /* GL_FRONT_RIGHT */
- { 10484, 0x00008006 }, /* GL_FUNC_ADD */
- { 10496, 0x00008006 }, /* GL_FUNC_ADD_EXT */
- { 10512, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
- { 10537, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
- { 10566, 0x0000800A }, /* GL_FUNC_SUBTRACT */
- { 10583, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
- { 10604, 0x00008191 }, /* GL_GENERATE_MIPMAP */
- { 10623, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
- { 10647, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
- { 10676, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
- { 10700, 0x00000206 }, /* GL_GEQUAL */
- { 10710, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */
- { 10735, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */
- { 10763, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
- { 10797, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */
- { 10819, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */
- { 10847, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
- { 10884, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */
- { 10903, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */
- { 10922, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */
- { 10941, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */
- { 10960, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */
- { 10979, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */
- { 10998, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */
- { 11022, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
- { 11054, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */
- { 11080, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
- { 11114, 0x00008C46 }, /* GL_GL_SLUMINANCE */
- { 11131, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */
- { 11149, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */
- { 11174, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */
- { 11197, 0x00008C40 }, /* GL_GL_SRGB */
- { 11208, 0x00008C41 }, /* GL_GL_SRGB8 */
- { 11220, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */
- { 11239, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */
- { 11256, 0x00000204 }, /* GL_GREATER */
- { 11267, 0x00001904 }, /* GL_GREEN */
- { 11276, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 11290, 0x00000D53 }, /* GL_GREEN_BITS */
- { 11304, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 11319, 0x00008000 }, /* GL_HINT_BIT */
- { 11331, 0x00008024 }, /* GL_HISTOGRAM */
- { 11344, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 11368, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 11396, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 11419, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 11446, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 11463, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 11483, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 11507, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 11531, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 11559, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 11587, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 11619, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 11641, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 11667, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 11685, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 11707, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 11726, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 11749, 0x0000862A }, /* GL_IDENTITY_NV */
- { 11764, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 11784, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 11824, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 11862, 0x00001E02 }, /* GL_INCR */
- { 11870, 0x00008507 }, /* GL_INCR_WRAP */
- { 11883, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 11900, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 11915, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 11945, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 11979, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 12002, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 12024, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 12044, 0x00000D51 }, /* GL_INDEX_BITS */
- { 12058, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 12079, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 12097, 0x00000C30 }, /* GL_INDEX_MODE */
- { 12111, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 12127, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 12142, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 12161, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
- { 12180, 0x00001404 }, /* GL_INT */
- { 12187, 0x00008049 }, /* GL_INTENSITY */
- { 12200, 0x0000804C }, /* GL_INTENSITY12 */
- { 12215, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 12234, 0x0000804D }, /* GL_INTENSITY16 */
- { 12249, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 12268, 0x0000804A }, /* GL_INTENSITY4 */
- { 12282, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 12300, 0x0000804B }, /* GL_INTENSITY8 */
- { 12314, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 12332, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 12349, 0x00008575 }, /* GL_INTERPOLATE */
- { 12364, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 12383, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 12402, 0x00008B53 }, /* GL_INT_VEC2 */
- { 12414, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 12430, 0x00008B54 }, /* GL_INT_VEC3 */
- { 12442, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 12458, 0x00008B55 }, /* GL_INT_VEC4 */
- { 12470, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 12486, 0x00000500 }, /* GL_INVALID_ENUM */
- { 12502, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 12539, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 12560, 0x00000501 }, /* GL_INVALID_VALUE */
- { 12577, 0x0000862B }, /* GL_INVERSE_NV */
- { 12591, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 12615, 0x0000150A }, /* GL_INVERT */
- { 12625, 0x00001E00 }, /* GL_KEEP */
- { 12633, 0x00000406 }, /* GL_LEFT */
- { 12641, 0x00000203 }, /* GL_LEQUAL */
- { 12651, 0x00000201 }, /* GL_LESS */
- { 12659, 0x00004000 }, /* GL_LIGHT0 */
- { 12669, 0x00004001 }, /* GL_LIGHT1 */
- { 12679, 0x00004002 }, /* GL_LIGHT2 */
- { 12689, 0x00004003 }, /* GL_LIGHT3 */
- { 12699, 0x00004004 }, /* GL_LIGHT4 */
- { 12709, 0x00004005 }, /* GL_LIGHT5 */
- { 12719, 0x00004006 }, /* GL_LIGHT6 */
- { 12729, 0x00004007 }, /* GL_LIGHT7 */
- { 12739, 0x00000B50 }, /* GL_LIGHTING */
- { 12751, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 12767, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 12790, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 12819, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 12852, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 12880, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 12904, 0x00001B01 }, /* GL_LINE */
- { 12912, 0x00002601 }, /* GL_LINEAR */
- { 12922, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 12944, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 12974, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 13005, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 13029, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 13054, 0x00000001 }, /* GL_LINES */
- { 13063, 0x00000004 }, /* GL_LINE_BIT */
- { 13075, 0x00000002 }, /* GL_LINE_LOOP */
- { 13088, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 13108, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 13123, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 13143, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 13159, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 13183, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 13206, 0x00000003 }, /* GL_LINE_STRIP */
- { 13220, 0x00000702 }, /* GL_LINE_TOKEN */
- { 13234, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 13248, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 13274, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 13294, 0x00008B82 }, /* GL_LINK_STATUS */
- { 13309, 0x00000B32 }, /* GL_LIST_BASE */
- { 13322, 0x00020000 }, /* GL_LIST_BIT */
- { 13334, 0x00000B33 }, /* GL_LIST_INDEX */
- { 13348, 0x00000B30 }, /* GL_LIST_MODE */
- { 13361, 0x00000101 }, /* GL_LOAD */
- { 13369, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 13381, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 13398, 0x00008CA1 }, /* GL_LOWER_LEFT */
- { 13412, 0x00001909 }, /* GL_LUMINANCE */
- { 13425, 0x00008041 }, /* GL_LUMINANCE12 */
- { 13440, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 13463, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 13490, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 13512, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 13538, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 13557, 0x00008042 }, /* GL_LUMINANCE16 */
- { 13572, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 13595, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 13622, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 13641, 0x0000803F }, /* GL_LUMINANCE4 */
- { 13655, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 13676, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 13701, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 13719, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 13740, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 13765, 0x00008040 }, /* GL_LUMINANCE8 */
- { 13779, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 13800, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 13825, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 13843, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 13862, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 13878, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 13898, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 13920, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 13934, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 13949, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 13973, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 13997, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 14021, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 14045, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 14062, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 14079, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 14107, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 14136, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 14165, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 14194, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 14223, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 14252, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 14281, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 14309, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 14337, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 14365, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 14393, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 14421, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 14449, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 14477, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 14505, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 14533, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 14549, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 14569, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 14591, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 14605, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 14620, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 14644, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 14668, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 14692, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 14716, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 14733, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 14750, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 14778, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 14807, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 14836, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 14865, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 14894, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 14923, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 14952, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 14980, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 15008, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 15036, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 15064, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 15092, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 15120, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 15148, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 15176, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 15204, 0x00000D10 }, /* GL_MAP_COLOR */
- { 15217, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 15232, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 15247, 0x00008630 }, /* GL_MATRIX0_NV */
- { 15261, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 15277, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 15293, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 15309, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 15325, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 15341, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 15357, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 15373, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 15389, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 15405, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 15421, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 15436, 0x00008631 }, /* GL_MATRIX1_NV */
- { 15450, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 15466, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 15482, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 15498, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 15514, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 15530, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 15546, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 15562, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 15578, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 15594, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 15610, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 15625, 0x00008632 }, /* GL_MATRIX2_NV */
- { 15639, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 15655, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 15671, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 15686, 0x00008633 }, /* GL_MATRIX3_NV */
- { 15700, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 15715, 0x00008634 }, /* GL_MATRIX4_NV */
- { 15729, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 15744, 0x00008635 }, /* GL_MATRIX5_NV */
- { 15758, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 15773, 0x00008636 }, /* GL_MATRIX6_NV */
- { 15787, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 15802, 0x00008637 }, /* GL_MATRIX7_NV */
- { 15816, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 15831, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 15846, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 15872, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 15906, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 15937, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 15970, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 16001, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 16016, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 16038, 0x00008008 }, /* GL_MAX */
- { 16045, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 16068, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
- { 16100, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 16126, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 16159, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 16185, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 16219, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 16238, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 16267, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 16299, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 16335, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- { 16371, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 16411, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 16437, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 16467, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 16492, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 16521, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 16550, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 16583, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
- { 16603, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 16627, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 16651, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 16675, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 16700, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 16718, 0x00008008 }, /* GL_MAX_EXT */
- { 16729, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- { 16764, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 16803, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 16817, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 16837, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 16875, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 16904, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 16928, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 16956, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 16979, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 17016, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 17052, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 17079, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 17108, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 17142, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 17178, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 17205, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 17237, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 17273, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 17302, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 17331, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 17359, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 17397, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 17441, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 17484, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 17518, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 17557, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 17594, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 17632, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 17675, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 17718, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 17748, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 17779, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 17815, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 17851, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 17881, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 17915, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 17948, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 17977, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 17997, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 18021, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
- { 18043, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 18069, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- { 18096, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 18127, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 18151, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 18185, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 18205, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 18232, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 18253, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 18278, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 18303, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 18338, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
- { 18360, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 18386, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
- { 18408, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 18434, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- { 18468, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 18506, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- { 18539, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 18576, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 18600, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 18621, 0x00008007 }, /* GL_MIN */
- { 18628, 0x0000802E }, /* GL_MINMAX */
- { 18638, 0x0000802E }, /* GL_MINMAX_EXT */
- { 18652, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 18669, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 18690, 0x00008030 }, /* GL_MINMAX_SINK */
- { 18705, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 18724, 0x00008007 }, /* GL_MIN_EXT */
- { 18735, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 18754, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 18777, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 18800, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 18820, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 18840, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 18870, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 18898, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 18926, 0x00001700 }, /* GL_MODELVIEW */
- { 18939, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 18957, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 18976, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 18995, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 19014, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 19033, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 19052, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 19071, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 19090, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 19109, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 19128, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 19147, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 19165, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 19184, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 19203, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 19222, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 19241, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 19260, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 19279, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 19298, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 19317, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 19336, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 19355, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 19373, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 19392, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 19411, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 19429, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 19447, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 19465, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 19483, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 19501, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 19519, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 19537, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 19557, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 19584, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 19609, 0x00002100 }, /* GL_MODULATE */
- { 19621, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 19641, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 19668, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 19693, 0x00000103 }, /* GL_MULT */
- { 19701, 0x0000809D }, /* GL_MULTISAMPLE */
- { 19716, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 19736, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 19755, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 19774, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 19798, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 19821, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 19851, 0x00002A25 }, /* GL_N3F_V3F */
- { 19862, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 19882, 0x0000150E }, /* GL_NAND */
- { 19890, 0x00002600 }, /* GL_NEAREST */
- { 19901, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 19932, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 19964, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 19989, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 20015, 0x00000200 }, /* GL_NEVER */
- { 20024, 0x00001102 }, /* GL_NICEST */
- { 20034, 0x00000000 }, /* GL_NONE */
- { 20042, 0x00001505 }, /* GL_NOOP */
- { 20050, 0x00001508 }, /* GL_NOR */
- { 20057, 0x00000BA1 }, /* GL_NORMALIZE */
- { 20070, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 20086, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 20117, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 20152, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 20176, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 20199, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 20220, 0x00008511 }, /* GL_NORMAL_MAP */
- { 20234, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 20252, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 20269, 0x00000205 }, /* GL_NOTEQUAL */
- { 20281, 0x00000000 }, /* GL_NO_ERROR */
- { 20293, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 20327, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
- { 20365, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 20397, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 20439, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 20469, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 20509, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 20540, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 20569, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 20597, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 20627, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 20644, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 20670, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 20686, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 20721, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 20743, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 20762, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 20792, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 20813, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 20841, 0x00000001 }, /* GL_ONE */
- { 20848, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 20876, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 20908, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 20936, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 20968, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 20991, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 21014, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 21037, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 21060, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 21078, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 21100, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 21122, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 21138, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 21158, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 21178, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 21196, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 21218, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 21240, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 21256, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 21276, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 21296, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 21314, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 21336, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 21358, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 21374, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 21394, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 21414, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 21435, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 21454, 0x00001507 }, /* GL_OR */
- { 21460, 0x00000A01 }, /* GL_ORDER */
- { 21469, 0x0000150D }, /* GL_OR_INVERTED */
- { 21484, 0x0000150B }, /* GL_OR_REVERSE */
- { 21498, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 21515, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 21533, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 21554, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 21574, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 21592, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 21611, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 21631, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 21651, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 21669, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 21688, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 21713, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 21737, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 21758, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 21780, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 21802, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 21827, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 21851, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 21872, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 21894, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 21916, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 21938, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 21969, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 21989, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 22014, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 22034, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 22059, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 22079, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 22104, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 22124, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 22149, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 22169, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 22194, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 22214, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 22239, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 22259, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 22284, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 22304, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 22329, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 22349, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 22374, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 22394, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 22419, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 22437, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 22470, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 22495, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 22530, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 22557, 0x00001B00 }, /* GL_POINT */
- { 22566, 0x00000000 }, /* GL_POINTS */
- { 22576, 0x00000002 }, /* GL_POINT_BIT */
- { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 22619, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 22653, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 22687, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 22722, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 22751, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 22784, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 22817, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 22851, 0x00000B11 }, /* GL_POINT_SIZE */
- { 22865, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 22891, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 22909, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 22931, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 22953, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 22976, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 22994, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 23016, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 23038, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 23061, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 23081, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 23097, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 23118, 0x00008861 }, /* GL_POINT_SPRITE */
- { 23134, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 23154, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 23183, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 23202, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 23228, 0x00000701 }, /* GL_POINT_TOKEN */
- { 23243, 0x00000009 }, /* GL_POLYGON */
- { 23254, 0x00000008 }, /* GL_POLYGON_BIT */
- { 23269, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 23285, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 23308, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 23333, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 23356, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 23379, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 23403, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 23427, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 23445, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 23468, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 23487, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 23510, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 23527, 0x00001203 }, /* GL_POSITION */
- { 23539, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 23571, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 23607, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 23640, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 23677, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 23708, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 23743, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 23775, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 23811, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 23844, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 23876, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 23912, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 23945, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 23982, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 24012, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 24046, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 24077, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 24112, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 24143, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 24178, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 24210, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 24246, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 24276, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 24310, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 24341, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 24376, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 24408, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 24439, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 24474, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 24506, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 24542, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 24571, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 24604, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 24634, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 24668, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 24707, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 24740, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 24780, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 24814, 0x00008578 }, /* GL_PREVIOUS */
- { 24826, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 24842, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 24858, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 24875, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 24896, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 24917, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 24950, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 24982, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 25005, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 25028, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 25058, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 25087, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 25115, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 25137, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 25165, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 25193, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 25215, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 25236, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 25276, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 25315, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 25345, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 25380, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 25413, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 25447, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 25486, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 25525, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 25547, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 25573, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 25597, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 25620, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 25642, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 25663, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 25684, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 25711, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 25743, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 25775, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 25810, 0x00001701 }, /* GL_PROJECTION */
- { 25824, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 25845, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 25871, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 25892, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 25911, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 25934, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 25973, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 26011, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 26031, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
- { 26061, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 26085, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 26105, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
- { 26135, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 26159, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 26179, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 26212, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 26238, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 26268, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 26299, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 26329, 0x00002003 }, /* GL_Q */
- { 26334, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 26359, 0x00000007 }, /* GL_QUADS */
- { 26368, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 26385, 0x00000008 }, /* GL_QUAD_STRIP */
- { 26399, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 26421, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 26447, 0x00008866 }, /* GL_QUERY_RESULT */
- { 26463, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 26483, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 26509, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 26539, 0x00002002 }, /* GL_R */
- { 26544, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 26556, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 26589, 0x00000C02 }, /* GL_READ_BUFFER */
- { 26604, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 26636, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 26660, 0x000088B8 }, /* GL_READ_ONLY */
- { 26673, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 26690, 0x000088BA }, /* GL_READ_WRITE */
- { 26704, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 26722, 0x00001903 }, /* GL_RED */
- { 26729, 0x00008016 }, /* GL_REDUCE */
- { 26739, 0x00008016 }, /* GL_REDUCE_EXT */
- { 26753, 0x00000D15 }, /* GL_RED_BIAS */
- { 26765, 0x00000D52 }, /* GL_RED_BITS */
- { 26777, 0x00000D14 }, /* GL_RED_SCALE */
- { 26790, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 26808, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 26830, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 26851, 0x00001C00 }, /* GL_RENDER */
- { 26861, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 26889, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 26909, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 26936, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 26972, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 26998, 0x00001F01 }, /* GL_RENDERER */
- { 27010, 0x00000C40 }, /* GL_RENDER_MODE */
- { 27025, 0x00002901 }, /* GL_REPEAT */
- { 27035, 0x00001E01 }, /* GL_REPLACE */
- { 27046, 0x00008062 }, /* GL_REPLACE_EXT */
- { 27061, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 27084, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 27102, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 27124, 0x00000102 }, /* GL_RETURN */
- { 27134, 0x00001907 }, /* GL_RGB */
- { 27141, 0x00008052 }, /* GL_RGB10 */
- { 27150, 0x00008059 }, /* GL_RGB10_A2 */
- { 27162, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 27178, 0x00008052 }, /* GL_RGB10_EXT */
- { 27191, 0x00008053 }, /* GL_RGB12 */
- { 27200, 0x00008053 }, /* GL_RGB12_EXT */
- { 27213, 0x00008054 }, /* GL_RGB16 */
- { 27222, 0x00008054 }, /* GL_RGB16_EXT */
- { 27235, 0x0000804E }, /* GL_RGB2_EXT */
- { 27247, 0x0000804F }, /* GL_RGB4 */
- { 27255, 0x0000804F }, /* GL_RGB4_EXT */
- { 27267, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 27280, 0x00008050 }, /* GL_RGB5 */
- { 27288, 0x00008057 }, /* GL_RGB5_A1 */
- { 27299, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 27314, 0x00008050 }, /* GL_RGB5_EXT */
- { 27326, 0x00008051 }, /* GL_RGB8 */
- { 27334, 0x00008051 }, /* GL_RGB8_EXT */
- { 27346, 0x00001908 }, /* GL_RGBA */
- { 27354, 0x0000805A }, /* GL_RGBA12 */
- { 27364, 0x0000805A }, /* GL_RGBA12_EXT */
- { 27378, 0x0000805B }, /* GL_RGBA16 */
- { 27388, 0x0000805B }, /* GL_RGBA16_EXT */
- { 27402, 0x00008055 }, /* GL_RGBA2 */
- { 27411, 0x00008055 }, /* GL_RGBA2_EXT */
- { 27424, 0x00008056 }, /* GL_RGBA4 */
- { 27433, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 27452, 0x00008056 }, /* GL_RGBA4_EXT */
- { 27465, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 27479, 0x00008058 }, /* GL_RGBA8 */
- { 27488, 0x00008058 }, /* GL_RGBA8_EXT */
- { 27501, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 27519, 0x00000C31 }, /* GL_RGBA_MODE */
- { 27532, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 27545, 0x000083A0 }, /* GL_RGB_S3TC */
- { 27557, 0x00008573 }, /* GL_RGB_SCALE */
- { 27570, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 27587, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 27604, 0x00000407 }, /* GL_RIGHT */
- { 27613, 0x00002000 }, /* GL_S */
- { 27618, 0x00008B5D }, /* GL_SAMPLER_1D */
- { 27632, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
- { 27653, 0x00008B5E }, /* GL_SAMPLER_2D */
- { 27667, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
- { 27688, 0x00008B5F }, /* GL_SAMPLER_3D */
- { 27702, 0x00008B60 }, /* GL_SAMPLER_CUBE */
- { 27718, 0x000080A9 }, /* GL_SAMPLES */
- { 27729, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 27745, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 27760, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 27778, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 27800, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 27828, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 27860, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 27883, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 27910, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 27928, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 27951, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 27973, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 27992, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 28015, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 28041, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 28071, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 28096, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 28125, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 28140, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 28155, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 28171, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 28196, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 28236, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 28280, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 28313, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 28343, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 28375, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 28405, 0x00001C02 }, /* GL_SELECT */
- { 28415, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 28443, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 28468, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 28484, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 28511, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 28542, 0x0000150F }, /* GL_SET */
- { 28549, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 28570, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
- { 28594, 0x00008B4F }, /* GL_SHADER_TYPE */
- { 28609, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 28624, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
- { 28652, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 28675, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 28705, 0x00001601 }, /* GL_SHININESS */
- { 28718, 0x00001402 }, /* GL_SHORT */
- { 28727, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 28743, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 28763, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 28782, 0x00001D01 }, /* GL_SMOOTH */
- { 28792, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 28825, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 28852, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 28885, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 28912, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 28929, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 28950, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 28971, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 28986, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 29005, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 29024, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 29041, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 29062, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 29083, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 29098, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 29117, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 29136, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 29153, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 29174, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 29195, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 29210, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 29229, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 29248, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 29268, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 29286, 0x00001202 }, /* GL_SPECULAR */
- { 29298, 0x00002402 }, /* GL_SPHERE_MAP */
- { 29312, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 29327, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 29345, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 29362, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 29376, 0x00008580 }, /* GL_SRC0_RGB */
- { 29388, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 29402, 0x00008581 }, /* GL_SRC1_RGB */
- { 29414, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 29428, 0x00008582 }, /* GL_SRC2_RGB */
- { 29440, 0x00000302 }, /* GL_SRC_ALPHA */
- { 29453, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 29475, 0x00000300 }, /* GL_SRC_COLOR */
- { 29488, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 29506, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 29525, 0x000088E6 }, /* GL_STATIC_COPY */
- { 29540, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 29559, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 29574, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 29593, 0x000088E5 }, /* GL_STATIC_READ */
- { 29608, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 29627, 0x00001802 }, /* GL_STENCIL */
- { 29638, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 29664, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
- { 29685, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
- { 29710, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
- { 29731, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
- { 29756, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- { 29788, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
- { 29824, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- { 29856, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
- { 29892, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
- { 29912, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
- { 29939, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
- { 29965, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 29981, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 30003, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 30026, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 30042, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 30058, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 30075, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 30098, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 30120, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 30142, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 30164, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 30185, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 30212, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 30239, 0x00000B97 }, /* GL_STENCIL_REF */
- { 30254, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 30270, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 30299, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 30321, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 30342, 0x00000C33 }, /* GL_STEREO */
- { 30352, 0x000088E2 }, /* GL_STREAM_COPY */
- { 30367, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 30386, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 30401, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 30420, 0x000088E1 }, /* GL_STREAM_READ */
- { 30435, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 30454, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 30471, 0x000084E7 }, /* GL_SUBTRACT */
- { 30483, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 30499, 0x00002001 }, /* GL_T */
- { 30504, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 30519, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 30538, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 30554, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 30569, 0x00002A27 }, /* GL_T2F_V3F */
- { 30580, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 30599, 0x00002A28 }, /* GL_T4F_V4F */
- { 30610, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 30633, 0x00001702 }, /* GL_TEXTURE */
- { 30644, 0x000084C0 }, /* GL_TEXTURE0 */
- { 30656, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 30672, 0x000084C1 }, /* GL_TEXTURE1 */
- { 30684, 0x000084CA }, /* GL_TEXTURE10 */
- { 30697, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 30714, 0x000084CB }, /* GL_TEXTURE11 */
- { 30727, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 30744, 0x000084CC }, /* GL_TEXTURE12 */
- { 30757, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 30774, 0x000084CD }, /* GL_TEXTURE13 */
- { 30787, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 30804, 0x000084CE }, /* GL_TEXTURE14 */
- { 30817, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 30834, 0x000084CF }, /* GL_TEXTURE15 */
- { 30847, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 30864, 0x000084D0 }, /* GL_TEXTURE16 */
- { 30877, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 30894, 0x000084D1 }, /* GL_TEXTURE17 */
- { 30907, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 30924, 0x000084D2 }, /* GL_TEXTURE18 */
- { 30937, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 30954, 0x000084D3 }, /* GL_TEXTURE19 */
- { 30967, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 30984, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 31000, 0x000084C2 }, /* GL_TEXTURE2 */
- { 31012, 0x000084D4 }, /* GL_TEXTURE20 */
- { 31025, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 31042, 0x000084D5 }, /* GL_TEXTURE21 */
- { 31055, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 31072, 0x000084D6 }, /* GL_TEXTURE22 */
- { 31085, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 31102, 0x000084D7 }, /* GL_TEXTURE23 */
- { 31115, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 31132, 0x000084D8 }, /* GL_TEXTURE24 */
- { 31145, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 31162, 0x000084D9 }, /* GL_TEXTURE25 */
- { 31175, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 31192, 0x000084DA }, /* GL_TEXTURE26 */
- { 31205, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 31222, 0x000084DB }, /* GL_TEXTURE27 */
- { 31235, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 31252, 0x000084DC }, /* GL_TEXTURE28 */
- { 31265, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 31282, 0x000084DD }, /* GL_TEXTURE29 */
- { 31295, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 31312, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 31328, 0x000084C3 }, /* GL_TEXTURE3 */
- { 31340, 0x000084DE }, /* GL_TEXTURE30 */
- { 31353, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 31370, 0x000084DF }, /* GL_TEXTURE31 */
- { 31383, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 31400, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 31416, 0x000084C4 }, /* GL_TEXTURE4 */
- { 31428, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 31444, 0x000084C5 }, /* GL_TEXTURE5 */
- { 31456, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 31472, 0x000084C6 }, /* GL_TEXTURE6 */
- { 31484, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 31500, 0x000084C7 }, /* GL_TEXTURE7 */
- { 31512, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 31528, 0x000084C8 }, /* GL_TEXTURE8 */
- { 31540, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 31556, 0x000084C9 }, /* GL_TEXTURE9 */
- { 31568, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 31584, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 31598, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
- { 31622, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 31636, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
- { 31660, 0x0000806F }, /* GL_TEXTURE_3D */
- { 31674, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 31696, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 31722, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 31744, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 31766, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
- { 31798, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 31820, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
- { 31852, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 31874, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 31902, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 31934, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 31967, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 31999, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 32014, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 32035, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 32060, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 32078, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 32102, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 32133, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 32163, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 32193, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 32228, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 32259, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 32297, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 32324, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 32356, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 32390, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 32414, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 32442, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 32466, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 32494, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 32527, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 32551, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 32573, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 32595, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 32621, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 32655, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 32688, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 32725, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 32753, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 32785, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 32808, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 32846, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 32888, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 32919, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 32947, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 32977, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 33005, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 33025, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 33049, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 33080, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 33115, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 33146, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 33181, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 33212, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 33247, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 33278, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 33313, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 33344, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 33379, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 33410, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 33445, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 33462, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 33484, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 33510, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 33525, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 33546, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 33566, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 33592, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 33612, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 33629, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 33646, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 33663, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 33680, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 33705, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 33727, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 33753, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 33771, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 33797, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 33823, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 33853, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 33880, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 33905, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 33925, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 33949, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 33976, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 34003, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 34030, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 34056, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 34086, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 34108, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 34126, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 34156, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 34184, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 34212, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 34240, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 34261, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 34280, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 34302, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 34321, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 34341, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 34366, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 34390, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 34410, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 34434, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 34454, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 34477, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 34502, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 34536, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 34553, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 34571, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 34589, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 34607, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 34627, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 34646, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 34675, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 34692, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 34718, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 34748, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 34780, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 34810, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 34844, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 34860, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 34891, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 34926, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 34954, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 34986, 0x00000004 }, /* GL_TRIANGLES */
- { 34999, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 35015, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 35036, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 35054, 0x00000001 }, /* GL_TRUE */
- { 35062, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 35082, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 35105, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 35125, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 35146, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 35168, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 35190, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 35210, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 35231, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 35248, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 35275, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 35298, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 35314, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 35341, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 35365, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 35396, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 35420, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 35448, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 35466, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 35496, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 35522, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 35552, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 35578, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 35602, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 35630, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 35658, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 35685, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 35717, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 35748, 0x00008CA2 }, /* GL_UPPER_LEFT */
- { 35762, 0x00002A20 }, /* GL_V2F */
- { 35769, 0x00002A21 }, /* GL_V3F */
- { 35776, 0x00008B83 }, /* GL_VALIDATE_STATUS */
- { 35795, 0x00001F00 }, /* GL_VENDOR */
- { 35805, 0x00001F02 }, /* GL_VERSION */
- { 35816, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 35832, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 35862, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 35893, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 35928, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 35952, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 35973, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 35996, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 36017, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 36044, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 36072, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 36100, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 36128, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 36156, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 36184, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 36212, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 36239, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 36266, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 36293, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 36320, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 36347, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 36374, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 36401, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 36428, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 36455, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 36493, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 36535, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- { 36566, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 36601, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- { 36635, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 36673, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- { 36704, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 36739, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- { 36767, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 36799, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- { 36829, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 36863, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- { 36891, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 36923, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 36943, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 36965, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 36994, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 37015, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- { 37044, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 37077, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 37109, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- { 37136, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 37167, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 37197, 0x00008B31 }, /* GL_VERTEX_SHADER */
- { 37214, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 37235, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 37262, 0x00000BA2 }, /* GL_VIEWPORT */
- { 37274, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 37290, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 37310, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 37341, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 37376, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 37404, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 37429, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 37456, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 37481, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 37505, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 37524, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 37538, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 37556, 0x00001506 }, /* GL_XOR */
- { 37563, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 37582, 0x00008757 }, /* GL_YCBCR_MESA */
- { 37596, 0x00000000 }, /* GL_ZERO */
- { 37604, 0x00000D16 }, /* GL_ZOOM_X */
- { 37614, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */
+ { 2497, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
+ { 2522, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */
+ { 2543, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */
+ { 2565, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
+ { 2591, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */
+ { 2613, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
+ { 2639, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */
+ { 2661, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
+ { 2687, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */
+ { 2709, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
+ { 2735, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */
+ { 2757, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
+ { 2783, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */
+ { 2805, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
+ { 2831, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
+ { 2856, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */
+ { 2877, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
+ { 2902, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */
+ { 2923, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
+ { 2948, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */
+ { 2969, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
+ { 2994, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */
+ { 3015, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
+ { 3040, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */
+ { 3061, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
+ { 3086, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */
+ { 3107, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
+ { 3132, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */
+ { 3153, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
+ { 3178, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */
+ { 3199, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
+ { 3224, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
+ { 3244, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
+ { 3265, 0x00001900 }, /* GL_COLOR_INDEX */
+ { 3280, 0x00001603 }, /* GL_COLOR_INDEXES */
+ { 3297, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
+ { 3315, 0x00000B57 }, /* GL_COLOR_MATERIAL */
+ { 3333, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
+ { 3356, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
+ { 3384, 0x000080B1 }, /* GL_COLOR_MATRIX */
+ { 3400, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
+ { 3420, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ { 3448, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 3480, 0x00008458 }, /* GL_COLOR_SUM */
+ { 3493, 0x00008458 }, /* GL_COLOR_SUM_ARB */
+ { 3510, 0x000080D0 }, /* GL_COLOR_TABLE */
+ { 3525, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ { 3551, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
+ { 3581, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
+ { 3611, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
+ { 3631, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
+ { 3655, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
+ { 3680, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
+ { 3709, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
+ { 3738, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
+ { 3760, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
+ { 3786, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
+ { 3812, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
+ { 3838, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
+ { 3868, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
+ { 3898, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ { 3928, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
+ { 3962, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
+ { 3996, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ { 4026, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
+ { 4060, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
+ { 4094, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
+ { 4118, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
+ { 4146, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
+ { 4174, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
+ { 4195, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
+ { 4220, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
+ { 4241, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
+ { 4266, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
+ { 4291, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
+ { 4310, 0x00008570 }, /* GL_COMBINE */
+ { 4321, 0x00008503 }, /* GL_COMBINE4 */
+ { 4333, 0x00008572 }, /* GL_COMBINE_ALPHA */
+ { 4350, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
+ { 4371, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
+ { 4392, 0x00008570 }, /* GL_COMBINE_ARB */
+ { 4407, 0x00008570 }, /* GL_COMBINE_EXT */
+ { 4422, 0x00008571 }, /* GL_COMBINE_RGB */
+ { 4437, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
+ { 4456, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
+ { 4475, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */
+ { 4511, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
+ { 4535, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
+ { 4563, 0x00001300 }, /* GL_COMPILE */
+ { 4574, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
+ { 4597, 0x00008B81 }, /* GL_COMPILE_STATUS */
+ { 4615, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
+ { 4635, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
+ { 4659, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
+ { 4683, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
+ { 4711, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
+ { 4735, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ { 4765, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
+ { 4799, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
+ { 4827, 0x000084ED }, /* GL_COMPRESSED_RGB */
+ { 4845, 0x000084EE }, /* GL_COMPRESSED_RGBA */
+ { 4864, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
+ { 4887, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ { 4916, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ { 4949, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ { 4982, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ { 5015, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
+ { 5037, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ { 5065, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ { 5097, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ { 5127, 0x00008576 }, /* GL_CONSTANT */
+ { 5139, 0x00008003 }, /* GL_CONSTANT_ALPHA */
+ { 5157, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
+ { 5179, 0x00008576 }, /* GL_CONSTANT_ARB */
+ { 5195, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
+ { 5219, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
+ { 5241, 0x00008001 }, /* GL_CONSTANT_COLOR */
+ { 5259, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
+ { 5281, 0x00008576 }, /* GL_CONSTANT_EXT */
+ { 5297, 0x00008010 }, /* GL_CONVOLUTION_1D */
+ { 5315, 0x00008011 }, /* GL_CONVOLUTION_2D */
+ { 5333, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
+ { 5361, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
+ { 5392, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
+ { 5419, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
+ { 5450, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
+ { 5477, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
+ { 5508, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
+ { 5536, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
+ { 5568, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
+ { 5590, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
+ { 5616, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
+ { 5638, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
+ { 5664, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
+ { 5685, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
+ { 5710, 0x00008862 }, /* GL_COORD_REPLACE */
+ { 5727, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
+ { 5748, 0x00008862 }, /* GL_COORD_REPLACE_NV */
+ { 5768, 0x00001503 }, /* GL_COPY */
+ { 5776, 0x0000150C }, /* GL_COPY_INVERTED */
+ { 5793, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
+ { 5813, 0x00000B44 }, /* GL_CULL_FACE */
+ { 5826, 0x00000B45 }, /* GL_CULL_FACE_MODE */
+ { 5844, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
+ { 5863, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ { 5895, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ { 5930, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
+ { 5951, 0x00000001 }, /* GL_CURRENT_BIT */
+ { 5966, 0x00000B00 }, /* GL_CURRENT_COLOR */
+ { 5983, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
+ { 6004, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
+ { 6030, 0x00000B01 }, /* GL_CURRENT_INDEX */
+ { 6047, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
+ { 6069, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ { 6097, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
+ { 6118, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ { 6152, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
+ { 6185, 0x00000B02 }, /* GL_CURRENT_NORMAL */
+ { 6203, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ { 6233, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
+ { 6252, 0x00008865 }, /* GL_CURRENT_QUERY */
+ { 6269, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
+ { 6290, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
+ { 6314, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
+ { 6341, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
+ { 6365, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
+ { 6392, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
+ { 6425, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ { 6458, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
+ { 6485, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
+ { 6511, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
+ { 6536, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
+ { 6565, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
+ { 6587, 0x00000900 }, /* GL_CW */
+ { 6593, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
+ { 6614, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
+ { 6635, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
+ { 6655, 0x00002101 }, /* GL_DECAL */
+ { 6664, 0x00001E03 }, /* GL_DECR */
+ { 6672, 0x00008508 }, /* GL_DECR_WRAP */
+ { 6685, 0x00008508 }, /* GL_DECR_WRAP_EXT */
+ { 6702, 0x00008B80 }, /* GL_DELETE_STATUS */
+ { 6719, 0x00001801 }, /* GL_DEPTH */
+ { 6728, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */
+ { 6748, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */
+ { 6768, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
+ { 6792, 0x00000D1F }, /* GL_DEPTH_BIAS */
+ { 6806, 0x00000D56 }, /* GL_DEPTH_BITS */
+ { 6820, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
+ { 6840, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ { 6865, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
+ { 6885, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
+ { 6903, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
+ { 6924, 0x00001902 }, /* GL_DEPTH_COMPONENT */
+ { 6943, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
+ { 6964, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
+ { 6989, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
+ { 7015, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
+ { 7036, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
+ { 7061, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
+ { 7087, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
+ { 7108, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
+ { 7133, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
+ { 7159, 0x00000B74 }, /* GL_DEPTH_FUNC */
+ { 7173, 0x00000B70 }, /* GL_DEPTH_RANGE */
+ { 7188, 0x00000D1E }, /* GL_DEPTH_SCALE */
+ { 7203, 0x000084F9 }, /* GL_DEPTH_STENCIL */
+ { 7220, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */
+ { 7248, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
+ { 7268, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ { 7296, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ { 7324, 0x00000B71 }, /* GL_DEPTH_TEST */
+ { 7338, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
+ { 7360, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
+ { 7386, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
+ { 7405, 0x00001201 }, /* GL_DIFFUSE */
+ { 7416, 0x00000BD0 }, /* GL_DITHER */
+ { 7426, 0x00000A02 }, /* GL_DOMAIN */
+ { 7436, 0x00001100 }, /* GL_DONT_CARE */
+ { 7449, 0x000086AE }, /* GL_DOT3_RGB */
+ { 7461, 0x000086AF }, /* GL_DOT3_RGBA */
+ { 7474, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
+ { 7491, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
+ { 7508, 0x000086AE }, /* GL_DOT3_RGB_ARB */
+ { 7524, 0x00008740 }, /* GL_DOT3_RGB_EXT */
+ { 7540, 0x0000140A }, /* GL_DOUBLE */
+ { 7550, 0x00000C32 }, /* GL_DOUBLEBUFFER */
+ { 7566, 0x00000C01 }, /* GL_DRAW_BUFFER */
+ { 7581, 0x00008825 }, /* GL_DRAW_BUFFER0 */
+ { 7597, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
+ { 7617, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
+ { 7637, 0x00008826 }, /* GL_DRAW_BUFFER1 */
+ { 7653, 0x0000882F }, /* GL_DRAW_BUFFER10 */
+ { 7670, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
+ { 7691, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
+ { 7712, 0x00008830 }, /* GL_DRAW_BUFFER11 */
+ { 7729, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
+ { 7750, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
+ { 7771, 0x00008831 }, /* GL_DRAW_BUFFER12 */
+ { 7788, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
+ { 7809, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
+ { 7830, 0x00008832 }, /* GL_DRAW_BUFFER13 */
+ { 7847, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
+ { 7868, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
+ { 7889, 0x00008833 }, /* GL_DRAW_BUFFER14 */
+ { 7906, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
+ { 7927, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
+ { 7948, 0x00008834 }, /* GL_DRAW_BUFFER15 */
+ { 7965, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
+ { 7986, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
+ { 8007, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
+ { 8027, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
+ { 8047, 0x00008827 }, /* GL_DRAW_BUFFER2 */
+ { 8063, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
+ { 8083, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
+ { 8103, 0x00008828 }, /* GL_DRAW_BUFFER3 */
+ { 8119, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
+ { 8139, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
+ { 8159, 0x00008829 }, /* GL_DRAW_BUFFER4 */
+ { 8175, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
+ { 8195, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
+ { 8215, 0x0000882A }, /* GL_DRAW_BUFFER5 */
+ { 8231, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
+ { 8251, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
+ { 8271, 0x0000882B }, /* GL_DRAW_BUFFER6 */
+ { 8287, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
+ { 8307, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
+ { 8327, 0x0000882C }, /* GL_DRAW_BUFFER7 */
+ { 8343, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
+ { 8363, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
+ { 8383, 0x0000882D }, /* GL_DRAW_BUFFER8 */
+ { 8399, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
+ { 8419, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
+ { 8439, 0x0000882E }, /* GL_DRAW_BUFFER9 */
+ { 8455, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
+ { 8475, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
+ { 8495, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */
+ { 8515, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 8547, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
+ { 8571, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
+ { 8591, 0x00000304 }, /* GL_DST_ALPHA */
+ { 8604, 0x00000306 }, /* GL_DST_COLOR */
+ { 8617, 0x000088EA }, /* GL_DYNAMIC_COPY */
+ { 8633, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
+ { 8653, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
+ { 8669, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
+ { 8689, 0x000088E9 }, /* GL_DYNAMIC_READ */
+ { 8705, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
+ { 8725, 0x00000B43 }, /* GL_EDGE_FLAG */
+ { 8738, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
+ { 8757, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ { 8791, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
+ { 8829, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ { 8856, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ { 8882, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
+ { 8906, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ { 8938, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
+ { 8974, 0x00001600 }, /* GL_EMISSION */
+ { 8986, 0x00002000 }, /* GL_ENABLE_BIT */
+ { 9000, 0x00000202 }, /* GL_EQUAL */
+ { 9009, 0x00001509 }, /* GL_EQUIV */
+ { 9018, 0x00010000 }, /* GL_EVAL_BIT */
+ { 9030, 0x00000800 }, /* GL_EXP */
+ { 9037, 0x00000801 }, /* GL_EXP2 */
+ { 9045, 0x00001F03 }, /* GL_EXTENSIONS */
+ { 9059, 0x00002400 }, /* GL_EYE_LINEAR */
+ { 9073, 0x00002502 }, /* GL_EYE_PLANE */
+ { 9086, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ { 9111, 0x0000855B }, /* GL_EYE_RADIAL_NV */
+ { 9128, 0x00000000 }, /* GL_FALSE */
+ { 9137, 0x00001101 }, /* GL_FASTEST */
+ { 9148, 0x00001C01 }, /* GL_FEEDBACK */
+ { 9160, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
+ { 9187, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
+ { 9211, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
+ { 9235, 0x00001B02 }, /* GL_FILL */
+ { 9243, 0x00001D00 }, /* GL_FLAT */
+ { 9251, 0x00001406 }, /* GL_FLOAT */
+ { 9260, 0x00008B5A }, /* GL_FLOAT_MAT2 */
+ { 9274, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
+ { 9292, 0x00008B5B }, /* GL_FLOAT_MAT3 */
+ { 9306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
+ { 9324, 0x00008B5C }, /* GL_FLOAT_MAT4 */
+ { 9338, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
+ { 9356, 0x00008B50 }, /* GL_FLOAT_VEC2 */
+ { 9370, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
+ { 9388, 0x00008B51 }, /* GL_FLOAT_VEC3 */
+ { 9402, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
+ { 9420, 0x00008B52 }, /* GL_FLOAT_VEC4 */
+ { 9434, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
+ { 9452, 0x00000B60 }, /* GL_FOG */
+ { 9459, 0x00000080 }, /* GL_FOG_BIT */
+ { 9470, 0x00000B66 }, /* GL_FOG_COLOR */
+ { 9483, 0x00008451 }, /* GL_FOG_COORD */
+ { 9496, 0x00008451 }, /* GL_FOG_COORDINATE */
+ { 9514, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
+ { 9538, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ { 9577, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
+ { 9620, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ { 9652, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ { 9683, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ { 9712, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
+ { 9737, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
+ { 9756, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
+ { 9790, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
+ { 9817, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
+ { 9843, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
+ { 9867, 0x00008450 }, /* GL_FOG_COORD_SRC */
+ { 9884, 0x00000B62 }, /* GL_FOG_DENSITY */
+ { 9899, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
+ { 9923, 0x00000B64 }, /* GL_FOG_END */
+ { 9934, 0x00000C54 }, /* GL_FOG_HINT */
+ { 9946, 0x00000B61 }, /* GL_FOG_INDEX */
+ { 9959, 0x00000B65 }, /* GL_FOG_MODE */
+ { 9971, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
+ { 9990, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
+ { 10015, 0x00000B63 }, /* GL_FOG_START */
+ { 10028, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
+ { 10046, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
+ { 10070, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
+ { 10089, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
+ { 10112, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ { 10147, 0x00008D40 }, /* GL_FRAMEBUFFER */
+ { 10162, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ { 10199, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ { 10235, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ { 10276, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ { 10317, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ { 10354, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ { 10391, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ { 10429, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ { 10471, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ { 10509, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ { 10551, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ { 10586, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ { 10625, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ { 10674, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ { 10722, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ { 10774, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ { 10814, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+ { 10858, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ { 10898, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ { 10942, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
+ { 10969, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */
+ { 10993, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ { 11021, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */
+ { 11044, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
+ { 11063, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ { 11100, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ { 11141, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ { 11182, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ { 11224, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ { 11275, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ { 11313, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ { 11358, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ { 11407, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ { 11445, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ { 11487, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ { 11519, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */
+ { 11544, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ { 11571, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ { 11602, 0x00000404 }, /* GL_FRONT */
+ { 11611, 0x00000408 }, /* GL_FRONT_AND_BACK */
+ { 11629, 0x00000B46 }, /* GL_FRONT_FACE */
+ { 11643, 0x00000400 }, /* GL_FRONT_LEFT */
+ { 11657, 0x00000401 }, /* GL_FRONT_RIGHT */
+ { 11672, 0x00008006 }, /* GL_FUNC_ADD */
+ { 11684, 0x00008006 }, /* GL_FUNC_ADD_EXT */
+ { 11700, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
+ { 11725, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
+ { 11754, 0x0000800A }, /* GL_FUNC_SUBTRACT */
+ { 11771, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
+ { 11792, 0x00008191 }, /* GL_GENERATE_MIPMAP */
+ { 11811, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
+ { 11835, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
+ { 11864, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
+ { 11888, 0x00000206 }, /* GL_GEQUAL */
+ { 11898, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */
+ { 11923, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */
+ { 11951, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ { 11985, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */
+ { 12007, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ { 12035, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ { 12072, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */
+ { 12091, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */
+ { 12110, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */
+ { 12129, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */
+ { 12148, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */
+ { 12167, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */
+ { 12186, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */
+ { 12210, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ { 12242, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ { 12268, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 12302, 0x00008C46 }, /* GL_GL_SLUMINANCE */
+ { 12319, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */
+ { 12337, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ { 12362, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */
+ { 12385, 0x00008C40 }, /* GL_GL_SRGB */
+ { 12396, 0x00008C41 }, /* GL_GL_SRGB8 */
+ { 12408, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */
+ { 12427, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */
+ { 12444, 0x00000204 }, /* GL_GREATER */
+ { 12455, 0x00001904 }, /* GL_GREEN */
+ { 12464, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 12478, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 12492, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 12507, 0x00008000 }, /* GL_HINT_BIT */
+ { 12519, 0x00008024 }, /* GL_HISTOGRAM */
+ { 12532, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 12556, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 12584, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 12607, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 12634, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 12651, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 12671, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 12695, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 12719, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 12747, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 12775, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 12807, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 12829, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 12855, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 12873, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 12895, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 12914, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 12937, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 12952, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 12972, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 13012, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 13050, 0x00001E02 }, /* GL_INCR */
+ { 13058, 0x00008507 }, /* GL_INCR_WRAP */
+ { 13071, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 13088, 0x00008222 }, /* GL_INDEX */
+ { 13097, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 13112, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 13142, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 13176, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 13199, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 13221, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 13241, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 13255, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 13276, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 13294, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 13308, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 13324, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 13339, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 13358, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
+ { 13377, 0x00001404 }, /* GL_INT */
+ { 13384, 0x00008049 }, /* GL_INTENSITY */
+ { 13397, 0x0000804C }, /* GL_INTENSITY12 */
+ { 13412, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 13431, 0x0000804D }, /* GL_INTENSITY16 */
+ { 13446, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 13465, 0x0000804A }, /* GL_INTENSITY4 */
+ { 13479, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 13497, 0x0000804B }, /* GL_INTENSITY8 */
+ { 13511, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 13529, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 13546, 0x00008575 }, /* GL_INTERPOLATE */
+ { 13561, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 13580, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 13599, 0x00008B53 }, /* GL_INT_VEC2 */
+ { 13611, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 13627, 0x00008B54 }, /* GL_INT_VEC3 */
+ { 13639, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 13655, 0x00008B55 }, /* GL_INT_VEC4 */
+ { 13667, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 13683, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 13699, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */
+ { 13732, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 13769, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 13790, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 13807, 0x0000862B }, /* GL_INVERSE_NV */
+ { 13821, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 13845, 0x0000150A }, /* GL_INVERT */
+ { 13855, 0x00001E00 }, /* GL_KEEP */
+ { 13863, 0x00000406 }, /* GL_LEFT */
+ { 13871, 0x00000203 }, /* GL_LEQUAL */
+ { 13881, 0x00000201 }, /* GL_LESS */
+ { 13889, 0x00004000 }, /* GL_LIGHT0 */
+ { 13899, 0x00004001 }, /* GL_LIGHT1 */
+ { 13909, 0x00004002 }, /* GL_LIGHT2 */
+ { 13919, 0x00004003 }, /* GL_LIGHT3 */
+ { 13929, 0x00004004 }, /* GL_LIGHT4 */
+ { 13939, 0x00004005 }, /* GL_LIGHT5 */
+ { 13949, 0x00004006 }, /* GL_LIGHT6 */
+ { 13959, 0x00004007 }, /* GL_LIGHT7 */
+ { 13969, 0x00000B50 }, /* GL_LIGHTING */
+ { 13981, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 13997, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 14020, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 14049, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 14082, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 14110, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 14134, 0x00001B01 }, /* GL_LINE */
+ { 14142, 0x00002601 }, /* GL_LINEAR */
+ { 14152, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 14174, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 14204, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 14235, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 14259, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 14284, 0x00000001 }, /* GL_LINES */
+ { 14293, 0x00000004 }, /* GL_LINE_BIT */
+ { 14305, 0x00000002 }, /* GL_LINE_LOOP */
+ { 14318, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 14338, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 14353, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 14373, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 14389, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 14413, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 14436, 0x00000003 }, /* GL_LINE_STRIP */
+ { 14450, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 14464, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 14478, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 14504, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 14524, 0x00008B82 }, /* GL_LINK_STATUS */
+ { 14539, 0x00000B32 }, /* GL_LIST_BASE */
+ { 14552, 0x00020000 }, /* GL_LIST_BIT */
+ { 14564, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 14578, 0x00000B30 }, /* GL_LIST_MODE */
+ { 14591, 0x00000101 }, /* GL_LOAD */
+ { 14599, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 14611, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 14628, 0x00008CA1 }, /* GL_LOWER_LEFT */
+ { 14642, 0x00001909 }, /* GL_LUMINANCE */
+ { 14655, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 14670, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 14693, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 14720, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 14742, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 14768, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 14787, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 14802, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 14825, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 14852, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 14871, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 14885, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 14906, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 14931, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 14949, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 14970, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 14995, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 15009, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 15030, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 15055, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 15073, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 15092, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 15108, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 15128, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 15150, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 15164, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 15179, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 15203, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 15227, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 15251, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 15275, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 15292, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 15309, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 15337, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 15366, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 15395, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 15424, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 15453, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 15482, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 15511, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 15539, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 15567, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 15595, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 15623, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 15651, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 15679, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 15707, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 15735, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 15763, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 15779, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 15799, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 15821, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 15835, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 15850, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 15874, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 15898, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 15922, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 15946, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 15963, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 15980, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 16008, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 16037, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 16066, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 16095, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 16124, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 16153, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 16182, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 16210, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 16238, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 16266, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 16294, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 16322, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 16350, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 16378, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 16406, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 16434, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 16447, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 16462, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 16477, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 16491, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 16507, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 16523, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 16539, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 16555, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 16571, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 16587, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 16603, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 16619, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 16635, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 16651, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 16666, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 16680, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 16696, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 16712, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 16728, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 16744, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 16760, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 16776, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 16792, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 16808, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 16824, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 16840, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 16855, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 16869, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 16885, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 16901, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 16916, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 16930, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 16945, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 16959, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 16974, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 16988, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 17003, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 17017, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 17032, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 17046, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 17061, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 17076, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 17102, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 17136, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 17167, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 17200, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 17231, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 17246, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 17268, 0x00008008 }, /* GL_MAX */
+ { 17275, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 17298, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
+ { 17330, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 17356, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 17389, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 17415, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 17449, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 17468, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 17497, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 17529, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 17565, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ { 17601, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 17641, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 17667, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 17697, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 17722, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 17751, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 17780, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 17813, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
+ { 17833, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 17857, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 17881, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 17905, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 17930, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 17948, 0x00008008 }, /* GL_MAX_EXT */
+ { 17959, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ { 17994, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 18033, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 18047, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 18067, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 18105, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 18134, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 18158, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 18186, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 18209, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 18246, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 18282, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 18309, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 18338, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 18372, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 18408, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 18435, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 18467, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 18503, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 18532, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 18561, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 18589, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 18627, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 18671, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 18714, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 18748, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 18787, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 18824, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 18862, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 18905, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 18948, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 18978, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 19009, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 19045, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 19081, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 19111, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 19145, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 19178, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 19207, 0x00008D57 }, /* GL_MAX_SAMPLES */
+ { 19222, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 19242, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 19266, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
+ { 19288, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 19314, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ { 19341, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 19372, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 19396, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 19430, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 19450, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 19477, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 19498, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 19523, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 19548, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 19583, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
+ { 19605, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 19631, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
+ { 19653, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 19679, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ { 19713, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 19751, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ { 19784, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 19821, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 19845, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 19866, 0x00008007 }, /* GL_MIN */
+ { 19873, 0x0000802E }, /* GL_MINMAX */
+ { 19883, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 19897, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 19914, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 19935, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 19950, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 19969, 0x00008007 }, /* GL_MIN_EXT */
+ { 19980, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 19999, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 20022, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 20045, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 20065, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 20085, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 20115, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 20143, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 20171, 0x00001700 }, /* GL_MODELVIEW */
+ { 20184, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 20202, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 20221, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 20240, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 20259, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 20278, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 20297, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 20316, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 20335, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 20354, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 20373, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 20392, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 20410, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 20429, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 20448, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 20467, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 20486, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 20505, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 20524, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 20543, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 20562, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 20581, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 20600, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 20618, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 20637, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 20656, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 20674, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 20692, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 20710, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 20728, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 20746, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 20764, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 20782, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 20802, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 20829, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 20854, 0x00002100 }, /* GL_MODULATE */
+ { 20866, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 20886, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 20913, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 20938, 0x00000103 }, /* GL_MULT */
+ { 20946, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 20961, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 20981, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 21000, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 21019, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 21043, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 21066, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 21096, 0x00002A25 }, /* GL_N3F_V3F */
+ { 21107, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 21127, 0x0000150E }, /* GL_NAND */
+ { 21135, 0x00002600 }, /* GL_NEAREST */
+ { 21146, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 21177, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 21209, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 21234, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 21260, 0x00000200 }, /* GL_NEVER */
+ { 21269, 0x00001102 }, /* GL_NICEST */
+ { 21279, 0x00000000 }, /* GL_NONE */
+ { 21287, 0x00001505 }, /* GL_NOOP */
+ { 21295, 0x00001508 }, /* GL_NOR */
+ { 21302, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 21315, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 21331, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 21362, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 21397, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 21421, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 21444, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 21465, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 21479, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 21497, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 21514, 0x00000205 }, /* GL_NOTEQUAL */
+ { 21526, 0x00000000 }, /* GL_NO_ERROR */
+ { 21538, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 21572, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
+ { 21610, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 21642, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 21684, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 21714, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 21754, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 21785, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 21814, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 21842, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 21872, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 21889, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 21915, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 21931, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 21966, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 21988, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 22007, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 22037, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 22058, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 22086, 0x00000001 }, /* GL_ONE */
+ { 22093, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 22121, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 22153, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 22181, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 22213, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 22236, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 22259, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 22282, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 22305, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 22323, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 22345, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 22367, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 22383, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 22403, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 22423, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 22441, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 22463, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 22485, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 22501, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 22521, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 22541, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 22559, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 22581, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 22603, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 22619, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 22639, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 22659, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 22680, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 22699, 0x00001507 }, /* GL_OR */
+ { 22705, 0x00000A01 }, /* GL_ORDER */
+ { 22714, 0x0000150D }, /* GL_OR_INVERTED */
+ { 22729, 0x0000150B }, /* GL_OR_REVERSE */
+ { 22743, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 22760, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 22778, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 22799, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 22819, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 22837, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 22856, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 22876, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 22896, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 22914, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 22933, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 22958, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 22982, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 23003, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 23025, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 23047, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 23072, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 23096, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 23117, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 23139, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 23161, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 23183, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 23214, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 23234, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 23259, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 23279, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 23304, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 23324, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 23349, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 23369, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 23394, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 23414, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 23439, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 23459, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 23484, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 23504, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 23529, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 23549, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 23574, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 23594, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 23619, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 23639, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 23664, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 23682, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 23715, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 23740, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 23775, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 23802, 0x00001B00 }, /* GL_POINT */
+ { 23811, 0x00000000 }, /* GL_POINTS */
+ { 23821, 0x00000002 }, /* GL_POINT_BIT */
+ { 23834, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 23864, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 23898, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 23932, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 23967, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 23996, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 24029, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 24062, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 24096, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 24110, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 24136, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 24154, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 24176, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 24198, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 24221, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 24239, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 24261, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 24283, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 24306, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 24326, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 24342, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 24363, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 24379, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 24399, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 24428, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 24447, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 24473, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 24488, 0x00000009 }, /* GL_POLYGON */
+ { 24499, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 24514, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 24530, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 24553, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 24578, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 24601, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 24624, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 24648, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 24672, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 24690, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 24713, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 24732, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 24755, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 24772, 0x00001203 }, /* GL_POSITION */
+ { 24784, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 24816, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 24852, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 24885, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 24922, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 24953, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 24988, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 25020, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 25056, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 25089, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 25121, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 25157, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 25190, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 25227, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 25257, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 25291, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 25322, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 25357, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 25388, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 25423, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 25455, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 25491, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 25521, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 25555, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 25586, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 25621, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 25653, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 25684, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 25719, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 25751, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 25787, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 25816, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 25849, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 25879, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 25913, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 25952, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 25985, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 26025, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 26059, 0x00008578 }, /* GL_PREVIOUS */
+ { 26071, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 26087, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 26103, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 26120, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 26141, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 26162, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 26195, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 26227, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 26250, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 26273, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 26303, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 26332, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 26360, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 26382, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 26410, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 26438, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 26460, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 26481, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 26521, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 26560, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 26590, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 26625, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 26658, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 26692, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 26731, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 26770, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 26792, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 26818, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 26842, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 26865, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 26887, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 26908, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 26929, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 26956, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 26988, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 27020, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 27055, 0x00001701 }, /* GL_PROJECTION */
+ { 27069, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 27090, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 27116, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 27137, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 27156, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 27179, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 27218, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 27256, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 27276, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
+ { 27306, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 27330, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 27350, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
+ { 27380, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 27404, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 27424, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 27457, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 27483, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 27513, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 27544, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 27574, 0x00002003 }, /* GL_Q */
+ { 27579, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 27604, 0x00000007 }, /* GL_QUADS */
+ { 27613, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 27630, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 27644, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 27666, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 27692, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 27708, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 27728, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 27754, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 27784, 0x00002002 }, /* GL_R */
+ { 27789, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 27801, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 27834, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 27849, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
+ { 27869, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 27901, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 27925, 0x000088B8 }, /* GL_READ_ONLY */
+ { 27938, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 27955, 0x000088BA }, /* GL_READ_WRITE */
+ { 27969, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 27987, 0x00001903 }, /* GL_RED */
+ { 27994, 0x00008016 }, /* GL_REDUCE */
+ { 28004, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 28018, 0x00000D15 }, /* GL_RED_BIAS */
+ { 28030, 0x00000D52 }, /* GL_RED_BITS */
+ { 28042, 0x00000D14 }, /* GL_RED_SCALE */
+ { 28055, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 28073, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 28095, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 28116, 0x00001C00 }, /* GL_RENDER */
+ { 28126, 0x00008D41 }, /* GL_RENDERBUFFER */
+ { 28142, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ { 28169, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 28197, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
+ { 28223, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ { 28250, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 28270, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
+ { 28297, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
+ { 28320, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 28347, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ { 28379, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 28415, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
+ { 28440, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
+ { 28464, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ { 28493, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
+ { 28515, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 28541, 0x00001F01 }, /* GL_RENDERER */
+ { 28553, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 28568, 0x00002901 }, /* GL_REPEAT */
+ { 28578, 0x00001E01 }, /* GL_REPLACE */
+ { 28589, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 28604, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 28627, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 28645, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 28667, 0x00000102 }, /* GL_RETURN */
+ { 28677, 0x00001907 }, /* GL_RGB */
+ { 28684, 0x00008052 }, /* GL_RGB10 */
+ { 28693, 0x00008059 }, /* GL_RGB10_A2 */
+ { 28705, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 28721, 0x00008052 }, /* GL_RGB10_EXT */
+ { 28734, 0x00008053 }, /* GL_RGB12 */
+ { 28743, 0x00008053 }, /* GL_RGB12_EXT */
+ { 28756, 0x00008054 }, /* GL_RGB16 */
+ { 28765, 0x00008054 }, /* GL_RGB16_EXT */
+ { 28778, 0x0000804E }, /* GL_RGB2_EXT */
+ { 28790, 0x0000804F }, /* GL_RGB4 */
+ { 28798, 0x0000804F }, /* GL_RGB4_EXT */
+ { 28810, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 28823, 0x00008050 }, /* GL_RGB5 */
+ { 28831, 0x00008057 }, /* GL_RGB5_A1 */
+ { 28842, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 28857, 0x00008050 }, /* GL_RGB5_EXT */
+ { 28869, 0x00008051 }, /* GL_RGB8 */
+ { 28877, 0x00008051 }, /* GL_RGB8_EXT */
+ { 28889, 0x00001908 }, /* GL_RGBA */
+ { 28897, 0x0000805A }, /* GL_RGBA12 */
+ { 28907, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 28921, 0x0000805B }, /* GL_RGBA16 */
+ { 28931, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 28945, 0x00008055 }, /* GL_RGBA2 */
+ { 28954, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 28967, 0x00008056 }, /* GL_RGBA4 */
+ { 28976, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 28995, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 29008, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 29022, 0x00008058 }, /* GL_RGBA8 */
+ { 29031, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 29044, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 29062, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 29075, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 29088, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 29100, 0x00008573 }, /* GL_RGB_SCALE */
+ { 29113, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 29130, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 29147, 0x00000407 }, /* GL_RIGHT */
+ { 29156, 0x00002000 }, /* GL_S */
+ { 29161, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 29175, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 29196, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 29210, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 29231, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 29245, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 29261, 0x000080A9 }, /* GL_SAMPLES */
+ { 29272, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 29288, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 29303, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 29321, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 29343, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 29371, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 29403, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 29426, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 29453, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 29471, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 29494, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 29516, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 29535, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 29558, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 29584, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 29614, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 29639, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 29668, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 29683, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 29698, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 29714, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 29739, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 29779, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 29823, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 29856, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 29886, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 29918, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 29948, 0x00001C02 }, /* GL_SELECT */
+ { 29958, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 29986, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 30011, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 30027, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 30054, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 30085, 0x0000150F }, /* GL_SET */
+ { 30092, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 30113, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 30137, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 30152, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 30167, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 30195, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 30218, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 30248, 0x00001601 }, /* GL_SHININESS */
+ { 30261, 0x00001402 }, /* GL_SHORT */
+ { 30270, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 30286, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 30306, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 30325, 0x00001D01 }, /* GL_SMOOTH */
+ { 30335, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 30368, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 30395, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 30428, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 30455, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 30472, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 30493, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 30514, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 30529, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 30548, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 30567, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 30584, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 30605, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 30626, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 30641, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 30660, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 30679, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 30696, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 30717, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 30738, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 30753, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 30772, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 30791, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 30811, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 30829, 0x00001202 }, /* GL_SPECULAR */
+ { 30841, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 30855, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 30870, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 30888, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 30905, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 30919, 0x00008580 }, /* GL_SRC0_RGB */
+ { 30931, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 30945, 0x00008581 }, /* GL_SRC1_RGB */
+ { 30957, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 30971, 0x00008582 }, /* GL_SRC2_RGB */
+ { 30983, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 30996, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 31018, 0x00000300 }, /* GL_SRC_COLOR */
+ { 31031, 0x00008C40 }, /* GL_SRGB */
+ { 31039, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 31057, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 31076, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 31091, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 31110, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 31125, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 31144, 0x000088E5 }, /* GL_STATIC_READ */
+ { 31159, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 31178, 0x00001802 }, /* GL_STENCIL */
+ { 31189, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
+ { 31211, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 31237, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 31258, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
+ { 31283, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 31304, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
+ { 31329, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 31361, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
+ { 31397, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 31429, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
+ { 31465, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 31485, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 31512, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 31538, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 31554, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 31576, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 31599, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 31615, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 31631, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 31648, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 31671, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 31693, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 31715, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 31737, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 31758, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 31785, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 31812, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 31827, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 31843, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 31872, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 31894, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 31915, 0x00000C33 }, /* GL_STEREO */
+ { 31925, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 31940, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 31959, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 31974, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 31993, 0x000088E1 }, /* GL_STREAM_READ */
+ { 32008, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 32027, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 32044, 0x000084E7 }, /* GL_SUBTRACT */
+ { 32056, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 32072, 0x00002001 }, /* GL_T */
+ { 32077, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 32092, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 32111, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 32127, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 32142, 0x00002A27 }, /* GL_T2F_V3F */
+ { 32153, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 32172, 0x00002A28 }, /* GL_T4F_V4F */
+ { 32183, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 32206, 0x00001702 }, /* GL_TEXTURE */
+ { 32217, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 32229, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 32245, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 32257, 0x000084CA }, /* GL_TEXTURE10 */
+ { 32270, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 32287, 0x000084CB }, /* GL_TEXTURE11 */
+ { 32300, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 32317, 0x000084CC }, /* GL_TEXTURE12 */
+ { 32330, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 32347, 0x000084CD }, /* GL_TEXTURE13 */
+ { 32360, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 32377, 0x000084CE }, /* GL_TEXTURE14 */
+ { 32390, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 32407, 0x000084CF }, /* GL_TEXTURE15 */
+ { 32420, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 32437, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 32450, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 32467, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 32480, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 32497, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 32510, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 32527, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 32540, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 32557, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 32573, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 32585, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 32598, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 32615, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 32628, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 32645, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 32658, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 32675, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 32688, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 32705, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 32718, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 32735, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 32748, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 32765, 0x000084DA }, /* GL_TEXTURE26 */
+ { 32778, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 32795, 0x000084DB }, /* GL_TEXTURE27 */
+ { 32808, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 32825, 0x000084DC }, /* GL_TEXTURE28 */
+ { 32838, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 32855, 0x000084DD }, /* GL_TEXTURE29 */
+ { 32868, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 32885, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 32901, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 32913, 0x000084DE }, /* GL_TEXTURE30 */
+ { 32926, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 32943, 0x000084DF }, /* GL_TEXTURE31 */
+ { 32956, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 32973, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 32989, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 33001, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 33017, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 33029, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 33045, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 33057, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 33073, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 33085, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 33101, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 33113, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 33129, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 33141, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 33157, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 33171, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
+ { 33195, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 33209, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
+ { 33233, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 33247, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 33269, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 33295, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 33317, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 33339, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
+ { 33371, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 33393, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
+ { 33425, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 33447, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 33475, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 33507, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 33540, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 33572, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 33587, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 33608, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 33633, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 33651, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 33675, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 33706, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 33736, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 33766, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 33801, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 33832, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 33870, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 33897, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 33929, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 33963, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 33987, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 34015, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 34039, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 34067, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 34100, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 34124, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 34146, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 34168, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 34194, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 34228, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 34261, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 34298, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 34326, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 34358, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 34381, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 34419, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 34461, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 34492, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 34520, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 34550, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 34578, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 34598, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 34622, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 34653, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 34688, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 34719, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 34754, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 34785, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 34820, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 34851, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 34886, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 34917, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 34952, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 34983, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 35018, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 35035, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 35057, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 35083, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 35098, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 35119, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 35139, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 35165, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 35185, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 35202, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 35219, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 35236, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 35253, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 35278, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 35300, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 35326, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 35344, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 35370, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 35396, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 35426, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 35453, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 35478, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 35498, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 35522, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 35549, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 35576, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 35603, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 35629, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 35659, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 35681, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 35699, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 35729, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 35757, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 35785, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 35813, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 35834, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 35853, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 35875, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 35894, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 35914, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 35939, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 35963, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 35983, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 36007, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 36027, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 36050, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
+ { 36074, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 36099, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 36133, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 36150, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 36168, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 36186, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 36204, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 36224, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 36243, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 36272, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 36289, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 36315, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 36345, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 36377, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 36407, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 36441, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 36457, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 36488, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 36523, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 36551, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 36583, 0x00000004 }, /* GL_TRIANGLES */
+ { 36596, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 36612, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 36633, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 36651, 0x00000001 }, /* GL_TRUE */
+ { 36659, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 36679, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 36702, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 36722, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 36743, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 36765, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 36787, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 36807, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 36828, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 36845, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 36872, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 36895, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 36911, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 36938, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
+ { 36959, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 36983, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 37014, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 37038, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 37066, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
+ { 37089, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 37107, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 37137, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 37163, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 37193, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 37219, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 37243, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 37271, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 37299, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 37326, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 37358, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 37389, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 37403, 0x00002A20 }, /* GL_V2F */
+ { 37410, 0x00002A21 }, /* GL_V3F */
+ { 37417, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 37436, 0x00001F00 }, /* GL_VENDOR */
+ { 37446, 0x00001F02 }, /* GL_VERSION */
+ { 37457, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 37473, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 37503, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 37534, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 37569, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 37593, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 37614, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 37637, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 37658, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 37685, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 37713, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 37741, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 37769, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 37797, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 37825, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 37853, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 37880, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 37907, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 37934, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 37961, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 37988, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 38015, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 38042, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 38069, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 38096, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 38134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 38176, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 38207, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 38242, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 38276, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 38314, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 38345, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 38380, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 38408, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 38440, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 38470, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 38504, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 38532, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 38564, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 38584, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 38606, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 38635, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 38656, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 38685, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 38718, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 38750, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 38777, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 38808, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 38838, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 38855, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 38876, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 38903, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 38915, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 38931, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 38951, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 38982, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 39017, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 39045, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 39070, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 39097, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 39122, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 39146, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 39165, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 39179, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 39197, 0x00001506 }, /* GL_XOR */
+ { 39204, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 39223, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 39237, 0x00000000 }, /* GL_ZERO */
+ { 39245, 0x00000D16 }, /* GL_ZOOM_X */
+ { 39255, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1284] =
+static const unsigned reduced_enums[1308] =
{
- 434, /* GL_FALSE */
- 643, /* GL_LINES */
- 645, /* GL_LINE_LOOP */
- 652, /* GL_LINE_STRIP */
- 1639, /* GL_TRIANGLES */
- 1642, /* GL_TRIANGLE_STRIP */
- 1640, /* GL_TRIANGLE_FAN */
- 1209, /* GL_QUADS */
- 1211, /* GL_QUAD_STRIP */
- 1097, /* GL_POLYGON */
- 1109, /* GL_POLYGON_STIPPLE_BIT */
- 1062, /* GL_PIXEL_MODE_BIT */
- 630, /* GL_LIGHTING_BIT */
- 456, /* GL_FOG_BIT */
+ 455, /* GL_FALSE */
+ 687, /* GL_LINES */
+ 689, /* GL_LINE_LOOP */
+ 696, /* GL_LINE_STRIP */
+ 1699, /* GL_TRIANGLES */
+ 1702, /* GL_TRIANGLE_STRIP */
+ 1700, /* GL_TRIANGLE_FAN */
+ 1254, /* GL_QUADS */
+ 1256, /* GL_QUAD_STRIP */
+ 1142, /* GL_POLYGON */
+ 1154, /* GL_POLYGON_STIPPLE_BIT */
+ 1107, /* GL_PIXEL_MODE_BIT */
+ 674, /* GL_LIGHTING_BIT */
+ 477, /* GL_FOG_BIT */
8, /* GL_ACCUM */
- 662, /* GL_LOAD */
- 1251, /* GL_RETURN */
- 935, /* GL_MULT */
+ 706, /* GL_LOAD */
+ 1308, /* GL_RETURN */
+ 980, /* GL_MULT */
23, /* GL_ADD */
- 951, /* GL_NEVER */
- 620, /* GL_LESS */
- 424, /* GL_EQUAL */
- 619, /* GL_LEQUAL */
- 545, /* GL_GREATER */
- 966, /* GL_NOTEQUAL */
- 520, /* GL_GEQUAL */
+ 996, /* GL_NEVER */
+ 664, /* GL_LESS */
+ 445, /* GL_EQUAL */
+ 663, /* GL_LEQUAL */
+ 587, /* GL_GREATER */
+ 1011, /* GL_NOTEQUAL */
+ 562, /* GL_GEQUAL */
46, /* GL_ALWAYS */
- 1384, /* GL_SRC_COLOR */
- 995, /* GL_ONE_MINUS_SRC_COLOR */
- 1382, /* GL_SRC_ALPHA */
- 994, /* GL_ONE_MINUS_SRC_ALPHA */
- 405, /* GL_DST_ALPHA */
- 992, /* GL_ONE_MINUS_DST_ALPHA */
- 406, /* GL_DST_COLOR */
- 993, /* GL_ONE_MINUS_DST_COLOR */
- 1383, /* GL_SRC_ALPHA_SATURATE */
- 508, /* GL_FRONT_LEFT */
- 509, /* GL_FRONT_RIGHT */
+ 1441, /* GL_SRC_COLOR */
+ 1040, /* GL_ONE_MINUS_SRC_COLOR */
+ 1439, /* GL_SRC_ALPHA */
+ 1039, /* GL_ONE_MINUS_SRC_ALPHA */
+ 426, /* GL_DST_ALPHA */
+ 1037, /* GL_ONE_MINUS_DST_ALPHA */
+ 427, /* GL_DST_COLOR */
+ 1038, /* GL_ONE_MINUS_DST_COLOR */
+ 1440, /* GL_SRC_ALPHA_SATURATE */
+ 550, /* GL_FRONT_LEFT */
+ 551, /* GL_FRONT_RIGHT */
68, /* GL_BACK_LEFT */
69, /* GL_BACK_RIGHT */
- 505, /* GL_FRONT */
+ 547, /* GL_FRONT */
67, /* GL_BACK */
- 618, /* GL_LEFT */
- 1291, /* GL_RIGHT */
- 506, /* GL_FRONT_AND_BACK */
+ 662, /* GL_LEFT */
+ 1348, /* GL_RIGHT */
+ 548, /* GL_FRONT_AND_BACK */
62, /* GL_AUX0 */
63, /* GL_AUX1 */
64, /* GL_AUX2 */
65, /* GL_AUX3 */
- 610, /* GL_INVALID_ENUM */
- 613, /* GL_INVALID_VALUE */
- 612, /* GL_INVALID_OPERATION */
- 1385, /* GL_STACK_OVERFLOW */
- 1386, /* GL_STACK_UNDERFLOW */
- 1020, /* GL_OUT_OF_MEMORY */
- 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ 653, /* GL_INVALID_ENUM */
+ 657, /* GL_INVALID_VALUE */
+ 656, /* GL_INVALID_OPERATION */
+ 1443, /* GL_STACK_OVERFLOW */
+ 1444, /* GL_STACK_UNDERFLOW */
+ 1065, /* GL_OUT_OF_MEMORY */
+ 654, /* GL_INVALID_FRAMEBUFFER_OPERATION */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 1040, /* GL_PASS_THROUGH_TOKEN */
- 1096, /* GL_POINT_TOKEN */
- 653, /* GL_LINE_TOKEN */
- 1110, /* GL_POLYGON_TOKEN */
+ 1085, /* GL_PASS_THROUGH_TOKEN */
+ 1141, /* GL_POINT_TOKEN */
+ 697, /* GL_LINE_TOKEN */
+ 1155, /* GL_POLYGON_TOKEN */
73, /* GL_BITMAP_TOKEN */
- 404, /* GL_DRAW_PIXEL_TOKEN */
- 270, /* GL_COPY_PIXEL_TOKEN */
- 646, /* GL_LINE_RESET_TOKEN */
- 427, /* GL_EXP */
- 428, /* GL_EXP2 */
- 303, /* GL_CW */
+ 425, /* GL_DRAW_PIXEL_TOKEN */
+ 286, /* GL_COPY_PIXEL_TOKEN */
+ 690, /* GL_LINE_RESET_TOKEN */
+ 448, /* GL_EXP */
+ 449, /* GL_EXP2 */
+ 319, /* GL_CW */
115, /* GL_CCW */
136, /* GL_COEFF */
- 1017, /* GL_ORDER */
- 343, /* GL_DOMAIN */
- 278, /* GL_CURRENT_COLOR */
- 281, /* GL_CURRENT_INDEX */
- 287, /* GL_CURRENT_NORMAL */
- 299, /* GL_CURRENT_TEXTURE_COORDS */
- 292, /* GL_CURRENT_RASTER_COLOR */
- 294, /* GL_CURRENT_RASTER_INDEX */
- 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- 295, /* GL_CURRENT_RASTER_POSITION */
- 296, /* GL_CURRENT_RASTER_POSITION_VALID */
- 293, /* GL_CURRENT_RASTER_DISTANCE */
- 1089, /* GL_POINT_SMOOTH */
- 1078, /* GL_POINT_SIZE */
- 1088, /* GL_POINT_SIZE_RANGE */
- 1079, /* GL_POINT_SIZE_GRANULARITY */
- 647, /* GL_LINE_SMOOTH */
- 654, /* GL_LINE_WIDTH */
- 656, /* GL_LINE_WIDTH_RANGE */
- 655, /* GL_LINE_WIDTH_GRANULARITY */
- 649, /* GL_LINE_STIPPLE */
- 650, /* GL_LINE_STIPPLE_PATTERN */
- 651, /* GL_LINE_STIPPLE_REPEAT */
- 661, /* GL_LIST_MODE */
- 820, /* GL_MAX_LIST_NESTING */
- 658, /* GL_LIST_BASE */
- 660, /* GL_LIST_INDEX */
- 1099, /* GL_POLYGON_MODE */
- 1106, /* GL_POLYGON_SMOOTH */
- 1108, /* GL_POLYGON_STIPPLE */
- 413, /* GL_EDGE_FLAG */
- 271, /* GL_CULL_FACE */
- 272, /* GL_CULL_FACE_MODE */
- 507, /* GL_FRONT_FACE */
- 629, /* GL_LIGHTING */
- 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 635, /* GL_LIGHT_MODEL_TWO_SIDE */
- 631, /* GL_LIGHT_MODEL_AMBIENT */
- 1337, /* GL_SHADE_MODEL */
- 167, /* GL_COLOR_MATERIAL_FACE */
- 168, /* GL_COLOR_MATERIAL_PARAMETER */
- 166, /* GL_COLOR_MATERIAL */
- 455, /* GL_FOG */
- 477, /* GL_FOG_INDEX */
- 473, /* GL_FOG_DENSITY */
- 481, /* GL_FOG_START */
- 475, /* GL_FOG_END */
- 478, /* GL_FOG_MODE */
- 457, /* GL_FOG_COLOR */
- 332, /* GL_DEPTH_RANGE */
- 337, /* GL_DEPTH_TEST */
- 340, /* GL_DEPTH_WRITEMASK */
- 320, /* GL_DEPTH_CLEAR_VALUE */
- 331, /* GL_DEPTH_FUNC */
+ 1062, /* GL_ORDER */
+ 363, /* GL_DOMAIN */
+ 294, /* GL_CURRENT_COLOR */
+ 297, /* GL_CURRENT_INDEX */
+ 303, /* GL_CURRENT_NORMAL */
+ 315, /* GL_CURRENT_TEXTURE_COORDS */
+ 308, /* GL_CURRENT_RASTER_COLOR */
+ 310, /* GL_CURRENT_RASTER_INDEX */
+ 313, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ 311, /* GL_CURRENT_RASTER_POSITION */
+ 312, /* GL_CURRENT_RASTER_POSITION_VALID */
+ 309, /* GL_CURRENT_RASTER_DISTANCE */
+ 1134, /* GL_POINT_SMOOTH */
+ 1123, /* GL_POINT_SIZE */
+ 1133, /* GL_POINT_SIZE_RANGE */
+ 1124, /* GL_POINT_SIZE_GRANULARITY */
+ 691, /* GL_LINE_SMOOTH */
+ 698, /* GL_LINE_WIDTH */
+ 700, /* GL_LINE_WIDTH_RANGE */
+ 699, /* GL_LINE_WIDTH_GRANULARITY */
+ 693, /* GL_LINE_STIPPLE */
+ 694, /* GL_LINE_STIPPLE_PATTERN */
+ 695, /* GL_LINE_STIPPLE_REPEAT */
+ 705, /* GL_LIST_MODE */
+ 864, /* GL_MAX_LIST_NESTING */
+ 702, /* GL_LIST_BASE */
+ 704, /* GL_LIST_INDEX */
+ 1144, /* GL_POLYGON_MODE */
+ 1151, /* GL_POLYGON_SMOOTH */
+ 1153, /* GL_POLYGON_STIPPLE */
+ 434, /* GL_EDGE_FLAG */
+ 287, /* GL_CULL_FACE */
+ 288, /* GL_CULL_FACE_MODE */
+ 549, /* GL_FRONT_FACE */
+ 673, /* GL_LIGHTING */
+ 678, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 679, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 675, /* GL_LIGHT_MODEL_AMBIENT */
+ 1394, /* GL_SHADE_MODEL */
+ 183, /* GL_COLOR_MATERIAL_FACE */
+ 184, /* GL_COLOR_MATERIAL_PARAMETER */
+ 182, /* GL_COLOR_MATERIAL */
+ 476, /* GL_FOG */
+ 498, /* GL_FOG_INDEX */
+ 494, /* GL_FOG_DENSITY */
+ 502, /* GL_FOG_START */
+ 496, /* GL_FOG_END */
+ 499, /* GL_FOG_MODE */
+ 478, /* GL_FOG_COLOR */
+ 350, /* GL_DEPTH_RANGE */
+ 357, /* GL_DEPTH_TEST */
+ 360, /* GL_DEPTH_WRITEMASK */
+ 338, /* GL_DEPTH_CLEAR_VALUE */
+ 349, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1420, /* GL_STENCIL_TEST */
- 1408, /* GL_STENCIL_CLEAR_VALUE */
- 1410, /* GL_STENCIL_FUNC */
- 1422, /* GL_STENCIL_VALUE_MASK */
- 1409, /* GL_STENCIL_FAIL */
- 1417, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1418, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1419, /* GL_STENCIL_REF */
- 1423, /* GL_STENCIL_WRITEMASK */
- 789, /* GL_MATRIX_MODE */
- 956, /* GL_NORMALIZE */
- 1729, /* GL_VIEWPORT */
- 930, /* GL_MODELVIEW_STACK_DEPTH */
- 1189, /* GL_PROJECTION_STACK_DEPTH */
- 1618, /* GL_TEXTURE_STACK_DEPTH */
- 928, /* GL_MODELVIEW_MATRIX */
- 1188, /* GL_PROJECTION_MATRIX */
- 1603, /* GL_TEXTURE_MATRIX */
+ 1479, /* GL_STENCIL_TEST */
+ 1467, /* GL_STENCIL_CLEAR_VALUE */
+ 1469, /* GL_STENCIL_FUNC */
+ 1481, /* GL_STENCIL_VALUE_MASK */
+ 1468, /* GL_STENCIL_FAIL */
+ 1476, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1477, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1478, /* GL_STENCIL_REF */
+ 1482, /* GL_STENCIL_WRITEMASK */
+ 833, /* GL_MATRIX_MODE */
+ 1001, /* GL_NORMALIZE */
+ 1791, /* GL_VIEWPORT */
+ 975, /* GL_MODELVIEW_STACK_DEPTH */
+ 1234, /* GL_PROJECTION_STACK_DEPTH */
+ 1677, /* GL_TEXTURE_STACK_DEPTH */
+ 973, /* GL_MODELVIEW_MATRIX */
+ 1233, /* GL_PROJECTION_MATRIX */
+ 1662, /* GL_TEXTURE_MATRIX */
60, /* GL_ATTRIB_STACK_DEPTH */
126, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
43, /* GL_ALPHA_TEST */
44, /* GL_ALPHA_TEST_FUNC */
45, /* GL_ALPHA_TEST_REF */
- 342, /* GL_DITHER */
+ 362, /* GL_DITHER */
77, /* GL_BLEND_DST */
85, /* GL_BLEND_SRC */
74, /* GL_BLEND */
- 664, /* GL_LOGIC_OP_MODE */
- 584, /* GL_INDEX_LOGIC_OP */
- 165, /* GL_COLOR_LOGIC_OP */
+ 708, /* GL_LOGIC_OP_MODE */
+ 627, /* GL_INDEX_LOGIC_OP */
+ 181, /* GL_COLOR_LOGIC_OP */
66, /* GL_AUX_BUFFERS */
- 353, /* GL_DRAW_BUFFER */
- 1221, /* GL_READ_BUFFER */
- 1318, /* GL_SCISSOR_BOX */
- 1319, /* GL_SCISSOR_TEST */
- 583, /* GL_INDEX_CLEAR_VALUE */
- 588, /* GL_INDEX_WRITEMASK */
- 162, /* GL_COLOR_CLEAR_VALUE */
- 204, /* GL_COLOR_WRITEMASK */
- 585, /* GL_INDEX_MODE */
- 1285, /* GL_RGBA_MODE */
- 352, /* GL_DOUBLEBUFFER */
- 1424, /* GL_STEREO */
- 1244, /* GL_RENDER_MODE */
- 1041, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1090, /* GL_POINT_SMOOTH_HINT */
- 648, /* GL_LINE_SMOOTH_HINT */
- 1107, /* GL_POLYGON_SMOOTH_HINT */
- 476, /* GL_FOG_HINT */
- 1584, /* GL_TEXTURE_GEN_S */
- 1585, /* GL_TEXTURE_GEN_T */
- 1583, /* GL_TEXTURE_GEN_R */
- 1582, /* GL_TEXTURE_GEN_Q */
- 1054, /* GL_PIXEL_MAP_I_TO_I */
- 1060, /* GL_PIXEL_MAP_S_TO_S */
- 1056, /* GL_PIXEL_MAP_I_TO_R */
- 1052, /* GL_PIXEL_MAP_I_TO_G */
- 1050, /* GL_PIXEL_MAP_I_TO_B */
- 1048, /* GL_PIXEL_MAP_I_TO_A */
- 1058, /* GL_PIXEL_MAP_R_TO_R */
- 1046, /* GL_PIXEL_MAP_G_TO_G */
- 1044, /* GL_PIXEL_MAP_B_TO_B */
- 1042, /* GL_PIXEL_MAP_A_TO_A */
- 1055, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 1061, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 1057, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 1053, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 1051, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 1049, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 1059, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 1047, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 1045, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 1043, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 1651, /* GL_UNPACK_SWAP_BYTES */
- 1646, /* GL_UNPACK_LSB_FIRST */
- 1647, /* GL_UNPACK_ROW_LENGTH */
- 1650, /* GL_UNPACK_SKIP_ROWS */
- 1649, /* GL_UNPACK_SKIP_PIXELS */
- 1644, /* GL_UNPACK_ALIGNMENT */
- 1029, /* GL_PACK_SWAP_BYTES */
- 1024, /* GL_PACK_LSB_FIRST */
- 1025, /* GL_PACK_ROW_LENGTH */
- 1028, /* GL_PACK_SKIP_ROWS */
- 1027, /* GL_PACK_SKIP_PIXELS */
- 1021, /* GL_PACK_ALIGNMENT */
- 742, /* GL_MAP_COLOR */
- 743, /* GL_MAP_STENCIL */
- 587, /* GL_INDEX_SHIFT */
- 586, /* GL_INDEX_OFFSET */
- 1233, /* GL_RED_SCALE */
- 1231, /* GL_RED_BIAS */
- 1746, /* GL_ZOOM_X */
- 1747, /* GL_ZOOM_Y */
- 549, /* GL_GREEN_SCALE */
- 547, /* GL_GREEN_BIAS */
+ 373, /* GL_DRAW_BUFFER */
+ 1266, /* GL_READ_BUFFER */
+ 1375, /* GL_SCISSOR_BOX */
+ 1376, /* GL_SCISSOR_TEST */
+ 626, /* GL_INDEX_CLEAR_VALUE */
+ 631, /* GL_INDEX_WRITEMASK */
+ 178, /* GL_COLOR_CLEAR_VALUE */
+ 220, /* GL_COLOR_WRITEMASK */
+ 628, /* GL_INDEX_MODE */
+ 1342, /* GL_RGBA_MODE */
+ 372, /* GL_DOUBLEBUFFER */
+ 1483, /* GL_STEREO */
+ 1301, /* GL_RENDER_MODE */
+ 1086, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1135, /* GL_POINT_SMOOTH_HINT */
+ 692, /* GL_LINE_SMOOTH_HINT */
+ 1152, /* GL_POLYGON_SMOOTH_HINT */
+ 497, /* GL_FOG_HINT */
+ 1643, /* GL_TEXTURE_GEN_S */
+ 1644, /* GL_TEXTURE_GEN_T */
+ 1642, /* GL_TEXTURE_GEN_R */
+ 1641, /* GL_TEXTURE_GEN_Q */
+ 1099, /* GL_PIXEL_MAP_I_TO_I */
+ 1105, /* GL_PIXEL_MAP_S_TO_S */
+ 1101, /* GL_PIXEL_MAP_I_TO_R */
+ 1097, /* GL_PIXEL_MAP_I_TO_G */
+ 1095, /* GL_PIXEL_MAP_I_TO_B */
+ 1093, /* GL_PIXEL_MAP_I_TO_A */
+ 1103, /* GL_PIXEL_MAP_R_TO_R */
+ 1091, /* GL_PIXEL_MAP_G_TO_G */
+ 1089, /* GL_PIXEL_MAP_B_TO_B */
+ 1087, /* GL_PIXEL_MAP_A_TO_A */
+ 1100, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1106, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1102, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1098, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1096, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1094, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1104, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1092, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1090, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1088, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 1711, /* GL_UNPACK_SWAP_BYTES */
+ 1706, /* GL_UNPACK_LSB_FIRST */
+ 1707, /* GL_UNPACK_ROW_LENGTH */
+ 1710, /* GL_UNPACK_SKIP_ROWS */
+ 1709, /* GL_UNPACK_SKIP_PIXELS */
+ 1704, /* GL_UNPACK_ALIGNMENT */
+ 1074, /* GL_PACK_SWAP_BYTES */
+ 1069, /* GL_PACK_LSB_FIRST */
+ 1070, /* GL_PACK_ROW_LENGTH */
+ 1073, /* GL_PACK_SKIP_ROWS */
+ 1072, /* GL_PACK_SKIP_PIXELS */
+ 1066, /* GL_PACK_ALIGNMENT */
+ 786, /* GL_MAP_COLOR */
+ 787, /* GL_MAP_STENCIL */
+ 630, /* GL_INDEX_SHIFT */
+ 629, /* GL_INDEX_OFFSET */
+ 1279, /* GL_RED_SCALE */
+ 1277, /* GL_RED_BIAS */
+ 1808, /* GL_ZOOM_X */
+ 1809, /* GL_ZOOM_Y */
+ 591, /* GL_GREEN_SCALE */
+ 589, /* GL_GREEN_BIAS */
91, /* GL_BLUE_SCALE */
89, /* GL_BLUE_BIAS */
42, /* GL_ALPHA_SCALE */
40, /* GL_ALPHA_BIAS */
- 333, /* GL_DEPTH_SCALE */
- 314, /* GL_DEPTH_BIAS */
- 815, /* GL_MAX_EVAL_ORDER */
- 819, /* GL_MAX_LIGHTS */
- 798, /* GL_MAX_CLIP_PLANES */
- 863, /* GL_MAX_TEXTURE_SIZE */
- 825, /* GL_MAX_PIXEL_MAP_TABLE */
- 794, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 822, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 823, /* GL_MAX_NAME_STACK_DEPTH */
- 851, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 864, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 878, /* GL_MAX_VIEWPORT_DIMS */
- 795, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1431, /* GL_SUBPIXEL_BITS */
- 582, /* GL_INDEX_BITS */
- 1232, /* GL_RED_BITS */
- 548, /* GL_GREEN_BITS */
+ 351, /* GL_DEPTH_SCALE */
+ 332, /* GL_DEPTH_BIAS */
+ 859, /* GL_MAX_EVAL_ORDER */
+ 863, /* GL_MAX_LIGHTS */
+ 842, /* GL_MAX_CLIP_PLANES */
+ 908, /* GL_MAX_TEXTURE_SIZE */
+ 869, /* GL_MAX_PIXEL_MAP_TABLE */
+ 838, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 866, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 867, /* GL_MAX_NAME_STACK_DEPTH */
+ 895, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 909, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 923, /* GL_MAX_VIEWPORT_DIMS */
+ 839, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1490, /* GL_SUBPIXEL_BITS */
+ 625, /* GL_INDEX_BITS */
+ 1278, /* GL_RED_BITS */
+ 590, /* GL_GREEN_BITS */
90, /* GL_BLUE_BITS */
41, /* GL_ALPHA_BITS */
- 315, /* GL_DEPTH_BITS */
- 1406, /* GL_STENCIL_BITS */
+ 333, /* GL_DEPTH_BITS */
+ 1465, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
9, /* GL_ACCUM_ALPHA_BITS */
- 944, /* GL_NAME_STACK_DEPTH */
+ 989, /* GL_NAME_STACK_DEPTH */
61, /* GL_AUTO_NORMAL */
- 688, /* GL_MAP1_COLOR_4 */
- 691, /* GL_MAP1_INDEX */
- 692, /* GL_MAP1_NORMAL */
- 693, /* GL_MAP1_TEXTURE_COORD_1 */
- 694, /* GL_MAP1_TEXTURE_COORD_2 */
- 695, /* GL_MAP1_TEXTURE_COORD_3 */
- 696, /* GL_MAP1_TEXTURE_COORD_4 */
- 697, /* GL_MAP1_VERTEX_3 */
- 698, /* GL_MAP1_VERTEX_4 */
- 715, /* GL_MAP2_COLOR_4 */
- 718, /* GL_MAP2_INDEX */
- 719, /* GL_MAP2_NORMAL */
- 720, /* GL_MAP2_TEXTURE_COORD_1 */
- 721, /* GL_MAP2_TEXTURE_COORD_2 */
- 722, /* GL_MAP2_TEXTURE_COORD_3 */
- 723, /* GL_MAP2_TEXTURE_COORD_4 */
- 724, /* GL_MAP2_VERTEX_3 */
- 725, /* GL_MAP2_VERTEX_4 */
- 689, /* GL_MAP1_GRID_DOMAIN */
- 690, /* GL_MAP1_GRID_SEGMENTS */
- 716, /* GL_MAP2_GRID_DOMAIN */
- 717, /* GL_MAP2_GRID_SEGMENTS */
- 1508, /* GL_TEXTURE_1D */
- 1510, /* GL_TEXTURE_2D */
- 437, /* GL_FEEDBACK_BUFFER_POINTER */
- 438, /* GL_FEEDBACK_BUFFER_SIZE */
- 439, /* GL_FEEDBACK_BUFFER_TYPE */
- 1328, /* GL_SELECTION_BUFFER_POINTER */
- 1329, /* GL_SELECTION_BUFFER_SIZE */
- 1621, /* GL_TEXTURE_WIDTH */
- 1589, /* GL_TEXTURE_HEIGHT */
- 1545, /* GL_TEXTURE_COMPONENTS */
- 1529, /* GL_TEXTURE_BORDER_COLOR */
- 1528, /* GL_TEXTURE_BORDER */
- 344, /* GL_DONT_CARE */
- 435, /* GL_FASTEST */
- 952, /* GL_NICEST */
+ 732, /* GL_MAP1_COLOR_4 */
+ 735, /* GL_MAP1_INDEX */
+ 736, /* GL_MAP1_NORMAL */
+ 737, /* GL_MAP1_TEXTURE_COORD_1 */
+ 738, /* GL_MAP1_TEXTURE_COORD_2 */
+ 739, /* GL_MAP1_TEXTURE_COORD_3 */
+ 740, /* GL_MAP1_TEXTURE_COORD_4 */
+ 741, /* GL_MAP1_VERTEX_3 */
+ 742, /* GL_MAP1_VERTEX_4 */
+ 759, /* GL_MAP2_COLOR_4 */
+ 762, /* GL_MAP2_INDEX */
+ 763, /* GL_MAP2_NORMAL */
+ 764, /* GL_MAP2_TEXTURE_COORD_1 */
+ 765, /* GL_MAP2_TEXTURE_COORD_2 */
+ 766, /* GL_MAP2_TEXTURE_COORD_3 */
+ 767, /* GL_MAP2_TEXTURE_COORD_4 */
+ 768, /* GL_MAP2_VERTEX_3 */
+ 769, /* GL_MAP2_VERTEX_4 */
+ 733, /* GL_MAP1_GRID_DOMAIN */
+ 734, /* GL_MAP1_GRID_SEGMENTS */
+ 760, /* GL_MAP2_GRID_DOMAIN */
+ 761, /* GL_MAP2_GRID_SEGMENTS */
+ 1567, /* GL_TEXTURE_1D */
+ 1569, /* GL_TEXTURE_2D */
+ 458, /* GL_FEEDBACK_BUFFER_POINTER */
+ 459, /* GL_FEEDBACK_BUFFER_SIZE */
+ 460, /* GL_FEEDBACK_BUFFER_TYPE */
+ 1385, /* GL_SELECTION_BUFFER_POINTER */
+ 1386, /* GL_SELECTION_BUFFER_SIZE */
+ 1681, /* GL_TEXTURE_WIDTH */
+ 1648, /* GL_TEXTURE_HEIGHT */
+ 1604, /* GL_TEXTURE_COMPONENTS */
+ 1588, /* GL_TEXTURE_BORDER_COLOR */
+ 1587, /* GL_TEXTURE_BORDER */
+ 364, /* GL_DONT_CARE */
+ 456, /* GL_FASTEST */
+ 997, /* GL_NICEST */
47, /* GL_AMBIENT */
- 341, /* GL_DIFFUSE */
- 1371, /* GL_SPECULAR */
- 1111, /* GL_POSITION */
- 1374, /* GL_SPOT_DIRECTION */
- 1375, /* GL_SPOT_EXPONENT */
- 1373, /* GL_SPOT_CUTOFF */
- 244, /* GL_CONSTANT_ATTENUATION */
- 638, /* GL_LINEAR_ATTENUATION */
- 1208, /* GL_QUADRATIC_ATTENUATION */
- 218, /* GL_COMPILE */
- 219, /* GL_COMPILE_AND_EXECUTE */
+ 361, /* GL_DIFFUSE */
+ 1428, /* GL_SPECULAR */
+ 1156, /* GL_POSITION */
+ 1431, /* GL_SPOT_DIRECTION */
+ 1432, /* GL_SPOT_EXPONENT */
+ 1430, /* GL_SPOT_CUTOFF */
+ 260, /* GL_CONSTANT_ATTENUATION */
+ 682, /* GL_LINEAR_ATTENUATION */
+ 1253, /* GL_QUADRATIC_ATTENUATION */
+ 234, /* GL_COMPILE */
+ 235, /* GL_COMPILE_AND_EXECUTE */
110, /* GL_BYTE */
- 1652, /* GL_UNSIGNED_BYTE */
- 1342, /* GL_SHORT */
- 1661, /* GL_UNSIGNED_SHORT */
- 590, /* GL_INT */
- 1655, /* GL_UNSIGNED_INT */
- 442, /* GL_FLOAT */
+ 1712, /* GL_UNSIGNED_BYTE */
+ 1399, /* GL_SHORT */
+ 1723, /* GL_UNSIGNED_SHORT */
+ 633, /* GL_INT */
+ 1715, /* GL_UNSIGNED_INT */
+ 463, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
7, /* GL_4_BYTES */
- 351, /* GL_DOUBLE */
+ 371, /* GL_DOUBLE */
122, /* GL_CLEAR */
49, /* GL_AND */
51, /* GL_AND_REVERSE */
- 268, /* GL_COPY */
+ 284, /* GL_COPY */
50, /* GL_AND_INVERTED */
- 954, /* GL_NOOP */
- 1742, /* GL_XOR */
- 1016, /* GL_OR */
- 955, /* GL_NOR */
- 425, /* GL_EQUIV */
- 616, /* GL_INVERT */
- 1019, /* GL_OR_REVERSE */
- 269, /* GL_COPY_INVERTED */
- 1018, /* GL_OR_INVERTED */
- 945, /* GL_NAND */
- 1333, /* GL_SET */
- 422, /* GL_EMISSION */
- 1341, /* GL_SHININESS */
+ 999, /* GL_NOOP */
+ 1804, /* GL_XOR */
+ 1061, /* GL_OR */
+ 1000, /* GL_NOR */
+ 446, /* GL_EQUIV */
+ 660, /* GL_INVERT */
+ 1064, /* GL_OR_REVERSE */
+ 285, /* GL_COPY_INVERTED */
+ 1063, /* GL_OR_INVERTED */
+ 990, /* GL_NAND */
+ 1390, /* GL_SET */
+ 443, /* GL_EMISSION */
+ 1398, /* GL_SHININESS */
48, /* GL_AMBIENT_AND_DIFFUSE */
- 164, /* GL_COLOR_INDEXES */
- 895, /* GL_MODELVIEW */
- 1187, /* GL_PROJECTION */
- 1443, /* GL_TEXTURE */
+ 180, /* GL_COLOR_INDEXES */
+ 940, /* GL_MODELVIEW */
+ 1232, /* GL_PROJECTION */
+ 1502, /* GL_TEXTURE */
137, /* GL_COLOR */
- 312, /* GL_DEPTH */
- 1393, /* GL_STENCIL */
- 163, /* GL_COLOR_INDEX */
- 1411, /* GL_STENCIL_INDEX */
- 321, /* GL_DEPTH_COMPONENT */
- 1228, /* GL_RED */
- 546, /* GL_GREEN */
+ 328, /* GL_DEPTH */
+ 1451, /* GL_STENCIL */
+ 179, /* GL_COLOR_INDEX */
+ 1470, /* GL_STENCIL_INDEX */
+ 339, /* GL_DEPTH_COMPONENT */
+ 1274, /* GL_RED */
+ 588, /* GL_GREEN */
88, /* GL_BLUE */
31, /* GL_ALPHA */
- 1252, /* GL_RGB */
- 1271, /* GL_RGBA */
- 666, /* GL_LUMINANCE */
- 687, /* GL_LUMINANCE_ALPHA */
+ 1309, /* GL_RGB */
+ 1328, /* GL_RGBA */
+ 710, /* GL_LUMINANCE */
+ 731, /* GL_LUMINANCE_ALPHA */
72, /* GL_BITMAP */
- 1067, /* GL_POINT */
- 636, /* GL_LINE */
- 440, /* GL_FILL */
- 1237, /* GL_RENDER */
- 436, /* GL_FEEDBACK */
- 1327, /* GL_SELECT */
- 441, /* GL_FLAT */
- 1346, /* GL_SMOOTH */
- 617, /* GL_KEEP */
- 1246, /* GL_REPLACE */
- 573, /* GL_INCR */
- 308, /* GL_DECR */
- 1676, /* GL_VENDOR */
- 1243, /* GL_RENDERER */
- 1677, /* GL_VERSION */
- 429, /* GL_EXTENSIONS */
- 1292, /* GL_S */
- 1434, /* GL_T */
- 1218, /* GL_R */
- 1207, /* GL_Q */
- 931, /* GL_MODULATE */
- 307, /* GL_DECAL */
- 1579, /* GL_TEXTURE_ENV_MODE */
- 1578, /* GL_TEXTURE_ENV_COLOR */
- 1577, /* GL_TEXTURE_ENV */
- 430, /* GL_EYE_LINEAR */
- 978, /* GL_OBJECT_LINEAR */
- 1372, /* GL_SPHERE_MAP */
- 1581, /* GL_TEXTURE_GEN_MODE */
- 980, /* GL_OBJECT_PLANE */
- 431, /* GL_EYE_PLANE */
- 946, /* GL_NEAREST */
- 637, /* GL_LINEAR */
- 950, /* GL_NEAREST_MIPMAP_NEAREST */
- 642, /* GL_LINEAR_MIPMAP_NEAREST */
- 949, /* GL_NEAREST_MIPMAP_LINEAR */
- 641, /* GL_LINEAR_MIPMAP_LINEAR */
- 1602, /* GL_TEXTURE_MAG_FILTER */
- 1610, /* GL_TEXTURE_MIN_FILTER */
- 1623, /* GL_TEXTURE_WRAP_S */
- 1624, /* GL_TEXTURE_WRAP_T */
+ 1112, /* GL_POINT */
+ 680, /* GL_LINE */
+ 461, /* GL_FILL */
+ 1283, /* GL_RENDER */
+ 457, /* GL_FEEDBACK */
+ 1384, /* GL_SELECT */
+ 462, /* GL_FLAT */
+ 1403, /* GL_SMOOTH */
+ 661, /* GL_KEEP */
+ 1303, /* GL_REPLACE */
+ 615, /* GL_INCR */
+ 324, /* GL_DECR */
+ 1738, /* GL_VENDOR */
+ 1300, /* GL_RENDERER */
+ 1739, /* GL_VERSION */
+ 450, /* GL_EXTENSIONS */
+ 1349, /* GL_S */
+ 1493, /* GL_T */
+ 1263, /* GL_R */
+ 1252, /* GL_Q */
+ 976, /* GL_MODULATE */
+ 323, /* GL_DECAL */
+ 1638, /* GL_TEXTURE_ENV_MODE */
+ 1637, /* GL_TEXTURE_ENV_COLOR */
+ 1636, /* GL_TEXTURE_ENV */
+ 451, /* GL_EYE_LINEAR */
+ 1023, /* GL_OBJECT_LINEAR */
+ 1429, /* GL_SPHERE_MAP */
+ 1640, /* GL_TEXTURE_GEN_MODE */
+ 1025, /* GL_OBJECT_PLANE */
+ 452, /* GL_EYE_PLANE */
+ 991, /* GL_NEAREST */
+ 681, /* GL_LINEAR */
+ 995, /* GL_NEAREST_MIPMAP_NEAREST */
+ 686, /* GL_LINEAR_MIPMAP_NEAREST */
+ 994, /* GL_NEAREST_MIPMAP_LINEAR */
+ 685, /* GL_LINEAR_MIPMAP_LINEAR */
+ 1661, /* GL_TEXTURE_MAG_FILTER */
+ 1669, /* GL_TEXTURE_MIN_FILTER */
+ 1683, /* GL_TEXTURE_WRAP_S */
+ 1684, /* GL_TEXTURE_WRAP_T */
116, /* GL_CLAMP */
- 1245, /* GL_REPEAT */
- 1105, /* GL_POLYGON_OFFSET_UNITS */
- 1104, /* GL_POLYGON_OFFSET_POINT */
- 1103, /* GL_POLYGON_OFFSET_LINE */
- 1219, /* GL_R3_G3_B2 */
- 1673, /* GL_V2F */
- 1674, /* GL_V3F */
+ 1302, /* GL_REPEAT */
+ 1150, /* GL_POLYGON_OFFSET_UNITS */
+ 1149, /* GL_POLYGON_OFFSET_POINT */
+ 1148, /* GL_POLYGON_OFFSET_LINE */
+ 1264, /* GL_R3_G3_B2 */
+ 1735, /* GL_V2F */
+ 1736, /* GL_V3F */
113, /* GL_C4UB_V2F */
114, /* GL_C4UB_V3F */
111, /* GL_C3F_V3F */
- 943, /* GL_N3F_V3F */
+ 988, /* GL_N3F_V3F */
112, /* GL_C4F_N3F_V3F */
- 1439, /* GL_T2F_V3F */
- 1441, /* GL_T4F_V4F */
- 1437, /* GL_T2F_C4UB_V3F */
- 1435, /* GL_T2F_C3F_V3F */
- 1438, /* GL_T2F_N3F_V3F */
- 1436, /* GL_T2F_C4F_N3F_V3F */
- 1440, /* GL_T4F_C4F_N3F_V4F */
+ 1498, /* GL_T2F_V3F */
+ 1500, /* GL_T4F_V4F */
+ 1496, /* GL_T2F_C4UB_V3F */
+ 1494, /* GL_T2F_C3F_V3F */
+ 1497, /* GL_T2F_N3F_V3F */
+ 1495, /* GL_T2F_C4F_N3F_V3F */
+ 1499, /* GL_T4F_C4F_N3F_V4F */
129, /* GL_CLIP_PLANE0 */
130, /* GL_CLIP_PLANE1 */
131, /* GL_CLIP_PLANE2 */
132, /* GL_CLIP_PLANE3 */
133, /* GL_CLIP_PLANE4 */
134, /* GL_CLIP_PLANE5 */
- 621, /* GL_LIGHT0 */
- 622, /* GL_LIGHT1 */
- 623, /* GL_LIGHT2 */
- 624, /* GL_LIGHT3 */
- 625, /* GL_LIGHT4 */
- 626, /* GL_LIGHT5 */
- 627, /* GL_LIGHT6 */
- 628, /* GL_LIGHT7 */
- 550, /* GL_HINT_BIT */
- 246, /* GL_CONSTANT_COLOR */
- 990, /* GL_ONE_MINUS_CONSTANT_COLOR */
- 241, /* GL_CONSTANT_ALPHA */
- 988, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 665, /* GL_LIGHT0 */
+ 666, /* GL_LIGHT1 */
+ 667, /* GL_LIGHT2 */
+ 668, /* GL_LIGHT3 */
+ 669, /* GL_LIGHT4 */
+ 670, /* GL_LIGHT5 */
+ 671, /* GL_LIGHT6 */
+ 672, /* GL_LIGHT7 */
+ 592, /* GL_HINT_BIT */
+ 262, /* GL_CONSTANT_COLOR */
+ 1035, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 257, /* GL_CONSTANT_ALPHA */
+ 1033, /* GL_ONE_MINUS_CONSTANT_ALPHA */
75, /* GL_BLEND_COLOR */
- 510, /* GL_FUNC_ADD */
- 879, /* GL_MIN */
- 791, /* GL_MAX */
+ 552, /* GL_FUNC_ADD */
+ 924, /* GL_MIN */
+ 835, /* GL_MAX */
80, /* GL_BLEND_EQUATION */
- 514, /* GL_FUNC_SUBTRACT */
- 512, /* GL_FUNC_REVERSE_SUBTRACT */
- 249, /* GL_CONVOLUTION_1D */
- 250, /* GL_CONVOLUTION_2D */
- 1330, /* GL_SEPARABLE_2D */
- 253, /* GL_CONVOLUTION_BORDER_MODE */
- 257, /* GL_CONVOLUTION_FILTER_SCALE */
- 255, /* GL_CONVOLUTION_FILTER_BIAS */
- 1229, /* GL_REDUCE */
- 259, /* GL_CONVOLUTION_FORMAT */
- 263, /* GL_CONVOLUTION_WIDTH */
- 261, /* GL_CONVOLUTION_HEIGHT */
- 806, /* GL_MAX_CONVOLUTION_WIDTH */
- 804, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1144, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1140, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1135, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1131, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1142, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1138, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1133, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1129, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 551, /* GL_HISTOGRAM */
- 1191, /* GL_PROXY_HISTOGRAM */
- 567, /* GL_HISTOGRAM_WIDTH */
- 557, /* GL_HISTOGRAM_FORMAT */
- 563, /* GL_HISTOGRAM_RED_SIZE */
- 559, /* GL_HISTOGRAM_GREEN_SIZE */
- 554, /* GL_HISTOGRAM_BLUE_SIZE */
- 552, /* GL_HISTOGRAM_ALPHA_SIZE */
- 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 565, /* GL_HISTOGRAM_SINK */
- 880, /* GL_MINMAX */
- 882, /* GL_MINMAX_FORMAT */
- 884, /* GL_MINMAX_SINK */
- 1442, /* GL_TABLE_TOO_LARGE_EXT */
- 1654, /* GL_UNSIGNED_BYTE_3_3_2 */
- 1663, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 1665, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 1659, /* GL_UNSIGNED_INT_8_8_8_8 */
- 1656, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1102, /* GL_POLYGON_OFFSET_FILL */
- 1101, /* GL_POLYGON_OFFSET_FACTOR */
- 1100, /* GL_POLYGON_OFFSET_BIAS */
- 1249, /* GL_RESCALE_NORMAL */
+ 556, /* GL_FUNC_SUBTRACT */
+ 554, /* GL_FUNC_REVERSE_SUBTRACT */
+ 265, /* GL_CONVOLUTION_1D */
+ 266, /* GL_CONVOLUTION_2D */
+ 1387, /* GL_SEPARABLE_2D */
+ 269, /* GL_CONVOLUTION_BORDER_MODE */
+ 273, /* GL_CONVOLUTION_FILTER_SCALE */
+ 271, /* GL_CONVOLUTION_FILTER_BIAS */
+ 1275, /* GL_REDUCE */
+ 275, /* GL_CONVOLUTION_FORMAT */
+ 279, /* GL_CONVOLUTION_WIDTH */
+ 277, /* GL_CONVOLUTION_HEIGHT */
+ 850, /* GL_MAX_CONVOLUTION_WIDTH */
+ 848, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1189, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1185, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1180, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1176, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1187, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1183, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1178, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1174, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 593, /* GL_HISTOGRAM */
+ 1236, /* GL_PROXY_HISTOGRAM */
+ 609, /* GL_HISTOGRAM_WIDTH */
+ 599, /* GL_HISTOGRAM_FORMAT */
+ 605, /* GL_HISTOGRAM_RED_SIZE */
+ 601, /* GL_HISTOGRAM_GREEN_SIZE */
+ 596, /* GL_HISTOGRAM_BLUE_SIZE */
+ 594, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 603, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 607, /* GL_HISTOGRAM_SINK */
+ 925, /* GL_MINMAX */
+ 927, /* GL_MINMAX_FORMAT */
+ 929, /* GL_MINMAX_SINK */
+ 1501, /* GL_TABLE_TOO_LARGE_EXT */
+ 1714, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 1725, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 1727, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 1720, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 1716, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1147, /* GL_POLYGON_OFFSET_FILL */
+ 1146, /* GL_POLYGON_OFFSET_FACTOR */
+ 1145, /* GL_POLYGON_OFFSET_BIAS */
+ 1306, /* GL_RESCALE_NORMAL */
36, /* GL_ALPHA4 */
38, /* GL_ALPHA8 */
32, /* GL_ALPHA12 */
34, /* GL_ALPHA16 */
- 677, /* GL_LUMINANCE4 */
- 683, /* GL_LUMINANCE8 */
- 667, /* GL_LUMINANCE12 */
- 673, /* GL_LUMINANCE16 */
- 678, /* GL_LUMINANCE4_ALPHA4 */
- 681, /* GL_LUMINANCE6_ALPHA2 */
- 684, /* GL_LUMINANCE8_ALPHA8 */
- 670, /* GL_LUMINANCE12_ALPHA4 */
- 668, /* GL_LUMINANCE12_ALPHA12 */
- 674, /* GL_LUMINANCE16_ALPHA16 */
- 591, /* GL_INTENSITY */
- 596, /* GL_INTENSITY4 */
- 598, /* GL_INTENSITY8 */
- 592, /* GL_INTENSITY12 */
- 594, /* GL_INTENSITY16 */
- 1261, /* GL_RGB2_EXT */
- 1262, /* GL_RGB4 */
- 1265, /* GL_RGB5 */
- 1269, /* GL_RGB8 */
- 1253, /* GL_RGB10 */
- 1257, /* GL_RGB12 */
- 1259, /* GL_RGB16 */
- 1276, /* GL_RGBA2 */
- 1278, /* GL_RGBA4 */
- 1266, /* GL_RGB5_A1 */
- 1282, /* GL_RGBA8 */
- 1254, /* GL_RGB10_A2 */
- 1272, /* GL_RGBA12 */
- 1274, /* GL_RGBA16 */
- 1615, /* GL_TEXTURE_RED_SIZE */
- 1587, /* GL_TEXTURE_GREEN_SIZE */
- 1526, /* GL_TEXTURE_BLUE_SIZE */
- 1513, /* GL_TEXTURE_ALPHA_SIZE */
- 1600, /* GL_TEXTURE_LUMINANCE_SIZE */
- 1591, /* GL_TEXTURE_INTENSITY_SIZE */
- 1247, /* GL_REPLACE_EXT */
- 1195, /* GL_PROXY_TEXTURE_1D */
- 1198, /* GL_PROXY_TEXTURE_2D */
- 1619, /* GL_TEXTURE_TOO_LARGE_EXT */
- 1612, /* GL_TEXTURE_PRIORITY */
- 1617, /* GL_TEXTURE_RESIDENT */
- 1516, /* GL_TEXTURE_BINDING_1D */
- 1518, /* GL_TEXTURE_BINDING_2D */
- 1520, /* GL_TEXTURE_BINDING_3D */
- 1026, /* GL_PACK_SKIP_IMAGES */
- 1022, /* GL_PACK_IMAGE_HEIGHT */
- 1648, /* GL_UNPACK_SKIP_IMAGES */
- 1645, /* GL_UNPACK_IMAGE_HEIGHT */
- 1512, /* GL_TEXTURE_3D */
- 1201, /* GL_PROXY_TEXTURE_3D */
- 1574, /* GL_TEXTURE_DEPTH */
- 1622, /* GL_TEXTURE_WRAP_R */
- 792, /* GL_MAX_3D_TEXTURE_SIZE */
- 1678, /* GL_VERTEX_ARRAY */
- 957, /* GL_NORMAL_ARRAY */
+ 721, /* GL_LUMINANCE4 */
+ 727, /* GL_LUMINANCE8 */
+ 711, /* GL_LUMINANCE12 */
+ 717, /* GL_LUMINANCE16 */
+ 722, /* GL_LUMINANCE4_ALPHA4 */
+ 725, /* GL_LUMINANCE6_ALPHA2 */
+ 728, /* GL_LUMINANCE8_ALPHA8 */
+ 714, /* GL_LUMINANCE12_ALPHA4 */
+ 712, /* GL_LUMINANCE12_ALPHA12 */
+ 718, /* GL_LUMINANCE16_ALPHA16 */
+ 634, /* GL_INTENSITY */
+ 639, /* GL_INTENSITY4 */
+ 641, /* GL_INTENSITY8 */
+ 635, /* GL_INTENSITY12 */
+ 637, /* GL_INTENSITY16 */
+ 1318, /* GL_RGB2_EXT */
+ 1319, /* GL_RGB4 */
+ 1322, /* GL_RGB5 */
+ 1326, /* GL_RGB8 */
+ 1310, /* GL_RGB10 */
+ 1314, /* GL_RGB12 */
+ 1316, /* GL_RGB16 */
+ 1333, /* GL_RGBA2 */
+ 1335, /* GL_RGBA4 */
+ 1323, /* GL_RGB5_A1 */
+ 1339, /* GL_RGBA8 */
+ 1311, /* GL_RGB10_A2 */
+ 1329, /* GL_RGBA12 */
+ 1331, /* GL_RGBA16 */
+ 1674, /* GL_TEXTURE_RED_SIZE */
+ 1646, /* GL_TEXTURE_GREEN_SIZE */
+ 1585, /* GL_TEXTURE_BLUE_SIZE */
+ 1572, /* GL_TEXTURE_ALPHA_SIZE */
+ 1659, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 1650, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1304, /* GL_REPLACE_EXT */
+ 1240, /* GL_PROXY_TEXTURE_1D */
+ 1243, /* GL_PROXY_TEXTURE_2D */
+ 1679, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 1671, /* GL_TEXTURE_PRIORITY */
+ 1676, /* GL_TEXTURE_RESIDENT */
+ 1575, /* GL_TEXTURE_BINDING_1D */
+ 1577, /* GL_TEXTURE_BINDING_2D */
+ 1579, /* GL_TEXTURE_BINDING_3D */
+ 1071, /* GL_PACK_SKIP_IMAGES */
+ 1067, /* GL_PACK_IMAGE_HEIGHT */
+ 1708, /* GL_UNPACK_SKIP_IMAGES */
+ 1705, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1571, /* GL_TEXTURE_3D */
+ 1246, /* GL_PROXY_TEXTURE_3D */
+ 1633, /* GL_TEXTURE_DEPTH */
+ 1682, /* GL_TEXTURE_WRAP_R */
+ 836, /* GL_MAX_3D_TEXTURE_SIZE */
+ 1740, /* GL_VERTEX_ARRAY */
+ 1002, /* GL_NORMAL_ARRAY */
138, /* GL_COLOR_ARRAY */
- 576, /* GL_INDEX_ARRAY */
- 1553, /* GL_TEXTURE_COORD_ARRAY */
- 414, /* GL_EDGE_FLAG_ARRAY */
- 1683, /* GL_VERTEX_ARRAY_SIZE */
- 1685, /* GL_VERTEX_ARRAY_TYPE */
- 1684, /* GL_VERTEX_ARRAY_STRIDE */
- 962, /* GL_NORMAL_ARRAY_TYPE */
- 961, /* GL_NORMAL_ARRAY_STRIDE */
+ 619, /* GL_INDEX_ARRAY */
+ 1612, /* GL_TEXTURE_COORD_ARRAY */
+ 435, /* GL_EDGE_FLAG_ARRAY */
+ 1745, /* GL_VERTEX_ARRAY_SIZE */
+ 1747, /* GL_VERTEX_ARRAY_TYPE */
+ 1746, /* GL_VERTEX_ARRAY_STRIDE */
+ 1007, /* GL_NORMAL_ARRAY_TYPE */
+ 1006, /* GL_NORMAL_ARRAY_STRIDE */
142, /* GL_COLOR_ARRAY_SIZE */
144, /* GL_COLOR_ARRAY_TYPE */
143, /* GL_COLOR_ARRAY_STRIDE */
- 581, /* GL_INDEX_ARRAY_TYPE */
- 580, /* GL_INDEX_ARRAY_STRIDE */
- 1557, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 1559, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 1558, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 1682, /* GL_VERTEX_ARRAY_POINTER */
- 960, /* GL_NORMAL_ARRAY_POINTER */
+ 624, /* GL_INDEX_ARRAY_TYPE */
+ 623, /* GL_INDEX_ARRAY_STRIDE */
+ 1616, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 1618, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 1617, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 439, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ 1744, /* GL_VERTEX_ARRAY_POINTER */
+ 1005, /* GL_NORMAL_ARRAY_POINTER */
141, /* GL_COLOR_ARRAY_POINTER */
- 579, /* GL_INDEX_ARRAY_POINTER */
- 1556, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- 417, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 936, /* GL_MULTISAMPLE */
- 1304, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1306, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1311, /* GL_SAMPLE_COVERAGE */
- 1308, /* GL_SAMPLE_BUFFERS */
- 1299, /* GL_SAMPLES */
- 1315, /* GL_SAMPLE_COVERAGE_VALUE */
- 1313, /* GL_SAMPLE_COVERAGE_INVERT */
- 169, /* GL_COLOR_MATRIX */
- 171, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 800, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1127, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1123, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1118, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1114, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1125, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1121, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1116, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1112, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 1536, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1202, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 1538, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 622, /* GL_INDEX_ARRAY_POINTER */
+ 1615, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 438, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ 981, /* GL_MULTISAMPLE */
+ 1361, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1363, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1368, /* GL_SAMPLE_COVERAGE */
+ 1365, /* GL_SAMPLE_BUFFERS */
+ 1356, /* GL_SAMPLES */
+ 1372, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1370, /* GL_SAMPLE_COVERAGE_INVERT */
+ 185, /* GL_COLOR_MATRIX */
+ 187, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ 844, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1172, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1168, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1163, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1159, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1170, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1166, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1161, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1157, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 1595, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1247, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 1597, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
79, /* GL_BLEND_DST_RGB */
87, /* GL_BLEND_SRC_RGB */
78, /* GL_BLEND_DST_ALPHA */
86, /* GL_BLEND_SRC_ALPHA */
- 175, /* GL_COLOR_TABLE */
- 1137, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1120, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1190, /* GL_PROXY_COLOR_TABLE */
- 1194, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1193, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- 199, /* GL_COLOR_TABLE_SCALE */
- 179, /* GL_COLOR_TABLE_BIAS */
- 184, /* GL_COLOR_TABLE_FORMAT */
- 201, /* GL_COLOR_TABLE_WIDTH */
- 196, /* GL_COLOR_TABLE_RED_SIZE */
- 187, /* GL_COLOR_TABLE_GREEN_SIZE */
- 181, /* GL_COLOR_TABLE_BLUE_SIZE */
- 176, /* GL_COLOR_TABLE_ALPHA_SIZE */
- 193, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- 190, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ 191, /* GL_COLOR_TABLE */
+ 1182, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1165, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1235, /* GL_PROXY_COLOR_TABLE */
+ 1239, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1238, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 215, /* GL_COLOR_TABLE_SCALE */
+ 195, /* GL_COLOR_TABLE_BIAS */
+ 200, /* GL_COLOR_TABLE_FORMAT */
+ 217, /* GL_COLOR_TABLE_WIDTH */
+ 212, /* GL_COLOR_TABLE_RED_SIZE */
+ 203, /* GL_COLOR_TABLE_GREEN_SIZE */
+ 197, /* GL_COLOR_TABLE_BLUE_SIZE */
+ 192, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ 209, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ 206, /* GL_COLOR_TABLE_INTENSITY_SIZE */
70, /* GL_BGR */
71, /* GL_BGRA */
- 814, /* GL_MAX_ELEMENTS_VERTICES */
- 813, /* GL_MAX_ELEMENTS_INDICES */
- 1590, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 858, /* GL_MAX_ELEMENTS_VERTICES */
+ 857, /* GL_MAX_ELEMENTS_INDICES */
+ 1649, /* GL_TEXTURE_INDEX_SIZE_EXT */
135, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1084, /* GL_POINT_SIZE_MIN */
- 1080, /* GL_POINT_SIZE_MAX */
- 1074, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 1070, /* GL_POINT_DISTANCE_ATTENUATION */
+ 1129, /* GL_POINT_SIZE_MIN */
+ 1125, /* GL_POINT_SIZE_MAX */
+ 1119, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1115, /* GL_POINT_DISTANCE_ATTENUATION */
117, /* GL_CLAMP_TO_BORDER */
120, /* GL_CLAMP_TO_EDGE */
- 1611, /* GL_TEXTURE_MIN_LOD */
- 1609, /* GL_TEXTURE_MAX_LOD */
- 1515, /* GL_TEXTURE_BASE_LEVEL */
- 1608, /* GL_TEXTURE_MAX_LEVEL */
- 570, /* GL_IGNORE_BORDER_HP */
- 245, /* GL_CONSTANT_BORDER_HP */
- 1248, /* GL_REPLICATE_BORDER_HP */
- 251, /* GL_CONVOLUTION_BORDER_COLOR */
- 985, /* GL_OCCLUSION_TEST_HP */
- 986, /* GL_OCCLUSION_TEST_RESULT_HP */
- 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 1530, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 1532, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 1534, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 1535, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1533, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 1531, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 796, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 797, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1147, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1149, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1146, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1148, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 1598, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 1599, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 1597, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- 516, /* GL_GENERATE_MIPMAP */
- 517, /* GL_GENERATE_MIPMAP_HINT */
- 479, /* GL_FOG_OFFSET_SGIX */
- 480, /* GL_FOG_OFFSET_VALUE_SGIX */
- 1544, /* GL_TEXTURE_COMPARE_SGIX */
- 1543, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 1594, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 1586, /* GL_TEXTURE_GEQUAL_R_SGIX */
- 322, /* GL_DEPTH_COMPONENT16 */
- 325, /* GL_DEPTH_COMPONENT24 */
- 328, /* GL_DEPTH_COMPONENT32 */
- 273, /* GL_CULL_VERTEX_EXT */
- 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 1739, /* GL_WRAP_BORDER_SUN */
- 1537, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1343, /* GL_SINGLE_COLOR */
- 1331, /* GL_SEPARATE_SPECULAR_COLOR */
- 1340, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 1653, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 1666, /* GL_UNSIGNED_SHORT_5_6_5 */
- 1667, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 1664, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 1662, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 1660, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 1658, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 1606, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 1607, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 1605, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 887, /* GL_MIRRORED_REPEAT */
- 1287, /* GL_RGB_S3TC */
- 1264, /* GL_RGB4_S3TC */
- 1286, /* GL_RGBA_S3TC */
- 1281, /* GL_RGBA4_S3TC */
- 1284, /* GL_RGBA_DXT5_S3TC */
- 1279, /* GL_RGBA4_DXT5_S3TC */
- 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 948, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 947, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- 466, /* GL_FOG_COORDINATE_SOURCE */
- 458, /* GL_FOG_COORD */
- 482, /* GL_FRAGMENT_DEPTH */
- 279, /* GL_CURRENT_FOG_COORD */
- 465, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- 464, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- 463, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- 460, /* GL_FOG_COORDINATE_ARRAY */
- 173, /* GL_COLOR_SUM */
- 298, /* GL_CURRENT_SECONDARY_COLOR */
- 1324, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1326, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1325, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1323, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1320, /* GL_SECONDARY_COLOR_ARRAY */
- 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ 1670, /* GL_TEXTURE_MIN_LOD */
+ 1668, /* GL_TEXTURE_MAX_LOD */
+ 1574, /* GL_TEXTURE_BASE_LEVEL */
+ 1667, /* GL_TEXTURE_MAX_LEVEL */
+ 612, /* GL_IGNORE_BORDER_HP */
+ 261, /* GL_CONSTANT_BORDER_HP */
+ 1305, /* GL_REPLICATE_BORDER_HP */
+ 267, /* GL_CONVOLUTION_BORDER_COLOR */
+ 1030, /* GL_OCCLUSION_TEST_HP */
+ 1031, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 683, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 1589, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 1591, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 1593, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 1594, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1592, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 1590, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 840, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 841, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1192, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1194, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1191, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1193, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 1657, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 1658, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 1656, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 558, /* GL_GENERATE_MIPMAP */
+ 559, /* GL_GENERATE_MIPMAP_HINT */
+ 500, /* GL_FOG_OFFSET_SGIX */
+ 501, /* GL_FOG_OFFSET_VALUE_SGIX */
+ 1603, /* GL_TEXTURE_COMPARE_SGIX */
+ 1602, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 1653, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 1645, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 340, /* GL_DEPTH_COMPONENT16 */
+ 343, /* GL_DEPTH_COMPONENT24 */
+ 346, /* GL_DEPTH_COMPONENT32 */
+ 289, /* GL_CULL_VERTEX_EXT */
+ 291, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ 290, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ 1801, /* GL_WRAP_BORDER_SUN */
+ 1596, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 676, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1400, /* GL_SINGLE_COLOR */
+ 1388, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1397, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 511, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ 512, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ 519, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ 514, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ 510, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ 509, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ 513, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ 520, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ 531, /* GL_FRAMEBUFFER_DEFAULT */
+ 544, /* GL_FRAMEBUFFER_UNDEFINED */
+ 353, /* GL_DEPTH_STENCIL_ATTACHMENT */
+ 618, /* GL_INDEX */
+ 1713, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 1728, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 1729, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 1726, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 1724, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 1721, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 1719, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 1665, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 1666, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 1664, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 932, /* GL_MIRRORED_REPEAT */
+ 1344, /* GL_RGB_S3TC */
+ 1321, /* GL_RGB4_S3TC */
+ 1343, /* GL_RGBA_S3TC */
+ 1338, /* GL_RGBA4_S3TC */
+ 1341, /* GL_RGBA_DXT5_S3TC */
+ 1336, /* GL_RGBA4_DXT5_S3TC */
+ 254, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ 249, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ 250, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ 251, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ 993, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 992, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 684, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 487, /* GL_FOG_COORDINATE_SOURCE */
+ 479, /* GL_FOG_COORD */
+ 503, /* GL_FRAGMENT_DEPTH */
+ 295, /* GL_CURRENT_FOG_COORD */
+ 486, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ 485, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ 484, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ 481, /* GL_FOG_COORDINATE_ARRAY */
+ 189, /* GL_COLOR_SUM */
+ 314, /* GL_CURRENT_SECONDARY_COLOR */
+ 1381, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1383, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1382, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1380, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1377, /* GL_SECONDARY_COLOR_ARRAY */
+ 568, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
28, /* GL_ALIASED_POINT_SIZE_RANGE */
27, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1444, /* GL_TEXTURE0 */
- 1446, /* GL_TEXTURE1 */
- 1468, /* GL_TEXTURE2 */
- 1490, /* GL_TEXTURE3 */
- 1496, /* GL_TEXTURE4 */
- 1498, /* GL_TEXTURE5 */
- 1500, /* GL_TEXTURE6 */
- 1502, /* GL_TEXTURE7 */
- 1504, /* GL_TEXTURE8 */
- 1506, /* GL_TEXTURE9 */
- 1447, /* GL_TEXTURE10 */
- 1449, /* GL_TEXTURE11 */
- 1451, /* GL_TEXTURE12 */
- 1453, /* GL_TEXTURE13 */
- 1455, /* GL_TEXTURE14 */
- 1457, /* GL_TEXTURE15 */
- 1459, /* GL_TEXTURE16 */
- 1461, /* GL_TEXTURE17 */
- 1463, /* GL_TEXTURE18 */
- 1465, /* GL_TEXTURE19 */
- 1469, /* GL_TEXTURE20 */
- 1471, /* GL_TEXTURE21 */
- 1473, /* GL_TEXTURE22 */
- 1475, /* GL_TEXTURE23 */
- 1477, /* GL_TEXTURE24 */
- 1479, /* GL_TEXTURE25 */
- 1481, /* GL_TEXTURE26 */
- 1483, /* GL_TEXTURE27 */
- 1485, /* GL_TEXTURE28 */
- 1487, /* GL_TEXTURE29 */
- 1491, /* GL_TEXTURE30 */
- 1493, /* GL_TEXTURE31 */
+ 1503, /* GL_TEXTURE0 */
+ 1505, /* GL_TEXTURE1 */
+ 1527, /* GL_TEXTURE2 */
+ 1549, /* GL_TEXTURE3 */
+ 1555, /* GL_TEXTURE4 */
+ 1557, /* GL_TEXTURE5 */
+ 1559, /* GL_TEXTURE6 */
+ 1561, /* GL_TEXTURE7 */
+ 1563, /* GL_TEXTURE8 */
+ 1565, /* GL_TEXTURE9 */
+ 1506, /* GL_TEXTURE10 */
+ 1508, /* GL_TEXTURE11 */
+ 1510, /* GL_TEXTURE12 */
+ 1512, /* GL_TEXTURE13 */
+ 1514, /* GL_TEXTURE14 */
+ 1516, /* GL_TEXTURE15 */
+ 1518, /* GL_TEXTURE16 */
+ 1520, /* GL_TEXTURE17 */
+ 1522, /* GL_TEXTURE18 */
+ 1524, /* GL_TEXTURE19 */
+ 1528, /* GL_TEXTURE20 */
+ 1530, /* GL_TEXTURE21 */
+ 1532, /* GL_TEXTURE22 */
+ 1534, /* GL_TEXTURE23 */
+ 1536, /* GL_TEXTURE24 */
+ 1538, /* GL_TEXTURE25 */
+ 1540, /* GL_TEXTURE26 */
+ 1542, /* GL_TEXTURE27 */
+ 1544, /* GL_TEXTURE28 */
+ 1546, /* GL_TEXTURE29 */
+ 1550, /* GL_TEXTURE30 */
+ 1552, /* GL_TEXTURE31 */
18, /* GL_ACTIVE_TEXTURE */
123, /* GL_CLIENT_ACTIVE_TEXTURE */
- 865, /* GL_MAX_TEXTURE_UNITS */
- 1632, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 1635, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 1637, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 1629, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1432, /* GL_SUBTRACT */
- 854, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- 221, /* GL_COMPRESSED_ALPHA */
- 225, /* GL_COMPRESSED_LUMINANCE */
- 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- 223, /* GL_COMPRESSED_INTENSITY */
- 229, /* GL_COMPRESSED_RGB */
- 230, /* GL_COMPRESSED_RGBA */
- 1551, /* GL_TEXTURE_COMPRESSION_HINT */
- 1613, /* GL_TEXTURE_RECTANGLE_ARB */
- 1523, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- 1205, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- 852, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- 334, /* GL_DEPTH_STENCIL_NV */
- 1657, /* GL_UNSIGNED_INT_24_8_NV */
- 861, /* GL_MAX_TEXTURE_LOD_BIAS */
- 1604, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 862, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 1580, /* GL_TEXTURE_FILTER_CONTROL */
- 1595, /* GL_TEXTURE_LOD_BIAS */
- 206, /* GL_COMBINE4 */
- 855, /* GL_MAX_SHININESS_NV */
- 856, /* GL_MAX_SPOT_EXPONENT_NV */
- 574, /* GL_INCR_WRAP */
- 309, /* GL_DECR_WRAP */
- 907, /* GL_MODELVIEW1_ARB */
- 963, /* GL_NORMAL_MAP */
- 1234, /* GL_REFLECTION_MAP */
- 1560, /* GL_TEXTURE_CUBE_MAP */
- 1521, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 1568, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 1562, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 1570, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 1564, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 1572, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 1566, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1203, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 808, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 942, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 474, /* GL_FOG_DISTANCE_MODE_NV */
- 433, /* GL_EYE_RADIAL_NV */
- 432, /* GL_EYE_PLANE_ABSOLUTE_NV */
- 205, /* GL_COMBINE */
- 212, /* GL_COMBINE_RGB */
- 207, /* GL_COMBINE_ALPHA */
- 1288, /* GL_RGB_SCALE */
+ 910, /* GL_MAX_TEXTURE_UNITS */
+ 1692, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 1695, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 1697, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 1689, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1491, /* GL_SUBTRACT */
+ 898, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ 237, /* GL_COMPRESSED_ALPHA */
+ 241, /* GL_COMPRESSED_LUMINANCE */
+ 242, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ 239, /* GL_COMPRESSED_INTENSITY */
+ 245, /* GL_COMPRESSED_RGB */
+ 246, /* GL_COMPRESSED_RGBA */
+ 1610, /* GL_TEXTURE_COMPRESSION_HINT */
+ 1672, /* GL_TEXTURE_RECTANGLE_ARB */
+ 1582, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ 1250, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ 896, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ 352, /* GL_DEPTH_STENCIL */
+ 1717, /* GL_UNSIGNED_INT_24_8 */
+ 906, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 1663, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 907, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1639, /* GL_TEXTURE_FILTER_CONTROL */
+ 1654, /* GL_TEXTURE_LOD_BIAS */
+ 222, /* GL_COMBINE4 */
+ 900, /* GL_MAX_SHININESS_NV */
+ 901, /* GL_MAX_SPOT_EXPONENT_NV */
+ 616, /* GL_INCR_WRAP */
+ 325, /* GL_DECR_WRAP */
+ 952, /* GL_MODELVIEW1_ARB */
+ 1008, /* GL_NORMAL_MAP */
+ 1280, /* GL_REFLECTION_MAP */
+ 1619, /* GL_TEXTURE_CUBE_MAP */
+ 1580, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 1627, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 1621, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 1629, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 1623, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 1631, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 1625, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1248, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 852, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 987, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 495, /* GL_FOG_DISTANCE_MODE_NV */
+ 454, /* GL_EYE_RADIAL_NV */
+ 453, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ 221, /* GL_COMBINE */
+ 228, /* GL_COMBINE_RGB */
+ 223, /* GL_COMBINE_ALPHA */
+ 1345, /* GL_RGB_SCALE */
24, /* GL_ADD_SIGNED */
- 601, /* GL_INTERPOLATE */
- 240, /* GL_CONSTANT */
- 1153, /* GL_PRIMARY_COLOR */
- 1150, /* GL_PREVIOUS */
- 1354, /* GL_SOURCE0_RGB */
- 1360, /* GL_SOURCE1_RGB */
- 1366, /* GL_SOURCE2_RGB */
- 1370, /* GL_SOURCE3_RGB_NV */
- 1351, /* GL_SOURCE0_ALPHA */
- 1357, /* GL_SOURCE1_ALPHA */
- 1363, /* GL_SOURCE2_ALPHA */
- 1369, /* GL_SOURCE3_ALPHA_NV */
- 999, /* GL_OPERAND0_RGB */
- 1005, /* GL_OPERAND1_RGB */
- 1011, /* GL_OPERAND2_RGB */
- 1015, /* GL_OPERAND3_RGB_NV */
- 996, /* GL_OPERAND0_ALPHA */
- 1002, /* GL_OPERAND1_ALPHA */
- 1008, /* GL_OPERAND2_ALPHA */
- 1014, /* GL_OPERAND3_ALPHA_NV */
- 1679, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- 1743, /* GL_YCBCR_422_APPLE */
- 1668, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 1670, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 1345, /* GL_SLICE_ACCUM_SUN */
- 1210, /* GL_QUAD_MESH_SUN */
- 1641, /* GL_TRIANGLE_MESH_SUN */
- 1717, /* GL_VERTEX_PROGRAM_ARB */
- 1728, /* GL_VERTEX_STATE_PROGRAM_NV */
- 1704, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- 1710, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- 1712, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- 1714, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- 300, /* GL_CURRENT_VERTEX_ATTRIB */
- 1166, /* GL_PROGRAM_LENGTH_ARB */
- 1180, /* GL_PROGRAM_STRING_ARB */
- 929, /* GL_MODELVIEW_PROJECTION_NV */
- 569, /* GL_IDENTITY_NV */
- 614, /* GL_INVERSE_NV */
- 1634, /* GL_TRANSPOSE_NV */
- 615, /* GL_INVERSE_TRANSPOSE_NV */
- 838, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 837, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 745, /* GL_MATRIX0_NV */
- 757, /* GL_MATRIX1_NV */
- 769, /* GL_MATRIX2_NV */
- 773, /* GL_MATRIX3_NV */
- 775, /* GL_MATRIX4_NV */
- 777, /* GL_MATRIX5_NV */
- 779, /* GL_MATRIX6_NV */
- 781, /* GL_MATRIX7_NV */
- 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- 282, /* GL_CURRENT_MATRIX_ARB */
- 1720, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- 1723, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- 1178, /* GL_PROGRAM_PARAMETER_NV */
- 1708, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- 1182, /* GL_PROGRAM_TARGET_NV */
- 1179, /* GL_PROGRAM_RESIDENT_NV */
- 1626, /* GL_TRACK_MATRIX_NV */
- 1627, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 1718, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1160, /* GL_PROGRAM_ERROR_POSITION_ARB */
- 319, /* GL_DEPTH_CLAMP_NV */
- 1686, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 1693, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 1694, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 1695, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 1696, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 1697, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 1698, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 1699, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 1700, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 1701, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 1687, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 1688, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 1689, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 1690, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 1691, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 1692, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1159, /* GL_PROGRAM_BINDING_ARB */
- 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 1549, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 1546, /* GL_TEXTURE_COMPRESSED */
- 968, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- 239, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 877, /* GL_MAX_VERTEX_UNITS_ARB */
+ 644, /* GL_INTERPOLATE */
+ 256, /* GL_CONSTANT */
+ 1198, /* GL_PRIMARY_COLOR */
+ 1195, /* GL_PREVIOUS */
+ 1411, /* GL_SOURCE0_RGB */
+ 1417, /* GL_SOURCE1_RGB */
+ 1423, /* GL_SOURCE2_RGB */
+ 1427, /* GL_SOURCE3_RGB_NV */
+ 1408, /* GL_SOURCE0_ALPHA */
+ 1414, /* GL_SOURCE1_ALPHA */
+ 1420, /* GL_SOURCE2_ALPHA */
+ 1426, /* GL_SOURCE3_ALPHA_NV */
+ 1044, /* GL_OPERAND0_RGB */
+ 1050, /* GL_OPERAND1_RGB */
+ 1056, /* GL_OPERAND2_RGB */
+ 1060, /* GL_OPERAND3_RGB_NV */
+ 1041, /* GL_OPERAND0_ALPHA */
+ 1047, /* GL_OPERAND1_ALPHA */
+ 1053, /* GL_OPERAND2_ALPHA */
+ 1059, /* GL_OPERAND3_ALPHA_NV */
+ 1741, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ 1805, /* GL_YCBCR_422_APPLE */
+ 1730, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 1732, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 1402, /* GL_SLICE_ACCUM_SUN */
+ 1255, /* GL_QUAD_MESH_SUN */
+ 1701, /* GL_TRIANGLE_MESH_SUN */
+ 1779, /* GL_VERTEX_PROGRAM_ARB */
+ 1790, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 1766, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 1772, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 1774, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 1776, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 316, /* GL_CURRENT_VERTEX_ATTRIB */
+ 1211, /* GL_PROGRAM_LENGTH_ARB */
+ 1225, /* GL_PROGRAM_STRING_ARB */
+ 974, /* GL_MODELVIEW_PROJECTION_NV */
+ 611, /* GL_IDENTITY_NV */
+ 658, /* GL_INVERSE_NV */
+ 1694, /* GL_TRANSPOSE_NV */
+ 659, /* GL_INVERSE_TRANSPOSE_NV */
+ 882, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 881, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 789, /* GL_MATRIX0_NV */
+ 801, /* GL_MATRIX1_NV */
+ 813, /* GL_MATRIX2_NV */
+ 817, /* GL_MATRIX3_NV */
+ 819, /* GL_MATRIX4_NV */
+ 821, /* GL_MATRIX5_NV */
+ 823, /* GL_MATRIX6_NV */
+ 825, /* GL_MATRIX7_NV */
+ 301, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ 298, /* GL_CURRENT_MATRIX_ARB */
+ 1782, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ 1785, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1223, /* GL_PROGRAM_PARAMETER_NV */
+ 1770, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1227, /* GL_PROGRAM_TARGET_NV */
+ 1224, /* GL_PROGRAM_RESIDENT_NV */
+ 1686, /* GL_TRACK_MATRIX_NV */
+ 1687, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 1780, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1205, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 337, /* GL_DEPTH_CLAMP_NV */
+ 1748, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 1755, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 1756, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 1757, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 1758, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 1759, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 1760, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 1761, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 1762, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 1763, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 1749, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 1750, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 1751, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 1752, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 1753, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 1754, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 743, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 750, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 751, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 752, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 753, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 754, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 755, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 756, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 757, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 758, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 744, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 745, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 746, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 747, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 748, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 749, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 770, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 777, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 778, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 779, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 780, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 781, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 782, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1204, /* GL_PROGRAM_BINDING_ARB */
+ 784, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 785, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 771, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 772, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 773, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 774, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 775, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 776, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 1608, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 1605, /* GL_TEXTURE_COMPRESSED */
+ 1013, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 255, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ 922, /* GL_MAX_VERTEX_UNITS_ARB */
22, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 1738, /* GL_WEIGHT_SUM_UNITY_ARB */
- 1716, /* GL_VERTEX_BLEND_ARB */
- 302, /* GL_CURRENT_WEIGHT_ARB */
- 1737, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 1736, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 1735, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 1734, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 1731, /* GL_WEIGHT_ARRAY_ARB */
- 345, /* GL_DOT3_RGB */
- 346, /* GL_DOT3_RGBA */
- 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 937, /* GL_MULTISAMPLE_3DFX */
- 1309, /* GL_SAMPLE_BUFFERS_3DFX */
- 1300, /* GL_SAMPLES_3DFX */
- 918, /* GL_MODELVIEW2_ARB */
- 921, /* GL_MODELVIEW3_ARB */
- 922, /* GL_MODELVIEW4_ARB */
- 923, /* GL_MODELVIEW5_ARB */
- 924, /* GL_MODELVIEW6_ARB */
- 925, /* GL_MODELVIEW7_ARB */
- 926, /* GL_MODELVIEW8_ARB */
- 927, /* GL_MODELVIEW9_ARB */
- 897, /* GL_MODELVIEW10_ARB */
- 898, /* GL_MODELVIEW11_ARB */
- 899, /* GL_MODELVIEW12_ARB */
- 900, /* GL_MODELVIEW13_ARB */
- 901, /* GL_MODELVIEW14_ARB */
- 902, /* GL_MODELVIEW15_ARB */
- 903, /* GL_MODELVIEW16_ARB */
- 904, /* GL_MODELVIEW17_ARB */
- 905, /* GL_MODELVIEW18_ARB */
- 906, /* GL_MODELVIEW19_ARB */
- 908, /* GL_MODELVIEW20_ARB */
- 909, /* GL_MODELVIEW21_ARB */
- 910, /* GL_MODELVIEW22_ARB */
- 911, /* GL_MODELVIEW23_ARB */
- 912, /* GL_MODELVIEW24_ARB */
- 913, /* GL_MODELVIEW25_ARB */
- 914, /* GL_MODELVIEW26_ARB */
- 915, /* GL_MODELVIEW27_ARB */
- 916, /* GL_MODELVIEW28_ARB */
- 917, /* GL_MODELVIEW29_ARB */
- 919, /* GL_MODELVIEW30_ARB */
- 920, /* GL_MODELVIEW31_ARB */
- 350, /* GL_DOT3_RGB_EXT */
- 348, /* GL_DOT3_RGBA_EXT */
- 891, /* GL_MIRROR_CLAMP_EXT */
- 894, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 932, /* GL_MODULATE_ADD_ATI */
- 933, /* GL_MODULATE_SIGNED_ADD_ATI */
- 934, /* GL_MODULATE_SUBTRACT_ATI */
- 1744, /* GL_YCBCR_MESA */
- 1023, /* GL_PACK_INVERT_MESA */
- 305, /* GL_DEBUG_OBJECT_MESA */
- 306, /* GL_DEBUG_PRINT_MESA */
- 304, /* GL_DEBUG_ASSERT_MESA */
+ 1800, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 1778, /* GL_VERTEX_BLEND_ARB */
+ 318, /* GL_CURRENT_WEIGHT_ARB */
+ 1799, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 1798, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 1797, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 1796, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 1793, /* GL_WEIGHT_ARRAY_ARB */
+ 365, /* GL_DOT3_RGB */
+ 366, /* GL_DOT3_RGBA */
+ 253, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ 248, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ 982, /* GL_MULTISAMPLE_3DFX */
+ 1366, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1357, /* GL_SAMPLES_3DFX */
+ 963, /* GL_MODELVIEW2_ARB */
+ 966, /* GL_MODELVIEW3_ARB */
+ 967, /* GL_MODELVIEW4_ARB */
+ 968, /* GL_MODELVIEW5_ARB */
+ 969, /* GL_MODELVIEW6_ARB */
+ 970, /* GL_MODELVIEW7_ARB */
+ 971, /* GL_MODELVIEW8_ARB */
+ 972, /* GL_MODELVIEW9_ARB */
+ 942, /* GL_MODELVIEW10_ARB */
+ 943, /* GL_MODELVIEW11_ARB */
+ 944, /* GL_MODELVIEW12_ARB */
+ 945, /* GL_MODELVIEW13_ARB */
+ 946, /* GL_MODELVIEW14_ARB */
+ 947, /* GL_MODELVIEW15_ARB */
+ 948, /* GL_MODELVIEW16_ARB */
+ 949, /* GL_MODELVIEW17_ARB */
+ 950, /* GL_MODELVIEW18_ARB */
+ 951, /* GL_MODELVIEW19_ARB */
+ 953, /* GL_MODELVIEW20_ARB */
+ 954, /* GL_MODELVIEW21_ARB */
+ 955, /* GL_MODELVIEW22_ARB */
+ 956, /* GL_MODELVIEW23_ARB */
+ 957, /* GL_MODELVIEW24_ARB */
+ 958, /* GL_MODELVIEW25_ARB */
+ 959, /* GL_MODELVIEW26_ARB */
+ 960, /* GL_MODELVIEW27_ARB */
+ 961, /* GL_MODELVIEW28_ARB */
+ 962, /* GL_MODELVIEW29_ARB */
+ 964, /* GL_MODELVIEW30_ARB */
+ 965, /* GL_MODELVIEW31_ARB */
+ 370, /* GL_DOT3_RGB_EXT */
+ 368, /* GL_DOT3_RGBA_EXT */
+ 936, /* GL_MIRROR_CLAMP_EXT */
+ 939, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 977, /* GL_MODULATE_ADD_ATI */
+ 978, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 979, /* GL_MODULATE_SUBTRACT_ATI */
+ 1806, /* GL_YCBCR_MESA */
+ 1068, /* GL_PACK_INVERT_MESA */
+ 321, /* GL_DEBUG_OBJECT_MESA */
+ 322, /* GL_DEBUG_PRINT_MESA */
+ 320, /* GL_DEBUG_ASSERT_MESA */
106, /* GL_BUFFER_SIZE */
108, /* GL_BUFFER_USAGE */
- 1397, /* GL_STENCIL_BACK_FUNC */
- 1395, /* GL_STENCIL_BACK_FAIL */
- 1399, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- 1401, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- 483, /* GL_FRAGMENT_PROGRAM_ARB */
- 1157, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1185, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1184, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1169, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1175, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1174, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 827, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 850, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 849, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 840, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 846, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 810, /* GL_MAX_DRAW_BUFFERS */
- 354, /* GL_DRAW_BUFFER0 */
- 357, /* GL_DRAW_BUFFER1 */
- 378, /* GL_DRAW_BUFFER2 */
- 381, /* GL_DRAW_BUFFER3 */
- 384, /* GL_DRAW_BUFFER4 */
- 387, /* GL_DRAW_BUFFER5 */
- 390, /* GL_DRAW_BUFFER6 */
- 393, /* GL_DRAW_BUFFER7 */
- 396, /* GL_DRAW_BUFFER8 */
- 399, /* GL_DRAW_BUFFER9 */
- 358, /* GL_DRAW_BUFFER10 */
- 361, /* GL_DRAW_BUFFER11 */
- 364, /* GL_DRAW_BUFFER12 */
- 367, /* GL_DRAW_BUFFER13 */
- 370, /* GL_DRAW_BUFFER14 */
- 373, /* GL_DRAW_BUFFER15 */
+ 1456, /* GL_STENCIL_BACK_FUNC */
+ 1454, /* GL_STENCIL_BACK_FAIL */
+ 1458, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1460, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 504, /* GL_FRAGMENT_PROGRAM_ARB */
+ 1202, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1230, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1229, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1214, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1220, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1219, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 871, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 894, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 893, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 884, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 890, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 889, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 854, /* GL_MAX_DRAW_BUFFERS */
+ 374, /* GL_DRAW_BUFFER0 */
+ 377, /* GL_DRAW_BUFFER1 */
+ 398, /* GL_DRAW_BUFFER2 */
+ 401, /* GL_DRAW_BUFFER3 */
+ 404, /* GL_DRAW_BUFFER4 */
+ 407, /* GL_DRAW_BUFFER5 */
+ 410, /* GL_DRAW_BUFFER6 */
+ 413, /* GL_DRAW_BUFFER7 */
+ 416, /* GL_DRAW_BUFFER8 */
+ 419, /* GL_DRAW_BUFFER9 */
+ 378, /* GL_DRAW_BUFFER10 */
+ 381, /* GL_DRAW_BUFFER11 */
+ 384, /* GL_DRAW_BUFFER12 */
+ 387, /* GL_DRAW_BUFFER13 */
+ 390, /* GL_DRAW_BUFFER14 */
+ 393, /* GL_DRAW_BUFFER15 */
81, /* GL_BLEND_EQUATION_ALPHA */
- 790, /* GL_MATRIX_PALETTE_ARB */
- 821, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 824, /* GL_MAX_PALETTE_MATRICES_ARB */
- 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 784, /* GL_MATRIX_INDEX_ARRAY_ARB */
- 283, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 1575, /* GL_TEXTURE_DEPTH_SIZE */
- 338, /* GL_DEPTH_TEXTURE_MODE */
- 1541, /* GL_TEXTURE_COMPARE_MODE */
- 1539, /* GL_TEXTURE_COMPARE_FUNC */
- 216, /* GL_COMPARE_R_TO_TEXTURE */
- 1091, /* GL_POINT_SPRITE */
- 265, /* GL_COORD_REPLACE */
- 1095, /* GL_POINT_SPRITE_R_MODE_NV */
- 1212, /* GL_QUERY_COUNTER_BITS */
- 290, /* GL_CURRENT_QUERY */
- 1214, /* GL_QUERY_RESULT */
- 1216, /* GL_QUERY_RESULT_AVAILABLE */
- 871, /* GL_MAX_VERTEX_ATTRIBS */
- 1706, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 857, /* GL_MAX_TEXTURE_COORDS */
- 859, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- 1162, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1164, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1163, /* GL_PROGRAM_FORMAT_ARB */
- 1620, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- 317, /* GL_DEPTH_BOUNDS_TEST_EXT */
- 316, /* GL_DEPTH_BOUNDS_EXT */
+ 834, /* GL_MATRIX_PALETTE_ARB */
+ 865, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 868, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 304, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ 828, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 299, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ 830, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 832, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 831, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 829, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 1634, /* GL_TEXTURE_DEPTH_SIZE */
+ 358, /* GL_DEPTH_TEXTURE_MODE */
+ 1600, /* GL_TEXTURE_COMPARE_MODE */
+ 1598, /* GL_TEXTURE_COMPARE_FUNC */
+ 232, /* GL_COMPARE_R_TO_TEXTURE */
+ 1136, /* GL_POINT_SPRITE */
+ 281, /* GL_COORD_REPLACE */
+ 1140, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1257, /* GL_QUERY_COUNTER_BITS */
+ 306, /* GL_CURRENT_QUERY */
+ 1259, /* GL_QUERY_RESULT */
+ 1261, /* GL_QUERY_RESULT_AVAILABLE */
+ 916, /* GL_MAX_VERTEX_ATTRIBS */
+ 1768, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 356, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ 355, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ 902, /* GL_MAX_TEXTURE_COORDS */
+ 904, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ 1207, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1209, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1208, /* GL_PROGRAM_FORMAT_ARB */
+ 1680, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 335, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ 334, /* GL_DEPTH_BOUNDS_EXT */
52, /* GL_ARRAY_BUFFER */
- 419, /* GL_ELEMENT_ARRAY_BUFFER */
+ 440, /* GL_ELEMENT_ARRAY_BUFFER */
53, /* GL_ARRAY_BUFFER_BINDING */
- 420, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 1680, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 958, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 441, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ 1742, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 1003, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
139, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 1554, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1321, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- 461, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 1732, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 1702, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1165, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 833, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1171, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 842, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1183, /* GL_PROGRAM_TEMPORARIES_ARB */
- 848, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1173, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 844, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1177, /* GL_PROGRAM_PARAMETERS_ARB */
- 847, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1172, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 843, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1158, /* GL_PROGRAM_ATTRIBS_ARB */
- 828, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1170, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 841, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1156, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 826, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1168, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 839, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 834, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 830, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1186, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 1631, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1224, /* GL_READ_ONLY */
- 1740, /* GL_WRITE_ONLY */
- 1226, /* GL_READ_WRITE */
+ 620, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 1613, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 436, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ 1378, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 482, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ 1794, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 1764, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1210, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 877, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1216, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 886, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1228, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 892, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1218, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 888, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1222, /* GL_PROGRAM_PARAMETERS_ARB */
+ 891, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1217, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 887, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1203, /* GL_PROGRAM_ATTRIBS_ARB */
+ 872, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1215, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 885, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1201, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 870, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1213, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 883, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 878, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 874, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1231, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 1691, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1270, /* GL_READ_ONLY */
+ 1802, /* GL_WRITE_ONLY */
+ 1272, /* GL_READ_WRITE */
100, /* GL_BUFFER_ACCESS */
102, /* GL_BUFFER_MAPPED */
104, /* GL_BUFFER_MAP_POINTER */
- 1625, /* GL_TIME_ELAPSED_EXT */
- 744, /* GL_MATRIX0_ARB */
- 756, /* GL_MATRIX1_ARB */
- 768, /* GL_MATRIX2_ARB */
- 772, /* GL_MATRIX3_ARB */
- 774, /* GL_MATRIX4_ARB */
- 776, /* GL_MATRIX5_ARB */
- 778, /* GL_MATRIX6_ARB */
- 780, /* GL_MATRIX7_ARB */
- 782, /* GL_MATRIX8_ARB */
- 783, /* GL_MATRIX9_ARB */
- 746, /* GL_MATRIX10_ARB */
- 747, /* GL_MATRIX11_ARB */
- 748, /* GL_MATRIX12_ARB */
- 749, /* GL_MATRIX13_ARB */
- 750, /* GL_MATRIX14_ARB */
- 751, /* GL_MATRIX15_ARB */
- 752, /* GL_MATRIX16_ARB */
- 753, /* GL_MATRIX17_ARB */
- 754, /* GL_MATRIX18_ARB */
- 755, /* GL_MATRIX19_ARB */
- 758, /* GL_MATRIX20_ARB */
- 759, /* GL_MATRIX21_ARB */
- 760, /* GL_MATRIX22_ARB */
- 761, /* GL_MATRIX23_ARB */
- 762, /* GL_MATRIX24_ARB */
- 763, /* GL_MATRIX25_ARB */
- 764, /* GL_MATRIX26_ARB */
- 765, /* GL_MATRIX27_ARB */
- 766, /* GL_MATRIX28_ARB */
- 767, /* GL_MATRIX29_ARB */
- 770, /* GL_MATRIX30_ARB */
- 771, /* GL_MATRIX31_ARB */
- 1427, /* GL_STREAM_DRAW */
- 1429, /* GL_STREAM_READ */
- 1425, /* GL_STREAM_COPY */
- 1389, /* GL_STATIC_DRAW */
- 1391, /* GL_STATIC_READ */
- 1387, /* GL_STATIC_COPY */
- 409, /* GL_DYNAMIC_DRAW */
- 411, /* GL_DYNAMIC_READ */
- 407, /* GL_DYNAMIC_COPY */
- 533, /* GL_GL_PIXEL_PACK_BUFFER */
- 535, /* GL_GL_PIXEL_UNPACK_BUFFER */
- 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
- 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
- 831, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- 829, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 832, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 836, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 835, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 793, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
- 1421, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 1685, /* GL_TIME_ELAPSED_EXT */
+ 788, /* GL_MATRIX0_ARB */
+ 800, /* GL_MATRIX1_ARB */
+ 812, /* GL_MATRIX2_ARB */
+ 816, /* GL_MATRIX3_ARB */
+ 818, /* GL_MATRIX4_ARB */
+ 820, /* GL_MATRIX5_ARB */
+ 822, /* GL_MATRIX6_ARB */
+ 824, /* GL_MATRIX7_ARB */
+ 826, /* GL_MATRIX8_ARB */
+ 827, /* GL_MATRIX9_ARB */
+ 790, /* GL_MATRIX10_ARB */
+ 791, /* GL_MATRIX11_ARB */
+ 792, /* GL_MATRIX12_ARB */
+ 793, /* GL_MATRIX13_ARB */
+ 794, /* GL_MATRIX14_ARB */
+ 795, /* GL_MATRIX15_ARB */
+ 796, /* GL_MATRIX16_ARB */
+ 797, /* GL_MATRIX17_ARB */
+ 798, /* GL_MATRIX18_ARB */
+ 799, /* GL_MATRIX19_ARB */
+ 802, /* GL_MATRIX20_ARB */
+ 803, /* GL_MATRIX21_ARB */
+ 804, /* GL_MATRIX22_ARB */
+ 805, /* GL_MATRIX23_ARB */
+ 806, /* GL_MATRIX24_ARB */
+ 807, /* GL_MATRIX25_ARB */
+ 808, /* GL_MATRIX26_ARB */
+ 809, /* GL_MATRIX27_ARB */
+ 810, /* GL_MATRIX28_ARB */
+ 811, /* GL_MATRIX29_ARB */
+ 814, /* GL_MATRIX30_ARB */
+ 815, /* GL_MATRIX31_ARB */
+ 1486, /* GL_STREAM_DRAW */
+ 1488, /* GL_STREAM_READ */
+ 1484, /* GL_STREAM_COPY */
+ 1447, /* GL_STATIC_DRAW */
+ 1449, /* GL_STATIC_READ */
+ 1445, /* GL_STATIC_COPY */
+ 430, /* GL_DYNAMIC_DRAW */
+ 432, /* GL_DYNAMIC_READ */
+ 428, /* GL_DYNAMIC_COPY */
+ 575, /* GL_GL_PIXEL_PACK_BUFFER */
+ 577, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ 576, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ 578, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 329, /* GL_DEPTH24_STENCIL8 */
+ 1678, /* GL_TEXTURE_STENCIL_SIZE */
+ 875, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ 873, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 876, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 880, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 879, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 837, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
+ 1480, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
17, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 892, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1302, /* GL_SAMPLES_PASSED */
- 484, /* GL_FRAGMENT_SHADER */
- 1726, /* GL_VERTEX_SHADER */
- 1176, /* GL_PROGRAM_OBJECT_ARB */
- 1334, /* GL_SHADER_OBJECT_ARB */
- 817, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- 875, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- 869, /* GL_MAX_VARYING_FLOATS */
- 873, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- 802, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- 983, /* GL_OBJECT_TYPE_ARB */
- 1336, /* GL_SHADER_TYPE */
- 449, /* GL_FLOAT_VEC2 */
- 451, /* GL_FLOAT_VEC3 */
- 453, /* GL_FLOAT_VEC4 */
- 604, /* GL_INT_VEC2 */
- 606, /* GL_INT_VEC3 */
- 608, /* GL_INT_VEC4 */
+ 937, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1359, /* GL_SAMPLES_PASSED */
+ 505, /* GL_FRAGMENT_SHADER */
+ 1788, /* GL_VERTEX_SHADER */
+ 1221, /* GL_PROGRAM_OBJECT_ARB */
+ 1391, /* GL_SHADER_OBJECT_ARB */
+ 861, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ 920, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ 914, /* GL_MAX_VARYING_FLOATS */
+ 918, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ 846, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ 1028, /* GL_OBJECT_TYPE_ARB */
+ 1393, /* GL_SHADER_TYPE */
+ 470, /* GL_FLOAT_VEC2 */
+ 472, /* GL_FLOAT_VEC3 */
+ 474, /* GL_FLOAT_VEC4 */
+ 647, /* GL_INT_VEC2 */
+ 649, /* GL_INT_VEC3 */
+ 651, /* GL_INT_VEC4 */
92, /* GL_BOOL */
94, /* GL_BOOL_VEC2 */
96, /* GL_BOOL_VEC3 */
98, /* GL_BOOL_VEC4 */
- 443, /* GL_FLOAT_MAT2 */
- 445, /* GL_FLOAT_MAT3 */
- 447, /* GL_FLOAT_MAT4 */
- 1293, /* GL_SAMPLER_1D */
- 1295, /* GL_SAMPLER_2D */
- 1297, /* GL_SAMPLER_3D */
- 1298, /* GL_SAMPLER_CUBE */
- 1294, /* GL_SAMPLER_1D_SHADOW */
- 1296, /* GL_SAMPLER_2D_SHADOW */
- 527, /* GL_GL_FLOAT_MAT2x3 */
- 528, /* GL_GL_FLOAT_MAT2x4 */
- 529, /* GL_GL_FLOAT_MAT3x2 */
- 530, /* GL_GL_FLOAT_MAT3x4 */
- 531, /* GL_GL_FLOAT_MAT4x2 */
- 532, /* GL_GL_FLOAT_MAT4x3 */
- 311, /* GL_DELETE_STATUS */
- 220, /* GL_COMPILE_STATUS */
- 657, /* GL_LINK_STATUS */
- 1675, /* GL_VALIDATE_STATUS */
- 589, /* GL_INFO_LOG_LENGTH */
+ 464, /* GL_FLOAT_MAT2 */
+ 466, /* GL_FLOAT_MAT3 */
+ 468, /* GL_FLOAT_MAT4 */
+ 1350, /* GL_SAMPLER_1D */
+ 1352, /* GL_SAMPLER_2D */
+ 1354, /* GL_SAMPLER_3D */
+ 1355, /* GL_SAMPLER_CUBE */
+ 1351, /* GL_SAMPLER_1D_SHADOW */
+ 1353, /* GL_SAMPLER_2D_SHADOW */
+ 569, /* GL_GL_FLOAT_MAT2x3 */
+ 570, /* GL_GL_FLOAT_MAT2x4 */
+ 571, /* GL_GL_FLOAT_MAT3x2 */
+ 572, /* GL_GL_FLOAT_MAT3x4 */
+ 573, /* GL_GL_FLOAT_MAT4x2 */
+ 574, /* GL_GL_FLOAT_MAT4x3 */
+ 327, /* GL_DELETE_STATUS */
+ 236, /* GL_COMPILE_STATUS */
+ 701, /* GL_LINK_STATUS */
+ 1737, /* GL_VALIDATE_STATUS */
+ 632, /* GL_INFO_LOG_LENGTH */
55, /* GL_ATTACHED_SHADERS */
20, /* GL_ACTIVE_UNIFORMS */
21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
- 1335, /* GL_SHADER_SOURCE_LENGTH */
+ 1392, /* GL_SHADER_SOURCE_LENGTH */
15, /* GL_ACTIVE_ATTRIBUTES */
16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
- 486, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- 1338, /* GL_SHADING_LANGUAGE_VERSION */
- 289, /* GL_CURRENT_PROGRAM */
- 1032, /* GL_PALETTE4_RGB8_OES */
- 1034, /* GL_PALETTE4_RGBA8_OES */
- 1030, /* GL_PALETTE4_R5_G6_B5_OES */
- 1033, /* GL_PALETTE4_RGBA4_OES */
- 1031, /* GL_PALETTE4_RGB5_A1_OES */
- 1037, /* GL_PALETTE8_RGB8_OES */
- 1039, /* GL_PALETTE8_RGBA8_OES */
- 1035, /* GL_PALETTE8_R5_G6_B5_OES */
- 1038, /* GL_PALETTE8_RGBA4_OES */
- 1036, /* GL_PALETTE8_RGB5_A1_OES */
- 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- 1509, /* GL_TEXTURE_1D_ARRAY_EXT */
- 1196, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
- 1511, /* GL_TEXTURE_2D_ARRAY_EXT */
- 1199, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
- 1517, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
- 1519, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
- 541, /* GL_GL_SRGB */
- 542, /* GL_GL_SRGB8 */
- 544, /* GL_GL_SRGB_ALPHA */
- 543, /* GL_GL_SRGB8_ALPHA8 */
- 540, /* GL_GL_SLUMINANCE_ALPHA */
- 539, /* GL_GL_SLUMINANCE8_ALPHA8 */
- 537, /* GL_GL_SLUMINANCE */
- 538, /* GL_GL_SLUMINANCE8 */
- 524, /* GL_GL_COMPRESSED_SRGB */
- 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */
- 522, /* GL_GL_COMPRESSED_SLUMINANCE */
- 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
- 1093, /* GL_POINT_SPRITE_COORD_ORIGIN */
- 665, /* GL_LOWER_LEFT */
- 1672, /* GL_UPPER_LEFT */
- 1403, /* GL_STENCIL_BACK_REF */
- 1404, /* GL_STENCIL_BACK_VALUE_MASK */
- 1405, /* GL_STENCIL_BACK_WRITEMASK */
- 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- 1238, /* GL_RENDERBUFFER_BINDING_EXT */
- 1223, /* GL_READ_FRAMEBUFFER_EXT */
- 403, /* GL_DRAW_FRAMEBUFFER_EXT */
- 1222, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- 487, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- 489, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 799, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- 145, /* GL_COLOR_ATTACHMENT0_EXT */
- 152, /* GL_COLOR_ATTACHMENT1_EXT */
- 153, /* GL_COLOR_ATTACHMENT2_EXT */
- 154, /* GL_COLOR_ATTACHMENT3_EXT */
- 155, /* GL_COLOR_ATTACHMENT4_EXT */
- 156, /* GL_COLOR_ATTACHMENT5_EXT */
- 157, /* GL_COLOR_ATTACHMENT6_EXT */
- 158, /* GL_COLOR_ATTACHMENT7_EXT */
- 159, /* GL_COLOR_ATTACHMENT8_EXT */
- 160, /* GL_COLOR_ATTACHMENT9_EXT */
- 146, /* GL_COLOR_ATTACHMENT10_EXT */
- 147, /* GL_COLOR_ATTACHMENT11_EXT */
- 148, /* GL_COLOR_ATTACHMENT12_EXT */
- 149, /* GL_COLOR_ATTACHMENT13_EXT */
- 150, /* GL_COLOR_ATTACHMENT14_EXT */
- 151, /* GL_COLOR_ATTACHMENT15_EXT */
- 313, /* GL_DEPTH_ATTACHMENT_EXT */
- 1394, /* GL_STENCIL_ATTACHMENT_EXT */
- 495, /* GL_FRAMEBUFFER_EXT */
- 1239, /* GL_RENDERBUFFER_EXT */
- 1242, /* GL_RENDERBUFFER_WIDTH_EXT */
- 1240, /* GL_RENDERBUFFER_HEIGHT_EXT */
- 1241, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- 1416, /* GL_STENCIL_INDEX_EXT */
- 1413, /* GL_STENCIL_INDEX1_EXT */
- 1414, /* GL_STENCIL_INDEX4_EXT */
- 1415, /* GL_STENCIL_INDEX8_EXT */
- 1412, /* GL_STENCIL_INDEX16_EXT */
- 426, /* GL_EVAL_BIT */
- 1220, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 659, /* GL_LIST_BIT */
- 1525, /* GL_TEXTURE_BIT */
- 1317, /* GL_SCISSOR_BIT */
+ 507, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ 1395, /* GL_SHADING_LANGUAGE_VERSION */
+ 305, /* GL_CURRENT_PROGRAM */
+ 1077, /* GL_PALETTE4_RGB8_OES */
+ 1079, /* GL_PALETTE4_RGBA8_OES */
+ 1075, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1078, /* GL_PALETTE4_RGBA4_OES */
+ 1076, /* GL_PALETTE4_RGB5_A1_OES */
+ 1082, /* GL_PALETTE8_RGB8_OES */
+ 1084, /* GL_PALETTE8_RGBA8_OES */
+ 1080, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1083, /* GL_PALETTE8_RGBA4_OES */
+ 1081, /* GL_PALETTE8_RGB5_A1_OES */
+ 614, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ 613, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ 1722, /* GL_UNSIGNED_NORMALIZED */
+ 1568, /* GL_TEXTURE_1D_ARRAY_EXT */
+ 1241, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
+ 1570, /* GL_TEXTURE_2D_ARRAY_EXT */
+ 1244, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
+ 1576, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
+ 1578, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
+ 583, /* GL_GL_SRGB */
+ 584, /* GL_GL_SRGB8 */
+ 586, /* GL_GL_SRGB_ALPHA */
+ 585, /* GL_GL_SRGB8_ALPHA8 */
+ 582, /* GL_GL_SLUMINANCE_ALPHA */
+ 581, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ 579, /* GL_GL_SLUMINANCE */
+ 580, /* GL_GL_SLUMINANCE8 */
+ 566, /* GL_GL_COMPRESSED_SRGB */
+ 567, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ 564, /* GL_GL_COMPRESSED_SLUMINANCE */
+ 565, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ 1138, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 709, /* GL_LOWER_LEFT */
+ 1734, /* GL_UPPER_LEFT */
+ 1462, /* GL_STENCIL_BACK_REF */
+ 1463, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1464, /* GL_STENCIL_BACK_WRITEMASK */
+ 423, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ 1286, /* GL_RENDERBUFFER_BINDING_EXT */
+ 1267, /* GL_READ_FRAMEBUFFER */
+ 422, /* GL_DRAW_FRAMEBUFFER */
+ 1268, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ 1296, /* GL_RENDERBUFFER_SAMPLES */
+ 517, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ 515, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ 526, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ 522, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ 524, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ 529, /* GL_FRAMEBUFFER_COMPLETE */
+ 533, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ 539, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ 537, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ 535, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ 538, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ 536, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ 542, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ 545, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ 543, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ 843, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ 145, /* GL_COLOR_ATTACHMENT0 */
+ 147, /* GL_COLOR_ATTACHMENT1 */
+ 161, /* GL_COLOR_ATTACHMENT2 */
+ 163, /* GL_COLOR_ATTACHMENT3 */
+ 165, /* GL_COLOR_ATTACHMENT4 */
+ 167, /* GL_COLOR_ATTACHMENT5 */
+ 169, /* GL_COLOR_ATTACHMENT6 */
+ 171, /* GL_COLOR_ATTACHMENT7 */
+ 173, /* GL_COLOR_ATTACHMENT8 */
+ 175, /* GL_COLOR_ATTACHMENT9 */
+ 148, /* GL_COLOR_ATTACHMENT10 */
+ 150, /* GL_COLOR_ATTACHMENT11 */
+ 152, /* GL_COLOR_ATTACHMENT12 */
+ 154, /* GL_COLOR_ATTACHMENT13 */
+ 156, /* GL_COLOR_ATTACHMENT14 */
+ 158, /* GL_COLOR_ATTACHMENT15 */
+ 330, /* GL_DEPTH_ATTACHMENT */
+ 1452, /* GL_STENCIL_ATTACHMENT */
+ 508, /* GL_FRAMEBUFFER */
+ 1284, /* GL_RENDERBUFFER */
+ 1298, /* GL_RENDERBUFFER_WIDTH */
+ 1291, /* GL_RENDERBUFFER_HEIGHT */
+ 1293, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ 1475, /* GL_STENCIL_INDEX_EXT */
+ 1472, /* GL_STENCIL_INDEX1_EXT */
+ 1473, /* GL_STENCIL_INDEX4_EXT */
+ 1474, /* GL_STENCIL_INDEX8_EXT */
+ 1471, /* GL_STENCIL_INDEX16_EXT */
+ 1295, /* GL_RENDERBUFFER_RED_SIZE */
+ 1290, /* GL_RENDERBUFFER_GREEN_SIZE */
+ 1287, /* GL_RENDERBUFFER_BLUE_SIZE */
+ 1285, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ 1288, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ 1297, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ 541, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ 899, /* GL_MAX_SAMPLES */
+ 447, /* GL_EVAL_BIT */
+ 1265, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 703, /* GL_LIST_BIT */
+ 1584, /* GL_TEXTURE_BIT */
+ 1374, /* GL_SCISSOR_BIT */
29, /* GL_ALL_ATTRIB_BITS */
- 939, /* GL_MULTISAMPLE_BIT */
+ 984, /* GL_MULTISAMPLE_BIT */
30, /* GL_ALL_CLIENT_ATTRIB_BITS */
};
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index aa5b172123..1b31e283cd 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -45,13 +45,14 @@ static const struct {
int flag_offset;
} default_extensions[] = {
{ OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) },
- { OFF, "GL_ARB_draw_buffers", F(ARB_draw_buffers) },
+ { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) },
{ OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) },
{ OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) },
{ OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) },
+ { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) },
{ OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) },
{ OFF, "GL_ARB_imaging", F(ARB_imaging) },
- { OFF, "GL_ARB_multisample", F(ARB_multisample) },
+ { ON, "GL_ARB_multisample", F(ARB_multisample) },
{ OFF, "GL_ARB_multitexture", F(ARB_multitexture) },
{ OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) },
{ OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) },
@@ -61,9 +62,9 @@ static const struct {
{ OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) },
{ OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) },
{ OFF, "GL_ARB_shadow", F(ARB_shadow) },
- { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) },
+ { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) },
{ OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) },
- { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
+ { ON, "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) },
@@ -74,7 +75,7 @@ static const struct {
{ OFF, "GL_ARB_texture_non_power_of_two", F(ARB_texture_non_power_of_two)},
{ OFF, "GL_ARB_texture_rectangle", F(NV_texture_rectangle) },
{ ON, "GL_ARB_transpose_matrix", F(ARB_transpose_matrix) },
- { OFF, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) },
+ { ON, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) },
{ OFF, "GL_ARB_vertex_program", F(ARB_vertex_program) },
{ OFF, "GL_ARB_vertex_shader", F(ARB_vertex_shader) },
{ ON, "GL_ARB_window_pos", F(ARB_window_pos) },
@@ -98,7 +99,7 @@ static const struct {
{ OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) },
{ OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) },
{ OFF, "GL_EXT_histogram", F(EXT_histogram) },
- { OFF, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) },
+ { ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) },
{ OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) },
{ ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) },
{ OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) },
@@ -126,8 +127,10 @@ static const struct {
{ ON, "GL_EXT_texture_object", F(EXT_texture_object) },
{ OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) },
{ OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) },
+ { OFF, "GL_EXT_texture_swizzle", F(EXT_texture_swizzle) },
{ OFF, "GL_EXT_timer_query", F(EXT_timer_query) },
{ ON, "GL_EXT_vertex_array", F(EXT_vertex_array) },
+ { OFF, "GL_EXT_vertex_array_bgra", F(EXT_vertex_array_bgra) },
{ OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) },
{ OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) },
{ OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) },
@@ -138,7 +141,7 @@ static const struct {
{ OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)},
{ OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)},
{ OFF, "GL_ATI_separate_stencil", F(ATI_separate_stencil)},
- { OFF, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) },
+ { ON, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) },
{ 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(EXT_blend_func_separate) },
@@ -153,6 +156,7 @@ static const struct {
{ OFF, "GL_NV_fragment_program", F(NV_fragment_program) },
{ ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) },
{ OFF, "GL_NV_point_sprite", F(NV_point_sprite) },
+ { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) },
{ OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) },
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
{ OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
@@ -165,10 +169,7 @@ static const struct {
{ OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) },
{ ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
{ ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) },
- { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) },
- { OFF, "GL_SGIX_shadow", F(SGIX_shadow) },
- { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) },
- { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) },
+ { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) },
{ OFF, "GL_S3_s3tc", F(S3_s3tc) },
};
@@ -182,7 +183,7 @@ void
_mesa_enable_sw_extensions(GLcontext *ctx)
{
ctx->Extensions.ARB_depth_texture = GL_TRUE;
- ctx->Extensions.ARB_draw_buffers = GL_TRUE;
+ /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
#if FEATURE_ARB_fragment_program
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
@@ -190,6 +191,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
+#if FEATURE_ARB_framebuffer_object
+ ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
+#endif
ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
ctx->Extensions.ARB_imaging = GL_TRUE;
ctx->Extensions.ARB_multitexture = GL_TRUE;
@@ -207,6 +211,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.ARB_shading_language_120 = GL_FALSE; /* not quite done */
#endif
ctx->Extensions.ARB_shadow = GL_TRUE;
+ ctx->Extensions.ARB_shadow_ambient = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
@@ -222,7 +227,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#endif
#if FEATURE_ARB_vertex_buffer_object
- ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
+ /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
#endif
ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
#if FEATURE_ATI_fragment_shader
@@ -247,7 +252,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
#endif
ctx->Extensions.EXT_histogram = GL_TRUE;
- ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;
+ /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
ctx->Extensions.EXT_paletted_texture = GL_TRUE;
#if FEATURE_EXT_pixel_buffer_object
@@ -258,7 +263,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.EXT_secondary_color = GL_TRUE;
ctx->Extensions.EXT_shared_texture_palette = GL_TRUE;
ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
- ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */
+ ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
ctx->Extensions.EXT_texture_env_add = GL_TRUE;
ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
@@ -267,7 +272,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
#if FEATURE_EXT_texture_sRGB
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
#endif
- ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;
+ ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
+ ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
+ /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/
ctx->Extensions.MESA_pack_invert = GL_TRUE;
#if FEATURE_MESA_program_debug
ctx->Extensions.MESA_program_debug = GL_TRUE;
@@ -278,6 +285,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.NV_blend_square = GL_TRUE;
/*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/
ctx->Extensions.NV_point_sprite = GL_TRUE;
+ ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
ctx->Extensions.NV_texture_rectangle = GL_TRUE;
/*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
#if FEATURE_NV_vertex_program
@@ -292,8 +300,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.SGI_texture_color_table = GL_TRUE;
ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
- ctx->Extensions.SGIX_shadow = GL_TRUE;
- ctx->Extensions.SGIX_shadow_ambient = GL_TRUE;
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
#endif
@@ -335,10 +341,10 @@ _mesa_enable_imaging_extensions(GLcontext *ctx)
void
_mesa_enable_1_3_extensions(GLcontext *ctx)
{
- ctx->Extensions.ARB_multisample = GL_TRUE;
+ /*ctx->Extensions.ARB_multisample = GL_TRUE;*/
ctx->Extensions.ARB_multitexture = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
- ctx->Extensions.ARB_texture_compression = GL_TRUE;
+ /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
@@ -365,7 +371,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx)
ctx->Extensions.EXT_blend_minmax = GL_TRUE;
ctx->Extensions.EXT_blend_subtract = GL_TRUE;
ctx->Extensions.EXT_fog_coord = GL_TRUE;
- ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;
+ /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/
ctx->Extensions.EXT_point_parameters = GL_TRUE;
ctx->Extensions.EXT_secondary_color = GL_TRUE;
ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
@@ -382,7 +388,7 @@ void
_mesa_enable_1_5_extensions(GLcontext *ctx)
{
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
- ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
+ /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/
ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
}
@@ -394,7 +400,7 @@ _mesa_enable_1_5_extensions(GLcontext *ctx)
void
_mesa_enable_2_0_extensions(GLcontext *ctx)
{
- ctx->Extensions.ARB_draw_buffers = GL_TRUE;
+ /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
@@ -406,7 +412,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx)
#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
- ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */
+ ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#endif
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 718c97568b..c3cdc11037 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3,6 +3,7 @@
* Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -24,6 +25,8 @@
/*
+ * GL_EXT/ARB_framebuffer_object extensions
+ *
* Authors:
* Brian Paul
*/
@@ -34,6 +37,7 @@
#include "fbobject.h"
#include "framebuffer.h"
#include "hash.h"
+#include "macros.h"
#include "mipmap.h"
#include "renderbuffer.h"
#include "state.h"
@@ -122,8 +126,22 @@ _mesa_lookup_framebuffer(GLcontext *ctx, GLuint id)
/**
+ * Mark the given framebuffer as invalid. This will force the
+ * test for framebuffer completeness to be done before the framebuffer
+ * is used.
+ */
+static void
+invalidate_framebuffer(struct gl_framebuffer *fb)
+{
+ fb->_Status = 0; /* "indeterminate" */
+}
+
+
+/**
* Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding
* gl_renderbuffer_attachment object.
+ * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to
+ * the depth buffer attachment point.
*/
struct gl_renderbuffer_attachment *
_mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb,
@@ -153,6 +171,8 @@ _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb,
return NULL;
}
return &fb->Attachment[BUFFER_COLOR0 + i];
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ /* fall-through */
case GL_DEPTH_ATTACHMENT_EXT:
return &fb->Attachment[BUFFER_DEPTH];
case GL_STENCIL_ATTACHMENT_EXT:
@@ -226,6 +246,8 @@ _mesa_set_texture_attachment(GLcontext *ctx,
if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) {
ctx->Driver.RenderTexture(ctx, fb, att);
}
+
+ invalidate_framebuffer(fb);
}
@@ -263,11 +285,19 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb,
ASSERT(att);
if (rb) {
_mesa_set_renderbuffer_attachment(ctx, att, rb);
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* do stencil attachment here (depth already done above) */
+ att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
+ assert(att);
+ _mesa_set_renderbuffer_attachment(ctx, att, rb);
+ }
}
else {
_mesa_remove_attachment(ctx, att);
}
+ invalidate_framebuffer(fb);
+
_glthread_UNLOCK_MUTEX(fb->Mutex);
}
@@ -410,15 +440,18 @@ fbo_incomplete(const char *msg, int index)
/**
* Test if the given framebuffer object is complete and update its
* Status field with the results.
+ * Calls the ctx->Driver.ValidateFramebuffer() function to allow the
+ * driver to make hardware-specific validation/completeness checks.
* Also update the framebuffer's Width and Height fields if the
* framebuffer is complete.
*/
void
_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
{
- GLuint numImages, width = 0, height = 0;
- GLenum intFormat = GL_NONE;
- GLuint w = 0, h = 0;
+ GLuint numImages;
+ GLenum intFormat = GL_NONE; /* color buffers' internal format */
+ GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0;
+ GLint numSamples = -1;
GLint i;
GLuint j;
@@ -428,11 +461,22 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
fb->Width = 0;
fb->Height = 0;
- /* Start at -2 to more easily loop over all attachment points */
+ /* Start at -2 to more easily loop over all attachment points.
+ * -2: depth buffer
+ * -1: stencil buffer
+ * >=0: color buffer
+ */
for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
struct gl_renderbuffer_attachment *att;
GLenum f;
+ /*
+ * XXX for ARB_fbo, only check color buffers that are named by
+ * GL_READ_BUFFER and GL_DRAW_BUFFERi.
+ */
+
+ /* check for attachment completeness
+ */
if (i == -2) {
att = &fb->Attachment[BUFFER_DEPTH];
test_attachment_completeness(ctx, GL_DEPTH, att);
@@ -461,11 +505,15 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
}
}
+ /* get width, height, format of the renderbuffer/texture
+ */
if (att->Type == GL_TEXTURE) {
const struct gl_texture_image *texImg
= att->Texture->Image[att->CubeMapFace][att->TextureLevel];
- w = texImg->Width;
- h = texImg->Height;
+ minWidth = MIN2(minWidth, texImg->Width);
+ maxWidth = MAX2(maxWidth, texImg->Width);
+ minHeight = MIN2(minHeight, texImg->Height);
+ maxHeight = MAX2(maxHeight, texImg->Height);
f = texImg->_BaseFormat;
numImages++;
if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT
@@ -476,8 +524,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
}
}
else if (att->Type == GL_RENDERBUFFER_EXT) {
- w = att->Renderbuffer->Width;
- h = att->Renderbuffer->Height;
+ minWidth = MIN2(minWidth, att->Renderbuffer->Width);
+ maxWidth = MAX2(minWidth, att->Renderbuffer->Width);
+ minHeight = MIN2(minHeight, att->Renderbuffer->Height);
+ maxHeight = MAX2(minHeight, att->Renderbuffer->Height);
f = att->Renderbuffer->InternalFormat;
numImages++;
}
@@ -486,25 +536,41 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
continue;
}
+ if (numSamples < 0) {
+ /* first buffer */
+ numSamples = att->Renderbuffer->NumSamples;
+ }
+
+ /* Error-check width, height, format, samples
+ */
if (numImages == 1) {
- /* set required width, height and format */
- width = w;
- height = h;
- if (i >= 0)
+ /* save format, num samples */
+ if (i >= 0) {
intFormat = f;
+ }
}
else {
- /* check that width, height, format are same */
- if (w != width || h != height) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
- fbo_incomplete("width or height mismatch", -1);
- return;
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ /* check that width, height, format are same */
+ if (minWidth != maxWidth || minHeight != maxHeight) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
+ fbo_incomplete("width or height mismatch", -1);
+ return;
+ }
+ /* check that all color buffer have same format */
+ if (intFormat != GL_NONE && f != intFormat) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
+ fbo_incomplete("format mismatch", -1);
+ return;
+ }
}
- if (intFormat != GL_NONE && f != intFormat) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
- fbo_incomplete("format mismatch", -1);
+ if (att->Renderbuffer &&
+ att->Renderbuffer->NumSamples != numSamples) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+ fbo_incomplete("inconsistant number of samples", i);
return;
- }
+ }
+
}
}
@@ -542,12 +608,32 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
return;
}
- /*
- * If we get here, the framebuffer is complete!
- */
+ /* Provisionally set status = COMPLETE ... */
fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
- fb->Width = w;
- fb->Height = h;
+
+ /* ... but the driver may say the FB is incomplete.
+ * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED
+ * if anything.
+ */
+ if (ctx->Driver.ValidateFramebuffer) {
+ ctx->Driver.ValidateFramebuffer(ctx, fb);
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ fbo_incomplete("driver marked FBO as incomplete", -1);
+ }
+ }
+
+ if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) {
+ /*
+ * Note that if ARB_framebuffer_object is supported and the attached
+ * renderbuffers/textures are different sizes, the framebuffer
+ * width/height will be set to the smallest width/height.
+ */
+ fb->Width = minWidth;
+ fb->Height = minHeight;
+
+ /* finally, update the visual info for the framebuffer */
+ _mesa_update_framebuffer_visual(fb);
+ }
}
@@ -593,6 +679,12 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
/* ID was reserved, but no real renderbuffer object made yet */
newRb = NULL;
}
+ else if (!newRb && ctx->Extensions.ARB_framebuffer_object) {
+ /* All RB IDs must be Gen'd */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)");
+ return;
+ }
+
if (!newRb) {
/* create new renderbuffer object */
newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer);
@@ -615,6 +707,27 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
}
+/**
+ * If the given renderbuffer is anywhere attached to the framebuffer, detach
+ * the renderbuffer.
+ * This is used when a renderbuffer object is deleted.
+ * The spec calls for unbinding.
+ */
+static void
+detach_renderbuffer(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer *rb)
+{
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (fb->Attachment[i].Renderbuffer == rb) {
+ _mesa_remove_attachment(ctx, &fb->Attachment[i]);
+ }
+ }
+ invalidate_framebuffer(fb);
+}
+
+
void GLAPIENTRY
_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers)
{
@@ -636,6 +749,13 @@ _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers)
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
}
+ if (ctx->DrawBuffer->Name) {
+ detach_renderbuffer(ctx, ctx->DrawBuffer, rb);
+ }
+ if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) {
+ detach_renderbuffer(ctx, ctx->ReadBuffer, rb);
+ }
+
/* Remove from hash table immediately, to free the ID.
* But the object will not be freed until it's no longer
* referenced anywhere else.
@@ -737,10 +857,21 @@ _mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat)
}
-void GLAPIENTRY
-_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height)
+/** sentinal value, see below */
+#define NO_SAMPLES 1000
+
+
+/**
+ * Helper function used by _mesa_RenderbufferStorageEXT() and
+ * _mesa_RenderbufferStorageMultisample().
+ * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT().
+ */
+static void
+renderbuffer_storage(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLsizei samples)
{
+ const char *func = samples == NO_SAMPLES ?
+ "glRenderbufferStorage" : "RenderbufferStorageMultisample";
struct gl_renderbuffer *rb;
GLenum baseFormat;
GET_CURRENT_CONTEXT(ctx);
@@ -748,31 +879,39 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (target != GL_RENDERBUFFER_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
return;
}
baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glRenderbufferStorageEXT(internalFormat)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func);
return;
}
if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(width)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func);
return;
}
if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(height)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func);
return;
}
- rb = ctx->CurrentRenderbuffer;
+ if (samples == NO_SAMPLES) {
+ /* NumSamples == 0 indicates non-multisampling */
+ samples = 0;
+ }
+ else if (samples > ctx->Const.MaxSamples) {
+ /* note: driver may choose to use more samples than what's requested */
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func);
+ return;
+ }
+ rb = ctx->CurrentRenderbuffer;
if (!rb) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glRenderbufferStorageEXT");
+ _mesa_error(ctx, GL_INVALID_OPERATION, func);
return;
}
@@ -794,6 +933,7 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
rb->IndexBits =
rb->DepthBits =
rb->StencilBits = 0;
+ rb->NumSamples = samples;
/* Now allocate the storage */
ASSERT(rb->AllocStorage);
@@ -820,7 +960,8 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
rb->AlphaBits =
rb->IndexBits =
rb->DepthBits =
- rb->StencilBits = 0;
+ rb->StencilBits =
+ rb->NumSamples = 0;
}
/*
@@ -833,8 +974,31 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
void GLAPIENTRY
+_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ /* GL_ARB_fbo says calling this function is equivalent to calling
+ * glRenderbufferStorageMultisample() with samples=0. We pass in
+ * a token value here just for error reporting purposes.
+ */
+ renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES);
+}
+
+
+void GLAPIENTRY
+_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ renderbuffer_storage(target, internalFormat, width, height, samples);
+}
+
+
+
+void GLAPIENTRY
_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
{
+ struct gl_renderbuffer *rb;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -845,7 +1009,8 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
return;
}
- if (!ctx->CurrentRenderbuffer) {
+ rb = ctx->CurrentRenderbuffer;
+ if (!rb) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetRenderbufferParameterivEXT");
return;
@@ -855,32 +1020,38 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
switch (pname) {
case GL_RENDERBUFFER_WIDTH_EXT:
- *params = ctx->CurrentRenderbuffer->Width;
+ *params = rb->Width;
return;
case GL_RENDERBUFFER_HEIGHT_EXT:
- *params = ctx->CurrentRenderbuffer->Height;
+ *params = rb->Height;
return;
case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT:
- *params = ctx->CurrentRenderbuffer->InternalFormat;
+ *params = rb->InternalFormat;
return;
case GL_RENDERBUFFER_RED_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->RedBits;
+ *params = rb->RedBits;
break;
case GL_RENDERBUFFER_GREEN_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->GreenBits;
+ *params = rb->GreenBits;
break;
case GL_RENDERBUFFER_BLUE_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->BlueBits;
+ *params = rb->BlueBits;
break;
case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->AlphaBits;
+ *params = rb->AlphaBits;
break;
case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->DepthBits;
+ *params = rb->DepthBits;
break;
case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
- *params = ctx->CurrentRenderbuffer->StencilBits;
+ *params = rb->StencilBits;
break;
+ case GL_RENDERBUFFER_SAMPLES:
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ *params = rb->NumSamples;
+ break;
+ }
+ /* fallthrough */
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetRenderbufferParameterivEXT(target)");
@@ -946,6 +1117,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
GLboolean bindReadBuf, bindDrawBuf;
GET_CURRENT_CONTEXT(ctx);
+#ifdef DEBUG
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ ASSERT(ctx->Extensions.EXT_framebuffer_object);
+ ASSERT(ctx->Extensions.EXT_framebuffer_blit);
+ }
+#endif
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!ctx->Extensions.EXT_framebuffer_object) {
@@ -995,6 +1173,12 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
/* ID was reserved, but no real framebuffer object made yet */
newFb = NULL;
}
+ else if (!newFb && ctx->Extensions.ARB_framebuffer_object) {
+ /* All FBO IDs must be Gen'd */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)");
+ return;
+ }
+
if (!newFb) {
/* create new framebuffer object */
newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
@@ -1069,7 +1253,12 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
if (fb == ctx->DrawBuffer) {
/* bind default */
ASSERT(fb->RefCount >= 2);
- _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+ }
+ if (fb == ctx->ReadBuffer) {
+ /* bind default */
+ ASSERT(fb->RefCount >= 2);
+ _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
}
/* remove from hash table immediately, to free the ID */
@@ -1079,7 +1268,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
/* But the object will not be freed until it's no longer
* bound in any context.
*/
- _mesa_unreference_framebuffer(&fb);
+ _mesa_reference_framebuffer(&fb, NULL);
}
}
}
@@ -1158,7 +1347,10 @@ _mesa_CheckFramebufferStatusEXT(GLenum target)
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
- _mesa_test_framebuffer_completeness(ctx, buffer);
+ if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, buffer);
+ }
+
return buffer->_Status;
}
@@ -1175,16 +1367,31 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
struct gl_renderbuffer_attachment *att;
struct gl_texture_object *texObj = NULL;
struct gl_framebuffer *fb;
+ GLboolean error = GL_FALSE;
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (target != GL_FRAMEBUFFER_EXT) {
+ switch (target) {
+ case GL_READ_FRAMEBUFFER_EXT:
+ error = !ctx->Extensions.EXT_framebuffer_blit;
+ fb = ctx->ReadBuffer;
+ break;
+ case GL_DRAW_FRAMEBUFFER_EXT:
+ error = !ctx->Extensions.EXT_framebuffer_blit;
+ /* fall-through */
+ case GL_FRAMEBUFFER_EXT:
+ fb = ctx->DrawBuffer;
+ break;
+ default:
+ error = GL_TRUE;
+ }
+
+ if (error) {
_mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture%sEXT(target)", caller);
+ "glFramebufferTexture%sEXT(target=0x%x)", caller, target);
return;
}
- fb = ctx->DrawBuffer;
ASSERT(fb);
/* check framebuffer binding */
@@ -1239,7 +1446,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
}
}
-
if ((level < 0) ||
(level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
_mesa_error(ctx, GL_INVALID_VALUE,
@@ -1255,6 +1461,18 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
return;
}
+ if (texObj && attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* the texture format must be depth+stencil */
+ const struct gl_texture_image *texImg;
+ texImg = texObj->Image[0][texObj->BaseLevel];
+ if (!texImg || texImg->_BaseFormat != GL_DEPTH_STENCIL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture%sEXT(texture is not"
+ " DEPTH_STENCIL format)", caller);
+ return;
+ }
+ }
+
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
/* The above doesn't fully flush the drivers in the way that a
* glFlush does, but that is required here:
@@ -1266,10 +1484,22 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
if (texObj) {
_mesa_set_texture_attachment(ctx, fb, att, texObj, textarget,
level, zoffset);
+ /* Set the render-to-texture flag. We'll check this flag in
+ * glTexImage() and friends to determine if we need to revalidate
+ * any FBOs that might be rendering into this texture.
+ * This flag never gets cleared since it's non-trivial to determine
+ * when all FBOs might be done rendering to this texture. That's OK
+ * though since it's uncommon to render to a texture then repeatedly
+ * call glTexImage() to change images in the texture.
+ */
+ texObj->_RenderToTexture = GL_TRUE;
}
else {
_mesa_remove_attachment(ctx, att);
}
+
+ invalidate_framebuffer(fb);
+
_glthread_UNLOCK_MUTEX(fb->Mutex);
}
@@ -1303,7 +1533,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
(textarget != GL_TEXTURE_RECTANGLE_ARB) &&
(!IS_CUBE_FACE(textarget))) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture2DEXT(textarget)");
+ "glFramebufferTexture2DEXT(textarget=0x%x)", textarget);
return;
}
@@ -1413,6 +1643,17 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
rb = NULL;
}
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* make sure the renderbuffer is a depth/stencil format */
+ if (rb->_BaseFormat != GL_DEPTH_STENCIL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferRenderbufferEXT(renderbuffer"
+ " is not DEPTH_STENCIL format)");
+ return;
+ }
+ }
+
+
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
/* The above doesn't fully flush the drivers in the way that a
* glFlush does, but that is required here:
@@ -1481,6 +1722,19 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
return;
}
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* the depth and stencil attachments must point to the same buffer */
+ const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt;
+ depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);
+ stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT);
+ if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL"
+ " attachments differ)");
+ return;
+ }
+ }
+
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
/* The above doesn't fully flush the drivers in the way that a
* glFlush does, but that is required here:
@@ -1541,6 +1795,79 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
"glGetFramebufferAttachmentParameterivEXT(pname)");
}
return;
+ case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->ColorEncoding;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ return;
+ }
+ else {
+ *params = att->Renderbuffer->ComponentType;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->RedBits;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->GreenBits;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->BlueBits;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->AlphaBits;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->DepthBits;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ *params = att->Renderbuffer->StencilBits;
+ }
+ return;
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
@@ -1590,11 +1917,22 @@ _mesa_GenerateMipmapEXT(GLenum target)
#if FEATURE_EXT_framebuffer_blit
+/**
+ * Blit rectangular region, optionally from one framebuffer to another.
+ *
+ * Note, if the src buffer is multisampled and the dest is not, this is
+ * when the samples must be resolved to a single color.
+ */
void GLAPIENTRY
_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
{
+ const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT);
+ const struct gl_framebuffer *readFb, *drawFb;
+ const struct gl_renderbuffer *colorReadRb, *colorDrawRb;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -1604,13 +1942,19 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
_mesa_update_state(ctx);
}
- if (!ctx->ReadBuffer) {
- /* XXX */
+ readFb = ctx->ReadBuffer;
+ drawFb = ctx->DrawBuffer;
+
+ if (!readFb || !drawFb) {
+ /* This will normally never happen but someday we may want to
+ * support MakeCurrent() with no drawables.
+ */
+ return;
}
/* check for complete framebuffers */
- if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
- ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
+ readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
"glBlitFramebufferEXT(incomplete draw/read buffers)");
return;
@@ -1621,9 +1965,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
return;
}
- if (mask & ~(GL_COLOR_BUFFER_BIT |
- GL_DEPTH_BUFFER_BIT |
- GL_STENCIL_BUFFER_BIT)) {
+ if (mask & ~legalMaskBits) {
_mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)");
return;
}
@@ -1636,9 +1978,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
return;
}
+ /* get color read/draw renderbuffers */
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ colorReadRb = readFb->_ColorReadBuffer;
+ colorDrawRb = drawFb->_ColorDrawBuffers[0];
+ }
+ else {
+ colorReadRb = colorDrawRb = NULL;
+ }
+
if (mask & GL_STENCIL_BUFFER_BIT) {
- struct gl_renderbuffer *readRb = ctx->ReadBuffer->_StencilBuffer;
- struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_StencilBuffer;
+ struct gl_renderbuffer *readRb = readFb->_StencilBuffer;
+ struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer;
if (readRb->StencilBits != drawRb->StencilBits) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBlitFramebufferEXT(stencil buffer size mismatch");
@@ -1647,8 +1998,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
}
if (mask & GL_DEPTH_BUFFER_BIT) {
- struct gl_renderbuffer *readRb = ctx->ReadBuffer->_DepthBuffer;
- struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_DepthBuffer;
+ struct gl_renderbuffer *readRb = readFb->_DepthBuffer;
+ struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer;
if (readRb->DepthBits != drawRb->DepthBits) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBlitFramebufferEXT(depth buffer size mismatch");
@@ -1656,6 +2007,34 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
}
}
+ if (readFb->Visual.samples > 0 &&
+ drawFb->Visual.samples > 0 &&
+ readFb->Visual.samples != drawFb->Visual.samples) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(mismatched samples");
+ return;
+ }
+
+ /* extra checks for multisample copies... */
+ if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) {
+ /* src and dest region sizes must be the same */
+ if (srcX1 - srcX0 != dstX1 - dstX0 ||
+ srcY1 - srcY0 != dstY1 - dstY0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(bad src/dst multisample region sizes");
+ return;
+ }
+
+ /* color formats must match */
+ if (colorReadRb &&
+ colorDrawRb &&
+ colorReadRb->_ActualFormat != colorDrawRb->_ActualFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(bad src/dst multisample pixel formats");
+ return;
+ }
+ }
+
if (!ctx->Extensions.EXT_framebuffer_blit) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT");
return;
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index b6154719ab..33d16cc5a0 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -83,6 +83,11 @@ extern void GLAPIENTRY
_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat,
GLsizei width, GLsizei height);
+void GLAPIENTRY
+_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
+ GLenum internalformat,
+ GLsizei width, GLsizei height);
+
extern void GLAPIENTRY
_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname,
GLint *params);
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index af78363ad3..351bf6959a 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -35,6 +35,7 @@
#include "buffers.h"
#include "context.h"
#include "depthstencil.h"
+#include "macros.h"
#include "mtypes.h"
#include "fbobject.h"
#include "framebuffer.h"
@@ -222,19 +223,36 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr,
/* no change */
return;
}
+
if (*ptr) {
- _mesa_unreference_framebuffer(ptr);
+ /* unreference old renderbuffer */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_framebuffer *oldFb = *ptr;
+
+ _glthread_LOCK_MUTEX(oldFb->Mutex);
+ ASSERT(oldFb->RefCount > 0);
+ oldFb->RefCount--;
+ deleteFlag = (oldFb->RefCount == 0);
+ _glthread_UNLOCK_MUTEX(oldFb->Mutex);
+
+ if (deleteFlag)
+ oldFb->Delete(oldFb);
+
+ *ptr = NULL;
}
assert(!*ptr);
- assert(fb);
- _glthread_LOCK_MUTEX(fb->Mutex);
- fb->RefCount++;
- _glthread_UNLOCK_MUTEX(fb->Mutex);
- *ptr = fb;
+
+ if (fb) {
+ _glthread_LOCK_MUTEX(fb->Mutex);
+ fb->RefCount++;
+ _glthread_UNLOCK_MUTEX(fb->Mutex);
+ *ptr = fb;
+ }
}
/**
+ * XXX this function is deprecated.
* Undo/remove a reference to a framebuffer object.
* Decrement the framebuffer object's reference count and delete it when
* the refcount hits zero.
@@ -243,21 +261,7 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr,
void
_mesa_unreference_framebuffer(struct gl_framebuffer **fb)
{
- assert(fb);
- if (*fb) {
- GLboolean deleteFlag = GL_FALSE;
-
- _glthread_LOCK_MUTEX((*fb)->Mutex);
- ASSERT((*fb)->RefCount > 0);
- (*fb)->RefCount--;
- deleteFlag = ((*fb)->RefCount == 0);
- _glthread_UNLOCK_MUTEX((*fb)->Mutex);
-
- if (deleteFlag)
- (*fb)->Delete(*fb);
-
- *fb = NULL;
- }
+ _mesa_reference_framebuffer(fb, NULL);
}
@@ -418,14 +422,14 @@ _mesa_ResizeBuffersMESA( void )
/**
* Examine all the framebuffer's renderbuffers to update the Width/Height
* fields of the framebuffer. If we have renderbuffers with different
- * sizes, set the framebuffer's width and height to zero.
+ * sizes, set the framebuffer's width and height to the min size.
* Note: this is only intended for user-created framebuffers, not
* window-system framebuffes.
*/
static void
-update_framebuffer_size(struct gl_framebuffer *fb)
+update_framebuffer_size(GLcontext *ctx, struct gl_framebuffer *fb)
{
- GLboolean haveSize = GL_FALSE;
+ GLuint minWidth = ~0, minHeight = ~0;
GLuint i;
/* user-created framebuffers only */
@@ -435,21 +439,19 @@ update_framebuffer_size(struct gl_framebuffer *fb)
struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
const struct gl_renderbuffer *rb = att->Renderbuffer;
if (rb) {
- if (haveSize) {
- if (rb->Width != fb->Width && rb->Height != fb->Height) {
- /* size mismatch! */
- fb->Width = 0;
- fb->Height = 0;
- return;
- }
- }
- else {
- fb->Width = rb->Width;
- fb->Height = rb->Height;
- haveSize = GL_TRUE;
- }
+ minWidth = MIN2(minWidth, rb->Width);
+ minHeight = MIN2(minHeight, rb->Height);
}
}
+
+ if (minWidth != ~0) {
+ fb->Width = minWidth;
+ fb->Height = minHeight;
+ }
+ else {
+ fb->Width = 0;
+ fb->Height = 0;
+ }
}
@@ -469,7 +471,7 @@ _mesa_update_draw_buffer_bounds(GLcontext *ctx)
if (buffer->Name) {
/* user-created framebuffer size depends on the renderbuffers */
- update_framebuffer_size(buffer);
+ update_framebuffer_size(ctx, buffer);
}
buffer->_Xmin = 0;
@@ -544,6 +546,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb)
fb->Visual.rgbBits = fb->Visual.redBits
+ fb->Visual.greenBits + fb->Visual.blueBits;
fb->Visual.floatMode = GL_FALSE;
+ fb->Visual.samples = rb->NumSamples;
break;
}
else if (rb->_BaseFormat == GL_COLOR_INDEX) {
@@ -793,8 +796,9 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
/* This is a user-created framebuffer.
* Completeness only matters for user-created framebuffers.
*/
- _mesa_test_framebuffer_completeness(ctx, fb);
- _mesa_update_framebuffer_visual(fb);
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, fb);
+ }
}
/* Strictly speaking, we don't need to update the draw-state
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 8ce9b0ae69..87a821b12d 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -460,7 +460,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = INT_TO_BOOLEAN(ctx->List.ListBase);
break;
case GL_LIST_INDEX:
- params[0] = INT_TO_BOOLEAN(ctx->ListState.CurrentListNum);
+ params[0] = INT_TO_BOOLEAN((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
break;
case GL_LIST_MODE:
{
@@ -1078,15 +1078,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
break;
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
{
GLint formats[100];
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
@@ -1368,35 +1365,27 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy);
break;
case GL_MULTISAMPLE_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = ctx->Multisample.Enabled;
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = ctx->Multisample.SampleAlphaToCoverage;
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = ctx->Multisample.SampleAlphaToOne;
break;
case GL_SAMPLE_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = ctx->Multisample.SampleCoverage;
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue);
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = ctx->Multisample.SampleCoverageInvert;
break;
case GL_SAMPLE_BUFFERS_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers);
break;
case GL_SAMPLES_ARB:
- CHECK_EXT1(ARB_multisample, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples);
break;
case GL_RASTER_POSITION_UNCLIPPED_IBM:
@@ -1592,43 +1581,33 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent);
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name);
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name);
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name);
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name);
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
break;
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name);
break;
case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
@@ -1753,15 +1732,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition);
break;
case GL_MAX_DRAW_BUFFERS_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers);
break;
case GL_DRAW_BUFFER0_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -1773,7 +1749,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
break;
case GL_DRAW_BUFFER2_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -1785,7 +1760,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
break;
case GL_DRAW_BUFFER3_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -1905,6 +1879,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
CHECK_EXT1(ARB_shader_objects, "GetBooleanv");
params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
break;
+ case GL_MAX_SAMPLES:
+ CHECK_EXT1(ARB_framebuffer_object, "GetBooleanv");
+ params[0] = INT_TO_BOOLEAN(ctx->Const.MaxSamples);
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
}
@@ -2308,7 +2286,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = (GLfloat)(ctx->List.ListBase);
break;
case GL_LIST_INDEX:
- params[0] = (GLfloat)(ctx->ListState.CurrentListNum);
+ params[0] = (GLfloat)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
break;
case GL_LIST_MODE:
{
@@ -2926,15 +2904,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
break;
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetFloatv");
params[0] = (GLfloat)(ctx->Hint.TextureCompression);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetFloatv");
params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetFloatv");
{
GLint formats[100];
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
@@ -3216,35 +3191,27 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = ctx->Const.MaxTextureMaxAnisotropy;
break;
case GL_MULTISAMPLE_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled);
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage);
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne);
break;
case GL_SAMPLE_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage);
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = ctx->Multisample.SampleCoverageValue;
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert);
break;
case GL_SAMPLE_BUFFERS_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers);
break;
case GL_SAMPLES_ARB:
- CHECK_EXT1(ARB_multisample, "GetFloatv");
params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples);
break;
case GL_RASTER_POSITION_UNCLIPPED_IBM:
@@ -3440,43 +3407,33 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = ctx->Const.MaxSpotExponent;
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name);
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name);
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name);
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name);
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
break;
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv");
params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name);
break;
case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
@@ -3601,15 +3558,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition);
break;
case GL_MAX_DRAW_BUFFERS_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers);
break;
case GL_DRAW_BUFFER0_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -3621,7 +3575,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
break;
case GL_DRAW_BUFFER2_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -3633,7 +3586,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
break;
case GL_DRAW_BUFFER3_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -3753,6 +3705,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
CHECK_EXT1(ARB_shader_objects, "GetFloatv");
params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
break;
+ case GL_MAX_SAMPLES:
+ CHECK_EXT1(ARB_framebuffer_object, "GetFloatv");
+ params[0] = (GLfloat)(ctx->Const.MaxSamples);
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname);
}
@@ -4156,7 +4112,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- params[0] = ctx->ListState.CurrentListNum;
+ params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0);
break;
case GL_LIST_MODE:
{
@@ -4774,15 +4730,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
break;
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
params[0] = ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
{
GLint formats[100];
GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
@@ -5064,35 +5017,27 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy);
break;
case GL_MULTISAMPLE_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled);
break;
case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage);
break;
case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne);
break;
case GL_SAMPLE_COVERAGE_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage);
break;
case GL_SAMPLE_COVERAGE_VALUE_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = IROUND(ctx->Multisample.SampleCoverageValue);
break;
case GL_SAMPLE_COVERAGE_INVERT_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert);
break;
case GL_SAMPLE_BUFFERS_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = ctx->DrawBuffer->Visual.sampleBuffers;
break;
case GL_SAMPLES_ARB:
- CHECK_EXT1(ARB_multisample, "GetIntegerv");
params[0] = ctx->DrawBuffer->Visual.samples;
break;
case GL_RASTER_POSITION_UNCLIPPED_IBM:
@@ -5288,43 +5233,33 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = IROUND(ctx->Const.MaxSpotExponent);
break;
case GL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayBufferObj->Name;
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name;
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name;
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name;
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name;
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name;
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name;
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name;
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name;
break;
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv");
params[0] = ctx->Array.ElementArrayBufferObj->Name;
break;
case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
@@ -5449,15 +5384,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = ctx->VertexProgram.CurrentPosition;
break;
case GL_MAX_DRAW_BUFFERS_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
params[0] = ctx->Const.MaxDrawBuffers;
break;
case GL_DRAW_BUFFER0_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -5469,7 +5401,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
break;
case GL_DRAW_BUFFER2_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -5481,7 +5412,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
break;
case GL_DRAW_BUFFER3_ARB:
- CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
{
GLenum buffer;
if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
@@ -5601,6 +5531,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
CHECK_EXT1(ARB_shader_objects, "GetIntegerv");
params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0;
break;
+ case GL_MAX_SAMPLES:
+ CHECK_EXT1(ARB_framebuffer_object, "GetIntegerv");
+ params[0] = ctx->Const.MaxSamples;
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
}
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index a191b045d3..3b2496c663 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -254,7 +254,7 @@ StateVars = [
["ctx->Const.MinLineWidth",
"ctx->Const.MaxLineWidth"], "", None ),
( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ),
- ( "GL_LIST_INDEX", GLint, ["ctx->ListState.CurrentListNum"], "", None ),
+ ( "GL_LIST_INDEX", GLint, ["(ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)"], "", None ),
( "GL_LIST_MODE", GLenum, ["mode"],
"""GLenum mode;
if (!ctx->CompileFlag)
@@ -523,10 +523,10 @@ StateVars = [
# GL_ARB_texture_compression */
( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint,
- ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ),
+ ["ctx->Hint.TextureCompression"], "", None ),
( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"],
- "", ["ARB_texture_compression"] ),
+ "", None ),
( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum,
[],
"""GLint formats[100];
@@ -534,7 +534,7 @@ StateVars = [
ASSERT(n <= 100);
for (i = 0; i < n; i++)
params[i] = CONVERSION(formats[i]);""",
- ["ARB_texture_compression"] ),
+ None ),
# GL_EXT_compiled_vertex_array
( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"],
@@ -681,21 +681,21 @@ StateVars = [
# GL_ARB_multisample
( "GL_MULTISAMPLE_ARB", GLboolean,
- ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.Enabled"], "", None ),
( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean,
- ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.SampleAlphaToCoverage"], "", None ),
( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean,
- ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.SampleAlphaToOne"], "", None ),
( "GL_SAMPLE_COVERAGE_ARB", GLboolean,
- ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.SampleCoverage"], "", None ),
( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat,
- ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.SampleCoverageValue"], "", None ),
( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean,
- ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ),
+ ["ctx->Multisample.SampleCoverageInvert"], "", None ),
( "GL_SAMPLE_BUFFERS_ARB", GLint,
- ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ),
+ ["ctx->DrawBuffer->Visual.sampleBuffers"], "", None ),
( "GL_SAMPLES_ARB", GLint,
- ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ),
+ ["ctx->DrawBuffer->Visual.samples"], "", None ),
# GL_IBM_rasterpos_clip
( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean,
@@ -815,30 +815,30 @@ StateVars = [
# GL_ARB_vertex_buffer_object
( "GL_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayBufferObj->Name"], "", None ),
( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", None ),
( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", None ),
( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", None ),
( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", None ),
( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint,
["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"],
- "", ["ARB_vertex_buffer_object"] ),
+ "", None ),
( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint,
- ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
+ ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", None ),
( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint,
["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"],
- "", ["ARB_vertex_buffer_object"] ),
+ "", None ),
( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint,
["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"],
- "", ["ARB_vertex_buffer_object"] ),
+ "", None ),
# GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported
( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint,
["ctx->Array.ElementArrayBufferObj->Name"],
- "", ["ARB_vertex_buffer_object"] ),
+ "", None ),
# GL_EXT_pixel_buffer_object
( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint,
@@ -914,9 +914,9 @@ StateVars = [
# GL_ARB_draw_buffers
( "GL_MAX_DRAW_BUFFERS_ARB", GLint,
- ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ),
+ ["ctx->Const.MaxDrawBuffers"], "", None ),
( "GL_DRAW_BUFFER0_ARB", GLenum,
- ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ),
+ ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ),
( "GL_DRAW_BUFFER1_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -924,7 +924,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", None ),
( "GL_DRAW_BUFFER2_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -932,7 +932,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", None ),
( "GL_DRAW_BUFFER3_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -940,7 +940,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", None ),
# XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future
# GL_OES_read_format
@@ -1009,7 +1009,11 @@ StateVars = [
# close enough for now.
( "GL_CURRENT_PROGRAM", GLint,
["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"],
- "", ["ARB_shader_objects"] )
+ "", ["ARB_shader_objects"] ),
+
+ # GL_ARB_framebuffer_object
+ ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "",
+ ["ARB_framebuffer_object"] )
]
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 94bf5de1e8..a9e22d340a 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -82,7 +82,16 @@ compute_version(const GLcontext *ctx)
ctx->Extensions.ARB_vertex_shader &&
ctx->Extensions.ARB_fragment_shader &&
ctx->Extensions.ARB_texture_non_power_of_two &&
- ctx->Extensions.EXT_blend_equation_separate);
+ ctx->Extensions.EXT_blend_equation_separate &&
+
+ /* Technically, 2.0 requires the functionality
+ * of the EXT version. Enable 2.0 if either
+ * extension is available, and assume that a
+ * driver that only exposes the ATI extension
+ * will fallback to software when necessary.
+ */
+ (ctx->Extensions.EXT_stencil_two_side
+ || ctx->Extensions.ATI_separate_stencil));
const GLboolean ver_2_1 = (ver_2_0 &&
/*ctx->Extensions.ARB_shading_language_120 &&*/
ctx->Extensions.EXT_pixel_buffer_object &&
diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
index dcfa9c7363..e2d4129a38 100644
--- a/src/mesa/main/hint.c
+++ b/src/mesa/main/hint.c
@@ -89,10 +89,6 @@ _mesa_Hint( GLenum target, GLenum mode )
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (!ctx->Extensions.ARB_texture_compression) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return;
- }
if (ctx->Hint.TextureCompression == mode)
return;
FLUSH_VERTICES(ctx, _NEW_HINT);
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 69d55923c3..cb04594c1f 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -952,6 +952,19 @@ _mesa_printf( const char *fmtString, ... )
va_end( args );
}
+/** Wrapper around fprintf(), using vsprintf() for the formatting. */
+void
+_mesa_fprintf( FILE *f, const char *fmtString, ... )
+{
+ char s[MAXSTRING];
+ va_list args;
+ va_start( args, fmtString );
+ vsnprintf(s, MAXSTRING, fmtString, args);
+ va_end( args );
+ fprintf(f, "%s", s);
+}
+
+
/** Wrapper around vsprintf() */
int
_mesa_vsprintf( char *str, const char *fmt, va_list args )
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 92d5d0bb4a..a421eb5e75 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -769,6 +769,9 @@ _mesa_snprintf( char *str, size_t size, const char *fmt, ... );
extern void
_mesa_printf( const char *fmtString, ... );
+extern void
+_mesa_fprintf( FILE *f, const char *fmtString, ... );
+
extern int
_mesa_vsprintf( char *str, const char *fmt, va_list args );
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 0f96f94909..90d142278d 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -42,7 +42,6 @@
#include "matrix.h"
#include "mtypes.h"
#include "math/m_matrix.h"
-#include "math/m_xform.h"
/**
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 3819da3d68..8fb32dd7e9 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -60,6 +60,7 @@
#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL
#define FEATURE_ARB_fragment_program _HAVE_FULL_GL
+#define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL
#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL
#define FEATURE_ARB_vertex_program _HAVE_FULL_GL
#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a61f970685..be982afe39 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -903,7 +903,7 @@ struct gl_light_attrib
/*@{*/
GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */
- GLbitfield _Flags; /**< LIGHT_* flags, see above */
+ GLbitfield _Flags; /**< LIGHT_* flags, see above */
GLfloat _BaseColor[2][3];
/*@}*/
};
@@ -1110,25 +1110,40 @@ struct gl_scissor_attrib
/**
* Stencil attribute group (GL_STENCIL_BUFFER_BIT).
+ *
+ * Three sets of stencil data are tracked so that OpenGL 2.0,
+ * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported
+ * simultaneously. In each of the stencil state arrays, element 0 corresponds
+ * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 /
+ * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the
+ * GL_EXT_stencil_two_side GL_BACK state.
+ *
+ * The derived value \c _BackFace is either 1 or 2 depending on whether or
+ * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled.
+ *
+ * The derived value \c _TestTwoSide is set when the front-face and back-face
+ * stencil state are different.
*/
struct gl_stencil_attrib
{
GLboolean Enabled; /**< Enabled flag */
GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
- GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 1) */
+ GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
GLboolean _TestTwoSide;
- GLenum Function[2]; /**< Stencil function */
- GLenum FailFunc[2]; /**< Fail function */
- GLenum ZPassFunc[2]; /**< Depth buffer pass function */
- GLenum ZFailFunc[2]; /**< Depth buffer fail function */
- GLint Ref[2]; /**< Reference value */
- GLuint ValueMask[2]; /**< Value mask */
- GLuint WriteMask[2]; /**< Write mask */
+ GLubyte _BackFace;
+ GLenum Function[3]; /**< Stencil function */
+ GLenum FailFunc[3]; /**< Fail function */
+ GLenum ZPassFunc[3]; /**< Depth buffer pass function */
+ GLenum ZFailFunc[3]; /**< Depth buffer fail function */
+ GLint Ref[3]; /**< Reference value */
+ GLuint ValueMask[3]; /**< Value mask */
+ GLuint WriteMask[3]; /**< Write mask */
GLuint Clear; /**< Clear value */
};
-#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */
+/** 1D, 2D, 3D, CUBE, RECT, 1D_ARRAY, and 2D_ARRAY targets */
+#define NUM_TEXTURE_TARGETS 7
/**
* An index for each type of texture object
@@ -1421,11 +1436,9 @@ struct gl_texture_object
GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
- GLboolean CompareFlag; /**< GL_SGIX_shadow */
- GLenum CompareOperator; /**< GL_SGIX_shadow */
- GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */
GLenum CompareMode; /**< GL_ARB_shadow */
GLenum CompareFunc; /**< GL_ARB_shadow */
+ GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */
GLenum _Function; /**< Comparison function derived from
* \c CompareOperator, \c CompareMode, and
* \c CompareFunc.
@@ -1434,8 +1447,11 @@ struct gl_texture_object
GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
GLint CropRect[4]; /**< GL_OES_draw_texture */
+ GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */
+ GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */
GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
GLboolean _Complete; /**< Is texture object complete? */
+ GLboolean _RenderToTexture; /**< Any rendering to this texture? */
/** Actual texture images, indexed by [cube face] and [mipmap level] */
struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS];
@@ -1456,23 +1472,20 @@ struct gl_texture_object
/**
* Texture combine environment state.
- *
- * \todo
- * If GL_NV_texture_env_combine4 is ever supported, the arrays in this
- * structure will need to be expanded for 4 elements.
+ * Up to four combiner sources are possible with GL_NV_texture_env_combine4.
*/
struct gl_tex_env_combine_state
{
GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
- GLenum SourceRGB[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
- GLenum SourceA[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
- GLenum OperandRGB[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */
- GLenum OperandA[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */
+ GLenum SourceRGB[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
+ GLenum SourceA[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
+ GLenum OperandRGB[4]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */
+ GLenum OperandA[4]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */
GLuint ScaleShiftRGB; /**< 0, 1 or 2 */
GLuint ScaleShiftA; /**< 0, 1 or 2 */
- GLuint _NumArgsRGB; /**< Number of inputs used for the combine mode. */
- GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */
+ GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */
+ GLuint _NumArgsA; /**< Number of inputs used for the A combiner */
};
@@ -1662,6 +1675,7 @@ struct gl_client_array
{
GLint Size; /**< components per element (1,2,3,4) */
GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */
+ GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */
GLsizei Stride; /**< user-specified stride */
GLsizei StrideB; /**< actual stride in bytes */
const GLubyte *Ptr; /**< Points to array data */
@@ -2151,6 +2165,13 @@ struct gl_shader_program
};
+#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */
+#define GLSL_LOG 0x2 /**< Write shaders to files */
+#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */
+#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */
+#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */
+
+
/**
* Context state for GLSL vertex/fragment shaders.
*/
@@ -2162,6 +2183,7 @@ struct gl_shader_state
GLboolean EmitCondCodes; /**< Use condition codes? */
GLboolean EmitComments; /**< Annotated instructions */
void *MemPool;
+ GLbitfield Flags; /**< Mask of GLSL_x flags */
};
@@ -2263,7 +2285,9 @@ struct gl_renderbuffer
GLenum _ActualFormat; /**< The driver-chosen format */
GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
GL_STENCIL_INDEX. */
- GLenum DataType; /**< Type of values passed to the Get/Put functions */
+ GLenum ColorEncoding; /**< GL_LINEAR or GL_SRGB */
+ GLenum ComponentType; /**< GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
+ GL_UNSIGNED_NORMALIZED or GL_INDEX */
GLubyte RedBits; /**< Bits of red per pixel */
GLubyte GreenBits;
GLubyte BlueBits;
@@ -2271,7 +2295,9 @@ struct gl_renderbuffer
GLubyte IndexBits;
GLubyte DepthBits;
GLubyte StencilBits;
- GLubyte Samples; /**< Number of samples - 0 if not multisampled */
+ GLubyte NumSamples;
+
+ GLenum DataType; /**< Type of values passed to the Get/Put functions */
GLvoid *Data; /**< This may not be used by some kinds of RBs */
/* Used to wrap one renderbuffer around another: */
@@ -2514,6 +2540,8 @@ struct gl_constants
/* GL_ARB_vertex_shader */
GLuint MaxVertexTextureImageUnits;
GLuint MaxVarying; /**< Number of float[4] vectors */
+ /* GL_ARB_framebuffer_object */
+ GLuint MaxSamples;
};
@@ -2535,6 +2563,7 @@ struct gl_extensions
GLboolean ARB_fragment_program;
GLboolean ARB_fragment_program_shadow;
GLboolean ARB_fragment_shader;
+ GLboolean ARB_framebuffer_object;
GLboolean ARB_half_float_pixel;
GLboolean ARB_imaging;
GLboolean ARB_multisample;
@@ -2545,6 +2574,7 @@ struct gl_extensions
GLboolean ARB_shading_language_100;
GLboolean ARB_shading_language_120;
GLboolean ARB_shadow;
+ GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
GLboolean ARB_texture_cube_map;
@@ -2605,8 +2635,10 @@ struct gl_extensions
GLboolean EXT_texture_lod_bias;
GLboolean EXT_texture_mirror_clamp;
GLboolean EXT_texture_sRGB;
+ GLboolean EXT_texture_swizzle;
GLboolean EXT_timer_query;
GLboolean EXT_vertex_array;
+ GLboolean EXT_vertex_array_bgra;
GLboolean EXT_vertex_array_set;
/* vendor extensions */
GLboolean APPLE_client_storage;
@@ -2629,6 +2661,7 @@ struct gl_extensions
GLboolean NV_light_max_exponent;
GLboolean NV_point_sprite;
GLboolean NV_texgen_reflection;
+ GLboolean NV_texture_env_combine4;
GLboolean NV_texture_rectangle;
GLboolean NV_vertex_program;
GLboolean NV_vertex_program1_1;
@@ -2639,8 +2672,6 @@ struct gl_extensions
GLboolean SGIS_generate_mipmap;
GLboolean SGIS_texture_edge_clamp;
GLboolean SGIS_texture_lod;
- GLboolean SGIX_shadow;
- GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
GLboolean TDFX_texture_compression_FXT1;
GLboolean S3_s3tc;
/*@}*/
@@ -2815,6 +2846,10 @@ struct gl_matrix_stack
/*@}*/
+/**
+ * Composite state flags
+ */
+/*@{*/
#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
_NEW_TEXTURE | \
_NEW_POINT | \
@@ -2824,16 +2859,11 @@ struct gl_matrix_stack
#define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \
_NEW_TEXTURE)
-#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX)
-
-
+#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL | \
+ _NEW_COLOR_MATRIX)
+/*@}*/
-/*
- * Forward declaration of display list data types:
- */
-union node;
-typedef union node Node;
/* This has to be included here. */
@@ -2865,21 +2895,31 @@ struct gl_tnl_module
/*@}*/
};
-/* Strictly this is a tnl/ private concept, but it doesn't seem
+
+/**
+ * Display list flags.
+ * Strictly this is a tnl-private concept, but it doesn't seem
* worthwhile adding a tnl private structure just to hold this one bit
* of information:
*/
-#define MESA_DLIST_DANGLING_REFS 0x1
+#define DLIST_DANGLING_REFS 0x1
+
+
+/** Opaque declaration of display list payload data type */
+union gl_dlist_node;
-/* Provide a location where information about a display list can be
+
+/**
+ * Provide a location where information about a display list can be
* collected. Could be extended with driverPrivate structures,
* etc. in the future.
*/
-struct mesa_display_list
+struct gl_display_list
{
- Node *node;
- GLuint id;
- GLbitfield flags;
+ GLuint Name;
+ GLbitfield Flags; /**< DLIST_x flags */
+ /** The dlist commands are in a linked list of nodes */
+ union gl_dlist_node *Head;
};
@@ -2890,10 +2930,8 @@ struct gl_dlist_state
{
GLuint CallDepth; /**< Current recursion calling depth */
- struct mesa_display_list *CurrentList;
- Node *CurrentListPtr; /**< Head of list being compiled */
- GLuint CurrentListNum; /**< Number of the list being compiled */
- Node *CurrentBlock; /**< Pointer to current block of nodes */
+ struct gl_display_list *CurrentList; /**< List currently being compiled */
+ union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */
GLuint CurrentPos; /**< Index into current block of nodes */
GLvertexformat ListVtxfmt;
@@ -3145,8 +3183,6 @@ enum _verbose
VERBOSE_PRIMS = 0x0400,
VERBOSE_VERTS = 0x0800,
VERBOSE_DISASSEM = 0x1000,
- VERBOSE_GLSL = 0x2000,
- VERBOSE_GLSL_DUMP = 0x4000
};
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index b9cfad9216..01b68df7af 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -37,11 +37,6 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
{
GET_CURRENT_CONTEXT(ctx);
- if (!ctx->Extensions.ARB_multisample) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB");
- return;
- }
-
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0);
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 8d24a201f0..52781e048e 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -828,7 +828,7 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state )
/* References ColorMatrix.type (derived above).
*/
- if (new_state & _IMAGE_NEW_TRANSFER_STATE)
+ if (new_state & _MESA_NEW_TRANSFER_STATE)
update_image_transfer_state(ctx);
}
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index 3c37d05b40..38be8266e0 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -1488,11 +1488,16 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
rb->InternalFormat = GL_NONE;
rb->_ActualFormat = GL_NONE;
rb->_BaseFormat = GL_NONE;
- rb->DataType = GL_NONE;
+
+ rb->ComponentType = GL_UNSIGNED_NORMALIZED; /* ARB_fbo */
+ rb->ColorEncoding = GL_LINEAR; /* ARB_fbo */
+
rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0;
rb->IndexBits = 0;
rb->DepthBits = 0;
rb->StencilBits = 0;
+
+ rb->DataType = GL_NONE;
rb->Data = NULL;
/* Point back to ourself so that we don't have to check for Wrapped==NULL
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 718cd99847..0a39279bff 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -173,13 +173,16 @@ update_arrays( GLcontext *ctx )
}
+/**
+ * Update the following fields:
+ * ctx->VertexProgram._Enabled
+ * ctx->FragmentProgram._Enabled
+ * ctx->ATIFragmentShader._Enabled
+ * This needs to be done before texture state validation.
+ */
static void
-update_program(GLcontext *ctx)
+update_program_enables(GLcontext *ctx)
{
- const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
- const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
- const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
-
/* These _Enabled flags indicate if the program is enabled AND valid. */
ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled
&& ctx->VertexProgram.Current->Base.Instructions;
@@ -187,6 +190,25 @@ update_program(GLcontext *ctx)
&& ctx->FragmentProgram.Current->Base.Instructions;
ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled
&& ctx->ATIFragmentShader.Current->Instructions[0];
+}
+
+
+/**
+ * Update vertex/fragment program state. In particular, update these fields:
+ * ctx->VertexProgram._Current
+ * ctx->VertexProgram._TnlProgram,
+ * These point to the highest priority enabled vertex/fragment program or are
+ * NULL if fixed-function processing is to be done.
+ *
+ * This function needs to be called after texture state validation in case
+ * we're generating a fragment program from fixed-function texture state.
+ */
+static void
+update_program(GLcontext *ctx)
+{
+ const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
+ const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
+ const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
/*
* Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current
@@ -432,6 +454,24 @@ _mesa_update_state_locked( GLcontext *ctx )
if (MESA_VERBOSE & VERBOSE_STATE)
_mesa_print_state("_mesa_update_state", new_state);
+ /* Determine which state flags effect vertex/fragment program state */
+ if (ctx->FragmentProgram._MaintainTexEnvProgram) {
+ prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR);
+ }
+ if (ctx->VertexProgram._MaintainTnlProgram) {
+ prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX |
+ _NEW_TRANSFORM | _NEW_POINT |
+ _NEW_FOG | _NEW_LIGHT |
+ _MESA_NEW_NEED_EYE_COORDS);
+ }
+
+ /*
+ * Now update derived state info
+ */
+
+ if (new_state & prog_flags)
+ update_program_enables( ctx );
+
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
_mesa_update_modelview_project( ctx, new_state );
@@ -454,7 +494,7 @@ _mesa_update_state_locked( GLcontext *ctx )
_mesa_update_stencil( ctx );
#if FEATURE_pixel_transfer
- if (new_state & _IMAGE_NEW_TRANSFER_STATE)
+ if (new_state & _MESA_NEW_TRANSFER_STATE)
_mesa_update_pixel( ctx, new_state );
#endif
@@ -491,23 +531,9 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & _MESA_NEW_NEED_EYE_COORDS)
_mesa_update_tnl_spaces( ctx, new_state );
- if (ctx->FragmentProgram._MaintainTexEnvProgram) {
- prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE_MATRIX | _NEW_LIGHT |
- _NEW_RENDERMODE |
- _NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR);
- }
- if (ctx->VertexProgram._MaintainTnlProgram) {
- prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX |
- _NEW_RENDERMODE |
- _NEW_TRANSFORM | _NEW_POINT |
- _NEW_FOG | _NEW_LIGHT |
- _MESA_NEW_NEED_EYE_COORDS);
- }
if (new_state & prog_flags)
update_program( ctx );
-
-
/*
* Give the driver a chance to act upon the new_state flags.
* The driver might plug in different span functions, for example.
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 2a4c38b1f2..b4ea9978d8 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -27,21 +27,6 @@
* \file stencil.c
* Stencil operations.
*
- * Note: There's an incompatibility between GL_EXT_stencil_two_side and
- * OpenGL 2.0's two-sided stencil feature.
- *
- * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the
- * front OR back face state (as set by glActiveStencilFaceEXT) is set.
- *
- * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the
- * front AND back state.
- *
- * So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL
- * 2.0, but not both.
- *
- * Also, note that GL_ATI_separate_stencil is different as well:
- * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs.
- * glStencilFuncSeparate(GLenum face, GLenum func, ...).
*/
@@ -198,6 +183,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
+ const GLint face = ctx->Stencil.ActiveFace;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!validate_stencil_func(ctx, func)) {
@@ -207,9 +193,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
ref = CLAMP( ref, 0, stencilMax );
- if (ctx->Extensions.EXT_stencil_two_side) {
- /* only set active face state */
- const GLint face = ctx->Stencil.ActiveFace;
+ if (face != 0) {
if (ctx->Stencil.Function[face] == func &&
ctx->Stencil.ValueMask[face] == mask &&
ctx->Stencil.Ref[face] == ref)
@@ -218,9 +202,12 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
ctx->Stencil.Function[face] = func;
ctx->Stencil.Ref[face] = ref;
ctx->Stencil.ValueMask[face] = mask;
- if (ctx->Driver.StencilFuncSeparate) {
- ctx->Driver.StencilFuncSeparate(ctx, face ? GL_BACK : GL_FRONT,
- func, ref, mask);
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask);
}
}
else {
@@ -237,7 +224,9 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
if (ctx->Driver.StencilFuncSeparate) {
- ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK,
+ ctx->Driver.StencilFuncSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
func, ref, mask);
}
}
@@ -259,17 +248,23 @@ void GLAPIENTRY
_mesa_StencilMask( GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Extensions.EXT_stencil_two_side) {
- /* only set active face state */
- const GLint face = ctx->Stencil.ActiveFace;
+ if (face != 0) {
+ /* Only modify the EXT_stencil_two_side back-face state.
+ */
if (ctx->Stencil.WriteMask[face] == mask)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.WriteMask[face] = mask;
- if (ctx->Driver.StencilMaskSeparate) {
- ctx->Driver.StencilMaskSeparate(ctx, face ? GL_BACK : GL_FRONT, mask);
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask);
}
}
else {
@@ -280,7 +275,10 @@ _mesa_StencilMask( GLuint mask )
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask;
if (ctx->Driver.StencilMaskSeparate) {
- ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask);
+ ctx->Driver.StencilMaskSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
+ mask);
}
}
}
@@ -304,6 +302,8 @@ void GLAPIENTRY
_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
+
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!validate_stencil_op(ctx, fail)) {
@@ -319,9 +319,8 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
return;
}
- if (ctx->Extensions.EXT_stencil_two_side) {
+ if (face != 0) {
/* only set active face state */
- const GLint face = ctx->Stencil.ActiveFace;
if (ctx->Stencil.ZFailFunc[face] == zfail &&
ctx->Stencil.ZPassFunc[face] == zpass &&
ctx->Stencil.FailFunc[face] == fail)
@@ -330,9 +329,12 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZFailFunc[face] = zfail;
ctx->Stencil.ZPassFunc[face] = zpass;
ctx->Stencil.FailFunc[face] = fail;
- if (ctx->Driver.StencilOpSeparate) {
- ctx->Driver.StencilOpSeparate(ctx, face ? GL_BACK : GL_FRONT,
- fail, zfail, zpass);
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass);
}
}
else {
@@ -349,7 +351,9 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass;
ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail;
if (ctx->Driver.StencilOpSeparate) {
- ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK,
+ ctx->Driver.StencilOpSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
fail, zfail, zpass);
}
}
@@ -372,7 +376,7 @@ _mesa_ActiveStencilFaceEXT(GLenum face)
if (face == GL_FRONT || face == GL_BACK) {
FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 1;
+ ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2;
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
@@ -513,19 +517,16 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask)
void
_mesa_update_stencil(GLcontext *ctx)
{
- if (ctx->Extensions.EXT_stencil_two_side) {
- ctx->Stencil._TestTwoSide = ctx->Stencil.TestTwoSide;
- }
- else {
- ctx->Stencil._TestTwoSide =
- (ctx->Stencil.Function[0] != ctx->Stencil.Function[1] ||
- ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[1] ||
- ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[1] ||
- ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[1] ||
- ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] ||
- ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] ||
- ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1]);
- }
+ const GLint face = ctx->Stencil._BackFace;
+
+ ctx->Stencil._TestTwoSide =
+ (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
+ ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
+ ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||
+ ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] ||
+ ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] ||
+ ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] ||
+ ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]);
}
@@ -544,17 +545,24 @@ _mesa_init_stencil(GLcontext *ctx)
ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 1 = GL_BACK */
ctx->Stencil.Function[0] = GL_ALWAYS;
ctx->Stencil.Function[1] = GL_ALWAYS;
+ ctx->Stencil.Function[2] = GL_ALWAYS;
ctx->Stencil.FailFunc[0] = GL_KEEP;
ctx->Stencil.FailFunc[1] = GL_KEEP;
+ ctx->Stencil.FailFunc[2] = GL_KEEP;
ctx->Stencil.ZPassFunc[0] = GL_KEEP;
ctx->Stencil.ZPassFunc[1] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[2] = GL_KEEP;
ctx->Stencil.ZFailFunc[0] = GL_KEEP;
ctx->Stencil.ZFailFunc[1] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[2] = GL_KEEP;
ctx->Stencil.Ref[0] = 0;
ctx->Stencil.Ref[1] = 0;
+ ctx->Stencil.Ref[2] = 0;
ctx->Stencil.ValueMask[0] = ~0U;
ctx->Stencil.ValueMask[1] = ~0U;
+ ctx->Stencil.ValueMask[2] = ~0U;
ctx->Stencil.WriteMask[0] = ~0U;
ctx->Stencil.WriteMask[1] = ~0U;
+ ctx->Stencil.WriteMask[2] = ~0U;
ctx->Stencil.Clear = 0;
}
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 04f0f3ab13..c1b8c7675a 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -57,66 +57,58 @@ GLuint
_mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all)
{
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 += 2;
- }
+ if (ctx->Extensions.TDFX_texture_compression_FXT1) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
+ formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
}
- if (ctx->Extensions.EXT_texture_compression_s3tc) {
- if (formats) {
- formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- /* This format has some restrictions/limitations and so should
- * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
- * Specifically, all transparent pixels become black. NVIDIA
- * omits this format too.
- */
- if (all)
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
- }
- else {
- n += 3;
- if (all)
- n += 1;
- }
+ else {
+ n += 2;
+ }
+ }
+ if (ctx->Extensions.EXT_texture_compression_s3tc) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ /* This format has some restrictions/limitations and so should
+ * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
+ * Specifically, all transparent pixels become black. NVIDIA
+ * omits this format too.
+ */
+ if (all)
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ }
+ else {
+ n += 3;
+ if (all)
+ n += 1;
+ }
+ }
+ if (ctx->Extensions.S3_s3tc) {
+ if (formats) {
+ formats[n++] = GL_RGB_S3TC;
+ formats[n++] = GL_RGB4_S3TC;
+ formats[n++] = GL_RGBA_S3TC;
+ formats[n++] = GL_RGBA4_S3TC;
+ }
+ else {
+ n += 4;
+ }
+ }
#if FEATURE_EXT_texture_sRGB
- if (ctx->Extensions.EXT_texture_sRGB) {
- if (formats) {
- if (all) {
- /* according to sRGB spec, these should not be returned
- via the GL_COMPRESSED_TEXTURE_FORMATS query as they
- aren't really general purpose */
- formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
- }
- }
- else {
- if (all)
- n += 4;
- }
- }
-#endif /* FEATURE_EXT_texture_sRGB */
+ if (ctx->Extensions.EXT_texture_sRGB) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
}
- if (ctx->Extensions.S3_s3tc) {
- if (formats) {
- formats[n++] = GL_RGB_S3TC;
- formats[n++] = GL_RGB4_S3TC;
- formats[n++] = GL_RGBA_S3TC;
- formats[n++] = GL_RGBA4_S3TC;
- }
- else {
- n += 4;
- }
+ else {
+ n += 4;
}
}
+#endif /* FEATURE_EXT_texture_sRGB */
return n;
}
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index e072cea136..95547a500e 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -1,8 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.5
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -34,7 +35,415 @@
#include "main/enums.h"
#include "main/macros.h"
#include "main/texenv.h"
-#include "math/m_xform.h"
+
+
+#define TE_ERROR(errCode, msg, value) \
+ _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
+
+
+/** Set texture env mode */
+static void
+set_env_mode(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum mode)
+{
+ GLboolean legal;
+
+ if (texUnit->EnvMode == mode)
+ return;
+
+ switch (mode) {
+ case GL_MODULATE:
+ case GL_BLEND:
+ case GL_DECAL:
+ case GL_REPLACE:
+ legal = GL_TRUE;
+ break;
+ case GL_REPLACE_EXT:
+ mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */
+ legal = GL_TRUE;
+ break;
+ case GL_ADD:
+ legal = ctx->Extensions.EXT_texture_env_add;
+ break;
+ case GL_COMBINE:
+ legal = (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine);
+ break;
+ case GL_COMBINE4_NV:
+ legal = ctx->Extensions.NV_texture_env_combine4;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (legal) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->EnvMode = mode;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ }
+}
+
+
+static void
+set_env_color(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ const GLfloat *color)
+{
+ GLfloat tmp[4];
+ tmp[0] = CLAMP(color[0], 0.0F, 1.0F);
+ tmp[1] = CLAMP(color[1], 0.0F, 1.0F);
+ tmp[2] = CLAMP(color[2], 0.0F, 1.0F);
+ tmp[3] = CLAMP(color[3], 0.0F, 1.0F);
+ if (TEST_EQ_4V(tmp, texUnit->EnvColor))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ COPY_4FV(texUnit->EnvColor, tmp);
+}
+
+
+/** Set an RGB or A combiner mode/function */
+static void
+set_combiner_mode(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum mode)
+{
+ GLboolean legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ switch (mode) {
+ case GL_REPLACE:
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_INTERPOLATE:
+ legal = GL_TRUE;
+ break;
+ case GL_SUBTRACT:
+ legal = ctx->Extensions.ARB_texture_env_combine;
+ break;
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ legal = (ctx->Extensions.EXT_texture_env_dot3 &&
+ pname == GL_COMBINE_RGB);
+ break;
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ legal = (ctx->Extensions.ARB_texture_env_dot3 &&
+ pname == GL_COMBINE_RGB);
+ break;
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ legal =ctx->Extensions.ATI_texture_env_combine3;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ return;
+ }
+
+ switch (pname) {
+ case GL_COMBINE_RGB:
+ if (texUnit->Combine.ModeRGB == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ModeRGB = mode;
+ break;
+
+ case GL_COMBINE_ALPHA:
+ if (texUnit->Combine.ModeA == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ModeA = mode;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ }
+}
+
+
+
+/** Set an RGB or A combiner source term */
+static void
+set_combiner_source(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum param)
+{
+ GLuint src;
+ GLboolean alpha, legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ /*
+ * Translate pname to (src, alpha).
+ */
+ switch (pname) {
+ case GL_SOURCE0_RGB:
+ src = 0;
+ alpha = GL_FALSE;
+ break;
+ case GL_SOURCE1_RGB:
+ src = 1;
+ alpha = GL_FALSE;
+ break;
+ case GL_SOURCE2_RGB:
+ src = 2;
+ alpha = GL_FALSE;
+ break;
+ case GL_SOURCE3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ src = 3;
+ alpha = GL_FALSE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ case GL_SOURCE0_ALPHA:
+ src = 0;
+ alpha = GL_TRUE;
+ break;
+ case GL_SOURCE1_ALPHA:
+ src = 1;
+ alpha = GL_TRUE;
+ break;
+ case GL_SOURCE2_ALPHA:
+ src = 2;
+ alpha = GL_TRUE;
+ break;
+ case GL_SOURCE3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ src = 3;
+ alpha = GL_TRUE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ assert(src < 4);
+
+ /*
+ * Error-check param (the source term)
+ */
+ switch (param) {
+ case GL_TEXTURE:
+ case GL_CONSTANT:
+ case GL_PRIMARY_COLOR:
+ case GL_PREVIOUS:
+ legal = GL_TRUE;
+ break;
+ case GL_TEXTURE0:
+ case GL_TEXTURE1:
+ case GL_TEXTURE2:
+ case GL_TEXTURE3:
+ case GL_TEXTURE4:
+ case GL_TEXTURE5:
+ case GL_TEXTURE6:
+ case GL_TEXTURE7:
+ legal = (ctx->Extensions.ARB_texture_env_crossbar &&
+ param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits);
+ break;
+ case GL_ZERO:
+ legal = (ctx->Extensions.ATI_texture_env_combine3 ||
+ ctx->Extensions.NV_texture_env_combine4);
+ break;
+ case GL_ONE:
+ legal = ctx->Extensions.ATI_texture_env_combine3;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ if (alpha)
+ texUnit->Combine.SourceA[src] = param;
+ else
+ texUnit->Combine.SourceRGB[src] = param;
+}
+
+
+/** Set an RGB or A combiner operand term */
+static void
+set_combiner_operand(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum param)
+{
+ GLuint op;
+ GLboolean alpha, legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ switch (pname) {
+ case GL_OPERAND0_RGB:
+ op = 0;
+ alpha = GL_FALSE;
+ break;
+ case GL_OPERAND1_RGB:
+ op = 1;
+ alpha = GL_FALSE;
+ break;
+ case GL_OPERAND2_RGB:
+ if (ctx->Extensions.ARB_texture_env_combine) {
+ op = 2;
+ alpha = GL_FALSE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ case GL_OPERAND3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ op = 3;
+ alpha = GL_FALSE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ case GL_OPERAND0_ALPHA:
+ op = 0;
+ alpha = GL_TRUE;
+ break;
+ case GL_OPERAND1_ALPHA:
+ op = 1;
+ alpha = GL_TRUE;
+ break;
+ case GL_OPERAND2_ALPHA:
+ if (ctx->Extensions.ARB_texture_env_combine) {
+ op = 2;
+ alpha = GL_TRUE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ case GL_OPERAND3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ op = 3;
+ alpha = GL_TRUE;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ assert(op < 4);
+
+ /*
+ * Error-check param (the source operand)
+ */
+ switch (param) {
+ case GL_SRC_COLOR:
+ case GL_ONE_MINUS_SRC_COLOR:
+ legal = !alpha;
+ break;
+ case GL_SRC_ALPHA:
+ case GL_ONE_MINUS_SRC_ALPHA:
+ legal = GL_TRUE;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ if (alpha)
+ texUnit->Combine.OperandA[op] = param;
+ else
+ texUnit->Combine.OperandRGB[op] = param;
+}
+
+
+static void
+set_combiner_scale(GLcontext *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLfloat scale)
+{
+ GLuint shift;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ if (scale == 1.0F) {
+ shift = 0;
+ }
+ else if (scale == 2.0F) {
+ shift = 1;
+ }
+ else if (scale == 4.0F) {
+ shift = 2;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" );
+ return;
+ }
+
+ switch (pname) {
+ case GL_RGB_SCALE:
+ if (texUnit->Combine.ScaleShiftRGB == shift)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ScaleShiftRGB = shift;
+ break;
+ case GL_ALPHA_SCALE:
+ if (texUnit->Combine.ScaleShiftA == shift)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ScaleShiftA = shift;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ }
+}
@@ -55,377 +464,41 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
-#define TE_ERROR(errCode, msg, value) \
- _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
-
if (target == GL_TEXTURE_ENV) {
switch (pname) {
case GL_TEXTURE_ENV_MODE:
- {
- GLenum mode = (GLenum) (GLint) *param;
- if (mode == GL_REPLACE_EXT)
- mode = GL_REPLACE;
- if (texUnit->EnvMode == mode)
- return;
- 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 */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->EnvMode = mode;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- }
+ set_env_mode(ctx, texUnit, (GLenum) (GLint) param[0]);
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);
- }
+ set_env_color(ctx, texUnit, param);
break;
case GL_COMBINE_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const GLenum mode = (GLenum) (GLint) *param;
- if (texUnit->Combine.ModeRGB == mode)
- return;
- switch (mode) {
- case GL_REPLACE:
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_INTERPOLATE:
- /* OK */
- break;
- case GL_SUBTRACT:
- if (!ctx->Extensions.ARB_texture_env_combine) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- break;
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- if (!ctx->Extensions.EXT_texture_env_dot3) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- break;
- 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;
- }
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ModeRGB = mode;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- break;
case GL_COMBINE_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const GLenum mode = (GLenum) (GLint) *param;
- if (texUnit->Combine.ModeA == mode)
- return;
- switch (mode) {
- case GL_REPLACE:
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_INTERPOLATE:
- /* OK */
- break;
- 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;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ModeA = mode;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
+ set_combiner_mode(ctx, texUnit, pname, (GLenum) (GLint) param[0]);
break;
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) {
- const GLenum source = (GLenum) (GLint) *param;
- const GLuint s = pname - GL_SOURCE0_RGB;
- if (texUnit->Combine.SourceRGB[s] == source)
- return;
- 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 */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.SourceRGB[s] = source;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
- return;
- }
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- break;
+ case GL_SOURCE3_RGB_NV:
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) {
- const GLenum source = (GLenum) (GLint) *param;
- const GLuint s = pname - GL_SOURCE0_ALPHA;
- if (texUnit->Combine.SourceA[s] == source)
- return;
- 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 */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.SourceA[s] = source;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source);
- return;
- }
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
+ case GL_SOURCE3_ALPHA_NV:
+ set_combiner_source(ctx, texUnit, pname, (GLenum) (GLint) param[0]);
break;
case GL_OPERAND0_RGB:
case GL_OPERAND1_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- const GLuint s = pname - GL_OPERAND0_RGB;
- if (texUnit->Combine.OperandRGB[s] == operand)
- return;
- switch (operand) {
- case GL_SRC_COLOR:
- case GL_ONE_MINUS_SRC_COLOR:
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.OperandRGB[s] = 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:
+ case GL_OPERAND3_RGB_NV:
case GL_OPERAND0_ALPHA:
case GL_OPERAND1_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand)
- return;
- switch (operand) {
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = 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:
- if (ctx->Extensions.ARB_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- if (texUnit->Combine.OperandRGB[2] == operand)
- return;
- 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 */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.OperandRGB[2] = operand;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
- return;
- }
- }
- else if (ctx->Extensions.EXT_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- if (texUnit->Combine.OperandRGB[2] == operand)
- return;
- /* operand must be GL_SRC_ALPHA which is the initial value - thus
- don't need to actually compare the operand to the possible value */
- else {
- 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:
- if (ctx->Extensions.ARB_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- if (texUnit->Combine.OperandA[2] == operand)
- return;
- switch (operand) {
- case GL_SRC_ALPHA:
- case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.OperandA[2] = operand;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
- return;
- }
- }
- else if (ctx->Extensions.EXT_texture_env_combine) {
- const GLenum operand = (GLenum) (GLint) *param;
- if (texUnit->Combine.OperandA[2] == operand)
- return;
- /* operand must be GL_SRC_ALPHA which is the initial value - thus
- don't need to actually compare the operand to the possible value */
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
- return;
- }
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
+ case GL_OPERAND3_ALPHA_NV:
+ set_combiner_operand(ctx, texUnit, pname, (GLenum) (GLint) param[0]);
break;
case GL_RGB_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- GLuint newshift;
- if (*param == 1.0) {
- newshift = 0;
- }
- else if (*param == 2.0) {
- newshift = 1;
- }
- else if (*param == 4.0) {
- newshift = 2;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE,
- "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" );
- return;
- }
- if (texUnit->Combine.ScaleShiftRGB == newshift)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ScaleShiftRGB = newshift;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- break;
case GL_ALPHA_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- GLuint newshift;
- if (*param == 1.0) {
- newshift = 0;
- }
- else if (*param == 2.0) {
- newshift = 1;
- }
- else if (*param == 4.0) {
- newshift = 2;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE,
- "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" );
- return;
- }
- if (texUnit->Combine.ScaleShiftA == newshift)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ScaleShiftA = newshift;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
+ set_combiner_scale(ctx, texUnit, pname, param[0]);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" );
@@ -533,6 +606,144 @@ _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
}
+
+/**
+ * Helper for glGetTexEnvi/f()
+ * \return value of queried pname or -1 if error.
+ */
+static GLint
+get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+ GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_ENV_MODE:
+ return texUnit->EnvMode;
+ break;
+ case GL_COMBINE_RGB:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return texUnit->Combine.ModeRGB;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_COMBINE_ALPHA:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return texUnit->Combine.ModeA;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ 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) {
+ const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
+ return texUnit->Combine.SourceRGB[rgb_idx];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.SourceRGB[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ 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) {
+ const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
+ return texUnit->Combine.SourceA[alpha_idx];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.SourceA[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ 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) {
+ const unsigned op_rgb = pname - GL_OPERAND0_RGB;
+ return texUnit->Combine.OperandRGB[op_rgb];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.OperandRGB[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ 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) {
+ const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
+ return texUnit->Combine.OperandA[op_alpha];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.OperandA[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_RGB_SCALE:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return 1 << texUnit->Combine.ScaleShiftRGB;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_ALPHA_SCALE:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return 1 << texUnit->Combine.ScaleShiftA;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ default:
+ ;
+ }
+
+ return -1; /* error */
+}
+
+
+
void GLAPIENTRY
_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
{
@@ -551,111 +762,14 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
if (target == GL_TEXTURE_ENV) {
- switch (pname) {
- case GL_TEXTURE_ENV_MODE:
- *params = ENUM_TO_FLOAT(texUnit->EnvMode);
- break;
- case GL_TEXTURE_ENV_COLOR:
- COPY_4FV( params, texUnit->EnvColor );
- break;
- case GL_COMBINE_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- *params = (GLfloat) texUnit->Combine.ModeRGB;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_COMBINE_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- *params = (GLfloat) texUnit->Combine.ModeA;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- 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) {
- const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
- *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- 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) {
- const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
- *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- 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) {
- const unsigned op_rgb = pname - GL_OPERAND0_RGB;
- *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- 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) {
- const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
- *params = (GLfloat) texUnit->Combine.OperandA[op_alpha];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_RGB_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- if (texUnit->Combine.ScaleShiftRGB == 0)
- *params = 1.0;
- else if (texUnit->Combine.ScaleShiftRGB == 1)
- *params = 2.0;
- else
- *params = 4.0;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- return;
- }
- break;
- case GL_ALPHA_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- if (texUnit->Combine.ScaleShiftA == 0)
- *params = 1.0;
- else if (texUnit->Combine.ScaleShiftA == 1)
- *params = 2.0;
- else
- *params = 4.0;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- return;
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname);
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ COPY_4FV( params, texUnit->EnvColor );
+ }
+ else {
+ GLint val = get_texenvi(ctx, texUnit, pname);
+ if (val >= 0) {
+ *params = (GLfloat) val;
+ }
}
}
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
@@ -712,115 +826,17 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
if (target == GL_TEXTURE_ENV) {
- switch (pname) {
- case GL_TEXTURE_ENV_MODE:
- *params = (GLint) texUnit->EnvMode;
- break;
- case GL_TEXTURE_ENV_COLOR:
- params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] );
- params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] );
- params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] );
- params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
- break;
- case GL_COMBINE_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- *params = (GLint) texUnit->Combine.ModeRGB;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- case GL_COMBINE_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- *params = (GLint) texUnit->Combine.ModeA;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- 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) {
- const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
- *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- 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) {
- const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
- *params = (GLint) texUnit->Combine.SourceA[alpha_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- 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) {
- const unsigned op_rgb = pname - GL_OPERAND0_RGB;
- *params = (GLint) texUnit->Combine.OperandRGB[op_rgb];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- 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) {
- const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
- *params = (GLint) texUnit->Combine.OperandA[op_alpha];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- }
- break;
- case GL_RGB_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- if (texUnit->Combine.ScaleShiftRGB == 0)
- *params = 1;
- else if (texUnit->Combine.ScaleShiftRGB == 1)
- *params = 2;
- else
- *params = 4;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- return;
- }
- break;
- case GL_ALPHA_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- if (texUnit->Combine.ScaleShiftA == 0)
- *params = 1;
- else if (texUnit->Combine.ScaleShiftA == 1)
- *params = 2;
- else
- *params = 4;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)");
- return;
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)",
- pname);
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] );
+ params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] );
+ params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] );
+ params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
+ }
+ else {
+ GLint val = get_texenvi(ctx, texUnit, pname);
+ if (val >= 0) {
+ *params = val;
+ }
}
}
else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 48abf51d89..af51a206a5 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -2,6 +2,7 @@
*
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
+ * Copyright 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
@@ -38,6 +39,9 @@
#include "texenvprogram.h"
+#define MAX_TERMS 4
+
+
/*
* Note on texture units:
*
@@ -89,13 +93,13 @@ struct state_key {
GLuint ScaleShiftRGB:2;
GLuint ScaleShiftA:2;
- GLuint NumArgsRGB:2;
+ GLuint NumArgsRGB:3;
GLuint ModeRGB:4;
- GLuint NumArgsA:2;
- GLuint ModeA:4;
+ struct mode_opt OptRGB[MAX_TERMS];
- struct mode_opt OptRGB[3];
- struct mode_opt OptA[3];
+ GLuint NumArgsA:3;
+ GLuint ModeA:4;
+ struct mode_opt OptA[MAX_TERMS];
} unit[8];
};
@@ -131,7 +135,9 @@ static GLuint translate_operand( GLenum operand )
case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA;
case GL_ZERO: return OPR_ZERO;
case GL_ONE: return OPR_ONE;
- default: return OPR_UNKNOWN;
+ default:
+ assert(0);
+ return OPR_UNKNOWN;
}
}
@@ -147,6 +153,7 @@ static GLuint translate_operand( GLenum operand )
#define SRC_CONSTANT 9
#define SRC_PRIMARY_COLOR 10
#define SRC_PREVIOUS 11
+#define SRC_ZERO 12
#define SRC_UNKNOWN 15
static GLuint translate_source( GLenum src )
@@ -164,32 +171,49 @@ static GLuint translate_source( GLenum src )
case GL_CONSTANT: return SRC_CONSTANT;
case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR;
case GL_PREVIOUS: return SRC_PREVIOUS;
- default: return SRC_UNKNOWN;
+ case GL_ZERO:
+ return SRC_ZERO;
+ default:
+ assert(0);
+ return SRC_UNKNOWN;
}
}
-#define MODE_REPLACE 0
-#define MODE_MODULATE 1
-#define MODE_ADD 2
-#define MODE_ADD_SIGNED 3
-#define MODE_INTERPOLATE 4
-#define MODE_SUBTRACT 5
-#define MODE_DOT3_RGB 6
-#define MODE_DOT3_RGB_EXT 7
-#define MODE_DOT3_RGBA 8
-#define MODE_DOT3_RGBA_EXT 9
-#define MODE_MODULATE_ADD_ATI 10
-#define MODE_MODULATE_SIGNED_ADD_ATI 11
-#define MODE_MODULATE_SUBTRACT_ATI 12
-#define MODE_UNKNOWN 15
-
-static GLuint translate_mode( GLenum mode )
+#define MODE_REPLACE 0 /* r = a0 */
+#define MODE_MODULATE 1 /* r = a0 * a1 */
+#define MODE_ADD 2 /* r = a0 + a1 */
+#define MODE_ADD_SIGNED 3 /* r = a0 + a1 - 0.5 */
+#define MODE_INTERPOLATE 4 /* r = a0 * a2 + a1 * (1 - a2) */
+#define MODE_SUBTRACT 5 /* r = a0 - a1 */
+#define MODE_DOT3_RGB 6 /* r = a0 . a1 */
+#define MODE_DOT3_RGB_EXT 7 /* r = a0 . a1 */
+#define MODE_DOT3_RGBA 8 /* r = a0 . a1 */
+#define MODE_DOT3_RGBA_EXT 9 /* r = a0 . a1 */
+#define MODE_MODULATE_ADD_ATI 10 /* r = a0 * a2 + a1 */
+#define MODE_MODULATE_SIGNED_ADD_ATI 11 /* r = a0 * a2 + a1 - 0.5 */
+#define MODE_MODULATE_SUBTRACT_ATI 12 /* r = a0 * a2 - a1 */
+#define MODE_ADD_PRODUCTS 13 /* r = a0 * a1 + a2 * a3 */
+#define MODE_ADD_PRODUCTS_SIGNED 14 /* r = a0 * a1 + a2 * a3 - 0.5 */
+#define MODE_UNKNOWN 15
+
+/**
+ * Translate GL combiner state into a MODE_x value
+ */
+static GLuint translate_mode( GLenum envMode, GLenum mode )
{
switch (mode) {
case GL_REPLACE: return MODE_REPLACE;
case GL_MODULATE: return MODE_MODULATE;
- case GL_ADD: return MODE_ADD;
- case GL_ADD_SIGNED: return MODE_ADD_SIGNED;
+ case GL_ADD:
+ if (envMode == GL_COMBINE4_NV)
+ return MODE_ADD_PRODUCTS;
+ else
+ return MODE_ADD;
+ case GL_ADD_SIGNED:
+ if (envMode == GL_COMBINE4_NV)
+ return MODE_ADD_PRODUCTS_SIGNED;
+ else
+ return MODE_ADD_SIGNED;
case GL_INTERPOLATE: return MODE_INTERPOLATE;
case GL_SUBTRACT: return MODE_SUBTRACT;
case GL_DOT3_RGB: return MODE_DOT3_RGB;
@@ -199,7 +223,9 @@ static GLuint translate_mode( GLenum mode )
case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI;
case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI;
case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI;
- default: return MODE_UNKNOWN;
+ default:
+ assert(0);
+ return MODE_UNKNOWN;
}
}
@@ -209,14 +235,16 @@ static GLuint translate_tex_src_bit( GLbitfield bit )
/* make sure number of switch cases is correct */
assert(NUM_TEXTURE_TARGETS == 7);
switch (bit) {
- case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX;
- case TEXTURE_2D_BIT: return TEXTURE_2D_INDEX;
- case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX;
- case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX;
- case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX;
- case TEXTURE_1D_ARRAY_BIT: return TEXTURE_1D_ARRAY_INDEX;
- case TEXTURE_2D_ARRAY_BIT: return TEXTURE_2D_ARRAY_INDEX;
- default: return TEXTURE_UNKNOWN_INDEX;
+ case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX;
+ case TEXTURE_2D_BIT: return TEXTURE_2D_INDEX;
+ case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX;
+ case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX;
+ case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX;
+ case TEXTURE_1D_ARRAY_BIT: return TEXTURE_1D_ARRAY_INDEX;
+ case TEXTURE_2D_ARRAY_BIT: return TEXTURE_2D_ARRAY_INDEX;
+ default:
+ assert(0);
+ return TEXTURE_UNKNOWN_INDEX;
}
}
@@ -352,14 +380,14 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA;
key->unit[i].ModeRGB =
- translate_mode(texUnit->_CurrentCombine->ModeRGB);
+ translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeRGB);
key->unit[i].ModeA =
- translate_mode(texUnit->_CurrentCombine->ModeA);
+ translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeA);
key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB;
key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA;
- for (j=0;j<3;j++) {
+ for (j = 0; j < MAX_TERMS; j++) {
key->unit[i].OptRGB[j].Operand =
translate_operand(texUnit->_CurrentCombine->OperandRGB[j]);
key->unit[i].OptA[j].Operand =
@@ -821,12 +849,17 @@ static struct ureg get_source( struct texenv_fragment_program *p,
case SRC_PRIMARY_COLOR:
return register_input(p, FRAG_ATTRIB_COL0);
+ case SRC_ZERO:
+ return get_zero(p);
+
case SRC_PREVIOUS:
- default:
if (is_undef(p->src_previous))
return register_input(p, FRAG_ATTRIB_COL0);
else
return p->src_previous;
+
+ default:
+ assert(0);
}
}
@@ -867,7 +900,9 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p,
case OPR_ONE:
return get_one(p);
case OPR_SRC_COLOR:
+ return src;
default:
+ assert(0);
return src;
}
}
@@ -916,10 +951,12 @@ static struct ureg emit_combine( struct texenv_fragment_program *p,
GLuint mode,
const struct mode_opt *opt)
{
- struct ureg src[3];
+ struct ureg src[MAX_TERMS];
struct ureg tmp, half;
GLuint i;
+ assert(nr <= MAX_TERMS);
+
tmp = undef; /* silence warning (bug 5318) */
for (i = 0; i < nr; i++)
@@ -995,7 +1032,26 @@ static struct ureg emit_combine( struct texenv_fragment_program *p,
/* Arg0 * Arg2 - Arg1 */
emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) );
return dest;
+ case MODE_ADD_PRODUCTS:
+ /* Arg0 * Arg1 + Arg2 * Arg3 */
+ {
+ struct ureg tmp0 = get_temp(p);
+ emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
+ emit_arith( p, OPCODE_MAD, dest, mask, saturate, src[2], src[3], tmp0 );
+ }
+ return dest;
+ case MODE_ADD_PRODUCTS_SIGNED:
+ /* Arg0 * Arg1 + Arg2 * Arg3 - 0.5 */
+ {
+ struct ureg tmp0 = get_temp(p);
+ half = get_half(p);
+ emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
+ emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[2], src[3], tmp0 );
+ emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef );
+ }
+ return dest;
default:
+ assert(0);
return src[0];
}
}
@@ -1152,6 +1208,7 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p,
break;
default:
+ /* not a texture src - do nothing */
break;
}
@@ -1348,42 +1405,3 @@ _mesa_get_fixed_func_fragment_program(GLcontext *ctx)
return prog;
}
-
-
-
-/**
- * If _MaintainTexEnvProgram is set we'll generate a fragment program that
- * implements the current texture env/combine mode.
- * This function generates that program and puts it into effect.
- *
- * XXX: remove this function. currently only called by some drivers,
- * not by mesa core. We now handle this properly from inside mesa.
- */
-void
-_mesa_UpdateTexEnvProgram( GLcontext *ctx )
-{
- const struct gl_fragment_program *prev = ctx->FragmentProgram._Current;
-
- ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram);
-
- /* If a conventional fragment program/shader isn't in effect... */
- if (!ctx->FragmentProgram._Enabled &&
- (!ctx->Shader.CurrentProgram ||
- !ctx->Shader.CurrentProgram->FragmentProgram) )
- {
- struct gl_fragment_program *newProg;
-
- newProg = _mesa_get_fixed_func_fragment_program(ctx);
-
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, newProg);
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, newProg);
- }
-
- /* Tell the driver about the change. Could define a new target for
- * this?
- */
- if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) {
- ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB,
- (struct gl_program *) ctx->FragmentProgram._Current);
- }
-}
diff --git a/src/mesa/main/texenvprogram.h b/src/mesa/main/texenvprogram.h
index a7aa60cf37..0a162d2e7a 100644
--- a/src/mesa/main/texenvprogram.h
+++ b/src/mesa/main/texenvprogram.h
@@ -32,6 +32,4 @@
extern struct gl_fragment_program *
_mesa_get_fixed_func_fragment_program(GLcontext *ctx);
-extern void _mesa_UpdateTexEnvProgram( GLcontext *ctx );
-
#endif
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index f49c916b33..16d05cc7d0 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1506,41 +1506,39 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
}
}
- if (ctx->Extensions.ARB_texture_compression) {
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA_ARB:
- return &_mesa_texformat_alpha;
- case GL_COMPRESSED_LUMINANCE_ARB:
- return &_mesa_texformat_luminance;
- case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
- return &_mesa_texformat_luminance_alpha;
- case GL_COMPRESSED_INTENSITY_ARB:
- return &_mesa_texformat_intensity;
- case GL_COMPRESSED_RGB_ARB:
+ switch (internalFormat) {
+ case GL_COMPRESSED_ALPHA_ARB:
+ return &_mesa_texformat_alpha;
+ case GL_COMPRESSED_LUMINANCE_ARB:
+ return &_mesa_texformat_luminance;
+ case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
+ return &_mesa_texformat_luminance_alpha;
+ case GL_COMPRESSED_INTENSITY_ARB:
+ return &_mesa_texformat_intensity;
+ case GL_COMPRESSED_RGB_ARB:
#if FEATURE_texture_fxt1
- if (ctx->Extensions.TDFX_texture_compression_FXT1)
- return &_mesa_texformat_rgb_fxt1;
+ if (ctx->Extensions.TDFX_texture_compression_FXT1)
+ return &_mesa_texformat_rgb_fxt1;
#endif
#if FEATURE_texture_s3tc
- if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
- return &_mesa_texformat_rgb_dxt1;
+ if (ctx->Extensions.EXT_texture_compression_s3tc ||
+ ctx->Extensions.S3_s3tc)
+ return &_mesa_texformat_rgb_dxt1;
#endif
- return &_mesa_texformat_rgb;
- case GL_COMPRESSED_RGBA_ARB:
+ return &_mesa_texformat_rgb;
+ case GL_COMPRESSED_RGBA_ARB:
#if FEATURE_texture_fxt1
- if (ctx->Extensions.TDFX_texture_compression_FXT1)
- return &_mesa_texformat_rgba_fxt1;
+ if (ctx->Extensions.TDFX_texture_compression_FXT1)
+ return &_mesa_texformat_rgba_fxt1;
#endif
#if FEATURE_texture_s3tc
- if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
- return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
+ if (ctx->Extensions.EXT_texture_compression_s3tc ||
+ ctx->Extensions.S3_s3tc)
+ return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
#endif
- return &_mesa_texformat_rgba;
- default:
- ; /* fallthrough */
- }
+ return &_mesa_texformat_rgba;
+ default:
+ ; /* fallthrough */
}
if (ctx->Extensions.MESA_ycbcr_texture) {
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h
index 08b6d8f12f..275340cabd 100644
--- a/src/mesa/main/texformat_tmp.h
+++ b/src/mesa/main/texformat_tmp.h
@@ -1223,11 +1223,11 @@ static void store_texel_srgb8(struct gl_texture_image *texImage,
static void FETCH(srgba8)(const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
- texel[RCOMP] = nonlinear_to_linear(src[0]);
- texel[GCOMP] = nonlinear_to_linear(src[1]);
- texel[BCOMP] = nonlinear_to_linear(src[2]);
- texel[ACOMP] = UBYTE_TO_FLOAT(src[3]); /* linear! */
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ texel[RCOMP] = nonlinear_to_linear( (s >> 24) );
+ texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
+ texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
+ texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */
}
#if DIM == 3
@@ -1235,11 +1235,8 @@ static void store_texel_srgba8(struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, const void *texel)
{
const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
- dst[0] = rgba[RCOMP];
- dst[1] = rgba[GCOMP];
- dst[2] = rgba[BCOMP];
- dst[3] = rgba[ACOMP];
+ GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
}
#endif
@@ -1247,11 +1244,11 @@ static void store_texel_srgba8(struct gl_texture_image *texImage,
static void FETCH(sargb8)(const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
- texel[RCOMP] = nonlinear_to_linear(src[1]);
- texel[GCOMP] = nonlinear_to_linear(src[2]);
- texel[BCOMP] = nonlinear_to_linear(src[3]);
- texel[ACOMP] = UBYTE_TO_FLOAT(src[0]); /* linear! */
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
+ texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
+ texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff );
+ texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
}
#if DIM == 3
@@ -1259,11 +1256,8 @@ static void store_texel_sargb8(struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, const void *texel)
{
const GLubyte *rgba = (const GLubyte *) texel;
- GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
- dst[0] = rgba[ACOMP];
- dst[1] = rgba[RCOMP];
- dst[2] = rgba[GCOMP];
- dst[3] = rgba[BCOMP];
+ GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
}
#endif
diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index 244c7aaafc..d2baecb92a 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -34,7 +34,7 @@
#include "main/enums.h"
#include "main/macros.h"
#include "main/texgen.h"
-#include "math/m_xform.h"
+#include "math/m_matrix.h"
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index a5e0db736e..8fd69c4f6a 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,8 +1,9 @@
/*
* mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.5
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -37,6 +38,7 @@
#endif
#include "fbobject.h"
#include "framebuffer.h"
+#include "hash.h"
#include "image.h"
#include "imports.h"
#include "macros.h"
@@ -253,23 +255,21 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
}
}
- if (ctx->Extensions.ARB_texture_compression) {
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA:
- return GL_ALPHA;
- case GL_COMPRESSED_LUMINANCE:
- return GL_LUMINANCE;
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return GL_LUMINANCE_ALPHA;
- case GL_COMPRESSED_INTENSITY:
- return GL_INTENSITY;
- case GL_COMPRESSED_RGB:
- return GL_RGB;
- case GL_COMPRESSED_RGBA:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
+ switch (internalFormat) {
+ case GL_COMPRESSED_ALPHA:
+ return GL_ALPHA;
+ case GL_COMPRESSED_LUMINANCE:
+ return GL_LUMINANCE;
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
+ return GL_LUMINANCE_ALPHA;
+ case GL_COMPRESSED_INTENSITY:
+ return GL_INTENSITY;
+ case GL_COMPRESSED_RGB:
+ return GL_RGB;
+ case GL_COMPRESSED_RGBA:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
}
if (ctx->Extensions.TDFX_texture_compression_FXT1) {
@@ -925,6 +925,7 @@ struct gl_texture_image *
_mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level)
{
struct gl_texture_image *texImage;
+ GLuint texIndex;
if (level < 0 )
return NULL;
@@ -933,111 +934,54 @@ _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level)
case GL_PROXY_TEXTURE_1D:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_1D_INDEX;
+ break;
case GL_PROXY_TEXTURE_2D:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_2D_INDEX;
+ break;
case GL_PROXY_TEXTURE_3D:
if (level >= ctx->Const.Max3DTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_3D_INDEX;
+ break;
case GL_PROXY_TEXTURE_CUBE_MAP:
if (level >= ctx->Const.MaxCubeTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_CUBE_INDEX;
+ break;
case GL_PROXY_TEXTURE_RECTANGLE_NV:
if (level > 0)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_RECT_INDEX;
+ break;
case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_1D_ARRAY_INDEX;
+ break;
case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX];
- }
- return texImage;
+ texIndex = TEXTURE_2D_ARRAY_INDEX;
+ break;
default:
return NULL;
}
+
+ texImage = ctx->Texture.ProxyTex[texIndex]->Image[0][level];
+ if (!texImage) {
+ texImage = ctx->Driver.NewTextureImage(ctx);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
+ return NULL;
+ }
+ ctx->Texture.ProxyTex[texIndex]->Image[0][level] = texImage;
+ /* Set the 'back' pointer */
+ texImage->TexObject = ctx->Texture.ProxyTex[texIndex];
+ }
+ return texImage;
}
@@ -2235,7 +2179,8 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions,
if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(missing readbuffer)", dimensions);
+ "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)",
+ dimensions, teximage->_BaseFormat);
return GL_TRUE;
}
@@ -2391,23 +2336,33 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
}
+/** Callback info for walking over FBO hash table */
+struct cb_info
+{
+ GLcontext *ctx;
+ struct gl_texture_object *texObj;
+ GLuint level, face;
+};
+
/**
- * Check if the given texture image is bound to any framebuffer objects
- * and update/invalidate them.
- * XXX We're only checking the currently bound framebuffer object for now.
- * In the future, perhaps struct gl_texture_image should have a pointer (or
- * list of pointers (yikes)) to the gl_framebuffer(s) which it's bound to.
+ * Check render to texture callback. Called from _mesa_HashWalk().
*/
static void
-update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj,
- GLuint face, GLuint level)
+check_rtt_cb(GLuint key, void *data, void *userData)
{
- if (ctx->DrawBuffer->Name) {
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ const struct cb_info *info = (struct cb_info *) userData;
+ GLcontext *ctx = info->ctx;
+ const struct gl_texture_object *texObj = info->texObj;
+ const GLuint level = info->level, face = info->face;
+
+ /* If this is a user-created FBO */
+ if (fb->Name) {
GLuint i;
+ /* check if any of the FBO's attachments point to 'texObj' */
for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att =
- ctx->DrawBuffer->Attachment + i;
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
if (att->Type == GL_TEXTURE &&
att->Texture == texObj &&
att->TextureLevel == level &&
@@ -2415,12 +2370,36 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj,
ASSERT(att->Texture->Image[att->CubeMapFace][att->TextureLevel]);
/* Tell driver about the new renderbuffer texture */
ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att);
+ /* Mark fb status as indeterminate to force re-validation */
+ fb->_Status = 0;
}
}
}
}
+/**
+ * When a texture image is specified we have to check if it's bound to
+ * any framebuffer objects (render to texture) in order to detect changes
+ * in size or format since that effects FBO completeness.
+ * Any FBOs rendering into the texture must be re-validated.
+ */
+static void
+update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj,
+ GLuint face, GLuint level)
+{
+ /* Only check this texture if it's been marked as RenderToTexture */
+ if (texObj->_RenderToTexture) {
+ struct cb_info info;
+ info.ctx = ctx;
+ info.texObj = texObj;
+ info.level = level;
+ info.face = face;
+ _mesa_HashWalk(ctx->Shared->FrameBuffers, check_rtt_cb, &info);
+ }
+}
+
+
/*
* Called from the API. Note that width includes the border.
@@ -2452,7 +2431,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2558,7 +2537,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2614,7 +2593,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
1, border)) {
/* when error, clear all proxy texture image parameters */
if (texImage)
- clear_teximage_fields(ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]);
+ clear_teximage_fields(texImage);
}
else {
/* no error, set the tex image parameters */
@@ -2659,7 +2638,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
return; /* error was recorded */
}
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
@@ -2752,7 +2731,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -2812,7 +2791,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -2872,7 +2851,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset,
@@ -2928,7 +2907,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -2993,7 +2972,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -3061,7 +3040,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 1, target, level))
@@ -3116,7 +3095,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 2, target, level))
@@ -3171,7 +3150,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
+ if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 3, target, level))
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 7848f0be35..b4e30c8bb7 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -42,6 +42,8 @@
#include "texstate.h"
#include "texobj.h"
#include "mtypes.h"
+#include "shader/prog_instruction.h"
+
/**********************************************************************/
@@ -132,12 +134,15 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
obj->MaxAnisotropy = 1.0;
- obj->CompareFlag = GL_FALSE; /* SGIX_shadow */
- obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */
obj->CompareMode = GL_NONE; /* ARB_shadow */
obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */
+ obj->CompareFailValue = 0.0F; /* ARB_shadow_ambient */
obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
- obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */
+ obj->Swizzle[0] = GL_RED;
+ obj->Swizzle[1] = GL_GREEN;
+ obj->Swizzle[2] = GL_BLUE;
+ obj->Swizzle[3] = GL_ALPHA;
+ obj->_Swizzle = SWIZZLE_NOOP;
}
@@ -241,17 +246,17 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
dest->BaseLevel = src->BaseLevel;
dest->MaxLevel = src->MaxLevel;
dest->MaxAnisotropy = src->MaxAnisotropy;
- dest->CompareFlag = src->CompareFlag;
- dest->CompareOperator = src->CompareOperator;
- dest->ShadowAmbient = src->ShadowAmbient;
dest->CompareMode = src->CompareMode;
dest->CompareFunc = src->CompareFunc;
+ dest->CompareFailValue = src->CompareFailValue;
dest->DepthMode = src->DepthMode;
dest->_MaxLevel = src->_MaxLevel;
dest->_MaxLambda = src->_MaxLambda;
dest->GenerateMipmap = src->GenerateMipmap;
dest->Palette = src->Palette;
dest->_Complete = src->_Complete;
+ COPY_4V(dest->Swizzle, src->Swizzle);
+ dest->_Swizzle = src->_Swizzle;
}
@@ -388,8 +393,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
*/
if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) {
char s[100];
- _mesa_sprintf(s, "obj %p (%d) base level = %d is invalid",
- (void *) t, t->Name, baseLevel);
+ _mesa_sprintf(s, "base level = %d is invalid", baseLevel);
incomplete(t, s);
t->_Complete = GL_FALSE;
return;
@@ -398,8 +402,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
/* Always need the base level image */
if (!t->Image[0][baseLevel]) {
char s[100];
- _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL",
- (void *) t, t->Name, baseLevel);
+ _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel);
incomplete(t, s);
t->_Complete = GL_FALSE;
return;
@@ -979,11 +982,11 @@ _mesa_BindTexture( GLenum target, GLuint texName )
ASSERT(texUnit->CurrentRect);
break;
case GL_TEXTURE_1D_ARRAY_EXT:
- texUnit->Current1DArray = newTexObj;
+ _mesa_reference_texobj(&texUnit->Current1DArray, newTexObj);
ASSERT(texUnit->Current1DArray);
break;
case GL_TEXTURE_2D_ARRAY_EXT:
- texUnit->Current2DArray = newTexObj;
+ _mesa_reference_texobj(&texUnit->Current2DArray, newTexObj);
ASSERT(texUnit->Current2DArray);
break;
default:
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index a9e752a637..865aae8627 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1,8 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.5
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -37,6 +38,7 @@
#include "main/texcompress.h"
#include "main/texparam.h"
#include "main/teximage.h"
+#include "shader/prog_instruction.h"
/**
@@ -72,404 +74,609 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap)
}
-void GLAPIENTRY
-_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param )
+/**
+ * Get current texture object for given target.
+ * Return NULL if any error.
+ */
+static struct gl_texture_object *
+get_texobj(GLcontext *ctx, GLenum target)
{
- _mesa_TexParameterfv(target, pname, &param);
+ struct gl_texture_unit *texUnit;
+
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(current unit)");
+ return NULL;
+ }
+
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+
+ switch (target) {
+ case GL_TEXTURE_1D:
+ return texUnit->Current1D;
+ case GL_TEXTURE_2D:
+ return texUnit->Current2D;
+ case GL_TEXTURE_3D:
+ return texUnit->Current3D;
+ case GL_TEXTURE_CUBE_MAP:
+ if (ctx->Extensions.ARB_texture_cube_map) {
+ return texUnit->CurrentCubeMap;
+ }
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ if (ctx->Extensions.NV_texture_rectangle) {
+ return texUnit->CurrentRect;
+ }
+ break;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ if (ctx->Extensions.MESA_texture_array) {
+ return texUnit->Current1DArray;
+ }
+ break;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ if (ctx->Extensions.MESA_texture_array) {
+ return texUnit->Current2DArray;
+ }
+ break;
+ default:
+ ;
+ }
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(target)");
+ return NULL;
}
-void GLAPIENTRY
-_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
+/**
+ * Convert GL_RED/GREEN/BLUE/ALPHA/ZERO/ONE to SWIZZLE_X/Y/Z/W/ZERO/ONE.
+ * \return -1 if error.
+ */
+static GLint
+comp_to_swizzle(GLenum comp)
{
- const GLenum eparam = (GLenum) (GLint) params[0];
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+ switch (comp) {
+ case GL_RED:
+ return SWIZZLE_X;
+ case GL_GREEN:
+ return SWIZZLE_Y;
+ case GL_BLUE:
+ return SWIZZLE_Z;
+ case GL_ALPHA:
+ return SWIZZLE_W;
+ case GL_ZERO:
+ return SWIZZLE_ZERO;
+ case GL_ONE:
+ return SWIZZLE_ONE;
+ default:
+ return -1;
+ }
+}
- if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glTexParameter %s %s %.1f(%s)...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- *params,
- _mesa_lookup_enum_by_nr(eparam));
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameterfv(current unit)");
- return;
+static void
+set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz)
+{
+ ASSERT(comp < 4);
+ ASSERT(swz <= SWIZZLE_NIL);
+ {
+ GLuint mask = 0x7 << (3 * comp);
+ GLuint s = (*swizzle & ~mask) | (swz << (3 * comp));
+ *swizzle = s;
}
+}
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- switch (target) {
- case GL_TEXTURE_1D:
- texObj = texUnit->Current1D;
- break;
- case GL_TEXTURE_2D:
- texObj = texUnit->Current2D;
- break;
- case GL_TEXTURE_3D:
- texObj = texUnit->Current3D;
- break;
- case GL_TEXTURE_CUBE_MAP:
- if (!ctx->Extensions.ARB_texture_cube_map) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
- return;
- }
- texObj = texUnit->CurrentCubeMap;
- break;
- case GL_TEXTURE_RECTANGLE_NV:
- if (!ctx->Extensions.NV_texture_rectangle) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
- return;
- }
- texObj = texUnit->CurrentRect;
- break;
- case GL_TEXTURE_1D_ARRAY_EXT:
- if (!ctx->Extensions.MESA_texture_array) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
- return;
- }
- texObj = texUnit->Current1DArray;
- break;
- case GL_TEXTURE_2D_ARRAY_EXT:
- if (!ctx->Extensions.MESA_texture_array) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
+/**
+ * This is called just prior to changing any texture object state.
+ * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE
+ * state flag and then mark the texture object as 'incomplete' so that any
+ * per-texture derived state gets recomputed.
+ */
+static INLINE void
+flush(GLcontext *ctx, struct gl_texture_object *texObj)
+{
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->_Complete = GL_FALSE;
+}
+
+
+/** Set an integer-valued texture parameter */
+static void
+set_tex_parameteri(GLcontext *ctx,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLint *params)
+{
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ if (texObj->MinFilter == params[0])
+ return;
+ switch (params[0]) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ flush(ctx, texObj);
+ texObj->MinFilter = params[0];
+ return;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ case GL_LINEAR_MIPMAP_NEAREST:
+ case GL_NEAREST_MIPMAP_LINEAR:
+ case GL_LINEAR_MIPMAP_LINEAR:
+ if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
+ flush(ctx, texObj);
+ texObj->MinFilter = params[0];
return;
}
- texObj = texUnit->Current2DArray;
- break;
+ /* fall-through */
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" );
+ _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
+ }
+ return;
+
+ case GL_TEXTURE_MAG_FILTER:
+ if (texObj->MagFilter == params[0])
return;
- }
+ switch (params[0]) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ flush(ctx, texObj);
+ texObj->MagFilter = params[0];
+ return;
+ default:
+ _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
+ }
+ return;
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- /* A small optimization */
- if (texObj->MinFilter == eparam)
- return;
- if (eparam==GL_NEAREST || eparam==GL_LINEAR) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MinFilter = eparam;
- }
- else if ((eparam==GL_NEAREST_MIPMAP_NEAREST ||
- eparam==GL_LINEAR_MIPMAP_NEAREST ||
- eparam==GL_NEAREST_MIPMAP_LINEAR ||
- eparam==GL_LINEAR_MIPMAP_LINEAR) &&
- texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MinFilter = eparam;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
- return;
- }
- break;
- case GL_TEXTURE_MAG_FILTER:
- /* A small optimization */
- if (texObj->MagFilter == eparam)
- return;
+ case GL_TEXTURE_WRAP_S:
+ if (texObj->WrapS == params[0])
+ return;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx, texObj);
+ texObj->WrapS = params[0];
+ }
+ return;
- if (eparam==GL_NEAREST || eparam==GL_LINEAR) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MagFilter = eparam;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
- return;
- }
- break;
- case GL_TEXTURE_WRAP_S:
- if (texObj->WrapS == eparam)
- return;
- if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->WrapS = eparam;
- }
- else {
- return;
- }
- break;
- case GL_TEXTURE_WRAP_T:
- if (texObj->WrapT == eparam)
- return;
- if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->WrapT = eparam;
- }
- else {
- return;
- }
- break;
- case GL_TEXTURE_WRAP_R:
- if (texObj->WrapR == eparam)
- return;
- if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->WrapR = eparam;
- }
- else {
- return;
- }
- break;
- case GL_TEXTURE_BORDER_COLOR:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- 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])
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MinLod = params[0];
- break;
- case GL_TEXTURE_MAX_LOD:
- if (texObj->MaxLod == params[0])
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MaxLod = params[0];
- break;
- case GL_TEXTURE_BASE_LEVEL:
- if (params[0] < 0.0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
- return;
- }
- if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->BaseLevel = (GLint) params[0];
- break;
- case GL_TEXTURE_MAX_LEVEL:
- if (params[0] < 0.0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
- return;
- }
- if (target == GL_TEXTURE_RECTANGLE_ARB) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)");
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->MaxLevel = (GLint) params[0];
- break;
- case GL_TEXTURE_PRIORITY:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->Priority = CLAMP( params[0], 0.0F, 1.0F );
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- if (params[0] < 1.0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- /* clamp to max, that's what NVIDIA does */
- texObj->MaxAnisotropy = MIN2(params[0],
- ctx->Const.MaxTextureMaxAnisotropy);
+ case GL_TEXTURE_WRAP_T:
+ if (texObj->WrapT == params[0])
+ return;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx, texObj);
+ texObj->WrapT = params[0];
+ }
+ return;
+
+ case GL_TEXTURE_WRAP_R:
+ if (texObj->WrapR == params[0])
+ return;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx, texObj);
+ texObj->WrapR = params[0];
+ }
+ return;
+
+ case GL_TEXTURE_BASE_LEVEL:
+ if (texObj->BaseLevel == params[0])
+ return;
+ if (params[0] < 0 ||
+ (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
+ return;
+ }
+ flush(ctx, texObj);
+ texObj->BaseLevel = params[0];
+ return;
+
+ case GL_TEXTURE_MAX_LEVEL:
+ if (texObj->MaxLevel == params[0])
+ return;
+ if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)");
+ return;
+ }
+ flush(ctx, texObj);
+ texObj->MaxLevel = params[0];
+ return;
+
+ case GL_GENERATE_MIPMAP_SGIS:
+ if (ctx->Extensions.SGIS_generate_mipmap) {
+ if (texObj->GenerateMipmap != params[0]) {
+ flush(ctx, texObj);
+ texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
}
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
+ }
+ return;
+
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow &&
+ (params[0] == GL_NONE ||
+ params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) {
+ if (texObj->CompareMode != params[0]) {
+ flush(ctx, texObj);
+ texObj->CompareMode = params[0];
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)");
+ }
+ return;
+
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ if (texObj->CompareFunc == params[0])
return;
- }
- break;
- case GL_TEXTURE_COMPARE_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)");
+ switch (params[0]) {
+ case GL_LEQUAL:
+ case GL_GEQUAL:
+ flush(ctx, texObj);
+ texObj->CompareFunc = params[0];
return;
- }
- break;
- case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- GLenum op = (GLenum) params[0];
- if (op == GL_TEXTURE_LEQUAL_R_SGIX ||
- op == GL_TEXTURE_GEQUAL_R_SGIX) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->CompareOperator = op;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)");
+ case GL_EQUAL:
+ case GL_NOTEQUAL:
+ case GL_LESS:
+ case GL_GREATER:
+ case GL_ALWAYS:
+ case GL_NEVER:
+ if (ctx->Extensions.EXT_shadow_funcs) {
+ flush(ctx, texObj);
+ texObj->CompareFunc = params[0];
+ return;
}
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_COMPARE_OPERATOR_SGIX)");
- return;
- }
- break;
- case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- if (ctx->Extensions.SGIX_shadow_ambient) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
- }
- else {
+ /* fall-through */
+ default:
_mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)");
- return;
+ "glTexParameter(GL_TEXTURE_COMPARE_FUNC_ARB)");
}
- 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 {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)");
+ }
+ return;
+
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture &&
+ (params[0] == GL_LUMINANCE ||
+ params[0] == GL_INTENSITY ||
+ params[0] == GL_ALPHA)) {
+ if (texObj->DepthMode != params[0]) {
+ flush(ctx, texObj);
+ texObj->DepthMode = params[0];
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)");
+ }
+ return;
+
+#ifdef FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ texObj->CropRect[0] = params[0];
+ texObj->CropRect[1] = params[1];
+ texObj->CropRect[2] = params[2];
+ texObj->CropRect[3] = params[3];
+ return;
+#endif
+
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ const GLint swz = comp_to_swizzle(params[0]);
+ if (swz < 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[0]);
return;
}
- break;
- 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)");
+ ASSERT(comp < 4);
+ if (swz >= 0) {
+ flush(ctx, texObj);
+ texObj->Swizzle[comp] = params[0];
+ set_swizzle_component(&texObj->_Swizzle, comp, swz);
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;
+ }
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
+ return;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp;
+ flush(ctx, texObj);
+ for (comp = 0; comp < 4; comp++) {
+ const GLint swz = comp_to_swizzle(params[comp]);
+ if (swz >= 0) {
+ texObj->Swizzle[comp] = params[comp];
+ set_swizzle_component(&texObj->_Swizzle, comp, swz);
}
else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[comp]);
return;
}
}
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)");
+ return;
+ }
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
+ return;
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
+ }
+}
+
+
+/** Set a float-valued texture parameter */
+static void
+set_tex_parameterf(GLcontext *ctx,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params)
+{
+ switch (pname) {
+ case GL_TEXTURE_MIN_LOD:
+ if (texObj->MinLod == params[0])
+ return;
+ flush(ctx, texObj);
+ texObj->MinLod = params[0];
+ return;
+
+ case GL_TEXTURE_MAX_LOD:
+ if (texObj->MaxLod == params[0])
+ return;
+ flush(ctx, texObj);
+ texObj->MaxLod = params[0];
+ return;
+
+ case GL_TEXTURE_PRIORITY:
+ flush(ctx, texObj);
+ texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
+ return;
+
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ if (ctx->Extensions.EXT_texture_filter_anisotropic) {
+ if (texObj->MaxAnisotropy == params[0])
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)");
+ if (params[0] < 1.0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
return;
}
- break;
- case GL_TEXTURE_LOD_BIAS:
- /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/
- if (ctx->Extensions.EXT_texture_lod_bias) {
- if (texObj->LodBias != params[0]) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->LodBias = params[0];
- }
- }
- break;
-#ifdef FEATURE_OES_draw_texture
- case GL_TEXTURE_CROP_RECT_OES:
- texObj->CropRect[0] = (GLint) params[0];
- texObj->CropRect[1] = (GLint) params[1];
- texObj->CropRect[2] = (GLint) params[2];
- texObj->CropRect[3] = (GLint) params[3];
- break;
-#endif
+ flush(ctx, texObj);
+ /* clamp to max, that's what NVIDIA does */
+ texObj->MaxAnisotropy = MIN2(params[0],
+ ctx->Const.MaxTextureMaxAnisotropy);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
+ }
+ return;
- default:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ if (texObj->CompareFailValue != params[0]) {
+ flush(ctx, texObj);
+ texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F);
+ }
+ }
+ else {
_mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=0x%x)", pname);
- return;
+ "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)");
+ }
+ return;
+
+ case GL_TEXTURE_LOD_BIAS:
+ /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ if (texObj->LodBias != params[0]) {
+ flush(ctx, texObj);
+ texObj->LodBias = params[0];
+ }
+ }
+ break;
+
+ case GL_TEXTURE_BORDER_COLOR:
+ flush(ctx, texObj);
+ 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]);
+ return;
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
}
+}
- texObj->_Complete = GL_FALSE;
- if (ctx->Driver.TexParameter) {
- (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params );
+void GLAPIENTRY
+_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_GENERATE_MIPMAP_SGIS:
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ {
+ /* convert float param to int */
+ GLint p = (GLint) param;
+ set_tex_parameteri(ctx, texObj, pname, &p);
+ }
+ return;
+ default:
+ /* this will generate an error if pname is illegal */
+ set_tex_parameterf(ctx, texObj, pname, &param);
+ }
+
+ if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, &param);
}
}
void GLAPIENTRY
-_mesa_TexParameteri( GLenum target, GLenum pname, GLint param )
+_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
- GLfloat fparam[4];
- if (pname == GL_TEXTURE_PRIORITY)
- fparam[0] = INT_TO_FLOAT(param);
- else
- fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0;
- _mesa_TexParameterfv(target, pname, fparam);
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_GENERATE_MIPMAP_SGIS:
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ {
+ /* convert float param to int */
+ GLint p = (GLint) params[0];
+ set_tex_parameteri(ctx, texObj, pname, &p);
+ }
+ break;
+
+#ifdef FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ {
+ /* convert float params to int */
+ GLint iparams[4];
+ iparams[0] = (GLint) params[0];
+ iparams[1] = (GLint) params[1];
+ iparams[2] = (GLint) params[2];
+ iparams[3] = (GLint) params[3];
+ set_tex_parameteri(ctx, target, iparams);
+ }
+ break;
+#endif
+
+ default:
+ /* this will generate an error if pname is illegal */
+ set_tex_parameterf(ctx, texObj, pname, params);
+ }
+
+ if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
+ }
}
void GLAPIENTRY
-_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
+_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
{
- GLfloat fparam[4];
- 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]);
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ {
+ GLfloat fparam = (GLfloat) param;
+ /* convert int param to float */
+ set_tex_parameterf(ctx, texObj, pname, &fparam);
+ }
+ break;
+ default:
+ /* this will generate an error if pname is illegal */
+ set_tex_parameteri(ctx, texObj, pname, &param);
}
- else if (pname == GL_TEXTURE_CROP_RECT_OES) {
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- fparam[3] = (GLfloat) params[3];
+
+ if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
+ GLfloat fparam = (GLfloat) param;
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
}
- else {
- if (pname == GL_TEXTURE_PRIORITY)
- fparam[0] = INT_TO_FLOAT(params[0]);
- else
- fparam[0] = (GLfloat) params[0];
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
+}
+
+
+void GLAPIENTRY
+_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ {
+ /* convert int params to float */
+ GLfloat fparams[4];
+ fparams[0] = INT_TO_FLOAT(params[0]);
+ fparams[1] = INT_TO_FLOAT(params[1]);
+ fparams[2] = INT_TO_FLOAT(params[2]);
+ fparams[3] = INT_TO_FLOAT(params[3]);
+ set_tex_parameterf(ctx, texObj, pname, fparams);
+ }
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ {
+ /* convert int param to float */
+ GLfloat fparam = (GLfloat) params[0];
+ set_tex_parameterf(ctx, texObj, pname, &fparam);
+ }
+ break;
+ default:
+ /* this will generate an error if pname is illegal */
+ set_tex_parameteri(ctx, texObj, pname, params);
+ }
+
+ if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
+ GLfloat fparams[4];
+ fparams[0] = INT_TO_FLOAT(params[0]);
+ if (pname == GL_TEXTURE_BORDER_COLOR ||
+ pname == GL_TEXTURE_CROP_RECT_OES) {
+ fparams[1] = INT_TO_FLOAT(params[1]);
+ fparams[2] = INT_TO_FLOAT(params[2]);
+ fparams[3] = INT_TO_FLOAT(params[3]);
+ }
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams);
}
- _mesa_TexParameterfv(target, pname, fparam);
}
@@ -660,33 +867,21 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
- if (ctx->Extensions.ARB_texture_compression) {
- if (img->IsCompressed && !isProxy) {
- /* Don't use ctx->Driver.CompressedTextureSize() since that
- * may returned a padded hardware size.
- */
- *params = _mesa_compressed_texture_size(ctx, img->Width,
- img->Height, img->Depth,
- img->TexFormat->MesaFormat);
- }
- else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexLevelParameter[if]v(pname)");
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetTexLevelParameter[if]v(pname)");
- }
+ if (img->IsCompressed && !isProxy) {
+ /* Don't use ctx->Driver.CompressedTextureSize() since that
+ * may returned a padded hardware size.
+ */
+ *params = _mesa_compressed_texture_size(ctx, img->Width,
+ img->Height, img->Depth,
+ img->TexFormat->MesaFormat);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetTexLevelParameter[if]v(pname)");
+ }
break;
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)");
- }
+ *params = (GLint) img->IsCompressed;
break;
/* GL_ARB_texture_float */
@@ -841,63 +1036,49 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
*params = obj->MaxAnisotropy;
}
else
- error = 1;
- break;
- case GL_TEXTURE_COMPARE_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- *params = (GLfloat) obj->CompareFlag;
- }
- else
- error = 1;
- break;
- case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- *params = (GLfloat) obj->CompareOperator;
- }
- else
- error = 1;
+ error = GL_TRUE;
break;
- case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- if (ctx->Extensions.SGIX_shadow_ambient) {
- *params = obj->ShadowAmbient;
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ *params = obj->CompareFailValue;
}
else
- error = 1;
+ error = GL_TRUE;
break;
case GL_GENERATE_MIPMAP_SGIS:
if (ctx->Extensions.SGIS_generate_mipmap) {
*params = (GLfloat) obj->GenerateMipmap;
}
else
- error = 1;
+ error = GL_TRUE;
break;
case GL_TEXTURE_COMPARE_MODE_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLfloat) obj->CompareMode;
}
else
- error = 1;
+ error = GL_TRUE;
break;
case GL_TEXTURE_COMPARE_FUNC_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLfloat) obj->CompareFunc;
}
else
- error = 1;
+ error = GL_TRUE;
break;
case GL_DEPTH_TEXTURE_MODE_ARB:
if (ctx->Extensions.ARB_depth_texture) {
*params = (GLfloat) obj->DepthMode;
}
else
- error = 1;
+ error = GL_TRUE;
break;
case GL_TEXTURE_LOD_BIAS:
if (ctx->Extensions.EXT_texture_lod_bias) {
*params = obj->LodBias;
}
else
- error = 1;
+ error = GL_TRUE;
break;
#ifdef FEATURE_OES_draw_texture
case GL_TEXTURE_CROP_RECT_OES:
@@ -907,10 +1088,37 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
params[3] = obj->CropRect[3];
break;
#endif
+
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ *params = (GLfloat) obj->Swizzle[comp];
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp;
+ for (comp = 0; comp < 4; comp++) {
+ params[comp] = (GLfloat) obj->Swizzle[comp];
+ }
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
default:
- error = 1;
+ error = GL_TRUE;
break;
}
+
if (error)
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)",
pname);
@@ -924,6 +1132,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
{
struct gl_texture_unit *texUnit;
struct gl_texture_object *obj;
+ GLboolean error = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -944,19 +1153,19 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
*params = (GLint) obj->MagFilter;
- return;
+ break;;
case GL_TEXTURE_MIN_FILTER:
*params = (GLint) obj->MinFilter;
- return;
+ break;;
case GL_TEXTURE_WRAP_S:
*params = (GLint) obj->WrapS;
- return;
+ break;;
case GL_TEXTURE_WRAP_T:
*params = (GLint) obj->WrapT;
- return;
+ break;;
case GL_TEXTURE_WRAP_R:
*params = (GLint) obj->WrapR;
- return;
+ break;;
case GL_TEXTURE_BORDER_COLOR:
{
GLfloat b[4];
@@ -969,7 +1178,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
params[2] = FLOAT_TO_INT(b[2]);
params[3] = FLOAT_TO_INT(b[3]);
}
- return;
+ break;;
case GL_TEXTURE_RESIDENT:
{
GLboolean resident;
@@ -979,74 +1188,76 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
resident = GL_TRUE;
*params = (GLint) resident;
}
- return;
+ break;;
case GL_TEXTURE_PRIORITY:
*params = FLOAT_TO_INT(obj->Priority);
- return;
+ break;;
case GL_TEXTURE_MIN_LOD:
*params = (GLint) obj->MinLod;
- return;
+ break;;
case GL_TEXTURE_MAX_LOD:
*params = (GLint) obj->MaxLod;
- return;
+ break;;
case GL_TEXTURE_BASE_LEVEL:
*params = obj->BaseLevel;
- return;
+ break;;
case GL_TEXTURE_MAX_LEVEL:
*params = obj->MaxLevel;
- return;
+ break;;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
*params = (GLint) obj->MaxAnisotropy;
- return;
}
- break;
- case GL_TEXTURE_COMPARE_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- *params = (GLint) obj->CompareFlag;
- return;
+ else {
+ error = GL_TRUE;
}
break;
- case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
- if (ctx->Extensions.SGIX_shadow) {
- *params = (GLint) obj->CompareOperator;
- return;
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ *params = (GLint) FLOAT_TO_INT(obj->CompareFailValue);
}
- break;
- case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- if (ctx->Extensions.SGIX_shadow_ambient) {
- *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient);
- return;
+ else {
+ error = GL_TRUE;
}
break;
case GL_GENERATE_MIPMAP_SGIS:
if (ctx->Extensions.SGIS_generate_mipmap) {
*params = (GLint) obj->GenerateMipmap;
- return;
+ }
+ else {
+ error = GL_TRUE;
}
break;
case GL_TEXTURE_COMPARE_MODE_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLint) obj->CompareMode;
- return;
+ }
+ else {
+ error = GL_TRUE;
}
break;
case GL_TEXTURE_COMPARE_FUNC_ARB:
if (ctx->Extensions.ARB_shadow) {
*params = (GLint) obj->CompareFunc;
- return;
+ }
+ else {
+ error = GL_TRUE;
}
break;
case GL_DEPTH_TEXTURE_MODE_ARB:
if (ctx->Extensions.ARB_depth_texture) {
*params = (GLint) obj->DepthMode;
- return;
+ }
+ else {
+ error = GL_TRUE;
}
break;
case GL_TEXTURE_LOD_BIAS:
if (ctx->Extensions.EXT_texture_lod_bias) {
*params = (GLint) obj->LodBias;
- return;
+ }
+ else {
+ error = GL_TRUE;
}
break;
#ifdef FEATURE_OES_draw_texture
@@ -1057,9 +1268,35 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
params[3] = obj->CropRect[3];
break;
#endif
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ *params = obj->Swizzle[comp];
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ COPY_4V(params, obj->Swizzle);
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
default:
; /* silence warnings */
}
- /* If we get here, pname was an unrecognized enum */
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname);
+
+ if (error)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)",
+ pname);
+
+ _mesa_unlock_texture(ctx, obj);
}
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 4ae13a7b9b..49de6f5b8a 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -194,6 +194,59 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
+/**
+ * Put row of RGB values into a renderbuffer that wraps a texture image.
+ */
+static void
+texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ y += trb->Yoffset;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgb = (const GLchan *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, rgb);
+ }
+ rgb += 3;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
+ }
+}
+
static void
texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
@@ -380,6 +433,7 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
trb->Base.GetRow = texture_get_row;
trb->Base.GetValues = texture_get_values;
trb->Base.PutRow = texture_put_row;
+ trb->Base.PutRowRGB = texture_put_row_rgb;
trb->Base.PutMonoRow = texture_put_mono_row;
trb->Base.PutValues = texture_put_values;
trb->Base.PutMonoValues = texture_put_mono_values;
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 9bfb7e0ec2..6586a48646 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -42,7 +42,6 @@
#include "texstate.h"
#include "texenvprogram.h"
#include "mtypes.h"
-#include "math/m_xform.h"
@@ -53,10 +52,10 @@
*/
static const struct gl_tex_env_combine_state default_combine_state = {
GL_MODULATE, GL_MODULATE,
- { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT },
- { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT },
- { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA },
- { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
+ { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
+ { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
+ { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA },
+ { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
0, 0,
2, 2
};
@@ -404,16 +403,6 @@ update_texture_compare_function(GLcontext *ctx,
*/
tObj->_Function = GL_NONE;
}
- else if (tObj->CompareFlag) {
- /* GL_SGIX_shadow */
- if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
- tObj->_Function = GL_LEQUAL;
- }
- else {
- ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX);
- tObj->_Function = GL_GEQUAL;
- }
- }
else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) {
/* GL_ARB_shadow */
tObj->_Function = tObj->CompareFunc;
@@ -447,6 +436,96 @@ texture_override(GLcontext *ctx,
/**
+ * Examine texture unit's combine/env state to update derived state.
+ */
+static void
+update_tex_combine(GLcontext *ctx, struct gl_texture_unit *texUnit)
+{
+ /* Set the texUnit->_CurrentCombine field to point to the user's combiner
+ * state, or the combiner state which is derived from traditional texenv
+ * mode.
+ */
+ if (texUnit->EnvMode == GL_COMBINE ||
+ texUnit->EnvMode == GL_COMBINE4_NV) {
+ texUnit->_CurrentCombine = & texUnit->Combine;
+ }
+ else {
+ const struct gl_texture_object *texObj = texUnit->_Current;
+ GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
+ if (format == GL_COLOR_INDEX) {
+ format = GL_RGBA; /* a bit of a hack */
+ }
+ else if (format == GL_DEPTH_COMPONENT ||
+ format == GL_DEPTH_STENCIL_EXT) {
+ format = texObj->DepthMode;
+ }
+ calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
+ texUnit->_CurrentCombine = & texUnit->_EnvMode;
+ }
+
+ /* Determine number of source RGB terms in the combiner function */
+ switch (texUnit->_CurrentCombine->ModeRGB) {
+ case GL_REPLACE:
+ texUnit->_CurrentCombine->_NumArgsRGB = 1;
+ break;
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ if (texUnit->EnvMode == GL_COMBINE4_NV)
+ texUnit->_CurrentCombine->_NumArgsRGB = 4;
+ else
+ texUnit->_CurrentCombine->_NumArgsRGB = 2;
+ break;
+ case GL_MODULATE:
+ case GL_SUBTRACT:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ texUnit->_CurrentCombine->_NumArgsRGB = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ texUnit->_CurrentCombine->_NumArgsRGB = 3;
+ break;
+ default:
+ texUnit->_CurrentCombine->_NumArgsRGB = 0;
+ _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state");
+ return;
+ }
+
+ /* Determine number of source Alpha terms in the combiner function */
+ switch (texUnit->_CurrentCombine->ModeA) {
+ case GL_REPLACE:
+ texUnit->_CurrentCombine->_NumArgsA = 1;
+ break;
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ if (texUnit->EnvMode == GL_COMBINE4_NV)
+ texUnit->_CurrentCombine->_NumArgsA = 4;
+ else
+ texUnit->_CurrentCombine->_NumArgsA = 2;
+ break;
+ case GL_MODULATE:
+ case GL_SUBTRACT:
+ texUnit->_CurrentCombine->_NumArgsA = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ texUnit->_CurrentCombine->_NumArgsA = 3;
+ break;
+ default:
+ texUnit->_CurrentCombine->_NumArgsA = 0;
+ _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state");
+ break;
+ }
+}
+
+
+/**
* \note This routine refers to derived texture matrix values to
* compute the ENABLE_TEXMAT flags, but is only called on
* _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
@@ -478,9 +557,8 @@ update_texture_state( GLcontext *ctx )
}
}
- ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are
- * actual changes.
- */
+ /* TODO: only set this if there are actual changes */
+ ctx->NewState |= _NEW_TEXTURE;
ctx->Texture._EnabledUnits = 0;
ctx->Texture._GenFlags = 0;
@@ -498,25 +576,27 @@ update_texture_state( GLcontext *ctx )
texUnit->_ReallyEnabled = 0;
texUnit->_GenFlags = 0;
- /* Get the bitmask of texture enables.
+ /* Get the bitmask of texture target enables.
* enableBits will be a mask of the TEXTURE_*_BIT flags indicating
* which texture targets are enabled (fixed function) or referenced
* by a fragment shader/program. When multiple flags are set, we'll
* settle on the one with highest priority (see texture_override below).
*/
- if (fprog || vprog) {
- enableBits = 0x0;
- if (fprog)
- enableBits |= fprog->Base.TexturesUsed[unit];
- if (vprog)
- enableBits |= vprog->Base.TexturesUsed[unit];
+ enableBits = 0x0;
+ if (vprog) {
+ enableBits |= vprog->Base.TexturesUsed[unit];
+ }
+ if (fprog) {
+ enableBits |= fprog->Base.TexturesUsed[unit];
}
else {
- if (!texUnit->Enabled)
- continue;
- enableBits = texUnit->Enabled;
+ /* fixed-function fragment program */
+ enableBits |= texUnit->Enabled;
}
+ if (enableBits == 0x0)
+ continue;
+
ASSERT(texUnit->Current1D);
ASSERT(texUnit->Current2D);
ASSERT(texUnit->Current3D);
@@ -548,75 +628,14 @@ update_texture_state( GLcontext *ctx )
continue;
}
- if (texUnit->_ReallyEnabled)
- ctx->Texture._EnabledUnits |= (1 << unit);
+ /* if we get here, we know this texture unit is enabled */
- if (texUnit->EnvMode == GL_COMBINE) {
- texUnit->_CurrentCombine = & texUnit->Combine;
- }
- else {
- const struct gl_texture_object *texObj = texUnit->_Current;
- GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
- if (format == GL_COLOR_INDEX) {
- format = GL_RGBA; /* a bit of a hack */
- }
- else if (format == GL_DEPTH_COMPONENT
- || format == GL_DEPTH_STENCIL_EXT) {
- format = texObj->DepthMode;
- }
- calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
- texUnit->_CurrentCombine = & texUnit->_EnvMode;
- }
-
- switch (texUnit->_CurrentCombine->ModeRGB) {
- case GL_REPLACE:
- texUnit->_CurrentCombine->_NumArgsRGB = 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:
- texUnit->_CurrentCombine->_NumArgsRGB = 2;
- break;
- case GL_INTERPOLATE:
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- texUnit->_CurrentCombine->_NumArgsRGB = 3;
- break;
- default:
- texUnit->_CurrentCombine->_NumArgsRGB = 0;
- _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state");
- return;
- }
+ ctx->Texture._EnabledUnits |= (1 << unit);
- switch (texUnit->_CurrentCombine->ModeA) {
- case GL_REPLACE:
- texUnit->_CurrentCombine->_NumArgsA = 1;
- break;
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_SUBTRACT:
- texUnit->_CurrentCombine->_NumArgsA = 2;
- break;
- case GL_INTERPOLATE:
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- texUnit->_CurrentCombine->_NumArgsA = 3;
- break;
- default:
- texUnit->_CurrentCombine->_NumArgsA = 0;
- _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state");
- break;
- }
+ update_tex_combine(ctx, texUnit);
}
+
/* Determine which texture coordinate sets are actually needed */
if (fprog) {
const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2b06796aba..6360ca15f8 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3699,14 +3699,37 @@ is_srgb_teximage(const struct gl_texture_image *texImage)
case MESA_FORMAT_SARGB8:
case MESA_FORMAT_SL8:
case MESA_FORMAT_SLA8:
+ case MESA_FORMAT_SRGB_DXT1:
+ case MESA_FORMAT_SRGBA_DXT1:
+ case MESA_FORMAT_SRGBA_DXT3:
+ case MESA_FORMAT_SRGBA_DXT5:
return GL_TRUE;
default:
return GL_FALSE;
}
}
-#endif /* FEATURE_EXT_texture_sRGB */
+/**
+ * Convert a float value from linear space to a
+ * non-linear sRGB value in [0, 255].
+ * Not terribly efficient.
+ */
+static INLINE GLfloat
+linear_to_nonlinear(GLfloat cl)
+{
+ /* can't have values outside [0, 1] */
+ GLfloat cs;
+ if (cl < 0.0031308) {
+ cs = 12.92 * cl;
+ }
+ else {
+ cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055;
+ }
+ return cs;
+}
+
+#endif /* FEATURE_EXT_texture_sRGB */
/**
* This is the software fallback for Driver.GetTexImage().
@@ -3823,16 +3846,34 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
}
#if FEATURE_EXT_texture_sRGB
else if (is_srgb_teximage(texImage)) {
- /* no pixel transfer and no non-linear to linear conversion */
- const GLint comps = texImage->TexFormat->TexelBytes;
- const GLint rowstride = comps * texImage->RowStride;
- MEMCPY(dest,
- (const GLubyte *) texImage->Data + row * rowstride,
- comps * width * sizeof(GLubyte));
- /* FIXME: isn't it necessary to still do component assigning
- according to format/type? */
- /* FIXME: need to do something else for compressed srgb textures
- (currently will return values converted to linear) */
+ /* special case this since need to backconvert values */
+ /* convert row to RGBA format */
+ GLfloat rgba[MAX_WIDTH][4];
+ GLint col;
+ GLbitfield transferOps = 0x0;
+
+ for (col = 0; col < width; col++) {
+ (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]);
+ if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) {
+ rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]);
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ }
+ else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) {
+ rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]);
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ }
+ else if (texImage->TexFormat->BaseFormat == GL_RGB ||
+ texImage->TexFormat->BaseFormat == GL_RGBA) {
+ rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]);
+ rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]);
+ rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]);
+ }
+ }
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
+ format, type, dest,
+ &ctx->Pack, transferOps /*image xfer ops*/);
}
#endif /* FEATURE_EXT_texture_sRGB */
else {
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 9d9b28b518..106252e460 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -52,11 +52,13 @@
static void
update_array(GLcontext *ctx, struct gl_client_array *array,
GLbitfield dirtyBit, GLsizei elementSize,
- GLint size, GLenum type,
+ GLint size, GLenum type, GLenum format,
GLsizei stride, GLboolean normalized, const GLvoid *ptr)
{
+ ASSERT(format == GL_RGBA || format == GL_BGRA);
array->Size = size;
array->Type = type;
+ array->Format = format;
array->Stride = stride;
array->StrideB = stride ? stride : elementSize;
array->Normalized = normalized;
@@ -132,7 +134,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX,
- elementSize, size, type, stride, GL_FALSE, ptr);
+ elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr);
if (ctx->Driver.VertexPointer)
ctx->Driver.VertexPointer( ctx, size, type, stride, ptr );
@@ -182,7 +184,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
}
update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL,
- elementSize, 3, type, stride, GL_TRUE, ptr);
+ elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr);
if (ctx->Driver.NormalPointer)
ctx->Driver.NormalPointer( ctx, type, stride, ptr );
@@ -193,12 +195,15 @@ void GLAPIENTRY
_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
{
GLsizei elementSize;
+ GLenum format;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (size < 3 || size > 4) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" );
- return;
+ if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(size)");
+ return;
+ }
}
if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(stride)" );
@@ -209,6 +214,18 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
_mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size,
_mesa_lookup_enum_by_nr( type ), stride);
+ if (size == GL_BGRA) {
+ if (type != GL_UNSIGNED_BYTE) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)");
+ return;
+ }
+ format = GL_BGRA;
+ size = 4;
+ }
+ else {
+ format = GL_RGBA;
+ }
+
switch (type) {
case GL_BYTE:
elementSize = size * sizeof(GLbyte);
@@ -245,7 +262,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0,
- elementSize, size, type, stride, GL_TRUE, ptr);
+ elementSize, size, type, format, stride, GL_TRUE, ptr);
if (ctx->Driver.ColorPointer)
ctx->Driver.ColorPointer( ctx, size, type, stride, ptr );
@@ -277,7 +294,7 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD,
- elementSize, 1, type, stride, GL_FALSE, ptr);
+ elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr);
if (ctx->Driver.FogCoordPointer)
ctx->Driver.FogCoordPointer( ctx, type, stride, ptr );
@@ -318,7 +335,7 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX,
- elementSize, 1, type, stride, GL_FALSE, ptr);
+ elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr);
if (ctx->Driver.IndexPointer)
ctx->Driver.IndexPointer( ctx, type, stride, ptr );
@@ -330,12 +347,15 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
GLsizei elementSize;
+ GLenum format;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (size != 3 && size != 4) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)" );
- return;
+ if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)");
+ return;
+ }
}
if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(stride)" );
@@ -346,6 +366,18 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
_mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n",
size, _mesa_lookup_enum_by_nr( type ), stride);
+ if (size == GL_BGRA) {
+ if (type != GL_UNSIGNED_BYTE) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)");
+ return;
+ }
+ format = GL_BGRA;
+ size = 4;
+ }
+ else {
+ format = GL_RGBA;
+ }
+
switch (type) {
case GL_BYTE:
elementSize = size * sizeof(GLbyte);
@@ -377,7 +409,7 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
}
update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1,
- elementSize, size, type, stride, GL_TRUE, ptr);
+ elementSize, size, type, format, stride, GL_TRUE, ptr);
if (ctx->Driver.SecondaryColorPointer)
ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr );
@@ -437,7 +469,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit],
_NEW_ARRAY_TEXCOORD(unit),
- elementSize, size, type, stride, GL_FALSE, ptr);
+ elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr);
if (ctx->Driver.TexCoordPointer)
ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr );
@@ -456,7 +488,8 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG,
- sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, stride, GL_FALSE, ptr);
+ sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA,
+ stride, GL_FALSE, ptr);
if (ctx->Driver.EdgeFlagPointer)
ctx->Driver.EdgeFlagPointer( ctx, stride, ptr );
@@ -490,7 +523,7 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr)
}
update_array(ctx, &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE,
- elementSize, 1, type, stride, GL_FALSE, ptr);
+ elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr);
}
@@ -546,7 +579,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
_NEW_ARRAY_ATTRIB(index),
- elementSize, size, type, stride, normalized, ptr);
+ elementSize, size, type, GL_RGBA, stride, normalized, ptr);
if (ctx->Driver.VertexAttribPointer)
ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr );
@@ -561,6 +594,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
GLsizei elementSize;
+ GLenum format;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -570,8 +604,10 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
}
if (size < 1 || size > 4) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)");
- return;
+ if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)");
+ return;
+ }
}
if (stride < 0) {
@@ -579,6 +615,20 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
return;
}
+ if (size == GL_BGRA) {
+ if (type != GL_UNSIGNED_BYTE) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glVertexAttribPointerARB(GL_BGRA/type)");
+ return;
+ }
+ format = GL_BGRA;
+ size = 4;
+ normalized = GL_TRUE;
+ }
+ else {
+ format = GL_RGBA;
+ }
+
/* check for valid 'type' and compute StrideB right away */
/* NOTE: more types are supported here than in the NV extension */
switch (type) {
@@ -618,7 +668,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
_NEW_ARRAY_ATTRIB(index),
- elementSize, size, type, stride, normalized, ptr);
+ elementSize, size, type, GL_RGBA, stride, normalized, ptr);
if (ctx->Driver.VertexAttribPointer)
ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr);
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 84dcb263c6..9287e8515c 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -1,6 +1,10 @@
/*
* Mesa 3-D graphics library
+<<<<<<< HEAD:src/mesa/main/version.h
+ * Version: 7.5
+=======
* Version: 7.4
+>>>>>>> origin/gallium-0.2:src/mesa/main/version.h
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
@@ -29,9 +33,9 @@
/* Mesa version */
#define MESA_MAJOR 7
-#define MESA_MINOR 4
+#define MESA_MINOR 5
#define MESA_PATCH 0
-#define MESA_VERSION_STRING "7.4"
+#define MESA_VERSION_STRING "7.5-devel"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 84b4cae4ad..58cae88b08 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1620,3 +1620,24 @@ _math_transposefd( GLfloat to[16], const GLdouble from[16] )
/*@}*/
+
+/**
+ * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This
+ * function is used for transforming clipping plane equations and spotlight
+ * directions.
+ * Mathematically, u = v * m.
+ * Input: v - input vector
+ * m - transformation matrix
+ * Output: u - transformed vector
+ */
+void
+_mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[16] )
+{
+ const GLfloat v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];
+#define M(row,col) m[row + col*4]
+ u[0] = v0 * M(0,0) + v1 * M(1,0) + v2 * M(2,0) + v3 * M(3,0);
+ u[1] = v0 * M(0,1) + v1 * M(1,1) + v2 * M(2,1) + v3 * M(3,1);
+ u[2] = v0 * M(0,2) + v1 * M(1,2) + v2 * M(2,2) + v3 * M(3,2);
+ u[3] = v0 * M(0,3) + v1 * M(1,3) + v2 * M(2,3) + v3 * M(3,3);
+#undef M
+}
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h
index a8d9000e89..3bc5de6cd4 100644
--- a/src/mesa/math/m_matrix.h
+++ b/src/mesa/math/m_matrix.h
@@ -200,6 +200,9 @@ do { \
} while (0)
+extern void
+_mesa_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16]);
+
/*@}*/
diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c
index 901ae5b416..369f2c6e95 100644
--- a/src/mesa/math/m_xform.c
+++ b/src/mesa/math/m_xform.c
@@ -40,7 +40,6 @@
#include "m_matrix.h"
#include "m_translate.h"
#include "m_xform.h"
-#include "mathmod.h"
#ifdef DEBUG_MATH
@@ -97,99 +96,6 @@ transform_func *_mesa_transform_tab[5];
#undef ARGS
-
-
-GLvector4f *_mesa_project_points( GLvector4f *proj_vec,
- const GLvector4f *clip_vec )
-{
- const GLuint stride = clip_vec->stride;
- const GLfloat *from = (GLfloat *)clip_vec->start;
- const GLuint count = clip_vec->count;
- GLfloat (*vProj)[4] = (GLfloat (*)[4])proj_vec->start;
- GLuint i;
-
- for (i = 0 ; i < count ; i++, STRIDE_F(from, stride))
- {
- GLfloat oow = 1.0F / from[3];
- vProj[i][3] = oow;
- vProj[i][0] = from[0] * oow;
- vProj[i][1] = from[1] * oow;
- vProj[i][2] = from[2] * oow;
- }
-
- proj_vec->flags |= VEC_SIZE_4;
- proj_vec->size = 3;
- proj_vec->count = clip_vec->count;
- return proj_vec;
-}
-
-
-
-
-
-
-/*
- * Transform a 4-element row vector (1x4 matrix) by a 4x4 matrix. This
- * function is used for transforming clipping plane equations and spotlight
- * directions.
- * Mathematically, u = v * m.
- * Input: v - input vector
- * m - transformation matrix
- * Output: u - transformed vector
- */
-void _mesa_transform_vector( GLfloat u[4], const GLfloat v[4], const GLfloat m[16] )
-{
- GLfloat v0=v[0], v1=v[1], v2=v[2], v3=v[3];
-#define M(row,col) m[row + col*4]
- u[0] = v0 * M(0,0) + v1 * M(1,0) + v2 * M(2,0) + v3 * M(3,0);
- u[1] = v0 * M(0,1) + v1 * M(1,1) + v2 * M(2,1) + v3 * M(3,1);
- u[2] = v0 * M(0,2) + v1 * M(1,2) + v2 * M(2,2) + v3 * M(3,2);
- u[3] = v0 * M(0,3) + v1 * M(1,3) + v2 * M(2,3) + v3 * M(3,3);
-#undef M
-}
-
-
-/* Useful for one-off point transformations, as in clipping.
- * Note that because the matrix isn't analysed we do too many
- * multiplies, and that the result is always 4-clean.
- */
-void _mesa_transform_point_sz( GLfloat Q[4], const GLfloat M[16],
- const GLfloat P[4], GLuint sz )
-{
- if (Q == P)
- return;
-
- if (sz == 4)
- {
- Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3];
- Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3];
- Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3];
- Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3];
- }
- else if (sz == 3)
- {
- Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12];
- Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13];
- Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14];
- Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15];
- }
- else if (sz == 2)
- {
- Q[0] = M[0] * P[0] + M[4] * P[1] + M[12];
- Q[1] = M[1] * P[0] + M[5] * P[1] + M[13];
- Q[2] = M[2] * P[0] + M[6] * P[1] + M[14];
- Q[3] = M[3] * P[0] + M[7] * P[1] + M[15];
- }
- else if (sz == 1)
- {
- Q[0] = M[0] * P[0] + M[12];
- Q[1] = M[1] * P[0] + M[13];
- Q[2] = M[2] * P[0] + M[14];
- Q[3] = M[3] * P[0] + M[15];
- }
-}
-
-
/*
* This is called only once. It initializes several tables with pointers
* to optimized transformation functions. This is where we can test for
@@ -220,11 +126,3 @@ _math_init_transformation( void )
_mesa_init_all_x86_64_transform_asm();
#endif
}
-
-void
-_math_init( void )
-{
- _math_init_transformation();
- _math_init_translate();
- _math_init_eval();
-}
diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h
index 24e8ddbd57..7ef76e0b92 100644
--- a/src/mesa/math/m_xform.h
+++ b/src/mesa/math/m_xform.h
@@ -42,10 +42,6 @@
extern void
-_mesa_transform_vector(GLfloat u[4], CONST GLfloat v[4], CONST GLfloat m[16]);
-
-
-extern void
_math_init_transformation(void);
@@ -148,18 +144,6 @@ typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
CONST GLvector4f *from_vec );
-extern GLvector4f *_mesa_project_points( GLvector4f *to,
- CONST GLvector4f *from );
-
-extern void _mesa_transform_bounds3( GLubyte *orMask, GLubyte *andMask,
- CONST GLfloat m[16],
- CONST GLfloat src[][3] );
-
-extern void _mesa_transform_bounds2( GLubyte *orMask, GLubyte *andMask,
- CONST GLfloat m[16],
- CONST GLfloat src[][3] );
-
-
extern dotprod_func _mesa_dotprod_tab[5];
extern vec_copy_func _mesa_copy_tab[0x10];
extern vec_copy_func _mesa_copy_clean_tab[5];
@@ -173,9 +157,6 @@ extern normal_func _mesa_normal_tab[0xf];
extern transform_func *_mesa_transform_tab[5];
-extern void _mesa_transform_point_sz( GLfloat Q[4], CONST GLfloat M[16],
- CONST GLfloat P[4], GLuint sz );
-
#define TransformRaw( to, mat, from ) \
( _mesa_transform_tab[(from)->size][(mat)->type]( to, (mat)->m, from ), \
diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h
deleted file mode 100644
index 6fbaaea94b..0000000000
--- a/src/mesa/math/mathmod.h
+++ /dev/null
@@ -1,41 +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.
- */
-
-
-/**
- * \mainpage Mesa Math Module
- *
- * This module contains math-related utility functions for transforming
- * vertices, translating arrays of numbers from one data type to another,
- * evaluating curved surfaces, etc.
- */
-
-
-#ifndef _MESA_MATH_H_
-#define _MESA_MATH_H_
-
-extern void _math_init( void );
-
-#endif
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 5b80d99d49..2e0fc3694a 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3648,8 +3648,7 @@ enable_parser_extensions(GLcontext *ctx, grammar id)
if (ctx->Extensions.NV_texture_rectangle
&& !enable_ext(ctx, id, "texture_rectangle"))
return GL_FALSE;
- if (ctx->Extensions.ARB_draw_buffers
- && !enable_ext(ctx, id, "draw_buffers"))
+ if (!enable_ext(ctx, id, "draw_buffers"))
return GL_FALSE;
if (ctx->Extensions.MESA_texture_array
&& !enable_ext(ctx, id, "texture_array"))
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 7c2b747c43..7831e0faf9 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -335,10 +335,6 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]);
break;
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB:
- if (!ctx->Extensions.ARB_vertex_buffer_object) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribfvARB(pname)");
- return;
- }
params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name;
break;
default:
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 88272fff3f..16116c4339 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -469,10 +469,6 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
params[3] = (GLint) ctx->Current.Attrib[index][3];
break;
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB:
- if (!ctx->Extensions.ARB_vertex_buffer_object) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV");
- return;
- }
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name;
break;
default:
diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h
index f978334ab2..c649b3db5e 100644
--- a/src/mesa/shader/prog_instruction.h
+++ b/src/mesa/shader/prog_instruction.h
@@ -418,7 +418,7 @@ struct prog_instruction
*/
GLint BranchTarget;
-#if 0
+#if 01 /* XXX just use this for i965 driver for now! */
/**
* For TEX instructions in shaders, the sampler to use for the
* texture lookup.
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 8f33d4f651..ce48767a87 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -3,6 +3,7 @@
* Version: 7.3
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -217,48 +218,48 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode,
switch (mode) {
case PROG_PRINT_DEBUG:
if (relAddr)
- sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index);
+ _mesa_sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index);
else
- sprintf(str, "%s[%d]", file_string(f, mode), index);
+ _mesa_sprintf(str, "%s[%d]", file_string(f, mode), index);
break;
case PROG_PRINT_ARB:
switch (f) {
case PROGRAM_INPUT:
- sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
+ _mesa_sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
break;
case PROGRAM_OUTPUT:
- sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
+ _mesa_sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
break;
case PROGRAM_TEMPORARY:
- sprintf(str, "temp%d", index);
+ _mesa_sprintf(str, "temp%d", index);
break;
case PROGRAM_ENV_PARAM:
- sprintf(str, "program.env[%d]", index);
+ _mesa_sprintf(str, "program.env[%d]", index);
break;
case PROGRAM_LOCAL_PARAM:
- sprintf(str, "program.local[%d]", index);
+ _mesa_sprintf(str, "program.local[%d]", index);
break;
case PROGRAM_VARYING: /* extension */
- sprintf(str, "varying[%d]", index);
+ _mesa_sprintf(str, "varying[%d]", index);
break;
case PROGRAM_CONSTANT: /* extension */
- sprintf(str, "constant[%d]", index);
+ _mesa_sprintf(str, "constant[%d]", index);
break;
case PROGRAM_UNIFORM: /* extension */
- sprintf(str, "uniform[%d]", index);
+ _mesa_sprintf(str, "uniform[%d]", index);
break;
case PROGRAM_STATE_VAR:
{
struct gl_program_parameter *param
= prog->Parameters->Parameters + index;
char *state = _mesa_program_state_string(param->StateIndexes);
- sprintf(str, state);
+ _mesa_sprintf(str, state);
_mesa_free(state);
}
break;
case PROGRAM_ADDRESS:
- sprintf(str, "A%d", index);
+ _mesa_sprintf(str, "A%d", index);
break;
default:
_mesa_problem(NULL, "bad file in reg_string()");
@@ -269,30 +270,30 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode,
switch (f) {
case PROGRAM_INPUT:
if (prog->Target == GL_VERTEX_PROGRAM_ARB)
- sprintf(str, "v[%d]", index);
+ _mesa_sprintf(str, "v[%d]", index);
else
- sprintf(str, "f[%d]", index);
+ _mesa_sprintf(str, "f[%d]", index);
break;
case PROGRAM_OUTPUT:
- sprintf(str, "o[%d]", index);
+ _mesa_sprintf(str, "o[%d]", index);
break;
case PROGRAM_TEMPORARY:
- sprintf(str, "R%d", index);
+ _mesa_sprintf(str, "R%d", index);
break;
case PROGRAM_ENV_PARAM:
- sprintf(str, "c[%d]", index);
+ _mesa_sprintf(str, "c[%d]", index);
break;
case PROGRAM_VARYING: /* extension */
- sprintf(str, "varying[%d]", index);
+ _mesa_sprintf(str, "varying[%d]", index);
break;
case PROGRAM_UNIFORM: /* extension */
- sprintf(str, "uniform[%d]", index);
+ _mesa_sprintf(str, "uniform[%d]", index);
break;
case PROGRAM_CONSTANT: /* extension */
- sprintf(str, "constant[%d]", index);
+ _mesa_sprintf(str, "constant[%d]", index);
break;
case PROGRAM_STATE_VAR: /* extension */
- sprintf(str, "state[%d]", index);
+ _mesa_sprintf(str, "state[%d]", index);
break;
default:
_mesa_problem(NULL, "bad file in reg_string()");
@@ -416,90 +417,98 @@ _mesa_condcode_string(GLuint condcode)
static void
-print_dst_reg(const struct prog_dst_register *dstReg, gl_prog_print_mode mode,
- const struct gl_program *prog)
+fprint_dst_reg(FILE * f,
+ const struct prog_dst_register *dstReg,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
{
- _mesa_printf("%s%s",
- reg_string((enum register_file) dstReg->File,
- dstReg->Index, mode, dstReg->RelAddr, prog),
- _mesa_writemask_string(dstReg->WriteMask));
+ _mesa_fprintf(f, "%s%s",
+ reg_string((enum register_file) dstReg->File,
+ dstReg->Index, mode, dstReg->RelAddr, prog),
+ _mesa_writemask_string(dstReg->WriteMask));
if (dstReg->CondMask != COND_TR) {
- _mesa_printf(" (%s.%s)",
- _mesa_condcode_string(dstReg->CondMask),
- _mesa_swizzle_string(dstReg->CondSwizzle, GL_FALSE, GL_FALSE));
+ _mesa_fprintf(f, " (%s.%s)",
+ _mesa_condcode_string(dstReg->CondMask),
+ _mesa_swizzle_string(dstReg->CondSwizzle,
+ GL_FALSE, GL_FALSE));
}
#if 0
- _mesa_printf("%s[%d]%s",
+ _mesa_fprintf(f, "%s[%d]%s",
file_string((enum register_file) dstReg->File, mode),
dstReg->Index,
_mesa_writemask_string(dstReg->WriteMask));
#endif
}
+
static void
-print_src_reg(const struct prog_src_register *srcReg, gl_prog_print_mode mode,
- const struct gl_program *prog)
+fprint_src_reg(FILE *f,
+ const struct prog_src_register *srcReg,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
{
- _mesa_printf("%s%s",
- reg_string((enum register_file) srcReg->File,
- srcReg->Index, mode, srcReg->RelAddr, prog),
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->NegateBase, GL_FALSE));
+ _mesa_fprintf(f, "%s%s",
+ reg_string((enum register_file) srcReg->File,
+ srcReg->Index, mode, srcReg->RelAddr, prog),
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->NegateBase, GL_FALSE));
#if 0
- _mesa_printf("%s[%d]%s",
- file_string((enum register_file) srcReg->File, mode),
- srcReg->Index,
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->NegateBase, GL_FALSE));
+ _mesa_fprintf(f, "%s[%d]%s",
+ file_string((enum register_file) srcReg->File, mode),
+ srcReg->Index,
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->NegateBase, GL_FALSE));
#endif
}
+
static void
-print_comment(const struct prog_instruction *inst)
+fprint_comment(FILE *f, const struct prog_instruction *inst)
{
if (inst->Comment)
- _mesa_printf("; # %s\n", inst->Comment);
+ _mesa_fprintf(f, "; # %s\n", inst->Comment);
else
- _mesa_printf(";\n");
+ _mesa_fprintf(f, ";\n");
}
static void
-print_alu_instruction(const struct prog_instruction *inst,
- const char *opcode_string, GLuint numRegs,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
+fprint_alu_instruction(FILE *f,
+ const struct prog_instruction *inst,
+ const char *opcode_string, GLuint numRegs,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
{
GLuint j;
- _mesa_printf("%s", opcode_string);
+ _mesa_fprintf(f, "%s", opcode_string);
if (inst->CondUpdate)
- _mesa_printf(".C");
+ _mesa_fprintf(f, ".C");
/* frag prog only */
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_printf("_SAT");
+ _mesa_fprintf(f, "_SAT");
- _mesa_printf(" ");
+ _mesa_fprintf(f, " ");
if (inst->DstReg.File != PROGRAM_UNDEFINED) {
- print_dst_reg(&inst->DstReg, mode, prog);
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
}
else {
- _mesa_printf(" ???");
+ _mesa_fprintf(f, " ???");
}
if (numRegs > 0)
- _mesa_printf(", ");
+ _mesa_fprintf(f, ", ");
for (j = 0; j < numRegs; j++) {
- print_src_reg(inst->SrcReg + j, mode, prog);
+ fprint_src_reg(f, inst->SrcReg + j, mode, prog);
if (j + 1 < numRegs)
- _mesa_printf(", ");
+ _mesa_fprintf(f, ", ");
}
- print_comment(inst);
+ fprint_comment(f, inst);
}
@@ -507,23 +516,18 @@ void
_mesa_print_alu_instruction(const struct prog_instruction *inst,
const char *opcode_string, GLuint numRegs)
{
- print_alu_instruction(inst, opcode_string, numRegs, PROG_PRINT_DEBUG, NULL);
-}
-
-
-void
-_mesa_print_instruction(const struct prog_instruction *inst)
-{
- /* note: 4th param should be ignored for PROG_PRINT_DEBUG */
- _mesa_print_instruction_opt(inst, 0, PROG_PRINT_DEBUG, NULL);
+ fprint_alu_instruction(stdout, inst, opcode_string,
+ numRegs, PROG_PRINT_DEBUG, NULL);
}
/**
* Print a single vertex/fragment program instruction.
*/
-GLint
-_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
+static GLint
+_mesa_fprint_instruction_opt(FILE *f,
+ const struct prog_instruction *inst,
+ GLint indent,
gl_prog_print_mode mode,
const struct gl_program *prog)
{
@@ -536,15 +540,15 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
indent -= 3;
}
for (i = 0; i < indent; i++) {
- _mesa_printf(" ");
+ _mesa_fprintf(f, " ");
}
switch (inst->Opcode) {
case OPCODE_PRINT:
- _mesa_printf("PRINT '%s'", inst->Data);
+ _mesa_fprintf(f, "PRINT '%s'", inst->Data);
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
- _mesa_printf(", ");
- _mesa_printf("%s[%d]%s",
+ _mesa_fprintf(f, ", ");
+ _mesa_fprintf(f, "%s[%d]%s",
file_string((enum register_file) inst->SrcReg[0].File,
mode),
inst->SrcReg[0].Index,
@@ -552,259 +556,295 @@ _mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
inst->SrcReg[0].NegateBase, GL_FALSE));
}
if (inst->Comment)
- _mesa_printf(" # %s", inst->Comment);
- print_comment(inst);
+ _mesa_fprintf(f, " # %s", inst->Comment);
+ fprint_comment(f, inst);
break;
case OPCODE_SWZ:
- _mesa_printf("SWZ");
+ _mesa_fprintf(f, "SWZ");
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_printf("_SAT");
- _mesa_printf(" ");
- print_dst_reg(&inst->DstReg, mode, prog);
- _mesa_printf(", %s[%d], %s",
+ _mesa_fprintf(f, "_SAT");
+ _mesa_fprintf(f, " ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ _mesa_fprintf(f, ", %s[%d], %s",
file_string((enum register_file) inst->SrcReg[0].File,
mode),
inst->SrcReg[0].Index,
_mesa_swizzle_string(inst->SrcReg[0].Swizzle,
inst->SrcReg[0].NegateBase, GL_TRUE));
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_TEX:
case OPCODE_TXP:
case OPCODE_TXL:
case OPCODE_TXB:
- _mesa_printf("%s", _mesa_opcode_string(inst->Opcode));
+ _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
if (inst->SaturateMode == SATURATE_ZERO_ONE)
- _mesa_printf("_SAT");
- _mesa_printf(" ");
- print_dst_reg(&inst->DstReg, mode, prog);
- _mesa_printf(", ");
- print_src_reg(&inst->SrcReg[0], mode, prog);
- _mesa_printf(", texture[%d], ", inst->TexSrcUnit);
+ _mesa_fprintf(f, "_SAT");
+ _mesa_fprintf(f, " ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ _mesa_fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ _mesa_fprintf(f, ", texture[%d], ", inst->TexSrcUnit);
switch (inst->TexSrcTarget) {
- case TEXTURE_1D_INDEX: _mesa_printf("1D"); break;
- case TEXTURE_2D_INDEX: _mesa_printf("2D"); break;
- case TEXTURE_3D_INDEX: _mesa_printf("3D"); break;
- case TEXTURE_CUBE_INDEX: _mesa_printf("CUBE"); break;
- case TEXTURE_RECT_INDEX: _mesa_printf("RECT"); break;
+ case TEXTURE_1D_INDEX: _mesa_fprintf(f, "1D"); break;
+ case TEXTURE_2D_INDEX: _mesa_fprintf(f, "2D"); break;
+ case TEXTURE_3D_INDEX: _mesa_fprintf(f, "3D"); break;
+ case TEXTURE_CUBE_INDEX: _mesa_fprintf(f, "CUBE"); break;
+ case TEXTURE_RECT_INDEX: _mesa_fprintf(f, "RECT"); break;
default:
;
}
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_KIL:
- _mesa_printf("%s", _mesa_opcode_string(inst->Opcode));
- _mesa_printf(" ");
- print_src_reg(&inst->SrcReg[0], mode, prog);
- print_comment(inst);
+ _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ _mesa_fprintf(f, " ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ fprint_comment(f, inst);
break;
case OPCODE_KIL_NV:
- _mesa_printf("%s", _mesa_opcode_string(inst->Opcode));
- _mesa_printf(" ");
- _mesa_printf("%s.%s",
+ _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ _mesa_fprintf(f, " ");
+ _mesa_fprintf(f, "%s.%s",
_mesa_condcode_string(inst->DstReg.CondMask),
_mesa_swizzle_string(inst->DstReg.CondSwizzle,
GL_FALSE, GL_FALSE));
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_ARL:
- _mesa_printf("ARL ");
- print_dst_reg(&inst->DstReg, mode, prog);
- _mesa_printf(", ");
- print_src_reg(&inst->SrcReg[0], mode, prog);
- print_comment(inst);
+ _mesa_fprintf(f, "ARL ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ _mesa_fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ fprint_comment(f, inst);
break;
case OPCODE_BRA:
- _mesa_printf("BRA %d (%s%s)",
+ _mesa_fprintf(f, "BRA %d (%s%s)",
inst->BranchTarget,
_mesa_condcode_string(inst->DstReg.CondMask),
_mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_IF:
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
/* Use ordinary register */
- _mesa_printf("IF ");
- print_src_reg(&inst->SrcReg[0], mode, prog);
- _mesa_printf("; ");
+ _mesa_fprintf(f, "IF ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ _mesa_fprintf(f, "; ");
}
else {
/* Use cond codes */
- _mesa_printf("IF (%s%s);",
+ _mesa_fprintf(f, "IF (%s%s);",
_mesa_condcode_string(inst->DstReg.CondMask),
_mesa_swizzle_string(inst->DstReg.CondSwizzle,
0, GL_FALSE));
}
- _mesa_printf(" # (if false, goto %d)", inst->BranchTarget);
- print_comment(inst);
+ _mesa_fprintf(f, " # (if false, goto %d)", inst->BranchTarget);
+ fprint_comment(f, inst);
return indent + 3;
case OPCODE_ELSE:
- _mesa_printf("ELSE; # (goto %d)\n", inst->BranchTarget);
+ _mesa_fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget);
return indent + 3;
case OPCODE_ENDIF:
- _mesa_printf("ENDIF;\n");
+ _mesa_fprintf(f, "ENDIF;\n");
break;
case OPCODE_BGNLOOP:
- _mesa_printf("BGNLOOP; # (end at %d)\n", inst->BranchTarget);
+ _mesa_fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget);
return indent + 3;
case OPCODE_ENDLOOP:
- _mesa_printf("ENDLOOP; # (goto %d)\n", inst->BranchTarget);
+ _mesa_fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget);
break;
case OPCODE_BRK:
case OPCODE_CONT:
- _mesa_printf("%s (%s%s); # (goto %d)",
+ _mesa_fprintf(f, "%s (%s%s); # (goto %d)",
_mesa_opcode_string(inst->Opcode),
_mesa_condcode_string(inst->DstReg.CondMask),
_mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
inst->BranchTarget);
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_BGNSUB:
if (mode == PROG_PRINT_NV) {
- _mesa_printf("%s:\n", inst->Comment); /* comment is label */
+ _mesa_fprintf(f, "%s:\n", inst->Comment); /* comment is label */
return indent;
}
else {
- _mesa_printf("BGNSUB");
- print_comment(inst);
+ _mesa_fprintf(f, "BGNSUB");
+ fprint_comment(f, inst);
return indent + 3;
}
case OPCODE_ENDSUB:
if (mode == PROG_PRINT_DEBUG) {
- _mesa_printf("ENDSUB");
- print_comment(inst);
+ _mesa_fprintf(f, "ENDSUB");
+ fprint_comment(f, inst);
}
break;
case OPCODE_CAL:
if (mode == PROG_PRINT_NV) {
- _mesa_printf("CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
+ _mesa_fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
}
else {
- _mesa_printf("CAL %u", inst->BranchTarget);
- print_comment(inst);
+ _mesa_fprintf(f, "CAL %u", inst->BranchTarget);
+ fprint_comment(f, inst);
}
break;
case OPCODE_RET:
- _mesa_printf("RET (%s%s)",
+ _mesa_fprintf(f, "RET (%s%s)",
_mesa_condcode_string(inst->DstReg.CondMask),
_mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
- print_comment(inst);
+ fprint_comment(f, inst);
break;
case OPCODE_END:
- _mesa_printf("END\n");
+ _mesa_fprintf(f, "END\n");
break;
case OPCODE_NOP:
if (mode == PROG_PRINT_DEBUG) {
- _mesa_printf("NOP");
- print_comment(inst);
+ _mesa_fprintf(f, "NOP");
+ fprint_comment(f, inst);
}
else if (inst->Comment) {
/* ARB/NV extensions don't have NOP instruction */
- _mesa_printf("# %s\n", inst->Comment);
+ _mesa_fprintf(f, "# %s\n", inst->Comment);
}
break;
/* XXX may need other special-case instructions */
default:
/* typical alu instruction */
- print_alu_instruction(inst,
- _mesa_opcode_string(inst->Opcode),
- _mesa_num_inst_src_regs(inst->Opcode),
- mode, prog);
+ fprint_alu_instruction(f, inst,
+ _mesa_opcode_string(inst->Opcode),
+ _mesa_num_inst_src_regs(inst->Opcode),
+ mode, prog);
break;
}
return indent;
}
-/**
- * Print program to stdout, default options.
- */
+GLint
+_mesa_print_instruction_opt(const struct prog_instruction *inst,
+ GLint indent,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ return _mesa_fprint_instruction_opt(stdout, inst, indent, mode, prog);
+}
+
+
void
-_mesa_print_program(const struct gl_program *prog)
+_mesa_print_instruction(const struct prog_instruction *inst)
{
- _mesa_print_program_opt(prog, PROG_PRINT_DEBUG, GL_TRUE);
+ /* note: 4th param should be ignored for PROG_PRINT_DEBUG */
+ _mesa_fprint_instruction_opt(stdout, inst, 0, PROG_PRINT_DEBUG, NULL);
}
+
/**
* Print program, with options.
*/
void
-_mesa_print_program_opt(const struct gl_program *prog,
- gl_prog_print_mode mode,
- GLboolean lineNumbers)
+_mesa_fprint_program_opt(FILE *f,
+ const struct gl_program *prog,
+ gl_prog_print_mode mode,
+ GLboolean lineNumbers)
{
GLuint i, indent = 0;
switch (prog->Target) {
case GL_VERTEX_PROGRAM_ARB:
if (mode == PROG_PRINT_ARB)
- _mesa_printf("!!ARBvp1.0\n");
+ _mesa_fprintf(f, "!!ARBvp1.0\n");
else if (mode == PROG_PRINT_NV)
- _mesa_printf("!!VP1.0\n");
+ _mesa_fprintf(f, "!!VP1.0\n");
else
- _mesa_printf("# Vertex Program/Shader\n");
+ _mesa_fprintf(f, "# Vertex Program/Shader\n");
break;
case GL_FRAGMENT_PROGRAM_ARB:
case GL_FRAGMENT_PROGRAM_NV:
if (mode == PROG_PRINT_ARB)
- _mesa_printf("!!ARBfp1.0\n");
+ _mesa_fprintf(f, "!!ARBfp1.0\n");
else if (mode == PROG_PRINT_NV)
- _mesa_printf("!!FP1.0\n");
+ _mesa_fprintf(f, "!!FP1.0\n");
else
- _mesa_printf("# Fragment Program/Shader\n");
+ _mesa_fprintf(f, "# Fragment Program/Shader\n");
break;
}
for (i = 0; i < prog->NumInstructions; i++) {
if (lineNumbers)
- _mesa_printf("%3d: ", i);
- indent = _mesa_print_instruction_opt(prog->Instructions + i,
+ _mesa_fprintf(f, "%3d: ", i);
+ indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i,
indent, mode, prog);
}
}
/**
- * Print all of a program's parameters.
+ * Print program to stdout, default options.
*/
void
-_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
+_mesa_print_program(const struct gl_program *prog)
+{
+ _mesa_fprint_program_opt(stdout, prog, PROG_PRINT_DEBUG, GL_TRUE);
+}
+
+
+/**
+ * Print all of a program's parameters/fields to given file.
+ */
+static void
+_mesa_fprint_program_parameters(FILE *f,
+ GLcontext *ctx,
+ const struct gl_program *prog)
{
GLuint i;
- _mesa_printf("InputsRead: 0x%x\n", prog->InputsRead);
- _mesa_printf("OutputsWritten: 0x%x\n", prog->OutputsWritten);
- _mesa_printf("NumInstructions=%d\n", prog->NumInstructions);
- _mesa_printf("NumTemporaries=%d\n", prog->NumTemporaries);
- _mesa_printf("NumParameters=%d\n", prog->NumParameters);
- _mesa_printf("NumAttributes=%d\n", prog->NumAttributes);
- _mesa_printf("NumAddressRegs=%d\n", prog->NumAddressRegs);
- _mesa_printf("Samplers=[ ");
+ _mesa_fprintf(f, "InputsRead: 0x%x\n", prog->InputsRead);
+ _mesa_fprintf(f, "OutputsWritten: 0x%x\n", prog->OutputsWritten);
+ _mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
+ _mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
+ _mesa_fprintf(f, "NumParameters=%d\n", prog->NumParameters);
+ _mesa_fprintf(f, "NumAttributes=%d\n", prog->NumAttributes);
+ _mesa_fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs);
+ _mesa_fprintf(f, "Samplers=[ ");
for (i = 0; i < MAX_SAMPLERS; i++) {
- _mesa_printf("%d ", prog->SamplerUnits[i]);
+ _mesa_fprintf(f, "%d ", prog->SamplerUnits[i]);
}
- _mesa_printf("]\n");
+ _mesa_fprintf(f, "]\n");
_mesa_load_state_parameters(ctx, prog->Parameters);
#if 0
- _mesa_printf("Local Params:\n");
+ _mesa_fprintf(f, "Local Params:\n");
for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){
const GLfloat *p = prog->LocalParams[i];
- _mesa_printf("%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
+ _mesa_fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
}
#endif
_mesa_print_parameter_list(prog->Parameters);
}
+/**
+ * Print all of a program's parameters/fields to stdout.
+ */
void
-_mesa_print_parameter_list(const struct gl_program_parameter_list *list)
+_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
+{
+ _mesa_fprint_program_parameters(stdout, ctx, prog);
+}
+
+
+/**
+ * Print a program parameter list to given file.
+ */
+static void
+_mesa_fprint_parameter_list(FILE *f,
+ const struct gl_program_parameter_list *list)
{
const gl_prog_print_mode mode = PROG_PRINT_DEBUG;
GLuint i;
@@ -812,22 +852,77 @@ _mesa_print_parameter_list(const struct gl_program_parameter_list *list)
if (!list)
return;
- _mesa_printf("param list %p\n", (void *) list);
+ _mesa_fprintf(f, "param list %p\n", (void *) list);
for (i = 0; i < list->NumParameters; i++){
struct gl_program_parameter *param = list->Parameters + i;
const GLfloat *v = list->ParameterValues[i];
- _mesa_printf("param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
+ _mesa_fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
i, param->Size,
file_string(list->Parameters[i].Type, mode),
param->Name, v[0], v[1], v[2], v[3]);
if (param->Flags & PROG_PARAM_BIT_CENTROID)
- _mesa_printf(" Centroid");
+ _mesa_fprintf(f, " Centroid");
if (param->Flags & PROG_PARAM_BIT_INVARIANT)
- _mesa_printf(" Invariant");
+ _mesa_fprintf(f, " Invariant");
if (param->Flags & PROG_PARAM_BIT_FLAT)
- _mesa_printf(" Flat");
+ _mesa_fprintf(f, " Flat");
if (param->Flags & PROG_PARAM_BIT_LINEAR)
- _mesa_printf(" Linear");
- _mesa_printf("\n");
+ _mesa_fprintf(f, " Linear");
+ _mesa_fprintf(f, "\n");
}
}
+
+
+/**
+ * Print a program parameter list to stdout.
+ */
+void
+_mesa_print_parameter_list(const struct gl_program_parameter_list *list)
+{
+ _mesa_fprint_parameter_list(stdout, list);
+}
+
+
+/**
+ * Write shader and associated info to a file.
+ */
+void
+_mesa_write_shader_to_file(const struct gl_shader *shader)
+{
+ const char *type;
+ char filename[100];
+ FILE *f;
+
+ if (shader->Type == GL_FRAGMENT_SHADER)
+ type = "frag";
+ else
+ type = "vert";
+
+ _mesa_snprintf(filename, strlen(filename), "shader_%u.%s", shader->Name, type);
+ f = fopen(filename, "w");
+ if (!f) {
+ fprintf(stderr, "Unable to open %s for writing\n", filename);
+ return;
+ }
+
+ fprintf(f, "/* Shader %u source */\n", shader->Name);
+ fputs(shader->Source, f);
+ fprintf(f, "\n");
+
+ fprintf(f, "/* Compile status: %s */\n",
+ shader->CompileStatus ? "ok" : "fail");
+ if (!shader->CompileStatus) {
+ fprintf(f, "/* Log Info: */\n");
+ fputs(shader->InfoLog, f);
+ }
+ else {
+ fprintf(f, "/* GPU code */\n");
+ fprintf(f, "/*\n");
+ _mesa_fprint_program_opt(f, shader->Program, PROG_PRINT_DEBUG, GL_TRUE);
+ fprintf(f, "*/\n");
+ }
+
+ fclose(f);
+}
+
+
diff --git a/src/mesa/shader/prog_print.h b/src/mesa/shader/prog_print.h
index 3966909aed..d55661cebb 100644
--- a/src/mesa/shader/prog_print.h
+++ b/src/mesa/shader/prog_print.h
@@ -65,8 +65,9 @@ extern void
_mesa_print_program(const struct gl_program *prog);
extern void
-_mesa_print_program_opt(const struct gl_program *prog, gl_prog_print_mode mode,
- GLboolean lineNumbers);
+_mesa_fprint_program_opt(FILE *f,
+ const struct gl_program *prog, gl_prog_print_mode mode,
+ GLboolean lineNumbers);
extern void
_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog);
@@ -75,4 +76,8 @@ extern void
_mesa_print_parameter_list(const struct gl_program_parameter_list *list);
+extern void
+_mesa_write_shader_to_file(const struct gl_shader *shader);
+
+
#endif /* PROG_PRINT_H */
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 8d29acac8b..e1db30b78f 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -499,10 +499,10 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
const struct gl_texture_object *texObj
= ctx->Texture.Unit[unit]._Current;
if (texObj) {
- value[0] = texObj->ShadowAmbient;
- value[1] = texObj->ShadowAmbient;
- value[2] = texObj->ShadowAmbient;
- value[3] = texObj->ShadowAmbient;
+ value[0] =
+ value[1] =
+ value[2] =
+ value[3] = texObj->CompareFailValue;
}
}
return;
@@ -804,7 +804,7 @@ append_token(char *dst, gl_state_index k)
append(dst, "PCMbias");
break;
case STATE_SHADOW_AMBIENT:
- append(dst, "ShadowAmbient");
+ append(dst, "CompareFailValue");
break;
default:
/* probably STATE_INTERNAL_DRIVER+i (driver private state) */
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 122688826c..38f4cd03c4 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -370,6 +370,31 @@ _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller)
}
+/**
+ * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
+ */
+static GLbitfield
+get_shader_flags(void)
+{
+ GLbitfield flags = 0x0;
+ const char *env = _mesa_getenv("MESA_GLSL");
+
+ if (env) {
+ if (_mesa_strstr(env, "dump"))
+ flags |= GLSL_DUMP;
+ if (_mesa_strstr(env, "log"))
+ flags |= GLSL_LOG;
+ if (_mesa_strstr(env, "nopt"))
+ flags |= GLSL_NO_OPT;
+ else if (_mesa_strstr(env, "opt"))
+ flags |= GLSL_OPT;
+ if (_mesa_strstr(env, "uniform"))
+ flags |= GLSL_UNIFORMS;
+ }
+
+ return flags;
+}
+
/**
* Initialize context's shader state.
@@ -381,8 +406,9 @@ _mesa_init_shader_state(GLcontext * ctx)
* are generated by the GLSL compiler.
*/
ctx->Shader.EmitHighLevelInstructions = GL_TRUE;
- ctx->Shader.EmitCondCodes = GL_FALSE;/*GL_TRUE;*/ /* XXX probably want GL_FALSE... */
+ ctx->Shader.EmitCondCodes = GL_FALSE;
ctx->Shader.EmitComments = GL_FALSE;
+ ctx->Shader.Flags = get_shader_flags();
}
@@ -866,6 +892,7 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
{
const struct gl_shader_program *shProg;
const struct gl_program *prog;
+ const struct gl_program_parameter *param;
GLint progPos;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
@@ -891,14 +918,30 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
if (!prog || progPos < 0)
return; /* should never happen */
- if (nameOut)
- copy_string(nameOut, maxLength, length,
- prog->Parameters->Parameters[progPos].Name);
- if (size)
- *size = prog->Parameters->Parameters[progPos].Size
- / sizeof_glsl_type(prog->Parameters->Parameters[progPos].DataType);
- if (type)
- *type = prog->Parameters->Parameters[progPos].DataType;
+ ASSERT(progPos < prog->Parameters->NumParameters);
+ param = &prog->Parameters->Parameters[progPos];
+
+ if (nameOut) {
+ copy_string(nameOut, maxLength, length, param->Name);
+ }
+
+ if (size) {
+ GLint typeSize = sizeof_glsl_type(param->DataType);
+ if (param->Size > typeSize) {
+ /* This is an array.
+ * Array elements are placed on vector[4] boundaries so they're
+ * a multiple of four floats. We round typeSize up to next multiple
+ * of four to get the right size below.
+ */
+ typeSize = (typeSize + 3) & ~3;
+ }
+ /* Note that the returned size is in units of the <type>, not bytes */
+ *size = param->Size / typeSize;
+ }
+
+ if (type) {
+ *type = param->DataType;
+ }
}
@@ -1142,24 +1185,30 @@ get_uniform_rows_cols(const struct gl_program_parameter *p,
}
-#define MAX_UNIFORM_ELEMENTS 16
-
/**
- * Helper for GetUniformfv(), GetUniformiv()
- * Returns number of elements written to 'params' output.
+ * Helper for get_uniform[fi]v() functions.
+ * Given a shader program name and uniform location, return a pointer
+ * to the shader program and return the program parameter position.
*/
-static GLuint
-get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
- GLfloat *params)
+static void
+lookup_uniform_parameter(GLcontext *ctx, GLuint program, GLint location,
+ struct gl_program **progOut, GLint *paramPosOut)
{
struct gl_shader_program *shProg
= _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v");
- if (shProg) {
- if (shProg->Uniforms &&
- location >= 0 && location < (GLint) shProg->Uniforms->NumUniforms) {
- GLint progPos;
- const struct gl_program *prog = NULL;
+ struct gl_program *prog = NULL;
+ GLint progPos = -1;
+
+ /* if shProg is NULL, we'll have already recorded an error */
+ if (shProg) {
+ if (!shProg->Uniforms ||
+ location < 0 ||
+ location >= (GLint) shProg->Uniforms->NumUniforms) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
+ }
+ else {
+ /* OK, find the gl_program and program parameter location */
progPos = shProg->Uniforms->Uniforms[location].VertPos;
if (progPos >= 0) {
prog = &shProg->VertexProgram->Base;
@@ -1170,33 +1219,11 @@ get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
prog = &shProg->FragmentProgram->Base;
}
}
-
- ASSERT(prog);
- if (prog) {
- const struct gl_program_parameter *p =
- &prog->Parameters->Parameters[progPos];
- GLint rows, cols, i, j, k;
-
- /* See uniformiv() below */
- assert(p->Size <= MAX_UNIFORM_ELEMENTS);
-
- get_uniform_rows_cols(p, &rows, &cols);
-
- k = 0;
- for (i = 0; i < rows; i++) {
- for (j = 0; j < cols; j++ ) {
- params[k++] = prog->Parameters->ParameterValues[progPos+i][j];
- }
- }
-
- return p->Size;
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
}
}
- return 0;
+
+ *progOut = prog;
+ *paramPosOut = progPos;
}
@@ -1207,23 +1234,54 @@ static void
_mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
GLfloat *params)
{
- (void) get_uniformfv(ctx, program, location, params);
+ struct gl_program *prog;
+ GLint paramPos;
+
+ lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
+
+ if (prog) {
+ const struct gl_program_parameter *p =
+ &prog->Parameters->Parameters[paramPos];
+ GLint rows, cols, i, j, k;
+
+ get_uniform_rows_cols(p, &rows, &cols);
+
+ k = 0;
+ for (i = 0; i < rows; i++) {
+ for (j = 0; j < cols; j++ ) {
+ params[k++] = prog->Parameters->ParameterValues[paramPos+i][j];
+ }
+ }
+ }
}
/**
* Called via ctx->Driver.GetUniformiv().
+ * \sa _mesa_get_uniformfv, only difference is a cast.
*/
static void
_mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location,
GLint *params)
{
- GLfloat fparams[MAX_UNIFORM_ELEMENTS];
- GLuint n = get_uniformfv(ctx, program, location, fparams);
- GLuint i;
- assert(n <= MAX_UNIFORM_ELEMENTS);
- for (i = 0; i < n; i++) {
- params[i] = (GLint) fparams[i];
+ struct gl_program *prog;
+ GLint paramPos;
+
+ lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
+
+ if (prog) {
+ const struct gl_program_parameter *p =
+ &prog->Parameters->Parameters[paramPos];
+ GLint rows, cols, i, j, k;
+
+ get_uniform_rows_cols(p, &rows, &cols);
+
+ k = 0;
+ for (i = 0; i < rows; i++) {
+ for (j = 0; j < cols; j++ ) {
+ params[k++] = (GLint) prog->Parameters->ParameterValues[paramPos+i][j];
+ }
+ }
}
}
@@ -1364,7 +1422,10 @@ _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj)
if (!sh)
return;
- sh->CompileStatus = _slang_compile(ctx, sh);
+ /* this call will set the sh->CompileStatus field to indicate if
+ * compilation was successful.
+ */
+ (void) _slang_compile(ctx, sh);
}
@@ -1542,27 +1603,36 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
if (param->Type == PROGRAM_SAMPLER) {
/* This controls which texture unit which is used by a sampler */
GLuint texUnit, sampler;
+ GLint i;
/* data type for setting samplers must be int */
- if (type != GL_INT || count != 1) {
+ if (type != GL_INT) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glUniform(only glUniform1i can be used "
"to set sampler uniforms)");
return;
}
- sampler = (GLuint) program->Parameters->ParameterValues[index][0];
- texUnit = ((GLuint *) values)[0];
+ /* XXX arrays of samplers haven't been tested much, but it's not a
+ * common thing...
+ */
+ for (i = 0; i < count; i++) {
+ sampler = (GLuint) program->Parameters->ParameterValues[index + i][0];
+ texUnit = ((GLuint *) values)[i];
+
+ /* check that the sampler (tex unit index) is legal */
+ if (texUnit >= ctx->Const.MaxTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glUniform1(invalid sampler/tex unit index)");
+ return;
+ }
- /* check that the sampler (tex unit index) is legal */
- if (texUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glUniform1(invalid sampler/tex unit index)");
- return;
+ /* This maps a sampler to a texture unit: */
+ if (sampler < MAX_SAMPLERS) {
+ program->SamplerUnits[sampler] = texUnit;
+ }
}
- /* This maps a sampler to a texture unit: */
- program->SamplerUnits[sampler] = texUnit;
_mesa_update_shader_textures_used(program);
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -1570,19 +1640,31 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
else {
/* ordinary uniform variable */
GLsizei k, i;
- GLint slots = (param->Size + 3) / 4;
+ const GLint slots = (param->Size + 3) / 4;
+ const GLint typeSize = sizeof_glsl_type(param->DataType);
- if (count * elems > (GLint) param->Size) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)");
- return;
+ if (param->Size > typeSize) {
+ /* an array */
+ /* we'll ignore extra data below */
+ }
+ else {
+ /* non-array: count must be one */
+ if (count != 1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniform(uniform is not an array)");
+ return;
+ }
}
-
- if (count > slots)
- count = slots;
for (k = 0; k < count; k++) {
- GLfloat *uniformVal =
- program->Parameters->ParameterValues[index + offset + k];
+ GLfloat *uniformVal;
+
+ if (offset + k > slots) {
+ /* Extra array data is ignored */
+ break;
+ }
+
+ uniformVal = program->Parameters->ParameterValues[index + offset + k];
if (is_integer_type(type)) {
const GLint *iValues = ((const GLint *) values) + k * elems;
for (i = 0; i < elems; i++) {
@@ -1617,6 +1699,7 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
struct gl_uniform *uniform;
GLint elems, offset;
+ GLenum basicType;
if (!shProg || !shProg->LinkStatus) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
@@ -1626,6 +1709,11 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
if (location == -1)
return; /* The standard specifies this as a no-op */
+ if (location < -1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)");
+ return;
+ }
+
split_location_offset(&location, &offset);
if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
@@ -1640,19 +1728,35 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
switch (type) {
case GL_FLOAT:
+ basicType = GL_FLOAT;
+ elems = 1;
+ break;
case GL_INT:
+ basicType = GL_INT;
elems = 1;
break;
case GL_FLOAT_VEC2:
+ basicType = GL_FLOAT;
+ elems = 2;
+ break;
case GL_INT_VEC2:
+ basicType = GL_INT;
elems = 2;
break;
case GL_FLOAT_VEC3:
+ basicType = GL_FLOAT;
+ elems = 3;
+ break;
case GL_INT_VEC3:
+ basicType = GL_INT;
elems = 3;
break;
case GL_FLOAT_VEC4:
+ basicType = GL_FLOAT;
+ elems = 4;
+ break;
case GL_INT_VEC4:
+ basicType = GL_INT;
elems = 4;
break;
default:
@@ -1664,6 +1768,25 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
uniform = &shProg->Uniforms->Uniforms[location];
+ if (ctx->Shader.Flags & GLSL_UNIFORMS) {
+ GLint i;
+ _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ",
+ shProg->Name, uniform->Name, location);
+ if (basicType == GL_INT) {
+ const GLint *v = (const GLint *) values;
+ for (i = 0; i < count * elems; i++) {
+ _mesa_printf("%d ", v[i]);
+ }
+ }
+ else {
+ const GLfloat *v = (const GLfloat *) values;
+ for (i = 0; i < count * elems; i++) {
+ _mesa_printf("%g ", v[i]);
+ }
+ }
+ _mesa_printf("\n");
+ }
+
/* A uniform var may be used by both a vertex shader and a fragment
* shader. We may need to update one or both shader's uniform here:
*/
@@ -1765,6 +1888,11 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
if (location == -1)
return; /* The standard specifies this as a no-op */
+ if (location < -1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)");
+ return;
+ }
+
split_location_offset(&location, &offset);
if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 11340d26e2..cfdb868d6c 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -3662,7 +3662,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
if (lhs && rhs) {
/* convert lhs swizzle into writemask */
const GLuint swizzle = root_swizzle(lhs->Store);
- GLuint writemask, newSwizzle;
+ GLuint writemask, newSwizzle = 0x0;
if (!swizzle_to_writemask(A, swizzle, &writemask, &newSwizzle)) {
/* Non-simple writemask, need to swizzle right hand side in
* order to put components into the right place.
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 818b90b7a8..ab848579b7 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1450,7 +1450,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
case OP_CALL:
{
GLboolean array_constructor = GL_FALSE;
- GLint array_constructor_size;
+ GLint array_constructor_size = 0;
op->type = SLANG_OPER_CALL;
op->a_id = parse_identifier(C);
@@ -2794,6 +2794,12 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
_mesa_print_program(shader->Program);
#endif
+ shader->CompileStatus = success;
+
+ if (ctx->Shader.Flags & GLSL_LOG) {
+ _mesa_write_shader_to_file(shader);
+ }
+
return success;
}
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index ea446fa5d4..2dd122c9a5 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -2120,6 +2120,10 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n)
/* mark var as used */
_mesa_use_uniform(emitInfo->prog->Parameters, (char *) n->Var->a_name);
}
+ else if (n->Store->File == PROGRAM_INPUT) {
+ assert(n->Store->Index >= 0);
+ emitInfo->prog->InputsRead |= (1 << n->Store->Index);
+ }
if (n->Store->Index < 0) {
/* probably ran out of registers */
diff --git a/src/mesa/shader/slang/slang_emit.h b/src/mesa/shader/slang/slang_emit.h
index 8ff52bf605..ab4c202d67 100644
--- a/src/mesa/shader/slang/slang_emit.h
+++ b/src/mesa/shader/slang/slang_emit.h
@@ -32,10 +32,6 @@
#include "main/mtypes.h"
-extern void
-slang_print_ir(const slang_ir_node *n, int indent);
-
-
extern GLuint
_slang_swizzle_swizzle(GLuint swz1, GLuint swz2);
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index b5862bda82..99f2cbdcc0 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -318,7 +318,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
{
GLint attribMap[MAX_VERTEX_ATTRIBS];
GLuint i, j;
- GLbitfield usedAttributes;
+ GLbitfield usedAttributes; /* generics only, not legacy attributes */
assert(origProg != linkedProg);
assert(origProg->Target == GL_VERTEX_PROGRAM_ARB);
@@ -342,6 +342,15 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
usedAttributes |= (1 << attr);
}
+ /* If gl_Vertex is used, that actually counts against the limit
+ * on generic vertex attributes. This avoids the ambiguity of
+ * whether glVertexAttrib4fv(0, v) sets legacy attribute 0 (vert pos)
+ * or generic attribute[0]. If gl_Vertex is used, we want the former.
+ */
+ if (origProg->InputsRead & VERT_BIT_POS) {
+ usedAttributes |= 0x1;
+ }
+
/* initialize the generic attribute map entries to -1 */
for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
attribMap[i] = -1;
@@ -384,7 +393,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
* Start at 1 since generic attribute 0 always aliases
* glVertex/position.
*/
- for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
+ for (attr = 0; attr < MAX_VERTEX_ATTRIBS; attr++) {
if (((1 << attr) & usedAttributes) == 0)
break;
}
@@ -665,12 +674,12 @@ _slang_link(GLcontext *ctx,
/* notify driver that a new fragment program has been compiled/linked */
ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
&shProg->FragmentProgram->Base);
- if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
- printf("Mesa original fragment program:\n");
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ _mesa_printf("Mesa pre-link fragment program:\n");
_mesa_print_program(&fragProg->Base);
_mesa_print_program_parameters(ctx, &fragProg->Base);
- printf("Mesa post-link fragment program:\n");
+ _mesa_printf("Mesa post-link fragment program:\n");
_mesa_print_program(&shProg->FragmentProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base);
}
@@ -683,20 +692,23 @@ _slang_link(GLcontext *ctx,
/* notify driver that a new vertex program has been compiled/linked */
ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
&shProg->VertexProgram->Base);
- if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
- printf("Mesa original vertex program:\n");
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ _mesa_printf("Mesa pre-link vertex program:\n");
_mesa_print_program(&vertProg->Base);
_mesa_print_program_parameters(ctx, &vertProg->Base);
- printf("Mesa post-link vertex program:\n");
+ _mesa_printf("Mesa post-link vertex program:\n");
_mesa_print_program(&shProg->VertexProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base);
}
}
- if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
- printf("Varying vars:\n");
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ _mesa_printf("Varying vars:\n");
_mesa_print_parameter_list(shProg->Varying);
+ if (shProg->InfoLog) {
+ _mesa_printf("Info Log: %s\n", shProg->InfoLog);
+ }
}
shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram);
diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c
index d5576d7ee2..d7d2b4fbfd 100644
--- a/src/mesa/shader/slang/slang_log.c
+++ b/src/mesa/shader/slang/slang_log.c
@@ -77,10 +77,6 @@ slang_info_log_message(slang_info_log * log, const char *prefix,
slang_string_concat(log->text, msg);
slang_string_concat(log->text, "\n");
- if (MESA_VERBOSE & VERBOSE_GLSL) {
- _mesa_printf("Mesa: GLSL %s", log->text);
- }
-
return 1;
}
diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c
index cd79c8b94a..89aaa3a621 100644
--- a/src/mesa/shader/slang/slang_preprocess.c
+++ b/src/mesa/shader/slang/slang_preprocess.c
@@ -508,8 +508,7 @@ static GLvoid
pp_ext_init(pp_ext *self, const struct gl_extensions *extensions)
{
pp_ext_disable_all (self);
- if (extensions->ARB_draw_buffers)
- self->ARB_draw_buffers = GL_TRUE;
+ self->ARB_draw_buffers = GL_TRUE;
if (extensions->NV_texture_rectangle)
self->ARB_texture_rectangle = GL_TRUE;
}
diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c
index de0c93957b..a4ebacc093 100644
--- a/src/mesa/shader/slang/slang_vartable.c
+++ b/src/mesa/shader/slang/slang_vartable.c
@@ -4,6 +4,7 @@
#include "shader/prog_print.h"
#include "slang_compile.h"
#include "slang_compile_variable.h"
+#include "slang_emit.h"
#include "slang_mem.h"
#include "slang_vartable.h"
#include "slang_ir.h"
@@ -72,9 +73,8 @@ _slang_delete_var_table(slang_var_table *vt)
/**
- * Create new table, put at head, return ptr to it.
- * XXX we should take a maxTemps parameter to indicate how many temporaries
- * are available for the current shader/program target.
+ * Create new table on top of vartable stack.
+ * Used when we enter a {} block.
*/
void
_slang_push_var_table(slang_var_table *vt)
@@ -95,7 +95,8 @@ _slang_push_var_table(slang_var_table *vt)
/**
- * Destroy given table, return ptr to Parent
+ * Pop top entry from variable table.
+ * Used when we leave a {} block.
*/
void
_slang_pop_var_table(slang_var_table *vt)
@@ -125,10 +126,12 @@ _slang_pop_var_table(slang_var_table *vt)
else
comp = 0;
- assert(store->Index >= 0);
- for (j = 0; j < store->Size; j++) {
- assert(t->Temps[store->Index * 4 + j + comp] == VAR);
- t->Temps[store->Index * 4 + j + comp] = FREE;
+ /* store->Index may be -1 if we run out of registers */
+ if (store->Index >= 0) {
+ for (j = 0; j < store->Size; j++) {
+ assert(t->Temps[store->Index * 4 + j + comp] == VAR);
+ t->Temps[store->Index * 4 + j + comp] = FREE;
+ }
}
store->Index = -1;
}
@@ -156,7 +159,7 @@ _slang_pop_var_table(slang_var_table *vt)
/**
- * Add a new variable to the given symbol table.
+ * Add a new variable to the given var/symbol table.
*/
void
_slang_add_variable(slang_var_table *vt, slang_variable *v)
@@ -214,6 +217,7 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp)
for (i = 0; i <= vt->MaxRegisters * 4 - size; i += step) {
GLuint found = 0;
for (j = 0; j < (GLuint) size; j++) {
+ assert(i + j < 4 * MAX_PROGRAM_TEMPS);
if (i + j < vt->MaxRegisters * 4 && t->Temps[i + j] == FREE) {
found++;
}
@@ -225,13 +229,17 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp)
/* found block of size free regs */
if (size > 1)
assert(i % 4 == 0);
- for (j = 0; j < (GLuint) size; j++)
+ for (j = 0; j < (GLuint) size; j++) {
+ assert(i + j < 4 * MAX_PROGRAM_TEMPS);
t->Temps[i + j] = isTemp ? TEMP : VAR;
+ }
assert(i < MAX_PROGRAM_TEMPS * 4);
t->ValSize[i] = size;
return i;
}
}
+
+ /* if we get here, we ran out of registers */
return -1;
}
@@ -259,21 +267,7 @@ _slang_alloc_var(slang_var_table *vt, slang_ir_storage *store)
return GL_FALSE;
store->Index = i / 4;
- if (store->Size == 1) {
- const GLuint comp = i % 4;
- store->Swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp);
- }
- else if (store->Size == 2) {
- store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
- SWIZZLE_NIL, SWIZZLE_NIL);
- }
- else if (store->Size == 3) {
- store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
- SWIZZLE_Z, SWIZZLE_NIL);
- }
- else {
- store->Swizzle = SWIZZLE_NOOP;
- }
+ store->Swizzle = _slang_var_swizzle(store->Size, i % 4);
if (dbg)
printf("Alloc var storage sz %d at %d.%s (level %d) store %p\n",
@@ -301,20 +295,7 @@ _slang_alloc_temp(slang_var_table *vt, slang_ir_storage *store)
assert(store->Index < 0);
store->Index = i / 4;
- if (store->Size == 1) {
- const GLuint comp = i % 4;
- store->Swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp);
- }
- else {
- /* XXX improve swizzled for size=2/3, use for writemask... */
-#if 1
- if (store->Size == 2) {
- store->Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y,
- SWIZZLE_NIL, SWIZZLE_NIL);
- }
-#endif
- store->Swizzle = SWIZZLE_NOOP;
- }
+ store->Swizzle = _slang_var_swizzle(store->Size, i % 4);
if (dbg) printf("Alloc temp sz %d at %d.%s (level %d) store %p\n",
store->Size, store->Index,
diff --git a/src/mesa/sources b/src/mesa/sources
deleted file mode 100644
index 643c625b5b..0000000000
--- a/src/mesa/sources
+++ /dev/null
@@ -1,303 +0,0 @@
-### Lists of source files, included by Makefiles
-
-MAIN_SOURCES = \
- main/api_arrayelt.c \
- main/api_exec.c \
- main/api_loopback.c \
- main/api_noop.c \
- main/api_validate.c \
- main/accum.c \
- main/attrib.c \
- main/arrayobj.c \
- main/blend.c \
- main/bufferobj.c \
- main/buffers.c \
- main/clear.c \
- main/clip.c \
- main/colortab.c \
- main/context.c \
- main/convolve.c \
- main/debug.c \
- main/depth.c \
- main/depthstencil.c \
- main/dlist.c \
- main/dlopen.c \
- main/drawpix.c \
- main/enable.c \
- main/enums.c \
- main/eval.c \
- main/execmem.c \
- main/extensions.c \
- main/fbobject.c \
- main/feedback.c \
- main/ffvertex_prog.c \
- main/fog.c \
- main/framebuffer.c \
- main/get.c \
- main/getstring.c \
- main/hash.c \
- main/hint.c \
- main/histogram.c \
- main/image.c \
- main/imports.c \
- main/light.c \
- main/lines.c \
- main/matrix.c \
- main/mipmap.c \
- main/mm.c \
- main/multisample.c \
- main/pixel.c \
- main/pixelstore.c \
- main/points.c \
- main/polygon.c \
- main/queryobj.c \
- main/rastpos.c \
- main/rbadaptors.c \
- main/readpix.c \
- main/renderbuffer.c \
- main/scissor.c \
- main/shaders.c \
- main/state.c \
- main/stencil.c \
- main/texcompress.c \
- main/texcompress_s3tc.c \
- main/texcompress_fxt1.c \
- main/texenv.c \
- main/texenvprogram.c \
- main/texformat.c \
- main/texgen.c \
- main/teximage.c \
- main/texobj.c \
- main/texparam.c \
- main/texrender.c \
- main/texstate.c \
- main/texstore.c \
- main/varray.c \
- main/vtxfmt.c
-
-GLAPI_SOURCES = \
- main/dispatch.c \
- glapi/glapi.c \
- glapi/glapi_getproc.c \
- glapi/glthread.c
-
-MATH_SOURCES = \
- math/m_debug_clip.c \
- math/m_debug_norm.c \
- math/m_debug_xform.c \
- math/m_eval.c \
- math/m_matrix.c \
- math/m_translate.c \
- math/m_vector.c \
- math/m_xform.c
-
-SWRAST_SOURCES = \
- swrast/s_aaline.c \
- swrast/s_aatriangle.c \
- swrast/s_accum.c \
- swrast/s_alpha.c \
- swrast/s_atifragshader.c \
- swrast/s_bitmap.c \
- swrast/s_blend.c \
- swrast/s_blit.c \
- swrast/s_buffers.c \
- swrast/s_copypix.c \
- swrast/s_context.c \
- swrast/s_depth.c \
- swrast/s_drawpix.c \
- swrast/s_feedback.c \
- swrast/s_fog.c \
- swrast/s_fragprog.c \
- swrast/s_imaging.c \
- swrast/s_lines.c \
- swrast/s_logic.c \
- swrast/s_masking.c \
- swrast/s_points.c \
- swrast/s_readpix.c \
- swrast/s_span.c \
- swrast/s_stencil.c \
- swrast/s_texcombine.c \
- swrast/s_texfilter.c \
- swrast/s_texstore.c \
- swrast/s_triangle.c \
- swrast/s_zoom.c
-
-SWRAST_SETUP_SOURCES = \
- swrast_setup/ss_context.c \
- swrast_setup/ss_triangle.c
-
-TNL_SOURCES = \
- tnl/t_context.c \
- tnl/t_pipeline.c \
- tnl/t_draw.c \
- tnl/t_rasterpos.c \
- tnl/t_vb_program.c \
- tnl/t_vb_render.c \
- tnl/t_vb_texgen.c \
- tnl/t_vb_texmat.c \
- tnl/t_vb_vertex.c \
- tnl/t_vb_cull.c \
- tnl/t_vb_fog.c \
- tnl/t_vb_light.c \
- tnl/t_vb_normals.c \
- tnl/t_vb_points.c \
- tnl/t_vp_build.c \
- tnl/t_vertex.c \
- tnl/t_vertex_sse.c \
- tnl/t_vertex_generic.c
-
-VBO_SOURCES = \
- vbo/vbo_context.c \
- vbo/vbo_exec.c \
- vbo/vbo_exec_api.c \
- vbo/vbo_exec_array.c \
- vbo/vbo_exec_draw.c \
- vbo/vbo_exec_eval.c \
- vbo/vbo_rebase.c \
- vbo/vbo_split.c \
- vbo/vbo_split_copy.c \
- vbo/vbo_split_inplace.c \
- vbo/vbo_save.c \
- vbo/vbo_save_api.c \
- vbo/vbo_save_draw.c \
- vbo/vbo_save_loopback.c
-
-
-SHADER_SOURCES = \
- shader/arbprogparse.c \
- shader/arbprogram.c \
- shader/atifragshader.c \
- shader/grammar/grammar_mesa.c \
- shader/nvfragparse.c \
- shader/nvprogram.c \
- shader/nvvertparse.c \
- shader/program.c \
- shader/prog_cache.c \
- shader/prog_debug.c \
- shader/prog_execute.c \
- shader/prog_instruction.c \
- shader/prog_noise.c \
- shader/prog_parameter.c \
- shader/prog_print.c \
- shader/prog_statevars.c \
- shader/prog_uniform.c \
- shader/programopt.c \
- shader/shader_api.c \
-
-SLANG_SOURCES = \
- shader/slang/slang_builtin.c \
- shader/slang/slang_codegen.c \
- shader/slang/slang_compile.c \
- shader/slang/slang_compile_function.c \
- shader/slang/slang_compile_operation.c \
- shader/slang/slang_compile_struct.c \
- shader/slang/slang_compile_variable.c \
- shader/slang/slang_emit.c \
- shader/slang/slang_ir.c \
- shader/slang/slang_label.c \
- shader/slang/slang_link.c \
- shader/slang/slang_log.c \
- shader/slang/slang_mem.c \
- shader/slang/slang_preprocess.c \
- shader/slang/slang_print.c \
- shader/slang/slang_simplify.c \
- shader/slang/slang_storage.c \
- shader/slang/slang_typeinfo.c \
- shader/slang/slang_vartable.c \
- shader/slang/slang_utility.c
-
-ASM_C_SOURCES = \
- x86/common_x86.c \
- x86/x86.c \
- x86/3dnow.c \
- x86/sse.c \
- x86/rtasm/x86sse.c \
- sparc/sparc.c \
- ppc/common_ppc.c \
- x86-64/x86-64.c
-
-X86_SOURCES = \
- x86/common_x86_asm.S \
- x86/x86_xform2.S \
- x86/x86_xform3.S \
- x86/x86_xform4.S \
- x86/x86_cliptest.S \
- x86/mmx_blend.S \
- x86/3dnow_xform1.S \
- x86/3dnow_xform2.S \
- x86/3dnow_xform3.S \
- x86/3dnow_xform4.S \
- x86/3dnow_normal.S \
- x86/sse_xform1.S \
- x86/sse_xform2.S \
- x86/sse_xform3.S \
- x86/sse_xform4.S \
- x86/sse_normal.S \
- x86/read_rgba_span_x86.S
-
-X86_API = \
- x86/glapi_x86.S
-
-X86-64_SOURCES = \
- x86-64/xform4.S
-
-X86-64_API = \
- x86-64/glapi_x86-64.S
-
-SPARC_SOURCES = \
- sparc/clip.S \
- sparc/norm.S \
- sparc/xform.S
-
-SPARC_API = \
- sparc/glapi_sparc.S
-
-COMMON_DRIVER_SOURCES = \
- drivers/common/driverfuncs.c
-
-
-
-### All the core C sources
-
-MESA_SOURCES = \
- $(MAIN_SOURCES) \
- $(MATH_SOURCES) \
- $(VBO_SOURCES) \
- $(TNL_SOURCES) \
- $(SHADER_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
- $(COMMON_DRIVER_SOURCES) \
- $(ASM_C_SOURCES) \
- $(SLANG_SOURCES)
-
-ALL_SOURCES = \
- $(MESA_SOURCES) \
- $(GLAPI_SOURCES) \
- $(MESA_ASM_SOURCES) \
- $(COMMON_DRIVER_SOURCES)
-
-
-### Object files
-
-MESA_OBJECTS = \
- $(MESA_SOURCES:.c=.o) \
- $(MESA_ASM_SOURCES:.S=.o)
-
-GLAPI_OBJECTS = \
- $(GLAPI_SOURCES:.c=.o) \
- $(GLAPI_ASM_SOURCES:.S=.o)
-
-
-COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
-
-
-
-### Include directories
-### XXX we should be able to trim this down to just -Iinclude/ and -Isrc/mesa/
-### since most #includes have been changed from #include "mtypes.h" to
-### #include "main/mtypes.h", etc.
-
-INCLUDE_DIRS = \
- -I$(TOP)/include \
- -I$(TOP)/src/mesa
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 8940670d5b..1bd81506e0 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -88,10 +88,13 @@ MATH_SOURCES = \
math/m_eval.c \
math/m_matrix.c \
math/m_translate.c \
- math/m_vector.c \
+ math/m_vector.c
+
+MATH_XFORM_SOURCES = \
+ $(MATH_SOURCES) \
math/m_xform.c
-__SWRAST_SOURCES = \
+SWRAST_SOURCES = \
swrast/s_aaline.c \
swrast/s_aatriangle.c \
swrast/s_accum.c \
@@ -122,11 +125,11 @@ __SWRAST_SOURCES = \
swrast/s_triangle.c \
swrast/s_zoom.c
-__SWRAST_SETUP_SOURCES = \
+SWRAST_SETUP_SOURCES = \
swrast_setup/ss_context.c \
swrast_setup/ss_triangle.c
-__TNL_SOURCES = \
+TNL_SOURCES = \
tnl/t_context.c \
tnl/t_pipeline.c \
tnl/t_draw.c \
@@ -162,7 +165,7 @@ VBO_SOURCES = \
vbo/vbo_save_draw.c \
vbo/vbo_save_loopback.c
-__VF_SOURCES = \
+VF_SOURCES = \
vf/vf.c \
vf/vf_generic.c \
vf/vf_sse.c
@@ -259,6 +262,7 @@ ASM_C_SOURCES = \
x86/x86.c \
x86/3dnow.c \
x86/sse.c \
+ x86/rtasm/x86sse.c \
sparc/sparc.c \
ppc/common_ppc.c \
x86-64/x86-64.c
@@ -299,7 +303,7 @@ SPARC_SOURCES = \
SPARC_API = \
sparc/glapi_sparc.S
-__COMMON_DRIVER_SOURCES = \
+COMMON_DRIVER_SOURCES = \
drivers/common/driverfuncs.c
@@ -308,21 +312,28 @@ __COMMON_DRIVER_SOURCES = \
MESA_SOURCES = \
$(MAIN_SOURCES) \
- $(MATH_SOURCES) \
+ $(MATH_XFORM_SOURCES) \
$(VBO_SOURCES) \
- $(STATETRACKER_SOURCES) \
$(TNL_SOURCES) \
$(SHADER_SOURCES) \
$(SWRAST_SOURCES) \
$(SWRAST_SETUP_SOURCES) \
+ $(COMMON_DRIVER_SOURCES)\
$(ASM_C_SOURCES) \
$(SLANG_SOURCES)
ALL_SOURCES = \
$(MESA_SOURCES) \
$(GLAPI_SOURCES) \
- $(MESA_ASM_SOURCES) \
- $(COMMON_DRIVER_SOURCES)
+ $(MESA_ASM_SOURCES)
+
+MESA_GALLIUM_SOURCES = \
+ $(MAIN_SOURCES) \
+ $(MATH_SOURCES) \
+ $(VBO_SOURCES) \
+ $(STATETRACKER_SOURCES) \
+ $(SHADER_SOURCES) \
+ $(SLANG_SOURCES)
### Object files
@@ -331,6 +342,10 @@ MESA_OBJECTS = \
$(MESA_SOURCES:.c=.o) \
$(MESA_ASM_SOURCES:.S=.o)
+MESA_GALLIUM_OBJECTS = \
+ $(MESA_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_ASM_SOURCES:.S=.o)
+
GLAPI_OBJECTS = \
$(GLAPI_SOURCES:.c=.o) \
$(GLAPI_ASM_SOURCES:.S=.o)
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index 3d1d55fd76..7d215939b4 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -626,8 +626,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glGetActiveAttribARB ; .type glGetActiveAttribARB,#function
.globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function
.globl glDrawBuffersARB ; .type glDrawBuffersARB,#function
+ .globl glRenderbufferStorageMultisample ; .type glRenderbufferStorageMultisample,#function
.globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function
- .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function
.globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function
.globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function
.globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function
@@ -635,6 +635,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function
.globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function
.globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function
+ .globl gl_dispatch_stub_570 ; .type gl_dispatch_stub_570,#function
.globl glColorPointerEXT ; .type glColorPointerEXT,#function
.globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function
.globl glIndexPointerEXT ; .type glIndexPointerEXT,#function
@@ -645,8 +646,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function
.globl glLockArraysEXT ; .type glLockArraysEXT,#function
.globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function
- .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function
.globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function
+ .globl gl_dispatch_stub_582 ; .type gl_dispatch_stub_582,#function
.globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function
.globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function
.globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function
@@ -671,7 +672,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function
.globl glFogCoordfEXT ; .type glFogCoordfEXT,#function
.globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function
- .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function
+ .globl gl_dispatch_stub_607 ; .type gl_dispatch_stub_607,#function
.globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function
.globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function
.globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function
@@ -713,7 +714,6 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function
.globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function
.globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function
- .globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function
.globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function
.globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function
.globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function
@@ -722,6 +722,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function
.globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function
.globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function
+ .globl gl_dispatch_stub_657 ; .type gl_dispatch_stub_657,#function
.globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function
.globl glBindProgramNV ; .type glBindProgramNV,#function
.globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function
@@ -798,19 +799,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function
.globl glPointParameteriNV ; .type glPointParameteriNV,#function
.globl glPointParameterivNV ; .type glPointParameterivNV,#function
- .globl gl_dispatch_stub_733 ; .type gl_dispatch_stub_733,#function
.globl gl_dispatch_stub_734 ; .type gl_dispatch_stub_734,#function
.globl gl_dispatch_stub_735 ; .type gl_dispatch_stub_735,#function
.globl gl_dispatch_stub_736 ; .type gl_dispatch_stub_736,#function
.globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function
+ .globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function
.globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function
.globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function
.globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function
.globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function
.globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function
.globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function
- .globl gl_dispatch_stub_744 ; .type gl_dispatch_stub_744,#function
.globl gl_dispatch_stub_745 ; .type gl_dispatch_stub_745,#function
+ .globl gl_dispatch_stub_746 ; .type gl_dispatch_stub_746,#function
.globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function
.globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function
.globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function
@@ -828,13 +829,13 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function
.globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function
.globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function
- .globl gl_dispatch_stub_763 ; .type gl_dispatch_stub_763,#function
+ .globl gl_dispatch_stub_764 ; .type gl_dispatch_stub_764,#function
.globl glFramebufferTextureLayerEXT ; .type glFramebufferTextureLayerEXT,#function
- .globl gl_dispatch_stub_765 ; .type gl_dispatch_stub_765,#function
.globl gl_dispatch_stub_766 ; .type gl_dispatch_stub_766,#function
.globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function
.globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function
.globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function
+ .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function
.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
_mesa_sparc_glapi_begin:
@@ -1399,8 +1400,8 @@ _mesa_sparc_glapi_begin:
GL_STUB(glGetActiveAttribARB, _gloffset_GetActiveAttribARB)
GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB)
GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB)
+ GL_STUB(glRenderbufferStorageMultisample, _gloffset_RenderbufferStorageMultisample)
GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT)
- GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562)
GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563)
GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564)
GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565)
@@ -1408,6 +1409,7 @@ _mesa_sparc_glapi_begin:
GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567)
GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568)
GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569)
+ GL_STUB(gl_dispatch_stub_570, _gloffset__dispatch_stub_570)
GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT)
GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT)
GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT)
@@ -1418,8 +1420,8 @@ _mesa_sparc_glapi_begin:
GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT)
GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT)
GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT)
- GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580)
GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581)
+ GL_STUB(gl_dispatch_stub_582, _gloffset__dispatch_stub_582)
GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT)
GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT)
GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT)
@@ -1444,7 +1446,7 @@ _mesa_sparc_glapi_begin:
GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT)
GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT)
GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT)
- GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606)
+ GL_STUB(gl_dispatch_stub_607, _gloffset__dispatch_stub_607)
GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT)
GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV)
GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV)
@@ -1486,7 +1488,6 @@ _mesa_sparc_glapi_begin:
GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA)
GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA)
GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA)
- GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648)
GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649)
GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650)
GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651)
@@ -1495,6 +1496,7 @@ _mesa_sparc_glapi_begin:
GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654)
GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655)
GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656)
+ GL_STUB(gl_dispatch_stub_657, _gloffset__dispatch_stub_657)
GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV)
GL_STUB(glBindProgramNV, _gloffset_BindProgramNV)
GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV)
@@ -1571,19 +1573,19 @@ _mesa_sparc_glapi_begin:
GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI)
GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV)
GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV)
- GL_STUB(gl_dispatch_stub_733, _gloffset__dispatch_stub_733)
GL_STUB(gl_dispatch_stub_734, _gloffset__dispatch_stub_734)
GL_STUB(gl_dispatch_stub_735, _gloffset__dispatch_stub_735)
GL_STUB(gl_dispatch_stub_736, _gloffset__dispatch_stub_736)
GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737)
+ GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738)
GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV)
GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV)
GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV)
GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV)
GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV)
GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV)
- GL_STUB(gl_dispatch_stub_744, _gloffset__dispatch_stub_744)
GL_STUB(gl_dispatch_stub_745, _gloffset__dispatch_stub_745)
+ GL_STUB(gl_dispatch_stub_746, _gloffset__dispatch_stub_746)
GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT)
GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT)
GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT)
@@ -1601,13 +1603,13 @@ _mesa_sparc_glapi_begin:
GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT)
GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT)
GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT)
- GL_STUB(gl_dispatch_stub_763, _gloffset__dispatch_stub_763)
+ GL_STUB(gl_dispatch_stub_764, _gloffset__dispatch_stub_764)
GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT)
- GL_STUB(gl_dispatch_stub_765, _gloffset__dispatch_stub_765)
GL_STUB(gl_dispatch_stub_766, _gloffset__dispatch_stub_766)
GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767)
GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768)
GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769)
+ GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770)
.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
_mesa_sparc_glapi_end:
@@ -1866,3 +1868,22 @@ _mesa_sparc_glapi_end:
.globl glPointParameteri ; .type glPointParameteri,#function ; glPointParameteri = glPointParameteriNV
.globl glPointParameteriv ; .type glPointParameteriv,#function ; glPointParameteriv = glPointParameterivNV
.globl glBlendEquationSeparate ; .type glBlendEquationSeparate,#function ; glBlendEquationSeparate = glBlendEquationSeparateEXT
+ .globl glBindFramebuffer ; .type glBindFramebuffer,#function ; glBindFramebuffer = glBindFramebufferEXT
+ .globl glBindRenderbuffer ; .type glBindRenderbuffer,#function ; glBindRenderbuffer = glBindRenderbufferEXT
+ .globl glCheckFramebufferStatus ; .type glCheckFramebufferStatus,#function ; glCheckFramebufferStatus = glCheckFramebufferStatusEXT
+ .globl glDeleteFramebuffers ; .type glDeleteFramebuffers,#function ; glDeleteFramebuffers = glDeleteFramebuffersEXT
+ .globl glDeleteRenderbuffers ; .type glDeleteRenderbuffers,#function ; glDeleteRenderbuffers = glDeleteRenderbuffersEXT
+ .globl glFramebufferRenderbuffer ; .type glFramebufferRenderbuffer,#function ; glFramebufferRenderbuffer = glFramebufferRenderbufferEXT
+ .globl glFramebufferTexture1D ; .type glFramebufferTexture1D,#function ; glFramebufferTexture1D = glFramebufferTexture1DEXT
+ .globl glFramebufferTexture2D ; .type glFramebufferTexture2D,#function ; glFramebufferTexture2D = glFramebufferTexture2DEXT
+ .globl glFramebufferTexture3D ; .type glFramebufferTexture3D,#function ; glFramebufferTexture3D = glFramebufferTexture3DEXT
+ .globl glGenFramebuffers ; .type glGenFramebuffers,#function ; glGenFramebuffers = glGenFramebuffersEXT
+ .globl glGenRenderbuffers ; .type glGenRenderbuffers,#function ; glGenRenderbuffers = glGenRenderbuffersEXT
+ .globl glGenerateMipmap ; .type glGenerateMipmap,#function ; glGenerateMipmap = glGenerateMipmapEXT
+ .globl glGetFramebufferAttachmentParameteriv ; .type glGetFramebufferAttachmentParameteriv,#function ; glGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameterivEXT
+ .globl glGetRenderbufferParameteriv ; .type glGetRenderbufferParameteriv,#function ; glGetRenderbufferParameteriv = glGetRenderbufferParameterivEXT
+ .globl glIsFramebuffer ; .type glIsFramebuffer,#function ; glIsFramebuffer = glIsFramebufferEXT
+ .globl glIsRenderbuffer ; .type glIsRenderbuffer,#function ; glIsRenderbuffer = glIsRenderbufferEXT
+ .globl glRenderbufferStorage ; .type glRenderbufferStorage,#function ; glRenderbufferStorage = glRenderbufferStorageEXT
+ .globl glBlitFramebuffer ; .type glBlitFramebuffer,#function ; glBlitFramebuffer = glBlitFramebufferEXT
+ .globl glFramebufferTextureLayer ; .type glFramebufferTextureLayer,#function ; glFramebufferTextureLayer = glFramebufferTextureLayerEXT
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index fc8587f459..f79092291b 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -69,7 +69,7 @@ void st_init_atoms( struct st_context *st )
{
GLuint i;
- st->atoms = malloc(sizeof(atoms));
+ st->atoms = _mesa_malloc(sizeof(atoms));
st->nr_atoms = sizeof(atoms)/sizeof(*atoms);
memcpy(st->atoms, atoms, sizeof(atoms));
@@ -92,7 +92,7 @@ void st_init_atoms( struct st_context *st )
void st_destroy_atoms( struct st_context *st )
{
if (st->atoms) {
- free(st->atoms);
+ _mesa_free(st->atoms);
st->atoms = NULL;
}
}
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index cbd414e2d3..bed3ff4ae5 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -165,7 +165,7 @@ find_translated_vp(struct st_context *st,
/* No? Allocate translated vp object now */
if (!xvp) {
- xvp = CALLOC_STRUCT(translated_vertex_program);
+ xvp = ST_CALLOC_STRUCT(translated_vertex_program);
xvp->frag_inputs = fragInputsRead;
xvp->master = stvp;
@@ -298,7 +298,7 @@ st_free_translated_vertex_programs(struct st_context *st,
while (xvp) {
next = xvp->next;
- free(xvp);
+ _mesa_free(xvp);
xvp = next;
}
}
@@ -313,7 +313,7 @@ get_passthrough_fs(struct st_context *st)
st->passthrough_fs =
util_make_fragment_passthrough_shader(st->pipe, &shader);
#if 0 /* We actually need to keep the tokens around at this time */
- free((void *) shader.tokens);
+ _mesa_free((void *) shader.tokens);
#endif
}
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index 46ec03234f..33c648856a 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -210,8 +210,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
PIPE_TRANSFER_READ, xpos, ypos,
width, height);
- colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, colorBuf);
acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
@@ -227,10 +227,17 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(colorBuf);
free(accBuf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(colorBuf);
+ _mesa_free(accBuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
@@ -253,7 +260,7 @@ accum_load(struct pipe_context *pipe, GLfloat value,
PIPE_TRANSFER_READ, xpos, ypos,
width, height);
- buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
@@ -263,9 +270,15 @@ accum_load(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, buf);
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(buf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(buf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
@@ -282,7 +295,7 @@ accum_return(GLcontext *ctx, GLfloat value,
GLfloat *abuf, *cbuf = NULL;
GLint i, ch;
- abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
PIPE_TRANSFER_READ, xpos, ypos,
@@ -295,8 +308,13 @@ accum_return(GLcontext *ctx, GLfloat value,
acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, abuf);
if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, cbuf);
+=======
+ cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
for (i = 0; i < width * height; i++) {
@@ -313,11 +331,17 @@ accum_return(GLcontext *ctx, GLfloat value,
pipe_put_tile_rgba(color_trans, 0, 0, width, height, abuf);
- free(abuf);
+ _mesa_free(abuf);
if (cbuf)
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(cbuf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(cbuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 93f1f0baac..77aac8507e 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -798,7 +798,7 @@ st_init_bitmap(struct st_context *st)
}
/* alloc bitmap cache object */
- st->bitmap.cache = CALLOC_STRUCT(bitmap_cache);
+ st->bitmap.cache = ST_CALLOC_STRUCT(bitmap_cache);
reset_cache(st);
}
@@ -827,7 +827,7 @@ st_destroy_bitmap(struct st_context *st)
if (st->bitmap.cache) {
pipe_texture_release(&st->bitmap.cache->texture);
- FREE(st->bitmap.cache);
+ _mesa_free(st->bitmap.cache);
st->bitmap.cache = NULL;
}
}
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 07fa2afce0..aba1cda932 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -55,7 +55,7 @@
static struct gl_buffer_object *
st_bufferobj_alloc(GLcontext *ctx, GLuint name, GLenum target)
{
- struct st_buffer_object *st_obj = CALLOC_STRUCT(st_buffer_object);
+ struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
if (!st_obj)
return NULL;
@@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj)
if (st_obj->buffer)
pipe_buffer_reference(pipe->screen, &st_obj->buffer, NULL);
- free(st_obj);
+ _mesa_free(st_obj);
}
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 668c3f9ebf..0eddda23a7 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -98,12 +98,12 @@ st_destroy_clear(struct st_context *st)
struct pipe_context *pipe = st->pipe;
if (st->clear.vert_shader.tokens) {
- FREE((void *) st->clear.vert_shader.tokens);
+ _mesa_free((void *) st->clear.vert_shader.tokens);
st->clear.vert_shader.tokens = NULL;
}
if (st->clear.frag_shader.tokens) {
- FREE((void *) st->clear.frag_shader.tokens);
+ _mesa_free((void *) st->clear.frag_shader.tokens);
st->clear.frag_shader.tokens = NULL;
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 9a84f04af1..13307fc2c1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -895,7 +895,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
ubyte *buffer;
int i;
- buffer = malloc(width * height * sizeof(ubyte));
+ buffer = _mesa_malloc(width * height * sizeof(ubyte));
if (!buffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)");
return;
@@ -950,7 +950,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
}
- free(buffer);
+ _mesa_free(buffer);
/* unmap the stencil buffer */
screen->transfer_unmap(screen, ptDraw);
@@ -1058,19 +1058,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf);
pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
else {
/* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint));
pipe_get_tile_z(ptRead, 0, 0, width, height, buf);
pipe_put_tile_z(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
screen->tex_transfer_release(screen, &ptRead);
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 7787cc93f3..5cc6960c06 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -118,7 +118,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
template.height[0] = height;
template.depth[0] = 1;
template.last_level = 0;
- template.nr_samples = rb->Samples;
+ template.nr_samples = rb->NumSamples;
if (pf_is_depth_stencil(template.format)) {
template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
@@ -190,7 +190,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb)
ASSERT(strb);
pipe_surface_reference(&strb->surface, NULL);
pipe_texture_reference(&strb->texture, NULL);
- free(strb);
+ _mesa_free(strb);
}
@@ -228,7 +228,7 @@ st_new_framebuffer(GLcontext *ctx, GLuint name)
static struct gl_renderbuffer *
st_new_renderbuffer(GLcontext *ctx, GLuint name)
{
- struct st_renderbuffer *strb = CALLOC_STRUCT(st_renderbuffer);
+ struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
if (strb) {
_mesa_init_renderbuffer(&strb->Base, name);
strb->Base.Delete = st_renderbuffer_delete;
@@ -250,7 +250,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples)
{
struct st_renderbuffer *strb;
- strb = CALLOC_STRUCT(st_renderbuffer);
+ strb = ST_CALLOC_STRUCT(st_renderbuffer);
if (!strb) {
_mesa_error(NULL, GL_OUT_OF_MEMORY, "creating renderbuffer");
return NULL;
@@ -258,7 +258,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples)
_mesa_init_renderbuffer(&strb->Base, 0);
strb->Base.ClassID = 0x4242; /* just a unique value */
- strb->Base.Samples = samples;
+ strb->Base.NumSamples = samples;
strb->format = format;
switch (format) {
diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c
index c7e8aa7cc5..86d3542262 100644
--- a/src/mesa/state_tracker/st_cb_feedback.c
+++ b/src/mesa/state_tracker/st_cb_feedback.c
@@ -184,7 +184,7 @@ feedback_destroy( struct draw_stage *stage )
static struct draw_stage *
draw_glfeedback_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage);
+ struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage);
fs->stage.draw = draw;
fs->stage.next = NULL;
@@ -257,7 +257,7 @@ select_destroy( struct draw_stage *stage )
static struct draw_stage *
draw_glselect_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage);
+ struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage);
fs->stage.draw = draw;
fs->stage.next = NULL;
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index ea0fa20012..4398ab2839 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -99,7 +99,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: {
- struct st_vertex_program *prog = CALLOC_STRUCT(st_vertex_program);
+ struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program);
prog->serialNo = SerialNo++;
@@ -111,7 +111,7 @@ static struct gl_program *st_new_program( GLcontext *ctx,
case GL_FRAGMENT_PROGRAM_ARB:
case GL_FRAGMENT_PROGRAM_NV: {
- struct st_fragment_program *prog = CALLOC_STRUCT(st_fragment_program);
+ struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program);
prog->serialNo = SerialNo++;
@@ -152,7 +152,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
}
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
}
@@ -167,7 +167,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
}
if (stfp->state.tokens) {
- FREE((void *) stfp->state.tokens);
+ _mesa_free((void *) stfp->state.tokens);
stfp->state.tokens = NULL;
}
@@ -214,7 +214,7 @@ static void st_program_string_notify( GLcontext *ctx,
}
if (stfp->state.tokens) {
- FREE((void *) stfp->state.tokens);
+ _mesa_free((void *) stfp->state.tokens);
stfp->state.tokens = NULL;
}
@@ -242,7 +242,7 @@ static void st_program_string_notify( GLcontext *ctx,
}
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index 21c2c7dd9f..dcf4c38eb6 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -64,7 +64,7 @@ st_query_object(struct gl_query_object *q)
static struct gl_query_object *
st_NewQueryObject(GLcontext *ctx, GLuint id)
{
- struct st_query_object *stq = CALLOC_STRUCT(st_query_object);
+ struct st_query_object *stq = ST_CALLOC_STRUCT(st_query_object);
if (stq) {
stq->base.Id = id;
stq->base.Ready = GL_TRUE;
@@ -87,7 +87,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q)
stq->pq = NULL;
}
- FREE(stq);
+ _mesa_free(stq);
}
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 8867ca5652..7dd2352739 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -102,7 +102,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim )
static void
rastpos_destroy(struct draw_stage *stage)
{
- free(stage);
+ _mesa_free(stage);
}
@@ -180,7 +180,7 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim)
static struct rastpos_stage *
new_draw_rastpos_stage(GLcontext *ctx, struct draw_context *draw)
{
- struct rastpos_stage *rs = CALLOC_STRUCT(rastpos_stage);
+ struct rastpos_stage *rs = ST_CALLOC_STRUCT(rastpos_stage);
GLuint i;
rs->stage.draw = draw;
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 3b77184faa..0ece8f9514 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -114,7 +114,7 @@ st_NewTextureImage(GLcontext * ctx)
{
DBG("%s\n", __FUNCTION__);
(void) ctx;
- return (struct gl_texture_image *) CALLOC_STRUCT(st_texture_image);
+ return (struct gl_texture_image *) ST_CALLOC_STRUCT(st_texture_image);
}
@@ -122,7 +122,7 @@ st_NewTextureImage(GLcontext * ctx)
static struct gl_texture_object *
st_NewTextureObject(GLcontext * ctx, GLuint name, GLenum target)
{
- struct st_texture_object *obj = CALLOC_STRUCT(st_texture_object);
+ struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object);
DBG("%s\n", __FUNCTION__);
_mesa_initialize_texture_object(&obj->base, name, target);
@@ -1410,9 +1410,7 @@ st_finalize_texture(GLcontext *ctx,
stObj->pt->width[0] != firstImage->base.Width2 ||
stObj->pt->height[0] != firstImage->base.Height2 ||
stObj->pt->depth[0] != firstImage->base.Depth2 ||
- stObj->pt->block.size != cpp ||
- stObj->pt->block.width != 1 ||
- stObj->pt->block.height != 1 ||
+ stObj->pt->block.size/stObj->pt->block.width != cpp || /* Nominal bytes per pixel */
stObj->pt->compressed != firstImage->base.IsCompressed) {
pipe_texture_release(&stObj->pt);
ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index e584a6ceea..6d6c9f4332 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -105,7 +105,7 @@ static struct st_context *
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
{
uint i;
- struct st_context *st = CALLOC_STRUCT( st_context );
+ struct st_context *st = ST_CALLOC_STRUCT( st_context );
ctx->st = st;
@@ -217,7 +217,7 @@ static void st_destroy_context_priv( struct st_context *st )
st->default_texture = NULL;
}
- free( st );
+ _mesa_free( st );
}
@@ -245,7 +245,7 @@ void st_destroy_context( struct st_context *st )
pipe->destroy( pipe );
- free(ctx);
+ _mesa_free(ctx);
}
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 695ac4a96f..3547925ad7 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -242,6 +242,10 @@ st_fb_orientation(const struct gl_framebuffer *fb)
}
+/** clear-alloc a struct-sized object, with casting */
+#define ST_CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
+
+
extern int
st_get_msaa(void);
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 630ad2bcdf..b52e488612 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -223,7 +223,7 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count,
if (!stobj)
return NULL;
- vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32);
+ vec = (unsigned *) _mesa_calloc(sizeof(unsigned) * ((count + 31) / 32));
if (!vec)
return NULL;
@@ -379,7 +379,7 @@ setup_interleaved_attribs(GLcontext *ctx,
else {
vbuffer->buffer = NULL;
pipe_buffer_reference(pipe->screen, &vbuffer->buffer, stobj->buffer);
- vbuffer->buffer_offset = (unsigned) arrays[mesaAttr]->Ptr;
+ vbuffer->buffer_offset = (unsigned) low;
}
vbuffer->stride = stride; /* in bytes */
vbuffer->max_index = max_index;
@@ -541,9 +541,11 @@ st_draw_vbo(GLcontext *ctx,
vp = ctx->st->vp;
vs = &ctx->st->vp->state;
+#if 0
if (MESA_VERBOSE & VERBOSE_GLSL) {
check_uniforms(ctx);
}
+#endif
/*
* Setup the vbuffer[] and velements[] arrays.
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 0d9c7b97e3..0d4474a8b3 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -49,7 +49,7 @@ st_create_framebuffer( const __GLcontextModes *visual,
uint width, uint height,
void *private)
{
- struct st_framebuffer *stfb = CALLOC_STRUCT(st_framebuffer);
+ struct st_framebuffer *stfb = ST_CALLOC_STRUCT(st_framebuffer);
if (stfb) {
int samples = st_get_msaa();
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 5b5707fa1c..8b9b18f94d 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -188,7 +188,7 @@ make_immediate(const float *value, uint size)
struct tgsi_full_immediate imm;
imm = tgsi_default_full_immediate();
- imm.Immediate.Size += size;
+ imm.Immediate.NrTokens += size;
imm.Immediate.DataType = TGSI_IMM_FLOAT32;
imm.u.Pointer = value;
return imm;
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 442eeed147..d2535b6a2f 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -61,9 +61,9 @@
static INLINE void *
mem_dup(const void *src, uint size)
{
- void *dup = MALLOC(size);
+ void *dup = _mesa_malloc(size);
if (dup)
- memcpy(dup, src, size);
+ _mesa_memcpy(dup, src, size);
return dup;
}
@@ -307,7 +307,7 @@ st_translate_vertex_program(struct st_context *st,
/* free old shader state, if any */
if (stvp->state.tokens) {
- FREE((void *) stvp->state.tokens);
+ _mesa_free((void *) stvp->state.tokens);
stvp->state.tokens = NULL;
}
if (stvp->driver_shader) {
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index ff741777e7..c6c7dbf5cf 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -550,7 +550,7 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint xpos, ypos, width, height;
- if (SWRAST_CONTEXT(ctx)->NewState)
+ if (swrast->NewState)
_swrast_validate_derived( ctx );
if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
@@ -558,9 +558,9 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
return;
}
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
- /* Compute region after calling RENDER_START so that we know the
+ /* Compute region after calling swrast_render_start() so that we know the
* drawbuffer's size/bounds are up to date.
*/
xpos = ctx->DrawBuffer->_Xmin;
@@ -595,5 +595,5 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
break;
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
}
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index 35b34e654f..5e7822cf32 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -50,7 +50,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint row, col;
GLuint count = 0;
SWspan span;
@@ -61,7 +60,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
if (!bitmap)
return;
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
@@ -132,7 +131,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
}
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
_mesa_unmap_bitmap_pbo(ctx, unpack);
}
@@ -157,7 +156,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
ASSERT(ctx->RenderMode == GL_RENDER);
ASSERT(bitmap);
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
@@ -224,6 +223,6 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
}
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
}
#endif
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index bc4b2ac625..0e32cb8f65 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -737,7 +737,6 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
static const GLint buffers[3] = {
GL_COLOR_BUFFER_BIT,
GL_DEPTH_BUFFER_BIT,
@@ -753,7 +752,7 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
return;
}
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
if (srcX1 - srcX0 == dstX1 - dstX0 &&
srcY1 - srcY0 == dstY1 - dstY0 &&
@@ -789,5 +788,5 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
}
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
}
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 9e87d6d485..af475ad8cb 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -307,8 +307,6 @@ clear_color_buffers(GLcontext *ctx)
void
_swrast_Clear(GLcontext *ctx, GLbitfield buffers)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
#ifdef DEBUG_FOO
{
const GLbitfield legalBits =
@@ -327,7 +325,7 @@ _swrast_Clear(GLcontext *ctx, GLbitfield buffers)
}
#endif
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
/* do software clearing here */
if (buffers) {
@@ -347,5 +345,5 @@ _swrast_Clear(GLcontext *ctx, GLbitfield buffers)
}
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
}
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index a511d1c9a1..cdd6fa5048 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -238,21 +238,43 @@ extern void
_swrast_update_texture_samplers(GLcontext *ctx);
-#define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context)
-
-#define RENDER_START(SWctx, GLctx) \
- do { \
- if ((SWctx)->Driver.SpanRenderStart) { \
- (*(SWctx)->Driver.SpanRenderStart)(GLctx); \
- } \
- } while (0)
-
-#define RENDER_FINISH(SWctx, GLctx) \
- do { \
- if ((SWctx)->Driver.SpanRenderFinish) { \
- (*(SWctx)->Driver.SpanRenderFinish)(GLctx); \
- } \
- } while (0)
+/** Return SWcontext for the given GLcontext */
+static INLINE SWcontext *
+SWRAST_CONTEXT(GLcontext *ctx)
+{
+ return (SWcontext *) ctx->swrast_context;
+}
+
+/** const version of above */
+static INLINE const SWcontext *
+CONST_SWRAST_CONTEXT(const GLcontext *ctx)
+{
+ return (const SWcontext *) ctx->swrast_context;
+}
+
+
+/**
+ * Called prior to framebuffer reading/writing.
+ * For drivers that rely on swrast for fallback rendering, this is the
+ * driver's opportunity to map renderbuffers and textures.
+ */
+static INLINE void
+swrast_render_start(GLcontext *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderStart)
+ swrast->Driver.SpanRenderStart(ctx);
+}
+
+
+/** Called after framebuffer reading/writing */
+static INLINE void
+swrast_render_finish(GLcontext *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderFinish)
+ swrast->Driver.SpanRenderFinish(ctx);
+}
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index fc5990b261..5ecfb1e90a 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -899,7 +899,7 @@ _swrast_CopyPixels( GLcontext *ctx,
GLint destx, GLint desty, GLenum type )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
if (swrast->NewState)
_swrast_validate_derived( ctx );
@@ -928,5 +928,5 @@ _swrast_CopyPixels( GLcontext *ctx,
}
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
}
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 7af3e3dad1..700f76d4bc 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -830,7 +830,7 @@ _swrast_DrawPixels( GLcontext *ctx,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
if (ctx->NewState)
_mesa_update_state(ctx);
@@ -840,7 +840,7 @@ _swrast_DrawPixels( GLcontext *ctx,
pixels = _mesa_map_drawpix_pbo(ctx, unpack, pixels);
if (!pixels) {
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
return;
}
@@ -879,9 +879,9 @@ _swrast_DrawPixels( GLcontext *ctx,
/* don't return yet, clean-up */
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
- _mesa_unmap_drapix_pbo(ctx, unpack);
+ _mesa_unmap_drawpix_pbo(ctx, unpack);
}
@@ -904,7 +904,7 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx,
if (swrast->NewState)
_swrast_validate_derived( ctx );
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
switch (colorFormat) {
case GL_COLOR_INDEX:
@@ -933,6 +933,6 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx,
_mesa_problem(ctx, "unexpected format in glDrawDepthPixelsMESA");
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
}
#endif
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index b9ba265db6..77ed0cfef9 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -164,7 +164,7 @@ else { \
void
_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
{
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
GLfloat rFog, gFog, bFog;
ASSERT(swrast->_FogEnabled);
@@ -283,7 +283,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
void
_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span )
{
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
const GLuint fogIndex = (GLuint) ctx->Fog.Index;
GLuint *index = span->array->index;
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 525cf9d724..c6601f5593 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -33,6 +33,35 @@
/**
+ * Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel'
+ * and return results in 'colorOut'.
+ */
+static INLINE void
+swizzle_texel(const GLchan texel[4], GLfloat colorOut[4], GLuint swizzle)
+{
+ if (swizzle == SWIZZLE_NOOP) {
+ colorOut[0] = CHAN_TO_FLOAT(texel[0]);
+ colorOut[1] = CHAN_TO_FLOAT(texel[1]);
+ colorOut[2] = CHAN_TO_FLOAT(texel[2]);
+ colorOut[3] = CHAN_TO_FLOAT(texel[3]);
+ }
+ else {
+ GLfloat vector[6];
+ vector[SWIZZLE_X] = CHAN_TO_FLOAT(texel[0]);
+ vector[SWIZZLE_Y] = CHAN_TO_FLOAT(texel[1]);
+ vector[SWIZZLE_Z] = CHAN_TO_FLOAT(texel[2]);
+ vector[SWIZZLE_W] = CHAN_TO_FLOAT(texel[3]);
+ vector[SWIZZLE_ZERO] = 0.0F;
+ vector[SWIZZLE_ONE] = 1.0F;
+ colorOut[0] = vector[GET_SWZ(swizzle, 0)];
+ colorOut[1] = vector[GET_SWZ(swizzle, 1)];
+ colorOut[2] = vector[GET_SWZ(swizzle, 2)];
+ colorOut[3] = vector[GET_SWZ(swizzle, 3)];
+ }
+}
+
+
+/**
* Fetch a texel with given lod.
* Called via machine->FetchTexelLod()
*/
@@ -40,20 +69,23 @@ static void
fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
GLuint unit, GLfloat color[4] )
{
- GLchan rgba[4];
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
- if (texObj)
+ if (texObj) {
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLchan rgba[4];
+
lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod);
- /* XXX use a float-valued TextureSample routine here!!! */
- swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
- color[0] = CHAN_TO_FLOAT(rgba[0]);
- color[1] = CHAN_TO_FLOAT(rgba[1]);
- color[2] = CHAN_TO_FLOAT(rgba[2]);
- color[3] = CHAN_TO_FLOAT(rgba[3]);
+ /* XXX use a float-valued TextureSample routine here!!! */
+ swrast->TextureSample[unit](ctx, texObj, 1,
+ (const GLfloat (*)[4]) texcoord,
+ &lambda, &rgba);
+ swizzle_texel(rgba, color, texObj->_Swizzle);
+ }
+ else {
+ ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
+ }
}
@@ -69,13 +101,14 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
- GLfloat lambda;
- GLchan rgba[4];
if (texObj) {
- const struct gl_texture_image *texImg = texObj->Image[0][texObj->BaseLevel];
+ const struct gl_texture_image *texImg =
+ texObj->Image[0][texObj->BaseLevel];
const GLfloat texW = (GLfloat) texImg->WidthScale;
const GLfloat texH = (GLfloat) texImg->HeightScale;
+ GLfloat lambda;
+ GLchan rgba[4];
lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
texdx[1], texdy[1], /* dt/dx, dt/dy */
@@ -85,14 +118,16 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
1.0F / texcoord[3]) + lodBias;
lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod);
- }
- swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
- color[0] = CHAN_TO_FLOAT(rgba[0]);
- color[1] = CHAN_TO_FLOAT(rgba[1]);
- color[2] = CHAN_TO_FLOAT(rgba[2]);
- color[3] = CHAN_TO_FLOAT(rgba[3]);
+ /* XXX use a float-valued TextureSample routine here!!! */
+ swrast->TextureSample[unit](ctx, texObj, 1,
+ (const GLfloat (*)[4]) texcoord,
+ &lambda, &rgba);
+ swizzle_texel(rgba, color, texObj->_Swizzle);
+ }
+ else {
+ ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
+ }
}
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index 591857c342..d6be3aa022 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -39,7 +39,6 @@ _swrast_CopyColorTable( GLcontext *ctx,
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
struct gl_buffer_object *bufferSave;
@@ -51,13 +50,13 @@ _swrast_CopyColorTable( GLcontext *ctx,
if (width > MAX_WIDTH)
width = MAX_WIDTH;
- RENDER_START( swrast, ctx );
+ swrast_render_start(ctx);
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
width, x, y, CHAN_TYPE, data );
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
@@ -74,7 +73,6 @@ 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];
struct gl_buffer_object *bufferSave;
@@ -86,13 +84,13 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
if (width > MAX_WIDTH)
width = MAX_WIDTH;
- RENDER_START( swrast, ctx );
+ swrast_render_start(ctx);
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
width, x, y, CHAN_TYPE, data );
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
@@ -110,7 +108,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
GLenum internalFormat,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
struct gl_buffer_object *bufferSave;
@@ -119,13 +116,13 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
return;
}
- RENDER_START( swrast, ctx );
+ swrast_render_start(ctx);
/* read the data from framebuffer */
_swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
width, x, y, CHAN_TYPE, rgba );
- RENDER_FINISH( swrast, ctx );
+ swrast_render_finish(ctx);
/* save PBO binding */
bufferSave = ctx->Unpack.BufferObj;
@@ -145,7 +142,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
GLenum internalFormat,
GLint x, GLint y, GLsizei width, GLsizei height)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_pixelstore_attrib packSave;
GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GLint i;
@@ -156,7 +152,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
return;
}
- RENDER_START(swrast,ctx);
+ swrast_render_start(ctx);
/* read pixels from framebuffer */
for (i = 0; i < height; i++) {
@@ -164,7 +160,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
width, x, y + i, CHAN_TYPE, rgba[i] );
}
- RENDER_FINISH(swrast,ctx);
+ swrast_render_finish(ctx);
/*
* HACK: save & restore context state so we can store this as a
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index f263045170..e901fc6b5d 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -555,11 +555,11 @@ _swrast_ReadPixels( GLcontext *ctx,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_pixelstore_attrib clippedPacking = *packing;
- /* Need to do RENDER_START before clipping or anything else since this
- * is where a driver may grab the hw lock and get an updated window
- * size.
+ /* Need to do swrast_render_start() before clipping or anything else
+ * since this is where a driver may grab the hw lock and get an updated
+ * window size.
*/
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
if (ctx->NewState)
_mesa_update_state(ctx);
@@ -570,7 +570,7 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
/* The ReadPixels region is totally outside the window bounds */
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
return;
}
@@ -614,7 +614,7 @@ _swrast_ReadPixels( GLcontext *ctx,
/* don't return yet, clean-up */
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
_mesa_unmap_readpix_pbo(ctx, &clippedPacking);
}
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 7f9cc64bb2..ab7b82b19d 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1311,6 +1311,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
/* Do the alpha test */
if (ctx->Color.AlphaEnabled) {
if (!_swrast_alpha_test(ctx, span)) {
+ /* all fragments failed test */
goto end;
}
}
@@ -1323,6 +1324,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
if (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0) {
/* Combined Z/stencil tests */
if (!_swrast_stencil_and_ztest_span(ctx, span)) {
+ /* all fragments failed test */
goto end;
}
}
@@ -1331,6 +1333,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
ASSERT(ctx->Depth.Test);
ASSERT(span->arrayMask & SPAN_Z);
if (!_swrast_depth_test_span(ctx, span)) {
+ /* all fragments failed test */
goto end;
}
}
@@ -1350,6 +1353,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
* the occlusion test.
*/
if (colorMask == 0x0) {
+ /* no colors to write */
goto end;
}
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index c925922463..2e84ddec71 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -997,10 +997,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face )
GLboolean
_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span)
{
+ const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace;
+
if (span->arrayMask & SPAN_XY)
- return stencil_and_ztest_pixels(ctx, span, span->facing);
+ return stencil_and_ztest_pixels(ctx, span, face);
else
- return stencil_and_ztest_span(ctx, span, span->facing);
+ return stencil_and_ztest_span(ctx, span, face);
}
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index 632d650007..38b5633887 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -1,8 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.5
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -30,6 +31,7 @@
#include "main/imports.h"
#include "main/macros.h"
#include "main/pixel.h"
+#include "shader/prog_instruction.h"
#include "s_context.h"
#include "s_texcombine.h"
@@ -66,9 +68,9 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
GLchan (*rgba)[4] )
{
const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]);
- const GLchan (*argRGB [3])[4];
- const GLchan (*argA [3])[4];
- const GLuint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB;
+ const GLchan (*argRGB [4])[4];
+ const GLchan (*argA [4])[4];
+ const GLint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB;
const GLuint Ashift = textureUnit->_CurrentCombine->ScaleShiftA;
#if CHAN_TYPE == GL_FLOAT
const GLchan RGBmult = (GLfloat) (1 << RGBshift);
@@ -80,12 +82,12 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
static const GLchan zero[4] = { 0, 0, 0, 0 };
const GLuint numColorArgs = textureUnit->_CurrentCombine->_NumArgsRGB;
const GLuint numAlphaArgs = textureUnit->_CurrentCombine->_NumArgsA;
- GLchan ccolor[3][MAX_WIDTH][4];
+ GLchan ccolor[4][MAX_WIDTH][4];
GLuint i, j;
ASSERT(ctx->Extensions.EXT_texture_env_combine ||
ctx->Extensions.ARB_texture_env_combine);
- ASSERT(SWRAST_CONTEXT(ctx)->_AnyTextureCombine);
+ ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine);
/*
printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n",
@@ -98,7 +100,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
*/
/*
- * Do operand setup for up to 3 operands. Loop over the terms.
+ * Do operand setup for up to 4 operands. Loop over the terms.
*/
for (j = 0; j < numColorArgs; j++) {
const GLenum srcRGB = textureUnit->_CurrentCombine->SourceRGB[j];
@@ -295,7 +297,36 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
}
break;
case GL_ADD:
- {
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) */
+ 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];
+ const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3];
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
+ arg2[i][RCOMP] * arg3[i][RCOMP]) * RGBmult;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
+ arg2[i][GCOMP] * arg3[i][GCOMP]) * RGBmult;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
+ arg2[i][BCOMP] * arg3[i][BCOMP]) * RGBmult;
+#else
+ const GLint shift = CHAN_BITS - RGBshift;
+ GLint r = (PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift) +
+ (PROD(arg2[i][RCOMP], arg3[i][RCOMP]) >> shift);
+ GLint g = (PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift) +
+ (PROD(arg2[i][GCOMP], arg3[i][GCOMP]) >> shift);
+ GLint b = (PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift) +
+ (PROD(arg2[i][BCOMP], arg3[i][BCOMP]) >> 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
+ }
+ }
+ else {
+ /* 2-term addition */
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
for (i = 0; i < n; i++) {
@@ -315,7 +346,37 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
}
break;
case GL_ADD_SIGNED:
- {
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) - 0.5 */
+ 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];
+ const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3];
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] *
+ arg2[i][RCOMP] + arg3[i][RCOMP] - 0.5) * RGBmult;
+ rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] *
+ arg2[i][GCOMP] + arg3[i][GCOMP] - 0.5) * RGBmult;
+ rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] *
+ arg2[i][BCOMP] + arg3[i][BCOMP] - 0.5) * RGBmult;
+#else
+ GLint r = (((PROD(arg0[i][RCOMP], arg1[i][RCOMP]) +
+ PROD(arg2[i][RCOMP], arg3[i][RCOMP])) >> CHAN_BITS) - half)
+ << RGBshift;
+ GLint g = (((PROD(arg0[i][GCOMP], arg1[i][GCOMP]) +
+ PROD(arg2[i][GCOMP], arg3[i][GCOMP])) >> CHAN_BITS) - half)
+ << RGBshift;
+ GLint b = (((PROD(arg0[i][BCOMP], arg1[i][BCOMP]) +
+ PROD(arg2[i][BCOMP], arg3[i][BCOMP])) >> CHAN_BITS) - half)
+ << RGBshift;
+ 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
+ }
+ }
+ else {
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1];
for (i = 0; i < n; i++) {
@@ -324,9 +385,9 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult;
rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult;
#else
- GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] -half;
- GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] -half;
- GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] -half;
+ GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] - half;
+ GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] - half;
+ GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] - half;
r = (r < 0) ? 0 : r << RGBshift;
g = (g < 0) ? 0 : g << RGBshift;
b = (b < 0) ? 0 : b << RGBshift;
@@ -573,9 +634,28 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
}
break;
case GL_ADD:
- {
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) */
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
- const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
+ const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2];
+ const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3];
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
+ arg2[i][ACOMP] * arg3[i][ACOMP]) * Amult;
+#else
+ const GLint shift = CHAN_BITS - Ashift;
+ GLint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift) +
+ (PROD(arg2[i][ACOMP], arg3[i][ACOMP]) >> shift);
+ rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX);
+#endif
+ }
+ }
+ else {
+ /* two-term add */
+ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
+ const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
for (i = 0; i < n; i++) {
#if CHAN_TYPE == GL_FLOAT
rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult;
@@ -587,7 +667,27 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
}
break;
case GL_ADD_SIGNED:
- {
+ if (textureUnit->EnvMode == GL_COMBINE4_NV) {
+ /* (a * b) + (c * d) - 0.5 */
+ 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];
+ const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3];
+ for (i = 0; i < n; i++) {
+#if CHAN_TYPE == GL_FLOAT
+ rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] +
+ arg2[i][ACOMP] * arg3[i][ACOMP] -
+ 0.5) * Amult;
+#else
+ GLint a = (((PROD(arg0[i][ACOMP], arg1[i][ACOMP]) +
+ PROD(arg2[i][ACOMP], arg3[i][ACOMP])) >> CHAN_BITS) - half)
+ << Ashift;
+ rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
+#endif
+ }
+ }
+ else {
+ /* a + b - 0.5 */
const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0];
const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1];
for (i = 0; i < n; i++) {
@@ -596,7 +696,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
#else
GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half;
a = (a < 0) ? 0 : a << Ashift;
- rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX);
+ rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX);
#endif
}
}
@@ -717,6 +817,36 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
/**
+ * Apply X/Y/Z/W/0/1 swizzle to an array of colors/texels.
+ * See GL_EXT_texture_swizzle.
+ */
+static void
+swizzle_texels(GLuint swizzle, GLuint count, GLchan (*texels)[4])
+{
+ const GLuint swzR = GET_SWZ(swizzle, 0);
+ const GLuint swzG = GET_SWZ(swizzle, 1);
+ const GLuint swzB = GET_SWZ(swizzle, 2);
+ const GLuint swzA = GET_SWZ(swizzle, 3);
+ GLchan vector[6];
+ GLuint i;
+
+ vector[SWIZZLE_ZERO] = 0;
+ vector[SWIZZLE_ONE] = CHAN_MAX;
+
+ for (i = 0; i < count; i++) {
+ vector[SWIZZLE_X] = texels[i][0];
+ vector[SWIZZLE_Y] = texels[i][1];
+ vector[SWIZZLE_Z] = texels[i][2];
+ vector[SWIZZLE_W] = texels[i][3];
+ texels[i][RCOMP] = vector[swzR];
+ texels[i][GCOMP] = vector[swzG];
+ texels[i][BCOMP] = vector[swzB];
+ texels[i][ACOMP] = vector[swzA];
+ }
+}
+
+
+/**
* 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
@@ -1142,9 +1272,15 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span )
_mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels);
#endif
}
+
+ /* GL_EXT_texture_swizzle */
+ if (curObj->_Swizzle != SWIZZLE_NOOP) {
+ swizzle_texels(curObj->_Swizzle, span->end, texels);
+ }
}
}
+
/*
* OK, now apply the texture (aka texture combine/blend).
* We modify the span->color.rgba values.
@@ -1163,6 +1299,8 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span )
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/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index a095b255ab..8d72018cf4 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -2826,7 +2826,7 @@ sample_depth_texture( GLcontext *ctx,
tObj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
tObj->Target == GL_TEXTURE_2D_ARRAY_EXT);
- UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient);
+ UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->CompareFailValue);
/* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */
@@ -3156,103 +3156,6 @@ sample_depth_texture( GLcontext *ctx,
}
-#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 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[0][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->TexFormat->BaseFormat != 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;
- col = nearest_texel_location(texObj->WrapS, img, width,
- texcoords[i][0]);
- row = nearest_texel_location(texObj->WrapT, img, height,
- texcoords[i][1]);
-
- 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;
- texImage->FetchTexelf(texImage, ii, jj, 0, &depthSample);
- 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.
* When a fragment program attempts to sample an incomplete texture we
diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c
index 16b00b9fa1..f9ff9ad6a4 100644
--- a/src/mesa/swrast/s_texstore.c
+++ b/src/mesa/swrast/s_texstore.c
@@ -67,7 +67,6 @@ static GLvoid *
read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type,
GLsizei width, GLsizei height )
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type);
const GLint stride = width * pixelSize;
@@ -78,7 +77,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type,
if (!image)
return NULL;
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
dst = image;
for (row = 0; row < height; row++) {
@@ -86,7 +85,7 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type,
dst += stride;
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
return image;
}
@@ -101,7 +100,6 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height )
{
struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint *image, *dst;
GLint i;
@@ -109,7 +107,7 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y,
if (!image)
return NULL;
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
dst = image;
for (i = 0; i < height; i++) {
@@ -117,7 +115,7 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y,
dst += width;
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
return image;
}
@@ -132,7 +130,6 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y,
{
struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer;
struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint *image, *dst;
GLint i;
@@ -143,7 +140,7 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y,
if (!image)
return NULL;
- RENDER_START(swrast, ctx);
+ swrast_render_start(ctx);
/* read from depth buffer */
dst = image;
@@ -205,7 +202,7 @@ read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y,
dst += width;
}
- RENDER_FINISH(swrast, ctx);
+ swrast_render_finish(ctx);
return image;
}
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index a2e8433e27..0598052f50 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -35,6 +35,7 @@
#include "main/imports.h"
#include "main/macros.h"
#include "main/texformat.h"
+#include "shader/prog_instruction.h"
#include "s_aatriangle.h"
#include "s_context.h"
@@ -265,9 +266,6 @@ affine_span(GLcontext *ctx, SWspan *span,
GLchan sample[4]; /* the filtered texture sample */
const GLuint texEnableSave = ctx->Texture._EnabledUnits;
- /* Disable tex units so they're not re-applied in swrast_write_rgba_span */
- ctx->Texture._EnabledUnits = 0x0;
-
/* Instead of defining a function for each mode, a test is done
* between the outer and inner loops. This is to reduce code size
* and complexity. Observe that an optimizing compiler kills
@@ -396,6 +394,9 @@ affine_span(GLcontext *ctx, SWspan *span,
GLuint i;
GLchan *dest = span->array->rgba[0];
+ /* Disable tex units so they're not re-applied in swrast_write_rgba_span */
+ ctx->Texture._EnabledUnits = 0x0;
+
span->intTex[0] -= FIXED_HALF;
span->intTex[1] -= FIXED_HALF;
switch (info->filter) {
@@ -1063,6 +1064,7 @@ _swrast_choose_triangle( GLcontext *ctx )
&& ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
&& texObj2D->WrapS == GL_REPEAT
&& texObj2D->WrapT == GL_REPEAT
+ && texObj2D->_Swizzle == SWIZZLE_NOOP
&& texImg->_IsPowerOfTwo
&& texImg->Border == 0
&& texImg->Width == texImg->RowStride
@@ -1070,7 +1072,8 @@ _swrast_choose_triangle( GLcontext *ctx )
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
&& !swrast->_FogEnabled
- && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT) {
+ && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT
+ && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) {
if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) {
if (minFilter == GL_NEAREST
&& format == MESA_FORMAT_RGB
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index fdf4534b36..f0d31fdac3 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -32,6 +32,8 @@
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/light.h"
+#include "math/m_translate.h"
+#include "math/m_xform.h"
#include "tnl.h"
#include "t_context.h"
@@ -81,6 +83,9 @@ _tnl_CreateContext( GLcontext *ctx )
/* plug in the VBO drawing function */
vbo_set_draw_func(ctx, _tnl_draw_prims);
+ _math_init_transformation();
+ _math_init_translate();
+
return GL_TRUE;
}
@@ -112,24 +117,28 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
tnl->pipeline.new_state |= new_state;
- /* Calculate tnl->render_inputs:
+ /* Calculate tnl->render_inputs. This bitmask indicates which vertex
+ * attributes need to be emitted to the rasterizer.
*/
if (ctx->Visual.rgbMode) {
GLuint i;
RENDERINPUTS_ZERO( tnl->render_inputs_bitset );
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
+
if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) {
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
}
+
+ if (NEED_SECONDARY_COLOR(ctx))
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 );
+
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- if (ctx->Texture._EnabledCoordUnits & (1 << i)) {
+ if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
+ (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) {
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) );
}
}
-
- if (NEED_SECONDARY_COLOR(ctx))
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 );
}
else {
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index fd647c1f4a..2ec65d5323 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -88,6 +88,29 @@ static void free_space(GLcontext *ctx)
} while (0)
+/**
+ * Convert array of BGRA/GLubyte[4] values to RGBA/float[4]
+ * \param ptr input/ubyte array
+ * \param fptr output/float array
+ */
+static void
+convert_bgra_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count )
+{
+ GLuint i;
+ assert(input->Normalized);
+ assert(input->Size == 4);
+ for (i = 0; i < count; i++) {
+ const GLubyte *in = (GLubyte *) ptr; /* in is in BGRA order */
+ *fptr++ = UBYTE_TO_FLOAT(in[2]); /* red */
+ *fptr++ = UBYTE_TO_FLOAT(in[1]); /* green */
+ *fptr++ = UBYTE_TO_FLOAT(in[0]); /* blue */
+ *fptr++ = UBYTE_TO_FLOAT(in[3]); /* alpha */
+ ptr += input->StrideB;
+ }
+}
+
/* Adjust pointer to point at first requested element, convert to
* floating point, populate VB->AttribPtr[].
@@ -112,7 +135,13 @@ static void _tnl_import_array( GLcontext *ctx,
CONVERT(GLbyte, BYTE_TO_FLOAT);
break;
case GL_UNSIGNED_BYTE:
- CONVERT(GLubyte, UBYTE_TO_FLOAT);
+ if (input->Format == GL_BGRA) {
+ /* See GL_EXT_vertex_array_bgra */
+ convert_bgra_to_float(input, ptr, fptr, count);
+ }
+ else {
+ CONVERT(GLubyte, UBYTE_TO_FLOAT);
+ }
break;
case GL_SHORT:
CONVERT(GLshort, SHORT_TO_FLOAT);
diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c
index dfbe0f1806..14d79eab54 100644
--- a/src/mesa/tnl/t_rasterpos.c
+++ b/src/mesa/tnl/t_rasterpos.c
@@ -26,11 +26,11 @@
#include "main/glheader.h"
#include "main/colormac.h"
#include "main/context.h"
-#include "feedback.h"
-#include "light.h"
+#include "main/feedback.h"
+#include "main/light.h"
#include "main/macros.h"
-#include "rastpos.h"
-#include "simple_list.h"
+#include "main/rastpos.h"
+#include "main/simple_list.h"
#include "main/mtypes.h"
#include "math/m_matrix.h"
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index 10b78f820e..fe4209ae57 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -535,27 +535,30 @@ void _tnl_init_vertices( GLcontext *ctx,
void _tnl_free_vertices( GLcontext *ctx )
{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_fastpath *fp, *tmp;
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ if (tnl) {
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_fastpath *fp, *tmp;
- if (vtx->vertex_buf) {
- ALIGN_FREE(vtx->vertex_buf);
- vtx->vertex_buf = NULL;
- }
-
- for (fp = vtx->fastpath ; fp ; fp = tmp) {
- tmp = fp->next;
- FREE(fp->attr);
-
- /* KW: At the moment, fp->func is constrained to be allocated by
- * _mesa_exec_alloc(), as the hardwired fastpaths in
- * t_vertex_generic.c are handled specially. It would be nice
- * to unify them, but this probably won't change until this
- * module gets another overhaul.
- */
- _mesa_exec_free((void *) fp->func);
- FREE(fp);
+ if (vtx->vertex_buf) {
+ ALIGN_FREE(vtx->vertex_buf);
+ vtx->vertex_buf = NULL;
+ }
+
+ for (fp = vtx->fastpath ; fp ; fp = tmp) {
+ tmp = fp->next;
+ FREE(fp->attr);
+
+ /* KW: At the moment, fp->func is constrained to be allocated by
+ * _mesa_exec_alloc(), as the hardwired fastpaths in
+ * t_vertex_generic.c are handled specially. It would be nice
+ * to unify them, but this probably won't change until this
+ * module gets another overhaul.
+ */
+ _mesa_exec_free((void *) fp->func);
+ FREE(fp);
+ }
+
+ vtx->fastpath = NULL;
}
-
- vtx->fastpath = NULL;
}
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index bbf745b0c6..ca8190fd05 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -28,6 +28,7 @@
#include "main/imports.h"
#include "main/mtypes.h"
#include "main/api_arrayelt.h"
+#include "math/m_eval.h"
#include "vbo.h"
#include "vbo_context.h"
@@ -78,6 +79,7 @@ static void init_legacy_currval(GLcontext *ctx)
cl->StrideB = 0;
cl->Enabled = 1;
cl->Type = GL_FLOAT;
+ cl->Format = GL_RGBA;
cl->Ptr = (const void *)ctx->Current.Attrib[i];
cl->BufferObj = ctx->Array.NullBufferObj;
}
@@ -99,6 +101,7 @@ static void init_generic_currval(GLcontext *ctx)
*/
cl->Size = 1;
cl->Type = GL_FLOAT;
+ cl->Format = GL_RGBA;
cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i];
cl->Stride = 0;
cl->StrideB = 0;
@@ -143,6 +146,7 @@ static void init_mat_currval(GLcontext *ctx)
cl->Ptr = (const void *)ctx->Light.Material.Attrib[i];
cl->Type = GL_FLOAT;
+ cl->Format = GL_RGBA;
cl->Stride = 0;
cl->StrideB = 0;
cl->Enabled = 1;
@@ -227,6 +231,8 @@ GLboolean _vbo_CreateContext( GLcontext *ctx )
vbo_save_init( ctx );
#endif
+ _math_init_eval();
+
return GL_TRUE;
}
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index a6ce26ffed..2743bf6b55 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -156,7 +156,6 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec )
if (memcmp(current, tmp, sizeof(tmp)) != 0)
{
memcpy(current, tmp, sizeof(tmp));
-
/* Given that we explicitly state size here, there is no need
* for the COPY_CLEAN above, could just copy 16 bytes and be
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 5bf3d836db..45133fa4f3 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -176,7 +176,20 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr];
}
map = vbo->map_vp_arb;
+
+ /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read.
+ * In that case we effectively need to route the data from
+ * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
+ */
+ if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 &&
+ (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) {
+ exec->vtx.inputs[16] = exec->vtx.inputs[0];
+ exec->vtx.attrsz[16] = exec->vtx.attrsz[0];
+ exec->vtx.attrsz[0] = 0;
+ }
break;
+ default:
+ assert(0);
}
/* Make all active attributes (including edgeflag) available as
@@ -205,6 +218,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);
arrays[attr].Type = GL_FLOAT;
+ arrays[attr].Format = GL_RGBA;
arrays[attr].Enabled = 1;
_mesa_reference_buffer_object(ctx,
&arrays[attr].BufferObj,
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index b7e9baabf8..7dda54af48 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -166,7 +166,7 @@ void vbo_loopback_vertex_list( GLcontext *ctx,
void vbo_save_EndList( GLcontext *ctx );
void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode );
void vbo_save_EndCallList( GLcontext *ctx );
-void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *list );
+void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *list );
void vbo_save_SaveFlushVertices( GLcontext *ctx );
GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode );
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f69a33d817..ddfd276577 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -293,7 +293,7 @@ static void _save_compile_vertex_list( GLcontext *ctx )
node->count == 0);
if (save->dangling_attr_ref)
- ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS;
+ ctx->ListState.CurrentList->Flags |= DLIST_DANGLING_REFS;
save->vertex_store->used += save->vertex_size * node->count;
save->prim_store->used += node->prim_count;
@@ -1076,10 +1076,10 @@ void vbo_save_EndList( GLcontext *ctx )
assert(save->vertex_size == 0);
}
-void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist )
+void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *dlist )
{
struct vbo_save_context *save = &vbo_context(ctx)->save;
- save->replay_flags |= dlist->flags;
+ save->replay_flags |= dlist->Flags;
}
void vbo_save_EndCallList( GLcontext *ctx )
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 0488c5d718..617c5a77ba 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -118,8 +118,11 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
GLuint data = node->buffer_offset;
const GLuint *map;
GLuint attr;
+ GLubyte node_attrsz[VBO_ATTRIB_MAX]; /* copy of node->attrsz[] */
GLbitfield varying_inputs = 0x0;
+ memcpy(node_attrsz, node->attrsz, sizeof(node->attrsz));
+
/* Install the default (ie Current) attributes first, then overlay
* all active ones.
*/
@@ -144,13 +147,26 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
save->inputs[attr + 16] = &vbo->generic_currval[attr];
}
map = vbo->map_vp_arb;
+
+ /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read.
+ * In that case we effectively need to route the data from
+ * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
+ */
+ if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 &&
+ (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) {
+ save->inputs[16] = save->inputs[0];
+ node_attrsz[16] = node_attrsz[0];
+ node_attrsz[0] = 0;
+ }
break;
+ default:
+ assert(0);
}
for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
GLuint src = map[attr];
- if (node->attrsz[src]) {
+ if (node_attrsz[src]) {
/* override the default array set above */
save->inputs[attr] = &arrays[attr];
@@ -159,6 +175,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat);
arrays[attr].Stride = node->vertex_size * sizeof(GLfloat);
arrays[attr].Type = GL_FLOAT;
+ arrays[attr].Format = GL_RGBA;
arrays[attr].Enabled = 1;
_mesa_reference_buffer_object(ctx,
&arrays[attr].BufferObj,
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index 685cc0fdf6..5fb66d3318 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -461,6 +461,7 @@ static void replay_init( struct copy_context *copy )
dst->Size = src->Size;
dst->Type = src->Type;
+ dst->Format = GL_RGBA;
dst->Stride = copy->vertex_size;
dst->StrideB = copy->vertex_size;
dst->Ptr = copy->dstbuf + offset;
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index cb34061b36..1eb4358b1c 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -21112,21 +21112,25 @@ GL_PREFIX(DrawBuffersARB):
.size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
.p2align 4,,15
- .globl GL_PREFIX(PolygonOffsetEXT)
- .type GL_PREFIX(PolygonOffsetEXT), @function
-GL_PREFIX(PolygonOffsetEXT):
+ .globl GL_PREFIX(RenderbufferStorageMultisample)
+ .type GL_PREFIX(RenderbufferStorageMultisample), @function
+GL_PREFIX(RenderbufferStorageMultisample):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
movq 4488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
movq 4488(%rax), %r11
jmp *%r11
#else
@@ -21136,35 +21140,38 @@ GL_PREFIX(PolygonOffsetEXT):
movq 4488(%rax), %r11
jmp *%r11
1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
movq 4488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
+ .size GL_PREFIX(RenderbufferStorageMultisample), .-GL_PREFIX(RenderbufferStorageMultisample)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_562)
- .type GL_PREFIX(_dispatch_stub_562), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_562))
-GL_PREFIX(_dispatch_stub_562):
+ .globl GL_PREFIX(PolygonOffsetEXT)
+ .type GL_PREFIX(PolygonOffsetEXT), @function
+GL_PREFIX(PolygonOffsetEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
movq 4496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
movq 4496(%rax), %r11
jmp *%r11
#else
@@ -21174,17 +21181,17 @@ GL_PREFIX(_dispatch_stub_562):
movq 4496(%rax), %r11
jmp *%r11
1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
movq 4496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562)
+ .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
.p2align 4,,15
.globl GL_PREFIX(_dispatch_stub_563)
@@ -21234,13 +21241,13 @@ GL_PREFIX(_dispatch_stub_564):
movq 4512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
+ popq %rbp
+ popq %rsi
+ popq %rdi
movq 4512(%rax), %r11
jmp *%r11
#else
@@ -21250,13 +21257,13 @@ GL_PREFIX(_dispatch_stub_564):
movq 4512(%rax), %r11
jmp *%r11
1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
+ popq %rbp
+ popq %rsi
+ popq %rdi
movq 4512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
@@ -21272,13 +21279,13 @@ GL_PREFIX(_dispatch_stub_565):
movq 4520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
movq 4520(%rax), %r11
jmp *%r11
#else
@@ -21288,13 +21295,13 @@ GL_PREFIX(_dispatch_stub_565):
movq 4520(%rax), %r11
jmp *%r11
1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
movq 4520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
@@ -21425,7 +21432,11 @@ GL_PREFIX(_dispatch_stub_569):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
popq %rdi
movq 4552(%rax), %r11
jmp *%r11
@@ -21437,7 +21448,11 @@ GL_PREFIX(_dispatch_stub_569):
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
popq %rdi
movq 4552(%rax), %r11
jmp *%r11
@@ -21445,12 +21460,42 @@ GL_PREFIX(_dispatch_stub_569):
.size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569)
.p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_570)
+ .type GL_PREFIX(_dispatch_stub_570), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_570))
+GL_PREFIX(_dispatch_stub_570):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_570), .-GL_PREFIX(_dispatch_stub_570)
+
+ .p2align 4,,15
.globl GL_PREFIX(ColorPointerEXT)
.type GL_PREFIX(ColorPointerEXT), @function
GL_PREFIX(ColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4560(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21464,13 +21509,13 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4560(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4560(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21484,7 +21529,7 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4560(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
@@ -21495,7 +21540,7 @@ GL_PREFIX(ColorPointerEXT):
GL_PREFIX(EdgeFlagPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4568(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21505,13 +21550,13 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4568(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21521,7 +21566,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
@@ -21532,7 +21577,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
GL_PREFIX(IndexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4576(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21546,13 +21591,13 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4576(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4576(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21566,7 +21611,7 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4576(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
@@ -21577,7 +21622,7 @@ GL_PREFIX(IndexPointerEXT):
GL_PREFIX(NormalPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4584(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21591,13 +21636,13 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4584(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4584(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21611,7 +21656,7 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4584(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
@@ -21622,7 +21667,7 @@ GL_PREFIX(NormalPointerEXT):
GL_PREFIX(TexCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4592(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21636,13 +21681,13 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4592(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4592(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21656,7 +21701,7 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4592(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
@@ -21667,7 +21712,7 @@ GL_PREFIX(TexCoordPointerEXT):
GL_PREFIX(VertexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4600(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21681,13 +21726,13 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4600(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21701,7 +21746,7 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
@@ -21712,7 +21757,7 @@ GL_PREFIX(VertexPointerEXT):
GL_PREFIX(PointParameterfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4608(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21722,13 +21767,13 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4608(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4608(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21738,7 +21783,7 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4608(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
@@ -21749,7 +21794,7 @@ GL_PREFIX(PointParameterfEXT):
GL_PREFIX(PointParameterfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4616(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21759,13 +21804,13 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4616(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21775,7 +21820,7 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
@@ -21786,7 +21831,7 @@ GL_PREFIX(PointParameterfvEXT):
GL_PREFIX(LockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4624(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21796,13 +21841,13 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4624(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4624(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21812,7 +21857,7 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4624(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
@@ -21823,37 +21868,37 @@ GL_PREFIX(LockArraysEXT):
GL_PREFIX(UnlockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4632(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4632(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4632(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4632(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_580)
- .type GL_PREFIX(_dispatch_stub_580), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_580))
-GL_PREFIX(_dispatch_stub_580):
+ .globl GL_PREFIX(_dispatch_stub_581)
+ .type GL_PREFIX(_dispatch_stub_581), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_581))
+GL_PREFIX(_dispatch_stub_581):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4640(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21863,13 +21908,13 @@ GL_PREFIX(_dispatch_stub_580):
popq %rbp
popq %rsi
popq %rdi
- movq 4640(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4640(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21879,19 +21924,19 @@ GL_PREFIX(_dispatch_stub_580):
popq %rbp
popq %rsi
popq %rdi
- movq 4640(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580)
+ .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_581)
- .type GL_PREFIX(_dispatch_stub_581), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_581))
-GL_PREFIX(_dispatch_stub_581):
+ .globl GL_PREFIX(_dispatch_stub_582)
+ .type GL_PREFIX(_dispatch_stub_582), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_582))
+GL_PREFIX(_dispatch_stub_582):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4648(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21901,13 +21946,13 @@ GL_PREFIX(_dispatch_stub_581):
popq %rbp
popq %rsi
popq %rdi
- movq 4648(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4648(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21917,10 +21962,10 @@ GL_PREFIX(_dispatch_stub_581):
popq %rbp
popq %rsi
popq %rdi
- movq 4648(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581)
+ .size GL_PREFIX(_dispatch_stub_582), .-GL_PREFIX(_dispatch_stub_582)
.p2align 4,,15
.globl GL_PREFIX(SecondaryColor3bEXT)
@@ -21928,7 +21973,7 @@ GL_PREFIX(_dispatch_stub_581):
GL_PREFIX(SecondaryColor3bEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4656(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21938,13 +21983,13 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4656(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4656(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21954,7 +21999,7 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4656(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
@@ -21965,25 +22010,25 @@ GL_PREFIX(SecondaryColor3bEXT):
GL_PREFIX(SecondaryColor3bvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4664(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4664(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4664(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4664(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
@@ -21994,7 +22039,7 @@ GL_PREFIX(SecondaryColor3bvEXT):
GL_PREFIX(SecondaryColor3dEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4672(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22006,13 +22051,13 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4672(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4672(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22024,7 +22069,7 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4672(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
@@ -22035,25 +22080,25 @@ GL_PREFIX(SecondaryColor3dEXT):
GL_PREFIX(SecondaryColor3dvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4680(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4680(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4680(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4680(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
@@ -22064,7 +22109,7 @@ GL_PREFIX(SecondaryColor3dvEXT):
GL_PREFIX(SecondaryColor3fEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4688(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22076,13 +22121,13 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4688(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4688(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22094,7 +22139,7 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4688(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
@@ -22105,25 +22150,25 @@ GL_PREFIX(SecondaryColor3fEXT):
GL_PREFIX(SecondaryColor3fvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4696(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4696(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4696(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4696(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
@@ -22134,7 +22179,7 @@ GL_PREFIX(SecondaryColor3fvEXT):
GL_PREFIX(SecondaryColor3iEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4704(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22144,13 +22189,13 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4704(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4704(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22160,7 +22205,7 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4704(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
@@ -22171,25 +22216,25 @@ GL_PREFIX(SecondaryColor3iEXT):
GL_PREFIX(SecondaryColor3ivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4712(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4712(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4712(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4712(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
@@ -22200,7 +22245,7 @@ GL_PREFIX(SecondaryColor3ivEXT):
GL_PREFIX(SecondaryColor3sEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4720(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22210,13 +22255,13 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4720(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4720(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22226,7 +22271,7 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4720(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
@@ -22237,25 +22282,25 @@ GL_PREFIX(SecondaryColor3sEXT):
GL_PREFIX(SecondaryColor3svEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4728(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4728(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4728(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4728(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
@@ -22266,7 +22311,7 @@ GL_PREFIX(SecondaryColor3svEXT):
GL_PREFIX(SecondaryColor3ubEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4736(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22276,13 +22321,13 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4736(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4736(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22292,7 +22337,7 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4736(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
@@ -22303,25 +22348,25 @@ GL_PREFIX(SecondaryColor3ubEXT):
GL_PREFIX(SecondaryColor3ubvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4744(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4744(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4744(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4744(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
@@ -22332,7 +22377,7 @@ GL_PREFIX(SecondaryColor3ubvEXT):
GL_PREFIX(SecondaryColor3uiEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4752(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22342,13 +22387,13 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4752(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4752(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22358,7 +22403,7 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4752(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
@@ -22369,25 +22414,25 @@ GL_PREFIX(SecondaryColor3uiEXT):
GL_PREFIX(SecondaryColor3uivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4760(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4760(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4760(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4760(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
@@ -22398,7 +22443,7 @@ GL_PREFIX(SecondaryColor3uivEXT):
GL_PREFIX(SecondaryColor3usEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4768(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22408,13 +22453,13 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4768(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22424,7 +22469,7 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
@@ -22435,25 +22480,25 @@ GL_PREFIX(SecondaryColor3usEXT):
GL_PREFIX(SecondaryColor3usvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4776(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4776(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4776(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4776(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
@@ -22464,7 +22509,7 @@ GL_PREFIX(SecondaryColor3usvEXT):
GL_PREFIX(SecondaryColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4784(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22478,13 +22523,13 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4784(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22498,7 +22543,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
@@ -22509,7 +22554,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
GL_PREFIX(MultiDrawArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4792(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22523,13 +22568,13 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4792(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4792(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22543,7 +22588,7 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4792(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
@@ -22554,7 +22599,7 @@ GL_PREFIX(MultiDrawArraysEXT):
GL_PREFIX(MultiDrawElementsEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4800(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22568,13 +22613,13 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4800(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4800(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22588,7 +22633,7 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4800(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
@@ -22599,7 +22644,7 @@ GL_PREFIX(MultiDrawElementsEXT):
GL_PREFIX(FogCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4808(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22609,13 +22654,13 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4808(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4808(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22625,7 +22670,7 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4808(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
@@ -22636,7 +22681,7 @@ GL_PREFIX(FogCoordPointerEXT):
GL_PREFIX(FogCoorddEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4816(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -22644,13 +22689,13 @@ GL_PREFIX(FogCoorddEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4816(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4816(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -22658,7 +22703,7 @@ GL_PREFIX(FogCoorddEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4816(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
@@ -22669,25 +22714,25 @@ GL_PREFIX(FogCoorddEXT):
GL_PREFIX(FogCoorddvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4824(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4824(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4824(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4824(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
@@ -22698,7 +22743,7 @@ GL_PREFIX(FogCoorddvEXT):
GL_PREFIX(FogCoordfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4832(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -22706,13 +22751,13 @@ GL_PREFIX(FogCoordfEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4832(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4832(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -22720,7 +22765,7 @@ GL_PREFIX(FogCoordfEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4832(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
@@ -22731,58 +22776,58 @@ GL_PREFIX(FogCoordfEXT):
GL_PREFIX(FogCoordfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4840(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4840(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4840(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4840(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_606)
- .type GL_PREFIX(_dispatch_stub_606), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_606))
-GL_PREFIX(_dispatch_stub_606):
+ .globl GL_PREFIX(_dispatch_stub_607)
+ .type GL_PREFIX(_dispatch_stub_607), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_607))
+GL_PREFIX(_dispatch_stub_607):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4848(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4848(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4848(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4848(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606)
+ .size GL_PREFIX(_dispatch_stub_607), .-GL_PREFIX(_dispatch_stub_607)
.p2align 4,,15
.globl GL_PREFIX(BlendFuncSeparateEXT)
@@ -22790,7 +22835,7 @@ GL_PREFIX(_dispatch_stub_606):
GL_PREFIX(BlendFuncSeparateEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4856(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22804,13 +22849,13 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4856(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4856(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22824,7 +22869,7 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4856(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
@@ -22835,25 +22880,25 @@ GL_PREFIX(BlendFuncSeparateEXT):
GL_PREFIX(FlushVertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4864(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4864(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4864(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4864(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
@@ -22864,7 +22909,7 @@ GL_PREFIX(FlushVertexArrayRangeNV):
GL_PREFIX(VertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4872(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22874,13 +22919,13 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4872(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4872(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22890,7 +22935,7 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4872(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
@@ -22901,7 +22946,7 @@ GL_PREFIX(VertexArrayRangeNV):
GL_PREFIX(CombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4880(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22919,13 +22964,13 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4880(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4880(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22943,7 +22988,7 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4880(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
@@ -22954,7 +22999,7 @@ GL_PREFIX(CombinerInputNV):
GL_PREFIX(CombinerOutputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4888(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22972,13 +23017,13 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4888(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22996,7 +23041,7 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
@@ -23007,7 +23052,7 @@ GL_PREFIX(CombinerOutputNV):
GL_PREFIX(CombinerParameterfNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4896(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23017,13 +23062,13 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4896(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4896(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23033,7 +23078,7 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4896(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
@@ -23044,7 +23089,7 @@ GL_PREFIX(CombinerParameterfNV):
GL_PREFIX(CombinerParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4904(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23054,13 +23099,13 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4904(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4904(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23070,7 +23115,7 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4904(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
@@ -23081,7 +23126,7 @@ GL_PREFIX(CombinerParameterfvNV):
GL_PREFIX(CombinerParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4912(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23091,13 +23136,13 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4912(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4912(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23107,7 +23152,7 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4912(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
@@ -23118,7 +23163,7 @@ GL_PREFIX(CombinerParameteriNV):
GL_PREFIX(CombinerParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4920(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23128,13 +23173,13 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4920(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4920(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23144,7 +23189,7 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4920(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
@@ -23155,7 +23200,7 @@ GL_PREFIX(CombinerParameterivNV):
GL_PREFIX(FinalCombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4928(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23169,13 +23214,13 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4928(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4928(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23189,7 +23234,7 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4928(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
@@ -23200,7 +23245,7 @@ GL_PREFIX(FinalCombinerInputNV):
GL_PREFIX(GetCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4936(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23214,13 +23259,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4936(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23234,7 +23279,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
@@ -23245,7 +23290,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
GL_PREFIX(GetCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4944(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23259,13 +23304,13 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4944(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4944(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23279,7 +23324,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4944(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
@@ -23290,7 +23335,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
GL_PREFIX(GetCombinerOutputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4952(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23304,13 +23349,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4952(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23324,7 +23369,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
@@ -23335,7 +23380,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
GL_PREFIX(GetCombinerOutputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4960(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23349,13 +23394,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4960(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4960(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23369,7 +23414,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4960(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
@@ -23380,7 +23425,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
GL_PREFIX(GetFinalCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4968(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23390,13 +23435,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4968(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4968(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23406,7 +23451,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4968(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
@@ -23417,7 +23462,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
GL_PREFIX(GetFinalCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4976(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23427,13 +23472,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4976(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4976(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23443,7 +23488,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4976(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
@@ -23454,25 +23499,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
GL_PREFIX(ResizeBuffersMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4984(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4984(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4984(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4984(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
@@ -23483,7 +23528,7 @@ GL_PREFIX(ResizeBuffersMESA):
GL_PREFIX(WindowPos2dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4992(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23493,13 +23538,13 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4992(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4992(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23509,7 +23554,7 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4992(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
@@ -23520,25 +23565,25 @@ GL_PREFIX(WindowPos2dMESA):
GL_PREFIX(WindowPos2dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5000(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5000(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5000(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5000(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
@@ -23549,7 +23594,7 @@ GL_PREFIX(WindowPos2dvMESA):
GL_PREFIX(WindowPos2fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5008(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23559,13 +23604,13 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5008(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5008(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23575,7 +23620,7 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5008(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
@@ -23586,25 +23631,25 @@ GL_PREFIX(WindowPos2fMESA):
GL_PREFIX(WindowPos2fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5016(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5016(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5016(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5016(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
@@ -23615,7 +23660,7 @@ GL_PREFIX(WindowPos2fvMESA):
GL_PREFIX(WindowPos2iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5024(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23625,13 +23670,13 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5024(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5024(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23641,7 +23686,7 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5024(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
@@ -23652,25 +23697,25 @@ GL_PREFIX(WindowPos2iMESA):
GL_PREFIX(WindowPos2ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5032(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5032(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5032(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5032(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
@@ -23681,7 +23726,7 @@ GL_PREFIX(WindowPos2ivMESA):
GL_PREFIX(WindowPos2sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5040(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23691,13 +23736,13 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5040(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5040(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23707,7 +23752,7 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 5040(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
@@ -23718,25 +23763,25 @@ GL_PREFIX(WindowPos2sMESA):
GL_PREFIX(WindowPos2svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5048(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5048(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5048(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5048(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
@@ -23747,7 +23792,7 @@ GL_PREFIX(WindowPos2svMESA):
GL_PREFIX(WindowPos3dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5056(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23759,13 +23804,13 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5056(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5056(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23777,7 +23822,7 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5056(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
@@ -23788,25 +23833,25 @@ GL_PREFIX(WindowPos3dMESA):
GL_PREFIX(WindowPos3dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5064(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5064(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5064(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5064(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
@@ -23817,7 +23862,7 @@ GL_PREFIX(WindowPos3dvMESA):
GL_PREFIX(WindowPos3fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5072(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23829,13 +23874,13 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5072(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5072(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23847,7 +23892,7 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 5072(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
@@ -23858,25 +23903,25 @@ GL_PREFIX(WindowPos3fMESA):
GL_PREFIX(WindowPos3fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5080(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5080(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5080(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5080(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
@@ -23887,7 +23932,7 @@ GL_PREFIX(WindowPos3fvMESA):
GL_PREFIX(WindowPos3iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5088(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23897,13 +23942,13 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5088(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5088(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23913,7 +23958,7 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5088(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
@@ -23924,25 +23969,25 @@ GL_PREFIX(WindowPos3iMESA):
GL_PREFIX(WindowPos3ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5096(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5096(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5096(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5096(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
@@ -23953,7 +23998,7 @@ GL_PREFIX(WindowPos3ivMESA):
GL_PREFIX(WindowPos3sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5104(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23963,13 +24008,13 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5104(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5104(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23979,7 +24024,7 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5104(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
@@ -23990,25 +24035,25 @@ GL_PREFIX(WindowPos3sMESA):
GL_PREFIX(WindowPos3svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5112(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5112(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5112(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5112(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
@@ -24019,7 +24064,7 @@ GL_PREFIX(WindowPos3svMESA):
GL_PREFIX(WindowPos4dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5120(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -24033,13 +24078,13 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5120(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5120(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -24053,7 +24098,7 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5120(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
@@ -24064,25 +24109,25 @@ GL_PREFIX(WindowPos4dMESA):
GL_PREFIX(WindowPos4dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5128(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5128(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5128(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5128(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
@@ -24093,7 +24138,7 @@ GL_PREFIX(WindowPos4dvMESA):
GL_PREFIX(WindowPos4fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5136(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -24107,13 +24152,13 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5136(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5136(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -24127,7 +24172,7 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 5136(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
@@ -24138,25 +24183,25 @@ GL_PREFIX(WindowPos4fMESA):
GL_PREFIX(WindowPos4fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5144(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5144(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5144(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5144(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
@@ -24167,7 +24212,7 @@ GL_PREFIX(WindowPos4fvMESA):
GL_PREFIX(WindowPos4iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5152(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24181,13 +24226,13 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5152(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5152(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24201,7 +24246,7 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5152(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
@@ -24212,25 +24257,25 @@ GL_PREFIX(WindowPos4iMESA):
GL_PREFIX(WindowPos4ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5160(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5160(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5160(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5160(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
@@ -24241,7 +24286,7 @@ GL_PREFIX(WindowPos4ivMESA):
GL_PREFIX(WindowPos4sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5168(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24255,13 +24300,13 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5168(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24275,7 +24320,7 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
@@ -24286,49 +24331,11 @@ GL_PREFIX(WindowPos4sMESA):
GL_PREFIX(WindowPos4svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_648)
- .type GL_PREFIX(_dispatch_stub_648), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_648))
-GL_PREFIX(_dispatch_stub_648):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
movq 5184(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
popq %rdi
movq 5184(%rax), %r11
jmp *%r11
@@ -24340,20 +24347,12 @@ GL_PREFIX(_dispatch_stub_648):
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
popq %rdi
movq 5184(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
+ .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
.p2align 4,,15
.globl GL_PREFIX(_dispatch_stub_649)
@@ -24370,11 +24369,7 @@ GL_PREFIX(_dispatch_stub_649):
pushq %rdx
pushq %rcx
pushq %r8
- pushq %r9
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
popq %r8
popq %rcx
popq %rdx
@@ -24394,11 +24389,7 @@ GL_PREFIX(_dispatch_stub_649):
pushq %rdx
pushq %rcx
pushq %r8
- pushq %r9
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %r9
popq %r8
popq %rcx
popq %rdx
@@ -24421,9 +24412,17 @@ GL_PREFIX(_dispatch_stub_650):
#elif defined(PTHREADS)
pushq %rdi
pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
popq %rsi
popq %rdi
movq 5200(%rax), %r11
@@ -24437,9 +24436,17 @@ GL_PREFIX(_dispatch_stub_650):
1:
pushq %rdi
pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
pushq %rbp
call _glapi_get_dispatch
popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
popq %rsi
popq %rdi
movq 5200(%rax), %r11
@@ -24458,7 +24465,11 @@ GL_PREFIX(_dispatch_stub_651):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5208(%rax), %r11
jmp *%r11
@@ -24470,7 +24481,11 @@ GL_PREFIX(_dispatch_stub_651):
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5208(%rax), %r11
jmp *%r11
@@ -24488,11 +24503,7 @@ GL_PREFIX(_dispatch_stub_652):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
popq %rdi
movq 5216(%rax), %r11
jmp *%r11
@@ -24504,11 +24515,7 @@ GL_PREFIX(_dispatch_stub_652):
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %rsi
popq %rdi
movq 5216(%rax), %r11
jmp *%r11
@@ -24527,9 +24534,9 @@ GL_PREFIX(_dispatch_stub_653):
#elif defined(PTHREADS)
pushq %rdi
pushq %rsi
- pushq %rdx
+ pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rdx
+ popq %rbp
popq %rsi
popq %rdi
movq 5224(%rax), %r11
@@ -24543,9 +24550,9 @@ GL_PREFIX(_dispatch_stub_653):
1:
pushq %rdi
pushq %rsi
- pushq %rdx
+ pushq %rbp
call _glapi_get_dispatch
- popq %rdx
+ popq %rbp
popq %rsi
popq %rdi
movq 5224(%rax), %r11
@@ -24564,7 +24571,11 @@ GL_PREFIX(_dispatch_stub_654):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rdx
call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
popq %rdi
movq 5232(%rax), %r11
jmp *%r11
@@ -24576,7 +24587,11 @@ GL_PREFIX(_dispatch_stub_654):
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rdx
call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
popq %rdi
movq 5232(%rax), %r11
jmp *%r11
@@ -24594,11 +24609,7 @@ GL_PREFIX(_dispatch_stub_655):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
popq %rdi
movq 5240(%rax), %r11
jmp *%r11
@@ -24610,11 +24621,7 @@ GL_PREFIX(_dispatch_stub_655):
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %rsi
popq %rdi
movq 5240(%rax), %r11
jmp *%r11
@@ -24632,7 +24639,11 @@ GL_PREFIX(_dispatch_stub_656):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5248(%rax), %r11
jmp *%r11
@@ -24644,7 +24655,11 @@ GL_PREFIX(_dispatch_stub_656):
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5248(%rax), %r11
jmp *%r11
@@ -24652,12 +24667,42 @@ GL_PREFIX(_dispatch_stub_656):
.size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656)
.p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_657)
+ .type GL_PREFIX(_dispatch_stub_657), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_657))
+GL_PREFIX(_dispatch_stub_657):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_657), .-GL_PREFIX(_dispatch_stub_657)
+
+ .p2align 4,,15
.globl GL_PREFIX(AreProgramsResidentNV)
.type GL_PREFIX(AreProgramsResidentNV), @function
GL_PREFIX(AreProgramsResidentNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5256(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24667,13 +24712,13 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5256(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24683,7 +24728,7 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
@@ -24694,7 +24739,7 @@ GL_PREFIX(AreProgramsResidentNV):
GL_PREFIX(BindProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5264(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24704,13 +24749,13 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5264(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24720,7 +24765,7 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
@@ -24731,7 +24776,7 @@ GL_PREFIX(BindProgramNV):
GL_PREFIX(DeleteProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5272(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24741,13 +24786,13 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5272(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24757,7 +24802,7 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
@@ -24768,7 +24813,7 @@ GL_PREFIX(DeleteProgramsNV):
GL_PREFIX(ExecuteProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5280(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24778,13 +24823,13 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5280(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24794,7 +24839,7 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
@@ -24805,7 +24850,7 @@ GL_PREFIX(ExecuteProgramNV):
GL_PREFIX(GenProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5288(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24815,13 +24860,13 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5288(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24831,7 +24876,7 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
@@ -24842,7 +24887,7 @@ GL_PREFIX(GenProgramsNV):
GL_PREFIX(GetProgramParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5296(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24856,13 +24901,13 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5296(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5296(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24876,7 +24921,7 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5296(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
@@ -24887,7 +24932,7 @@ GL_PREFIX(GetProgramParameterdvNV):
GL_PREFIX(GetProgramParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5304(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24901,13 +24946,13 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5304(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24921,7 +24966,7 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
@@ -24932,7 +24977,7 @@ GL_PREFIX(GetProgramParameterfvNV):
GL_PREFIX(GetProgramStringNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5312(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24942,13 +24987,13 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5312(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5312(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24958,7 +25003,7 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5312(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
@@ -24969,7 +25014,7 @@ GL_PREFIX(GetProgramStringNV):
GL_PREFIX(GetProgramivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5320(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24979,13 +25024,13 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5320(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24995,7 +25040,7 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
@@ -25006,7 +25051,7 @@ GL_PREFIX(GetProgramivNV):
GL_PREFIX(GetTrackMatrixivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5328(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25020,13 +25065,13 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5328(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25040,7 +25085,7 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
@@ -25051,7 +25096,7 @@ GL_PREFIX(GetTrackMatrixivNV):
GL_PREFIX(GetVertexAttribPointervNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5336(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25061,13 +25106,13 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5336(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25077,7 +25122,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
@@ -25088,7 +25133,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
GL_PREFIX(GetVertexAttribdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5344(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25098,13 +25143,13 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5344(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5344(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25114,7 +25159,7 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5344(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
@@ -25125,7 +25170,7 @@ GL_PREFIX(GetVertexAttribdvNV):
GL_PREFIX(GetVertexAttribfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5352(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25135,13 +25180,13 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5352(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25151,7 +25196,7 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
@@ -25162,7 +25207,7 @@ GL_PREFIX(GetVertexAttribfvNV):
GL_PREFIX(GetVertexAttribivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5360(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25172,13 +25217,13 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5360(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5360(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25188,7 +25233,7 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5360(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
@@ -25199,25 +25244,25 @@ GL_PREFIX(GetVertexAttribivNV):
GL_PREFIX(IsProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5368(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5368(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5368(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5368(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
@@ -25228,7 +25273,7 @@ GL_PREFIX(IsProgramNV):
GL_PREFIX(LoadProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5376(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25242,13 +25287,13 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5376(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5376(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25262,7 +25307,7 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5376(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
@@ -25273,7 +25318,7 @@ GL_PREFIX(LoadProgramNV):
GL_PREFIX(ProgramParameters4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5384(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25287,13 +25332,13 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5384(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25307,7 +25352,7 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
@@ -25318,7 +25363,7 @@ GL_PREFIX(ProgramParameters4dvNV):
GL_PREFIX(ProgramParameters4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5392(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25332,13 +25377,13 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5392(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5392(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25352,7 +25397,7 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5392(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
@@ -25363,7 +25408,7 @@ GL_PREFIX(ProgramParameters4fvNV):
GL_PREFIX(RequestResidentProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5400(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25373,13 +25418,13 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5400(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25389,7 +25434,7 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
@@ -25400,7 +25445,7 @@ GL_PREFIX(RequestResidentProgramsNV):
GL_PREFIX(TrackMatrixNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5408(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25414,13 +25459,13 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5408(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5408(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25434,7 +25479,7 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5408(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
@@ -25445,7 +25490,7 @@ GL_PREFIX(TrackMatrixNV):
GL_PREFIX(VertexAttrib1dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5416(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25455,13 +25500,13 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5416(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5416(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25471,7 +25516,7 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5416(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
@@ -25482,7 +25527,7 @@ GL_PREFIX(VertexAttrib1dNV):
GL_PREFIX(VertexAttrib1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5424(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25492,13 +25537,13 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5424(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5424(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25508,7 +25553,7 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5424(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
@@ -25519,7 +25564,7 @@ GL_PREFIX(VertexAttrib1dvNV):
GL_PREFIX(VertexAttrib1fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5432(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25529,13 +25574,13 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5432(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5432(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25545,7 +25590,7 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5432(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
@@ -25556,7 +25601,7 @@ GL_PREFIX(VertexAttrib1fNV):
GL_PREFIX(VertexAttrib1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5440(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25566,13 +25611,13 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5440(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5440(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25582,7 +25627,7 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5440(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
@@ -25593,7 +25638,7 @@ GL_PREFIX(VertexAttrib1fvNV):
GL_PREFIX(VertexAttrib1sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5448(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25603,13 +25648,13 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5448(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25619,7 +25664,7 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
@@ -25630,7 +25675,7 @@ GL_PREFIX(VertexAttrib1sNV):
GL_PREFIX(VertexAttrib1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5456(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25640,13 +25685,13 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5456(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5456(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25656,7 +25701,7 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5456(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
@@ -25667,7 +25712,7 @@ GL_PREFIX(VertexAttrib1svNV):
GL_PREFIX(VertexAttrib2dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5464(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25679,13 +25724,13 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5464(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5464(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25697,7 +25742,7 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5464(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
@@ -25708,7 +25753,7 @@ GL_PREFIX(VertexAttrib2dNV):
GL_PREFIX(VertexAttrib2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5472(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25718,13 +25763,13 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5472(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5472(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25734,7 +25779,7 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5472(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
@@ -25745,7 +25790,7 @@ GL_PREFIX(VertexAttrib2dvNV):
GL_PREFIX(VertexAttrib2fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5480(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25757,13 +25802,13 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5480(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5480(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25775,7 +25820,7 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5480(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
@@ -25786,7 +25831,7 @@ GL_PREFIX(VertexAttrib2fNV):
GL_PREFIX(VertexAttrib2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5488(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25796,13 +25841,13 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5488(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5488(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25812,7 +25857,7 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5488(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
@@ -25823,7 +25868,7 @@ GL_PREFIX(VertexAttrib2fvNV):
GL_PREFIX(VertexAttrib2sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5496(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25833,13 +25878,13 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5496(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25849,7 +25894,7 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
@@ -25860,7 +25905,7 @@ GL_PREFIX(VertexAttrib2sNV):
GL_PREFIX(VertexAttrib2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5504(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25870,13 +25915,13 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5504(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25886,7 +25931,7 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
@@ -25897,7 +25942,7 @@ GL_PREFIX(VertexAttrib2svNV):
GL_PREFIX(VertexAttrib3dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5512(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25911,13 +25956,13 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5512(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5512(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -25931,7 +25976,7 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5512(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
@@ -25942,7 +25987,7 @@ GL_PREFIX(VertexAttrib3dNV):
GL_PREFIX(VertexAttrib3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5520(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25952,13 +25997,13 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5520(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5520(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25968,7 +26013,7 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5520(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
@@ -25979,7 +26024,7 @@ GL_PREFIX(VertexAttrib3dvNV):
GL_PREFIX(VertexAttrib3fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5528(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25993,13 +26038,13 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5528(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5528(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26013,7 +26058,7 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5528(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
@@ -26024,7 +26069,7 @@ GL_PREFIX(VertexAttrib3fNV):
GL_PREFIX(VertexAttrib3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5536(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26034,13 +26079,13 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5536(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5536(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26050,7 +26095,7 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5536(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
@@ -26061,7 +26106,7 @@ GL_PREFIX(VertexAttrib3fvNV):
GL_PREFIX(VertexAttrib3sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5544(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26075,13 +26120,13 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5544(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26095,7 +26140,7 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
@@ -26106,7 +26151,7 @@ GL_PREFIX(VertexAttrib3sNV):
GL_PREFIX(VertexAttrib3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5552(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26116,13 +26161,13 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5552(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26132,7 +26177,7 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
@@ -26143,7 +26188,7 @@ GL_PREFIX(VertexAttrib3svNV):
GL_PREFIX(VertexAttrib4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5560(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26159,13 +26204,13 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5560(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5560(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26181,7 +26226,7 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5560(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
@@ -26192,7 +26237,7 @@ GL_PREFIX(VertexAttrib4dNV):
GL_PREFIX(VertexAttrib4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5568(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26202,13 +26247,13 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5568(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5568(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26218,7 +26263,7 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5568(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
@@ -26229,7 +26274,7 @@ GL_PREFIX(VertexAttrib4dvNV):
GL_PREFIX(VertexAttrib4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5576(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -26245,13 +26290,13 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5576(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5576(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -26267,7 +26312,7 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5576(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
@@ -26278,7 +26323,7 @@ GL_PREFIX(VertexAttrib4fNV):
GL_PREFIX(VertexAttrib4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5584(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26288,13 +26333,13 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5584(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5584(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26304,7 +26349,7 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5584(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
@@ -26315,7 +26360,7 @@ GL_PREFIX(VertexAttrib4fvNV):
GL_PREFIX(VertexAttrib4sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5592(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26329,13 +26374,13 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5592(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26349,7 +26394,7 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
@@ -26360,7 +26405,7 @@ GL_PREFIX(VertexAttrib4sNV):
GL_PREFIX(VertexAttrib4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5600(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26370,13 +26415,13 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5600(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26386,7 +26431,7 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
@@ -26397,7 +26442,7 @@ GL_PREFIX(VertexAttrib4svNV):
GL_PREFIX(VertexAttrib4ubNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5608(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26411,13 +26456,13 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5608(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26431,7 +26476,7 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
@@ -26442,7 +26487,7 @@ GL_PREFIX(VertexAttrib4ubNV):
GL_PREFIX(VertexAttrib4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5616(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26452,13 +26497,13 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5616(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26468,7 +26513,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
@@ -26479,7 +26524,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
GL_PREFIX(VertexAttribPointerNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5624(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26493,13 +26538,13 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5624(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26513,7 +26558,7 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
@@ -26524,7 +26569,7 @@ GL_PREFIX(VertexAttribPointerNV):
GL_PREFIX(VertexAttribs1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5632(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26534,13 +26579,13 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5632(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26550,7 +26595,7 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
@@ -26561,7 +26606,7 @@ GL_PREFIX(VertexAttribs1dvNV):
GL_PREFIX(VertexAttribs1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5640(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26571,13 +26616,13 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5640(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5640(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26587,7 +26632,7 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5640(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
@@ -26598,7 +26643,7 @@ GL_PREFIX(VertexAttribs1fvNV):
GL_PREFIX(VertexAttribs1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5648(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26608,13 +26653,13 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5648(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5648(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26624,7 +26669,7 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5648(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
@@ -26635,7 +26680,7 @@ GL_PREFIX(VertexAttribs1svNV):
GL_PREFIX(VertexAttribs2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5656(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26645,13 +26690,13 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5656(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26661,7 +26706,7 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
@@ -26672,7 +26717,7 @@ GL_PREFIX(VertexAttribs2dvNV):
GL_PREFIX(VertexAttribs2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5664(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26682,13 +26727,13 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5664(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26698,7 +26743,7 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
@@ -26709,7 +26754,7 @@ GL_PREFIX(VertexAttribs2fvNV):
GL_PREFIX(VertexAttribs2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5672(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26719,13 +26764,13 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5672(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26735,7 +26780,7 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
@@ -26746,7 +26791,7 @@ GL_PREFIX(VertexAttribs2svNV):
GL_PREFIX(VertexAttribs3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5680(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26756,13 +26801,13 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5680(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5680(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26772,7 +26817,7 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5680(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
@@ -26783,7 +26828,7 @@ GL_PREFIX(VertexAttribs3dvNV):
GL_PREFIX(VertexAttribs3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5688(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26793,13 +26838,13 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5688(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5688(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26809,7 +26854,7 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5688(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
@@ -26820,7 +26865,7 @@ GL_PREFIX(VertexAttribs3fvNV):
GL_PREFIX(VertexAttribs3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5696(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26830,13 +26875,13 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5696(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5696(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26846,7 +26891,7 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5696(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
@@ -26857,7 +26902,7 @@ GL_PREFIX(VertexAttribs3svNV):
GL_PREFIX(VertexAttribs4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5704(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26867,13 +26912,13 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5704(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26883,7 +26928,7 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
@@ -26894,7 +26939,7 @@ GL_PREFIX(VertexAttribs4dvNV):
GL_PREFIX(VertexAttribs4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5712(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26904,13 +26949,13 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5712(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26920,7 +26965,7 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
@@ -26931,7 +26976,7 @@ GL_PREFIX(VertexAttribs4fvNV):
GL_PREFIX(VertexAttribs4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5720(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26941,13 +26986,13 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5720(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26957,7 +27002,7 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
@@ -26968,7 +27013,7 @@ GL_PREFIX(VertexAttribs4svNV):
GL_PREFIX(VertexAttribs4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5728(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26978,13 +27023,13 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5728(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26994,7 +27039,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
@@ -27005,7 +27050,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
GL_PREFIX(AlphaFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5736(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27023,13 +27068,13 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5736(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27047,7 +27092,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
@@ -27058,7 +27103,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
GL_PREFIX(AlphaFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5744(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27076,13 +27121,13 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5744(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5744(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27100,7 +27145,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5744(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
@@ -27111,7 +27156,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
GL_PREFIX(AlphaFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5752(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27129,13 +27174,13 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5752(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5752(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27153,7 +27198,7 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5752(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
@@ -27164,25 +27209,25 @@ GL_PREFIX(AlphaFragmentOp3ATI):
GL_PREFIX(BeginFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5760(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5760(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5760(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5760(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
@@ -27193,25 +27238,25 @@ GL_PREFIX(BeginFragmentShaderATI):
GL_PREFIX(BindFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5768(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5768(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5768(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5768(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
@@ -27222,7 +27267,7 @@ GL_PREFIX(BindFragmentShaderATI):
GL_PREFIX(ColorFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5776(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27240,13 +27285,13 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5776(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5776(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27264,7 +27309,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5776(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
@@ -27275,7 +27320,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
GL_PREFIX(ColorFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5784(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27293,13 +27338,13 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5784(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27317,7 +27362,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
@@ -27328,7 +27373,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
GL_PREFIX(ColorFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5792(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27346,13 +27391,13 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5792(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27370,7 +27415,7 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
@@ -27381,25 +27426,25 @@ GL_PREFIX(ColorFragmentOp3ATI):
GL_PREFIX(DeleteFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5800(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5800(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5800(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5800(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
@@ -27410,25 +27455,25 @@ GL_PREFIX(DeleteFragmentShaderATI):
GL_PREFIX(EndFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5808(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5808(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5808(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5808(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
@@ -27439,25 +27484,25 @@ GL_PREFIX(EndFragmentShaderATI):
GL_PREFIX(GenFragmentShadersATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5816(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5816(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5816(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5816(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
@@ -27468,7 +27513,7 @@ GL_PREFIX(GenFragmentShadersATI):
GL_PREFIX(PassTexCoordATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5824(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27478,13 +27523,13 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5824(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5824(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27494,7 +27539,7 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5824(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
@@ -27505,7 +27550,7 @@ GL_PREFIX(PassTexCoordATI):
GL_PREFIX(SampleMapATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5832(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27515,13 +27560,13 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5832(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27531,7 +27576,7 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
@@ -27542,7 +27587,7 @@ GL_PREFIX(SampleMapATI):
GL_PREFIX(SetFragmentShaderConstantATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5840(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27552,13 +27597,13 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5840(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27568,7 +27613,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
@@ -27579,7 +27624,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
GL_PREFIX(PointParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5848(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27589,13 +27634,13 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5848(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27605,7 +27650,7 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
@@ -27616,7 +27661,7 @@ GL_PREFIX(PointParameteriNV):
GL_PREFIX(PointParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5856(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27626,13 +27671,13 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5856(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27642,40 +27687,10 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_733)
- .type GL_PREFIX(_dispatch_stub_733), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_733))
-GL_PREFIX(_dispatch_stub_733):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
movq 5864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733)
+ .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
.p2align 4,,15
.globl GL_PREFIX(_dispatch_stub_734)
@@ -27718,11 +27733,7 @@ GL_PREFIX(_dispatch_stub_735):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
- pushq %rsi
- pushq %rbp
call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
popq %rdi
movq 5880(%rax), %r11
jmp *%r11
@@ -27734,11 +27745,7 @@ GL_PREFIX(_dispatch_stub_735):
jmp *%r11
1:
pushq %rdi
- pushq %rsi
- pushq %rbp
call _glapi_get_dispatch
- popq %rbp
- popq %rsi
popq %rdi
movq 5880(%rax), %r11
jmp *%r11
@@ -27794,7 +27801,11 @@ GL_PREFIX(_dispatch_stub_737):
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5896(%rax), %r11
jmp *%r11
@@ -27806,7 +27817,11 @@ GL_PREFIX(_dispatch_stub_737):
jmp *%r11
1:
pushq %rdi
+ pushq %rsi
+ pushq %rbp
call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
popq %rdi
movq 5896(%rax), %r11
jmp *%r11
@@ -27814,12 +27829,42 @@ GL_PREFIX(_dispatch_stub_737):
.size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
.p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_738)
+ .type GL_PREFIX(_dispatch_stub_738), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_738))
+GL_PREFIX(_dispatch_stub_738):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
+
+ .p2align 4,,15
.globl GL_PREFIX(GetProgramNamedParameterdvNV)
.type GL_PREFIX(GetProgramNamedParameterdvNV), @function
GL_PREFIX(GetProgramNamedParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5904(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27833,13 +27878,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5904(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5904(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27853,7 +27898,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5904(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27864,7 +27909,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
GL_PREFIX(GetProgramNamedParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5912(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27878,13 +27923,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5912(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27898,7 +27943,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
@@ -27909,7 +27954,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
GL_PREFIX(ProgramNamedParameter4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5920(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -27929,13 +27974,13 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5920(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5920(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -27955,7 +28000,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5920(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
@@ -27966,7 +28011,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
GL_PREFIX(ProgramNamedParameter4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5928(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27980,13 +28025,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5928(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5928(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28000,7 +28045,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5928(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
@@ -28011,7 +28056,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
GL_PREFIX(ProgramNamedParameter4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5936(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -28031,13 +28076,13 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5936(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5936(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -28057,7 +28102,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5936(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
@@ -28068,7 +28113,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
GL_PREFIX(ProgramNamedParameter4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5944(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28082,13 +28127,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5944(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5944(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28102,19 +28147,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5944(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_744)
- .type GL_PREFIX(_dispatch_stub_744), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_744))
-GL_PREFIX(_dispatch_stub_744):
+ .globl GL_PREFIX(_dispatch_stub_745)
+ .type GL_PREFIX(_dispatch_stub_745), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_745))
+GL_PREFIX(_dispatch_stub_745):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5952(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28124,13 +28169,13 @@ GL_PREFIX(_dispatch_stub_744):
popq %rbp
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5952(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28140,19 +28185,19 @@ GL_PREFIX(_dispatch_stub_744):
popq %rbp
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_744), .-GL_PREFIX(_dispatch_stub_744)
+ .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_745)
- .type GL_PREFIX(_dispatch_stub_745), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_745))
-GL_PREFIX(_dispatch_stub_745):
+ .globl GL_PREFIX(_dispatch_stub_746)
+ .type GL_PREFIX(_dispatch_stub_746), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_746))
+GL_PREFIX(_dispatch_stub_746):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5960(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28162,13 +28207,13 @@ GL_PREFIX(_dispatch_stub_745):
popq %rbp
popq %rsi
popq %rdi
- movq 5960(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5960(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28178,10 +28223,10 @@ GL_PREFIX(_dispatch_stub_745):
popq %rbp
popq %rsi
popq %rdi
- movq 5960(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_745), .-GL_PREFIX(_dispatch_stub_745)
+ .size GL_PREFIX(_dispatch_stub_746), .-GL_PREFIX(_dispatch_stub_746)
.p2align 4,,15
.globl GL_PREFIX(BindFramebufferEXT)
@@ -28189,7 +28234,7 @@ GL_PREFIX(_dispatch_stub_745):
GL_PREFIX(BindFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5968(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28199,13 +28244,13 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5968(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5968(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28215,7 +28260,7 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5968(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
@@ -28226,7 +28271,7 @@ GL_PREFIX(BindFramebufferEXT):
GL_PREFIX(BindRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5976(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28236,13 +28281,13 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5976(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28252,7 +28297,7 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
@@ -28263,25 +28308,25 @@ GL_PREFIX(BindRenderbufferEXT):
GL_PREFIX(CheckFramebufferStatusEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5984(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5984(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5984(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5984(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
@@ -28292,7 +28337,7 @@ GL_PREFIX(CheckFramebufferStatusEXT):
GL_PREFIX(DeleteFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5992(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28302,13 +28347,13 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5992(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5992(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28318,7 +28363,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5992(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
@@ -28329,7 +28374,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
GL_PREFIX(DeleteRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6000(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28339,13 +28384,13 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6000(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28355,7 +28400,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
@@ -28366,7 +28411,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
GL_PREFIX(FramebufferRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6008(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28380,13 +28425,13 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6008(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28400,7 +28445,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
@@ -28411,7 +28456,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
GL_PREFIX(FramebufferTexture1DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6016(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28425,13 +28470,13 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6016(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28445,7 +28490,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
@@ -28456,7 +28501,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
GL_PREFIX(FramebufferTexture2DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6024(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28470,13 +28515,13 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6024(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6024(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28490,7 +28535,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6024(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
@@ -28501,7 +28546,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
GL_PREFIX(FramebufferTexture3DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6032(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28519,13 +28564,13 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6032(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6032(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28543,7 +28588,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6032(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
@@ -28554,7 +28599,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
GL_PREFIX(GenFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6040(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28564,13 +28609,13 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6040(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6040(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28580,7 +28625,7 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6040(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
@@ -28591,7 +28636,7 @@ GL_PREFIX(GenFramebuffersEXT):
GL_PREFIX(GenRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6048(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28601,13 +28646,13 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6048(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6048(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28617,7 +28662,7 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 6048(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
@@ -28628,25 +28673,25 @@ GL_PREFIX(GenRenderbuffersEXT):
GL_PREFIX(GenerateMipmapEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6056(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 6056(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6056(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 6056(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
@@ -28657,7 +28702,7 @@ GL_PREFIX(GenerateMipmapEXT):
GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6064(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28671,13 +28716,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6064(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6064(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28691,7 +28736,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6064(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
@@ -28702,7 +28747,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
GL_PREFIX(GetRenderbufferParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6072(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28712,13 +28757,13 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6072(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6072(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28728,7 +28773,7 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6072(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
@@ -28739,25 +28784,25 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
GL_PREFIX(IsFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6080(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 6080(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6080(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 6080(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
@@ -28768,25 +28813,25 @@ GL_PREFIX(IsFramebufferEXT):
GL_PREFIX(IsRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6088(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 6088(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6088(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 6088(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
@@ -28797,7 +28842,7 @@ GL_PREFIX(IsRenderbufferEXT):
GL_PREFIX(RenderbufferStorageEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6096(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28811,13 +28856,13 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6096(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6096(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28831,19 +28876,19 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6096(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_763)
- .type GL_PREFIX(_dispatch_stub_763), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_763))
-GL_PREFIX(_dispatch_stub_763):
+ .globl GL_PREFIX(_dispatch_stub_764)
+ .type GL_PREFIX(_dispatch_stub_764), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_764))
+GL_PREFIX(_dispatch_stub_764):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6104(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28861,13 +28906,13 @@ GL_PREFIX(_dispatch_stub_763):
popq %rdx
popq %rsi
popq %rdi
- movq 6104(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6104(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28885,10 +28930,10 @@ GL_PREFIX(_dispatch_stub_763):
popq %rdx
popq %rsi
popq %rdi
- movq 6104(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_763), .-GL_PREFIX(_dispatch_stub_763)
+ .size GL_PREFIX(_dispatch_stub_764), .-GL_PREFIX(_dispatch_stub_764)
.p2align 4,,15
.globl GL_PREFIX(FramebufferTextureLayerEXT)
@@ -28896,7 +28941,7 @@ GL_PREFIX(_dispatch_stub_763):
GL_PREFIX(FramebufferTextureLayerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6112(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28910,13 +28955,13 @@ GL_PREFIX(FramebufferTextureLayerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6112(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6112(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28930,19 +28975,19 @@ GL_PREFIX(FramebufferTextureLayerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 6112(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_765)
- .type GL_PREFIX(_dispatch_stub_765), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_765))
-GL_PREFIX(_dispatch_stub_765):
+ .globl GL_PREFIX(_dispatch_stub_766)
+ .type GL_PREFIX(_dispatch_stub_766), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_766))
+GL_PREFIX(_dispatch_stub_766):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6120(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28956,13 +29001,13 @@ GL_PREFIX(_dispatch_stub_765):
popq %rdx
popq %rsi
popq %rdi
- movq 6120(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6120(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28976,19 +29021,19 @@ GL_PREFIX(_dispatch_stub_765):
popq %rdx
popq %rsi
popq %rdi
- movq 6120(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_765), .-GL_PREFIX(_dispatch_stub_765)
+ .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_766)
- .type GL_PREFIX(_dispatch_stub_766), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_766))
-GL_PREFIX(_dispatch_stub_766):
+ .globl GL_PREFIX(_dispatch_stub_767)
+ .type GL_PREFIX(_dispatch_stub_767), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_767))
+GL_PREFIX(_dispatch_stub_767):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6128(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -29002,13 +29047,13 @@ GL_PREFIX(_dispatch_stub_766):
popq %rdx
popq %rsi
popq %rdi
- movq 6128(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6128(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -29022,19 +29067,19 @@ GL_PREFIX(_dispatch_stub_766):
popq %rdx
popq %rsi
popq %rdi
- movq 6128(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_766), .-GL_PREFIX(_dispatch_stub_766)
+ .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_767)
- .type GL_PREFIX(_dispatch_stub_767), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_767))
-GL_PREFIX(_dispatch_stub_767):
+ .globl GL_PREFIX(_dispatch_stub_768)
+ .type GL_PREFIX(_dispatch_stub_768), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_768))
+GL_PREFIX(_dispatch_stub_768):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6136(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -29048,13 +29093,13 @@ GL_PREFIX(_dispatch_stub_767):
popq %rdx
popq %rsi
popq %rdi
- movq 6136(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6136(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -29068,19 +29113,19 @@ GL_PREFIX(_dispatch_stub_767):
popq %rdx
popq %rsi
popq %rdi
- movq 6136(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
+ .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_768)
- .type GL_PREFIX(_dispatch_stub_768), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_768))
-GL_PREFIX(_dispatch_stub_768):
+ .globl GL_PREFIX(_dispatch_stub_769)
+ .type GL_PREFIX(_dispatch_stub_769), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_769))
+GL_PREFIX(_dispatch_stub_769):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6144(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -29090,13 +29135,13 @@ GL_PREFIX(_dispatch_stub_768):
popq %rdx
popq %rsi
popq %rdi
- movq 6144(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6144(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -29106,19 +29151,19 @@ GL_PREFIX(_dispatch_stub_768):
popq %rdx
popq %rsi
popq %rdi
- movq 6144(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
+ .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_769)
- .type GL_PREFIX(_dispatch_stub_769), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_769))
-GL_PREFIX(_dispatch_stub_769):
+ .globl GL_PREFIX(_dispatch_stub_770)
+ .type GL_PREFIX(_dispatch_stub_770), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_770))
+GL_PREFIX(_dispatch_stub_770):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6152(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -29128,13 +29173,13 @@ GL_PREFIX(_dispatch_stub_769):
popq %rdx
popq %rsi
popq %rdi
- movq 6152(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6152(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -29144,10 +29189,10 @@ GL_PREFIX(_dispatch_stub_769):
popq %rdx
popq %rsi
popq %rdi
- movq 6152(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
+ .size GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770)
.globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
.globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
@@ -29402,7 +29447,26 @@ GL_PREFIX(_dispatch_stub_769):
.globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV)
.globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV)
.globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV)
- .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_745)
+ .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_746)
+ .globl GL_PREFIX(BindFramebuffer) ; .set GL_PREFIX(BindFramebuffer), GL_PREFIX(BindFramebufferEXT)
+ .globl GL_PREFIX(BindRenderbuffer) ; .set GL_PREFIX(BindRenderbuffer), GL_PREFIX(BindRenderbufferEXT)
+ .globl GL_PREFIX(CheckFramebufferStatus) ; .set GL_PREFIX(CheckFramebufferStatus), GL_PREFIX(CheckFramebufferStatusEXT)
+ .globl GL_PREFIX(DeleteFramebuffers) ; .set GL_PREFIX(DeleteFramebuffers), GL_PREFIX(DeleteFramebuffersEXT)
+ .globl GL_PREFIX(DeleteRenderbuffers) ; .set GL_PREFIX(DeleteRenderbuffers), GL_PREFIX(DeleteRenderbuffersEXT)
+ .globl GL_PREFIX(FramebufferRenderbuffer) ; .set GL_PREFIX(FramebufferRenderbuffer), GL_PREFIX(FramebufferRenderbufferEXT)
+ .globl GL_PREFIX(FramebufferTexture1D) ; .set GL_PREFIX(FramebufferTexture1D), GL_PREFIX(FramebufferTexture1DEXT)
+ .globl GL_PREFIX(FramebufferTexture2D) ; .set GL_PREFIX(FramebufferTexture2D), GL_PREFIX(FramebufferTexture2DEXT)
+ .globl GL_PREFIX(FramebufferTexture3D) ; .set GL_PREFIX(FramebufferTexture3D), GL_PREFIX(FramebufferTexture3DEXT)
+ .globl GL_PREFIX(GenFramebuffers) ; .set GL_PREFIX(GenFramebuffers), GL_PREFIX(GenFramebuffersEXT)
+ .globl GL_PREFIX(GenRenderbuffers) ; .set GL_PREFIX(GenRenderbuffers), GL_PREFIX(GenRenderbuffersEXT)
+ .globl GL_PREFIX(GenerateMipmap) ; .set GL_PREFIX(GenerateMipmap), GL_PREFIX(GenerateMipmapEXT)
+ .globl GL_PREFIX(GetFramebufferAttachmentParameteriv) ; .set GL_PREFIX(GetFramebufferAttachmentParameteriv), GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
+ .globl GL_PREFIX(GetRenderbufferParameteriv) ; .set GL_PREFIX(GetRenderbufferParameteriv), GL_PREFIX(GetRenderbufferParameterivEXT)
+ .globl GL_PREFIX(IsFramebuffer) ; .set GL_PREFIX(IsFramebuffer), GL_PREFIX(IsFramebufferEXT)
+ .globl GL_PREFIX(IsRenderbuffer) ; .set GL_PREFIX(IsRenderbuffer), GL_PREFIX(IsRenderbufferEXT)
+ .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT)
+ .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_764)
+ .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT)
#if defined(GLX_USE_TLS) && defined(__linux__)
.section ".note.ABI-tag", "a"
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index b99c2b6520..2e05a74ac6 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -712,23 +712,24 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(GetActiveAttribARB, _gloffset_GetActiveAttribARB, GetActiveAttribARB@28)
GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8)
+ GL_STUB(RenderbufferStorageMultisample, _gloffset_RenderbufferStorageMultisample, RenderbufferStorageMultisample@20)
GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8)
- GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8))
- GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8)
+ GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_563@8)
HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8))
- GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8)
+ GL_STUB(_dispatch_stub_564, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_564@8)
HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8))
- GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8)
+ GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_565@8)
HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8))
- GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8)
+ GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_566@8)
HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8))
- GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8)
+ GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_567@8)
HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8))
- GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8)
+ GL_STUB(_dispatch_stub_568, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_568@8)
HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8))
- GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4))
+ GL_STUB(_dispatch_stub_569, _gloffset_SampleMaskSGIS, _dispatch_stub_569@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@8))
+ GL_STUB(_dispatch_stub_570, _gloffset_SamplePatternSGIS, _dispatch_stub_570@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_570, _dispatch_stub_570@4))
GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20)
GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12)
GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16)
@@ -739,10 +740,10 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8)
GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8)
GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0)
- GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8))
- GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8)
+ GL_STUB(_dispatch_stub_581, _gloffset_CullParameterdvEXT, _dispatch_stub_581@8)
HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8))
+ GL_STUB(_dispatch_stub_582, _gloffset_CullParameterfvEXT, _dispatch_stub_582@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_582, _dispatch_stub_582@8))
GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12)
GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24)
@@ -767,8 +768,8 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4)
GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4)
GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4))
+ GL_STUB(_dispatch_stub_607, _gloffset_PixelTexGenSGIX, _dispatch_stub_607@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_607, _dispatch_stub_607@4))
GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0)
GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8)
@@ -810,24 +811,24 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4)
GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16)
GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4)
- GL_STUB(_dispatch_stub_648, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_648@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@20))
- GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_649@24)
- HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@24))
- GL_STUB(_dispatch_stub_650, _gloffset_DeleteFencesNV, _dispatch_stub_650@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8))
- GL_STUB(_dispatch_stub_651, _gloffset_FinishFenceNV, _dispatch_stub_651@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@4))
- GL_STUB(_dispatch_stub_652, _gloffset_GenFencesNV, _dispatch_stub_652@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8))
- GL_STUB(_dispatch_stub_653, _gloffset_GetFenceivNV, _dispatch_stub_653@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@12))
- GL_STUB(_dispatch_stub_654, _gloffset_IsFenceNV, _dispatch_stub_654@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4))
- GL_STUB(_dispatch_stub_655, _gloffset_SetFenceNV, _dispatch_stub_655@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@8))
- GL_STUB(_dispatch_stub_656, _gloffset_TestFenceNV, _dispatch_stub_656@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@4))
+ GL_STUB(_dispatch_stub_649, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_649@20)
+ HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@20))
+ GL_STUB(_dispatch_stub_650, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_650@24)
+ HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@24))
+ GL_STUB(_dispatch_stub_651, _gloffset_DeleteFencesNV, _dispatch_stub_651@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@8))
+ GL_STUB(_dispatch_stub_652, _gloffset_FinishFenceNV, _dispatch_stub_652@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@4))
+ GL_STUB(_dispatch_stub_653, _gloffset_GenFencesNV, _dispatch_stub_653@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@8))
+ GL_STUB(_dispatch_stub_654, _gloffset_GetFenceivNV, _dispatch_stub_654@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@12))
+ GL_STUB(_dispatch_stub_655, _gloffset_IsFenceNV, _dispatch_stub_655@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_655, _dispatch_stub_655@4))
+ GL_STUB(_dispatch_stub_656, _gloffset_SetFenceNV, _dispatch_stub_656@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_656, _dispatch_stub_656@8))
+ GL_STUB(_dispatch_stub_657, _gloffset_TestFenceNV, _dispatch_stub_657@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_657, _dispatch_stub_657@4))
GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12)
GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8)
GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8)
@@ -904,26 +905,26 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
- GL_STUB(_dispatch_stub_733, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_733@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@4))
- GL_STUB(_dispatch_stub_734, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_734@4)
+ GL_STUB(_dispatch_stub_734, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_734@4)
HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
- GL_STUB(_dispatch_stub_735, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_735@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8))
- GL_STUB(_dispatch_stub_736, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_736@8)
+ GL_STUB(_dispatch_stub_735, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_735@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@4))
+ GL_STUB(_dispatch_stub_736, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_736@8)
HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@8))
- GL_STUB(_dispatch_stub_737, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_737@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
+ GL_STUB(_dispatch_stub_737, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_737@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@8))
+ GL_STUB(_dispatch_stub_738, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_738@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
- GL_STUB(_dispatch_stub_744, _gloffset_DepthBoundsEXT, _dispatch_stub_744@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_744, _dispatch_stub_744@16))
- GL_STUB(_dispatch_stub_745, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_745@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@8))
+ GL_STUB(_dispatch_stub_745, _gloffset_DepthBoundsEXT, _dispatch_stub_745@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_745, _dispatch_stub_745@16))
+ GL_STUB(_dispatch_stub_746, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_746@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_746, _dispatch_stub_746@8))
GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -941,19 +942,19 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4)
GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4)
GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
- GL_STUB(_dispatch_stub_763, _gloffset_BlitFramebufferEXT, _dispatch_stub_763@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_763, _dispatch_stub_763@40))
+ GL_STUB(_dispatch_stub_764, _gloffset_BlitFramebufferEXT, _dispatch_stub_764@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_764, _dispatch_stub_764@40))
GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
- GL_STUB(_dispatch_stub_765, _gloffset_StencilFuncSeparateATI, _dispatch_stub_765@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@16))
- GL_STUB(_dispatch_stub_766, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_766@16)
+ GL_STUB(_dispatch_stub_766, _gloffset_StencilFuncSeparateATI, _dispatch_stub_766@16)
HIDDEN(GL_PREFIX(_dispatch_stub_766, _dispatch_stub_766@16))
- GL_STUB(_dispatch_stub_767, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_767@16)
+ GL_STUB(_dispatch_stub_767, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_767@16)
HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@16))
- GL_STUB(_dispatch_stub_768, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_768@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@12))
- GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_769@12)
+ GL_STUB(_dispatch_stub_768, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_768@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16))
+ GL_STUB(_dispatch_stub_769, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_769@12)
HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@12))
+ GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_770@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12))
GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
@@ -1269,6 +1270,24 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(IsProgramARB, _gloffset_IsProgramNV, IsProgramARB@4, IsProgramNV, IsProgramNV@4)
GL_STUB_ALIAS(PointParameteri, _gloffset_PointParameteriNV, PointParameteri@8, PointParameteriNV, PointParameteriNV@8)
GL_STUB_ALIAS(PointParameteriv, _gloffset_PointParameterivNV, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8)
+ GL_STUB_ALIAS(BindFramebuffer, _gloffset_BindFramebufferEXT, BindFramebuffer@8, BindFramebufferEXT, BindFramebufferEXT@8)
+ GL_STUB_ALIAS(BindRenderbuffer, _gloffset_BindRenderbufferEXT, BindRenderbuffer@8, BindRenderbufferEXT, BindRenderbufferEXT@8)
+ GL_STUB_ALIAS(CheckFramebufferStatus, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatus@4, CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
+ GL_STUB_ALIAS(DeleteFramebuffers, _gloffset_DeleteFramebuffersEXT, DeleteFramebuffers@8, DeleteFramebuffersEXT, DeleteFramebuffersEXT@8)
+ GL_STUB_ALIAS(DeleteRenderbuffers, _gloffset_DeleteRenderbuffersEXT, DeleteRenderbuffers@8, DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8)
+ GL_STUB_ALIAS(FramebufferRenderbuffer, _gloffset_FramebufferRenderbufferEXT, FramebufferRenderbuffer@16, FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16)
+ GL_STUB_ALIAS(FramebufferTexture1D, _gloffset_FramebufferTexture1DEXT, FramebufferTexture1D@20, FramebufferTexture1DEXT, FramebufferTexture1DEXT@20)
+ GL_STUB_ALIAS(FramebufferTexture2D, _gloffset_FramebufferTexture2DEXT, FramebufferTexture2D@20, FramebufferTexture2DEXT, FramebufferTexture2DEXT@20)
+ GL_STUB_ALIAS(FramebufferTexture3D, _gloffset_FramebufferTexture3DEXT, FramebufferTexture3D@24, FramebufferTexture3DEXT, FramebufferTexture3DEXT@24)
+ GL_STUB_ALIAS(GenFramebuffers, _gloffset_GenFramebuffersEXT, GenFramebuffers@8, GenFramebuffersEXT, GenFramebuffersEXT@8)
+ GL_STUB_ALIAS(GenRenderbuffers, _gloffset_GenRenderbuffersEXT, GenRenderbuffers@8, GenRenderbuffersEXT, GenRenderbuffersEXT@8)
+ GL_STUB_ALIAS(GenerateMipmap, _gloffset_GenerateMipmapEXT, GenerateMipmap@4, GenerateMipmapEXT, GenerateMipmapEXT@4)
+ GL_STUB_ALIAS(GetFramebufferAttachmentParameteriv, _gloffset_GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameteriv@16, GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16)
+ GL_STUB_ALIAS(GetRenderbufferParameteriv, _gloffset_GetRenderbufferParameterivEXT, GetRenderbufferParameteriv@12, GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12)
+ GL_STUB_ALIAS(IsFramebuffer, _gloffset_IsFramebufferEXT, IsFramebuffer@4, IsFramebufferEXT, IsFramebufferEXT@4)
+ GL_STUB_ALIAS(IsRenderbuffer, _gloffset_IsRenderbufferEXT, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4)
+ GL_STUB_ALIAS(RenderbufferStorage, _gloffset_RenderbufferStorageEXT, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16)
+ GL_STUB_ALIAS(FramebufferTextureLayer, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
GLOBL GLNAME(gl_dispatch_functions_end)
HIDDEN(GLNAME(gl_dispatch_functions_end))