summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-01-16 11:22:57 +0000
committerKeith Whitwell <[email protected]>2007-01-16 11:22:57 +0000
commit6a3fdc3a1ea6c306d9543791bf172dd1052d7382 (patch)
treec372c6daff13e435e79914c2e40dfe9d370c337b /src
parent0b412f8f156b46b0e7220a2b61e0f41781769f66 (diff)
parenta03fc8277180e2171519165a724849e2254ef0b7 (diff)
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa into vbo-0.2
Conflicts: src/mesa/array_cache/sources src/mesa/drivers/dri/i965/brw_context.c src/mesa/drivers/dri/i965/brw_draw.c src/mesa/drivers/dri/i965/brw_fallback.c src/mesa/drivers/dri/i965/brw_vs_emit.c src/mesa/drivers/dri/i965/brw_vs_tnl.c src/mesa/drivers/dri/mach64/mach64_context.c src/mesa/main/extensions.c src/mesa/main/getstring.c src/mesa/tnl/sources src/mesa/tnl/t_save_api.c src/mesa/tnl/t_save_playback.c src/mesa/tnl/t_vtx_api.c src/mesa/tnl/t_vtx_exec.c src/mesa/vbo/vbo_attrib.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_api.c src/mesa/vbo/vbo_save_draw.c
Diffstat (limited to 'src')
-rw-r--r--src/egl/docs/EGL_MESA_screen_surface28
-rw-r--r--src/glu/sgi/libutil/mipmap.c44
-rw-r--r--src/glut/directfb/ext.c7
-rw-r--r--src/glut/directfb/internal.h3
-rw-r--r--src/glut/fbdev/callback.c5
-rw-r--r--src/glut/fbdev/colormap.c9
-rw-r--r--src/glut/fbdev/cursor.c24
-rw-r--r--src/glut/fbdev/ext.c2
-rw-r--r--src/glut/fbdev/fbdev.c89
-rw-r--r--src/glut/fbdev/gamemode.c1
-rw-r--r--src/glut/fbdev/input.c348
-rw-r--r--src/glut/fbdev/internal.h12
-rw-r--r--src/glut/fbdev/menu.c4
-rw-r--r--src/glut/fbdev/overlay.c1
-rw-r--r--src/glut/fbdev/state.c1
-rw-r--r--src/glx/mini/miniglx.c16
-rw-r--r--src/glx/x11/.gitignore1
-rw-r--r--src/glx/x11/XF86dri.c4
-rw-r--r--src/glx/x11/glxcmds.c3
-rw-r--r--src/glx/x11/glxext.c128
-rw-r--r--src/glx/x11/indirect.c2
-rw-r--r--src/glx/x11/indirect_vertex_array.c12
-rw-r--r--src/mesa/.gitignore2
-rw-r--r--src/mesa/Makefile4
-rw-r--r--src/mesa/array_cache/sources7
-rw-r--r--src/mesa/drivers/directfb/idirectfbgl_mesa.c187
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c30
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.h7
-rw-r--r--src/mesa/drivers/dri/common/extension_helper.h600
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/.gitignore5
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/Makefile2
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/options.h69
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/sv.po226
-rw-r--r--src/mesa/drivers/dri/i915/i830_metaops.c2
-rw-r--r--src/mesa/drivers/dri/i915/i830_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c13
-rw-r--r--src/mesa/drivers/dri/i915/i915_program.c5
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c1
-rw-r--r--src/mesa/drivers/dri/i915tex/Makefile5
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_context.h5
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_metaops.c32
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_state.c5
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_texstate.c32
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c91
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_context.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_context.h1
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_fragprog.c13
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_program.c7
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_state.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_tex.c35
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_tex_layout.c56
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_vtbl.c1
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_batchbuffer.c16
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.c35
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.h3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c49
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.c22
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h2
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c14
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h2
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel.c5
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_copy.c11
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_draw.c14
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_read.c8
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_regions.c11
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_screen.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex.c56
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex.h14
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_copy.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_format.c26
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_image.c132
l---------src/mesa/drivers/dri/i915tex/intel_tex_layout.c1
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_subimage.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_validate.c25
-rw-r--r--src/mesa/drivers/dri/i915tex/server/i830_common.h8
-rw-r--r--src/mesa/drivers/dri/i915tex/server/i830_dri.h42
-rw-r--r--src/mesa/drivers/dri/i915tex/server/intel.h5
-rw-r--r--src/mesa/drivers/dri/i915tex/server/intel_dri.c81
-rw-r--r--src/mesa/drivers/dri/i965/Makefile5
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c1
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h11
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c155
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_metaops.c97
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_structs.h22
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex.c32
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex_layout.c55
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_tnl.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c1
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c49
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_fp.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c6
-rw-r--r--src/mesa/drivers/dri/i965/bufmgr.h2
-rw-r--r--src/mesa/drivers/dri/i965/bufmgr_fake.c18
-rw-r--r--src/mesa/drivers/dri/i965/intel_blit.c42
-rw-r--r--src/mesa/drivers/dri/i965/intel_blit.h3
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c51
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.h8
-rw-r--r--src/mesa/drivers/dri/i965/intel_ioctl.c37
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_copy.c113
-rw-r--r--src/mesa/drivers/dri/i965/intel_regions.c3
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c6
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.h1
l---------src/mesa/drivers/dri/i965/intel_tex_layout.c1
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_validate.c3
-rw-r--r--src/mesa/drivers/dri/i965/server/i830_common.h19
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_layout.c102
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_layout.h41
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.c76
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.h57
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_lock.c7
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.c131
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.h10
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texmem.c655
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texstate.c135
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tris.c17
-rw-r--r--src/mesa/drivers/dri/mga/mgastate.c12
-rw-r--r--src/mesa/drivers/dri/mga/mgatex.c3
-rw-r--r--src/mesa/drivers/dri/nouveau/Makefile50
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c272
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h27
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_buffers.c434
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_buffers.h48
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_card.c17
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_card.h49
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_card_list.h230
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c366
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.h227
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_ctrlreg.h44
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_dri.h28
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_driver.c146
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_driver.h42
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.c137
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.h156
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_lock.c81
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_lock.h69
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_msg.h67
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_object.c92
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_object.h41
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_reg.h1505
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.c376
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.h61
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader.c798
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader.h374
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_0_arb.c710
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_1.c318
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_2.c243
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_span.c125
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_span.h39
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state.c341
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state.h48
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state_cache.c69
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state_cache.h29
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_swtcl.c127
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_swtcl.h55
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_sync.c136
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_sync.h36
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_tex.c49
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_tex.h38
-rw-r--r--src/mesa/drivers/dri/nouveau/nv04_swtcl.c570
-rw-r--r--src/mesa/drivers/dri/nouveau/nv04_swtcl.h12
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c746
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_swtcl.c569
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_swtcl.h40
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_shader.h121
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_state.c662
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_vertprog.c447
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_fragprog.c716
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_shader.h379
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_state.c901
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_vertprog.c353
-rw-r--r--src/mesa/drivers/dri/nouveau/nv40_fragprog.c152
-rw-r--r--src/mesa/drivers/dri/nouveau/nv40_shader.h467
-rw-r--r--src/mesa/drivers/dri/nouveau/nv40_vertprog.c685
-rw-r--r--src/mesa/drivers/dri/r128/r128_span.c8
-rw-r--r--src/mesa/drivers/dri/r200/.gitignore3
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c27
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h9
-rw-r--r--src/mesa/drivers/dri/r200/r200_fragshader.c43
-rw-r--r--src/mesa/drivers/dri/r200/r200_lock.c14
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c191
-rw-r--r--src/mesa/drivers/dri/r200/r200_sanity.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c35
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c7
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c104
-rw-r--r--src/mesa/drivers/dri/r300/.gitignore3
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h26
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c928
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.h3
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog_swz.c1328
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c14
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.h1
-rw-r--r--src/mesa/drivers/dri/r300/r300_maos.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_shader.c17
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c82
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertexprog.c488
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.c9
-rw-r--r--src/mesa/drivers/dri/r300/radeon_mm.c2
-rw-r--r--src/mesa/drivers/dri/r300/radeon_state.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c1
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c4
-rw-r--r--src/mesa/drivers/dri/savage/savage_init.h13
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c63
-rw-r--r--src/mesa/drivers/dri/savage/savagedd.c19
-rw-r--r--src/mesa/drivers/dri/savage/savagespan.c6
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c11
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c28
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.h12
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_dd.c134
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_lock.c23
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_pixels.c12
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c14
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_span.c29
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_tex.c2
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_texstate.c5
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.c1
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c146
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.h33
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c34
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c1
-rw-r--r--src/mesa/drivers/dri/unichrome/via_span.c10
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c14
-rw-r--r--src/mesa/drivers/ggi/default/.gitignore (renamed from src/mesa/drivers/ggi/default/.cvsignore)0
-rw-r--r--src/mesa/drivers/ggi/display/.gitignore (renamed from src/mesa/drivers/ggi/display/.cvsignore)0
-rw-r--r--src/mesa/drivers/x11/xm_span.c8
-rw-r--r--src/mesa/glapi/.gitignore (renamed from src/mesa/glapi/.cvsignore)0
-rw-r--r--src/mesa/glapi/Makefile10
-rw-r--r--src/mesa/glapi/dispatch.h825
-rw-r--r--src/mesa/glapi/glX_XML.py4
-rw-r--r--src/mesa/glapi/glX_proto_recv.py21
-rw-r--r--src/mesa/glapi/glX_proto_size.py12
-rw-r--r--src/mesa/glapi/gl_API.dtd4
-rw-r--r--src/mesa/glapi/gl_API.xml722
-rw-r--r--src/mesa/glapi/gl_XML.py5
-rw-r--r--src/mesa/glapi/gl_enums.py2
-rw-r--r--src/mesa/glapi/gl_procs.py10
-rw-r--r--src/mesa/glapi/gl_x86-64_asm.py1
-rw-r--r--src/mesa/glapi/gl_x86_asm.py1
-rw-r--r--src/mesa/glapi/glapioffsets.h730
-rw-r--r--src/mesa/glapi/glapitable.h709
-rw-r--r--src/mesa/glapi/glapitemp.h784
-rw-r--r--src/mesa/glapi/glprocs.h1372
-rw-r--r--src/mesa/glapi/glthread.h8
-rw-r--r--src/mesa/glapi/sources9
-rw-r--r--src/mesa/main/api_arrayelt.c113
-rw-r--r--src/mesa/main/api_arrayelt.h5
-rw-r--r--src/mesa/main/api_loopback.c2
-rw-r--r--src/mesa/main/attrib.c23
-rw-r--r--src/mesa/main/buffers.c3
-rw-r--r--src/mesa/main/config.h9
-rw-r--r--src/mesa/main/context.c13
-rw-r--r--src/mesa/main/context.h8
-rw-r--r--src/mesa/main/dlist.c4
-rw-r--r--src/mesa/main/enable.c91
-rw-r--r--src/mesa/main/enums.c5939
-rw-r--r--src/mesa/main/extensions.c6
-rw-r--r--src/mesa/main/get.c9
-rw-r--r--src/mesa/main/get_gen.py1
-rw-r--r--src/mesa/main/getstring.c16
-rw-r--r--src/mesa/main/glheader.h12
-rw-r--r--src/mesa/main/image.c6
-rw-r--r--src/mesa/main/imports.c222
-rw-r--r--src/mesa/main/imports.h28
-rw-r--r--src/mesa/main/light.c14
-rw-r--r--src/mesa/main/lines.c23
-rw-r--r--src/mesa/main/matrix.c2
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/points.c14
-rw-r--r--src/mesa/main/polygon.c39
-rw-r--r--src/mesa/main/polygon.h7
-rw-r--r--src/mesa/main/rastpos.c1
-rw-r--r--src/mesa/main/sources76
-rw-r--r--src/mesa/main/state.c136
-rw-r--r--src/mesa/main/stencil.c8
-rw-r--r--src/mesa/main/texcompress_fxt1.c4
-rw-r--r--src/mesa/main/texenvprogram.c2
-rw-r--r--src/mesa/main/teximage.c6
-rw-r--r--src/mesa/main/texstore.c4
-rw-r--r--src/mesa/math/sources16
-rw-r--r--src/mesa/shader/arbprogparse.c19
-rw-r--r--src/mesa/shader/arbprogram.c41
-rw-r--r--src/mesa/shader/arbprogram.h8
-rw-r--r--src/mesa/shader/atifragshader.c2
-rw-r--r--src/mesa/shader/descrip.mms7
-rw-r--r--src/mesa/shader/grammar/sources6
-rw-r--r--src/mesa/shader/nvfragparse.c8
-rw-r--r--src/mesa/shader/nvprogram.c21
-rw-r--r--src/mesa/shader/program.c145
-rw-r--r--src/mesa/shader/program.h24
-rw-r--r--src/mesa/shader/program_instruction.h7
-rw-r--r--src/mesa/shader/programopt.c2
-rw-r--r--src/mesa/shader/shaderobjects.c1723
-rw-r--r--src/mesa/shader/shaderobjects.h75
-rwxr-xr-xsrc/mesa/shader/shaderobjects_3dlabs.c2598
-rw-r--r--src/mesa/shader/slang/slang_assemble.c2473
-rw-r--r--src/mesa/shader/slang/slang_assemble.h288
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.c184
-rw-r--r--src/mesa/shader/slang/slang_assemble_assignment.h17
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.c628
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.h45
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.c1036
-rw-r--r--src/mesa/shader/slang/slang_assemble_typeinfo.h138
-rw-r--r--src/mesa/shader/slang/slang_compile.c3152
-rw-r--r--src/mesa/shader/slang/slang_compile_function.c252
-rw-r--r--src/mesa/shader/slang/slang_compile_function.h80
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c125
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.h173
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.c574
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.h119
-rw-r--r--src/mesa/shader/slang/slang_execute.c1032
-rw-r--r--src/mesa/shader/slang/slang_execute.h66
-rw-r--r--src/mesa/shader/slang/slang_execute_x86.c1114
-rw-r--r--src/mesa/shader/slang/slang_link.h115
-rw-r--r--src/mesa/shader/slang/slang_preprocess.c8
-rw-r--r--src/mesa/shader/slang/slang_utility.c125
-rw-r--r--src/mesa/shader/slang/sources23
-rw-r--r--src/mesa/shader/sources17
-rw-r--r--src/mesa/sparc/glapi_sparc.S235
-rw-r--r--src/mesa/swrast/s_arbshader.c22
-rw-r--r--src/mesa/swrast/s_context.c12
-rw-r--r--src/mesa/swrast/s_linetemp.h11
-rw-r--r--src/mesa/swrast/s_nvfragprog.c53
-rw-r--r--src/mesa/swrast/s_pointtemp.h6
-rw-r--r--src/mesa/swrast/s_readpix.c2
-rw-r--r--src/mesa/swrast/sources35
-rw-r--r--src/mesa/swrast_setup/sources7
-rw-r--r--src/mesa/tnl/sources15
-rw-r--r--src/mesa/tnl/t_context.c5
-rw-r--r--src/mesa/tnl/t_save_api.c1741
-rw-r--r--src/mesa/tnl/t_save_playback.c216
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c2
-rw-r--r--src/mesa/tnl/t_vp_build.c4
-rw-r--r--src/mesa/tnl/t_vtx_api.c1046
-rw-r--r--src/mesa/tnl/t_vtx_exec.c293
-rw-r--r--src/mesa/vbo/vbo_attrib.h1
-rw-r--r--src/mesa/vbo/vbo_save_api.c11
-rw-r--r--src/mesa/vbo/vbo_save_draw.c17
-rw-r--r--src/mesa/vbo/vbo_split_copy.c15
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S3879
-rw-r--r--src/mesa/x86/glapi_x86.S217
348 files changed, 41491 insertions, 18621 deletions
diff --git a/src/egl/docs/EGL_MESA_screen_surface b/src/egl/docs/EGL_MESA_screen_surface
index 3a11da7ac9b..6beb4ce88e2 100644
--- a/src/egl/docs/EGL_MESA_screen_surface
+++ b/src/egl/docs/EGL_MESA_screen_surface
@@ -18,7 +18,7 @@ Status
Version
- 10 (10 August 2005)
+ 11 (27 January 2006)
Number
@@ -127,22 +127,8 @@ Issues
isn't always reliable (consider video projectors) but can still be
used to determine the pixel aspect ratio.
- Arguments for:
-
- X supports a similar query with DisplayWidthMM(), DisplayHeightMM().
- If this information can be easily queried with EDID, why not
- make it available to the user?
-
- Arguments against:
-
- Historically, these values aren't always accurate. Also, they're
- not always applicable to the display device.
-
- Other options:
-
- Perhaps just a pixel aspect ratio should be supported. [M. Danzer]
-
- Postpone for a future extension, if needed. [A. Jackson]
+ Resolution: Omit. The EGL 1.2 specification includes queries for
+ the display resolution and pixel aspect ratio.
6. Should detailed mode timing information be exposed by this API?
@@ -222,7 +208,7 @@ Issues
14. What if the physical screen size can't be determined? Should
a query of EGL_PHYSICAL_SIZE_MESA return [0,0]?
- TBD.
+ Obsolete: EGL_PHYSICAL_SIZE_MESA not used.
15. Suppose the device's number of RAMDACs is different from the
@@ -317,7 +303,6 @@ New Tokens
EGL_SCREEN_COUNT_MESA
EGL_SCREEN_POSITION_MESA
- EGL_PHYSICAL_SIZE_MESA
EGL_SCREEN_BIT_MESA
EGL_SCREEN_POSITION_GRANULARITY_MESA
@@ -488,8 +473,6 @@ Additions to Chapter X of the EGL 1.1 Specification
EGL_SCREEN_POSITION_GRANULARITY_MESA
Returns the granularity, in pixels, for
which the screen position is constrained.
- EGL_PHYSICAL_SIZE_MESA Physical width and height of the screen
- in millimeters
Any other token will generate the error EGL_BAD_ATTRIBUTE.
@@ -576,3 +559,6 @@ Version History
10. 10 August 2005 - BrianP
Added EGL_SCREEN_POSITION_GRANULARITY_MESA.
+ 11. 27 January 2006 - BrianP
+ EGL_PHYSICAL_SIZE_MESA removed since EGL 1.2 has a similar feature.
+
diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index 5c28c858ec6..44f519a4e21 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -377,6 +377,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLubyte *s;
const char *t;
@@ -390,6 +391,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -405,6 +407,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -476,6 +479,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLbyte *s;
const char *t;
@@ -489,6 +493,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -504,6 +509,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -573,6 +579,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLushort *s;
const char *t;
@@ -586,6 +593,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -602,6 +610,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -616,6 +625,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -708,6 +718,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLshort *s;
const char *t;
@@ -721,6 +732,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -737,6 +749,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -758,6 +771,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -850,6 +864,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLuint *s;
const char *t;
@@ -863,6 +878,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -881,6 +897,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -899,6 +916,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -990,6 +1008,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLint *s;
const char *t;
@@ -1003,6 +1022,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -1019,6 +1039,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -1041,6 +1062,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -1134,6 +1156,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLfloat *s;
const char *t;
@@ -1147,6 +1170,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
@@ -1163,6 +1187,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
@@ -1183,6 +1208,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
@@ -3845,10 +3871,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
if (width == newwidth && height == newheight) {
/* Use usersImage for level userLevel */
if (baseLevel <= level && level <= maxLevel) {
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
glTexImage2D(target, level, internalFormat, width,
height, 0, format, type,
usersImage);
}
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
if(levels == 0) { /* we're done. clean up and return */
glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
@@ -8643,7 +8671,8 @@ static void halveImageSlice(int components,
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *)dataIn;
- int padBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
assert((width == 1 || height == 1) && depth >= 2);
@@ -8727,7 +8756,7 @@ static void halveImageSlice(int components,
/* skip over to next horizontal square of 4 */
src+= groupSizeInBytes;
} /* for jj */
- src+= padBytes;
+ src+= rowPadBytes;
src+= rowSizeInBytes;
} /* for ii */
@@ -8772,11 +8801,12 @@ static void halveImageSlice(int components,
src+= elementSizeInBytes;
} /* for cc */
- src+= padBytes;
+ src+= rowPadBytes;
/* skip over to next vertical square of 4 */
src+= rowSizeInBytes;
} /* for jj */
+ src+= imagePadBytes;
src+= imageSizeInBytes;
} /* for ii */
@@ -8816,7 +8846,8 @@ static void halveImage3D(int components,
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
for (dd= 0; dd < halfDepth; dd++) {
@@ -8872,7 +8903,7 @@ static void halveImage3D(int components,
src+= groupSizeInBytes;
} /* for jj */
/* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
+ src+= rowPadBytes;
/* src is at beginning of a row here, but it's the second row of
* the square block of 4 pixels that we just worked on so we
@@ -8887,6 +8918,9 @@ static void halveImage3D(int components,
src+= rowSizeInBytes;
} /* for ii */
+ /* skip past pad bytes, if any, to get to next image */
+ src+= imagePadBytes;
+
src+= imageSizeInBytes;
} /* for dd */
diff --git a/src/glut/directfb/ext.c b/src/glut/directfb/ext.c
index d7338ce5f7b..e37ecf5afad 100644
--- a/src/glut/directfb/ext.c
+++ b/src/glut/directfb/ext.c
@@ -156,6 +156,13 @@ glutGetProcAddress( const char *name )
return glut_functions[i].address;
}
+#if DIRECTFBGL_INTERFACE_VERSION >= 1
+ if (g_current) {
+ void *address = NULL;
+ g_current->gl->GetProcAddress( g_current->gl, name, &address );
+ return address;
+ }
+#endif
return NULL;
}
diff --git a/src/glut/directfb/internal.h b/src/glut/directfb/internal.h
index 2e986c9f286..bc3e20e93e7 100644
--- a/src/glut/directfb/internal.h
+++ b/src/glut/directfb/internal.h
@@ -26,8 +26,9 @@
#include <directfb.h>
#include <directfb_version.h>
+#include <directfbgl.h>
+
#include "GL/glut.h"
-#include "GL/directfbgl.h"
#define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r)))
diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c
index 37373672d36..8c039f530be 100644
--- a/src/glut/fbdev/callback.c
+++ b/src/glut/fbdev/callback.c
@@ -24,6 +24,8 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdlib.h>
+
#include <GL/glut.h>
#include "internal.h"
@@ -72,19 +74,16 @@ void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y))
void glutMouseFunc(void (*func)(int button, int state, int x, int y))
{
- MouseEnabled = 1;
MouseFunc = func;
}
void glutMotionFunc(void (*func)(int x, int y))
{
- MouseEnabled = 1;
MotionFunc = func;
}
void glutPassiveMotionFunc(void (*func)(int x, int y))
{
- MouseEnabled = 1;
PassiveMotionFunc = func;
}
diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c
index 89556ef4a5c..3e72a7b0513 100644
--- a/src/glut/fbdev/colormap.c
+++ b/src/glut/fbdev/colormap.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
#include <stdlib.h>
#include <linux/fb.h>
@@ -37,7 +38,7 @@
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1))
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1)
-static struct fb_cmap ColorMap;
+static struct fb_cmap ColorMap, OriginalColorMap;
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256];
@@ -91,12 +92,18 @@ static void FillReverseColorMap(void)
void RestoreColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0)
sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n");
}
void LoadColorMap(void)
{
+ if(FixedInfo.visual == FB_VISUAL_TRUECOLOR)
+ return;
+
ColorMap.start = 0;
ColorMap.red = RedColorMap;
ColorMap.green = GreenColorMap;
diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c
index 88386956a44..4bb2b7fba01 100644
--- a/src/glut/fbdev/cursor.c
+++ b/src/glut/fbdev/cursor.c
@@ -28,8 +28,10 @@
to render the cursor, this is faster, it would be good to use a hardware
cursor if it exists instead */
+#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
+#include <string.h>
#include <linux/fb.h>
@@ -64,6 +66,9 @@ void EraseCursor(void)
unsigned char *src = MouseBuffer;
+ if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
+ return;
+
for(i = 0; i<CURSOR_HEIGHT; i++) {
memcpy(BackBuffer + off, src, stride);
src += stride;
@@ -108,7 +113,7 @@ void DrawCursor(void)
unsigned char *c;
const unsigned char *d;
- if(CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
+ if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS)
return;
px = MouseX - CursorsXOffset[CurrentCursor];
@@ -210,10 +215,12 @@ void SwapCursor(void)
int miny = MIN(py, LastMouseY);
int sizey = abs(py - LastMouseY);
- DrawCursor();
- /* now update the portion of the screen that has changed */
+ if(MouseVisible)
+ DrawCursor();
- if(DisplayMode & GLUT_DOUBLE && (sizex || sizey)) {
+ /* now update the portion of the screen that has changed, this is also
+ used to hide the mouse if MouseVisible is 0 */
+ if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) {
int off, stride, i;
if(minx < 0)
minx = 0;
@@ -228,7 +235,7 @@ void SwapCursor(void)
+ minx * VarInfo.bits_per_pixel / 8;
stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8;
- for(i = 0; i< sizey + CURSOR_HEIGHT; i++) {
+ for(i = 0; i < sizey + CURSOR_HEIGHT; i++) {
memcpy(FrameBuffer+off, BackBuffer+off, stride);
off += FixedInfo.line_length;
}
@@ -258,11 +265,8 @@ void glutSetCursor(int cursor)
if(cursor == GLUT_CURSOR_FULL_CROSSHAIR)
cursor = GLUT_CURSOR_CROSSHAIR;
- if(CurrentCursor >= 0 && CurrentCursor < NUM_CURSORS)
- EraseCursor();
-
+ EraseCursor();
+ MouseVisible = 1;
CurrentCursor = cursor;
-
- MouseEnabled = 1;
SwapCursor();
}
diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c
index 4a3c185a16d..65953e705b9 100644
--- a/src/glut/fbdev/ext.c
+++ b/src/glut/fbdev/ext.c
@@ -24,6 +24,8 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
+
#include <GL/gl.h>
#include <GL/glut.h>
diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c
index ce6419816dd..3b63cd70ea1 100644
--- a/src/glut/fbdev/fbdev.c
+++ b/src/glut/fbdev/fbdev.c
@@ -74,6 +74,7 @@ int Redisplay;
int Visible;
int VisibleSwitch;
int Active;
+static int Resized;
/* we have to poll to see if we are visible
on a framebuffer that is not active */
int VisiblePoll;
@@ -127,8 +128,10 @@ static void Cleanup(void)
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
strerror(errno));
- munmap(FrameBuffer, FixedInfo.smem_len);
+ if(FrameBuffer)
+ munmap(FrameBuffer, FixedInfo.smem_len);
close(FrameBufferFD);
+
}
/* free allocated back buffer */
@@ -424,6 +427,8 @@ static void ProcessTimers(void)
void glutMainLoop(void)
{
+ int idleiters;
+
if(ReshapeFunc)
ReshapeFunc(VarInfo.xres, VarInfo.yres);
@@ -440,8 +445,6 @@ void glutMainLoop(void)
else
if(VisiblePoll)
TestVisible();
- else
- usleep(1);
if(IdleFunc)
IdleFunc();
@@ -452,17 +455,48 @@ void glutMainLoop(void)
VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE);
}
+ if(Resized) {
+ SetVideoMode();
+ CreateBuffer();
+
+ if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) {
+ sprintf(exiterror, "Failure to Make Current\n");
+ exit(0);
+ }
+
+ InitializeMenus();
+
+ if(ReshapeFunc)
+ ReshapeFunc(VarInfo.xres, VarInfo.yres);
+
+ Redisplay = 1;
+ Resized = 0;
+ }
+
if(Visible && Redisplay) {
Redisplay = 0;
- if(MouseEnabled)
- EraseCursor();
+ EraseCursor();
DisplayFunc();
if(!(DisplayMode & GLUT_DOUBLE)) {
if(ActiveMenu)
DrawMenus();
- if(MouseEnabled)
- DrawCursor();
+ DrawCursor();
}
+ idleiters = 0;
+ } else {
+ /* we sleep if not receiving redisplays, and
+ the main loop is running faster than 2khz */
+
+ static int lasttime;
+ int time = glutGet(GLUT_ELAPSED_TIME);
+ if(time > lasttime) {
+ if(idleiters >= 2)
+ usleep(100);
+
+ idleiters = 0;
+ lasttime = time;
+ }
+ idleiters++;
}
}
}
@@ -536,17 +570,16 @@ int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf)
return 0;
}
-/* ---------- Window Management ----------*/
void SetVideoMode(void)
{
/* set new variable screen info */
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
- sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
- strerror(errno));
+ sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno));
+ strcat(exiterror, "Perhaps the device does not support the selected mode\n");
exit(0);
}
- /* reload the screen info to update offsets */
+ /* reload the screen info to update rgb bits */
if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) {
sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
strerror(errno));
@@ -574,7 +607,7 @@ void SetVideoMode(void)
LoadColorMap();
}
-void CreateBuffer()
+void CreateBuffer(void)
{
int size = VarInfo.xres_virtual * VarInfo.yres_virtual
* VarInfo.bits_per_pixel / 8;
@@ -673,20 +706,6 @@ void CreateVisual(void)
}
}
-static void ResizeVisual(void)
-{
- if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) {
- sprintf(exiterror, "Failure to Make Current\n");
- exit(0);
- }
-
- InitializeMenus();
-
- if(ReshapeFunc)
- ReshapeFunc(VarInfo.xres, VarInfo.yres);
- Redisplay = 1;
-}
-
static void SignalWinch(int arg)
{
/* we can't change bitdepth without destroying the visual */
@@ -708,10 +727,7 @@ static void SignalWinch(int arg)
VarInfo.blue = blue;
VarInfo.transp = transp;
- SetVideoMode();
- CreateBuffer();
-
- ResizeVisual();
+ Resized = 1;
}
int glutCreateWindow (const char *title)
@@ -786,6 +802,7 @@ void glutDestroyWindow(int win)
glFBDevDestroyContext(Context);
glFBDevDestroyBuffer(Buffer);
glFBDevDestroyVisual(Visual);
+
Visual = NULL;
}
@@ -803,12 +820,14 @@ void glutSwapBuffers(void)
{
glFlush();
+ if(!(DisplayMode & GLUT_DOUBLE))
+ return;
+
if(ActiveMenu)
DrawMenus();
- if(MouseEnabled)
- DrawCursor();
+ DrawCursor();
- if(DisplayMode & GLUT_DOUBLE && Visible) {
+ if(Visible) {
Swapping = 1;
glFBDevSwapBuffers(Buffer);
Swapping = 0;
@@ -837,10 +856,8 @@ void glutReshapeWindow(int width, int height)
signal(SIGWINCH, SIG_IGN);
SetVideoMode();
- CreateBuffer();
-
- ResizeVisual();
signal(SIGWINCH, SignalWinch);
+ Resized = 1;
}
void glutFullScreen(void)
diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c
index 9f32d9d7e82..30be36af7af 100644
--- a/src/glut/fbdev/gamemode.c
+++ b/src/glut/fbdev/gamemode.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c
index 2528a74a105..1445682c760 100644
--- a/src/glut/fbdev/input.c
+++ b/src/glut/fbdev/input.c
@@ -53,7 +53,7 @@
int GpmMouse;
#endif
-int CurrentVT;
+int CurrentVT = 0;
int ConsoleFD = -1;
int KeyboardModifiers;
@@ -65,8 +65,8 @@ double MouseSpeed = 0;
int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT;
-/* only display the mouse if there is a registered callback for it */
-int MouseEnabled = 0;
+int MouseVisible = 0;
+int LastMouseTime = 0;
static int OldKDMode = -1;
static int OldMode = KD_TEXT;
@@ -79,6 +79,8 @@ static int MouseFD;
static int kbdpipe[2];
+static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1;
+
#define MODIFIER(mod) \
KeyboardModifiers = release ? KeyboardModifiers & ~mod \
: KeyboardModifiers | mod;
@@ -93,7 +95,6 @@ static void KeyboardHandler(int sig)
unsigned char code;
while(read(ConsoleFD, &code, 1) == 1) {
-
int release, labelval;
struct kbentry entry;
static int lalt; /* only left alt does vt switch */
@@ -163,10 +164,46 @@ static void LedModifier(int led, int release)
KeyboardLedState ^= led;
releaseflag &= ~led;
}
+
ioctl(ConsoleFD, KDSKBLED, KeyboardLedState);
ioctl(ConsoleFD, KDSETLED, 0x80);
}
+static void HandleKeyPress(unsigned char key, int up)
+{
+ if(up) {
+ if(KeyboardUpFunc)
+ KeyboardUpFunc(key, MouseX, MouseY);
+ } else
+ if(KeyboardFunc)
+ KeyboardFunc(key, MouseX, MouseY);
+ else
+ if(key == 27)
+ exit(0); /* no handler, to provide a way to exit */
+}
+
+static void HandleSpecialPress(int key, int up)
+{
+ if(up) {
+ if(SpecialUpFunc)
+ SpecialUpFunc(key, MouseX, MouseY);
+ } else
+ if(SpecialFunc)
+ SpecialFunc(key, MouseX, MouseY);
+}
+
+static void ReleaseStdinKey(void)
+{
+ if(LastStdinSpecialKey != -1) {
+ HandleSpecialPress(LastStdinSpecialKey, 1);
+ LastStdinSpecialKey = -1;
+ }
+ if(LastStdinCode != -1) {
+ HandleKeyPress(LastStdinCode, 1);
+ LastStdinCode = -1;
+ }
+}
+
#define READKEY read(kbdpipe[0], &code, 1)
static int ReadKey(void)
{
@@ -175,8 +212,14 @@ static int ReadKey(void)
int specialkey = 0;
struct kbentry entry;
- if(READKEY != 1)
+ if(READKEY != 1) {
+ /* if we are reading from stdin, we detect key releases when the key
+ does not repeat after a given timeout */
+ if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME))
+ ReleaseStdinKey();
return 0;
+ }
+
if(code == 0)
return 0;
@@ -185,65 +228,82 @@ static int ReadKey(void)
KeyboardModifiers = 0;
altset:
if(code == 27 && READKEY == 1) {
- switch(code) {
- case 79: /* function key */
- READKEY;
- if(code == 50) {
- READKEY;
- shiftfunc:
- KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
- specialkey = GLUT_KEY_F1 + code - 53;
- READKEY;
- } else {
- READKEY;
- specialkey = GLUT_KEY_F1 + code - 80;
- }
- break;
- case 91:
- READKEY;
- switch(code) {
- case 68:
- specialkey = GLUT_KEY_LEFT; break;
- case 65:
- specialkey = GLUT_KEY_UP; break;
- case 67:
- specialkey = GLUT_KEY_RIGHT; break;
- case 66:
- specialkey = GLUT_KEY_DOWN; break;
- case 53:
- specialkey = GLUT_KEY_PAGE_UP; READKEY; break;
- case 54:
- specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break;
- case 49:
- specialkey = GLUT_KEY_HOME; READKEY; break;
- case 52:
- specialkey = GLUT_KEY_END; READKEY; break;
- case 50:
- READKEY;
- if(code != 126)
- goto shiftfunc;
- specialkey = GLUT_KEY_INSERT;
- break;
- case 51:
- code = '\b';
- goto stdkey;
- case 91:
- READKEY;
- specialkey = GLUT_KEY_F1 + code - 65;
- break;
- default:
- return 0;
- }
- break;
- default:
+ if(code != 91) {
KeyboardModifiers |= GLUT_ACTIVE_ALT;
goto altset;
}
+ READKEY;
+ switch(code) {
+ case 68:
+ specialkey = GLUT_KEY_LEFT; break;
+ case 65:
+ specialkey = GLUT_KEY_UP; break;
+ case 67:
+ specialkey = GLUT_KEY_RIGHT; break;
+ case 66:
+ specialkey = GLUT_KEY_DOWN; break;
+ case 52:
+ specialkey = GLUT_KEY_END; READKEY; break;
+ case 53:
+ specialkey = GLUT_KEY_PAGE_UP; READKEY; break;
+ case 54:
+ specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break;
+ case 49:
+ READKEY;
+ if(code == 126)
+ specialkey = GLUT_KEY_HOME;
+ else {
+ specialkey = GLUT_KEY_F1 + code - 50;
+ READKEY;
+ }
+ break;
+ case 50:
+ READKEY;
+ if(code == 126)
+ specialkey = GLUT_KEY_INSERT;
+ else {
+ if(code > '1')
+ code--;
+ if(code > '6')
+ code--;
+ if(code > '3') {
+ KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
+ code -= 12;
+ }
+ specialkey = GLUT_KEY_F1 + code - 40;
+ READKEY;
+ }
+ break;
+ case 51:
+ READKEY;
+ if(code == 126) {
+ code = '\b';
+ goto stdkey;
+ }
+ KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
+ specialkey = GLUT_KEY_F1 + code - 45;
+ READKEY;
+ break;
+ case 91:
+ READKEY;
+ specialkey = GLUT_KEY_F1 + code - 65;
+ break;
+ default:
+ return 0;
+ }
}
if(specialkey) {
- if(SpecialFunc)
- SpecialFunc(specialkey, MouseX, MouseY);
+ LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME);
+
+ if(LastStdinSpecialKey != specialkey) {
+ ReleaseStdinKey();
+ HandleSpecialPress(specialkey, 0);
+ LastStdinSpecialKey = specialkey;
+ LastStdinKeyTime += 200; /* initial repeat */
+ } else
+ if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF)
+ HandleSpecialPress(specialkey, 0);
} else {
if(code >= 1 && code <= 26 && code != '\r') {
KeyboardModifiers |= GLUT_ACTIVE_CTRL;
@@ -255,8 +315,15 @@ static int ReadKey(void)
KeyboardModifiers |= GLUT_ACTIVE_SHIFT;
stdkey:
- if(KeyboardFunc)
- KeyboardFunc(code, MouseX, MouseY);
+ LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME);
+ if(LastStdinCode != code) {
+ ReleaseStdinKey();
+ HandleKeyPress(code, 0);
+ LastStdinCode = code;
+ LastStdinKeyTime += 200; /* initial repeat */
+ } else
+ if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF)
+ HandleSpecialPress(code, 0);
}
return 1;
}
@@ -342,19 +409,17 @@ static int ReadKey(void)
labelval = '\b';
break;
case K_ENTER:
- case K_ENTER - 1: /* keypad enter */
labelval = '\r'; break;
}
+ /* likely a keypad input, but depends on keyboard mapping, ignore */
+ if(labelval == 512)
+ return 1;
+
/* dispatch callback */
- if(specialkey) {
- if(release) {
- if(SpecialUpFunc)
- SpecialUpFunc(specialkey, MouseX, MouseY);
- } else
- if(SpecialFunc)
- SpecialFunc(specialkey, MouseX, MouseY);
- } else {
+ if(specialkey)
+ HandleSpecialPress(specialkey, release);
+ else {
char c = labelval;
if(KeyboardLedState & LED_CAP) {
@@ -364,12 +429,7 @@ static int ReadKey(void)
if(c >= 'a' && c <= 'z')
c += 'A' - 'a';
}
- if(release) {
- if(KeyboardUpFunc)
- KeyboardUpFunc(c, MouseX, MouseY);
- } else
- if(KeyboardFunc)
- KeyboardFunc(c, MouseX, MouseY);
+ HandleKeyPress(c, release);
}
return 1;
}
@@ -432,28 +492,22 @@ static int ReadMouse(void)
dy = event.dy;
} else
#endif
- {
- char data[4];
-
- if(MouseFD == -1)
- return 0;
+ {
+ char data[4];
- if(fcntl(MouseFD, F_SETFL, O_NONBLOCK) == -1) {
- close(MouseFD);
- MouseFD = -1;
- return 0;
- }
+ if(MouseFD == -1)
+ return 0;
- if(read(MouseFD, data, 4) != 4)
- return 0;
+ if(read(MouseFD, data, 4) != 4)
+ return 0;
- l = ((data[0] & 0x20) >> 3);
- m = ((data[3] & 0x10) >> 3);
- r = ((data[0] & 0x10) >> 4);
+ l = ((data[0] & 0x20) >> 3);
+ m = ((data[3] & 0x10) >> 3);
+ r = ((data[0] & 0x10) >> 4);
- dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F));
- dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
- }
+ dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F));
+ dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F));
+ }
MouseX += dx * MouseSpeed;
if(MouseX < 0)
@@ -478,7 +532,7 @@ static int ReadMouse(void)
ll = l, lm = m, lr = r;
- if(dx || dy) {
+ if(dx || dy || !MouseVisible) {
if(l || m || r) {
if(MotionFunc)
MotionFunc(MouseX, MouseY);
@@ -488,12 +542,16 @@ static int ReadMouse(void)
EraseCursor();
+ MouseVisible = 1;
+
if(ActiveMenu)
Redisplay = 1;
else
SwapCursor();
}
+ LastMouseTime = glutGet(GLUT_ELAPSED_TIME);
+
return 1;
}
@@ -502,8 +560,14 @@ void ReceiveInput(void)
if(ConsoleFD != -1)
while(ReadKey());
- if(MouseEnabled)
- while(ReadMouse());
+ while(ReadMouse());
+
+ /* implement a 2 second timeout on the mouse */
+ if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) {
+ EraseCursor();
+ MouseVisible = 0;
+ SwapCursor();
+ }
}
static void VTSwitchHandler(int sig)
@@ -526,9 +590,6 @@ static void VTSwitchHandler(int sig)
if(st.v_active)
ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ);
- /* this is a hack to turn the cursor off */
- ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo);
-
RestoreColorMap();
Active = 1;
@@ -536,7 +597,6 @@ static void VTSwitchHandler(int sig)
VisibleSwitch = 1;
Redisplay = 1;
-
break;
}
}
@@ -549,37 +609,11 @@ void InitializeVT(int usestdin)
signal(SIGIO, SIG_IGN);
- /* save old terminos settings */
- if (tcgetattr(0, &OldTermios) < 0) {
- sprintf(exiterror, "tcgetattr failed\n");
- exit(0);
- }
-
- tio = OldTermios;
-
- /* terminos settings for straight-through mode */
- tio.c_lflag &= ~(ICANON | ECHO | ISIG);
- tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
- tio.c_iflag |= IGNBRK;
-
- tio.c_cc[VMIN] = 0;
- tio.c_cc[VTIME] = 0;
-
- if (tcsetattr(0, TCSANOW, &tio) < 0) {
- sprintf(exiterror, "tcsetattr failed\n");
- exit(0);
- }
-
- if(fcntl(0, F_SETFL, O_NONBLOCK | O_ASYNC) < 0) {
- sprintf(exiterror, "Failed to set keyboard to non-blocking\n");
- exit(0);
- }
-
Active = 1;
if(usestdin) {
ConsoleFD = 0;
- return;
+ goto setattribs;
}
/* detect the current vt if it was not specified */
@@ -590,15 +624,16 @@ void InitializeVT(int usestdin)
sprintf(exiterror, "Failed to open /dev/tty\n");
exit(0);
}
+
if(ioctl(fd, VT_GETSTATE, &st) == -1) {
fprintf(stderr, "Could not detect current vt, specify with -vt\n");
fprintf(stderr, "Defaulting to stdin input\n");
ConsoleFD = 0;
close(fd);
- return;
- } else
- CurrentVT = st.v_active;
+ goto setattribs;
+ }
+ CurrentVT = st.v_active;
close(fd);
}
@@ -613,7 +648,7 @@ void InitializeVT(int usestdin)
sprintf(exiterror, "error couldn't open %s,"
" defaulting to stdin \n", console);
ConsoleFD = 0;
- return;
+ goto setattribs;
}
signal(SIGUSR1, VTSwitchHandler);
@@ -623,7 +658,7 @@ void InitializeVT(int usestdin)
sprintf(exiterror,"Failed to grab %s, defaulting to stdin\n", console);
close(ConsoleFD);
ConsoleFD = 0;
- return;
+ goto setattribs;
}
vt = OldVTMode;
@@ -655,7 +690,7 @@ void InitializeVT(int usestdin)
exit(0);
}
- fcntl(0, F_SETOWN, getpid());
+ fcntl(ConsoleFD, F_SETOWN, getpid());
if(ioctl(ConsoleFD, KDGETMODE, &OldMode) < 0)
sprintf(exiterror, "Warning: Failed to get terminal mode\n");
@@ -668,7 +703,6 @@ void InitializeVT(int usestdin)
if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) {
sprintf(exiterror, "ioctl KDSKBMODE failed!\n");
- tcsetattr(0, TCSANOW, &OldTermios);
exit(0);
}
@@ -676,6 +710,34 @@ void InitializeVT(int usestdin)
sprintf(exiterror, "ioctl KDGKBLED failed!\n");
exit(0);
}
+
+ setattribs:
+ /* enable async input input */
+ if(fcntl(ConsoleFD, F_SETFL, O_ASYNC) < 0) {
+ sprintf(exiterror, "Failed to set O_ASYNC mode on fd %d\n", ConsoleFD);
+ exit(0);
+ }
+
+ /* save old terminos settings */
+ if (tcgetattr(ConsoleFD, &OldTermios) < 0) {
+ sprintf(exiterror, "tcgetattr failed\n");
+ exit(0);
+ }
+
+ tio = OldTermios;
+
+ /* terminos settings for straight-through mode */
+ tio.c_lflag &= ~(ICANON | ECHO | ISIG);
+ tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
+ tio.c_iflag |= IGNBRK;
+
+ tio.c_cc[VMIN] = 0;
+ tio.c_cc[VTIME] = 0;
+
+ if (tcsetattr(ConsoleFD, TCSANOW, &tio) < 0) {
+ sprintf(exiterror, "tcsetattr failed\n");
+ exit(0);
+ }
}
void RestoreVT(void)
@@ -683,13 +745,13 @@ void RestoreVT(void)
if(ConsoleFD < 0)
return;
- if (tcsetattr(0, TCSANOW, &OldTermios) < 0)
- fprintf(stderr, "tcsetattr failed\n");
+ if (tcsetattr(ConsoleFD, TCSANOW, &OldTermios) < 0)
+ sprintf(exiterror, "tcsetattr failed\n");
- /* setting the mode to text from graphics restores the colormap*/
+ /* setting the mode to text from graphics restores the colormap */
if(
#ifdef HAVE_GPM
- GpmMouse ||
+ !GpmMouse ||
#endif
ConsoleFD == 0)
if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0)
@@ -725,11 +787,11 @@ void InitializeMouse(void)
const char *mousedev = getenv("MOUSE");
if(!mousedev)
mousedev = MOUSEDEV;
- if((MouseFD = open(mousedev, O_RDONLY)) >= 0) {
- if(!MouseSpeed)
- MouseSpeed = 1;
- NumMouseButtons = 3;
- return;
+ if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) {
+ if(!MouseSpeed)
+ MouseSpeed = 1;
+ NumMouseButtons = 3;
+ return;
}
}
#ifdef HAVE_GPM
diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h
index 082cd4f6f3a..0a159d96b0a 100644
--- a/src/glut/fbdev/internal.h
+++ b/src/glut/fbdev/internal.h
@@ -51,6 +51,8 @@ extern int Swapping, VTSwitch;
void TestVisible(void);
int ParseFBModes(int, int, int, int, int, int);
+void SetVideoMode(void);
+void CreateBuffer(void);
void CreateVisual(void);
extern int FrameBufferFD;
@@ -72,20 +74,20 @@ extern GLFBDevVisualPtr Visual;
#define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG)
extern unsigned short RedColorMap[256],
- GreenColorMap[256],
- BlueColorMap[256];
+ GreenColorMap[256],
+ BlueColorMap[256];
extern unsigned char ReverseColorMap[REVERSECMAPSIZE]
[REVERSECMAPSIZE]
[REVERSECMAPSIZE];
-void LoadOldColorMap(void);
+
void LoadColorMap(void);
-void UnloadColorMap(void);
void RestoreColorMap(void);
/* --- mouse --- */
extern int MouseX, MouseY;
extern int CurrentCursor;
-extern int MouseEnabled;
+extern int MouseVisible;
+extern int LastMouseTime;
extern int NumMouseButtons;
void InitializeCursor(void);
diff --git a/src/glut/fbdev/menu.c b/src/glut/fbdev/menu.c
index f5a5ef75434..4ab4eb30d46 100644
--- a/src/glut/fbdev/menu.c
+++ b/src/glut/fbdev/menu.c
@@ -25,6 +25,8 @@
*/
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include <linux/fb.h>
@@ -69,6 +71,7 @@ void FreeMenus(void)
free(Menus[i].Items[j].name);
free(Menus[i].Items);
}
+
free(Menus);
}
@@ -204,7 +207,6 @@ void CloseMenu(void)
int glutCreateMenu(void (*func)(int value))
{
- MouseEnabled = 1;
CurrentMenu = NumMenus;
NumMenus++;
Menus = realloc(Menus, sizeof(*Menus) * NumMenus);
diff --git a/src/glut/fbdev/overlay.c b/src/glut/fbdev/overlay.c
index 8bd207155c0..374cf30e7df 100644
--- a/src/glut/fbdev/overlay.c
+++ b/src/glut/fbdev/overlay.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <stdlib.h>
#include <GL/gl.h>
void glutEstablishOverlay(void)
diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c
index bca675c52c4..212a04aa028 100644
--- a/src/glut/fbdev/state.c
+++ b/src/glut/fbdev/state.c
@@ -24,6 +24,7 @@
* Written by Sean D'Epagnier (c) 2006
*/
+#include <string.h>
#include <sys/time.h>
#include <linux/fb.h>
diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c
index d4b29508632..ce45d374646 100644
--- a/src/glx/mini/miniglx.c
+++ b/src/glx/mini/miniglx.c
@@ -2310,7 +2310,9 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
GLXDrawable drawable = (GLXDrawable) draw;
drm_clip_rect_t * cliprect;
Display* display = (Display*)dpy;
+ __DRIscreenPrivate *psp = display->driScreen.private;
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private;
+ __DRIdrawablePrivate *pdp = pcp->driDrawablePriv;
if (drawable == 0) {
return GL_FALSE;
}
@@ -2325,6 +2327,7 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
*index = display->clientID;
*stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp;
+ drmUpdateDrawableInfo(psp->fd, pdp->hHWDrawable, DRM_DRAWABLE_CLIPRECTS, 1, cliprect);
*x = drawable->x;
*y = drawable->y;
*width = drawable->w;
@@ -2352,14 +2355,23 @@ static GLboolean
xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable,
drm_drawable_t *hHWDrawable )
{
- return GL_TRUE;
+
+ Display *display = (Display *)dpy;
+ __DRIscreenPrivate *psp = display->driScreen.private;
+ int ret;
+ ret = drmCreateDrawable(psp->fd, hHWDrawable);
+
+ fprintf(stderr, "drawable is %d %08X ret is %d\n", *hHWDrawable, drawable, -ret);
+ if (ret != 0)
+ return GL_FALSE;
+ return GL_TRUE;
}
static GLboolean
xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
{
- return GL_TRUE;
+ return GL_TRUE;
}
diff --git a/src/glx/x11/.gitignore b/src/glx/x11/.gitignore
new file mode 100644
index 00000000000..ffc14ab7660
--- /dev/null
+++ b/src/glx/x11/.gitignore
@@ -0,0 +1 @@
+glcontextmodes.c
diff --git a/src/glx/x11/XF86dri.c b/src/glx/x11/XF86dri.c
index 0ce588276be..8909a047721 100644
--- a/src/glx/x11/XF86dri.c
+++ b/src/glx/x11/XF86dri.c
@@ -203,7 +203,7 @@ PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
*hSAREA = rep.hSAREALow;
if (sizeof(drm_handle_t) == 8) {
- const int shift = 32; /* var to prevent warning on next line */
+ int shift = 32; /* var to prevent warning on next line */
*hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift;
}
@@ -566,7 +566,7 @@ PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
*hFrameBuffer = rep.hFrameBufferLow;
if (sizeof(drm_handle_t) == 8) {
- const int shift = 32; /* var to prevent warning on next line */
+ int shift = 32; /* var to prevent warning on next line */
*hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift;
}
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 9d1bb2a0b55..f52b71ffcd2 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -2883,8 +2883,9 @@ int __glXGetInternalVersion(void)
* 20050727 - Gut all the old interfaces. This breaks compatability with
* any DRI driver built to any previous version.
* 20060314 - Added support for GLX_MESA_copy_sub_buffer.
+ * 20070105 - Added support for damage reporting.
*/
- return 20060314;
+ return 20070105;
}
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index bad09ce4ccf..7f3857360d0 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -48,6 +48,8 @@
#include <stdio.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
+#include <X11/extensions/Xfixes.h>
+#include <X11/extensions/Xdamage.h>
#include <assert.h>
#include "indirect_init.h"
#include "glapi.h"
@@ -698,6 +700,68 @@ static __DRIfuncPtr get_proc_address( const char * proc_name )
return NULL;
}
+#ifdef XDAMAGE_1_1_INTERFACE
+static GLboolean has_damage_post(__DRInativeDisplay *dpy)
+{
+ static GLboolean inited = GL_FALSE;
+ static GLboolean has_damage;
+
+ if (!inited) {
+ int major, minor;
+
+ if (XDamageQueryVersion(dpy, &major, &minor) &&
+ major == 1 && minor >= 1)
+ {
+ has_damage = GL_TRUE;
+ } else {
+ has_damage = GL_FALSE;
+ }
+ inited = GL_TRUE;
+ }
+
+ return has_damage;
+}
+#endif /* XDAMAGE_1_1_INTERFACE */
+
+static void __glXReportDamage(__DRInativeDisplay *dpy, int screen,
+ __DRIid drawable,
+ int x, int y,
+ drm_clip_rect_t *rects, int num_rects,
+ GLboolean front_buffer)
+{
+#ifdef XDAMAGE_1_1_INTERFACE
+ XRectangle *xrects;
+ XserverRegion region;
+ int i;
+ int x_off, y_off;
+
+ if (!has_damage_post(dpy))
+ return;
+
+ if (front_buffer) {
+ x_off = x;
+ y_off = y;
+ drawable = RootWindow(dpy, screen);
+ } else{
+ x_off = 0;
+ y_off = 0;
+ }
+
+ xrects = malloc(sizeof(XRectangle) * num_rects);
+ if (xrects == NULL)
+ return;
+
+ for (i = 0; i < num_rects; i++) {
+ xrects[i].x = rects[i].x1 + x_off;
+ xrects[i].y = rects[i].y1 + y_off;
+ xrects[i].width = rects[i].x2 - rects[i].x1;
+ xrects[i].height = rects[i].y2 - rects[i].y1;
+ }
+ region = XFixesCreateRegion(dpy, xrects, num_rects);
+ XDamageAdd(dpy, drawable, region);
+ XFixesDestroyRegion(dpy, region);
+#endif
+}
/**
* Table of functions exported by the loader to the driver.
@@ -720,70 +784,10 @@ static const __DRIinterfaceMethods interface_methods = {
__glXGetUST,
__glXGetMscRateOML,
-};
-
-#define DRM_MAX_FDS 16
-static struct {
- char *BusID;
- int fd;
- int refcount;
-} connection[DRM_MAX_FDS];
-
-static int nr_fds = 0;
-int drmOpenOnce(void *unused,
- const char *BusID,
- int *newlyopened)
-{
- int i;
- int fd;
-
- for (i = 0; i < nr_fds; i++)
- if (strcmp(BusID, connection[i].BusID) == 0) {
- connection[i].refcount++;
- *newlyopened = 0;
- return connection[i].fd;
- }
-
- fd = drmOpen(unused, BusID);
- if (fd <= 0 || nr_fds == DRM_MAX_FDS)
- return fd;
-
- connection[nr_fds].BusID = strdup(BusID);
- connection[nr_fds].fd = fd;
- connection[nr_fds].refcount = 1;
- *newlyopened = 1;
-
- if (0)
- fprintf(stderr, "saved connection %d for %s %d\n",
- nr_fds, connection[nr_fds].BusID,
- strcmp(BusID, connection[nr_fds].BusID));
-
- nr_fds++;
-
- return fd;
-}
+ __glXReportDamage,
+};
-void drmCloseOnce(int fd)
-{
- int i;
-
-
-
- for (i = 0; i < nr_fds; i++) {
- if (fd == connection[i].fd) {
- if (--connection[i].refcount == 0) {
- drmClose(connection[i].fd);
- free(connection[i].BusID);
-
- if (i < --nr_fds)
- connection[i] = connection[nr_fds];
-
- return;
- }
- }
- }
-}
/**
diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c
index b62f2a3a174..b5c306c562d 100644
--- a/src/glx/x11/indirect.c
+++ b/src/glx/x11/indirect.c
@@ -31,8 +31,8 @@
#include "glxclient.h"
#include "indirect_size.h"
#include "dispatch.h"
-#include "glthread.h"
#include "glapi.h"
+#include "glthread.h"
#include <GL/glxproto.h>
#ifdef USE_XCB
#include <X11/Xlib-xcb.h>
diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c
index 5a5cd6697ea..1855547dced 100644
--- a/src/glx/x11/indirect_vertex_array.c
+++ b/src/glx/x11/indirect_vertex_array.c
@@ -123,10 +123,8 @@ __glXInitVertexArrayState( __GLXcontext * gc )
struct array_state_vector * arrays;
unsigned array_count;
- unsigned texture_units = 1;
- unsigned i;
- unsigned j;
- unsigned vertex_program_attribs = 0;
+ int texture_units = 1, vertex_program_attribs = 0;
+ unsigned i, j;
GLboolean got_fog = GL_FALSE;
GLboolean got_secondary_color = GL_FALSE;
@@ -529,7 +527,7 @@ static GLubyte *
emit_DrawArrays_header_old( __GLXcontext * gc,
struct array_state_vector * arrays,
size_t * elements_per_request,
- unsigned int * total_requests,
+ size_t * total_requests,
GLenum mode, GLsizei count )
{
size_t command_size;
@@ -642,7 +640,7 @@ emit_DrawArrays_old( GLenum mode, GLint first, GLsizei count )
GLubyte * pc;
size_t elements_per_request;
- unsigned total_requests = 0;
+ size_t total_requests = 0;
unsigned i;
size_t total_sent = 0;
@@ -772,7 +770,7 @@ emit_DrawElements_old( GLenum mode, GLsizei count, GLenum type,
GLubyte * pc;
size_t elements_per_request;
- unsigned total_requests = 0;
+ size_t total_requests = 0;
unsigned i;
unsigned req;
diff --git a/src/mesa/.gitignore b/src/mesa/.gitignore
new file mode 100644
index 00000000000..b83498b1d9d
--- /dev/null
+++ b/src/mesa/.gitignore
@@ -0,0 +1,2 @@
+*/gen_matypes
+*/matypes.h
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index e06607b0f83..0ab4fc5149c 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -33,8 +33,8 @@ default:
$(MAKE) beos ; \
elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
$(MAKE) directfb ; \
- elif [ "$(DRIVER_DIRS)" = "fbdev" ]; then \
- $(MAKE) fbdev ; \
+ elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \
+ $(MAKE) fbdev ; $(MAKE) osmesa-only ; \
else \
$(MAKE) stand-alone ; \
fi
diff --git a/src/mesa/array_cache/sources b/src/mesa/array_cache/sources
new file mode 100644
index 00000000000..fb3328d10e6
--- /dev/null
+++ b/src/mesa/array_cache/sources
@@ -0,0 +1,7 @@
+MESA_ARRAY_CACHE_SOURCES = \
+ac_context.c \
+ac_import.c
+
+MESA_ARRAY_CACHE_HEADERS = \
+ac_context.h \
+acache.h
diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
index 2a20bddb1b6..2a62ac4053b 100644
--- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c
+++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
@@ -25,24 +25,16 @@
#include <pthread.h>
-#include <direct/messages.h>
-#include <direct/interface.h>
-#include <direct/mem.h>
-
#include <directfb.h>
#include <directfb_version.h>
-#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r)))
-#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \
- DIRECTFB_MINOR_VERSION, \
- DIRECTFB_MICRO_VERSION )
+#include <directfbgl.h>
+#include <direct/mem.h>
+#include <direct/messages.h>
+#include <direct/interface.h>
-#ifdef CLAMP
-# undef CLAMP
-#endif
-
-#include "GL/directfbgl.h"
+#undef CLAMP
#include "glheader.h"
#include "buffers.h"
#include "context.h"
@@ -62,6 +54,12 @@
#include "drivers/common/driverfuncs.h"
+#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r)))
+#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \
+ DIRECTFB_MINOR_VERSION, \
+ DIRECTFB_MICRO_VERSION )
+
+
static DFBResult
Probe( void *data );
@@ -79,7 +77,7 @@ DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa )
typedef struct {
int ref; /* reference counter */
- DFBBoolean locked;
+ int locked;
IDirectFBSurface *surface;
DFBSurfacePixelFormat format;
@@ -87,8 +85,8 @@ typedef struct {
int height;
struct {
- __u8 *start;
- __u8 *end;
+ GLubyte *start;
+ GLubyte *end;
int pitch;
} video;
@@ -185,12 +183,14 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
IDirectFBSurface *surface;
int width = 0;
int height = 0;
- DFBResult err;
+ DFBResult ret;
DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
- if (data->locked)
- return DFB_LOCKED;
+ if (data->locked) {
+ data->locked++;
+ return DFB_OK;
+ }
if (directfbgl_lock())
return DFB_LOCKED;
@@ -198,11 +198,12 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
surface = data->surface;
surface->GetSize( surface, &width, &height );
- err = surface->Lock( surface, DSLF_READ | DSLF_WRITE,
+ ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE,
(void*)&data->video.start, &data->video.pitch );
- if (err != DFB_OK) {
+ if (ret) {
D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" );
- return err;
+ directfbgl_unlock();
+ return ret;
}
data->video.end = data->video.start + (height-1) * data->video.pitch;
@@ -212,13 +213,13 @@ IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz )
&data->framebuffer, &data->framebuffer );
if (data->width != width || data->height != height) {
+ _mesa_resize_framebuffer( &data->context,
+ &data->framebuffer, width, height );
data->width = width;
- data->height = height;
- _mesa_resize_framebuffer(&data->context,
- &data->framebuffer, width, height);
+ data->height = height;
}
- data->locked = DFB_TRUE;
+ data->locked++;
return DFB_OK;
}
@@ -230,14 +231,14 @@ IDirectFBGL_Mesa_Unlock( IDirectFBGL *thiz )
if (!data->locked)
return DFB_OK;
-
- _mesa_make_current( NULL, NULL, NULL );
+
+ if (--data->locked == 0) {
+ _mesa_make_current( NULL, NULL, NULL );
- data->surface->Unlock( data->surface );
-
- directfbgl_unlock();
+ data->surface->Unlock( data->surface );
- data->locked = DFB_FALSE;
+ directfbgl_unlock();
+ }
return DFB_OK;
}
@@ -270,12 +271,32 @@ IDirectFBGL_Mesa_GetAttributes( IDirectFBGL *thiz,
attributes->accum_green_size = visual->accumGreenBits;
attributes->accum_blue_size = visual->accumBlueBits;
attributes->accum_alpha_size = visual->accumAlphaBits;
- attributes->double_buffer = (caps & DSCAPS_FLIPPING) ? 1 : 0;
+ attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0);
attributes->stereo = (visual->stereoMode != 0);
return DFB_OK;
}
+#if DIRECTFBGL_INTERFACE_VERSION >= 1
+static DFBResult
+IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz,
+ const char *name,
+ void **ret_address )
+{
+ DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
+
+ if (!name)
+ return DFB_INVARG;
+
+ if (!ret_address)
+ return DFB_INVARG;
+
+ *ret_address = _glapi_get_proc_address( name );
+
+ return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED;
+}
+#endif
+
/* exported symbols */
@@ -288,6 +309,8 @@ Probe( void *data )
static DFBResult
Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
{
+ DFBResult ret;
+
/* Initialize global resources. */
if (directfbgl_init())
return DFB_INIT;
@@ -296,12 +319,17 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL );
/* Initialize interface data. */
- data->ref = 1;
- data->surface = surface;
+ data->ref = 1;
- surface->AddRef( surface );
- surface->GetPixelFormat( surface, &data->format );
- surface->GetSize( surface, &data->width, &data->height );
+ /* Duplicate destination surface. */
+ ret = surface->GetSubSurface( surface, NULL, &data->surface );
+ if (ret) {
+ IDirectFBGL_Mesa_Destruct( thiz );
+ return ret;
+ }
+
+ data->surface->GetPixelFormat( data->surface, &data->format );
+ data->surface->GetSize( data->surface, &data->width, &data->height );
/* Configure visual. */
if (!directfbgl_init_visual( &data->visual, data->format )) {
@@ -319,11 +347,14 @@ Construct( IDirectFBGL *thiz, IDirectFBSurface *surface )
}
/* Assign interface pointers. */
- thiz->AddRef = IDirectFBGL_Mesa_AddRef;
- thiz->Release = IDirectFBGL_Mesa_Release;
- thiz->Lock = IDirectFBGL_Mesa_Lock;
- thiz->Unlock = IDirectFBGL_Mesa_Unlock;
- thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes;
+ thiz->AddRef = IDirectFBGL_Mesa_AddRef;
+ thiz->Release = IDirectFBGL_Mesa_Release;
+ thiz->Lock = IDirectFBGL_Mesa_Lock;
+ thiz->Unlock = IDirectFBGL_Mesa_Unlock;
+ thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes;
+#if DIRECTFBGL_INTERFACE_VERSION >= 1
+ thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress;
+#endif
return DFB_OK;
}
@@ -363,71 +394,54 @@ dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height )
static void
dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
{
- GLuint newWidth, newHeight;
- GLframebuffer *buffer = ctx->WinSysDrawBuffer;
- dfbGetBufferSize( buffer, &newWidth, &newHeight );
- if (buffer->Width != newWidth || buffer->Height != newHeight) {
- _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
- }
+ /* Nothing to do (the surface can't be resized while it's locked). */
+ return;
}
static void
dfbClear( GLcontext *ctx, GLbitfield mask )
{
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
- int x = ctx->DrawBuffer->_Xmin;
- int y = ctx->DrawBuffer->_Ymin;
- int width = ctx->DrawBuffer->_Xmax - x;
- int height = ctx->DrawBuffer->_Ymax - y;
- GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height)
-
- if (mask & BUFFER_BIT_FRONT_LEFT &&
- ctx->Color.ColorMask[0] &&
- ctx->Color.ColorMask[1] &&
- ctx->Color.ColorMask[2] &&
+
+#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \
+ BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT )
+ if (mask & BUFFER_BIT_MASK &&
+ ctx->Color.ColorMask[0] &&
+ ctx->Color.ColorMask[1] &&
+ ctx->Color.ColorMask[2] &&
ctx->Color.ColorMask[3])
{
DFBRegion clip;
- __u8 a, r, g, b;
+ GLubyte a, r, g, b;
UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] );
UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] );
- data->surface->Unlock( data->surface );
-
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25)
- data->surface->GetClip( data->surface, &clip );
-#else
- (void)clip;
-#endif
+ clip.x1 = ctx->DrawBuffer->_Xmin;
+ clip.y1 = ctx->DrawBuffer->_Ymin;
+ clip.x2 = ctx->DrawBuffer->_Xmax - 1;
+ clip.y2 = ctx->DrawBuffer->_Ymax - 1;
+ data->surface->SetClip( data->surface, &clip );
- if (all) {
- data->surface->SetClip( data->surface, NULL );
- }
- else {
- DFBRegion reg = { x1:x, y1:y, x2:x+width-1, y2:y+height-1 };
- data->surface->SetClip( data->surface, &reg );
- }
+ data->surface->Unlock( data->surface );
data->surface->Clear( data->surface, r, g, b, a );
-
-#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25)
- data->surface->SetClip( data->surface, &clip );
-#endif
data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE,
(void*)&data->video.start, &data->video.pitch );
+ data->video.end = data->video.start + (data->height-1) * data->video.pitch;
+ data->render.Data = data->video.start;
- mask &= ~BUFFER_BIT_FRONT_LEFT;
+ mask &= ~BUFFER_BIT_MASK;
}
+#undef BUFFER_BIT_MASK
if (mask)
_swrast_Clear( ctx, mask );
-}
-
-
+}
+
/************************ RenderBuffer functions *****************************/
@@ -790,6 +804,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB332;
data->render.GetValues = get_values_RGB332;
data->render.PutRow = put_row_RGB332;
+ data->render.PutRowRGB = put_row_rgb_RGB332;
data->render.PutMonoRow = put_mono_row_RGB332;
data->render.PutValues = put_values_RGB332;
data->render.PutMonoValues = put_mono_values_RGB332;
@@ -798,6 +813,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB4444;
data->render.GetValues = get_values_ARGB4444;
data->render.PutRow = put_row_ARGB4444;
+ data->render.PutRowRGB = put_row_rgb_ARGB4444;
data->render.PutMonoRow = put_mono_row_ARGB4444;
data->render.PutValues = put_values_ARGB4444;
data->render.PutMonoValues = put_mono_values_ARGB4444;
@@ -806,6 +822,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB2554;
data->render.GetValues = get_values_ARGB2554;
data->render.PutRow = put_row_ARGB2554;
+ data->render.PutRowRGB = put_row_rgb_ARGB2554;
data->render.PutMonoRow = put_mono_row_ARGB2554;
data->render.PutValues = put_values_ARGB2554;
data->render.PutMonoValues = put_mono_values_ARGB2554;
@@ -814,6 +831,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB1555;
data->render.GetValues = get_values_ARGB1555;
data->render.PutRow = put_row_ARGB1555;
+ data->render.PutRowRGB = put_row_rgb_ARGB1555;
data->render.PutMonoRow = put_mono_row_ARGB1555;
data->render.PutValues = put_values_ARGB1555;
data->render.PutMonoValues = put_mono_values_ARGB1555;
@@ -822,6 +840,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB16;
data->render.GetValues = get_values_RGB16;
data->render.PutRow = put_row_RGB16;
+ data->render.PutRowRGB = put_row_rgb_RGB16;
data->render.PutMonoRow = put_mono_row_RGB16;
data->render.PutValues = put_values_RGB16;
data->render.PutMonoValues = put_mono_values_RGB16;
@@ -830,6 +849,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB24;
data->render.GetValues = get_values_RGB24;
data->render.PutRow = put_row_RGB24;
+ data->render.PutRowRGB = put_row_rgb_RGB24;
data->render.PutMonoRow = put_mono_row_RGB24;
data->render.PutValues = put_values_RGB24;
data->render.PutMonoValues = put_mono_values_RGB24;
@@ -838,6 +858,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_RGB32;
data->render.GetValues = get_values_RGB32;
data->render.PutRow = put_row_RGB32;
+ data->render.PutRowRGB = put_row_rgb_RGB32;
data->render.PutMonoRow = put_mono_row_RGB32;
data->render.PutValues = put_values_RGB32;
data->render.PutMonoValues = put_mono_values_RGB32;
@@ -846,6 +867,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_ARGB;
data->render.GetValues = get_values_ARGB;
data->render.PutRow = put_row_ARGB;
+ data->render.PutRowRGB = put_row_rgb_ARGB;
data->render.PutMonoRow = put_mono_row_ARGB;
data->render.PutValues = put_values_ARGB;
data->render.PutMonoValues = put_mono_values_ARGB;
@@ -854,6 +876,7 @@ directfbgl_create_context( GLcontext *context,
data->render.GetRow = get_row_AiRGB;
data->render.GetValues = get_values_AiRGB;
data->render.PutRow = put_row_AiRGB;
+ data->render.PutRowRGB = put_row_rgb_AiRGB;
data->render.PutMonoRow = put_mono_row_AiRGB;
data->render.PutValues = put_values_AiRGB;
data->render.PutMonoValues = put_mono_values_AiRGB;
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index e7f07569f4e..cc3dcf9d8db 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -411,13 +411,18 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
if (!pcp
|| ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
- /* ERROR!!! */
- return;
+ /* ERROR!!!
+ * ...but we must ignore it. There can be many contexts bound to a
+ * drawable.
+ */
}
psp = pdp->driScreenPriv;
if (!psp) {
/* ERROR!!! */
+ _mesa_problem("Warning! Possible infinite loop due to bug "
+ "in file %s, line %d\n",
+ __FILE__, __LINE__);
return;
}
@@ -477,8 +482,27 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate )
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
+ drm_clip_rect_t rect;
+
dPriv->swapBuffers(dPriv);
- (void) dpy;
+
+ /* Check that we actually have the new damage report method */
+ if (api_ver < 20070105 || dri_interface->reportDamage == NULL)
+ return;
+
+ /* Assume it's affecting the whole drawable for now */
+ rect.x1 = 0;
+ rect.y1 = 0;
+ rect.x2 = rect.x1 + dPriv->w;
+ rect.y2 = rect.y1 + dPriv->h;
+
+ /* Report the damage. Currently, all our drivers draw directly to the
+ * front buffer, so we report the damage there rather than to the backing
+ * store (if any).
+ */
+ (*dri_interface->reportDamage)(dpy, dPriv->screen, dPriv->draw,
+ dPriv->x, dPriv->y,
+ &rect, 1, GL_TRUE);
}
/**
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h
index cd73b781741..747f92fcdbe 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.h
@@ -52,8 +52,11 @@ typedef struct {
*/
GLboolean depthHasSurface;
- /* XXX this is for s3v only. A handy flag to know if this is the back
- * color buffer.
+ /**
+ * A handy flag to know if this is the back color buffer.
+ *
+ * \note
+ * This is currently only used by s3v and tdfx.
*/
GLboolean backBuffer;
} driRenderbuffer;
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index 618f1794c1a..d6d51cdd165 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -32,9 +32,10 @@
# define NULL 0
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix3fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix3fv\0"
"glUniformMatrix3fvARB\0"
"";
#endif
@@ -78,6 +79,13 @@ static const char PointParameteriNV_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_0)
+static const char GetProgramiv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetProgramiv\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_3)
static const char MultiTexCoord3sARB_names[] =
"iiii\0" /* Parameter signature */
@@ -231,16 +239,17 @@ static const char TexCoord2fColor4ubVertex3fvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
-static const char ProgramEnvParameter4dvARB_names[] =
- "iip\0" /* Parameter signature */
- "glProgramEnvParameter4dvARB\0"
+#if defined(need_GL_VERSION_2_0)
+static const char AttachShader_names[] =
+ "ii\0" /* Parameter signature */
+ "glAttachShader\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2fARB_names[] =
"iff\0" /* Parameter signature */
+ "glVertexAttrib2f\0"
"glVertexAttrib2fARB\0"
"";
#endif
@@ -252,9 +261,10 @@ static const char GetDebugLogLengthMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3fARB_names[] =
"ifff\0" /* Parameter signature */
+ "glVertexAttrib3f\0"
"glVertexAttrib3fARB\0"
"";
#endif
@@ -305,16 +315,25 @@ static const char CompressedTexSubImage2DARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_NV_register_combiners)
+static const char CombinerOutputNV_names[] =
+ "iiiiiiiiii\0" /* Parameter signature */
+ "glCombinerOutputNV\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2fARB_names[] =
"iff\0" /* Parameter signature */
+ "glUniform2f\0"
"glUniform2fARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1sv\0"
"glVertexAttrib1svARB\0"
"";
#endif
@@ -326,9 +345,10 @@ static const char VertexAttribs1dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform2iv\0"
"glUniform2ivARB\0"
"";
#endif
@@ -347,6 +367,13 @@ static const char WeightubvARB_names[] =
"";
#endif
+#if defined(need_GL_NV_vertex_program)
+static const char VertexAttrib1fvNV_names[] =
+ "ip\0" /* Parameter signature */
+ "glVertexAttrib1fvNV\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_convolution)
static const char CopyConvolutionFilter1D_names[] =
"iiiii\0" /* Parameter signature */
@@ -377,9 +404,10 @@ static const char BlendColor_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix4fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix4fv\0"
"glUniformMatrix4fvARB\0"
"";
#endif
@@ -398,6 +426,13 @@ static const char ReadInstrumentsSGIX_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix2x4fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix2x4fv\0"
+ "";
+#endif
+
#if defined(need_GL_SUN_vertex)
static const char Color4ubVertex3fvSUN_names[] =
"pp\0" /* Parameter signature */
@@ -412,9 +447,10 @@ static const char GetListParameterivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NusvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nusv\0"
"glVertexAttrib4NusvARB\0"
"";
#endif
@@ -440,10 +476,10 @@ static const char FragmentLightModelivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ATI_fragment_shader)
-static const char ColorFragmentOp3ATI_names[] =
- "iiiiiiiiiiiii\0" /* Parameter signature */
- "glColorFragmentOp3ATI\0"
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix4x3fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix4x3fv\0"
"";
#endif
@@ -536,9 +572,10 @@ static const char ProgramParameter4dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char DisableVertexAttribArrayARB_names[] =
"i\0" /* Parameter signature */
+ "glDisableVertexAttribArray\0"
"glDisableVertexAttribArrayARB\0"
"";
#endif
@@ -573,9 +610,10 @@ static const char GetConvolutionParameteriv_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1fARB_names[] =
"if\0" /* Parameter signature */
+ "glVertexAttrib1f\0"
"glVertexAttrib1fARB\0"
"";
#endif
@@ -688,16 +726,25 @@ static const char VertexAttrib2dNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0)
+static const char GetProgramInfoLog_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetProgramInfoLog\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NbvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nbv\0"
"glVertexAttrib4NbvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char GetActiveAttribARB_names[] =
"iiipppp\0" /* Parameter signature */
+ "glGetActiveAttrib\0"
"glGetActiveAttribARB\0"
"";
#endif
@@ -863,9 +910,10 @@ static const char ReplacementCodeubvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3iARB_names[] =
"iiii\0" /* Parameter signature */
+ "glUniform3i\0"
"glUniform3iARB\0"
"";
#endif
@@ -877,10 +925,10 @@ static const char GetFragmentMaterialfvSGIX_names[] =
"";
#endif
-#if defined(need_GL_EXT_coordinate_frame)
-static const char Binormal3fEXT_names[] =
- "fff\0" /* Parameter signature */
- "glBinormal3fEXT\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetShaderInfoLog_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetShaderInfoLog\0"
"";
#endif
@@ -998,9 +1046,10 @@ static const char TexSubImage1D_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1sARB_names[] =
"ii\0" /* Parameter signature */
+ "glVertexAttrib1s\0"
"glVertexAttrib1sARB\0"
"";
#endif
@@ -1026,9 +1075,10 @@ static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1fARB_names[] =
"if\0" /* Parameter signature */
+ "glUniform1f\0"
"glUniform1fARB\0"
"";
#endif
@@ -1162,9 +1212,10 @@ static const char GetFragmentLightivSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char UniformMatrix2fvARB_names[] =
"iiip\0" /* Parameter signature */
+ "glUniformMatrix2fv\0"
"glUniformMatrix2fvARB\0"
"";
#endif
@@ -1208,9 +1259,10 @@ static const char MapParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3dv\0"
"glVertexAttrib3dvARB\0"
"";
#endif
@@ -1301,9 +1353,10 @@ static const char GetAttachedObjectsARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform3fv\0"
"glUniform3fvARB\0"
"";
#endif
@@ -1344,9 +1397,10 @@ static const char GetHandleARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribivARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribiv\0"
"glGetVertexAttribivARB\0"
"";
#endif
@@ -1358,10 +1412,10 @@ static const char GetCombinerInputParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_SUN_vertex)
-static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] =
- "ppp\0" /* Parameter signature */
- "glReplacementCodeuiNormal3fVertex3fvSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char CreateProgram_names[] =
+ "\0" /* Parameter signature */
+ "glCreateProgram\0"
"";
#endif
@@ -1599,9 +1653,10 @@ static const char VertexAttrib3dNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3dARB_names[] =
"iddd\0" /* Parameter signature */
+ "glVertexAttrib3d\0"
"glVertexAttrib3dARB\0"
"";
#endif
@@ -1613,9 +1668,10 @@ static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[]
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4fARB_names[] =
"iffff\0" /* Parameter signature */
+ "glVertexAttrib4f\0"
"glVertexAttrib4fARB\0"
"";
#endif
@@ -1664,9 +1720,10 @@ static const char SecondaryColorPointerEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4fv\0"
"glVertexAttrib4fvARB\0"
"";
#endif
@@ -1678,9 +1735,10 @@ static const char ColorPointerListIBM_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetActiveUniformARB_names[] =
"iiipppp\0" /* Parameter signature */
+ "glGetActiveUniform\0"
"glGetActiveUniformARB\0"
"";
#endif
@@ -1722,6 +1780,13 @@ static const char DeformationMap3dSGIX_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_0)
+static const char IsShader_names[] =
+ "i\0" /* Parameter signature */
+ "glIsShader\0"
+ "";
+#endif
+
#if defined(need_GL_HP_image_transform)
static const char GetImageTransformParameterivHP_names[] =
"iip\0" /* Parameter signature */
@@ -1766,9 +1831,10 @@ static const char ResizeBuffersMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformivARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetUniformiv\0"
"glGetUniformivARB\0"
"";
#endif
@@ -1860,6 +1926,13 @@ static const char MultiTexCoord3iARB_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_0)
+static const char IsProgram_names[] =
+ "i\0" /* Parameter signature */
+ "glIsProgram\0"
+ "";
+#endif
+
#if defined(need_GL_IBM_vertex_array_lists)
static const char TexCoordPointerListIBM_names[] =
"iiipi\0" /* Parameter signature */
@@ -1998,9 +2071,10 @@ static const char PointParameterivNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform2fv\0"
"glUniform2fvARB\0"
"";
#endif
@@ -2027,10 +2101,10 @@ static const char DeleteObjectARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
-static const char UseProgramObjectARB_names[] =
- "i\0" /* Parameter signature */
- "glUseProgramObjectARB\0"
+#if defined(need_GL_ARB_matrix_palette)
+static const char MatrixIndexPointerARB_names[] =
+ "iiip\0" /* Parameter signature */
+ "glMatrixIndexPointerARB\0"
"";
#endif
@@ -2055,10 +2129,18 @@ static const char BindFramebufferEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
-static const char VertexAttrib4usvARB_names[] =
- "ip\0" /* Parameter signature */
- "glVertexAttrib4usvARB\0"
+#if defined(need_GL_SGIX_reference_plane)
+static const char ReferencePlaneSGIX_names[] =
+ "p\0" /* Parameter signature */
+ "glReferencePlaneSGIX\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char ValidateProgramARB_names[] =
+ "i\0" /* Parameter signature */
+ "glValidateProgram\0"
+ "glValidateProgramARB\0"
"";
#endif
@@ -2100,9 +2182,10 @@ static const char CopyTexSubImage3D_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2dARB_names[] =
"idd\0" /* Parameter signature */
+ "glVertexAttrib2d\0"
"glVertexAttrib2dARB\0"
"";
#endif
@@ -2169,9 +2252,10 @@ static const char MultiTexCoord2sARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1dv\0"
"glVertexAttrib1dvARB\0"
"";
#endif
@@ -2226,9 +2310,10 @@ static const char DeformSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribfvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribfv\0"
"glGetVertexAttribfvARB\0"
"";
#endif
@@ -2241,6 +2326,13 @@ static const char SecondaryColor3ivEXT_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix4x2fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix4x2fv\0"
+ "";
+#endif
+
#if defined(need_GL_SGIS_detail_texture)
static const char GetDetailTexFuncSGIS_names[] =
"ip\0" /* Parameter signature */
@@ -2255,6 +2347,13 @@ static const char GetCombinerStageParameterfvNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_coordinate_frame)
+static const char Binormal3fEXT_names[] =
+ "fff\0" /* Parameter signature */
+ "glBinormal3fEXT\0"
+ "";
+#endif
+
#if defined(need_GL_SUN_vertex)
static const char Color4ubVertex2fvSUN_names[] =
"pp\0" /* Parameter signature */
@@ -2277,9 +2376,10 @@ static const char SampleMaskSGIS_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char GetAttribLocationARB_names[] =
"ip\0" /* Parameter signature */
+ "glGetAttribLocation\0"
"glGetAttribLocationARB\0"
"";
#endif
@@ -2328,9 +2428,10 @@ static const char ProgramEnvParameter4fARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform3ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform3iv\0"
"glUniform3ivARB\0"
"";
#endif
@@ -2365,10 +2466,10 @@ static const char MultiTexCoord4ivARB_names[] =
"";
#endif
-#if defined(need_GL_EXT_gpu_program_parameters)
-static const char ProgramLocalParameters4fvEXT_names[] =
- "iiip\0" /* Parameter signature */
- "glProgramLocalParameters4fvEXT\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetVertexAttribPointervARB_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetVertexAttribPointerv\0"
"";
#endif
@@ -2379,9 +2480,10 @@ static const char GetMapAttribParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4sARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glVertexAttrib4s\0"
"glVertexAttrib4sARB\0"
"";
#endif
@@ -2408,9 +2510,10 @@ static const char GenRenderbuffersEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2dv\0"
"glVertexAttrib2dvARB\0"
"";
#endif
@@ -2436,9 +2539,10 @@ static const char WeightbvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2fv\0"
"glVertexAttrib2fvARB\0"
"";
#endif
@@ -2472,17 +2576,18 @@ static const char InstrumentsBufferSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Niv\0"
"glVertexAttrib4NivARB\0"
"";
#endif
-#if defined(need_GL_SUN_triangle_list)
-static const char ReplacementCodeuivSUN_names[] =
- "p\0" /* Parameter signature */
- "glReplacementCodeuivSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetAttachedShaders_names[] =
+ "iipp\0" /* Parameter signature */
+ "glGetAttachedShaders\0"
"";
#endif
@@ -2500,6 +2605,13 @@ static const char ProgramEnvParameters4fvEXT_names[] =
"";
#endif
+#if defined(need_GL_SUN_vertex)
+static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] =
+ "pppp\0" /* Parameter signature */
+ "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+ "";
+#endif
+
#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos)
static const char WindowPos2iMESA_names[] =
"ii\0" /* Parameter signature */
@@ -2539,17 +2651,26 @@ static const char GetProgramStringARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char CompileShaderARB_names[] =
"i\0" /* Parameter signature */
+ "glCompileShader\0"
"glCompileShaderARB\0"
"";
#endif
-#if defined(need_GL_NV_register_combiners)
-static const char CombinerOutputNV_names[] =
- "iiiiiiiiii\0" /* Parameter signature */
- "glCombinerOutputNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DeleteShader_names[] =
+ "i\0" /* Parameter signature */
+ "glDeleteShader\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char Uniform3fARB_names[] =
+ "ifff\0" /* Parameter signature */
+ "glUniform3f\0"
+ "glUniform3fARB\0"
"";
#endif
@@ -2611,9 +2732,10 @@ static const char WindowPos4sMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NuivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nuiv\0"
"glVertexAttrib4NuivARB\0"
"";
#endif
@@ -2640,9 +2762,10 @@ static const char ReplacementCodeusvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4fARB_names[] =
"iffff\0" /* Parameter signature */
+ "glUniform4f\0"
"glUniform4fARB\0"
"";
#endif
@@ -2713,9 +2836,10 @@ static const char VertexWeightfvEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1dARB_names[] =
"id\0" /* Parameter signature */
+ "glVertexAttrib1d\0"
"glVertexAttrib1dARB\0"
"";
#endif
@@ -2779,9 +2903,17 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_ARB_vertex_program)
+static const char VertexAttrib4usvARB_names[] =
+ "ip\0" /* Parameter signature */
+ "glVertexAttrib4usvARB\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char LinkProgramARB_names[] =
"i\0" /* Parameter signature */
+ "glLinkProgram\0"
"glLinkProgramARB\0"
"";
#endif
@@ -2793,9 +2925,10 @@ static const char VertexAttrib2fNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char ShaderSourceARB_names[] =
"iipp\0" /* Parameter signature */
+ "glShaderSource\0"
"glShaderSourceARB\0"
"";
#endif
@@ -2807,9 +2940,10 @@ static const char FragmentMaterialiSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3sv\0"
"glVertexAttrib3svARB\0"
"";
#endif
@@ -2838,16 +2972,18 @@ static const char IsFramebufferEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform4iv\0"
"glUniform4ivARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char GetVertexAttribdvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetVertexAttribdv\0"
"glGetVertexAttribdvARB\0"
"";
#endif
@@ -2910,9 +3046,10 @@ static const char MultiDrawElementsEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1ivARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform1iv\0"
"glUniform1ivARB\0"
"";
#endif
@@ -2956,16 +3093,18 @@ static const char SecondaryColor3ubvEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4dvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4dv\0"
"glVertexAttrib4dvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_shader)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader)
static const char BindAttribLocationARB_names[] =
"iip\0" /* Parameter signature */
+ "glBindAttribLocation\0"
"glBindAttribLocationARB\0"
"";
#endif
@@ -3013,6 +3152,13 @@ static const char VertexAttribPointerNV_names[] =
"";
#endif
+#if defined(need_GL_EXT_gpu_program_parameters)
+static const char ProgramLocalParameters4fvEXT_names[] =
+ "iiip\0" /* Parameter signature */
+ "glProgramLocalParameters4fvEXT\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_framebuffer_object)
static const char GetFramebufferAttachmentParameterivEXT_names[] =
"iiip\0" /* Parameter signature */
@@ -3035,13 +3181,6 @@ static const char PixelTransformParameteriEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
-static const char ValidateProgramARB_names[] =
- "i\0" /* Parameter signature */
- "glValidateProgramARB\0"
- "";
-#endif
-
#if defined(need_GL_SUN_vertex)
static const char TexCoord2fColor4ubVertex3fSUN_names[] =
"ffiiiifff\0" /* Parameter signature */
@@ -3049,16 +3188,18 @@ static const char TexCoord2fColor4ubVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1iARB_names[] =
"ii\0" /* Parameter signature */
+ "glUniform1i\0"
"glUniform1iARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttribPointerARB_names[] =
"iiiiip\0" /* Parameter signature */
+ "glVertexAttribPointer\0"
"glVertexAttribPointerARB\0"
"";
#endif
@@ -3078,6 +3219,13 @@ static const char MultiTexCoord4fvARB_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix2x3fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix2x3fv\0"
+ "";
+#endif
+
#if defined(need_GL_NV_vertex_program)
static const char TrackMatrixNV_names[] =
"iiii\0" /* Parameter signature */
@@ -3120,16 +3268,18 @@ static const char Normal3fVertex3fvSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NsvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nsv\0"
"glVertexAttrib4NsvARB\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib3fv\0"
"glVertexAttrib3fvARB\0"
"";
#endif
@@ -3192,10 +3342,10 @@ static const char PixelTexGenParameterfSGIS_names[] =
"";
#endif
-#if defined(need_GL_SUN_vertex)
-static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] =
- "pppp\0" /* Parameter signature */
- "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+#if defined(need_GL_VERSION_2_0)
+static const char CreateShader_names[] =
+ "i\0" /* Parameter signature */
+ "glCreateShader\0"
"";
#endif
@@ -3258,16 +3408,17 @@ static const char FragmentLightfvSGIX_names[] =
"";
#endif
-#if defined(need_GL_NV_vertex_program)
-static const char VertexAttrib3sNV_names[] =
- "iiii\0" /* Parameter signature */
- "glVertexAttrib3sNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DetachShader_names[] =
+ "ii\0" /* Parameter signature */
+ "glDetachShader\0"
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NubARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glVertexAttrib4Nub\0"
"glVertexAttrib4NubARB\0"
"";
#endif
@@ -3293,9 +3444,10 @@ static const char VertexAttrib3svNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform4fv\0"
"glUniform4fvARB\0"
"";
#endif
@@ -3315,9 +3467,10 @@ static const char ColorFragmentOp1ATI_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformfvARB_names[] =
"iip\0" /* Parameter signature */
+ "glGetUniformfv\0"
"glGetUniformfvARB\0"
"";
#endif
@@ -3462,9 +3615,10 @@ static const char GetMapParameterivNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform4iARB_names[] =
"iiiii\0" /* Parameter signature */
+ "glUniform4i\0"
"glUniform4iARB\0"
"";
#endif
@@ -3501,6 +3655,13 @@ static const char GetColorTableParameteriv_names[] =
"";
#endif
+#if defined(need_GL_ARB_vertex_program)
+static const char ProgramEnvParameter4dvARB_names[] =
+ "iip\0" /* Parameter signature */
+ "glProgramEnvParameter4dvARB\0"
+ "";
+#endif
+
#if defined(need_GL_NV_vertex_program)
static const char VertexAttribs2fvNV_names[] =
"iip\0" /* Parameter signature */
@@ -3508,10 +3669,11 @@ static const char VertexAttribs2fvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_matrix_palette)
-static const char MatrixIndexPointerARB_names[] =
- "iiip\0" /* Parameter signature */
- "glMatrixIndexPointerARB\0"
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
+static const char UseProgramObjectARB_names[] =
+ "i\0" /* Parameter signature */
+ "glUseProgram\0"
+ "glUseProgramObjectARB\0"
"";
#endif
@@ -3529,10 +3691,10 @@ static const char PassTexCoordATI_names[] =
"";
#endif
-#if defined(need_GL_NV_vertex_program)
-static const char VertexAttrib1fvNV_names[] =
- "ip\0" /* Parameter signature */
- "glVertexAttrib1fvNV\0"
+#if defined(need_GL_VERSION_2_0)
+static const char DeleteProgram_names[] =
+ "i\0" /* Parameter signature */
+ "glDeleteProgram\0"
"";
#endif
@@ -3635,9 +3797,10 @@ static const char MultiTexCoord1dvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform2iARB_names[] =
"iii\0" /* Parameter signature */
+ "glUniform2i\0"
"glUniform2iARB\0"
"";
#endif
@@ -3729,9 +3892,10 @@ static const char VertexAttribs4dvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4dARB_names[] =
"idddd\0" /* Parameter signature */
+ "glVertexAttrib4d\0"
"glVertexAttrib4dARB\0"
"";
#endif
@@ -3907,9 +4071,10 @@ static const char GetFogFuncSGIS_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetUniformLocationARB_names[] =
"ip\0" /* Parameter signature */
+ "glGetUniformLocation\0"
"glGetUniformLocationARB\0"
"";
#endif
@@ -3929,13 +4094,21 @@ static const char CombinerInputNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib3sARB_names[] =
"iiii\0" /* Parameter signature */
+ "glVertexAttrib3s\0"
"glVertexAttrib3sARB\0"
"";
#endif
+#if defined(need_GL_SUN_vertex)
+static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] =
+ "ppp\0" /* Parameter signature */
+ "glReplacementCodeuiNormal3fVertex3fvSUN\0"
+ "";
+#endif
+
#if defined(need_GL_ARB_vertex_program)
static const char ProgramStringARB_names[] =
"iiip\0" /* Parameter signature */
@@ -3951,6 +4124,13 @@ static const char TexCoord4fVertex4fvSUN_names[] =
#endif
#if defined(need_GL_NV_vertex_program)
+static const char VertexAttrib3sNV_names[] =
+ "iiii\0" /* Parameter signature */
+ "glVertexAttrib3sNV\0"
+ "";
+#endif
+
+#if defined(need_GL_NV_vertex_program)
static const char VertexAttrib1fNV_names[] =
"if\0" /* Parameter signature */
"glVertexAttrib1fNV\0"
@@ -3994,9 +4174,10 @@ static const char ActiveStencilFaceEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char GetShaderSourceARB_names[] =
"iipp\0" /* Parameter signature */
+ "glGetShaderSource\0"
"glGetShaderSourceARB\0"
"";
#endif
@@ -4111,9 +4292,10 @@ static const char WeightsvARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects)
static const char Uniform1fvARB_names[] =
"iip\0" /* Parameter signature */
+ "glUniform1fv\0"
"glUniform1fvARB\0"
"";
#endif
@@ -4156,9 +4338,17 @@ static const char VertexAttribs3svNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_SUN_triangle_list)
+static const char ReplacementCodeuivSUN_names[] =
+ "p\0" /* Parameter signature */
+ "glReplacementCodeuivSUN\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char EnableVertexAttribArrayARB_names[] =
"i\0" /* Parameter signature */
+ "glEnableVertexAttribArray\0"
"glEnableVertexAttribArrayARB\0"
"";
#endif
@@ -4216,10 +4406,10 @@ static const char Tangent3bvEXT_names[] =
"";
#endif
-#if defined(need_GL_SGIX_reference_plane)
-static const char ReferencePlaneSGIX_names[] =
- "p\0" /* Parameter signature */
- "glReferencePlaneSGIX\0"
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix3x4fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix3x4fv\0"
"";
#endif
@@ -4305,9 +4495,10 @@ static const char BindProgramNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4sv\0"
"glVertexAttrib4svARB\0"
"";
#endif
@@ -4319,10 +4510,10 @@ static const char CreateDebugObjectMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_shader_objects)
-static const char Uniform3fARB_names[] =
- "ifff\0" /* Parameter signature */
- "glUniform3fARB\0"
+#if defined(need_GL_VERSION_2_0)
+static const char GetShaderiv_names[] =
+ "iip\0" /* Parameter signature */
+ "glGetShaderiv\0"
"";
#endif
@@ -4378,9 +4569,17 @@ static const char GetFinalCombinerInputParameterfvNV_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_ATI_fragment_shader)
+static const char ColorFragmentOp3ATI_names[] =
+ "iiiiiiiiiiiii\0" /* Parameter signature */
+ "glColorFragmentOp3ATI\0"
+ "";
+#endif
+
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2svARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib2sv\0"
"glVertexAttrib2svARB\0"
"";
#endif
@@ -4423,9 +4622,10 @@ static const char PollInstrumentsSGIX_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4NubvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4Nubv\0"
"glVertexAttrib4NubvARB\0"
"";
#endif
@@ -4530,9 +4730,10 @@ static const char WeightuivARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib2sARB_names[] =
"iii\0" /* Parameter signature */
+ "glVertexAttrib2s\0"
"glVertexAttrib2sARB\0"
"";
#endif
@@ -4580,6 +4781,13 @@ static const char EdgeFlagPointerListIBM_names[] =
"";
#endif
+#if defined(need_GL_VERSION_2_1)
+static const char UniformMatrix3x2fv_names[] =
+ "iiip\0" /* Parameter signature */
+ "glUniformMatrix3x2fv\0"
+ "";
+#endif
+
#if defined(need_GL_EXT_histogram)
static const char GetMinmaxParameterfv_names[] =
"iip\0" /* Parameter signature */
@@ -4588,9 +4796,10 @@ static const char GetMinmaxParameterfv_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib1fvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib1fv\0"
"glVertexAttrib1fvARB\0"
"";
#endif
@@ -4697,9 +4906,9 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = {
static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = {
{ MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 },
{ MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 },
+ { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 },
{ CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 },
{ MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 },
- { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -4752,26 +4961,26 @@ static const struct dri_extension_function GL_ARB_shader_objects_functions[] = {
{ GetUniformivARB_names, GetUniformivARB_remap_index, -1 },
{ Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 },
{ DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 },
- { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
+ { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
{ Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
{ CompileShaderARB_names, CompileShaderARB_remap_index, -1 },
+ { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
{ Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
{ LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
{ ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
{ Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 },
{ Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 },
- { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
{ Uniform1iARB_names, Uniform1iARB_remap_index, -1 },
{ Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 },
{ GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 },
{ DetachObjectARB_names, DetachObjectARB_remap_index, -1 },
{ Uniform4iARB_names, Uniform4iARB_remap_index, -1 },
+ { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
{ Uniform2iARB_names, Uniform2iARB_remap_index, -1 },
{ GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 },
{ GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 },
{ GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 },
{ Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
- { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
{ GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 },
{ GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 },
{ NULL, 0, 0 }
@@ -4836,7 +5045,6 @@ static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions
#if defined(need_GL_ARB_vertex_program)
static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
- { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 },
{ VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 },
{ VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 },
{ VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 },
@@ -4856,7 +5064,6 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
{ VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
{ ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 },
- { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 },
{ VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
{ GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
@@ -4871,6 +5078,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ IsProgramNV_names, IsProgramNV_remap_index, -1 },
{ ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 },
{ VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
+ { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
{ GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 },
{ VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 },
@@ -4879,6 +5087,7 @@ static const struct dri_extension_function GL_ARB_vertex_program_functions[] = {
{ VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 },
{ VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 },
{ GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 },
+ { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 },
{ ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 },
{ DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 },
{ GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 },
@@ -4949,7 +5158,6 @@ static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = {
#if defined(need_GL_ATI_fragment_shader)
static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = {
- { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 },
{ ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 },
{ DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 },
{ SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 },
@@ -4961,6 +5169,7 @@ static const struct dri_extension_function GL_ATI_fragment_shader_functions[] =
{ PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 },
{ BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 },
{ BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 },
+ { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 },
{ GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 },
{ EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 },
{ NULL, 0, 0 }
@@ -5032,11 +5241,11 @@ static const struct dri_extension_function GL_EXT_convolution_functions[] = {
#if defined(need_GL_EXT_coordinate_frame)
static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = {
- { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 },
{ TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 },
{ Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 },
{ Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 },
{ Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 },
+ { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 },
{ Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 },
{ Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 },
{ Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 },
@@ -5134,8 +5343,8 @@ static const struct dri_extension_function GL_EXT_framebuffer_object_functions[]
#if defined(need_GL_EXT_gpu_program_parameters)
static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = {
- { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 },
{ ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 },
+ { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5475,12 +5684,12 @@ static const struct dri_extension_function GL_NV_point_sprite_functions[] = {
#if defined(need_GL_NV_register_combiners)
static const struct dri_extension_function GL_NV_register_combiners_functions[] = {
+ { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 },
{ CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 },
{ GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 },
{ FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 },
{ GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 },
{ GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 },
- { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 },
{ CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 },
{ GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 },
{ CombinerInputNV_names, CombinerInputNV_remap_index, -1 },
@@ -5514,6 +5723,7 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 },
{ VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 },
{ VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 },
+ { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 },
{ ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, -1 },
{ VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 },
{ VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 },
@@ -5546,7 +5756,6 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 },
{ TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 },
{ GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 },
- { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 },
{ GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 },
{ VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 },
{ ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 },
@@ -5554,13 +5763,13 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = {
{ GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 },
{ VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 },
{ VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 },
- { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 },
{ DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 },
{ GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 },
{ GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 },
{ VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 },
{ VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 },
{ ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 },
+ { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 },
{ VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 },
{ VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 },
{ VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 },
@@ -5827,11 +6036,11 @@ static const struct dri_extension_function GL_SUN_mesh_array_functions[] = {
static const struct dri_extension_function GL_SUN_triangle_list_functions[] = {
{ ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 },
{ ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 },
- { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 },
{ ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 },
{ ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 },
{ ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 },
{ ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 },
+ { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
@@ -5853,7 +6062,6 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = {
{ ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 },
{ TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 },
{ Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 },
- { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 },
{ Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 },
{ Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 },
{ ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 },
@@ -5864,18 +6072,19 @@ static const struct dri_extension_function GL_SUN_vertex_functions[] = {
{ Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 },
{ Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 },
{ ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 },
+ { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 },
{ TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 },
{ Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 },
{ ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 },
{ TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 },
{ Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 },
{ Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 },
- { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 },
{ ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 },
{ ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 },
{ ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 },
{ TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 },
{ TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 },
+ { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 },
{ TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 },
{ ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 },
{ NULL, 0, 0 }
@@ -6012,11 +6221,106 @@ static const struct dri_extension_function GL_VERSION_1_5_functions[] = {
#if defined(need_GL_VERSION_2_0)
static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
+ { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 },
+ { GetProgramiv_names, GetProgramiv_remap_index, -1 },
{ BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 },
+ { AttachShader_names, AttachShader_remap_index, -1 },
+ { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 },
+ { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 },
+ { Uniform2fARB_names, Uniform2fARB_remap_index, -1 },
+ { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 },
+ { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 },
+ { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 },
+ { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 },
+ { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 },
{ StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 },
+ { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 },
+ { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 },
+ { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 },
+ { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 },
+ { Uniform3iARB_names, Uniform3iARB_remap_index, -1 },
+ { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 },
+ { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 },
+ { Uniform1fARB_names, Uniform1fARB_remap_index, -1 },
{ StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 },
+ { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 },
+ { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 },
+ { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 },
+ { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 },
+ { CreateProgram_names, CreateProgram_remap_index, -1 },
{ StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 },
+ { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 },
+ { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
+ { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
+ { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 },
+ { IsShader_names, IsShader_remap_index, -1 },
+ { GetUniformivARB_names, GetUniformivARB_remap_index, -1 },
+ { IsProgram_names, IsProgram_remap_index, -1 },
+ { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 },
+ { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 },
+ { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 },
+ { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
+ { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
+ { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 },
+ { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
+ { GetVertexAttribPointervARB_names, GetVertexAttribPointervARB_remap_index, -1 },
+ { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 },
+ { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 },
+ { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 },
+ { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 },
+ { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 },
+ { CompileShaderARB_names, CompileShaderARB_remap_index, -1 },
+ { DeleteShader_names, DeleteShader_remap_index, -1 },
+ { Uniform3fARB_names, Uniform3fARB_remap_index, -1 },
+ { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 },
+ { Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
+ { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
+ { LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
+ { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
+ { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
+ { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 },
+ { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 },
+ { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 },
+ { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 },
+ { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 },
+ { Uniform1iARB_names, Uniform1iARB_remap_index, -1 },
+ { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 },
+ { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 },
+ { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 },
+ { CreateShader_names, CreateShader_remap_index, -1 },
+ { DetachShader_names, DetachShader_remap_index, -1 },
+ { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 },
+ { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 },
+ { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 },
+ { Uniform4iARB_names, Uniform4iARB_remap_index, -1 },
+ { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 },
+ { DeleteProgram_names, DeleteProgram_remap_index, -1 },
+ { Uniform2iARB_names, Uniform2iARB_remap_index, -1 },
+ { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 },
+ { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 },
+ { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 },
+ { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 },
{ DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 },
+ { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
+ { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 },
+ { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 },
+ { GetShaderiv_names, GetShaderiv_remap_index, -1 },
+ { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 },
+ { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 },
+ { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 },
+ { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 },
+ { NULL, 0, 0 }
+};
+#endif
+
+#if defined(need_GL_VERSION_2_1)
+static const struct dri_extension_function GL_VERSION_2_1_functions[] = {
+ { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 },
+ { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 },
+ { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 },
+ { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 },
+ { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 },
+ { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 },
{ NULL, 0, 0 }
};
#endif
diff --git a/src/mesa/drivers/dri/common/xmlpool/.gitignore b/src/mesa/drivers/dri/common/xmlpool/.gitignore
new file mode 100644
index 00000000000..a5a437849ba
--- /dev/null
+++ b/src/mesa/drivers/dri/common/xmlpool/.gitignore
@@ -0,0 +1,5 @@
+de
+es
+fr
+nl
+sv
diff --git a/src/mesa/drivers/dri/common/xmlpool/Makefile b/src/mesa/drivers/dri/common/xmlpool/Makefile
index ef94541c374..b077809cd18 100644
--- a/src/mesa/drivers/dri/common/xmlpool/Makefile
+++ b/src/mesa/drivers/dri/common/xmlpool/Makefile
@@ -41,7 +41,7 @@
# - info gettext
# The set of supported languages. Add languages as needed.
-POS=de.po es.po nl.po fr.po
+POS=de.po es.po nl.po fr.po sv.po
#
# Don't change anything below, unless you know what you're doing.
diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h
index 5cef72867b1..d5f4fc34917 100644
--- a/src/mesa/drivers/dri/common/xmlpool/options.h
+++ b/src/mesa/drivers/dri/common/xmlpool/options.h
@@ -58,7 +58,8 @@ DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(de,"Fehlersuche") \
DRI_CONF_DESC(es,"Depurando") \
DRI_CONF_DESC(nl,"Debuggen") \
- DRI_CONF_DESC(fr,"Debogage")
+ DRI_CONF_DESC(fr,"Debogage") \
+ DRI_CONF_DESC(sv,"Felsökning")
#define DRI_CONF_NO_RAST(def) \
DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
@@ -67,6 +68,7 @@ DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
DRI_CONF_DESC(es,"Desactivar aceleración 3D") \
DRI_CONF_DESC(nl,"3D versnelling uitschakelen") \
DRI_CONF_DESC(fr,"Désactiver l'accélération 3D") \
+ DRI_CONF_DESC(sv,"Inaktivera 3D-accelerering") \
DRI_CONF_OPT_END
#define DRI_CONF_PERFORMANCE_BOXES(def) \
@@ -76,6 +78,7 @@ DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
DRI_CONF_DESC(es,"Mostrar cajas de rendimiento") \
DRI_CONF_DESC(nl,"Laat prestatie boxjes zien") \
DRI_CONF_DESC(fr,"Afficher les boîtes de performance") \
+ DRI_CONF_DESC(sv,"Visa prestandarutor") \
DRI_CONF_OPT_END
@@ -86,7 +89,8 @@ DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(de,"Bildqualität") \
DRI_CONF_DESC(es,"Calidad de imagen") \
DRI_CONF_DESC(nl,"Beeldkwaliteit") \
- DRI_CONF_DESC(fr,"Qualité d'image")
+ DRI_CONF_DESC(fr,"Qualité d'image") \
+ DRI_CONF_DESC(sv,"Bildkvalitet")
#define DRI_CONF_EXCESS_MIPMAP(def) \
DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
@@ -129,6 +133,12 @@ DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
DRI_CONF_ENUM(2,"Prérérer 16 bits par texel") \
DRI_CONF_ENUM(3,"Forcer 16 bits par texel") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Färgdjup för texturer") \
+ DRI_CONF_ENUM(0,"Föredra färgdjupet för framebuffer") \
+ DRI_CONF_ENUM(1,"Föredra 32 bitar per texel") \
+ DRI_CONF_ENUM(2,"Föredra 16 bitar per texel") \
+ DRI_CONF_ENUM(3,"Tvinga 16 bitar per texel") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
@@ -138,6 +148,7 @@ DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
DRI_CONF_DESC(es,"Valor máximo inicial para filtrado anisotrópico de textura") \
DRI_CONF_DESC(nl,"Initïele maximum waarde voor anisotrophische textuur filtering") \
DRI_CONF_DESC(fr,"Valeur maximale initiale pour le filtrage anisotropique de texture") \
+ DRI_CONF_DESC(sv,"Initialt maximalt värde för anisotropisk texturfiltrering") \
DRI_CONF_OPT_END
#define DRI_CONF_NO_NEG_LOD_BIAS(def) \
@@ -147,6 +158,7 @@ DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
DRI_CONF_DESC(es,"Prohibir valores negativos de Nivel De Detalle (LOD) de texturas") \
DRI_CONF_DESC(nl,"Verbied negatief niveau detailonderscheid (LOD) van texturen") \
DRI_CONF_DESC(fr,"Interdire le LOD bias negatif") \
+ DRI_CONF_DESC(sv,"Förbjud negativ LOD-kompensation för texturer") \
DRI_CONF_OPT_END
#define DRI_CONF_FORCE_S3TC_ENABLE(def) \
@@ -156,6 +168,7 @@ DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
DRI_CONF_DESC(es,"Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible") \
DRI_CONF_DESC(nl,"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet aanwezig is") \
DRI_CONF_DESC(fr,"Activer la compression de texture S3TC même si le support logiciel est absent") \
+ DRI_CONF_DESC(sv,"Aktivera S3TC-texturkomprimering även om programvarustöd saknas") \
DRI_CONF_OPT_END
#define DRI_CONF_COLOR_REDUCTION_ROUND 0
@@ -182,6 +195,10 @@ DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
DRI_CONF_ENUM(0,"Arrondir les valeurs de couleur") \
DRI_CONF_ENUM(1,"Tramer les couleurs") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Initial färgminskningsmetod") \
+ DRI_CONF_ENUM(0,"Avrunda färger") \
+ DRI_CONF_ENUM(1,"Utjämna färger") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_ROUND_TRUNC 0
@@ -208,6 +225,10 @@ DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
DRI_CONF_ENUM(0,"Arrondi à l'inférieur") \
DRI_CONF_ENUM(1,"Arrondi au plus proche") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Färgavrundningsmetod") \
+ DRI_CONF_ENUM(0,"Avrunda färdkomponenter nedåt") \
+ DRI_CONF_ENUM(1,"Avrunda till närmsta färg") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_DITHER_XERRORDIFF 0
@@ -240,6 +261,11 @@ DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
DRI_CONF_ENUM(1,"Diffusion d'erreur horizontale, réinitialisé pour chaque ligne") \
DRI_CONF_ENUM(2,"Tramage ordonné des couleurs") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Färgutjämningsmetod") \
+ DRI_CONF_ENUM(0,"Horisontell felspridning") \
+ DRI_CONF_ENUM(1,"Horisontell felspridning, återställ fel vid radbörjan") \
+ DRI_CONF_ENUM(2,"Ordnad 2D-färgutjämning") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_FLOAT_DEPTH(def) \
@@ -249,6 +275,7 @@ DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
DRI_CONF_DESC(es,"Búfer de profundidad en coma flotante") \
DRI_CONF_DESC(nl,"Dieptebuffer als commagetal") \
DRI_CONF_DESC(fr,"Z-buffer en virgule flottante") \
+ DRI_CONF_DESC(sv,"Buffert för flytande punktdjup") \
DRI_CONF_OPT_END
/** \brief Performance-related options */
@@ -258,7 +285,8 @@ DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(de,"Leistung") \
DRI_CONF_DESC(es,"Rendimiento") \
DRI_CONF_DESC(nl,"Prestatie") \
- DRI_CONF_DESC(fr,"Performance")
+ DRI_CONF_DESC(fr,"Performance") \
+ DRI_CONF_DESC(sv,"Prestanda")
#define DRI_CONF_TCL_SW 0
#define DRI_CONF_TCL_PIPELINED 1
@@ -296,6 +324,12 @@ DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
DRI_CONF_ENUM(2,"Court-circuiter le pipeline TCL") \
DRI_CONF_ENUM(3,"Court-circuiter le pipeline TCL par une machine à états qui génère le codede TCL à la volée") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"TCL-läge (Transformation, Clipping, Lighting)") \
+ DRI_CONF_ENUM(0,"Använd programvaru-TCL-rörledning") \
+ DRI_CONF_ENUM(1,"Använd maskinvaru-TCL som första TCL-rörledningssteg") \
+ DRI_CONF_ENUM(2,"Kringgå TCL-rörledningen") \
+ DRI_CONF_ENUM(3,"Kringgå TCL-rörledningen med tillståndsbaserad maskinkod som direktgenereras") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_FTHROTTLE_BUSY 0
@@ -328,6 +362,11 @@ DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
DRI_CONF_ENUM(1,"Attente utilisant usleep()") \
DRI_CONF_ENUM(2,"Utiliser les interruptions") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Metod för att begränsa renderingslatens") \
+ DRI_CONF_ENUM(0,"Upptagen med att vänta på grafikhårdvaran") \
+ DRI_CONF_ENUM(1,"Sov i korta intervall under väntan på grafikhårdvaran") \
+ DRI_CONF_ENUM(2,"Låt grafikhårdvaran sända ut ett programvaruavbrott och sov") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_VBLANK_NEVER 0
@@ -366,6 +405,12 @@ DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
DRI_CONF_ENUM(2,"Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \
DRI_CONF_ENUM(3,"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Synkronisering med vertikal uppdatering (växlingsintervall)") \
+ DRI_CONF_ENUM(0,"Synkronisera aldrig med vertikal uppdatering, ignorera programmets val") \
+ DRI_CONF_ENUM(1,"Initialt växlingsintervall 0, följ programmets val") \
+ DRI_CONF_ENUM(2,"Initialt växlingsintervall 1, följ programmets val") \
+ DRI_CONF_ENUM(3,"Synkronisera alltid med vertikal uppdatering, programmet väljer den minsta växlingsintervallen") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_HYPERZ_DISABLED 0
@@ -377,6 +422,7 @@ DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
DRI_CONF_DESC(es,"Usar HyperZ para potenciar rendimiento") \
DRI_CONF_DESC(nl,"Gebruik HyperZ om de prestaties te verbeteren") \
DRI_CONF_DESC(fr,"Utiliser le HyperZ pour améliorer les performances") \
+ DRI_CONF_DESC(sv,"Använd HyperZ för att maximera prestandan") \
DRI_CONF_OPT_END
#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
@@ -386,6 +432,7 @@ DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
DRI_CONF_DESC(es,"Número de unidades de textura usadas") \
DRI_CONF_DESC(nl,"Aantal textuureenheden in gebruik") \
DRI_CONF_DESC(fr,"Nombre d'unités de texture") \
+ DRI_CONF_DESC(sv,"Antal använda texturenheter") \
DRI_CONF_OPT_END
#define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \
@@ -415,6 +462,11 @@ DRI_CONF_OPT_BEGIN_V(allow_large_textures,enum,def,"0:2") \
DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \
DRI_CONF_ENUM(2,"Announce hardware limits") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Stöd för större texturer är inte garanterat att passa i grafikminnet") \
+ DRI_CONF_ENUM(0,"Nej") \
+ DRI_CONF_ENUM(1,"Åtminstone en textur måste passa för antaget sämsta förhållande") \
+ DRI_CONF_ENUM(2,"Annonsera hårdvarubegränsningar") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
@@ -424,6 +476,7 @@ DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
DRI_CONF_DESC(es,"Calidad de filtrado de textura vs. velocidad, alias filtrado ”brilinear“ de textura") \
DRI_CONF_DESC(nl,"Textuurfilterkwaliteit versus -snelheid, ookwel bekend als “brilineaire” textuurfiltering") \
DRI_CONF_DESC(fr,"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)") \
+ DRI_CONF_DESC(sv,"Texturfiltreringskvalitet mot hastighet, även kallad ”brilinear”-texturfiltrering") \
DRI_CONF_OPT_END
#define DRI_CONF_TEXTURE_HEAPS_ALL 0
@@ -456,6 +509,11 @@ DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
DRI_CONF_ENUM(1,"Utiliser uniquement la mémoire graphique (si disponible)") \
DRI_CONF_ENUM(2,"Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)") \
DRI_CONF_DESC_END \
+ DRI_CONF_DESC_BEGIN(sv,"Använda typer av texturminne") \
+ DRI_CONF_ENUM(0,"Allt tillgängligt minne") \
+ DRI_CONF_ENUM(1,"Endast kortminne (om tillgängligt)") \
+ DRI_CONF_ENUM(2,"Endast GART-minne (AGP/PCIE) (om tillgängligt)") \
+ DRI_CONF_DESC_END \
DRI_CONF_OPT_END
/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
@@ -466,7 +524,8 @@ DRI_CONF_SECTION_BEGIN \
DRI_CONF_DESC(de,"Funktionalität, die nicht hardwarebeschleunigt ist") \
DRI_CONF_DESC(es,"Características no aceleradas por hardware") \
DRI_CONF_DESC(nl,"Eigenschappen die niet hardwareversneld zijn") \
- DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle")
+ DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle") \
+ DRI_CONF_DESC(sv,"Funktioner som inte är hårdvaruaccelererade")
#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
@@ -475,6 +534,7 @@ DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
DRI_CONF_DESC(es,"Activar la extensión GL_ARB_vertex_program") \
DRI_CONF_DESC(nl,"Zet uitbreiding GL_ARB_vertex_program aan") \
DRI_CONF_DESC(fr,"Activer l'extension GL_ARB_vertex_program") \
+ DRI_CONF_DESC(sv,"Aktivera tillägget GL_ARB_vertex_program") \
DRI_CONF_OPT_END
#define DRI_CONF_NV_VERTEX_PROGRAM(def) \
@@ -484,4 +544,5 @@ DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
DRI_CONF_DESC(es,"Activar extensión GL_NV_vertex_program") \
DRI_CONF_DESC(nl,"Zet uitbreiding GL_NV_vertex_program aan") \
DRI_CONF_DESC(fr,"Activer l'extension GL_NV_vertex_program") \
+ DRI_CONF_DESC(sv,"Aktivera tillägget GL_NV_vertex_program") \
DRI_CONF_OPT_END
diff --git a/src/mesa/drivers/dri/common/xmlpool/sv.po b/src/mesa/drivers/dri/common/xmlpool/sv.po
new file mode 100644
index 00000000000..ba32b2ff15a
--- /dev/null
+++ b/src/mesa/drivers/dri/common/xmlpool/sv.po
@@ -0,0 +1,226 @@
+# Swedish translation of DRI driver options.
+# Copyright (C) Free Software Foundation, Inc.
+# This file is distributed under the same license as the Mesa package.
+# Daniel Nylander <[email protected]>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Mesa DRI\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2005-04-11 23:19+0200\n"
+"PO-Revision-Date: 2006-09-18 10:56+0100\n"
+"Last-Translator: Daniel Nylander <[email protected]>\n"
+"Language-Team: Swedish <[email protected]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: t_options.h:53
+msgid "Debugging"
+msgstr "Felsökning"
+
+#: t_options.h:57
+msgid "Disable 3D acceleration"
+msgstr "Inaktivera 3D-accelerering"
+
+#: t_options.h:62
+msgid "Show performance boxes"
+msgstr "Visa prestandarutor"
+
+#: t_options.h:69
+msgid "Image Quality"
+msgstr "Bildkvalitet"
+
+#: t_options.h:77
+msgid "Texture color depth"
+msgstr "Färgdjup för texturer"
+
+#: t_options.h:78
+msgid "Prefer frame buffer color depth"
+msgstr "Föredra färgdjupet för framebuffer"
+
+#: t_options.h:79
+msgid "Prefer 32 bits per texel"
+msgstr "Föredra 32 bitar per texel"
+
+#: t_options.h:80
+msgid "Prefer 16 bits per texel"
+msgstr "Föredra 16 bitar per texel"
+
+#: t_options.h:81
+msgid "Force 16 bits per texel"
+msgstr "Tvinga 16 bitar per texel"
+
+#: t_options.h:87
+msgid "Initial maximum value for anisotropic texture filtering"
+msgstr "Initialt maximalt värde för anisotropisk texturfiltrering"
+
+#: t_options.h:92
+msgid "Forbid negative texture LOD bias"
+msgstr "Förbjud negativ LOD-kompensation för texturer"
+
+#: t_options.h:97
+msgid "Enable S3TC texture compression even if software support is not available"
+msgstr "Aktivera S3TC-texturkomprimering även om programvarustöd saknas"
+
+#: t_options.h:104
+msgid "Initial color reduction method"
+msgstr "Initial färgminskningsmetod"
+
+#: t_options.h:105
+msgid "Round colors"
+msgstr "Avrunda färger"
+
+#: t_options.h:106
+msgid "Dither colors"
+msgstr "Utjämna färger"
+
+#: t_options.h:114
+msgid "Color rounding method"
+msgstr "Färgavrundningsmetod"
+
+#: t_options.h:115
+msgid "Round color components downward"
+msgstr "Avrunda färdkomponenter nedåt"
+
+#: t_options.h:116
+msgid "Round to nearest color"
+msgstr "Avrunda till närmsta färg"
+
+#: t_options.h:125
+msgid "Color dithering method"
+msgstr "Färgutjämningsmetod"
+
+#: t_options.h:126
+msgid "Horizontal error diffusion"
+msgstr "Horisontell felspridning"
+
+#: t_options.h:127
+msgid "Horizontal error diffusion, reset error at line start"
+msgstr "Horisontell felspridning, återställ fel vid radbörjan"
+
+#: t_options.h:128
+msgid "Ordered 2D color dithering"
+msgstr "Ordnad 2D-färgutjämning"
+
+#: t_options.h:134
+msgid "Floating point depth buffer"
+msgstr "Buffert för flytande punktdjup"
+
+#: t_options.h:140
+msgid "Performance"
+msgstr "Prestanda"
+
+#: t_options.h:148
+msgid "TCL mode (Transformation, Clipping, Lighting)"
+msgstr "TCL-läge (Transformation, Clipping, Lighting)"
+
+#: t_options.h:149
+msgid "Use software TCL pipeline"
+msgstr "Använd programvaru-TCL-rörledning"
+
+#: t_options.h:150
+msgid "Use hardware TCL as first TCL pipeline stage"
+msgstr "Använd maskinvaru-TCL som första TCL-rörledningssteg"
+
+#: t_options.h:151
+msgid "Bypass the TCL pipeline"
+msgstr "Kringgå TCL-rörledningen"
+
+#: t_options.h:152
+msgid "Bypass the TCL pipeline with state-based machine code generated on-the-fly"
+msgstr "Kringgå TCL-rörledningen med tillståndsbaserad maskinkod som direktgenereras"
+
+#: t_options.h:161
+msgid "Method to limit rendering latency"
+msgstr "Metod för att begränsa renderingslatens"
+
+#: t_options.h:162
+msgid "Busy waiting for the graphics hardware"
+msgstr "Upptagen med att vänta på grafikhårdvaran"
+
+#: t_options.h:163
+msgid "Sleep for brief intervals while waiting for the graphics hardware"
+msgstr "Sov i korta intervall under väntan på grafikhårdvaran"
+
+#: t_options.h:164
+msgid "Let the graphics hardware emit a software interrupt and sleep"
+msgstr "Låt grafikhårdvaran sända ut ett programvaruavbrott och sov"
+
+#: t_options.h:174
+msgid "Synchronization with vertical refresh (swap intervals)"
+msgstr "Synkronisering med vertikal uppdatering (växlingsintervall)"
+
+#: t_options.h:175
+msgid "Never synchronize with vertical refresh, ignore application's choice"
+msgstr "Synkronisera aldrig med vertikal uppdatering, ignorera programmets val"
+
+#: t_options.h:176
+msgid "Initial swap interval 0, obey application's choice"
+msgstr "Initialt växlingsintervall 0, följ programmets val"
+
+#: t_options.h:177
+msgid "Initial swap interval 1, obey application's choice"
+msgstr "Initialt växlingsintervall 1, följ programmets val"
+
+#: t_options.h:178
+msgid "Always synchronize with vertical refresh, application chooses the minimum swap interval"
+msgstr "Synkronisera alltid med vertikal uppdatering, programmet väljer den minsta växlingsintervallen"
+
+#: t_options.h:186
+msgid "Use HyperZ to boost performance"
+msgstr "Använd HyperZ för att maximera prestandan"
+
+#: t_options.h:191
+msgid "Number of texture units used"
+msgstr "Antal använda texturenheter"
+
+#: t_options.h:196
+msgid "Support larger textures not guaranteed to fit into graphics memory"
+msgstr "Stöd för större texturer är inte garanterat att passa i grafikminnet"
+
+#: t_options.h:197
+msgid "No"
+msgstr "Nej"
+
+#: t_options.h:198
+msgid "At least 1 texture must fit under worst-case assumptions"
+msgstr "Åtminstone en textur måste passa för antaget sämsta förhållande"
+
+#: t_options.h:199
+msgid "Announce hardware limits"
+msgstr "Annonsera hårdvarubegränsningar"
+
+#: t_options.h:205
+msgid "Texture filtering quality vs. speed, AKA “brilinear” texture filtering"
+msgstr "Texturfiltreringskvalitet mot hastighet, även kallad \"brilinear\"-texturfiltrering"
+
+#: t_options.h:213
+msgid "Used types of texture memory"
+msgstr "Använda typer av texturminne"
+
+#: t_options.h:214
+msgid "All available memory"
+msgstr "Allt tillgängligt minne"
+
+#: t_options.h:215
+msgid "Only card memory (if available)"
+msgstr "Endast kortminne (om tillgängligt)"
+
+#: t_options.h:216
+msgid "Only GART (AGP/PCIE) memory (if available)"
+msgstr "Endast GART-minne (AGP/PCIE) (om tillgängligt)"
+
+#: t_options.h:224
+msgid "Features that are not hardware-accelerated"
+msgstr "Funktioner som inte är hårdvaruaccelererade"
+
+#: t_options.h:228
+msgid "Enable extension GL_ARB_vertex_program"
+msgstr "Aktivera tillägget GL_ARB_vertex_program"
+
+#: t_options.h:233
+msgid "Enable extension GL_NV_vertex_program"
+msgstr "Aktivera tillägget GL_NV_vertex_program"
+
diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c
index dbf5f043498..c1d7fe349c0 100644
--- a/src/mesa/drivers/dri/i915/i830_metaops.c
+++ b/src/mesa/drivers/dri/i915/i830_metaops.c
@@ -50,7 +50,6 @@
#define SET_STATE( i830, STATE ) \
do { \
- assert(!i830->intel.prim.flush); \
i830->current->emitted = 0; \
i830->current = &i830->STATE; \
i830->current->emitted = 0; \
@@ -907,7 +906,6 @@ i830RotateWindow(intelContextPtr intel, __DRIdrawablePrivate *dPriv,
} /* cliprect loop */
- assert(!intel->prim.flush);
intelFlushBatchLocked( intel, GL_FALSE, GL_FALSE, GL_FALSE );
done:
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
index ec9dca6231e..95125190108 100644
--- a/src/mesa/drivers/dri/i915/i830_state.c
+++ b/src/mesa/drivers/dri/i915/i830_state.c
@@ -225,7 +225,7 @@ static void i830EvalLogicOpBlendState(GLcontext *ctx)
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
ENABLE_LOGIC_OP_MASK);
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 7160234bced..ef14f3eef7c 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -39,6 +39,7 @@
#include "program_instruction.h"
#include "program.h"
+#include "programopt.h"
@@ -123,6 +124,7 @@ static GLuint src_vector( struct i915_fragment_program *p,
p, p->ctx->FragmentProgram.Parameters[source->Index]);
break;
+ case PROGRAM_CONSTANT:
case PROGRAM_STATE_VAR:
case PROGRAM_NAMED_PARAM:
src = i915_emit_param4fv(
@@ -937,6 +939,12 @@ static void i915ProgramStringNotify( GLcontext *ctx,
*/
ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB,
ctx->FragmentProgram.Enabled );
+
+ if (p->FragProg.FogOption) {
+ /* add extra instructions to do fog, then turn off FogOption field */
+ _mesa_append_fog_code(ctx, &p->FragProg);
+ p->FragProg.FogOption = GL_NONE;
+ }
}
_tnl_program_string(ctx, target, prog);
@@ -1010,7 +1018,10 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 )
EMIT_PAD( 1 );
}
-#if 0
+ /* XXX this was disabled, but enabling this code helped fix the Glean
+ * tfragprog1 fog tests.
+ */
+#if 1
if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 );
}
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index 0faadb4f1a7..9c13290d118 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -369,10 +369,7 @@ GLuint i915_emit_param4fv( struct i915_fragment_program *p,
void i915_program_error( struct i915_fragment_program *p, const char *msg )
{
- /* XXX we shouldn't print anything to stdout, record GL error or
- * call _mesa_problem()
- */
- fprintf(stderr, "%s\n", msg);
+ _mesa_problem(NULL, "i915_program_error: %s", msg);
p->error = 1;
}
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index db5bb9ddc78..3cec6a2ddfc 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -141,7 +141,7 @@ static void i915EvalLogicOpBlendState(GLcontext *ctx)
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
} else {
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 3d543b2485f..7bb00d98339 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -242,7 +242,6 @@ void intelInitDriverFunctions( struct dd_function_table *functions )
functions->Clear = intelClear;
functions->Flush = intelglFlush;
functions->Finish = intelFinish;
- functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;
diff --git a/src/mesa/drivers/dri/i915tex/Makefile b/src/mesa/drivers/dri/i915tex/Makefile
index 94879d209f7..3b3f3f5a3f7 100644
--- a/src/mesa/drivers/dri/i915tex/Makefile
+++ b/src/mesa/drivers/dri/i915tex/Makefile
@@ -20,6 +20,7 @@ DRIVER_SOURCES = \
intel_batchbuffer.c \
intel_mipmap_tree.c \
i915_tex_layout.c \
+ intel_tex_layout.c \
intel_tex_image.c \
intel_tex_subimage.c \
intel_tex_copy.c \
@@ -59,8 +60,10 @@ C_SOURCES = \
ASM_SOURCES =
-
+DRIVER_DEFINES = -I../intel
include ../Makefile.template
+intel_tex_layout.o: ../intel/intel_tex_layout.c
+
symlinks:
diff --git a/src/mesa/drivers/dri/i915tex/i830_context.h b/src/mesa/drivers/dri/i915tex/i830_context.h
index e5377b300aa..3d754103c0a 100644
--- a/src/mesa/drivers/dri/i915tex/i830_context.h
+++ b/src/mesa/drivers/dri/i915tex/i830_context.h
@@ -156,6 +156,11 @@ do { \
*/
extern void i830InitVtbl(struct i830_context *i830);
+extern void
+i830_state_draw_region(struct intel_context *intel,
+ struct i830_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region);
/* i830_context.c
*/
extern GLboolean
diff --git a/src/mesa/drivers/dri/i915tex/i830_metaops.c b/src/mesa/drivers/dri/i915tex/i830_metaops.c
index c90f5022229..f76646d89db 100644
--- a/src/mesa/drivers/dri/i915tex/i830_metaops.c
+++ b/src/mesa/drivers/dri/i915tex/i830_metaops.c
@@ -400,40 +400,12 @@ meta_import_pixel_state(struct intel_context *intel)
*/
static void
meta_draw_region(struct intel_context *intel,
- struct intel_region *draw_region,
+ struct intel_region *color_region,
struct intel_region *depth_region)
{
struct i830_context *i830 = i830_context(&intel->ctx);
- GLuint format;
- GLuint depth_format = DEPTH_FRMT_16_FIXED;
- intel_region_release(&i830->meta.draw_region);
- intel_region_reference(&i830->meta.draw_region, draw_region);
-
- intel_region_release(&i830->meta.depth_region);
- intel_region_reference(&i830->meta.depth_region, depth_region);
-
- /* XXX FBO: grab code from i915 meta_draw_region */
-
- /* XXX: 555 support?
- */
- if (draw_region->cpp == 2)
- format = DV_PF_565;
- else
- format = DV_PF_8888;
-
- if (depth_region) {
- if (depth_region->cpp == 2)
- depth_format = DEPTH_FRMT_16_FIXED;
- else
- depth_format = DEPTH_FRMT_24_FIXED_8_OTHER;
- }
-
- i830->meta.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
- DSTORG_VERT_BIAS(0x8) | /* .5 */
- format | DEPTH_IS_Z | depth_format);
-
- i830->meta.emitted &= ~I830_UPLOAD_BUFFERS;
+ i830_state_draw_region(intel, &i830->meta, color_region, depth_region);
}
diff --git a/src/mesa/drivers/dri/i915tex/i830_state.c b/src/mesa/drivers/dri/i915tex/i830_state.c
index 83d82882a65..812daa65246 100644
--- a/src/mesa/drivers/dri/i915tex/i830_state.c
+++ b/src/mesa/drivers/dri/i915tex/i830_state.c
@@ -231,7 +231,7 @@ i830EvalLogicOpBlendState(GLcontext * ctx)
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
ENABLE_LOGIC_OP_MASK);
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
@@ -1042,6 +1042,7 @@ i830_init_packets(struct i830_context *i830)
i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
+#if 0
switch (screen->fbFormat) {
case DV_PF_565:
i830->state.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */
@@ -1058,7 +1059,7 @@ i830_init_packets(struct i830_context *i830)
DEPTH_FRMT_24_FIXED_8_OTHER);
break;
}
-
+#endif
i830->state.Buffer[I830_DESTREG_SENABLE] = (_3DSTATE_SCISSOR_ENABLE_CMD |
DISABLE_SCISSOR_RECT);
i830->state.Buffer[I830_DESTREG_SR0] = _3DSTATE_SCISSOR_RECT_0_CMD;
diff --git a/src/mesa/drivers/dri/i915tex/i830_texstate.c b/src/mesa/drivers/dri/i915tex/i830_texstate.c
index ba79cf94599..e3f34e3944a 100644
--- a/src/mesa/drivers/dri/i915tex/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915tex/i830_texstate.c
@@ -25,21 +25,13 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "macros.h"
#include "mtypes.h"
-#include "simple_list.h"
#include "enums.h"
#include "texformat.h"
-#include "texstore.h"
+#include "dri_bufmgr.h"
-#include "mm.h"
-
-#include "intel_screen.h"
-#include "intel_ioctl.h"
-#include "intel_tex.h"
#include "intel_mipmap_tree.h"
-#include "intel_regions.h"
+#include "intel_tex.h"
#include "i830_context.h"
#include "i830_reg.h"
@@ -129,6 +121,13 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
memset(state, 0, sizeof(state));
+ /*We need to refcount these. */
+
+ if (i830->state.tex_buffer[unit] != NULL) {
+ driBOUnReference(i830->state.tex_buffer[unit]);
+ i830->state.tex_buffer[unit] = NULL;
+ }
+
if (!intel_finalize_mipmap_tree(intel, unit))
return GL_FALSE;
@@ -137,7 +136,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
- i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
+ i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->buffer);
i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
intelObj->
firstLevel);
@@ -298,10 +297,17 @@ i830UpdateTextureState(struct intel_context *intel)
case TEXTURE_RECT_BIT:
ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS);
break;
- case 0:
- if (i830->state.active & I830_UPLOAD_TEX(i))
+ case 0:{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ if (i830->state.active & I830_UPLOAD_TEX(i))
I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE);
+
+ if (i830->state.tex_buffer[i] != NULL) {
+ driBOUnReference(i830->state.tex_buffer[i]);
+ i830->state.tex_buffer[i] = NULL;
+ }
break;
+ }
case TEXTURE_3D_BIT:
default:
ok = GL_FALSE;
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index 45502da290a..dd0670dec37 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -451,14 +451,16 @@ i830_emit_state(struct intel_context *intel)
OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]);
OUT_RELOC(state->draw_region->buffer,
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
- DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->draw_region->draw_offset);
if (state->depth_region) {
OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]);
OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]);
OUT_RELOC(state->depth_region->buffer,
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_WRITE,
- DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
+ DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE,
+ state->depth_region->draw_offset);
}
OUT_BATCH(state->Buffer[I830_DESTREG_DV0]);
@@ -469,7 +471,7 @@ i830_emit_state(struct intel_context *intel)
OUT_BATCH(state->Buffer[I830_DESTREG_SR2]);
ADVANCE_BATCH();
}
-
+
if (dirty & I830_UPLOAD_STIPPLE) {
DBG("I830_UPLOAD_STIPPLE:\n");
emit(i830, state->Stipple, sizeof(state->Stipple));
@@ -518,28 +520,79 @@ i830_destroy_context(struct intel_context *intel)
_tnl_free_vertices(&intel->ctx);
}
-static void
-i830_set_draw_region(struct intel_context *intel,
- struct intel_region *draw_region,
- struct intel_region *depth_region)
+
+void
+i830_state_draw_region(struct intel_context *intel,
+ struct i830_hw_state *state,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
{
struct i830_context *i830 = i830_context(&intel->ctx);
+ GLuint value;
- intel_region_release(&i830->state.draw_region);
- intel_region_release(&i830->state.depth_region);
- intel_region_reference(&i830->state.draw_region, draw_region);
- intel_region_reference(&i830->state.depth_region, depth_region);
+ ASSERT(state == &i830->state || state == &i830->meta);
- /* XXX FBO: Need code from i915_set_draw_region() */
+ if (state->draw_region != color_region) {
+ intel_region_release(&state->draw_region);
+ intel_region_reference(&state->draw_region, color_region);
+ }
+ if (state->depth_region != depth_region) {
+ intel_region_release(&state->depth_region);
+ intel_region_reference(&state->depth_region, depth_region);
+ }
+
+ /*
+ * Set stride/cpp values
+ */
+ if (color_region) {
+ state->Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I830_DESTREG_CBUFADDR1] =
+ (BUF_3D_ID_COLOR_BACK |
+ BUF_3D_PITCH(color_region->pitch * color_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ if (depth_region) {
+ state->Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
+ state->Buffer[I830_DESTREG_DBUFADDR1] =
+ (BUF_3D_ID_DEPTH |
+ BUF_3D_PITCH(depth_region->pitch * depth_region->cpp) |
+ BUF_3D_USE_FENCE);
+ }
+
+ /*
+ * Compute/set I830_DESTREG_DV1 value
+ */
+ value = (DSTORG_HORT_BIAS(0x8) | /* .5 */
+ DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */
+
+ if (color_region && color_region->cpp == 4) {
+ value |= DV_PF_8888;
+ }
+ else {
+ value |= DV_PF_565;
+ }
+ if (depth_region && depth_region->cpp == 4) {
+ value |= DEPTH_FRMT_24_FIXED_8_OTHER;
+ }
+ else {
+ value |= DEPTH_FRMT_16_FIXED;
+ }
+ state->Buffer[I830_DESTREG_DV1] = value;
I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
- I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS);
- i830->state.Buffer[I830_DESTREG_CBUFADDR1] =
- (BUF_3D_ID_COLOR_BACK | BUF_3D_PITCH(draw_region->pitch) |
- BUF_3D_USE_FENCE);
- i830->state.Buffer[I830_DESTREG_DBUFADDR1] =
- (BUF_3D_ID_DEPTH | BUF_3D_PITCH(depth_region->pitch) |
- BUF_3D_USE_FENCE);
+
+
+}
+
+
+static void
+i830_set_draw_region(struct intel_context *intel,
+ struct intel_region *color_region,
+ struct intel_region *depth_region)
+{
+ struct i830_context *i830 = i830_context(&intel->ctx);
+ i830_state_draw_region(intel, &i830->state, color_region, depth_region);
}
#if 0
diff --git a/src/mesa/drivers/dri/i915tex/i915_context.c b/src/mesa/drivers/dri/i915tex/i915_context.c
index 4cbe29d79d6..9b4d72eab3e 100644
--- a/src/mesa/drivers/dri/i915tex/i915_context.c
+++ b/src/mesa/drivers/dri/i915tex/i915_context.c
@@ -36,7 +36,6 @@
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "array_cache/acache.h"
#include "utils.h"
#include "i915_reg.h"
@@ -67,7 +66,7 @@ i915InvalidateState(GLcontext * ctx, GLuint new_state)
{
_swrast_InvalidateState(ctx, new_state);
_swsetup_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
_tnl_invalidate_vertex_state(ctx, new_state);
intel_context(ctx)->NewGLState |= new_state;
diff --git a/src/mesa/drivers/dri/i915tex/i915_context.h b/src/mesa/drivers/dri/i915tex/i915_context.h
index 5ae76fcd185..d2713e88f96 100644
--- a/src/mesa/drivers/dri/i915tex/i915_context.h
+++ b/src/mesa/drivers/dri/i915tex/i915_context.h
@@ -243,7 +243,6 @@ struct i915_context
GLuint lodbias_ss2[MAX_TEXTURE_UNITS];
- struct i915_fragment_program tex_program;
struct i915_fragment_program *current_program;
struct i915_hw_state meta, initial, state, *current;
diff --git a/src/mesa/drivers/dri/i915tex/i915_fragprog.c b/src/mesa/drivers/dri/i915tex/i915_fragprog.c
index 2ddcbc43255..8772e702307 100644
--- a/src/mesa/drivers/dri/i915tex/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915tex/i915_fragprog.c
@@ -39,6 +39,7 @@
#include "program_instruction.h"
#include "program.h"
+#include "programopt.h"
@@ -127,6 +128,7 @@ src_vector(struct i915_fragment_program *p,
Index]);
break;
+ case PROGRAM_CONSTANT:
case PROGRAM_STATE_VAR:
case PROGRAM_NAMED_PARAM:
src =
@@ -928,6 +930,12 @@ i915ProgramStringNotify(GLcontext * ctx,
*/
ctx->Driver.Enable(ctx, GL_FRAGMENT_PROGRAM_ARB,
ctx->FragmentProgram.Enabled);
+
+ if (p->FragProg.FogOption) {
+ /* add extra instructions to do fog, then turn off FogOption field */
+ _mesa_append_fog_code(ctx, &p->FragProg);
+ p->FragProg.FogOption = GL_NONE;
+ }
}
_tnl_program_string(ctx, target, prog);
@@ -1001,7 +1009,10 @@ i915ValidateFragmentProgram(struct i915_context *i915)
EMIT_PAD(1);
}
-#if 0
+ /* XXX this was disabled, but enabling this code helped fix the Glean
+ * tfragprog1 fog tests.
+ */
+#if 1
if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4);
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_program.c b/src/mesa/drivers/dri/i915tex/i915_program.c
index 4fb56222c63..0be89d33206 100644
--- a/src/mesa/drivers/dri/i915tex/i915_program.c
+++ b/src/mesa/drivers/dri/i915tex/i915_program.c
@@ -379,17 +379,14 @@ i915_emit_param4fv(struct i915_fragment_program * p, const GLfloat * values)
-
void
i915_program_error(struct i915_fragment_program *p, const char *msg)
{
- /* XXX we shouldn't print anything to stdout, record GL error or
- * call _mesa_problem()
- */
- fprintf(stderr, "%s\n", msg);
+ _mesa_problem(NULL, "i915_program_error: %s", msg);
p->error = 1;
}
+
void
i915_init_program(struct i915_context *i915, struct i915_fragment_program *p)
{
diff --git a/src/mesa/drivers/dri/i915tex/i915_state.c b/src/mesa/drivers/dri/i915tex/i915_state.c
index d68801d3f94..7c742a7bd94 100644
--- a/src/mesa/drivers/dri/i915tex/i915_state.c
+++ b/src/mesa/drivers/dri/i915tex/i915_state.c
@@ -144,7 +144,7 @@ i915EvalLogicOpBlendState(GLcontext * ctx)
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- if (ctx->Color._LogicOpEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx)) {
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE;
i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE;
}
@@ -520,7 +520,6 @@ update_specular(GLcontext * ctx)
/* A hack to trigger the rebuild of the fragment program.
*/
intel_context(ctx)->NewGLState |= _NEW_TEXTURE;
- I915_CONTEXT(ctx)->tex_program.translated = 0;
}
static void
diff --git a/src/mesa/drivers/dri/i915tex/i915_tex.c b/src/mesa/drivers/dri/i915tex/i915_tex.c
index a53abe9a92f..59e148ca04e 100644
--- a/src/mesa/drivers/dri/i915tex/i915_tex.c
+++ b/src/mesa/drivers/dri/i915tex/i915_tex.c
@@ -52,27 +52,6 @@ i915TexEnv(GLcontext * ctx, GLenum target,
struct i915_context *i915 = I915_CONTEXT(ctx);
switch (pname) {
- case GL_TEXTURE_ENV_COLOR: /* Should be a tracked param */
- case GL_TEXTURE_ENV_MODE:
- case GL_COMBINE_RGB:
- case GL_COMBINE_ALPHA:
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_RGB_SCALE:
- case GL_ALPHA_SCALE:
- i915->tex_program.translated = 0;
- break;
-
case GL_TEXTURE_LOD_BIAS:{
GLuint unit = ctx->Texture.CurrentUnit;
GLint b = (int) ((*param) * 16.0);
@@ -92,22 +71,8 @@ i915TexEnv(GLcontext * ctx, GLenum target,
}
-static void
-i915BindTexture(GLcontext * ctx, GLenum target,
- struct gl_texture_object *texobj)
-{
- /* Need this if image format changes between bound textures.
- * Could try and shortcircuit by checking for differences in
- * state between incoming and outgoing textures:
- */
- I915_CONTEXT(ctx)->tex_program.translated = 0;
-}
-
-
-
void
i915InitTextureFuncs(struct dd_function_table *functions)
{
- functions->BindTexture = i915BindTexture;
functions->TexEnv = i915TexEnv;
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
index e9360ecea83..333fefef859 100644
--- a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
@@ -30,6 +30,7 @@
*/
#include "intel_mipmap_tree.h"
+#include "intel_tex_layout.h"
#include "macros.h"
#include "intel_context.h"
@@ -52,12 +53,6 @@ static GLint step_offsets[6][2] = { {0, 2},
{-1, 1}
};
-static GLuint
-minify(GLuint d)
-{
- return MAX2(1, d >> 1);
-}
-
GLboolean
i915_miptree_layout(struct intel_mipmap_tree * mt)
{
@@ -217,7 +212,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
y = mt->total_height - 4;
x = (face - 4) * 8;
}
- else if (dim < 4) {
+ else if (dim < 4 && (face > 0 || mt->first_level > 0)) {
y = mt->total_height - 4;
x = face * 8;
}
@@ -322,52 +317,9 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
- case GL_TEXTURE_RECTANGLE_ARB:{
- GLuint x = 0;
- GLuint y = 0;
- GLuint width = mt->width0;
- GLuint height = mt->height0;
- GLint align_h = 2;
-
- mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
- mt->total_height = 0;
-
- for (level = mt->first_level; level <= mt->last_level; level++) {
- GLuint img_height;
-
- intel_miptree_set_level_info(mt, level, 1,
- x, y,
- width,
- mt->compressed ? height/4 : height, 1);
-
-
- if (mt->compressed)
- img_height = MAX2(1, height / 4);
- else
- img_height = MAX2(align_h, height);
-
- /* LPT change: step right after second mipmap.
- */
- if (level == mt->first_level + 1) {
- x += mt->pitch / 2;
- x = (x + 3) & ~3;
- }
- else {
- y += img_height;
- y += align_h - 1;
- y &= ~(align_h - 1);
- }
-
- /* Because the images are packed better, the final offset
- * might not be the maximal one:
- */
- mt->total_height = MAX2(mt->total_height, y);
-
- width = minify(width);
- height = minify(height);
- }
+ case GL_TEXTURE_RECTANGLE_ARB:
+ i945_miptree_layout_2d(mt);
break;
- }
default:
_mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()");
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
index 827990d2cfb..52db9a95e6b 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -314,6 +314,7 @@ i915_emit_state(struct intel_context *intel)
if (dirty & I915_UPLOAD_CTX) {
if (INTEL_DEBUG & DEBUG_STATE)
fprintf(stderr, "I915_UPLOAD_CTX:\n");
+
emit(intel, state->Ctx, sizeof(state->Ctx));
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
index b4e0b74f161..be2750d041f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
@@ -252,6 +252,7 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch)
{
struct intel_context *intel = batch->intel;
GLuint used = batch->ptr - batch->map;
+ GLboolean was_locked = intel->locked;
if (used == 0)
return batch->last_fence;
@@ -278,17 +279,14 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch)
/* TODO: Just pass the relocation list and dma buffer up to the
* kernel.
*/
- if (!intel->locked) {
- assert(!(batch->flags & INTEL_BATCH_NO_CLIPRECTS));
-
+ if (!was_locked)
LOCK_HARDWARE(intel);
- do_flush_locked(batch, used, GL_FALSE, GL_TRUE);
+
+ do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS),
+ GL_FALSE);
+
+ if (!was_locked)
UNLOCK_HARDWARE(intel);
- }
- else {
- GLboolean ignore_cliprects = !(batch->flags & INTEL_BATCH_CLIPRECTS);
- do_flush_locked(batch, used, ignore_cliprects, GL_FALSE);
- }
/* Reset the buffer:
*/
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c
index b6b65439087..550669ab0c8 100644
--- a/src/mesa/drivers/dri/i915tex/intel_blit.c
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.c
@@ -277,6 +277,30 @@ intelEmitFillBlit(struct intel_context *intel,
}
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
+
/* Copy BitBlt
*/
void
@@ -289,7 +313,9 @@ intelEmitCopyBlit(struct intel_context *intel,
struct _DriBufferObject *dst_buffer,
GLuint dst_offset,
GLshort src_x, GLshort src_y,
- GLshort dst_x, GLshort dst_y, GLshort w, GLshort h)
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
{
GLuint CMD, BR13;
int dst_y2 = dst_y + h;
@@ -309,13 +335,14 @@ intelEmitCopyBlit(struct intel_context *intel,
case 1:
case 2:
case 3:
- BR13 = (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24);
+ BR13 = (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 16) | (1 << 24);
CMD = XY_SRC_COPY_BLT_CMD;
break;
case 4:
BR13 =
- (((GLint) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24) | (1 <<
- 25);
+ (((GLint) dst_pitch) & 0xffff) |
+ (translate_raster_op(logic_op) << 16) | (1 << 24) | (1 << 25);
CMD =
(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
XY_SRC_COPY_BLT_WRITE_RGB);
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.h b/src/mesa/drivers/dri/i915tex/intel_blit.h
index ee85c626334..e7bc280f58a 100644
--- a/src/mesa/drivers/dri/i915tex/intel_blit.h
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.h
@@ -47,7 +47,8 @@ extern void intelEmitCopyBlit(struct intel_context *intel,
GLuint dst_offset,
GLshort srcx, GLshort srcy,
GLshort dstx, GLshort dsty,
- GLshort w, GLshort h);
+ GLshort w, GLshort h,
+ GLenum logicop );
extern void intelEmitFillBlit(struct intel_context *intel,
GLuint cpp,
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index d3925bbc1ea..1ded0b5417f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -36,6 +36,7 @@
#include "intel_batchbuffer.h"
#include "context.h"
#include "utils.h"
+#include "drirenderbuffer.h"
#include "framebuffer.h"
#include "swrast/swrast.h"
#include "vblank.h"
@@ -105,32 +106,6 @@ intel_readbuf_region(struct intel_context *intel)
-static void
-intelBufferSize(GLframebuffer * buffer, GLuint * width, GLuint * height)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct intel_context *intel = intel_context(ctx);
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- /* XXX This isn't 100% correct, the given buffer might not be
- * bound to the current context!
- */
- LOCK_HARDWARE(intel);
- if (intel->driDrawable) {
- *width = intel->driDrawable->w;
- *height = intel->driDrawable->h;
- }
- else {
- *width = 0;
- *height = 0;
- }
- UNLOCK_HARDWARE(intel);
-}
-
-
-
/**
* Update the following fields for rendering to a user-created FBO:
* intel->numClipRects
@@ -209,6 +184,8 @@ void
intelWindowMoved(struct intel_context *intel)
{
GLcontext *ctx = &intel->ctx;
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ GLframebuffer *drawFb = (GLframebuffer *) dPriv->driverPrivate;
if (!intel->ctx.DrawBuffer) {
/* when would this happen? -BP */
@@ -220,7 +197,7 @@ intelWindowMoved(struct intel_context *intel)
}
else {
/* drawing to a window */
- switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
+ switch (drawFb->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_FRONT_LEFT:
intelSetFrontClipRects(intel);
break;
@@ -233,14 +210,11 @@ intelWindowMoved(struct intel_context *intel)
}
}
- /* this update Mesa's notion of window size */
- if (ctx->WinSysDrawBuffer) {
- _mesa_resize_framebuffer(ctx, ctx->WinSysDrawBuffer,
- intel->driDrawable->w, intel->driDrawable->h);
- }
+ /* Update Mesa's notion of window size */
+ driUpdateFramebufferSize(ctx, dPriv);
+ drawFb->Initialized = GL_TRUE; /* XXX remove someday */
- if (intel->intelScreen->driScrnPriv->ddxMinor >= 7 && intel->driDrawable) {
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
drmI830Sarea *sarea = intel->sarea;
drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
.y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
@@ -271,6 +245,9 @@ intelWindowMoved(struct intel_context *intel)
/* Update hardware scissor */
ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
ctx->Scissor.Width, ctx->Scissor.Height);
+
+ /* Re-calculate viewport related state */
+ ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far );
}
@@ -853,7 +830,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
***/
if (fb->_DepthBuffer && fb->_DepthBuffer->Wrapped) {
irbDepth = intel_renderbuffer(fb->_DepthBuffer->Wrapped);
- if (irbDepth->region) {
+ if (irbDepth && irbDepth->region) {
FALLBACK(intel, INTEL_FALLBACK_DEPTH_BUFFER, GL_FALSE);
depthRegion = irbDepth->region;
}
@@ -949,8 +926,6 @@ void
intelInitBufferFuncs(struct dd_function_table *functions)
{
functions->Clear = intelClear;
- functions->GetBufferSize = intelBufferSize;
- functions->ResizeBuffers = _mesa_resize_framebuffer;
functions->DrawBuffer = intelDrawBuffer;
functions->ReadBuffer = intelReadBuffer;
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c
index 3d51a6341c7..946f9e80415 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.c
+++ b/src/mesa/drivers/dri/i915tex/intel_context.c
@@ -37,7 +37,6 @@
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "array_cache/acache.h"
#include "tnl/t_pipeline.h"
#include "tnl/t_vertex.h"
@@ -86,7 +85,7 @@ int INTEL_DEBUG = (0);
#include "extension_helper.h"
-#define DRIVER_DATE "20060929"
+#define DRIVER_DATE "20061102"
_glthread_Mutex lockMutex;
static GLboolean lockMutexInit = GL_FALSE;
@@ -241,7 +240,7 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state)
{
_swrast_InvalidateState(ctx, new_state);
_swsetup_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
_tnl_invalidate_vertex_state(ctx, new_state);
intel_context(ctx)->NewGLState |= new_state;
@@ -390,7 +389,7 @@ intelInitContext(struct intel_context *intel,
/* Initialize the software rasterizer and helper modules. */
_swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
+ _vbo_CreateContext(ctx);
_tnl_CreateContext(ctx);
_swsetup_CreateContext(ctx);
@@ -500,7 +499,7 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
release_texture_heaps = (intel->ctx.Shared->RefCount == 1);
_swsetup_DestroyContext(&intel->ctx);
_tnl_DestroyContext(&intel->ctx);
- _ac_DestroyContext(&intel->ctx);
+ _vbo_DestroyContext(&intel->ctx);
_swrast_DestroyContext(&intel->ctx);
intel->Fallback = 0; /* don't call _swrast_Flush later */
@@ -577,6 +576,16 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
}
}
+ /* set initial GLframebuffer size to match window, if needed */
+ if (drawFb->Width == 0 && driDrawPriv->w) {
+ _mesa_resize_framebuffer(&intel->ctx, drawFb,
+ driDrawPriv->w, driDrawPriv->h);
+ }
+ if (readFb->Width == 0 && driReadPriv->w) {
+ _mesa_resize_framebuffer(&intel->ctx, readFb,
+ driReadPriv->w, driReadPriv->h);
+ }
+
_mesa_make_current(&intel->ctx, drawFb, readFb);
/* The drawbuffer won't always be updated by _mesa_make_current:
@@ -655,9 +664,6 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
}
-extern _glthread_Mutex lockMutex;
-
-
/* Lock the hardware and validate our state.
*/
void LOCK_HARDWARE( struct intel_context *intel )
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index fa3cf585718..7654e4ecd51 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -354,7 +354,7 @@ __memcpy(void *to, const void *from, size_t n)
/* ================================================================
* Debugging:
*/
-#define DO_DEBUG 1
+#define DO_DEBUG 0
#if DO_DEBUG
extern int INTEL_DEBUG;
#else
diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
index 2ebe3ae14e1..2b1077aee0d 100644
--- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
@@ -56,7 +56,7 @@ intel_miptree_create(struct intel_context *intel,
GLuint last_level,
GLuint width0,
GLuint height0,
- GLuint depth0, GLuint cpp, GLboolean compressed)
+ GLuint depth0, GLuint cpp, GLuint compress_byte)
{
GLboolean ok;
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
@@ -72,8 +72,8 @@ intel_miptree_create(struct intel_context *intel,
mt->width0 = width0;
mt->height0 = height0;
mt->depth0 = depth0;
- mt->cpp = compressed ? 2 : cpp;
- mt->compressed = compressed;
+ mt->cpp = compress_byte ? compress_byte : cpp;
+ mt->compressed = compress_byte ? 1 : 0;
mt->refcount = 1;
switch (intel->intelScreen->deviceID) {
@@ -302,11 +302,15 @@ intel_miptree_image_data(struct intel_context *intel,
GLuint dst_offset = intel_miptree_image_offset(dst, face, level);
const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level);
GLuint i;
+ GLuint height = 0;
DBG("%s\n", __FUNCTION__);
for (i = 0; i < depth; i++) {
+ height = dst->level[level].height;
+ if(dst->compressed)
+ height /= 4;
intel_region_data(intel->intelScreen, dst->region, dst_offset + dst_depth_offset[i], 0, 0, src, src_row_pitch, 0, 0, /* source x,y */
- dst->level[level].width, dst->level[level].height);
+ dst->level[level].width, height);
src += src_image_pitch;
}
@@ -329,6 +333,8 @@ intel_miptree_image_copy(struct intel_context *intel,
const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level);
GLuint i;
+ if (dst->compressed)
+ height /= 4;
for (i = 0; i < depth; i++) {
intel_region_copy(intel->intelScreen,
dst->region, dst_offset + dst_depth_offset[i],
diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h
index e6dd5bb6008..ecdb7be244f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.h
@@ -121,7 +121,7 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
GLuint height0,
GLuint depth0,
GLuint cpp,
- GLboolean compressed);
+ GLuint compress_byte);
void intel_miptree_reference(struct intel_mipmap_tree **dst,
struct intel_mipmap_tree *src);
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel.c b/src/mesa/drivers/dri/i915tex/intel_pixel.c
index 4fe128deea1..9018e3daef4 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel.c
@@ -56,8 +56,9 @@ intel_check_blit_fragment_ops(GLcontext * ctx)
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
- ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled);
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
index 5eb021f008b..9d478283e47 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
@@ -95,9 +95,9 @@ intel_check_copypixel_blit_fragment_ops(GLcontext * ctx)
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
- ctx->Color.ColorLogicOpEnabled ||
ctx->Texture._EnabledUnits ||
- ctx->FragmentProgram._Enabled);
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
}
/* Doesn't work for overlapping regions. Could do a double copy or
@@ -344,9 +344,12 @@ do_blit_copypixels(GLcontext * ctx,
intelEmitCopyBlit(intel, dst->cpp,
src->pitch, src->buffer, 0,
dst->pitch, dst->buffer, 0,
- rect.x1 + delta_x, rect.y1 + delta_y, /* srcx, srcy */
+ rect.x1 + delta_x,
+ rect.y1 + delta_y, /* srcx, srcy */
rect.x1, rect.y1, /* dstx, dsty */
- rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
}
out:
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
index 616101aef99..10a079896ae 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
@@ -252,9 +252,9 @@ do_blit_drawpixels(GLcontext * ctx,
return GL_FALSE;
}
- if (!intel_check_meta_tex_fragment_ops(ctx)) {
+ if (!intel_check_blit_fragment_ops(ctx)) {
if (INTEL_DEBUG & DEBUG_PIXEL)
- _mesa_printf("%s - bad GL fragment state for meta tex\n",
+ _mesa_printf("%s - bad GL fragment state for blitter\n",
__FUNCTION__);
return GL_FALSE;
}
@@ -320,17 +320,19 @@ do_blit_drawpixels(GLcontext * ctx,
rect.x1 - dest_rect.x1,
rect.y2 - dest_rect.y2,
rect.x1,
- rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
}
fence = intel_batchbuffer_flush(intel->batch);
driFenceReference(fence);
}
UNLOCK_HARDWARE(intel);
- if (intel->driDrawable->numClipRects)
+ if (fence) {
driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
-
- driFenceUnReference(fence);
+ driFenceUnReference(fence);
+ }
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
index c1cc65674d1..24e49ae0663 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_read.c
@@ -271,7 +271,8 @@ do_blit_readpixels(GLcontext * ctx,
rect.y1,
rect.x1 - src_rect.x1,
rect.y2 - src_rect.y2,
- rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ GL_COPY);
}
fence = intel_batchbuffer_flush(intel->batch);
@@ -280,11 +281,12 @@ do_blit_readpixels(GLcontext * ctx,
}
UNLOCK_HARDWARE(intel);
- if (intel->driDrawable->numClipRects)
+ if (fence) {
driFenceFinish(fence, DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
GL_FALSE);
+ driFenceUnReference(fence);
+ }
- driFenceUnReference(fence);
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s - DONE\n", __FUNCTION__);
diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c
index 064a34cda81..1205b180ca6 100644
--- a/src/mesa/drivers/dri/i915tex/intel_regions.c
+++ b/src/mesa/drivers/dri/i915tex/intel_regions.c
@@ -318,7 +318,8 @@ intel_region_copy(intelScreenPrivate *intelScreen,
dst->cpp,
src->pitch, src->buffer, src_offset,
dst->pitch, dst->buffer, dst_offset,
- srcx, srcy, dstx, dsty, width, height);
+ srcx, srcy, dstx, dsty, width, height,
+ GL_COPY);
}
/* Fill a rectangular sub-region. Need better logic about when to
@@ -433,7 +434,9 @@ intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region)
region->buffer, 0,
region->pitch,
pbo->buffer, 0,
- 0, 0, 0, 0, region->pitch, region->height);
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
UNLOCK_HARDWARE(intel);
@@ -445,7 +448,9 @@ intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region)
region->buffer, 0,
region->pitch,
pbo->buffer, 0,
- 0, 0, 0, 0, region->pitch, region->height);
+ 0, 0, 0, 0,
+ region->pitch, region->height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c
index 9bbfabbb8c3..efa1b014a61 100644
--- a/src/mesa/drivers/dri/i915tex/intel_screen.c
+++ b/src/mesa/drivers/dri/i915tex/intel_screen.c
@@ -737,6 +737,9 @@ intelFillInModes(unsigned pixel_bits, unsigned depth_bits,
*/
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;
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.c b/src/mesa/drivers/dri/i915tex/intel_tex.c
index 51875ab2921..b08dee43bc1 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex.c
@@ -75,6 +75,31 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
}
+/* The system memcpy (at least on ubuntu 5.10) has problems copying
+ * to agp (writecombined) memory from a source which isn't 64-byte
+ * aligned - there is a 4x performance falloff.
+ *
+ * The x86 __memcpy is immune to this but is slightly slower
+ * (10%-ish) than the system memcpy.
+ *
+ * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but
+ * isn't much faster than x86_memcpy for agp copies.
+ *
+ * TODO: switch dynamically.
+ */
+static void *
+do_memcpy(void *dest, const void *src, size_t n)
+{
+ if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) {
+ return __memcpy(dest, src, n);
+ }
+ else
+ return memcpy(dest, src, n);
+}
+
+
+#if DO_DEBUG
+
#ifndef __x86_64__
static unsigned
fastrdtsc(void)
@@ -109,29 +134,6 @@ time_diff(unsigned t, unsigned t2)
}
-/* The system memcpy (at least on ubuntu 5.10) has problems copying
- * to agp (writecombined) memory from a source which isn't 64-byte
- * aligned - there is a 4x performance falloff.
- *
- * The x86 __memcpy is immune to this but is slightly slower
- * (10%-ish) than the system memcpy.
- *
- * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but
- * isn't much faster than x86_memcpy for agp copies.
- *
- * TODO: switch dynamically.
- */
-static void *
-do_memcpy(void *dest, const void *src, size_t n)
-{
- if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) {
- return __memcpy(dest, src, n);
- }
- else
- return memcpy(dest, src, n);
-}
-
-
static void *
timed_memcpy(void *dest, const void *src, size_t n)
{
@@ -151,6 +153,7 @@ timed_memcpy(void *dest, const void *src, size_t n)
_mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate);
return ret;
}
+#endif /* DO_DEBUG */
void
@@ -168,6 +171,11 @@ intelInitTextureFuncs(struct dd_function_table *functions)
functions->CopyTexSubImage1D = intelCopyTexSubImage1D;
functions->CopyTexSubImage2D = intelCopyTexSubImage2D;
functions->GetTexImage = intelGetTexImage;
+
+ /* compressed texture functions */
+ functions->CompressedTexImage2D = intelCompressedTexImage2D;
+ functions->GetCompressedTexImage = intelGetCompressedTexImage;
+
functions->NewTextureObject = intelNewTextureObject;
functions->NewTextureImage = intelNewTextureImage;
functions->DeleteTexture = intelDeleteTextureObject;
@@ -175,8 +183,10 @@ intelInitTextureFuncs(struct dd_function_table *functions)
functions->UpdateTexturePalette = 0;
functions->IsTextureResident = intelIsTextureResident;
+#if DO_DEBUG
if (INTEL_DEBUG & DEBUG_BUFMGR)
functions->TextureMemCpy = timed_memcpy;
else
+#endif
functions->TextureMemCpy = do_memcpy;
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex.h b/src/mesa/drivers/dri/i915tex/intel_tex.h
index 2f3d4ec2d11..6e9938fe534 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex.h
+++ b/src/mesa/drivers/dri/i915tex/intel_tex.h
@@ -123,6 +123,18 @@ void intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage);
+void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
+ GLvoid *pixels,
+ const struct gl_texture_object *texObj,
+ const struct gl_texture_image *texImage);
+
GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
void intel_tex_map_images(struct intel_context *intel,
@@ -131,4 +143,6 @@ void intel_tex_map_images(struct intel_context *intel,
void intel_tex_unmap_images(struct intel_context *intel,
struct intel_texture_object *intelObj);
+int intel_compressed_num_bytes(GLuint mesaFormat);
+
#endif
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
index 88b62e781c0..b85a25642a2 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_copy.c
@@ -145,7 +145,8 @@ do_copy_texsubimage(struct intel_context *intel,
intelImage->mt->pitch,
intelImage->mt->region->buffer,
image_offset,
- x, y + height, dstx, dsty, width, height);
+ x, y + height, dstx, dsty, width, height,
+ GL_COPY); /* ? */
intel_batchbuffer_flush(intel->batch);
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_format.c b/src/mesa/drivers/dri/i915tex/intel_tex_format.c
index d7612dcbaab..6e058dff69f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_format.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_format.c
@@ -136,6 +136,10 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_DEPTH_COMPONENT32:
return &_mesa_texformat_z16;
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ return &_mesa_texformat_z24_s8;
+
default:
fprintf(stderr, "unexpected texture format %s in %s\n",
_mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__);
@@ -144,3 +148,25 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
return NULL; /* never get here */
}
+
+int intel_compressed_num_bytes(GLuint mesaFormat)
+{
+ int bytes = 0;
+ switch(mesaFormat) {
+
+ case MESA_FORMAT_RGB_FXT1:
+ case MESA_FORMAT_RGBA_FXT1:
+ case MESA_FORMAT_RGB_DXT1:
+ case MESA_FORMAT_RGBA_DXT1:
+ bytes = 2;
+ break;
+
+ case MESA_FORMAT_RGBA_DXT3:
+ case MESA_FORMAT_RGBA_DXT5:
+ bytes = 4;
+ default:
+ break;
+ }
+
+ return bytes;
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
index 48c2f35d3b9..22221e7322c 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c
@@ -69,7 +69,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
GLuint height = intelImage->base.Height;
GLuint depth = intelImage->base.Depth;
GLuint l2width, l2height, l2depth;
- GLuint i;
+ GLuint i, comp_byte = 0;
DBG("%s\n", __FUNCTION__);
@@ -121,6 +121,8 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
}
assert(!intelObj->mt);
+ if (intelImage->base.IsCompressed)
+ comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
intelObj->mt = intel_miptree_create(intel,
intelObj->base.Target,
intelImage->base.InternalFormat,
@@ -130,7 +132,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
height,
depth,
intelImage->base.TexFormat->TexelBytes,
- intelImage->base.IsCompressed);
+ comp_byte);
DBG("%s - success\n", __FUNCTION__);
}
@@ -230,7 +232,8 @@ try_pbo_upload(struct intel_context *intel,
intelImage->mt->cpp,
src_stride, src_buffer, src_offset,
dst_stride, dst_buffer, dst_offset,
- 0, 0, 0, 0, width, height);
+ 0, 0, 0, 0, width, height,
+ GL_COPY);
intel_batchbuffer_flush(intel->batch);
}
@@ -298,7 +301,7 @@ intelTexImage(GLcontext * ctx,
GLenum format, GLenum type, const void *pixels,
const struct gl_pixelstore_attrib *unpack,
struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
+ struct gl_texture_image *texImage, GLsizei imageSize, int compressed)
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_object *intelObj = intel_texture_object(texObj);
@@ -346,17 +349,26 @@ intelTexImage(GLcontext * ctx,
break;
}
- texelBytes = texImage->TexFormat->TexelBytes;
-
-
- /* Minimum pitch of 32 bytes */
- if (postConvWidth * texelBytes < 32) {
- postConvWidth = 32 / texelBytes;
- texImage->RowStride = postConvWidth;
+ if (texImage->TexFormat->TexelBytes == 0) {
+ /* must be a compressed format */
+ texelBytes = 0;
+ texImage->IsCompressed = GL_TRUE;
+ texImage->CompressedSize =
+ ctx->Driver.CompressedTextureSize(ctx, texImage->Width,
+ texImage->Height, texImage->Depth,
+ texImage->TexFormat->MesaFormat);
+ } else {
+ texelBytes = texImage->TexFormat->TexelBytes;
+
+ /* Minimum pitch of 32 bytes */
+ if (postConvWidth * texelBytes < 32) {
+ postConvWidth = 32 / texelBytes;
+ texImage->RowStride = postConvWidth;
+ }
+
+ assert(texImage->RowStride == postConvWidth);
}
- assert(texImage->RowStride == postConvWidth);
-
/* Release the reference to a potentially orphaned buffer.
* Release any old malloced memory.
*/
@@ -453,9 +465,15 @@ intelTexImage(GLcontext * ctx,
* the expectation that the mipmap tree will be set up but nothing
* more will be done. This is where those calls return:
*/
- pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
- format, type,
- pixels, unpack, "glTexImage");
+ if (compressed) {
+ pixels = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, pixels,
+ unpack,
+ "glCompressedTexImage");
+ } else {
+ pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
+ format, type,
+ pixels, unpack, "glTexImage");
+ }
if (!pixels)
return;
@@ -478,7 +496,7 @@ intelTexImage(GLcontext * ctx,
if (texImage->IsCompressed) {
sizeInBytes = texImage->CompressedSize;
dstRowStride =
- _mesa_compressed_row_stride(texImage->InternalFormat, width);
+ _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width);
assert(dims != 3);
}
else {
@@ -497,14 +515,16 @@ intelTexImage(GLcontext * ctx,
* the blitter to copy. Or, use the hardware to do the format
* conversion and copy:
*/
- if (!texImage->TexFormat->StoreImage(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- texImage->ImageOffsets,
- width, height, depth,
- format, type, pixels, unpack)) {
+ if (compressed) {
+ memcpy(texImage->Data, pixels, imageSize);
+ } else if (!texImage->TexFormat->StoreImage(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, depth,
+ format, type, pixels, unpack)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
@@ -541,7 +561,7 @@ intelTexImage3D(GLcontext * ctx,
{
intelTexImage(ctx, 3, target, level,
internalFormat, width, height, depth, border,
- format, type, pixels, unpack, texObj, texImage);
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
}
@@ -557,7 +577,7 @@ intelTexImage2D(GLcontext * ctx,
{
intelTexImage(ctx, 2, target, level,
internalFormat, width, height, 1, border,
- format, type, pixels, unpack, texObj, texImage);
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
}
void
@@ -572,20 +592,30 @@ intelTexImage1D(GLcontext * ctx,
{
intelTexImage(ctx, 1, target, level,
internalFormat, width, 1, 1, border,
- format, type, pixels, unpack, texObj, texImage);
+ format, type, pixels, unpack, texObj, texImage, 0, 0);
}
-
+void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage )
+{
+ intelTexImage(ctx, 2, target, level,
+ internalFormat, width, height, 1, border,
+ 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, 1);
+}
/**
* Need to map texture image into memory before copying image data,
* then unmap it.
*/
-void
-intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
+static void
+intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage, int compressed)
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intelImage = intel_texture_image(texImage);
@@ -615,8 +645,15 @@ intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
assert(intelImage->base.Data);
}
- _mesa_get_teximage(ctx, target, level, format, type, pixels,
- texObj, texImage);
+
+ if (compressed) {
+ _mesa_get_compressed_teximage(ctx, target, level, pixels,
+ texObj, texImage);
+ } else {
+ _mesa_get_teximage(ctx, target, level, format, type, pixels,
+ texObj, texImage);
+ }
+
/* Unmap */
if (intelImage->mt) {
@@ -624,3 +661,26 @@ intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
intelImage->base.Data = NULL;
}
}
+
+void
+intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ intel_get_tex_image(ctx, target, level, format, type, pixels,
+ texObj, texImage, 0);
+
+
+}
+
+void
+intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
+ GLvoid *pixels,
+ const struct gl_texture_object *texObj,
+ const struct gl_texture_image *texImage)
+{
+ intel_get_tex_image(ctx, target, level, 0, 0, pixels,
+ texObj, texImage, 1);
+
+}
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_layout.c b/src/mesa/drivers/dri/i915tex/intel_tex_layout.c
new file mode 120000
index 00000000000..fe61b441945
--- /dev/null
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_layout.c
@@ -0,0 +1 @@
+../intel/intel_tex_layout.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c
index 25a2dca6857..3935787806b 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_subimage.c
@@ -50,7 +50,6 @@ intelTexSubimage(GLcontext * ctx,
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intelImage = intel_texture_image(texImage);
- GLuint dstImageStride;
GLuint dstRowStride;
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
@@ -79,7 +78,7 @@ intelTexSubimage(GLcontext * ctx,
intelImage->face,
intelImage->level,
&dstRowStride,
- &dstImageStride);
+ texImage->ImageOffsets);
assert(dstRowStride);
diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
index e273716b090..79d587a1744 100644
--- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c
@@ -2,6 +2,7 @@
#include "macros.h"
#include "intel_context.h"
+#include "intel_batchbuffer.h"
#include "intel_mipmap_tree.h"
#include "intel_tex.h"
@@ -109,6 +110,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
GLuint nr_faces = 0;
struct intel_texture_image *firstImage;
+ GLboolean need_flush = GL_FALSE;
+
/* We know/require this is true by now:
*/
assert(intelObj->base.Complete);
@@ -155,9 +158,15 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
* leaving the tree alone.
*/
if (intelObj->mt &&
- ((intelObj->mt->first_level > intelObj->firstLevel) ||
- (intelObj->mt->last_level < intelObj->lastLevel) ||
- (intelObj->mt->internal_format != firstImage->base.InternalFormat))) {
+ (intelObj->mt->target != intelObj->base.Target ||
+ intelObj->mt->internal_format != firstImage->base.InternalFormat ||
+ intelObj->mt->first_level != intelObj->firstLevel ||
+ intelObj->mt->last_level != intelObj->lastLevel ||
+ intelObj->mt->width0 != firstImage->base.Width ||
+ intelObj->mt->height0 != firstImage->base.Height ||
+ intelObj->mt->depth0 != firstImage->base.Depth ||
+ intelObj->mt->cpp != firstImage->base.TexFormat->TexelBytes ||
+ intelObj->mt->compressed != firstImage->base.IsCompressed)) {
intel_miptree_release(intel, &intelObj->mt);
}
@@ -165,6 +174,10 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
/* May need to create a new tree:
*/
if (!intelObj->mt) {
+ int comp_byte = 0;
+
+ if (firstImage->base.IsCompressed)
+ comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
intelObj->mt = intel_miptree_create(intel,
intelObj->base.Target,
firstImage->base.InternalFormat,
@@ -175,7 +188,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
firstImage->base.Depth,
firstImage->base.TexFormat->
TexelBytes,
- firstImage->base.IsCompressed);
+ comp_byte);
}
/* Pull in any images not in the object's tree:
@@ -190,10 +203,14 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
*/
if (intelObj->mt != intelImage->mt) {
copy_image_data_to_tree(intel, intelObj, intelImage);
+ need_flush = GL_TRUE;
}
}
}
+ if (need_flush)
+ intel_batchbuffer_flush(intel->batch);
+
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/i915tex/server/i830_common.h b/src/mesa/drivers/dri/i915tex/server/i830_common.h
index fb6ceaa52d4..06f28ed19a4 100644
--- a/src/mesa/drivers/dri/i915tex/server/i830_common.h
+++ b/src/mesa/drivers/dri/i915tex/server/i830_common.h
@@ -52,6 +52,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define DRM_I830_INIT_HEAP 0x0a
#define DRM_I830_CMDBUFFER 0x0b
#define DRM_I830_DESTROY_HEAP 0x0c
+#define DRM_I830_SET_VBLANK_PIPE 0x0d
+#define DRM_I830_GET_VBLANK_PIPE 0x0e
typedef struct {
enum {
@@ -208,5 +210,11 @@ typedef struct {
int region;
} drmI830MemDestroyHeap;
+#define DRM_I830_VBLANK_PIPE_A 1
+#define DRM_I830_VBLANK_PIPE_B 2
+
+typedef struct {
+ int pipe;
+} drmI830VBlankPipe;
#endif /* _I830_DRM_H_ */
diff --git a/src/mesa/drivers/dri/i915tex/server/i830_dri.h b/src/mesa/drivers/dri/i915tex/server/i830_dri.h
index 6c9a7090215..c2a3af8cbf7 100644
--- a/src/mesa/drivers/dri/i915tex/server/i830_dri.h
+++ b/src/mesa/drivers/dri/i915tex/server/i830_dri.h
@@ -9,8 +9,8 @@
#define I830_MAX_DRAWABLES 256
#define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 3
-#define I830_PATCHLEVEL 0
+#define I830_MINOR_VERSION 7
+#define I830_PATCHLEVEL 2
#define I830_REG_SIZE 0x80000
@@ -18,20 +18,20 @@ typedef struct _I830DRIRec {
drm_handle_t regs;
drmSize regsSize;
- drmSize backbufferSize;
- drm_handle_t backbuffer;
+ drmSize unused1; /* backbufferSize */
+ drm_handle_t unused2; /* backbuffer */
- drmSize depthbufferSize;
- drm_handle_t depthbuffer;
+ drmSize unused3; /* depthbufferSize */
+ drm_handle_t unused4; /* depthbuffer */
- drmSize rotatedSize;
- drm_handle_t rotatedbuffer;
+ drmSize unused5; /* rotatedSize */
+ drm_handle_t unused6; /* rotatedbuffer */
- drm_handle_t textures;
- int textureSize;
+ drm_handle_t unused7; /* textures */
+ int unused8; /* textureSize */
- drm_handle_t agp_buffers;
- drmSize agp_buf_size;
+ drm_handle_t unused9; /* agp_buffers */
+ drmSize unused10; /* agp_buf_size */
int deviceID;
int width;
@@ -40,20 +40,10 @@ typedef struct _I830DRIRec {
int cpp;
int bitsPerPixel;
- int fbOffset;
- int fbStride;
-
- int backOffset;
- int backPitch;
-
- int depthOffset;
- int depthPitch;
-
- int rotatedOffset;
- int rotatedPitch;
-
- int logTextureGranularity;
- int textureOffset;
+ int unused11[8]; /* was front/back/depth/rotated offset/pitch */
+
+ int unused12; /* logTextureGranularity */
+ int unused13; /* textureOffset */
int irq;
int sarea_priv_offset;
diff --git a/src/mesa/drivers/dri/i915tex/server/intel.h b/src/mesa/drivers/dri/i915tex/server/intel.h
index d7858a20c8d..6ea72499c1c 100644
--- a/src/mesa/drivers/dri/i915tex/server/intel.h
+++ b/src/mesa/drivers/dri/i915tex/server/intel.h
@@ -75,6 +75,9 @@
#define I830_GMCH_CTRL 0x52
+#define I830_GMCH_MEM_MASK 0x1
+#define I830_GMCH_MEM_64M 0x1
+#define I830_GMCH_MEM_128M 0
#define I830_GMCH_GMS_MASK 0x70
#define I830_GMCH_GMS_DISABLED 0x00
@@ -141,7 +144,7 @@ typedef struct _I830Rec {
unsigned char *MMIOBase;
unsigned char *FbBase;
int cpp;
-
+ uint32_t aper_size;
unsigned int bios_version;
/* These are set in PreInit and never changed. */
diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c
index 169fdbece30..4d1ac09f644 100644
--- a/src/mesa/drivers/dri/i915tex/server/intel_dri.c
+++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c
@@ -292,15 +292,43 @@ static void I830SetupMemoryTiling(const DRIDriverContext *ctx, I830Rec *pI830)
static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830)
{
- struct pci_device host_bridge;
+ struct pci_device host_bridge, ig_dev;
uint32_t gmch_ctrl;
int memsize = 0;
int range;
-
+ uint32_t aper_size;
+ uint32_t membase2 = 0;
+
memset(&host_bridge, 0, sizeof(host_bridge));
+ memset(&ig_dev, 0, sizeof(ig_dev));
+
+ ig_dev.dev = 2;
pci_device_cfg_read_u32(&host_bridge, &gmch_ctrl, I830_GMCH_CTRL);
-
+
+ if (IS_I830(pI830) || IS_845G(pI830)) {
+ if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) {
+ aper_size = 0x80000000;
+ } else {
+ aper_size = 0x40000000;
+ }
+ } else {
+ if (IS_I9XX(pI830)) {
+ int ret;
+ ret = pci_device_cfg_read_u32(&ig_dev, &membase2, 0x18);
+ if (membase2 & 0x08000000)
+ aper_size = 0x8000000;
+ else
+ aper_size = 0x10000000;
+
+ fprintf(stderr,"aper size is %08X %08x %d\n", aper_size, membase2, ret);
+ } else
+ aper_size = 0x8000000;
+ }
+
+ pI830->aper_size = aper_size;
+
+
/* We need to reduce the stolen size, by the GTT and the popup.
* The GTT varying according the the FbMapSize and the popup is 4KB */
range = (ctx->shared.fbSize / (1024*1024)) + 4;
@@ -576,7 +604,8 @@ I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830)
fprintf(stderr,"unable to allocate context buffer %ld\n", ret);
return FALSE;
}
-
+
+#if 0
memset(&(pI830->TexMem), 0, sizeof(pI830->TexMem));
pI830->TexMem.Key = -1;
@@ -587,6 +616,7 @@ I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830)
fprintf(stderr,"unable to allocate texture memory %ld\n", ret);
return FALSE;
}
+#endif
return TRUE;
}
@@ -604,12 +634,29 @@ I830BindMemory(const DRIDriverContext *ctx, I830Rec *pI830)
return FALSE;
if (!BindAgpRange(ctx, &pI830->ContextMem))
return FALSE;
+#if 0
if (!BindAgpRange(ctx, &pI830->TexMem))
return FALSE;
-
+#endif
return TRUE;
}
+static void SetupDRIMM(const DRIDriverContext *ctx, I830Rec *pI830)
+{
+ unsigned long aperEnd = ROUND_DOWN_TO(pI830->aper_size, GTT_PAGE_SIZE) / GTT_PAGE_SIZE;
+ unsigned long aperStart = ROUND_TO(pI830->aper_size - KB(32768), GTT_PAGE_SIZE) / GTT_PAGE_SIZE;
+
+ fprintf(stderr, "aper size is %08X\n", ctx->shared.fbSize);
+ if (drmMMInit(ctx->drmFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) {
+ fprintf(stderr,
+ "DRM MM Initialization Failed\n");
+ } else {
+ fprintf(stderr,
+ "DRM MM Initialized at offset 0x%lx length %d page\n", aperStart, aperEnd-aperStart);
+ }
+
+}
+
static Bool
I830CleanupDma(const DRIDriverContext *ctx)
{
@@ -809,6 +856,7 @@ I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sar
fprintf(stderr, "[drm] Depth Buffer = 0x%08x\n",
sarea->depth_handle);
+#if 0
if (drmAddMap(ctx->drmFD,
(drm_handle_t)sarea->tex_offset,
sarea->tex_size, DRM_AGP, 0,
@@ -819,7 +867,7 @@ I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sar
}
fprintf(stderr, "[drm] textures = 0x%08x\n",
sarea->tex_handle);
-
+#endif
return TRUE;
}
@@ -847,6 +895,7 @@ I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sa
}
}
+#if 0
static void
I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
{
@@ -869,6 +918,7 @@ I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *s
sarea->log_tex_granularity);
}
}
+#endif
static Bool
I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
@@ -891,8 +941,11 @@ I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea)
/* init to zero to be safe */
I830DRIMapScreenRegions(ctx, pI830, sarea);
- I830InitTextureHeap(ctx, pI830, sarea);
+ SetupDRIMM(ctx, pI830);
+#if 0
+ I830InitTextureHeap(ctx, pI830, sarea);
+#endif
if (ctx->pciDevice != PCI_CHIP_845_G &&
ctx->pciDevice != PCI_CHIP_I830_M) {
I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 );
@@ -1083,6 +1136,10 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
return FALSE;
}
+ pSAREAPriv->rotated_offset = -1;
+ pSAREAPriv->rotated_size = 0;
+ pSAREAPriv->rotated_pitch = ctx->shared.virtualWidth;
+
pSAREAPriv->front_offset = pI830->FrontBuffer.Start;
pSAREAPriv->front_size = pI830->FrontBuffer.Size;
pSAREAPriv->width = ctx->shared.virtualWidth;
@@ -1094,8 +1151,10 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
pSAREAPriv->back_size = pI830->BackBuffer.Size;
pSAREAPriv->depth_offset = pI830->DepthBuffer.Start;
pSAREAPriv->depth_size = pI830->DepthBuffer.Size;
+#if 0
pSAREAPriv->tex_offset = pI830->TexMem.Start;
pSAREAPriv->tex_size = pI830->TexMem.Size;
+#endif
pSAREAPriv->log_tex_granularity = pI830->TexGranularity;
ctx->driverClientMsg = malloc(sizeof(I830DRIRec));
@@ -1107,14 +1166,6 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
pI830DRI->height = ctx->shared.virtualHeight;
pI830DRI->mem = ctx->shared.fbSize;
pI830DRI->cpp = ctx->cpp;
- pI830DRI->backOffset = pI830->BackBuffer.Start;
- pI830DRI->backPitch = pI830->BackBuffer.Pitch;
-
- pI830DRI->depthOffset = pI830->DepthBuffer.Start;
- pI830DRI->depthPitch = pI830->DepthBuffer.Pitch;
-
- pI830DRI->fbOffset = pI830->FrontBuffer.Start;
- pI830DRI->fbStride = pI830->FrontBuffer.Pitch;
pI830DRI->bitsPerPixel = ctx->bpp;
pI830DRI->sarea_priv_offset = sizeof(drm_sarea_t);
diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile
index 02fb93486e4..9e4ff112dc3 100644
--- a/src/mesa/drivers/dri/i965/Makefile
+++ b/src/mesa/drivers/dri/i965/Makefile
@@ -20,6 +20,7 @@ DRIVER_SOURCES = \
intel_pixel_bitmap.c \
intel_state.c \
intel_tex.c \
+ intel_tex_layout.c \
intel_tex_validate.c \
brw_aub.c \
brw_aub_playback.c \
@@ -83,8 +84,10 @@ C_SOURCES = \
ASM_SOURCES =
-
+DRIVER_DEFINES = -I../intel
include ../Makefile.template
+intel_tex_layout.o: ../intel/intel_tex_layout.c
+
symlinks:
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 0e8591aaa8d..3bec153075a 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -62,6 +62,8 @@ static void compile_clip_prog( struct brw_context *brw,
*/
brw_init_compile(&c.func);
+ c.func.single_program_flow = 1;
+
c.key = *key;
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 263110bf5e0..6faee65542b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -154,6 +154,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
brw_ProgramCacheInit( ctx );
+ brw_FrameBufferTexInit( brw );
{
const char *filename = getenv("INTEL_REPLAY");
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 0a61926ee84..08fdc545205 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -478,7 +478,7 @@ struct brw_context
*/
struct brw_state_pointers attribs;
struct gl_vertex_program *vp;
- struct gl_fragment_program *fp;
+ struct gl_fragment_program *fp, *fp_tex;
struct gl_buffer_object *vbo;
@@ -486,6 +486,8 @@ struct brw_context
struct intel_region *saved_depth_region;
GLuint restore_draw_mask;
+ struct gl_fragment_program *restore_fp;
+
GLboolean active;
} metaops;
@@ -496,8 +498,8 @@ struct brw_context
/* Active vertex program:
*/
- struct gl_vertex_program *vertex_program;
- struct gl_fragment_program *fragment_program;
+ const struct gl_vertex_program *vertex_program;
+ const struct gl_fragment_program *fragment_program;
/* For populating the gtt:
@@ -590,6 +592,7 @@ struct brw_context
struct {
struct brw_wm_prog_data *prog_data;
+ struct brw_wm_compile *compile_data;
/* Input sizes, calculated from active vertex program:
*/
@@ -665,6 +668,8 @@ void brw_destroy_state( struct brw_context *brw );
*/
void brwUpdateTextureState( struct intel_context *intel );
void brwInitTextureFuncs( struct dd_function_table *functions );
+void brw_FrameBufferTexInit( struct brw_context *brw );
+void brw_FrameBufferTexDestroy( struct brw_context *brw );
/*======================================================================
* brw_metaops.c
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index dfb598acdf6..90637d16eae 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -411,7 +411,7 @@ GLboolean brw_upload_vertices( struct brw_context *brw,
*/
while (tmp) {
- GLuint i = ffs(tmp)-1;
+ GLuint i = ffsll(tmp)-1;
struct brw_vertex_element *input = &brw->vb.inputs[i];
tmp &= ~(1<<i);
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 1afa0f816b8..d4dbcf38a7a 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -104,6 +104,7 @@ struct brw_compile {
struct brw_instruction *current;
GLuint flag_value;
+ GLboolean single_program_flow;
};
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 6425c91450c..9992b47d8ae 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -464,7 +464,6 @@ struct brw_instruction *brw_JMPI(struct brw_compile *p,
return insn;
}
-
/* EU takes the value from the flag register and pushes it onto some
* sort of a stack (presumably merging with any flag value already on
* the stack). Within an if block, the flags at the top of the stack
@@ -482,7 +481,16 @@ struct brw_instruction *brw_JMPI(struct brw_compile *p,
*/
struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_IF);
+ struct brw_instruction *insn;
+
+ if (p->single_program_flow) {
+ assert(execute_size == BRW_EXECUTE_1);
+
+ insn = next_insn(p, BRW_OPCODE_ADD);
+ insn->header.predicate_inverse = 1;
+ } else {
+ insn = next_insn(p, BRW_OPCODE_IF);
+ }
/* Override the defaults for this instruction:
*/
@@ -504,7 +512,13 @@ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size)
struct brw_instruction *brw_ELSE(struct brw_compile *p,
struct brw_instruction *if_insn)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_ELSE);
+ struct brw_instruction *insn;
+
+ if (p->single_program_flow) {
+ insn = next_insn(p, BRW_OPCODE_ADD);
+ } else {
+ insn = next_insn(p, BRW_OPCODE_ELSE);
+ }
brw_set_dest(insn, brw_ip_reg());
brw_set_src0(insn, brw_ip_reg());
@@ -516,11 +530,17 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p,
/* Patch the if instruction to point at this instruction.
*/
- assert(if_insn->header.opcode == BRW_OPCODE_IF);
+ if (p->single_program_flow) {
+ assert(if_insn->header.opcode == BRW_OPCODE_ADD);
- if_insn->bits3.if_else.jump_count = insn - if_insn;
- if_insn->bits3.if_else.pop_count = 1;
- if_insn->bits3.if_else.pad0 = 0;
+ if_insn->bits3.ud = (insn - if_insn + 1) * 16;
+ } else {
+ assert(if_insn->header.opcode == BRW_OPCODE_IF);
+
+ if_insn->bits3.if_else.jump_count = insn - if_insn;
+ if_insn->bits3.if_else.pop_count = 1;
+ if_insn->bits3.if_else.pad0 = 0;
+ }
return insn;
}
@@ -528,63 +548,76 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p,
void brw_ENDIF(struct brw_compile *p,
struct brw_instruction *patch_insn)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_ENDIF);
+ if (p->single_program_flow) {
+ /* In single program flow mode, there's no need to execute an ENDIF,
+ * since we don't need to do any stack operations, and if we're executing
+ * currently, we want to just continue executing.
+ */
+ struct brw_instruction *next = &p->store[p->nr_insn];
- brw_set_dest(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src1(insn, brw_imm_d(0x0));
+ assert(patch_insn->header.opcode == BRW_OPCODE_ADD);
- insn->header.compression_control = BRW_COMPRESSION_NONE;
- insn->header.execution_size = patch_insn->header.execution_size;
- insn->header.mask_control = BRW_MASK_ENABLE;
+ patch_insn->bits3.ud = (next - patch_insn) * 16;
+ } else {
+ struct brw_instruction *insn = next_insn(p, BRW_OPCODE_ENDIF);
- assert(patch_insn->bits3.if_else.jump_count == 0);
-
- /* Patch the if or else instructions to point at this or the next
- * instruction respectively.
- */
- if (patch_insn->header.opcode == BRW_OPCODE_IF) {
- /* Automagically turn it into an IFF:
+ brw_set_dest(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src1(insn, brw_imm_d(0x0));
+
+ insn->header.compression_control = BRW_COMPRESSION_NONE;
+ insn->header.execution_size = patch_insn->header.execution_size;
+ insn->header.mask_control = BRW_MASK_ENABLE;
+
+ assert(patch_insn->bits3.if_else.jump_count == 0);
+
+ /* Patch the if or else instructions to point at this or the next
+ * instruction respectively.
*/
- patch_insn->header.opcode = BRW_OPCODE_IFF;
- patch_insn->bits3.if_else.jump_count = insn - patch_insn + 1;
- patch_insn->bits3.if_else.pop_count = 0;
- patch_insn->bits3.if_else.pad0 = 0;
+ if (patch_insn->header.opcode == BRW_OPCODE_IF) {
+ /* Automagically turn it into an IFF:
+ */
+ patch_insn->header.opcode = BRW_OPCODE_IFF;
+ patch_insn->bits3.if_else.jump_count = insn - patch_insn + 1;
+ patch_insn->bits3.if_else.pop_count = 0;
+ patch_insn->bits3.if_else.pad0 = 0;
+ } else if (patch_insn->header.opcode == BRW_OPCODE_ELSE) {
+ patch_insn->bits3.if_else.jump_count = insn - patch_insn + 1;
+ patch_insn->bits3.if_else.pop_count = 1;
+ patch_insn->bits3.if_else.pad0 = 0;
+ } else {
+ assert(0);
+ }
+ /* Also pop item off the stack in the endif instruction:
+ */
+ insn->bits3.if_else.jump_count = 0;
+ insn->bits3.if_else.pop_count = 1;
+ insn->bits3.if_else.pad0 = 0;
}
- else if (patch_insn->header.opcode == BRW_OPCODE_ELSE) {
- patch_insn->bits3.if_else.jump_count = insn - patch_insn + 1;
- patch_insn->bits3.if_else.pop_count = 1;
- patch_insn->bits3.if_else.pad0 = 0;
- }
- else {
- assert(0);
- }
-
- /* Also pop item off the stack in the endif instruction:
- */
- insn->bits3.if_else.jump_count = 0;
- insn->bits3.if_else.pop_count = 1;
- insn->bits3.if_else.pad0 = 0;
}
/* DO/WHILE loop:
*/
struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_DO);
+ if (p->single_program_flow) {
+ return &p->store[p->nr_insn];
+ } else {
+ struct brw_instruction *insn = next_insn(p, BRW_OPCODE_DO);
- /* Override the defaults for this instruction:
- */
- brw_set_dest(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src0(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
- brw_set_src1(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
+ /* Override the defaults for this instruction:
+ */
+ brw_set_dest(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src0(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
+ brw_set_src1(insn, retype(brw_vec1_grf(0,0), BRW_REGISTER_TYPE_UD));
- insn->header.compression_control = BRW_COMPRESSION_NONE;
- insn->header.execution_size = execute_size;
-/* insn->header.mask_control = BRW_MASK_ENABLE; */
+ insn->header.compression_control = BRW_COMPRESSION_NONE;
+ insn->header.execution_size = execute_size;
+ /* insn->header.mask_control = BRW_MASK_ENABLE; */
- return insn;
+ return insn;
+ }
}
@@ -592,19 +625,31 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size)
void brw_WHILE(struct brw_compile *p,
struct brw_instruction *do_insn)
{
- struct brw_instruction *insn = next_insn(p, BRW_OPCODE_WHILE);
+ struct brw_instruction *insn;
+
+ if (p->single_program_flow)
+ insn = next_insn(p, BRW_OPCODE_ADD);
+ else
+ insn = next_insn(p, BRW_OPCODE_WHILE);
brw_set_dest(insn, brw_ip_reg());
brw_set_src0(insn, brw_ip_reg());
brw_set_src1(insn, brw_imm_d(0x0));
insn->header.compression_control = BRW_COMPRESSION_NONE;
- insn->header.execution_size = do_insn->header.execution_size;
- assert(do_insn->header.opcode == BRW_OPCODE_DO);
- insn->bits3.if_else.jump_count = do_insn - insn;
- insn->bits3.if_else.pop_count = 0;
- insn->bits3.if_else.pad0 = 0;
+ if (p->single_program_flow) {
+ insn->header.execution_size = BRW_EXECUTE_1;
+
+ insn->bits3.d = (do_insn - insn) * 16;
+ } else {
+ insn->header.execution_size = do_insn->header.execution_size;
+
+ assert(do_insn->header.opcode == BRW_OPCODE_DO);
+ insn->bits3.if_else.jump_count = do_insn - insn;
+ insn->bits3.if_else.pop_count = 0;
+ insn->bits3.if_else.pad0 = 0;
+ }
/* insn->header.mask_control = BRW_MASK_ENABLE; */
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 7d3f9dd5e3b..9066e42252d 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -66,7 +66,9 @@ static void compile_gs_prog( struct brw_context *brw,
/* Begin the compilation:
*/
brw_init_compile(&c.func);
-
+
+ c.func.single_program_flow = 1;
+
/* For some reason the thread is spawned with only 4 channels
* unmasked.
*/
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
index 2d4c84f6128..1728fc8f568 100644
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ b/src/mesa/drivers/dri/i965/brw_metaops.c
@@ -27,6 +27,7 @@
/*
* Authors:
* Keith Whitwell <[email protected]>
+ * frame buffer texture by Gary Wong <[email protected]>
*/
@@ -143,6 +144,15 @@ static const char *fp_prog =
"MOV result.color, fragment.color;\n"
"END\n";
+static const char *fp_tex_prog =
+ "!!ARBfp1.0\n"
+ "TEMP a;\n"
+ "ADD a, fragment.position, program.local[0];\n"
+ "MUL a, a, program.local[1];\n"
+ "TEX result.color, a, texture[0], 2D;\n"
+ "MOV result.depth.z, fragment.position;\n"
+ "END\n";
+
/* Derived values of importance:
*
* FragmentProgram->_Current
@@ -169,6 +179,9 @@ static void init_metaops_state( struct brw_context *brw )
brw->metaops.fp = (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
+ brw->metaops.fp_tex = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 );
+
brw->metaops.vp = (struct gl_vertex_program *)
ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 );
@@ -176,6 +189,10 @@ static void init_metaops_state( struct brw_context *brw )
fp_prog, strlen(fp_prog),
brw->metaops.fp);
+ _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,
+ fp_tex_prog, strlen(fp_tex_prog),
+ brw->metaops.fp_tex);
+
_mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB,
vp_prog, strlen(vp_prog),
brw->metaops.vp);
@@ -266,7 +283,76 @@ static void meta_color_mask( struct intel_context *intel, GLboolean state )
static void meta_no_texture( struct intel_context *intel )
{
- /* Nothing to do */
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp;
+
+ brw->metaops.attribs.Texture->CurrentUnit = 0;
+ brw->metaops.attribs.Texture->_EnabledUnits = 0;
+ brw->metaops.attribs.Texture->_EnabledCoordUnits = 0;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0;
+
+ brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
+}
+
+static void meta_texture_blend_replace(struct intel_context *intel)
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ brw->metaops.attribs.Texture->CurrentUnit = 0;
+ brw->metaops.attribs.Texture->_EnabledUnits = 1;
+ brw->metaops.attribs.Texture->_EnabledCoordUnits = 1;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT;
+ brw->metaops.attribs.Texture->Unit[ 0 ].Current2D =
+ intel->frame_buffer_texobj;
+ brw->metaops.attribs.Texture->Unit[ 0 ]._Current =
+ intel->frame_buffer_texobj;
+
+ brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM;
+}
+
+static void meta_import_pixel_state(struct intel_context *intel)
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+
+ RESTORE(brw, Color, _NEW_COLOR);
+ RESTORE(brw, Depth, _NEW_DEPTH);
+ RESTORE(brw, Fog, _NEW_FOG);
+ RESTORE(brw, Scissor, _NEW_SCISSOR);
+ RESTORE(brw, Stencil, _NEW_STENCIL);
+ RESTORE(brw, Texture, _NEW_TEXTURE);
+ RESTORE(brw, FragmentProgram, _NEW_PROGRAM);
+}
+
+static void meta_frame_buffer_texture( struct intel_context *intel,
+ GLint xoff, GLint yoff )
+{
+ struct brw_context *brw = brw_context(&intel->ctx);
+ struct intel_region *region = intel_drawbuf_region( intel );
+
+ INSTALL(brw, FragmentProgram, _NEW_PROGRAM);
+
+ brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex;
+ /* This is unfortunate, but seems to be necessary, since later on we
+ will end up calling _mesa_load_state_parameters to lookup the
+ local params (below), and that will want to look in ctx.FragmentProgram
+ instead of brw->attribs.FragmentProgram. */
+ intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex;
+
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] =
+ 1.0 / region->pitch;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] =
+ -1.0 / region->height;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0;
+ brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0;
+
+ brw->state.dirty.mesa |= _NEW_PROGRAM;
}
@@ -408,9 +494,11 @@ static void install_meta_state( struct intel_context *intel )
}
install_attribs(brw);
+
meta_no_texture(&brw->intel);
meta_flat_shade(&brw->intel);
brw->metaops.restore_draw_mask = ctx->DrawBuffer->_ColorDrawBufferMask[0];
+ brw->metaops.restore_fp = ctx->FragmentProgram.Current;
/* This works without adjusting refcounts. Fix later?
*/
@@ -429,6 +517,7 @@ static void leave_meta_state( struct intel_context *intel )
restore_attribs(brw);
ctx->DrawBuffer->_ColorDrawBufferMask[0] = brw->metaops.restore_draw_mask;
+ ctx->FragmentProgram.Current = brw->metaops.restore_fp;
brw->state.draw_region = brw->metaops.saved_draw_region;
brw->state.depth_region = brw->metaops.saved_depth_region;
@@ -455,10 +544,11 @@ void brw_init_metaops( struct brw_context *brw )
brw->intel.vtbl.meta_depth_replace = meta_depth_replace;
brw->intel.vtbl.meta_color_mask = meta_color_mask;
brw->intel.vtbl.meta_no_texture = meta_no_texture;
+ brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state;
+ brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture;
brw->intel.vtbl.meta_draw_region = meta_draw_region;
brw->intel.vtbl.meta_draw_quad = meta_draw_quad;
-
-/* brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; */
+ brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace;
/* brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */
/* brw->intel.vtbl.meta_draw_format = set_draw_format; */
}
@@ -471,5 +561,6 @@ void brw_destroy_metaops( struct brw_context *brw )
ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo );
/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */
+/* ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */
/* ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */
}
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 6a6c4503c74..d5779680ffc 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -88,10 +88,10 @@ static void upload_drawing_rect(struct brw_context *brw)
if (brw->intel.numClipRects > 1)
return;
- x1 = dPriv->x;
- y1 = dPriv->y;
- x2 = dPriv->x + dPriv->w;
- y2 = dPriv->y + dPriv->h;
+ x1 = brw->intel.pClipRects[0].x1;
+ y1 = brw->intel.pClipRects[0].y1;
+ x2 = brw->intel.pClipRects[0].x2;
+ y2 = brw->intel.pClipRects[0].y2;
if (x1 < 0) x1 = 0;
if (y1 < 0) y1 = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h
index 25acdcfe947..10fee944e8d 100644
--- a/src/mesa/drivers/dri/i965/brw_structs.h
+++ b/src/mesa/drivers/dri/i965/brw_structs.h
@@ -519,7 +519,22 @@ struct thread3
struct brw_clip_unit_state
{
struct thread0 thread0;
- struct thread1 thread1;
+ struct
+ {
+ GLuint pad0:7;
+ GLuint sw_exception_enable:1;
+ GLuint pad1:3;
+ GLuint mask_stack_exception_enable:1;
+ GLuint pad2:1;
+ GLuint illegal_op_exception_enable:1;
+ GLuint pad3:2;
+ GLuint floating_point_mode:1;
+ GLuint thread_priority:1;
+ GLuint binding_table_entry_count:8;
+ GLuint pad4:5;
+ GLuint single_program_flow:1;
+ } thread1;
+
struct thread2 thread2;
struct thread3 thread3;
@@ -532,8 +547,8 @@ struct brw_clip_unit_state
GLuint pad1:1;
GLuint urb_entry_allocation_size:5;
GLuint pad2:1;
- GLuint max_threads:6; /* may be less */
- GLuint pad3:1;
+ GLuint max_threads:1; /* may be less */
+ GLuint pad3:6;
} thread4;
struct
@@ -1322,6 +1337,7 @@ struct brw_instruction
GLuint end_of_thread:1;
} generic;
+ GLint d;
GLuint ud;
} bits3;
};
diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c
index 8332d869e1d..c3ffa9e6577 100644
--- a/src/mesa/drivers/dri/i965/brw_tex.c
+++ b/src/mesa/drivers/dri/i965/brw_tex.c
@@ -36,11 +36,14 @@
#include "simple_list.h"
#include "enums.h"
#include "image.h"
+#include "teximage.h"
#include "texstore.h"
#include "texformat.h"
#include "texmem.h"
+#include "intel_context.h"
#include "intel_ioctl.h"
+#include "intel_regions.h"
#include "brw_context.h"
#include "brw_defines.h"
@@ -179,3 +182,32 @@ void brwInitTextureFuncs( struct dd_function_table *functions )
{
functions->ChooseTextureFormat = brwChooseTextureFormat;
}
+
+void brw_FrameBufferTexInit( struct brw_context *brw )
+{
+ struct intel_context *intel = &brw->intel;
+ GLcontext *ctx = &intel->ctx;
+ struct intel_region *region = intel->front_region;
+ struct gl_texture_object *obj;
+ struct gl_texture_image *img;
+
+ intel->frame_buffer_texobj = obj =
+ ctx->Driver.NewTextureObject( ctx, (GLuint) -1, GL_TEXTURE_2D );
+
+ obj->MinFilter = GL_NEAREST;
+ obj->MagFilter = GL_NEAREST;
+
+ img = ctx->Driver.NewTextureImage( ctx );
+
+ _mesa_init_teximage_fields( ctx, GL_TEXTURE_2D, img,
+ region->pitch, region->height, 1, 0,
+ region->cpp == 4 ? GL_RGBA : GL_RGB );
+
+ _mesa_set_tex_image( obj, GL_TEXTURE_2D, 0, img );
+}
+
+void brw_FrameBufferTexDestroy( struct brw_context *brw )
+{
+ brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx,
+ brw->intel.frame_buffer_texobj );
+}
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 1353325afff..af1ad0f1ef1 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -34,21 +34,15 @@
*/
#include "intel_mipmap_tree.h"
+#include "intel_tex_layout.h"
#include "macros.h"
-static GLuint minify( GLuint d )
-{
- return MAX2(1, d>>1);
-}
-
GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
{
/* XXX: these vary depending on image format:
*/
/* GLint align_w = 4; */
- GLint align_h = 2;
-
switch (mt->target) {
case GL_TEXTURE_CUBE_MAP:
@@ -107,53 +101,10 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
break;
}
- default: {
- GLuint level;
- GLuint x = 0;
- GLuint y = 0;
- GLuint width = mt->width0;
- GLuint height = mt->height0;
-
- mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
- mt->total_height = 0;
-
- for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
- GLuint img_height;
-
- intel_miptree_set_level_info(mt, level, 1,
- x, y,
- width,
- mt->compressed ? height/4 : height, 1);
-
- if (mt->compressed)
- img_height = MAX2(1, height/4);
- else
- img_height = MAX2(align_h, height);
-
-
- /* Because the images are packed better, the final offset
- * might not be the maximal one:
- */
- mt->total_height = MAX2(mt->total_height, y + img_height);
-
- /* Layout_below: step right after second mipmap.
- */
- if (level == mt->first_level + 1) {
- x += mt->pitch / 2;
- x = (x + 3) & ~ 3;
- }
- else {
- y += img_height;
- y += align_h - 1;
- y &= ~(align_h - 1);
- }
-
- width = minify(width);
- height = minify(height);
- }
+ default:
+ i945_miptree_layout_2d(mt);
break;
}
- }
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
mt->pitch,
mt->total_height,
diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
index dc580998e37..0d61092247a 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
@@ -114,7 +114,7 @@ static GLuint translate_texgen( GLboolean enabled, GLenum mode )
static void make_state_key( GLcontext *ctx, struct state_key *key )
{
struct brw_context *brw = brw_context(ctx);
- struct gl_fragment_program *fp = brw->fragment_program;
+ const struct gl_fragment_program *fp = brw->fragment_program;
GLuint i;
/* This now relies on texenvprogram.c being active:
@@ -402,7 +402,7 @@ static struct ureg register_const4f( struct tnl_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
@@ -1625,7 +1625,7 @@ const struct brw_tracked_state brw_tnl_vertprog = {
static void update_active_vertprog( struct brw_context *brw )
{
- struct gl_vertex_program *prev = brw->vertex_program;
+ const struct gl_vertex_program *prev = brw->vertex_program;
/* NEW_PROGRAM */
if (brw->attribs.VertexProgram->_Enabled) {
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index a5738e57747..786f30e641e 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -67,6 +67,7 @@ static void brw_destroy_context( struct intel_context *intel )
brw_draw_destroy( brw );
brw_ProgramCacheDestroy( ctx );
+ brw_FrameBufferTexDestroy( brw );
}
/* called from intelDrawBuffer()
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 3e2f2d06b81..0f842d289d7 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -138,64 +138,75 @@ static void do_wm_prog( struct brw_context *brw,
struct brw_fragment_program *fp,
struct brw_wm_prog_key *key)
{
- struct brw_wm_compile c;
+ struct brw_wm_compile *c;
const GLuint *program;
GLuint program_size;
- memset(&c, 0, sizeof(c));
- memcpy(&c.key, key, sizeof(*key));
+ c = brw->wm.compile_data;
+ if (c == NULL) {
+ 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));
+ }
+ memcpy(&c->key, key, sizeof(*key));
- c.fp = fp;
- c.env_param = brw->intel.ctx.FragmentProgram.Parameters;
+ c->fp = fp;
+ c->env_param = brw->intel.ctx.FragmentProgram.Parameters;
/* Augment fragment program. Add instructions for pre- and
* post-fragment-program tasks such as interpolation and fogging.
*/
- brw_wm_pass_fp(&c);
+ brw_wm_pass_fp(c);
/* Translate to intermediate representation. Build register usage
* chains.
*/
- brw_wm_pass0(&c);
+ brw_wm_pass0(c);
/* Dead code removal.
*/
- brw_wm_pass1(&c);
+ brw_wm_pass1(c);
/* Hal optimization
*/
- brw_wm_pass_hal (&c);
+ brw_wm_pass_hal (c);
/* Register allocation.
*/
- c.grf_limit = BRW_WM_MAX_GRF/2;
+ c->grf_limit = BRW_WM_MAX_GRF/2;
/* This is where we start emitting gen4 code:
*/
- brw_init_compile(&c.func);
+ brw_init_compile(&c->func);
- brw_wm_pass2(&c);
+ brw_wm_pass2(c);
- c.prog_data.total_grf = c.max_wm_grf;
- c.prog_data.total_scratch = c.last_scratch ? c.last_scratch + 0x40 : 0;
+ 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_emit(c);
/* get the program
*/
- program = brw_get_program(&c.func, &program_size);
+ program = brw_get_program(&c->func, &program_size);
/*
*/
brw->wm.prog_gs_offset = brw_upload_cache( &brw->cache[BRW_WM_PROG],
- &c.key,
- sizeof(c.key),
+ &c->key,
+ sizeof(c->key),
program,
program_size,
- &c.prog_data,
+ &c->prog_data,
&brw->wm.prog_data );
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index 04c7555b9b8..bb0aa356150 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -432,7 +432,7 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c,
return src_reg(PROGRAM_STATE_VAR, idx);
}
- idx = _mesa_add_unnamed_constant( paramList, values );
+ idx = _mesa_add_unnamed_constant( paramList, values, 4 );
return src_reg(PROGRAM_STATE_VAR, idx);
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c
index 4707a709e77..ff5cb31bdd1 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_state.c
@@ -122,7 +122,7 @@ static void upload_wm_unit(struct brw_context *brw )
/* BRW_NEW_FRAGMENT_PROGRAM */
{
- struct gl_fragment_program *fp = brw->fragment_program;
+ const struct gl_fragment_program *fp = brw->fragment_program;
if (fp->Base.InputsRead & (1<<FRAG_ATTRIB_WPOS))
wm.wm5.program_uses_depth = 1; /* as far as we can tell */
@@ -168,7 +168,7 @@ static void upload_wm_unit(struct brw_context *brw )
wm.wm5.line_stipple = 1;
}
- if (INTEL_DEBUG & DEBUG_STATS)
+ if (INTEL_DEBUG & DEBUG_STATS || intel->stats_wm)
wm.wm4.stats_enable = 1;
brw->wm.state_gs_offset = brw_cache_data( &brw->cache[BRW_WM_UNIT], &wm );
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 5c7dc500cab..d24c618a668 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -239,6 +239,12 @@ static void upload_wm_surfaces(struct brw_context *brw )
brw->wm.bind.surf_ss_offset[i+1] = brw_cache_data( &brw->cache[BRW_SS_SURFACE], &surf );
brw->wm.nr_surfaces = i+2;
}
+ else if( texUnit->_ReallyEnabled &&
+ texUnit->_Current == intel->frame_buffer_texobj )
+ {
+ brw->wm.bind.surf_ss_offset[i+1] = brw->wm.bind.surf_ss_offset[0];
+ brw->wm.nr_surfaces = i+2;
+ }
else {
brw->wm.bind.surf_ss_offset[i+1] = 0;
}
diff --git a/src/mesa/drivers/dri/i965/bufmgr.h b/src/mesa/drivers/dri/i965/bufmgr.h
index 6932522d3d3..e748c0d6d0b 100644
--- a/src/mesa/drivers/dri/i965/bufmgr.h
+++ b/src/mesa/drivers/dri/i965/bufmgr.h
@@ -199,9 +199,11 @@ void *bmFindVirtual( struct intel_context *intel,
* For now they can stay, but will likely change/move before final:
*/
unsigned bmSetFence( struct intel_context * );
+unsigned bmSetFenceLock( struct intel_context * );
unsigned bmLockAndFence( struct intel_context *intel );
int bmTestFence( struct intel_context *, unsigned fence );
void bmFinishFence( struct intel_context *, unsigned fence );
+void bmFinishFenceLock( struct intel_context *, unsigned fence );
void bm_fake_NotifyContendedLockTake( struct intel_context * );
diff --git a/src/mesa/drivers/dri/i965/bufmgr_fake.c b/src/mesa/drivers/dri/i965/bufmgr_fake.c
index ed88ab3797a..24ee11edd8c 100644
--- a/src/mesa/drivers/dri/i965/bufmgr_fake.c
+++ b/src/mesa/drivers/dri/i965/bufmgr_fake.c
@@ -338,7 +338,6 @@ static int evict_mru( struct intel_context *intel, GLuint *pool )
}
-
static int check_fenced( struct intel_context *intel )
{
struct bufmgr *bm = intel->bm;
@@ -1328,11 +1327,21 @@ unsigned bmSetFence( struct intel_context *intel )
return intel->bm->last_fence;
}
+unsigned bmSetFenceLock( struct intel_context *intel )
+{
+ unsigned last;
+ LOCK(intel->bm);
+ last = bmSetFence(intel);
+ UNLOCK(intel->bm);
+ return last;
+}
unsigned bmLockAndFence( struct intel_context *intel )
{
if (intel->bm->need_fence) {
LOCK_HARDWARE(intel);
+ LOCK(intel->bm);
bmSetFence(intel);
+ UNLOCK(intel->bm);
UNLOCK_HARDWARE(intel);
}
@@ -1350,7 +1359,12 @@ void bmFinishFence( struct intel_context *intel, unsigned fence )
check_fenced(intel);
}
-
+void bmFinishFenceLock( struct intel_context *intel, unsigned fence )
+{
+ LOCK(intel->bm);
+ bmFinishFence(intel, fence);
+ UNLOCK(intel->bm);
+}
/* Specifically ignore texture memory sharing.
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 0974f1f80ad..173d1d5b6c2 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -66,7 +66,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
intelFlush( &intel->ctx );
- bmFinishFence(intel, intel->last_swap_fence);
+ bmFinishFenceLock(intel, intel->last_swap_fence);
/* The LOCK_HARDWARE is required for the cliprects. Buffer offsets
* should work regardless.
@@ -155,7 +155,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv,
intel_batchbuffer_flush( intel->batch );
intel->second_last_swap_fence = intel->last_swap_fence;
- intel->last_swap_fence = bmSetFence( intel );
+ intel->last_swap_fence = bmSetFenceLock( intel );
UNLOCK_HARDWARE( intel );
if (!rect)
@@ -221,6 +221,29 @@ void intelEmitFillBlit( struct intel_context *intel,
ADVANCE_BATCH();
}
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
/* Copy BitBlt
*/
@@ -236,7 +259,8 @@ void intelEmitCopyBlit( struct intel_context *intel,
GLboolean dst_tiled,
GLshort src_x, GLshort src_y,
GLshort dst_x, GLshort dst_y,
- GLshort w, GLshort h )
+ GLshort w, GLshort h,
+ GLenum logic_op )
{
GLuint CMD, BR13;
int dst_y2 = dst_y + h;
@@ -244,12 +268,15 @@ void intelEmitCopyBlit( struct intel_context *intel,
BATCH_LOCALS;
- DBG("%s src:buf(%d)/%d %d,%d dst:buf(%d)/%d %d,%d sz:%dx%d\n",
+ DBG("%s src:buf(%d)/%d %d,%d dst:buf(%d)/%d %d,%d sz:%dx%d op:%d\n",
__FUNCTION__,
src_buffer, src_pitch, src_x, src_y,
dst_buffer, dst_pitch, dst_x, dst_y,
- w,h);
+ w,h,logic_op);
+ assert( logic_op - GL_CLEAR >= 0 );
+ assert( logic_op - GL_CLEAR < 0x10 );
+
src_pitch *= cpp;
dst_pitch *= cpp;
@@ -257,11 +284,12 @@ void intelEmitCopyBlit( struct intel_context *intel,
case 1:
case 2:
case 3:
- BR13 = (0xCC << 16) | (1<<24);
+ BR13 = (translate_raster_op(logic_op) << 16) | (1<<24);
CMD = XY_SRC_COPY_BLT_CMD;
break;
case 4:
- BR13 = (0xCC << 16) | (1<<24) | (1<<25);
+ BR13 = (translate_raster_op(logic_op) << 16) | (1<<24) |
+ (1<<25);
CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
XY_SRC_COPY_BLT_WRITE_RGB);
break;
diff --git a/src/mesa/drivers/dri/i965/intel_blit.h b/src/mesa/drivers/dri/i965/intel_blit.h
index b15fb1c2b7f..8b0cc65243c 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.h
+++ b/src/mesa/drivers/dri/i965/intel_blit.h
@@ -49,7 +49,8 @@ extern void intelEmitCopyBlit( struct intel_context *intel,
GLboolean dst_tiled,
GLshort srcx, GLshort srcy,
GLshort dstx, GLshort dsty,
- GLshort w, GLshort h );
+ GLshort w, GLshort h,
+ GLenum logic_op );
extern void intelEmitFillBlit( struct intel_context *intel,
GLuint cpp,
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index c4c5488cbb1..60fcf958926 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -33,6 +33,7 @@
#include "extensions.h"
#include "framebuffer.h"
#include "imports.h"
+#include "points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -70,6 +71,7 @@ int INTEL_DEBUG = (0);
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_ARB_window_pos
+#define need_GL_ARB_occlusion_query
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
@@ -182,7 +184,8 @@ const struct dri_extension card_extensions[] =
{ NULL, NULL }
};
-
+static const struct dri_extension arb_oc_extension =
+ { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions};
static const struct dri_debug_control debug_control[] =
{
@@ -241,6 +244,36 @@ void intelFinish( GLcontext *ctx )
bmFinishFence(intel, bmLockAndFence(intel));
}
+static void
+intelBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+{
+ struct intel_context *intel = intel_context( ctx );
+ GLuint64EXT tmp = 0;
+ drmI830MMIO io = {
+ .read_write = MMIO_WRITE,
+ .reg = MMIO_REGS_PS_DEPTH_COUNT,
+ .data = &tmp
+ };
+ intel->stats_wm = GL_TRUE;
+ intelFinish(&intel->ctx);
+ drmCommandWrite(intel->driFd, DRM_I830_MMIO, &io, sizeof(io));
+}
+
+static void
+intelEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+{
+ struct intel_context *intel = intel_context( ctx );
+ drmI830MMIO io = {
+ .read_write = MMIO_READ,
+ .reg = MMIO_REGS_PS_DEPTH_COUNT,
+ .data = &q->Result
+ };
+ intelFinish(&intel->ctx);
+ drmCommandRead(intel->driFd, DRM_I830_MMIO, &io, sizeof(io));
+ q->Ready = GL_TRUE;
+ intel->stats_wm = GL_FALSE;
+}
+
void intelInitDriverFunctions( struct dd_function_table *functions )
{
@@ -250,6 +283,8 @@ void intelInitDriverFunctions( struct dd_function_table *functions )
functions->Finish = intelFinish;
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;
+ functions->BeginQuery = intelBeginQuery;
+ functions->EndQuery = intelEndQuery;
/* CopyPixels can be accelerated even with the current memory
* manager:
@@ -320,6 +355,11 @@ GLboolean intelInitContext( struct intel_context *intel,
ctx->Const.MaxPointSizeAA = 3.0;
ctx->Const.PointSizeGranularity = 1.0;
+ /* reinitialize the context point state.
+ * It depend on constants in __GLcontextRec::Const
+ */
+ _mesa_init_point(ctx);
+
/* Initialize the software rasterizer and helper modules. */
_swrast_CreateContext( ctx );
_vbo_CreateContext( ctx );
@@ -373,6 +413,9 @@ GLboolean intelInitContext( struct intel_context *intel,
driInitExtensions( ctx, card_extensions,
GL_TRUE );
+ if (intel->intelScreen->drmMinor >= 8)
+ driInitSingleExtension (ctx, &arb_oc_extension);
+
INTEL_DEBUG = driParseDebugString( getenv( "INTEL_DEBUG" ),
debug_control );
@@ -398,7 +441,7 @@ GLboolean intelInitContext( struct intel_context *intel,
intelScreen->cpp,
intelScreen->front.pitch / intelScreen->cpp,
intelScreen->height,
- GL_FALSE);
+ intelScreen->front.tiled != 0); /* 0: LINEAR */
intel->back_region =
@@ -409,7 +452,7 @@ GLboolean intelInitContext( struct intel_context *intel,
intelScreen->cpp,
intelScreen->back.pitch / intelScreen->cpp,
intelScreen->height,
- (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
+ intelScreen->back.tiled != 0);
/* Still assuming front.cpp == depth.cpp
*
@@ -425,7 +468,7 @@ GLboolean intelInitContext( struct intel_context *intel,
intelScreen->cpp,
intelScreen->depth.pitch / intelScreen->cpp,
intelScreen->height,
- (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
+ intelScreen->depth.tiled != 0);
intel_bufferobj_init( intel );
intel->batch = intel_batchbuffer_alloc( intel );
diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h
index 2df8faef28e..fe7ee382a19 100644
--- a/src/mesa/drivers/dri/i965/intel_context.h
+++ b/src/mesa/drivers/dri/i965/intel_context.h
@@ -86,7 +86,6 @@ struct intel_texture_object
-
struct intel_context
{
GLcontext ctx; /* the parent class */
@@ -148,9 +147,14 @@ struct intel_context
void (*meta_depth_replace)( struct intel_context *intel );
+ void (*meta_texture_blend_replace) (struct intel_context * intel);
+
void (*meta_no_stencil_write)( struct intel_context *intel );
void (*meta_no_depth_write)( struct intel_context *intel );
void (*meta_no_texture)( struct intel_context *intel );
+ void (*meta_import_pixel_state) (struct intel_context * intel);
+ void (*meta_frame_buffer_texture)( struct intel_context *intel,
+ GLint xoff, GLint yoff );
void (*meta_draw_quad)(struct intel_context *intel,
GLfloat x0, GLfloat x1,
@@ -173,6 +177,7 @@ struct intel_context
GLuint second_last_swap_fence;
GLboolean aub_wrap;
+ GLboolean stats_wm;
struct intel_batchbuffer *batch;
@@ -218,6 +223,7 @@ struct intel_context
int drawY;
GLuint numClipRects; /* cliprects for that buffer */
drm_clip_rect_t *pClipRects;
+ struct gl_texture_object *frame_buffer_texobj;
GLboolean scissor;
drm_clip_rect_t draw_rect;
diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.c b/src/mesa/drivers/dri/i965/intel_ioctl.c
index d1f2e3f27ca..4da31277ea2 100644
--- a/src/mesa/drivers/dri/i965/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i965/intel_ioctl.c
@@ -43,6 +43,26 @@
#include "drm.h"
#include "bufmgr.h"
+static int intelWaitIdleLocked( struct intel_context *intel )
+{
+ static int in_wait_idle = 0;
+ unsigned int fence;
+
+ if (!in_wait_idle) {
+ if (INTEL_DEBUG & DEBUG_SYNC) {
+ fprintf(stderr, "waiting for idle\n");
+ }
+
+ in_wait_idle = 1;
+ fence = bmSetFence(intel);
+ intelWaitIrq(intel, fence);
+ in_wait_idle = 0;
+
+ return bmTestFence(intel, fence);
+ } else {
+ return 1;
+ }
+}
int intelEmitIrqLocked( struct intel_context *intel )
{
@@ -75,7 +95,7 @@ void intelWaitIrq( struct intel_context *intel, int seq )
{
if (!intel->no_hw) {
drmI830IrqWait iw;
- int ret;
+ int ret, lastdispatch;
if (0)
fprintf(stderr, "%s %d\n", __FUNCTION__, seq );
@@ -83,11 +103,12 @@ void intelWaitIrq( struct intel_context *intel, int seq )
iw.irq_seq = seq;
do {
+ lastdispatch = intel->sarea->last_dispatch;
ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) );
/* This seems quite often to return before it should!?!
*/
- } while (ret == -EAGAIN || ret == -EINTR || (ret == 0 && seq > intel->sarea->last_dispatch));
+ } while (ret == -EAGAIN || ret == -EINTR || (ret == -EBUSY && lastdispatch != intel->sarea->last_dispatch) || (ret == 0 && seq > intel->sarea->last_dispatch));
if ( ret ) {
@@ -139,7 +160,11 @@ void intel_batch_ioctl( struct intel_context *intel,
UNLOCK_HARDWARE(intel);
exit(1);
}
- }
+
+ if (INTEL_DEBUG & DEBUG_SYNC) {
+ intelWaitIdleLocked(intel);
+ }
+ }
}
void intel_cmd_ioctl( struct intel_context *intel,
@@ -171,5 +196,9 @@ void intel_cmd_ioctl( struct intel_context *intel,
UNLOCK_HARDWARE(intel);
exit(1);
}
- }
+
+ if (INTEL_DEBUG & DEBUG_SYNC) {
+ intelWaitIdleLocked(intel);
+ }
+ }
}
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
index d5d48994529..58dc49505fe 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -80,8 +80,6 @@ intel_check_blit_fragment_ops(GLcontext * ctx)
if (ctx->NewState)
_mesa_update_state(ctx);
- /* Could do logicop with the blitter:
- */
return !(ctx->_ImageTransferState ||
ctx->RenderMode != GL_RENDER ||
ctx->Color.AlphaEnabled ||
@@ -92,12 +90,112 @@ intel_check_blit_fragment_ops(GLcontext * ctx)
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] || /* can do this! */
- ctx->Color.ColorLogicOpEnabled || /* can do this! */
ctx->Texture._EnabledUnits ||
- ctx->FragmentProgram._Enabled);
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
}
+/* Doesn't work for overlapping regions. Could do a double copy or
+ * just fallback.
+ */
+static GLboolean
+do_texture_copypixels(GLcontext * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst = intel_drawbuf_region(intel);
+ struct intel_region *src = copypix_src_region(intel, type);
+ GLenum src_format;
+ GLenum src_type;
+
+ DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__,
+ srcx, srcy, width, height, dstx, dsty);
+
+ if (!src || !dst || type != GL_COLOR ||
+ ctx->_ImageTransferState ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F ||
+ ctx->RenderMode != GL_RENDER ||
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ src != dst )
+ return GL_FALSE;
+
+ /* Can't handle overlapping regions. Don't have sufficient control
+ * over rasterization to pull it off in-place. Punt on these for
+ * now.
+ *
+ * XXX: do a copy to a temporary.
+ */
+ if (src->buffer == dst->buffer) {
+ drm_clip_rect_t srcbox;
+ drm_clip_rect_t dstbox;
+ drm_clip_rect_t tmp;
+
+ srcbox.x1 = srcx;
+ srcbox.y1 = srcy;
+ srcbox.x2 = srcx + width - 1;
+ srcbox.y2 = srcy + height - 1;
+
+ dstbox.x1 = dstx;
+ dstbox.y1 = dsty;
+ dstbox.x2 = dstx + width - 1;
+ dstbox.y2 = dsty + height - 1;
+
+ DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2);
+ DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2,
+ width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
+
+ if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) {
+ DBG("%s: regions overlap\n", __FUNCTION__);
+ return GL_FALSE;
+ }
+ }
+ intelFlush(&intel->ctx);
+
+ intel->vtbl.install_meta_state(intel);
+
+ /* Is this true? Also will need to turn depth testing on according
+ * to state:
+ */
+ intel->vtbl.meta_no_stencil_write(intel);
+ intel->vtbl.meta_no_depth_write(intel);
+
+ /* Set the 3d engine to draw into the destination region:
+ */
+ intel->vtbl.meta_draw_region(intel, dst, intel->depth_region);
+
+ intel->vtbl.meta_import_pixel_state(intel);
+
+ if (src->cpp == 2) {
+ src_format = GL_RGB;
+ src_type = GL_UNSIGNED_SHORT_5_6_5;
+ }
+ else {
+ src_format = GL_BGRA;
+ src_type = GL_UNSIGNED_BYTE;
+ }
+
+ /* Set the frontbuffer up as a large rectangular texture.
+ */
+ intel->vtbl.meta_frame_buffer_texture( intel, srcx - dstx, srcy - dsty );
+
+ intel->vtbl.meta_texture_blend_replace(intel);
+
+ if (intel->driDrawable->numClipRects)
+ intel->vtbl.meta_draw_quad( intel,
+ dstx, dstx + width,
+ dsty, dsty + height,
+ ctx->Current.RasterPos[ 2 ],
+ 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0 );
+
+ intel->vtbl.leave_meta_state( intel );
+
+ DBG("%s: success\n", __FUNCTION__);
+ return GL_TRUE;
+}
/**
* CopyPixels with the blitter. Don't support zooming, pixel transfer, etc.
@@ -210,7 +308,9 @@ do_blit_copypixels(GLcontext * ctx,
rect.x1 + delta_x,
rect.y1 + delta_y, /* srcx, srcy */
rect.x1, rect.y1, /* dstx, dsty */
- rect.x2 - rect.x1, rect.y2 - rect.y1);
+ rect.x2 - rect.x1, rect.y2 - rect.y1,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY);
}
intel->need_flush = GL_TRUE;
@@ -233,6 +333,9 @@ intelCopyPixels(GLcontext * ctx,
if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
return;
+ if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("fallback to _swrast_CopyPixels\n");
diff --git a/src/mesa/drivers/dri/i965/intel_regions.c b/src/mesa/drivers/dri/i965/intel_regions.c
index 53f05612377..398b0a0a3b5 100644
--- a/src/mesa/drivers/dri/i965/intel_regions.c
+++ b/src/mesa/drivers/dri/i965/intel_regions.c
@@ -269,7 +269,8 @@ void intel_region_copy( struct intel_context *intel,
dst->pitch, dst->buffer, dst_offset, dst->tiled,
srcx, srcy,
dstx, dsty,
- width, height);
+ width, height,
+ GL_COPY );
}
/* Fill a rectangular sub-region. Need better logic about when to
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 56e6a792fa2..8269deba664 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -230,16 +230,19 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
intelScreen->front.pitch = sarea->pitch * intelScreen->cpp;
intelScreen->front.handle = sarea->front_handle;
intelScreen->front.size = sarea->front_size;
+ intelScreen->front.tiled = sarea->front_tiled;
intelScreen->back.offset = sarea->back_offset;
intelScreen->back.pitch = sarea->pitch * intelScreen->cpp;
intelScreen->back.handle = sarea->back_handle;
intelScreen->back.size = sarea->back_size;
-
+ intelScreen->back.tiled = sarea->back_tiled;
+
intelScreen->depth.offset = sarea->depth_offset;
intelScreen->depth.pitch = sarea->pitch * intelScreen->cpp;
intelScreen->depth.handle = sarea->depth_handle;
intelScreen->depth.size = sarea->depth_size;
+ intelScreen->depth.tiled = sarea->depth_tiled;
intelScreen->tex.offset = sarea->tex_offset;
intelScreen->logTextureGranularity = sarea->log_tex_granularity;
@@ -249,6 +252,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
intelScreen->rotated.offset = sarea->rotated_offset;
intelScreen->rotated.pitch = sarea->rotated_pitch * intelScreen->cpp;
intelScreen->rotated.size = sarea->rotated_size;
+ intelScreen->rotated.tiled = sarea->rotated_tiled;
intelScreen->current_rotation = sarea->rotation;
#if 0
matrix23Rotate(&intelScreen->rotMatrix,
diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h
index 094158afd85..bf9a716082d 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.h
+++ b/src/mesa/drivers/dri/i965/intel_screen.h
@@ -42,6 +42,7 @@ typedef struct {
char *map; /* memory map */
int offset; /* from start of video mem, in bytes */
int pitch; /* row stride, in pixels */
+ unsigned int tiled;
} intelRegion;
typedef struct
diff --git a/src/mesa/drivers/dri/i965/intel_tex_layout.c b/src/mesa/drivers/dri/i965/intel_tex_layout.c
new file mode 120000
index 00000000000..fe61b441945
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_tex_layout.c
@@ -0,0 +1 @@
+../intel/intel_tex_layout.c \ No newline at end of file
diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c
index 91ae0970a04..cb23b9dd879 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c
@@ -133,6 +133,9 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel,
GLuint nr_faces = 0;
struct gl_texture_image *firstImage;
+ if( tObj == intel->frame_buffer_texobj )
+ return GL_FALSE;
+
/* We know/require this is true by now:
*/
assert(intelObj->base.Complete);
diff --git a/src/mesa/drivers/dri/i965/server/i830_common.h b/src/mesa/drivers/dri/i965/server/i830_common.h
index e3bbdc79070..f320378c2a5 100644
--- a/src/mesa/drivers/dri/i965/server/i830_common.h
+++ b/src/mesa/drivers/dri/i965/server/i830_common.h
@@ -52,6 +52,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define DRM_I830_INIT_HEAP 0x0a
#define DRM_I830_CMDBUFFER 0x0b
#define DRM_I830_DESTROY_HEAP 0x0c
+#define DRM_I830_MMIO 0x10
typedef struct {
enum {
@@ -199,5 +200,23 @@ typedef struct {
int region;
} drmI830MemDestroyHeap;
+#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/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
new file mode 100644
index 00000000000..f3564802171
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -0,0 +1,102 @@
+/**************************************************************************
+ *
+ * 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.
+ *
+ **************************************************************************/
+ /*
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ * Michel Dänzer <[email protected]>
+ */
+
+#include "intel_mipmap_tree.h"
+#include "intel_tex_layout.h"
+#include "macros.h"
+
+
+static int align(int value, int alignment)
+{
+ return (value + alignment - 1) & ~(alignment - 1);
+}
+
+void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
+{
+ GLint align_h = 2, align_w = 4;
+ GLuint level;
+ GLuint x = 0;
+ GLuint y = 0;
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+
+ mt->pitch = mt->width0;
+
+ /* May need to adjust pitch to accomodate the placement of
+ * the 2nd mipmap. This occurs when the alignment
+ * constraints of mipmap placement push the right edge of the
+ * 2nd mipmap out past the width of its parent.
+ */
+ if (mt->first_level != mt->last_level) {
+ GLuint mip1_width = align(minify(mt->width0), align_w)
+ + minify(minify(mt->width0));
+
+ if (mip1_width > mt->width0)
+ mt->pitch = mip1_width;
+ }
+
+ /* Pitch must be a whole number of dwords, even though we
+ * express it in texels.
+ */
+ mt->pitch = align(mt->pitch * mt->cpp, 4) / mt->cpp;
+ mt->total_height = 0;
+
+ for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
+ GLuint img_height;
+
+ intel_miptree_set_level_info(mt, level, 1, x, y, width,
+ mt->compressed ? height/4 : height, 1);
+
+ if (mt->compressed)
+ img_height = MAX2(1, height/4);
+ else
+ img_height = align(height, align_h);
+
+
+ /* Because the images are packed better, the final offset
+ * might not be the maximal one:
+ */
+ mt->total_height = MAX2(mt->total_height, y + img_height);
+
+ /* Layout_below: step right after second mipmap.
+ */
+ if (level == mt->first_level + 1) {
+ x += align(width, align_w);
+ }
+ else {
+ y += img_height;
+ }
+
+ width = minify(width);
+ height = minify(height);
+ }
+}
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h
new file mode 100644
index 00000000000..1e37f8f525f
--- /dev/null
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h
@@ -0,0 +1,41 @@
+/**************************************************************************
+ *
+ * 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.
+ *
+ **************************************************************************/
+ /*
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ * Michel Dänzer <[email protected]>
+ */
+
+#include "macros.h"
+
+
+static GLuint minify( GLuint d )
+{
+ return MAX2(1, d>>1);
+}
+
+extern void i945_miptree_layout_2d( struct intel_mipmap_tree *mt );
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index eeb4cbcf71e..5a6c301da2d 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -102,6 +102,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
mach64ContextPtr mmesa;
mach64ScreenPtr mach64Screen;
int i, heap;
+ GLuint *c_textureSwapsPtr = NULL;
#if DO_DEBUG
MACH64_DEBUG = driParseDebugString(getenv("MACH64_DEBUG"), debug_control);
@@ -153,15 +154,28 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
mmesa->CurrentTexObj[0] = NULL;
mmesa->CurrentTexObj[1] = NULL;
- make_empty_list( &mmesa->SwappedOut );
+ (void) memset( mmesa->texture_heaps, 0, sizeof( mmesa->texture_heaps ) );
+ make_empty_list( &mmesa->swapped );
mmesa->firstTexHeap = mach64Screen->firstTexHeap;
mmesa->lastTexHeap = mach64Screen->firstTexHeap + mach64Screen->numTexHeaps;
for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- make_empty_list( &mmesa->TexObjList[i] );
- mmesa->texHeap[i] = mmInit( 0, mach64Screen->texSize[i] );
- mmesa->lastTexAge[i] = -1;
+ mmesa->texture_heaps[i] = driCreateTextureHeap( i, mmesa,
+ mach64Screen->texSize[i],
+ 6, /* align to 64-byte boundary, use 12 for page-size boundary */
+ MACH64_NR_TEX_REGIONS,
+ (drmTextureRegionPtr)mmesa->sarea->tex_list[i],
+ &mmesa->sarea->tex_age[i],
+ &mmesa->swapped,
+ sizeof( mach64TexObj ),
+ (destroy_texture_object_t *) mach64DestroyTexObj );
+
+#if ENABLE_PERF_BOXES
+ c_textureSwapsPtr = & mmesa->c_textureSwaps;
+#endif
+ driSetTextureSwapCounterLocation( mmesa->texture_heaps[i],
+ c_textureSwapsPtr );
}
mmesa->RenderIndex = -1; /* Impossible value */
@@ -176,17 +190,25 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
* Test for 2 textures * bytes/texel * size * size. There's no
* need to account for mipmaps since we only upload one level.
*/
- heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP;
-
- if ( mach64Screen->texSize[heap] >= 2 * mach64Screen->cpp * 1024*1024 ) {
- ctx->Const.MaxTextureLevels = 11; /* 1024x1024 */
- } else if ( mach64Screen->texSize[heap] >= 2 * mach64Screen->cpp * 512*512 ) {
- ctx->Const.MaxTextureLevels = 10; /* 512x512 */
- } else {
- ctx->Const.MaxTextureLevels = 9; /* 256x256 */
- }
ctx->Const.MaxTextureUnits = 2;
+ ctx->Const.MaxTextureImageUnits = 2;
+ ctx->Const.MaxTextureCoordUnits = 2;
+
+ heap = mach64Screen->IsPCI ? MACH64_CARD_HEAP : MACH64_AGP_HEAP;
+
+ driCalculateMaxTextureLevels( & mmesa->texture_heaps[heap],
+ 1,
+ & ctx->Const,
+ mach64Screen->cpp,
+ 10, /* max 2D texture size is 1024x1024 */
+ 0, /* 3D textures unsupported. */
+ 0, /* cube textures unsupported. */
+ 0, /* texture rectangles unsupported. */
+ 1, /* mipmapping unsupported. */
+ GL_TRUE, /* need to have both textures in
+ either local or AGP memory */
+ 0 );
#if ENABLE_PERF_BOXES
mmesa->boxes = ( getenv( "LIBGL_PERFORMANCE_BOXES" ) != NULL );
@@ -250,31 +272,29 @@ void mach64DestroyContext( __DRIcontextPrivate *driContextPriv )
assert(mmesa); /* should never be null */
if ( mmesa ) {
- if (mmesa->glCtx->Shared->RefCount == 1) {
+ GLboolean release_texture_heaps;
+
+ release_texture_heaps = (mmesa->glCtx->Shared->RefCount == 1);
+
+ _swsetup_DestroyContext( mmesa->glCtx );
+ _tnl_DestroyContext( mmesa->glCtx );
+ _vbo_DestroyContext( mmesa->glCtx );
+ _swrast_DestroyContext( mmesa->glCtx );
+
+ if (release_texture_heaps) {
/* This share group is about to go away, free our private
* texture object data.
*/
- mach64TexObjPtr t, next_t;
int i;
for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- foreach_s ( t, next_t, &mmesa->TexObjList[i] ) {
- mach64DestroyTexObj( mmesa, t );
- }
- mmDestroy( mmesa->texHeap[i] );
- mmesa->texHeap[i] = NULL;
+ driDestroyTextureHeap( mmesa->texture_heaps[i] );
+ mmesa->texture_heaps[i] = NULL;
}
- foreach_s ( t, next_t, &mmesa->SwappedOut ) {
- mach64DestroyTexObj( mmesa, t );
- }
+ assert( is_empty_list( & mmesa->swapped ) );
}
- _swsetup_DestroyContext( mmesa->glCtx );
- _tnl_DestroyContext( mmesa->glCtx );
- _vbo_DestroyContext( mmesa->glCtx );
- _swrast_DestroyContext( mmesa->glCtx );
-
mach64FreeVB( mmesa->glCtx );
/* Free the vertex buffer */
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h
index e718b96c188..8d89452412b 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.h
+++ b/src/mesa/drivers/dri/mach64/mach64_context.h
@@ -134,46 +134,17 @@ typedef void (*mach64_line_func)( mach64ContextPtr,
typedef void (*mach64_point_func)( mach64ContextPtr,
mach64Vertex * );
-#ifdef TEXMEM
struct mach64_texture_object {
driTextureObject base;
- GLuint offset;
+ GLuint bufAddr;
- GLuint dirty;
- GLuint age;
+ GLint heap; /* same as base.heap->heapId */
- GLint widthLog2;
- GLint heightLog2;
- GLint maxLog2;
-
- GLint hasAlpha;
- GLint textureFormat;
-
- /* Have to keep these separate due to how they are programmed.
- * FIXME: Why don't we just use the tObj values?
+ /* For communicating values from mach64AllocTexObj(), mach64SetTexImages()
+ * to mach64UpdateTextureUnit(). Alternately, we can use the tObj values or
+ * set the context registers directly.
*/
- GLboolean BilinearMin;
- GLboolean BilinearMag;
- GLboolean ClampS;
- GLboolean ClampT;
-};
-#else
-struct mach64_texture_object {
- struct mach64_texture_object *next;
- struct mach64_texture_object *prev;
- struct gl_texture_object *tObj;
-
- struct mem_block *memBlock;
- GLuint offset;
- GLuint size;
-
- GLuint dirty;
- GLuint age;
-
- GLint bound;
- GLint heap;
-
GLint widthLog2;
GLint heightLog2;
GLint maxLog2;
@@ -181,19 +152,14 @@ struct mach64_texture_object {
GLint hasAlpha;
GLint textureFormat;
- /* Have to keep these separate due to how they are programmed.
- * FIXME: Why don't we just use the tObj values?
- */
GLboolean BilinearMin;
GLboolean BilinearMag;
GLboolean ClampS;
GLboolean ClampT;
};
-#endif
typedef struct mach64_texture_object mach64TexObj, *mach64TexObjPtr;
-
struct mach64_context {
GLcontext *glCtx;
@@ -229,17 +195,10 @@ struct mach64_context {
/* Texture object bookkeeping
*/
mach64TexObjPtr CurrentTexObj[2];
-#ifdef TEXMEM
- unsigned nr_heaps;
- driTexHeap * texture_heaps[ R128_NR_TEX_HEAPS ];
- driTextureObject swapped;
-#else
- mach64TexObj TexObjList[MACH64_NR_TEX_HEAPS];
- mach64TexObj SwappedOut;
- struct mem_block *texHeap[MACH64_NR_TEX_HEAPS];
- GLuint lastTexAge[MACH64_NR_TEX_HEAPS];
+
GLint firstTexHeap, lastTexHeap;
-#endif
+ driTexHeap *texture_heaps[MACH64_NR_TEX_HEAPS];
+ driTextureObject swapped;
/* Fallback rasterization functions
*/
diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c
index b214495d9a6..b73e350111f 100644
--- a/src/mesa/drivers/dri/mach64/mach64_lock.c
+++ b/src/mesa/drivers/dri/mach64/mach64_lock.c
@@ -82,14 +82,15 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags )
| MACH64_UPLOAD_MISC
| MACH64_UPLOAD_CLIPRECTS);
+ /* EXA render acceleration uses the texture engine, so restore it */
+ mmesa->dirty |= (MACH64_UPLOAD_TEXTURE);
+
if ( sarea->ctx_owner != mmesa->hHWContext ) {
sarea->ctx_owner = mmesa->hHWContext;
mmesa->dirty = MACH64_UPLOAD_ALL;
}
for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- if ( mmesa->texHeap[i] && (sarea->tex_age[i] != mmesa->lastTexAge[i]) ) {
- mach64AgeTextures( mmesa, i );
- }
+ DRI_AGE_TEXTURES( mmesa->texture_heaps[i] );
}
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index b17de01acc5..1014b8acd52 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -305,7 +305,7 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
mach64Screen->texSize[MACH64_AGP_HEAP] = 0;
mach64Screen->logTexGranularity[MACH64_AGP_HEAP] = 0;
} else {
- if (mach64Screen->texSize[MACH64_CARD_HEAP] > 0) {
+ if (serverInfo->textureSize > 0) {
mach64Screen->numTexHeaps = MACH64_NR_TEX_HEAPS;
mach64Screen->firstTexHeap = MACH64_CARD_HEAP;
} else {
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 6459deef784..5288d321ced 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -116,21 +116,20 @@ mach64AllocTexObj( struct gl_texture_object *texObj )
fprintf( stderr, "%s( %p )\n", __FUNCTION__, texObj );
t = (mach64TexObjPtr) CALLOC_STRUCT( mach64_texture_object );
+ texObj->DriverData = t;
if ( !t )
return NULL;
/* Initialize non-image-dependent parts of the state:
*/
- t->tObj = texObj;
+ t->base.tObj = texObj;
+ t->base.dirty_images[0] = (1 << 0);
- t->offset = 0;
+ t->bufAddr = 0;
- t->dirty = 1;
-
- make_empty_list( t );
+ make_empty_list( (driTextureObject *) t );
mach64SetTexWrap( t, texObj->WrapS, texObj->WrapT );
- /*mach64SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/
mach64SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
mach64SetTexBorderColor( t, texObj->_BorderChan );
@@ -251,18 +250,17 @@ static void mach64TexImage1D( GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
+ driTextureObject * t = (driTextureObject *) texObj->DriverData;
if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
+ driSwapOutTextureObject( t );
}
else {
- t = mach64AllocTexObj(texObj);
+ t = (driTextureObject *) mach64AllocTexObj(texObj);
if (!t) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
return;
}
- texObj->DriverData = t;
}
/* Note, this will call mach64ChooseTextureFormat */
@@ -285,19 +283,18 @@ static void mach64TexSubImage1D( GLcontext *ctx,
struct gl_texture_image *texImage )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
+ driTextureObject * t = (driTextureObject *) texObj->DriverData;
assert( t ); /* this _should_ be true */
if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
+ driSwapOutTextureObject( t );
}
else {
- t = mach64AllocTexObj(texObj);
+ t = (driTextureObject *) mach64AllocTexObj(texObj);
if (!t) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D");
return;
}
- texObj->DriverData = t;
}
_mesa_store_texsubimage1d(ctx, target, level, xoffset, width,
@@ -316,18 +313,17 @@ static void mach64TexImage2D( GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
+ driTextureObject * t = (driTextureObject *) texObj->DriverData;
if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
+ driSwapOutTextureObject( t );
}
else {
- t = mach64AllocTexObj(texObj);
+ t = (driTextureObject *) mach64AllocTexObj(texObj);
if (!t) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
return;
}
- texObj->DriverData = t;
}
/* Note, this will call mach64ChooseTextureFormat */
@@ -350,19 +346,18 @@ static void mach64TexSubImage2D( GLcontext *ctx,
struct gl_texture_image *texImage )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr) texObj->DriverData;
+ driTextureObject * t = (driTextureObject *) texObj->DriverData;
assert( t ); /* this _should_ be true */
if ( t ) {
- mach64SwapOutTexObj( mmesa, t );
+ driSwapOutTextureObject( t );
}
else {
- t = mach64AllocTexObj(texObj);
+ t = (driTextureObject *) mach64AllocTexObj(texObj);
if (!t) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D");
return;
}
- texObj->DriverData = t;
}
_mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width,
@@ -372,44 +367,6 @@ static void mach64TexSubImage2D( GLcontext *ctx,
mmesa->new_state |= MACH64_NEW_TEXTURE;
}
-/* Due to the way we must program texture state into the Rage Pro,
- * we must leave these calculations to the absolute last minute.
- */
-void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
- mach64TexObjPtr t0,
- mach64TexObjPtr t1 )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
- drm_mach64_context_regs_t *regs = &(mmesa->setup);
-
- /* for multitex, both textures must be local or AGP */
- if ( t0 && t1 )
- assert(t0->heap == t1->heap);
-
- if ( t0 ) {
- if (t0->heap == MACH64_CARD_HEAP) {
-#if ENABLE_PERF_BOXES
- mmesa->c_texsrc_card++;
-#endif
- mmesa->setup.tex_cntl &= ~MACH64_TEX_SRC_AGP;
- } else {
-#if ENABLE_PERF_BOXES
- mmesa->c_texsrc_agp++;
-#endif
- mmesa->setup.tex_cntl |= MACH64_TEX_SRC_AGP;
- }
- mmesa->setup.tex_offset = t0->offset;
- }
-
- if ( t1 ) {
- mmesa->setup.secondary_tex_off = t1->offset;
- }
-
- memcpy( &sarea->context_state.tex_size_pitch, &regs->tex_size_pitch,
- MACH64_NR_TEXTURE_REGS * sizeof(GLuint) );
-}
-
-
/* ================================================================
* Device Driver API texture functions
*/
@@ -491,24 +448,23 @@ static void mach64DDTexParameter( GLcontext *ctx, GLenum target,
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexParameter");
return;
}
- tObj->DriverData = t;
}
switch ( pname ) {
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
- if ( t->bound ) FLUSH_BATCH( mmesa );
+ if ( t->base.bound ) FLUSH_BATCH( mmesa );
mach64SetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
break;
case GL_TEXTURE_WRAP_S:
case GL_TEXTURE_WRAP_T:
- if ( t->bound ) FLUSH_BATCH( mmesa );
+ if ( t->base.bound ) FLUSH_BATCH( mmesa );
mach64SetTexWrap( t, tObj->WrapS, tObj->WrapT );
break;
case GL_TEXTURE_BORDER_COLOR:
- if ( t->bound ) FLUSH_BATCH( mmesa );
+ if ( t->base.bound ) FLUSH_BATCH( mmesa );
mach64SetTexBorderColor( t, tObj->_BorderChan );
break;
@@ -522,8 +478,8 @@ static void mach64DDTexParameter( GLcontext *ctx, GLenum target,
* For mach64 we're only concerned with the base level
* since that's the only texture we upload.
*/
- if ( t->bound ) FLUSH_BATCH( mmesa );
- mach64SwapOutTexObj( mmesa, t );
+ if ( t->base.bound ) FLUSH_BATCH( mmesa );
+ driSwapOutTextureObject( (driTextureObject *) t );
break;
default:
@@ -547,7 +503,7 @@ static void mach64DDBindTexture( GLcontext *ctx, GLenum target,
FLUSH_BATCH( mmesa );
if ( mmesa->CurrentTexObj[unit] ) {
- mmesa->CurrentTexObj[unit]->bound &= ~(unit+1);
+ mmesa->CurrentTexObj[unit]->base.bound &= ~(1 << unit);
mmesa->CurrentTexObj[unit] = NULL;
}
@@ -558,33 +514,37 @@ static void mach64DDDeleteTexture( GLcontext *ctx,
struct gl_texture_object *tObj )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
- mach64TexObjPtr t = (mach64TexObjPtr)tObj->DriverData;
+ driTextureObject * t = (driTextureObject *) tObj->DriverData;
if ( t ) {
if ( t->bound && mmesa ) {
FLUSH_BATCH( mmesa );
- mmesa->CurrentTexObj[t->bound-1] = 0;
mmesa->new_state |= MACH64_NEW_TEXTURE;
}
- mach64DestroyTexObj( mmesa, t );
- tObj->DriverData = NULL;
+ driDestroyTextureObject( t );
+
/* Free mipmap images and the texture object itself */
_mesa_delete_texture_object(ctx, tObj);
-
}
}
-static GLboolean mach64DDIsTextureResident( GLcontext *ctx,
- struct gl_texture_object *tObj )
+/**
+ * Allocate a new texture object.
+ * Called via ctx->Driver.NewTextureObject.
+ * Note: we could use containment here to 'derive' the driver-specific
+ * texture object from the core mesa gl_texture_object. Not done at this time.
+ */
+static struct gl_texture_object *
+mach64NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
- mach64TexObjPtr t = (mach64TexObjPtr)tObj->DriverData;
-
- return ( t && t->memBlock );
+ struct gl_texture_object *obj;
+ obj = _mesa_new_texture_object(ctx, name, target);
+ mach64AllocTexObj( obj );
+ return obj;
}
-
void mach64InitTextureFuncs( struct dd_function_table *functions )
{
functions->TexEnv = mach64DDTexEnv;
@@ -593,18 +553,15 @@ void mach64InitTextureFuncs( struct dd_function_table *functions )
functions->TexSubImage1D = mach64TexSubImage1D;
functions->TexImage2D = mach64TexImage2D;
functions->TexSubImage2D = mach64TexSubImage2D;
- functions->TexImage3D = _mesa_store_teximage3d;
- functions->TexSubImage3D = _mesa_store_texsubimage3d;
- functions->CopyTexImage1D = _swrast_copy_teximage1d;
- functions->CopyTexImage2D = _swrast_copy_teximage2d;
- functions->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
- functions->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
- functions->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
functions->TexParameter = mach64DDTexParameter;
functions->BindTexture = mach64DDBindTexture;
+ functions->NewTextureObject = mach64NewTextureObject;
functions->DeleteTexture = mach64DDDeleteTexture;
+ functions->IsTextureResident = driIsTextureResident;
+
functions->UpdateTexturePalette = NULL;
functions->ActiveTexture = NULL;
- functions->IsTextureResident = mach64DDIsTextureResident;
- functions->PrioritizeTexture = NULL;
+ functions->PrioritizeTexture = NULL;
+
+ driInitTextureFormats();
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.h b/src/mesa/drivers/dri/mach64/mach64_tex.h
index d950dd12b44..f6cf1cf8020 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.h
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.h
@@ -34,25 +34,15 @@
extern void mach64UpdateTextureState( GLcontext *ctx );
-extern void mach64SwapOutTexObj( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
extern void mach64UploadTexImages( mach64ContextPtr mach64ctx,
mach64TexObjPtr t );
extern void mach64UploadMultiTexImages( mach64ContextPtr mach64ctx,
mach64TexObjPtr t0, mach64TexObjPtr t1 );
-extern void mach64AgeTextures( mach64ContextPtr mach64ctx, int heap );
extern void mach64DestroyTexObj( mach64ContextPtr mach64ctx,
mach64TexObjPtr t );
-extern void mach64UpdateTexLRU( mach64ContextPtr mach64ctx,
- mach64TexObjPtr t );
-
-extern void mach64PrintLocalLRU( mach64ContextPtr mach64ctx, int heap );
-extern void mach64PrintGlobalLRU( mach64ContextPtr mach64ctx, int heap );
-
extern void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
mach64TexObjPtr t0,
mach64TexObjPtr t1 );
diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c
index 017fd3535d5..3b7b93b9842 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c
@@ -49,333 +49,19 @@
*/
void mach64DestroyTexObj( mach64ContextPtr mmesa, mach64TexObjPtr t )
{
-#if ENABLE_PERF_BOXES
- /* Bump the performace counter */
- if (mmesa)
- mmesa->c_textureSwaps++;
-#endif
- if ( !t ) return;
-
-#if 0
- if ( t->tObj && t->memBlock && mmesa ) {
- /* not a placeholder, so release from global LRU if necessary */
- int heap = t->heap;
- drmTextureRegion *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- /* do we own this block? */
- if (list[i].in_use == mmesa->hHWContext) {
- list[i].in_use = 0;
- list[i].age = mmesa->lastTexAge[heap];
-
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
- }
- }
- }
-#endif
-
- if ( t->memBlock ) {
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
- }
-
- if ( t->tObj ) {
- t->tObj->DriverData = NULL;
- }
-
- if ( t->bound && mmesa )
- mmesa->CurrentTexObj[t->bound-1] = NULL;
-
- remove_from_list( t );
- FREE( t );
-}
-
-/* Keep track of swapped out texture objects.
- */
-void mach64SwapOutTexObj( mach64ContextPtr mmesa,
- mach64TexObjPtr t )
-{
-#if ENABLE_PERF_BOXES
- /* Bump the performace counter */
- if (mmesa)
- mmesa->c_textureSwaps++;
-#endif
-
-#if 0
- if ( t->tObj && t->memBlock && mmesa ) {
- /* not a placeholder, so release from global LRU if necessary */
- int heap = t->heap;
- drmTextureRegion *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- /* do we own this block? */
- if (list[i].in_use == mmesa->hHWContext) {
- list[i].in_use = 0;
- list[i].age = mmesa->lastTexAge[heap];
-
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
- }
- }
- }
-#endif
-
- if ( t->memBlock ) {
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
- }
-
- t->dirty = ~0;
- move_to_tail( &mmesa->SwappedOut, t );
-}
-
-/* Print out debugging information about texture LRU.
- */
-void mach64PrintLocalLRU( mach64ContextPtr mmesa, int heap )
-{
- mach64TexObjPtr t;
- int sz = 1 << (mmesa->mach64Screen->logTexGranularity[heap]);
-
- fprintf( stderr, "\nLocal LRU, heap %d:\n", heap );
-
- foreach( t, &mmesa->TexObjList[heap] ) {
- if ( !t->tObj ) {
- fprintf( stderr, "Placeholder %d at 0x%x sz 0x%x\n",
- t->memBlock->ofs / sz,
- t->memBlock->ofs,
- t->memBlock->size );
- } else {
- fprintf( stderr, "Texture (bound %d) at 0x%x sz 0x%x\n",
- t->bound,
- t->memBlock->ofs,
- t->memBlock->size );
- }
- }
-
- fprintf( stderr, "\n" );
-}
-
-void mach64PrintGlobalLRU( mach64ContextPtr mmesa, int heap )
-{
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int i, j;
-
- fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list );
-
- for ( i = 0, j = MACH64_NR_TEX_REGIONS ; i < MACH64_NR_TEX_REGIONS ; i++ ) {
- fprintf( stderr, "list[%d] age %d in_use %d next %d prev %d\n",
- j, list[j].age, list[j].in_use, list[j].next, list[j].prev );
- j = list[j].next;
- if ( j == MACH64_NR_TEX_REGIONS ) break;
- }
-
- if ( j != MACH64_NR_TEX_REGIONS ) {
- fprintf( stderr, "Loop detected in global LRU\n" );
- for ( i = 0 ; i < MACH64_NR_TEX_REGIONS ; i++ ) {
- fprintf( stderr, "list[%d] age %d in_use %d next %d prev %d\n",
- i, list[i].age, list[i].in_use, list[i].next, list[i].prev );
- }
- }
+ unsigned i;
- fprintf( stderr, "\n" );
-}
-
-/* Reset the global texture LRU.
- */
-/* NOTE: This function is only called while holding the hardware lock */
-static void mach64ResetGlobalLRU( mach64ContextPtr mmesa, int heap )
-{
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
- int i;
-
- /* (Re)initialize the global circular LRU list. The last element in
- * the array (MACH64_NR_TEX_REGIONS) is the sentinal. Keeping it at
- * the end of the array allows it to be addressed rationally when
- * looking up objects at a particular location in texture memory.
+ /* See if it was the driver's current object.
*/
- for ( i = 0 ; (i+1) * sz <= mmesa->mach64Screen->texSize[heap] ; i++ ) {
- list[i].prev = i-1;
- list[i].next = i+1;
- list[i].age = 0;
- list[i].in_use = 0;
- }
-
- i--;
- list[0].prev = MACH64_NR_TEX_REGIONS;
- list[i].prev = i-1;
- list[i].next = MACH64_NR_TEX_REGIONS;
- list[MACH64_NR_TEX_REGIONS].prev = i;
- list[MACH64_NR_TEX_REGIONS].next = 0;
- mmesa->sarea->tex_age[heap] = 0;
-}
-
-/* Update the local and global texture LRUs.
- */
-/* NOTE: This function is only called while holding the hardware lock */
-void mach64UpdateTexLRU( mach64ContextPtr mmesa,
- mach64TexObjPtr t )
-{
- int heap = t->heap;
- drm_tex_region_t *list = mmesa->sarea->tex_list[heap];
- int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
- int start = t->memBlock->ofs >> log2sz;
- int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
- int i;
-
- mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];
-
- if ( !t->memBlock ) {
- fprintf( stderr, "no memblock\n\n" );
- return;
- }
-
- /* Update our local LRU */
- move_to_head( &mmesa->TexObjList[heap], t );
-
- /* Update the global LRU */
- for ( i = start ; i <= end ; i++ ) {
- list[i].in_use = mmesa->hHWContext;
- list[i].age = mmesa->lastTexAge[heap];
-
-#if 0
- /* if this is the last region, it's not in the list */
- if ( !(i*(1<<log2sz) > mmesa->mach64Screen->texSize[heap] ) ) {
-#endif
- /* remove_from_list(i) */
- list[(GLuint)list[i].next].prev = list[i].prev;
- list[(GLuint)list[i].prev].next = list[i].next;
-#if 0
- }
-#endif
-
- /* insert_at_head(list, i) */
- list[i].prev = MACH64_NR_TEX_REGIONS;
- list[i].next = list[MACH64_NR_TEX_REGIONS].next;
- list[(GLuint)list[MACH64_NR_TEX_REGIONS].next].prev = i;
- list[MACH64_NR_TEX_REGIONS].next = i;
- }
-
- if ( MACH64_DEBUG & DEBUG_VERBOSE_LRU ) {
- mach64PrintGlobalLRU( mmesa, t->heap );
- mach64PrintLocalLRU( mmesa, t->heap );
- }
-}
-
-/* Update our notion of what textures have been changed since we last
- * held the lock. This pertains to both our local textures and the
- * textures belonging to other clients. Keep track of other client's
- * textures by pushing a placeholder texture onto the LRU list -- these
- * are denoted by (tObj == NULL).
- */
-/* NOTE: This function is only called while holding the hardware lock */
-static void mach64TexturesGone( mach64ContextPtr mmesa, int heap,
- int offset, int size, int in_use )
-{
- mach64TexObjPtr t, tmp;
-
- foreach_s ( t, tmp, &mmesa->TexObjList[heap] ) {
- if ( t->memBlock->ofs >= offset + size ||
- t->memBlock->ofs + t->memBlock->size <= offset )
- continue;
-
- /* It overlaps - kick it out. Need to hold onto the currently
- * bound objects, however.
- */
- if ( t->bound ) {
- mach64SwapOutTexObj( mmesa, t );
- } else {
- mach64DestroyTexObj( mmesa, t );
- }
- }
-
- if ( in_use > 0 && in_use != mmesa->hHWContext ) {
- t = (mach64TexObjPtr) CALLOC( sizeof(*t) );
- if (!t) return;
-
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], size, 0, offset );
- if ( !t->memBlock ) {
- fprintf( stderr, "Couldn't alloc placeholder sz %x ofs %x\n",
- (int)size, (int)offset );
- mmDumpMemInfo( mmesa->texHeap[heap] );
- return;
- }
- insert_at_head( &mmesa->TexObjList[heap], t );
- }
-}
-
-/* Update our client's shared texture state. If another client has
- * modified a region in which we have textures, then we need to figure
- * out which of our textures has been removed, and update our global
- * LRU.
- */
-void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
-{
- drm_mach64_sarea_t *sarea = mmesa->sarea;
-
- if ( sarea->tex_age[heap] != mmesa->lastTexAge[heap] ) {
- int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
- int nr = 0;
- int idx;
-
- /* Have to go right round from the back to ensure stuff ends up
- * LRU in our local list... Fix with a cursor pointer.
- */
- for ( idx = sarea->tex_list[heap][MACH64_NR_TEX_REGIONS].prev ;
- idx != MACH64_NR_TEX_REGIONS && nr < MACH64_NR_TEX_REGIONS ;
- idx = sarea->tex_list[heap][idx].prev, nr++ )
+ if ( mmesa != NULL )
+ {
+ for ( i = 0 ; i < mmesa->glCtx->Const.MaxTextureUnits ; i++ )
{
- /* If switching texturing schemes, then the SAREA might not
- * have been properly cleared, so we need to reset the
- * global texture LRU.
- */
- if ( idx * sz > mmesa->mach64Screen->texSize[heap] ) {
- nr = MACH64_NR_TEX_REGIONS;
- break;
- }
-
- if ( sarea->tex_list[heap][idx].age > mmesa->lastTexAge[heap] ) {
- mach64TexturesGone( mmesa, heap, idx * sz, sz,
- sarea->tex_list[heap][idx].in_use );
- }
- }
-
- /* If switching texturing schemes, then the SAREA might not
- * have been properly cleared, so we need to reset the
- * global texture LRU.
- */
- if ( nr == MACH64_NR_TEX_REGIONS ) {
- mach64TexturesGone( mmesa, heap, 0,
- mmesa->mach64Screen->texSize[heap], 0 );
- mach64ResetGlobalLRU( mmesa, heap );
+ if ( t == mmesa->CurrentTexObj[ i ] ) {
+ assert( t->base.bound & (1 << i) );
+ mmesa->CurrentTexObj[ i ] = NULL;
+ }
}
-
- if ( 0 ) {
- mach64PrintGlobalLRU( mmesa, heap );
- mach64PrintLocalLRU( mmesa, heap );
- }
-
- mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
- MACH64_UPLOAD_TEX0IMAGE |
- MACH64_UPLOAD_TEX1IMAGE);
- mmesa->lastTexAge[heap] = sarea->tex_age[heap];
}
}
@@ -395,7 +81,7 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa,
if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
return;
- image = t->tObj->Image[0][level];
+ image = t->base.tObj->Image[0][level];
if ( !image )
return;
@@ -424,14 +110,13 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa,
fprintf( stderr, "mach64UploadSubImage: %d,%d of %d,%d at %d,%d\n",
width, height, image->Width, image->Height, x, y );
fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x dwords: %d\n",
- (GLuint)t->offset, (GLint)width, dwords );
- mmDumpMemInfo( mmesa->texHeap[t->heap] );
+ (GLuint)t->bufAddr, (GLint)width, dwords );
}
assert(image->Data);
{
- CARD32 *dst = (CARD32 *)((char *)mach64Screen->agpTextures.map + t->memBlock->ofs);
+ CARD32 *dst = (CARD32 *)((char *)mach64Screen->agpTextures.map + t->base.memBlock->ofs);
const GLubyte *src = (const GLubyte *) image->Data +
(y * image->Width + x) * image->TexFormat->TexelBytes;
const GLuint bytes = width * height * image->TexFormat->TexelBytes;
@@ -460,7 +145,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) )
return;
- image = t->tObj->Image[0][level];
+ image = t->base.tObj->Image[0][level];
if ( !image )
return;
@@ -543,7 +228,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
}
dwords = width * height / texelsPerDword;
- offset = t->offset;
+ offset = t->bufAddr;
#if ENABLE_PERF_BOXES
/* Bump the performance counter */
@@ -555,7 +240,6 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
width, height, image->Width, image->Height, x, y );
fprintf( stderr, " blit ofs: 0x%07x pitch: 0x%x dwords: %d\n",
(GLuint)offset, (GLint)width, dwords );
- mmDumpMemInfo( mmesa->texHeap[t->heap] );
}
/* Subdivide the texture if required (account for the registers added by the drm) */
@@ -594,78 +278,32 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
*/
void mach64UploadTexImages( mach64ContextPtr mmesa, mach64TexObjPtr t )
{
- GLint heap;
-
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %p, %p )\n",
__FUNCTION__, mmesa->glCtx, t );
}
assert(t);
- assert(t->tObj);
-
- /* Choose the heap appropriately */
- heap = MACH64_CARD_HEAP;
+ assert(t->base.tObj);
- if ( !mmesa->mach64Screen->IsPCI &&
- t->size > mmesa->mach64Screen->texSize[heap] ) {
- heap = MACH64_AGP_HEAP;
- }
-
- /* Do we need to eject LRU texture objects? */
- if ( !t->memBlock ) {
- t->heap = heap;
+ if ( !t->base.memBlock ) {
+ int heap;
- /* Allocate a memory block on a 64-byte boundary */
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], t->size, 6, 0 );
+ /* NULL heaps are skipped */
+ heap = driAllocateTexture( mmesa->texture_heaps, MACH64_NR_TEX_HEAPS,
+ (driTextureObject *) t );
- /* Try AGP before kicking anything out of local mem */
- if ( !mmesa->mach64Screen->IsPCI && !t->memBlock && heap == MACH64_CARD_HEAP ) {
- t->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP],
- t->size, 6, 0 );
-
- if ( t->memBlock )
- heap = t->heap = MACH64_AGP_HEAP;
+ if ( heap == -1 ) {
+ fprintf( stderr, "%s: upload texture failure, sz=%d\n", __FUNCTION__,
+ t->base.totalSize );
+ exit(-1);
+ return;
}
- /* Kick out textures until the requested texture fits */
- while ( !t->memBlock ) {
- if ( mmesa->TexObjList[heap].prev->bound ) {
- fprintf( stderr,
- "mach64UploadTexImages: ran into bound texture\n" );
- return;
- }
- if ( mmesa->TexObjList[heap].prev == &mmesa->TexObjList[heap] ) {
- if ( mmesa->mach64Screen->IsPCI ) {
- fprintf( stderr, "%s: upload texture failure on "
- "local texture heaps, sz=%d\n", __FUNCTION__,
- t->size );
- return;
- } else if ( heap == MACH64_CARD_HEAP ) {
- heap = t->heap = MACH64_AGP_HEAP;
- continue;
- } else {
- int i;
- fprintf( stderr, "%s: upload texture failure on "
- "%sAGP texture heaps, sz=%d\n", __FUNCTION__,
- mmesa->firstTexHeap == MACH64_CARD_HEAP ? "both local and " : "",
- t->size );
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- mach64PrintLocalLRU( mmesa, i );
- mmDumpMemInfo( mmesa->texHeap[i] );
- }
- exit(-1);
- return;
- }
- }
-
- mach64SwapOutTexObj( mmesa, mmesa->TexObjList[heap].prev );
-
- t->memBlock = mmAllocMem( mmesa->texHeap[heap], t->size, 6, 0 );
- }
+ t->heap = heap;
/* Set the base offset of the texture image */
- t->offset = mmesa->mach64Screen->texOffset[heap] + t->memBlock->ofs;
+ t->bufAddr = mmesa->mach64Screen->texOffset[heap] + t->base.memBlock->ofs;
/* Force loading the new state into the hardware */
mmesa->dirty |= (MACH64_UPLOAD_SCALE_3D_CNTL |
@@ -673,142 +311,152 @@ void mach64UploadTexImages( mach64ContextPtr mmesa, mach64TexObjPtr t )
}
/* Let the world know we've used this memory recently */
- mach64UpdateTexLRU( mmesa, t );
+ driUpdateTextureLRU( (driTextureObject *) t );
/* Upload any images that are new */
- if ( t->dirty ) {
+ if ( t->base.dirty_images[0] ) {
+ const GLint j = t->base.tObj->BaseLevel;
if (t->heap == MACH64_AGP_HEAP) {
/* Need to make sure any vertex buffers in the queue complete */
mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t, t->tObj->BaseLevel, 0, 0,
- t->tObj->Image[0][t->tObj->BaseLevel]->Width,
- t->tObj->Image[0][t->tObj->BaseLevel]->Height );
+ mach64UploadAGPSubImage( mmesa, t, j, 0, 0,
+ t->base.tObj->Image[0][j]->Width,
+ t->base.tObj->Image[0][j]->Height );
} else {
- mach64UploadLocalSubImage( mmesa, t, t->tObj->BaseLevel, 0, 0,
- t->tObj->Image[0][t->tObj->BaseLevel]->Width,
- t->tObj->Image[0][t->tObj->BaseLevel]->Height );
+ mach64UploadLocalSubImage( mmesa, t, j, 0, 0,
+ t->base.tObj->Image[0][j]->Width,
+ t->base.tObj->Image[0][j]->Height );
}
mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
+ t->base.dirty_images[0] = 0;
}
mmesa->dirty |= MACH64_UPLOAD_TEXTURE;
+}
+
+
+/* Allocate memory from the same texture heap `heap' for both textures
+ * `u0' and `u1'.
+ */
+static int mach64AllocateMultiTex( mach64ContextPtr mmesa,
+ mach64TexObjPtr u0,
+ mach64TexObjPtr u1,
+ int heap, GLboolean alloc_u0 )
+{
+ /* Both objects should be bound */
+ assert( u0->base.bound && u1->base.bound );
+
+ if ( alloc_u0 ) {
+ /* Evict u0 from its current heap */
+ if ( u0->base.memBlock ) {
+ assert( u0->heap != heap );
+ driSwapOutTextureObject( (driTextureObject *) u0 );
+ }
+
+ /* Try to allocate u0 in the chosen heap */
+ u0->heap = driAllocateTexture( &mmesa->texture_heaps[heap], 1,
+ (driTextureObject *) u0 );
+
+ if ( u0->heap == -1 ) {
+ return -1;
+ }
+ }
+
+ /* Evict u1 from its current heap */
+ if ( u1->base.memBlock ) {
+ assert( u1->heap != heap );
+ driSwapOutTextureObject( (driTextureObject *) u1 );
+ }
+
+ /* Try to allocate u1 in the same heap as u0 */
+ u1->heap = driAllocateTexture( &mmesa->texture_heaps[heap], 1,
+ (driTextureObject *) u1 );
+
+ if ( u1->heap == -1 ) {
+ return -1;
+ }
- t->dirty = 0;
+ /* Bound objects are not evicted */
+ assert( u0->base.memBlock && u1->base.memBlock );
+ assert( u0->heap == u1->heap );
+
+ return heap;
}
/* The mach64 needs to have both primary and secondary textures in either
* local or AGP memory, so we need a "buddy system" to make sure that allocation
* succeeds or fails for both textures.
- * FIXME: This needs to be optimized better.
*/
void mach64UploadMultiTexImages( mach64ContextPtr mmesa,
mach64TexObjPtr t0,
mach64TexObjPtr t1 )
{
- GLint heap;
-
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %p, %p %p )\n",
__FUNCTION__, mmesa->glCtx, t0, t1 );
}
assert(t0 && t1);
- assert(t0->tObj && t1->tObj);
+ assert(t0->base.tObj && t1->base.tObj);
- /* Choose the heap appropriately */
- heap = MACH64_CARD_HEAP;
+ if ( !t0->base.memBlock || !t1->base.memBlock || t0->heap != t1->heap ) {
+ mach64TexObjPtr u0 = NULL;
+ mach64TexObjPtr u1 = NULL;
+ unsigned totalSize = t0->base.totalSize + t1->base.totalSize;
- if ( !mmesa->mach64Screen->IsPCI &&
- ((t0->size + t1->size) > mmesa->mach64Screen->texSize[heap]) ) {
- heap = MACH64_AGP_HEAP;
- }
+ int heap, ret;
- /* Do we need to eject LRU texture objects? */
- if ( !t0->memBlock || !t1->memBlock || t0->heap != t1->heap ) {
- /* FIXME: starting from scratch for now to keep it simple */
- if ( t0->memBlock ) {
- mach64SwapOutTexObj( mmesa, t0 );
- }
- if ( t1->memBlock ) {
- mach64SwapOutTexObj( mmesa, t1 );
- }
- t0->heap = t1->heap = heap;
- /* Allocate a memory block on a 64-byte boundary */
- t0->memBlock = mmAllocMem( mmesa->texHeap[heap], t0->size, 6, 0 );
- if ( t0->memBlock ) {
- t1->memBlock = mmAllocMem( mmesa->texHeap[heap], t1->size, 6, 0 );
- if ( !t1->memBlock ) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
+ /* Check if one of the textures is already swapped in a heap and the
+ * other texture fits in that heap.
+ */
+ if ( t0->base.memBlock && totalSize <= t0->base.heap->size ) {
+ u0 = t0;
+ u1 = t1;
+ } else if ( t1->base.memBlock && totalSize <= t1->base.heap->size ) {
+ u0 = t1;
+ u1 = t0;
}
- /* Try AGP before kicking anything out of local mem */
- if ( (!t0->memBlock || !t1->memBlock) && heap == MACH64_CARD_HEAP ) {
- t0->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP], t0->size, 6, 0 );
- if ( t0->memBlock ) {
- t1->memBlock = mmAllocMem( mmesa->texHeap[MACH64_AGP_HEAP], t1->size, 6, 0 );
- if ( !t1->memBlock ) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
+
+ if ( u0 ) {
+ heap = u0->heap;
+
+ ret = mach64AllocateMultiTex( mmesa, u0, u1, heap, GL_FALSE );
+ } else {
+ /* Both textures are swapped out or collocation is impossible */
+ u0 = t0;
+ u1 = t1;
+
+ /* Choose the heap appropriately */
+ heap = MACH64_CARD_HEAP;
+
+ if ( totalSize > mmesa->texture_heaps[heap]->size ) {
+ heap = MACH64_AGP_HEAP;
}
- if ( t0->memBlock && t1->memBlock )
- heap = t0->heap = t1->heap = MACH64_AGP_HEAP;
+ ret = mach64AllocateMultiTex( mmesa, u0, u1, heap, GL_TRUE );
}
- /* Kick out textures until the requested texture fits */
- while ( !t0->memBlock || !t1->memBlock ) {
- if ( mmesa->TexObjList[heap].prev->bound ) {
- fprintf( stderr,
- "%s: ran into bound texture\n", __FUNCTION__ );
- return;
- }
- if ( mmesa->TexObjList[heap].prev == &mmesa->TexObjList[heap] ) {
- if ( mmesa->mach64Screen->IsPCI ) {
- fprintf( stderr, "%s: upload texture failure on local "
- "texture heaps, tex0 sz=%d tex1 sz=%d\n", __FUNCTION__,
- t0->size, t1->size );
- return;
- } else if ( heap == MACH64_CARD_HEAP ) {
- /* If only one allocation succeeded, start over again in AGP */
- if (t0->memBlock) {
- mmFreeMem( t0->memBlock );
- t0->memBlock = NULL;
- }
- if (t1->memBlock) {
- mmFreeMem( t1->memBlock );
- t1->memBlock = NULL;
- }
- heap = t0->heap = t1->heap = MACH64_AGP_HEAP;
- continue;
- } else {
- int i;
- fprintf( stderr, "%s: upload texture failure on %s"
- "AGP texture heaps, tex0 sz=%d tex1 sz=%d\n", __FUNCTION__,
- mmesa->firstTexHeap == MACH64_CARD_HEAP ? "both local and " : "",
- t0->size, t1->size );
- for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
- mach64PrintLocalLRU( mmesa, i );
- mmDumpMemInfo( mmesa->texHeap[i] );
- }
- exit(-1);
- return;
- }
- }
+ if ( ret == -1 && heap == MACH64_CARD_HEAP ) {
+ /* Try AGP if local memory failed */
+ heap = MACH64_AGP_HEAP;
- mach64SwapOutTexObj( mmesa, mmesa->TexObjList[heap].prev );
-
- if (!t0->memBlock)
- t0->memBlock = mmAllocMem( mmesa->texHeap[heap], t0->size, 6, 0 );
- if (!t1->memBlock)
- t1->memBlock = mmAllocMem( mmesa->texHeap[heap], t1->size, 6, 0 );
+ ret = mach64AllocateMultiTex( mmesa, u0, u1, heap, GL_TRUE );
+ }
+
+ if ( ret == -1 ) {
+ /* FIXME:
+ * Swap out all textures from the AGP heap and re-run allocation, this
+ * should succeed in all cases.
+ */
+ fprintf( stderr, "%s: upload multi-texture failure, sz0=%d sz1=%d\n",
+ __FUNCTION__, t0->base.totalSize, t1->base.totalSize );
+ exit(-1);
}
/* Set the base offset of the texture image */
- t0->offset = mmesa->mach64Screen->texOffset[heap] + t0->memBlock->ofs;
- t1->offset = mmesa->mach64Screen->texOffset[heap] + t1->memBlock->ofs;
+ t0->bufAddr = mmesa->mach64Screen->texOffset[heap] + t0->base.memBlock->ofs;
+ t1->bufAddr = mmesa->mach64Screen->texOffset[heap] + t1->base.memBlock->ofs;
/* Force loading the new state into the hardware */
mmesa->dirty |= (MACH64_UPLOAD_SCALE_3D_CNTL |
@@ -816,42 +464,43 @@ void mach64UploadMultiTexImages( mach64ContextPtr mmesa,
}
/* Let the world know we've used this memory recently */
- mach64UpdateTexLRU( mmesa, t0 );
- mach64UpdateTexLRU( mmesa, t1 );
+ driUpdateTextureLRU( (driTextureObject *) t0 );
+ driUpdateTextureLRU( (driTextureObject *) t1 );
/* Upload any images that are new */
- if ( t0->dirty ) {
+ if ( t0->base.dirty_images[0] ) {
+ const GLint j0 = t0->base.tObj->BaseLevel;
if (t0->heap == MACH64_AGP_HEAP) {
/* Need to make sure any vertex buffers in the queue complete */
mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t0, t0->tObj->BaseLevel, 0, 0,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Width,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Height );
+ mach64UploadAGPSubImage( mmesa, t0, j0, 0, 0,
+ t0->base.tObj->Image[0][j0]->Width,
+ t0->base.tObj->Image[0][j0]->Height );
} else {
- mach64UploadLocalSubImage( mmesa, t0, t0->tObj->BaseLevel, 0, 0,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Width,
- t0->tObj->Image[0][t0->tObj->BaseLevel]->Height );
+ mach64UploadLocalSubImage( mmesa, t0, j0, 0, 0,
+ t0->base.tObj->Image[0][j0]->Width,
+ t0->base.tObj->Image[0][j0]->Height );
}
mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
+ t0->base.dirty_images[0] = 0;
}
- if ( t1->dirty ) {
+ if ( t1->base.dirty_images[0] ) {
+ const GLint j1 = t1->base.tObj->BaseLevel;
if (t1->heap == MACH64_AGP_HEAP) {
/* Need to make sure any vertex buffers in the queue complete */
mach64WaitForIdleLocked( mmesa );
- mach64UploadAGPSubImage( mmesa, t1, t1->tObj->BaseLevel, 0, 0,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Width,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Height );
+ mach64UploadAGPSubImage( mmesa, t1, j1, 0, 0,
+ t1->base.tObj->Image[0][j1]->Width,
+ t1->base.tObj->Image[0][j1]->Height );
} else {
- mach64UploadLocalSubImage( mmesa, t1, t1->tObj->BaseLevel, 0, 0,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Width,
- t1->tObj->Image[0][t1->tObj->BaseLevel]->Height );
+ mach64UploadLocalSubImage( mmesa, t1, j1, 0, 0,
+ t1->base.tObj->Image[0][j1]->Width,
+ t1->base.tObj->Image[0][j1]->Height );
}
mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH;
+ t1->base.dirty_images[0] = 0;
}
mmesa->dirty |= MACH64_UPLOAD_TEXTURE;
-
- t0->dirty = 0;
- t1->dirty = 0;
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c
index b6a9e3f931e..3ace370d70d 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texstate.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c
@@ -47,11 +47,6 @@ static void mach64SetTexImages( mach64ContextPtr mmesa,
{
mach64TexObjPtr t = (mach64TexObjPtr) tObj->DriverData;
struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
-#if 0
- int log2Pitch, log2Height, log2Size, log2MinSize;
- int i;
- GLint firstLevel, lastLevel;
-#endif
int totalSize;
assert(t);
@@ -92,77 +87,17 @@ static void mach64SetTexImages( mach64ContextPtr mmesa,
_mesa_problem(mmesa->glCtx, "Bad texture format in %s", __FUNCTION__);
};
-#if 0
- /* Compute which mipmap levels we really want to send to the hardware.
- * This depends on the base image size, GL_TEXTURE_MIN_LOD,
- * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
- * Yes, this looks overly complicated, but it's all needed.
- */
- firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5);
- firstLevel = MAX2(firstLevel, tObj->BaseLevel);
- lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5);
- lastLevel = MAX2(lastLevel, tObj->BaseLevel);
- lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = MIN2(lastLevel, tObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
-
- log2Pitch = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
- log2Size = MAX2(log2Pitch, log2Height);
- log2MinSize = log2Size;
-
- t->dirty = 0;
- totalSize = 0;
- for ( i = firstLevel; i <= lastLevel; i++ ) {
- const struct gl_texture_image *texImage;
-
- texImage = tObj->Image[i];
- if ( !texImage || !texImage->Data ) {
- lastLevel = i - 1;
- break;
- }
-
- log2MinSize = texImage->MaxLog2;
-
- t->image[i - firstLevel].offset = totalSize;
- t->image[i - firstLevel].width = tObj->Image[i]->Width;
- t->image[i - firstLevel].height = tObj->Image[i]->Height;
+ totalSize = ( baseImage->Height *
+ baseImage->Width *
+ baseImage->TexFormat->TexelBytes );
- t->dirty |= (1 << i);
-
- totalSize += (tObj->Image[i]->Height *
- tObj->Image[i]->Width *
- tObj->Image[i]->TexFormat->TexelBytes);
-
- /* Offsets must be 32-byte aligned for host data blits and tiling */
- totalSize = (totalSize + 31) & ~31;
- }
+ totalSize = (totalSize + 31) & ~31;
- t->totalSize = totalSize;
- t->firstLevel = firstLevel;
- t->lastLevel = lastLevel;
+ t->base.totalSize = totalSize;
+ t->base.firstLevel = tObj->BaseLevel;
+ t->base.lastLevel = tObj->BaseLevel;
/* Set the texture format */
- t->setup.tex_cntl &= ~(0xf << 16);
- t->setup.tex_cntl |= t->textureFormat;
-
- t->setup.tex_combine_cntl = 0x00000000; /* XXX is this right? */
-
- t->setup.tex_size_pitch = ((log2Pitch << R128_TEX_PITCH_SHIFT) |
- (log2Size << R128_TEX_SIZE_SHIFT) |
- (log2Height << R128_TEX_HEIGHT_SHIFT) |
- (log2MinSize << R128_TEX_MIN_SIZE_SHIFT));
-
- for ( i = 0 ; i < R128_MAX_TEXTURE_LEVELS ; i++ ) {
- t->setup.tex_offset[i] = 0x00000000;
- }
-
- if (firstLevel == lastLevel)
- t->setup.tex_cntl |= R128_MIP_MAP_DISABLE;
- else
- t->setup.tex_cntl &= ~R128_MIP_MAP_DISABLE;
-
-#else
if ( ( baseImage->_BaseFormat == GL_RGBA ) ||
( baseImage->_BaseFormat == GL_ALPHA ) ||
( baseImage->_BaseFormat == GL_LUMINANCE_ALPHA ) ) {
@@ -171,15 +106,9 @@ static void mach64SetTexImages( mach64ContextPtr mmesa,
t->hasAlpha = 0;
}
- totalSize = ( baseImage->Width * baseImage->Height *
- baseImage->TexFormat->TexelBytes );
- totalSize = (totalSize + 31) & ~31;
- t->size = totalSize;
t->widthLog2 = baseImage->WidthLog2;
t->heightLog2 = baseImage->HeightLog2;
t->maxLog2 = baseImage->MaxLog2;
-
-#endif
}
static void mach64UpdateTextureEnv( GLcontext *ctx, int unit )
@@ -387,17 +316,17 @@ static void mach64UpdateTextureUnit( GLcontext *ctx, int unit )
}
/* Upload teximages */
- if (t->dirty) {
+ if (t->base.dirty_images[0]) {
mach64SetTexImages( mmesa, tObj );
mmesa->dirty |= (MACH64_UPLOAD_TEX0IMAGE << unit);
}
/* Bind to the given texture unit */
mmesa->CurrentTexObj[unit] = t;
- t->bound |= (1 << unit);
+ t->base.bound |= (1 << unit);
- if ( t->memBlock )
- mach64UpdateTexLRU( mmesa, t );
+ if ( t->base.memBlock )
+ driUpdateTextureLRU( (driTextureObject *) t ); /* XXX: should be locked! */
/* register setup */
if ( unit == 0 ) {
@@ -515,8 +444,8 @@ void mach64UpdateTextureState( GLcontext *ctx )
FALLBACK( mmesa, MACH64_FALLBACK_TEXTURE, GL_FALSE );
/* Unbind any currently bound textures */
- if ( mmesa->CurrentTexObj[0] ) mmesa->CurrentTexObj[0]->bound = 0;
- if ( mmesa->CurrentTexObj[1] ) mmesa->CurrentTexObj[1]->bound = 0;
+ if ( mmesa->CurrentTexObj[0] ) mmesa->CurrentTexObj[0]->base.bound = 0;
+ if ( mmesa->CurrentTexObj[1] ) mmesa->CurrentTexObj[1]->base.bound = 0;
mmesa->CurrentTexObj[0] = NULL;
mmesa->CurrentTexObj[1] = NULL;
@@ -556,3 +485,41 @@ void mach64UpdateTextureState( GLcontext *ctx )
MACH64_UPLOAD_TEXTURE);
}
+
+/* Due to the way we must program texture state into the Rage Pro,
+ * we must leave these calculations to the absolute last minute.
+ */
+void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
+ mach64TexObjPtr t0,
+ mach64TexObjPtr t1 )
+{
+ drm_mach64_sarea_t *sarea = mmesa->sarea;
+ drm_mach64_context_regs_t *regs = &(mmesa->setup);
+
+ /* for multitex, both textures must be local or AGP */
+ if ( t0 && t1 )
+ assert(t0->heap == t1->heap);
+
+ if ( t0 ) {
+ if (t0->heap == MACH64_CARD_HEAP) {
+#if ENABLE_PERF_BOXES
+ mmesa->c_texsrc_card++;
+#endif
+ mmesa->setup.tex_cntl &= ~MACH64_TEX_SRC_AGP;
+ } else {
+#if ENABLE_PERF_BOXES
+ mmesa->c_texsrc_agp++;
+#endif
+ mmesa->setup.tex_cntl |= MACH64_TEX_SRC_AGP;
+ }
+ mmesa->setup.tex_offset = t0->bufAddr;
+ }
+
+ if ( t1 ) {
+ mmesa->setup.secondary_tex_off = t1->bufAddr;
+ }
+
+ memcpy( &sarea->context_state.tex_size_pitch, &regs->tex_size_pitch,
+ MACH64_NR_TEXTURE_REGS * sizeof(GLuint) );
+}
+
diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c
index 4a0044be88c..08cc1849a12 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tris.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tris.c
@@ -1583,7 +1583,10 @@ static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
const GLuint vertsize = mmesa->vertex_size;
GLint a;
- GLfloat ooa;
+ union {
+ GLfloat f;
+ CARD32 u;
+ } ooa;
GLuint xy;
const GLuint xyoffset = 9;
GLint xx[3], yy[3]; /* 2 fractional bits for hardware */
@@ -1621,7 +1624,7 @@ static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
return;
}
- ooa = 16.0 / a;
+ ooa.f = 16.0 / a;
vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) );
vbchk = vb + vbsiz;
@@ -1629,7 +1632,7 @@ static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
COPY_VERTEX( vb, vertsize, v0, 1 );
COPY_VERTEX( vb, vertsize, v1, 2 );
COPY_VERTEX_OOA( vb, vertsize, v2, 3 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
+ LE32_OUT( vb++, ooa.u );
i = 3;
while (1) {
@@ -1644,10 +1647,10 @@ static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
(yy[0] - yy[2]) * (xx[1] - xx[2]);
- ooa = 16.0 / a;
+ ooa.f = 16.0 / a;
COPY_VERTEX_OOA( vb, vertsize, v0, 1 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
+ LE32_OUT( vb++, ooa.u );
if (i >= n)
break;
@@ -1660,10 +1663,10 @@ static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
a = (xx[0] - xx[2]) * (yy[1] - yy[2]) -
(yy[0] - yy[2]) * (xx[1] - xx[2]);
- ooa = 16.0 / a;
+ ooa.f = 16.0 / a;
COPY_VERTEX_OOA( vb, vertsize, v1, 2 );
- LE32_OUT( vb++, *(CARD32 *)&ooa );
+ LE32_OUT( vb++, ooa.u );
}
assert( vb == vbchk );
diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c
index f7e07c330ae..c20a76f29ef 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -24,7 +24,6 @@
* Authors:
* Keith Whitwell <[email protected]>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.13 2002/10/30 12:51:36 alanh Exp $ */
#include "mtypes.h"
@@ -49,6 +48,8 @@
#include "swrast_setup/swrast_setup.h"
#include "xmlpool.h"
+#include "drirenderbuffer.h"
+
static void updateSpecularLighting( GLcontext *ctx );
@@ -113,14 +114,15 @@ static void mgaDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
static void updateBlendLogicOp(GLcontext *ctx)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
+ GLboolean logicOp = RGBA_LOGICOP_ENABLED(ctx);
MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
mmesa->hw.blend_func_enable =
- (ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled) ? ~0 : 0;
+ (ctx->Color.BlendEnabled && !logicOp) ? ~0 : 0;
FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
+ ctx->Color.BlendEnabled && !logicOp &&
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
@@ -195,7 +197,7 @@ static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
mmesa->hw.blend_func = (src | dst);
FALLBACK( ctx, MGA_FALLBACK_BLEND,
- ctx->Color.BlendEnabled && !ctx->Color._LogicOpEnabled &&
+ ctx->Color.BlendEnabled && !RGBA_LOGICOP_ENABLED(ctx) &&
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
@@ -965,7 +967,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa )
? mmesa->hw.zmode : (DC_zmode_nozcmp | DC_atype_i);
mmesa->setup.dwgctl &= DC_bop_MASK;
- mmesa->setup.dwgctl |= (ctx->Color._LogicOpEnabled)
+ mmesa->setup.dwgctl |= RGBA_LOGICOP_ENABLED(ctx)
? mmesa->hw.rop : mgarop_NoBLK[ GL_COPY & 0x0f ];
mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK
diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c
index 8caa1f8580f..a7d74317a5b 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -502,6 +502,9 @@ mgaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
driDestroyTextureObject( t );
}
+
+ /* Free mipmap images and the texture object itself */
+ _mesa_delete_texture_object(ctx, tObj);
}
diff --git a/src/mesa/drivers/dri/nouveau/Makefile b/src/mesa/drivers/dri/nouveau/Makefile
new file mode 100644
index 00000000000..9eb40fb9c19
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/Makefile
@@ -0,0 +1,50 @@
+# src/mesa/drivers/dri/nouveau/Makefile
+
+TOP = ../../../../..
+include $(TOP)/configs/current
+
+LIBNAME = nouveau_dri.so
+
+MINIGLX_SOURCES =
+
+DRIVER_SOURCES = \
+ nouveau_bufferobj.c \
+ nouveau_buffers.c \
+ nouveau_card.c \
+ nouveau_context.c \
+ nouveau_driver.c \
+ nouveau_fifo.c \
+ nouveau_lock.c \
+ nouveau_object.c \
+ nouveau_screen.c \
+ nouveau_span.c \
+ nouveau_state.c \
+ nouveau_shader.c \
+ nouveau_shader_0_arb.c \
+ nouveau_shader_1.c \
+ nouveau_shader_2.c \
+ nouveau_tex.c \
+ nouveau_swtcl.c \
+ nouveau_sync.c \
+ nv04_swtcl.c \
+ nv10_swtcl.c \
+ nv10_state.c \
+ nv20_state.c \
+ nv30_state.c \
+ nouveau_state_cache.c \
+ nv20_vertprog.c \
+ nv30_fragprog.c \
+ nv30_vertprog.c \
+ nv40_fragprog.c \
+ nv40_vertprog.c
+
+C_SOURCES = \
+ $(COMMON_SOURCES) \
+ $(DRIVER_SOURCES)
+
+ASM_SOURCES =
+
+
+include ../Makefile.template
+
+symlinks:
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
new file mode 100644
index 00000000000..d36196aeef2
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
@@ -0,0 +1,272 @@
+#include "bufferobj.h"
+#include "enums.h"
+
+#include "nouveau_bufferobj.h"
+#include "nouveau_buffers.h"
+#include "nouveau_context.h"
+#include "nouveau_drm.h"
+#include "nouveau_object.h"
+#include "nouveau_msg.h"
+
+#define DEBUG(fmt,args...) do { \
+ if (NOUVEAU_DEBUG & DEBUG_BUFFEROBJ) { \
+ fprintf(stderr, "%s: "fmt, __func__, ##args); \
+ } \
+} while(0)
+
+/* Wrapper for nouveau_mem_gpu_offset_get() that marks the bufferobj dirty
+ * if the GPU modifies the data.
+ */
+uint32_t
+nouveau_bufferobj_gpu_ref(GLcontext *ctx, GLenum access,
+ struct gl_buffer_object *obj)
+{
+ nouveau_buffer_object *nbo = (nouveau_buffer_object *)obj;
+
+ DEBUG("obj=%p, access=%s\n", obj, _mesa_lookup_enum_by_nr(access));
+
+ if (access == GL_WRITE_ONLY_ARB || access == GL_READ_WRITE_ARB)
+ nbo->gpu_dirty = GL_TRUE;
+
+ return nouveau_mem_gpu_offset_get(ctx, nbo->gpu_mem);
+}
+
+static void
+nouveauBindBuffer(GLcontext *ctx, GLenum target, struct gl_buffer_object *obj)
+{
+}
+
+static struct gl_buffer_object *
+nouveauNewBufferObject(GLcontext *ctx, GLuint buffer, GLenum target)
+{
+ nouveau_buffer_object *nbo;
+
+ nbo = CALLOC_STRUCT(nouveau_buffer_object_t);
+ DEBUG("name=0x%08x, target=%s, obj=%p\n",
+ buffer, _mesa_lookup_enum_by_nr(target), nbo);
+ _mesa_initialize_buffer_object(&nbo->mesa, buffer, target);
+ return &nbo->mesa;
+}
+
+static void
+nouveauDeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
+{
+ nouveau_buffer_object *nbo = (nouveau_buffer_object *)obj;
+
+ DEBUG("obj=%p\n", obj);
+
+ if (nbo->gpu_mem) {
+ nouveau_mem_free(ctx, nbo->gpu_mem);
+ }
+ _mesa_delete_buffer_object(ctx, obj);
+}
+
+static void
+nouveauBufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
+ const GLvoid *data, GLenum usage,
+ struct gl_buffer_object *obj)
+{
+ nouveau_buffer_object *nbo = (nouveau_buffer_object *)obj;
+
+ DEBUG("obj=%p, target=%s, usage=%s, size=%d, data=%p\n",
+ obj,
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(usage),
+ (unsigned int)size,
+ data);
+
+ if (nbo->gpu_mem && nbo->gpu_mem->size != size)
+ nouveau_mem_free(ctx, nbo->gpu_mem);
+
+ /* Always have the GPU access the data from VRAM if possible. For
+ * some "usage" values it may be better from AGP be default?
+ *
+ * TODO: At some point we should drop the NOUVEAU_MEM_MAPPED flag.
+ * TODO: Use the NOUVEAU_MEM_AGP_ACCEPTABLE flag.
+ * TODO: What about PCI-E and shared system memory?
+ */
+ if (!nbo->gpu_mem)
+ nbo->gpu_mem = nouveau_mem_alloc(ctx,
+ NOUVEAU_MEM_FB |
+ NOUVEAU_MEM_MAPPED,
+ size,
+ 0);
+
+ if (!nbo->gpu_mem) {
+ MESSAGE("AIII bufferobj malloc failed\n");
+ return;
+ }
+
+ obj->Usage = usage;
+ obj->Size = size;
+ if (!data)
+ return;
+
+ ctx->Driver.MapBuffer(ctx, target, GL_WRITE_ONLY_ARB, obj);
+ _mesa_memcpy(nbo->cpu_mem->map, data, size);
+ ctx->Driver.UnmapBuffer(ctx, target, obj);
+}
+
+/*TODO: we don't need to DMA the entire buffer like MapBuffer does.. */
+static void
+nouveauBufferSubData(GLcontext *ctx, GLenum target, GLintptrARB offset,
+ GLsizeiptrARB size, const GLvoid *data,
+ struct gl_buffer_object *obj)
+{
+ DEBUG("obj=%p, target=%s, offset=0x%x, size=%d, data=%p\n",
+ obj,
+ _mesa_lookup_enum_by_nr(target),
+ (unsigned int)offset,
+ (unsigned int)size,
+ data);
+
+ ctx->Driver.MapBuffer(ctx, target, GL_WRITE_ONLY_ARB, obj);
+ _mesa_memcpy((GLubyte *)obj->Pointer + offset, data, size);
+ ctx->Driver.UnmapBuffer(ctx, target, obj);
+}
+
+/*TODO: we don't need to DMA the entire buffer like MapBuffer does.. */
+static void
+nouveauGetBufferSubData(GLcontext *ctx, GLenum target, GLintptrARB offset,
+ GLsizeiptrARB size, GLvoid *data,
+ struct gl_buffer_object *obj)
+{
+ DEBUG("obj=%p, target=%s, offset=0x%x, size=%d, data=%p\n",
+ obj,
+ _mesa_lookup_enum_by_nr(target),
+ (unsigned int)offset,
+ (unsigned int)size,
+ data);
+
+ ctx->Driver.MapBuffer(ctx, target, GL_READ_ONLY_ARB, obj);
+ _mesa_memcpy(data, (GLubyte *)obj->Pointer + offset, size);
+ ctx->Driver.UnmapBuffer(ctx, target, obj);
+}
+
+static void *
+nouveauMapBuffer(GLcontext *ctx, GLenum target, GLenum access,
+ struct gl_buffer_object *obj)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveau_buffer_object *nbo = (nouveau_buffer_object *)obj;
+
+ DEBUG("obj=%p, target=%s, access=%s\n",
+ obj,
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(access));
+
+ if (obj->Pointer) {
+ DEBUG("already mapped, return NULL\n");
+ return NULL;
+ }
+
+#ifdef ALLOW_MULTI_SUBCHANNEL
+ /* If GPU is accessing the data from VRAM, copy to faster AGP memory
+ * before CPU access to the buffer.
+ */
+ if (nbo->gpu_mem->type & NOUVEAU_MEM_FB) {
+ DEBUG("Data in VRAM, copying to AGP for CPU access\n");
+
+ /* This can happen if BufferData grows the GPU-access buffer */
+ if (nbo->cpu_mem && nbo->cpu_mem->size != nbo->gpu_mem->size) {
+ nouveau_mem_free(ctx, nbo->cpu_mem);
+ nbo->cpu_mem = NULL;
+ }
+
+ if (!nbo->cpu_mem) {
+ nbo->cpu_mem = nouveau_mem_alloc(ctx,
+ NOUVEAU_MEM_AGP |
+ NOUVEAU_MEM_MAPPED,
+ nbo->gpu_mem->size,
+ 0);
+
+ /* Mark GPU data as modified, so it gets copied to
+ * the new buffer */
+ nbo->gpu_dirty = GL_TRUE;
+ }
+
+ if (nbo->cpu_mem && nbo->gpu_dirty) {
+ nouveau_memformat_flat_emit(ctx, nbo->cpu_mem,
+ nbo->gpu_mem,
+ 0, 0,
+ nbo->gpu_mem->size);
+
+ nouveau_notifier_wait_nop(ctx,
+ nmesa->syncNotifier,
+ NvSubMemFormat);
+ nbo->gpu_dirty = GL_FALSE;
+ }
+
+ /* buffer isn't guaranteed to be up-to-date on the card now */
+ nbo->cpu_dirty = GL_TRUE;
+ }
+#endif
+
+ /* If the copy to AGP failed for some reason, just return a pointer
+ * directly to vram..
+ */
+ if (!nbo->cpu_mem) {
+ DEBUG("Returning direct pointer to VRAM\n");
+ nbo->cpu_mem = nbo->gpu_mem;
+ nbo->cpu_dirty = GL_FALSE;
+ }
+
+ obj->Pointer = nbo->cpu_mem->map;
+ return obj->Pointer;
+}
+
+static GLboolean
+nouveauUnmapBuffer(GLcontext *ctx, GLenum target, struct gl_buffer_object *obj)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveau_buffer_object *nbo = (nouveau_buffer_object *)obj;
+
+ DEBUG("obj=%p, target=%s\n", obj, _mesa_lookup_enum_by_nr(target));
+
+#ifdef ALLOW_MULTI_SUBCHANNEL
+ if (nbo->cpu_dirty && nbo->cpu_mem != nbo->gpu_mem) {
+ DEBUG("Copying potentially modified data back to GPU\n");
+
+ /* blit from GPU buffer -> CPU buffer */
+ nouveau_memformat_flat_emit(ctx, nbo->gpu_mem, nbo->cpu_mem,
+ 0, 0, nbo->cpu_mem->size);
+
+ /* buffer is now up-to-date on the hardware (or rather, will
+ * be by the time any other commands in this channel reference
+ * the data.)
+ */
+ nbo->cpu_dirty = GL_FALSE;
+
+ /* we can avoid this wait in some cases.. */
+ nouveau_notifier_wait_nop(ctx,
+ nmesa->syncNotifier,
+ NvSubMemFormat);
+
+ /* If it's likely CPU access to the buffer will occur often,
+ * keep the cpu_mem around to avoid repeated allocs.
+ */
+ if (obj->Usage != GL_DYNAMIC_DRAW_ARB) {
+
+ nouveau_mem_free(ctx, nbo->cpu_mem);
+ nbo->cpu_mem = NULL;
+ }
+ }
+#endif
+
+ obj->Pointer = NULL;
+ return GL_TRUE;
+}
+
+void
+nouveauInitBufferObjects(GLcontext *ctx)
+{
+ ctx->Driver.BindBuffer = nouveauBindBuffer;
+ ctx->Driver.NewBufferObject = nouveauNewBufferObject;
+ ctx->Driver.DeleteBuffer = nouveauDeleteBuffer;
+ ctx->Driver.BufferData = nouveauBufferData;
+ ctx->Driver.BufferSubData = nouveauBufferSubData;
+ ctx->Driver.GetBufferSubData = nouveauGetBufferSubData;
+ ctx->Driver.MapBuffer = nouveauMapBuffer;
+ ctx->Driver.UnmapBuffer = nouveauUnmapBuffer;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h
new file mode 100644
index 00000000000..fccc349b836
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h
@@ -0,0 +1,27 @@
+#ifndef __NOUVEAU_BUFFEROBJ_H__
+#define __NOUVEAU_BUFFEROBJ_H__
+
+#include "mtypes.h"
+#include "nouveau_buffers.h"
+
+typedef struct nouveau_buffer_object_t {
+ /* Base class, must be first */
+ struct gl_buffer_object mesa;
+
+ /* Memory used for GPU access to the buffer*/
+ nouveau_mem * gpu_mem;
+ /* Buffer has been dirtied by the GPU */
+ GLboolean gpu_dirty;
+
+ /* Memory used for CPU access to the buffer */
+ nouveau_mem * cpu_mem;
+ /* Buffer has possibly been dirtied by the CPU */
+ GLboolean cpu_dirty;
+} nouveau_buffer_object;
+
+extern uint32_t nouveau_bufferobj_gpu_ref(GLcontext *ctx, GLenum access,
+ struct gl_buffer_object *obj);
+
+extern void nouveauInitBufferObjects(GLcontext *ctx);
+
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
new file mode 100644
index 00000000000..b54f68f4023
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
@@ -0,0 +1,434 @@
+#include "utils.h"
+#include "framebuffer.h"
+#include "renderbuffer.h"
+#include "fbobject.h"
+
+#include "nouveau_context.h"
+#include "nouveau_buffers.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+#include "nouveau_msg.h"
+
+#define MAX_MEMFMT_LENGTH 32768
+
+/* Unstrided blit using NV_MEMORY_TO_MEMORY_FORMAT */
+GLboolean
+nouveau_memformat_flat_emit(GLcontext *ctx,
+ nouveau_mem *dst, nouveau_mem *src,
+ GLuint dst_offset, GLuint src_offset,
+ GLuint size)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ uint32_t src_handle, dst_handle;
+ GLuint count;
+
+ if (src_offset + size > src->size) {
+ MESSAGE("src out of nouveau_mem bounds\n");
+ return GL_FALSE;
+ }
+ if (dst_offset + size > dst->size) {
+ MESSAGE("dst out of nouveau_mem bounds\n");
+ return GL_FALSE;
+ }
+
+ src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
+ dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
+ src_offset += nouveau_mem_gpu_offset_get(ctx, src);
+ dst_offset += nouveau_mem_gpu_offset_get(ctx, dst);
+
+ BEGIN_RING_SIZE(NvSubMemFormat, NV_MEMORY_TO_MEMORY_FORMAT_OBJECT_IN, 2);
+ OUT_RING (src_handle);
+ OUT_RING (dst_handle);
+
+ count = (size / MAX_MEMFMT_LENGTH) + ((size % MAX_MEMFMT_LENGTH) ? 1 : 0);
+
+ while (count--) {
+ GLuint length = (size > MAX_MEMFMT_LENGTH) ? MAX_MEMFMT_LENGTH : size;
+
+ BEGIN_RING_SIZE(NvSubMemFormat, NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
+ OUT_RING (src_offset);
+ OUT_RING (dst_offset);
+ OUT_RING (0); /* pitch in */
+ OUT_RING (0); /* pitch out */
+ OUT_RING (length); /* line length */
+ OUT_RING (1); /* number of lines */
+ OUT_RING ((1 << 8) /* dst_inc */ | (1 << 0) /* src_inc */);
+ OUT_RING (0); /* buffer notify? */
+ FIRE_RING();
+
+ src_offset += length;
+ dst_offset += length;
+ size -= length;
+ }
+
+ return GL_TRUE;
+}
+
+void
+nouveau_mem_free(GLcontext *ctx, nouveau_mem *mem)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ drm_nouveau_mem_free_t memf;
+
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: type=0x%x, offset=0x%x, size=0x%x\n",
+ __func__, mem->type, (GLuint)mem->offset, (GLuint)mem->size);
+ }
+
+ if (mem->map)
+ drmUnmap(mem->map, mem->size);
+ memf.flags = mem->type;
+ memf.region_offset = mem->offset;
+ drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_MEM_FREE, &memf, sizeof(memf));
+ FREE(mem);
+}
+
+nouveau_mem *
+nouveau_mem_alloc(GLcontext *ctx, int type, GLuint size, GLuint align)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ drm_nouveau_mem_alloc_t mema;
+ nouveau_mem *mem;
+ int ret;
+
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: requested: type=0x%x, size=0x%x, align=0x%x\n",
+ __func__, type, (GLuint)size, align);
+ }
+
+ mem = CALLOC(sizeof(nouveau_mem));
+ if (!mem)
+ return NULL;
+
+ mema.flags = type;
+ mema.size = mem->size = size;
+ mema.alignment = align;
+ mem->map = NULL;
+ ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_MEM_ALLOC,
+ &mema, sizeof(mema));
+ if (ret) {
+ FREE(mem);
+ return NULL;
+ }
+ mem->offset = mema.region_offset;
+ mem->type = mema.flags;
+
+ if (NOUVEAU_DEBUG & DEBUG_MEM) {
+ fprintf(stderr, "%s: actual: type=0x%x, offset=0x%x, size=0x%x\n",
+ __func__, mem->type, (GLuint)mem->offset, (GLuint)mem->size);
+ }
+
+ if (type & NOUVEAU_MEM_MAPPED)
+ ret = drmMap(nmesa->driFd, mem->offset, mem->size, &mem->map);
+ if (ret) {
+ mem->map = NULL;
+ nouveau_mem_free(ctx, mem);
+ mem = NULL;
+ }
+
+ return mem;
+}
+
+uint32_t
+nouveau_mem_gpu_offset_get(GLcontext *ctx, nouveau_mem *mem)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (mem->type & NOUVEAU_MEM_FB)
+ return (uint32_t)mem->offset - nmesa->vram_phys;
+ else if (mem->type & NOUVEAU_MEM_AGP)
+ return (uint32_t)mem->offset - nmesa->agp_phys;
+ else
+ return 0xDEADF00D;
+}
+
+static GLboolean
+nouveau_renderbuffer_pixelformat(nouveau_renderbuffer *nrb,
+ GLenum internalFormat)
+{
+ nrb->mesa.InternalFormat = internalFormat;
+
+ /*TODO: We probably want to extend this a bit, and maybe make
+ * card-specific?
+ */
+ switch (internalFormat) {
+ case GL_RGBA:
+ case GL_RGBA8:
+ nrb->mesa._BaseFormat = GL_RGBA;
+ nrb->mesa._ActualFormat= GL_RGBA8;
+ nrb->mesa.DataType = GL_UNSIGNED_BYTE;
+ nrb->mesa.RedBits = 8;
+ nrb->mesa.GreenBits = 8;
+ nrb->mesa.BlueBits = 8;
+ nrb->mesa.AlphaBits = 8;
+ nrb->cpp = 4;
+ break;
+ case GL_RGB:
+ case GL_RGB5:
+ nrb->mesa._BaseFormat = GL_RGB;
+ nrb->mesa._ActualFormat= GL_RGB5;
+ nrb->mesa.DataType = GL_UNSIGNED_BYTE;
+ nrb->mesa.RedBits = 5;
+ nrb->mesa.GreenBits = 6;
+ nrb->mesa.BlueBits = 5;
+ nrb->mesa.AlphaBits = 0;
+ nrb->cpp = 2;
+ break;
+ case GL_DEPTH_COMPONENT16:
+ nrb->mesa._BaseFormat = GL_DEPTH_COMPONENT;
+ nrb->mesa._ActualFormat= GL_DEPTH_COMPONENT16;
+ nrb->mesa.DataType = GL_UNSIGNED_SHORT;
+ nrb->mesa.DepthBits = 16;
+ nrb->cpp = 2;
+ break;
+ case GL_DEPTH_COMPONENT24:
+ nrb->mesa._BaseFormat = GL_DEPTH_COMPONENT;
+ nrb->mesa._ActualFormat= GL_DEPTH24_STENCIL8_EXT;
+ nrb->mesa.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ nrb->mesa.DepthBits = 24;
+ nrb->cpp = 4;
+ break;
+ case GL_STENCIL_INDEX8_EXT:
+ nrb->mesa._BaseFormat = GL_STENCIL_INDEX;
+ nrb->mesa._ActualFormat= GL_DEPTH24_STENCIL8_EXT;
+ nrb->mesa.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ nrb->mesa.StencilBits = 8;
+ nrb->cpp = 4;
+ break;
+ case GL_DEPTH24_STENCIL8_EXT:
+ nrb->mesa._BaseFormat = GL_DEPTH_STENCIL_EXT;
+ nrb->mesa._ActualFormat= GL_DEPTH24_STENCIL8_EXT;
+ nrb->mesa.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ nrb->mesa.DepthBits = 24;
+ nrb->mesa.StencilBits = 8;
+ nrb->cpp = 4;
+ break;
+ default:
+ return GL_FALSE;
+ break;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean
+nouveau_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width,
+ GLuint height)
+{
+ nouveau_renderbuffer *nrb = (nouveau_renderbuffer*)rb;
+
+ if (!nouveau_renderbuffer_pixelformat(nrb, internalFormat)) {
+ fprintf(stderr, "%s: unknown internalFormat\n", __func__);
+ return GL_FALSE;
+ }
+
+ /* If this buffer isn't statically alloc'd, we may need to ask the
+ * drm for more memory */
+ if (!nrb->dPriv && (rb->Width != width || rb->Height != height)) {
+ GLuint pitch;
+
+ /* align pitches to 64 bytes */
+ pitch = ((width * nrb->cpp) + 63) & ~63;
+
+ if (nrb->mem)
+ nouveau_mem_free(ctx, nrb->mem);
+ nrb->mem = nouveau_mem_alloc(ctx,
+ NOUVEAU_MEM_FB | NOUVEAU_MEM_MAPPED,
+ pitch*height,
+ 0);
+ if (!nrb->mem)
+ return GL_FALSE;
+
+ /* update nouveau_renderbuffer info */
+ nrb->offset = nouveau_mem_gpu_offset_get(ctx, nrb->mem);
+ nrb->pitch = pitch;
+ }
+
+ rb->Width = width;
+ rb->Height = height;
+ rb->InternalFormat = internalFormat;
+ return GL_TRUE;
+}
+
+static void
+nouveau_renderbuffer_delete(struct gl_renderbuffer *rb)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ nouveau_renderbuffer *nrb = (nouveau_renderbuffer*)rb;
+
+ if (nrb->mem)
+ nouveau_mem_free(ctx, nrb->mem);
+ FREE(nrb);
+}
+
+nouveau_renderbuffer *
+nouveau_renderbuffer_new(GLenum internalFormat, GLvoid *map,
+ GLuint offset, GLuint pitch,
+ __DRIdrawablePrivate *dPriv)
+{
+ nouveau_renderbuffer *nrb;
+
+ nrb = CALLOC_STRUCT(nouveau_renderbuffer_t);
+ if (nrb) {
+ _mesa_init_renderbuffer(&nrb->mesa, 0);
+
+ nouveau_renderbuffer_pixelformat(nrb, internalFormat);
+
+ nrb->mesa.AllocStorage = nouveau_renderbuffer_storage;
+ nrb->mesa.Delete = nouveau_renderbuffer_delete;
+
+ nrb->dPriv = dPriv;
+ nrb->offset = offset;
+ nrb->pitch = pitch;
+ nrb->map = map;
+ }
+
+ return nrb;
+}
+
+static void
+nouveau_cliprects_drawable_set(nouveauContextPtr nmesa,
+ nouveau_renderbuffer *nrb)
+{
+ __DRIdrawablePrivate *dPriv = nrb->dPriv;
+
+ nmesa->numClipRects = dPriv->numClipRects;
+ nmesa->pClipRects = dPriv->pClipRects;
+ nmesa->drawX = dPriv->x;
+ nmesa->drawY = dPriv->y;
+}
+
+static void
+nouveau_cliprects_renderbuffer_set(nouveauContextPtr nmesa,
+ nouveau_renderbuffer *nrb)
+{
+ nmesa->numClipRects = 1;
+ nmesa->pClipRects = &nmesa->osClipRect;
+ nmesa->osClipRect.x1 = 0;
+ nmesa->osClipRect.y1 = 0;
+ nmesa->osClipRect.x2 = nrb->mesa.Width;
+ nmesa->osClipRect.y2 = nrb->mesa.Height;
+ nmesa->drawX = 0;
+ nmesa->drawY = 0;
+}
+
+void
+nouveau_window_moved(GLcontext *ctx)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveau_renderbuffer *nrb;
+
+ nrb = (nouveau_renderbuffer *)ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ if (!nrb)
+ return;
+
+ if (!nrb->dPriv)
+ nouveau_cliprects_renderbuffer_set(nmesa, nrb);
+ else
+ nouveau_cliprects_drawable_set(nmesa, nrb);
+
+ /* Viewport depends on window size/position, nouveauCalcViewport
+ * will take care of calling the hw-specific WindowMoved
+ */
+ ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y,
+ ctx->Viewport.Width, ctx->Viewport.Height);
+ /* Scissor depends on window position */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+}
+
+GLboolean
+nouveau_build_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveau_renderbuffer *color[MAX_DRAW_BUFFERS];
+ nouveau_renderbuffer *depth;
+
+ _mesa_update_framebuffer(ctx);
+ _mesa_update_draw_buffer_bounds(ctx);
+
+ color[0] = (nouveau_renderbuffer *)fb->_ColorDrawBuffers[0][0];
+ if (fb->_DepthBuffer && fb->_DepthBuffer->Wrapped)
+ depth = (nouveau_renderbuffer *)fb->_DepthBuffer->Wrapped;
+ else
+ depth = (nouveau_renderbuffer *)fb->_DepthBuffer;
+
+ if (!nmesa->hw_func.BindBuffers(nmesa, 1, color, depth))
+ return GL_FALSE;
+ nouveau_window_moved(ctx);
+
+ return GL_TRUE;
+}
+
+static void
+nouveauDrawBuffer(GLcontext *ctx, GLenum buffer)
+{
+ nouveau_build_framebuffer(ctx, ctx->DrawBuffer);
+}
+
+static struct gl_framebuffer *
+nouveauNewFramebuffer(GLcontext *ctx, GLuint name)
+{
+ return _mesa_new_framebuffer(ctx, name);
+}
+
+static struct gl_renderbuffer *
+nouveauNewRenderbuffer(GLcontext *ctx, GLuint name)
+{
+ nouveau_renderbuffer *nrb;
+
+ nrb = CALLOC_STRUCT(nouveau_renderbuffer_t);
+ if (nrb) {
+ _mesa_init_renderbuffer(&nrb->mesa, name);
+
+ nrb->mesa.AllocStorage = nouveau_renderbuffer_storage;
+ nrb->mesa.Delete = nouveau_renderbuffer_delete;
+ }
+ return &nrb->mesa;
+}
+
+static void
+nouveauBindFramebuffer(GLcontext *ctx, GLenum target, struct gl_framebuffer *fb)
+{
+ nouveau_build_framebuffer(ctx, fb);
+}
+
+static void
+nouveauFramebufferRenderbuffer(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment,
+ struct gl_renderbuffer *rb)
+{
+ _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
+ nouveau_build_framebuffer(ctx, fb);
+}
+
+static void
+nouveauRenderTexture(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+}
+
+static void
+nouveauFinishRenderTexture(GLcontext *ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+}
+
+void
+nouveauInitBufferFuncs(struct dd_function_table *func)
+{
+ func->DrawBuffer = nouveauDrawBuffer;
+
+ func->NewFramebuffer = nouveauNewFramebuffer;
+ func->NewRenderbuffer = nouveauNewRenderbuffer;
+ func->BindFramebuffer = nouveauBindFramebuffer;
+ func->FramebufferRenderbuffer = nouveauFramebufferRenderbuffer;
+ func->RenderTexture = nouveauRenderTexture;
+ func->FinishRenderTexture = nouveauFinishRenderTexture;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.h b/src/mesa/drivers/dri/nouveau/nouveau_buffers.h
new file mode 100644
index 00000000000..d86455184c2
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.h
@@ -0,0 +1,48 @@
+#ifndef __NOUVEAU_BUFFERS_H__
+#define __NOUVEAU_BUFFERS_H__
+
+#include <stdint.h>
+#include "mtypes.h"
+#include "utils.h"
+#include "renderbuffer.h"
+
+typedef struct nouveau_mem_t {
+ int type;
+ uint64_t offset;
+ uint64_t size;
+ void* map;
+} nouveau_mem;
+
+extern nouveau_mem *nouveau_mem_alloc(GLcontext *ctx, int type,
+ GLuint size, GLuint align);
+extern void nouveau_mem_free(GLcontext *ctx, nouveau_mem *mem);
+extern uint32_t nouveau_mem_gpu_offset_get(GLcontext *ctx, nouveau_mem *mem);
+
+extern GLboolean nouveau_memformat_flat_emit(GLcontext *ctx,
+ nouveau_mem *dst,
+ nouveau_mem *src,
+ GLuint dst_offset,
+ GLuint src_offset,
+ GLuint size);
+
+typedef struct nouveau_renderbuffer_t {
+ struct gl_renderbuffer mesa; /* must be first! */
+ __DRIdrawablePrivate *dPriv;
+
+ nouveau_mem *mem;
+ void * map;
+
+ int cpp;
+ uint32_t offset;
+ uint32_t pitch;
+} nouveau_renderbuffer;
+
+extern nouveau_renderbuffer *nouveau_renderbuffer_new(GLenum internalFormat,
+ GLvoid *map, GLuint offset, GLuint pitch, __DRIdrawablePrivate *dPriv);
+extern void nouveau_window_moved(GLcontext *ctx);
+extern GLboolean nouveau_build_framebuffer(GLcontext *, struct gl_framebuffer *);
+extern nouveau_renderbuffer *nouveau_current_draw_buffer(GLcontext *ctx);
+
+extern void nouveauInitBufferFuncs(struct dd_function_table *func);
+
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_card.c b/src/mesa/drivers/dri/nouveau/nouveau_card.c
new file mode 100644
index 00000000000..91f12f0d704
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_card.c
@@ -0,0 +1,17 @@
+
+#include "nouveau_card.h"
+#include "nouveau_reg.h"
+#include "nouveau_drm.h"
+#include "nouveau_card_list.h"
+
+
+nouveau_card* nouveau_card_lookup(uint32_t device_id)
+{
+ int i;
+ for(i=0;i<sizeof(nouveau_card_list)/sizeof(nouveau_card)-1;i++)
+ if (nouveau_card_list[i].id==(device_id&0xffff))
+ return &(nouveau_card_list[i]);
+ return NULL;
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_card.h b/src/mesa/drivers/dri/nouveau/nouveau_card.h
new file mode 100644
index 00000000000..8a4c5f2244e
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_card.h
@@ -0,0 +1,49 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#ifndef __NOUVEAU_CARD_H__
+#define __NOUVEAU_CARD_H__
+
+#include "dri_util.h"
+#include "drm.h"
+#include "nouveau_drm.h"
+
+typedef struct nouveau_card_t {
+ uint16_t id; /* last 4 digits of pci id, last digit is always 0 */
+ char* name; /* the user-friendly card name */
+ uint32_t class_3d; /* the object class this card uses for 3D */
+ uint32_t type; /* the major card family */
+ uint32_t flags;
+}
+nouveau_card;
+
+#define NV_HAS_LMA 0x00000001
+
+extern nouveau_card* nouveau_card_lookup(uint32_t device_id);
+
+#endif
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_card_list.h b/src/mesa/drivers/dri/nouveau/nouveau_card_list.h
new file mode 100644
index 00000000000..14e7b69802a
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_card_list.h
@@ -0,0 +1,230 @@
+static nouveau_card nouveau_card_list[]={
+{0x0008, "EDGE 3D", 0, NV_03, 0},
+{0x0009, "EDGE 3D", 0, NV_03, 0},
+{0x0010, "Mutara V08", 0, NV_03, 0},
+{0x0020, "RIVA TNT", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x0028, "RIVA TNT2/TNT2 Pro", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x0029, "RIVA TNT2 Ultra", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002A, "Riva TnT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002B, "Riva TnT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002C, "Vanta/Vanta LT", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002D, "RIVA TNT2 Model 64/Model 64 Pro", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002E, "Vanta", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002F, "Vanta", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x0040, "GeForce 6800 Ultra", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0041, "GeForce 6800", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0042, "GeForce 6800 LE", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0043, "NV40.3", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0044, "GeForce 6800 XT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0045, "GeForce 6800 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0046, "GeForce 6800 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0047, "GeForce 6800 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0048, "GeForce 6800 XT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0049, "NV40GL", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x004D, "Quadro FX 4000", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x004E, "Quadro FX 4000", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0090, "GeForce 7800 GTX", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0091, "GeForce 7800 GTX", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0092, "GeForce 7800 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0093, "GeForce 7800 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0098, "GeForce Go 7800", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0099, "GE Force Go 7800 GTX", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x009D, "Quadro FX4500", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00A0, "Aladdin TNT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x00C0, "GeForce 6800 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00C1, "GeForce 6800", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00C2, "GeForce 6800 LE", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00C3, "Geforce 6800 XT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00C8, "GeForce Go 6800", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00C9, "GeForce Go 6800 Ultra", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00CC, "Quadro FX Go1400", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00CD, "Quadro FX 3450/4000 SDI", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00CE, "Quadro FX 1400", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F0, "GeForce 6800/GeForce 6800 Ultra", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F1, "GeForce 6600/GeForce 6600 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F2, "GeForce 6600/GeForce 6600 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F3, "GeForce 6200", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F4, "GeForce 6600 LE", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F5, "GeForce 7800 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F6, "GeForce 6600 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F8, "Quadro FX 3400/4400", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00F9, "GeForce 6800 Ultra/GeForce 6800 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x00FA, "GeForce PCX 5750", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x00FB, "GeForce PCX 5900", NV30_TCL_PRIMITIVE_3D|0x0400, NV_30, 0},
+{0x00FC, "Quadro FX 330/GeForce PCX 5300", NV30_TCL_PRIMITIVE_3D|0x0600, NV_30, 0},
+{0x00FD, "Quadro FX 330/Quadro NVS280", NV30_TCL_PRIMITIVE_3D|0x0600, NV_30, 0},
+{0x00FE, "Quadro FX 1300", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x00FF, "GeForce PCX 4300", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0100, "GeForce 256 SDR", NV10_TCL_PRIMITIVE_3D, NV_10, 0},
+{0x0101, "GeForce 256 DDR", NV10_TCL_PRIMITIVE_3D, NV_10, 0},
+{0x0103, "Quadro", NV10_TCL_PRIMITIVE_3D, NV_10, 0},
+{0x0110, "GeForce2 MX/MX 400", NV11_TCL_PRIMITIVE_3D, NV_11, 0},
+{0x0111, "GeForce2 MX 100 DDR/200 DDR", NV11_TCL_PRIMITIVE_3D, NV_11, 0},
+{0x0112, "GeForce2 Go", NV11_TCL_PRIMITIVE_3D, NV_11, 0},
+{0x0113, "Quadro2 MXR/EX/Go", NV11_TCL_PRIMITIVE_3D, NV_11, 0},
+{0x0140, "GeForce 6600 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0141, "GeForce 6600", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0142, "GeForce 6600 PCIe", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0144, "GeForce Go 6600", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0145, "GeForce 6610 XL", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0146, "Geforce Go 6600TE/6200TE", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0148, "GeForce Go 6600", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0149, "GeForce Go 6600 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x014A, "Quadro NVS 440", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x014D, "Quadro FX 550", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x014E, "Quadro FX 540", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x014F, "GeForce 6200", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0150, "GeForce2 GTS/Pro", NV11_TCL_PRIMITIVE_3D, NV_15, 0},
+{0x0151, "GeForce2 Ti", NV11_TCL_PRIMITIVE_3D, NV_15, 0},
+{0x0152, "GeForce2 Ultra, Bladerunner", NV11_TCL_PRIMITIVE_3D, NV_15, 0},
+{0x0153, "Quadro2 Pro", NV11_TCL_PRIMITIVE_3D, NV_15, 0},
+{0x0161, "GeForce 6200 TurboCache(TM)", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0162, "GeForce 6200 SE TurboCache (TM)", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0163, "GeForce 6200 LE", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0164, "GeForce Go 6200", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0165, "Quadro NVS 285", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0166, "GeForce Go 6400", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0167, "GeForce Go 6200 TurboCache", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0168, "GeForce Go 6200 TurboCache", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0170, "GeForce4 MX 460", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0171, "GeForce4 MX 440", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0172, "GeForce4 MX 420", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0173, "GeForce4 MX 440-SE", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0174, "GeForce4 440 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0175, "GeForce4 420 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0176, "GeForce4 420 Go 32M", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0177, "GeForce4 460 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0178, "Quadro4 550 XGL", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0179, "GeForce4 420 Go 32M", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x017A, "Quadro4 200/400 NVS", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x017B, "Quadro4 550 XGL", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x017C, "Quadro4 500 GoGL", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x017D, "GeForce4 410 Go 16M", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0181, "GeForce4 MX 440 AGP 8x", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0182, "GeForce4 MX 440SE AGP 8x", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0183, "GeForce4 MX 420 AGP 8x", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0185, "GeForce4 MX 4000 AGP 8x", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0186, "GeForce4 448 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0187, "GeForce4 488 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0188, "Quadro4 580 XGL", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x018A, "Quadro4 NVS AGP 8x", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x018B, "Quadro4 380 XGL", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x018C, "Quadro NVS 50 PCI", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x018D, "GeForce4 448 Go", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0191, "GeForce 8800 GTX", NV30_TCL_PRIMITIVE_3D|0x5000, NV_50, 0},
+{0x0193, "GeForce 8800 GTS", NV30_TCL_PRIMITIVE_3D|0x5000, NV_50, 0},
+{0x01A0, "GeForce2 MX Integrated Graphics", NV11_TCL_PRIMITIVE_3D, NV_11, 0},
+{0x01D1, "GeForce 7300 LE", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01D6, "GeForce Go 7200", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01D7, "Quadro NVS 110M / GeForce Go 7300", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01D8, "GeForce Go 7400", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01DA, "Quadro NVS 110M", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01DF, "GeForce 7300 GS", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x01F0, "GeForce4 MX - nForce GPU", NV17_TCL_PRIMITIVE_3D, NV_17, 0},
+{0x0200, "GeForce3", NV20_TCL_PRIMITIVE_3D|0x2000, NV_20, 0},
+{0x0201, "GeForce3 Ti 200", NV20_TCL_PRIMITIVE_3D|0x2000, NV_20, 0},
+{0x0202, "GeForce3 Ti 500", NV20_TCL_PRIMITIVE_3D|0x2000, NV_20, 0},
+{0x0203, "Quadro DCC", NV20_TCL_PRIMITIVE_3D|0x2000, NV_20, 0},
+{0x0211, "GeForce 6800", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0212, "GeForce 6800 LE", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0215, "GeForce 6800 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0218, "GeForce 6800 XT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0221, "GeForce 6200", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0240, "GeForce 6150", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0242, "GeForce 6100", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0244, "GeForce 6150 Go", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0250, "GeForce4 Ti 4600", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0251, "GeForce4 Ti 4400", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0252, "GeForce4 Ti", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0253, "GeForce4 Ti 4200", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0258, "Quadro4 900 XGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0259, "Quadro4 750 XGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x025B, "Quadro4 700 XGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0280, "GeForce4 Ti 4800", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0281, "GeForce4 Ti 4200 AGP 8x", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0282, "GeForce4 Ti 4800 SE", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0286, "GeForce4 Ti 4200 Go AGP 8x", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0288, "Quadro4 980 XGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0289, "Quadro4 780 XGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x028C, "Quadro4 700 GoGL", NV20_TCL_PRIMITIVE_3D|0x2500, NV_25, 0},
+{0x0290, "GeForce 7900 GTX", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0291, "GeForce 7900 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0292, "GeForce 7900 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0298, "GeForce Go 7900 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0299, "GeForce Go 7900 GTX", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029A, "Quadro FX 2500M", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029B, "Quadro FX 1500M", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029C, "Quadro FX 5500", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029D, "Quadro FX 3500", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029E, "Quadro FX 1500", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x029F, "Quadro FX 4500 X2", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x02A0, "XGPU", NV20_TCL_PRIMITIVE_3D|0x2000, NV_20, 0},
+{0x02E1, "GeForce 7600 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0300, "GeForce FX", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0301, "GeForce FX 5800 Ultra", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0302, "GeForce FX 5800", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0308, "Quadro FX 2000", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0309, "Quadro FX 1000", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0311, "GeForce FX 5600 Ultra", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0312, "GeForce FX 5600", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0313, "NV31", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0314, "GeForce FX 5600XT", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0316, "NV31M", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0317, "NV31M Pro", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x031A, "GeForce FX Go5600", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x031B, "GeForce FX Go5650", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x031D, "NV31GLM", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x031E, "NV31GLM Pro", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x031F, "NV31GLM Pro", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0320, "GeForce FX 5200", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0321, "GeForce FX 5200 Ultra", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0322, "GeForce FX 5200", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0323, "GeForce FX 5200LE", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0324, "GeForce FX Go5200", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0325, "GeForce FX Go5250", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0326, "GeForce FX 5500", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0327, "GeForce FX 5100", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0328, "GeForce FX Go5200 32M/64M", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0329, "GeForce FX Go5200", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x032A, "Quadro NVS 280 PCI", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x032B, "Quadro FX 500/600 PCI", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x032C, "GeForce FX Go 5300", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x032D, "GeForce FX Go5100", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x032F, "NV34GL", NV30_TCL_PRIMITIVE_3D|0x3400, NV_34, 0},
+{0x0330, "GeForce FX 5900 Ultra", NV30_TCL_PRIMITIVE_3D|0x0400, NV_30, 0},
+{0x0331, "GeForce FX 5900", NV30_TCL_PRIMITIVE_3D|0x0400, NV_30, 0},
+{0x0332, "GeForce FX 5900XT", NV30_TCL_PRIMITIVE_3D|0x0400, NV_30, 0},
+{0x0333, "GeForce FX 5950 Ultra", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0334, "GeForce FX 5900ZT", NV30_TCL_PRIMITIVE_3D|0x0400, NV_30, 0},
+{0x0338, "Quadro FX 3000", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x033F, "Quadro FX 700", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0341, "GeForce FX 5700 Ultra", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0342, "GeForce FX 5700", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0343, "GeForce FX 5700LE", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0344, "GeForce FX 5700VE", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0345, "NV36.5", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0347, "GeForce FX Go5700", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0348, "GeForce FX Go5700", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0349, "NV36M Pro", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x034B, "NV36MAP", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x034C, "Quadro FX Go1000", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x034E, "Quadro FX 1100", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x034F, "NV36GL", NV30_TCL_PRIMITIVE_3D|0x3000, NV_30, 0},
+{0x0391, "GeForce 7600 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0392, "GeForce 7600 GS", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0393, "GeForce 7300 GT", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x0398, "GeForce Go 7600", NV30_TCL_PRIMITIVE_3D|0x4000, NV_40, 0},
+{0x03D0, "GeForce 6100 nForce 430", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x03D1, "GeForce 6100 nForce 405", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x03D2, "GeForce 6100 nForce 400", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x03D5, "GeForce 6100 nForce 420", NV30_TCL_PRIMITIVE_3D|0x4400, NV_44, 0},
+{0x0008, "NV1", 0, NV_03, 0},
+{0x0009, "DAC64", 0, NV_03, 0},
+{0x0018, "Riva128", 0, NV_03, 0},
+{0x0019, "Riva128ZX", 0, NV_03, 0},
+{0x0020, "TNT", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x0028, "TNT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x0029, "UTNT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x002C, "VTNT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+{0x00A0, "ITNT2", NV04_DX6_MULTITEX_TRIANGLE, NV_04, 0},
+};
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
new file mode 100644
index 00000000000..c86ff603f6f
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -0,0 +1,366 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "glheader.h"
+#include "context.h"
+#include "simple_list.h"
+#include "imports.h"
+#include "matrix.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "framebuffer.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "tnl/t_vp_build.h"
+
+#include "drivers/common/driverfuncs.h"
+
+#include "nouveau_context.h"
+#include "nouveau_driver.h"
+//#include "nouveau_state.h"
+#include "nouveau_span.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_tex.h"
+#include "nouveau_msg.h"
+#include "nouveau_reg.h"
+#include "nouveau_lock.h"
+#include "nv10_swtcl.h"
+
+#include "vblank.h"
+#include "utils.h"
+#include "texmem.h"
+#include "xmlpool.h" /* for symbolic values of enum-type options */
+
+#ifndef NOUVEAU_DEBUG
+int NOUVEAU_DEBUG = 0;
+#endif
+
+static const struct dri_debug_control debug_control[] =
+{
+ { "shaders" , DEBUG_SHADERS },
+ { "mem" , DEBUG_MEM },
+ { "bufferobj" , DEBUG_BUFFEROBJ },
+ { NULL , 0 }
+};
+
+#define need_GL_ARB_vertex_program
+#include "extension_helper.h"
+
+const struct dri_extension common_extensions[] =
+{
+ { NULL, 0 }
+};
+
+const struct dri_extension nv10_extensions[] =
+{
+ { NULL, 0 }
+};
+
+const struct dri_extension nv20_extensions[] =
+{
+ { NULL, 0 }
+};
+
+const struct dri_extension nv30_extensions[] =
+{
+ { "GL_ARB_fragment_program", NULL },
+ { NULL, 0 }
+};
+
+const struct dri_extension nv40_extensions[] =
+{
+ /* ARB_vp can be moved to nv20/30 once the shader backend has been
+ * written for those cards.
+ */
+ { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
+ { NULL, 0 }
+};
+
+const struct dri_extension nv50_extensions[] =
+{
+ { NULL, 0 }
+};
+
+/* Create the device specific context.
+ */
+GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
+ __DRIcontextPrivate *driContextPriv,
+ void *sharedContextPrivate )
+{
+ GLcontext *ctx, *shareCtx;
+ __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ struct dd_function_table functions;
+ nouveauContextPtr nmesa;
+ nouveauScreenPtr screen;
+
+ /* Allocate the context */
+ nmesa = (nouveauContextPtr) CALLOC( sizeof(*nmesa) );
+ if ( !nmesa )
+ return GL_FALSE;
+
+ nmesa->driContext = driContextPriv;
+ nmesa->driScreen = sPriv;
+ nmesa->driDrawable = NULL;
+ nmesa->hHWContext = driContextPriv->hHWContext;
+ nmesa->driHwLock = &sPriv->pSAREA->lock;
+ nmesa->driFd = sPriv->fd;
+
+ nmesa->screen = (nouveauScreenPtr)(sPriv->private);
+ screen=nmesa->screen;
+
+ /* Create the hardware context */
+ if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_FB_PHYSICAL,
+ &nmesa->vram_phys))
+ return GL_FALSE;
+ if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_PHYSICAL,
+ &nmesa->agp_phys))
+ return GL_FALSE;
+ if (!nouveauFifoInit(nmesa))
+ return GL_FALSE;
+ nouveauObjectInit(nmesa);
+
+
+ /* Init default driver functions then plug in our nouveau-specific functions
+ * (the texture functions are especially important)
+ */
+ _mesa_init_driver_functions( &functions );
+ nouveauDriverInitFunctions( &functions );
+ nouveauTexInitFunctions( &functions );
+
+ /* Allocate the Mesa context */
+ if (sharedContextPrivate)
+ shareCtx = ((nouveauContextPtr) sharedContextPrivate)->glCtx;
+ else
+ shareCtx = NULL;
+ nmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
+ &functions, (void *) nmesa);
+ if (!nmesa->glCtx) {
+ FREE(nmesa);
+ return GL_FALSE;
+ }
+ driContextPriv->driverPrivate = nmesa;
+ ctx = nmesa->glCtx;
+
+ /* Parse configuration files */
+ driParseConfigFiles (&nmesa->optionCache, &screen->optionCache,
+ screen->driScreen->myNum, "nouveau");
+
+ nmesa->sarea = (drm_nouveau_sarea_t *)((char *)sPriv->pSAREA +
+ screen->sarea_priv_offset);
+
+ /* Enable any supported extensions */
+ driInitExtensions(ctx, common_extensions, GL_TRUE);
+ if (nmesa->screen->card->type >= NV_10)
+ driInitExtensions(ctx, nv10_extensions, GL_FALSE);
+ if (nmesa->screen->card->type >= NV_20)
+ driInitExtensions(ctx, nv20_extensions, GL_FALSE);
+ if (nmesa->screen->card->type >= NV_30)
+ driInitExtensions(ctx, nv30_extensions, GL_FALSE);
+ if (nmesa->screen->card->type >= NV_40)
+ driInitExtensions(ctx, nv40_extensions, GL_FALSE);
+ if (nmesa->screen->card->type >= NV_50)
+ driInitExtensions(ctx, nv50_extensions, GL_FALSE);
+
+ nmesa->current_primitive = -1;
+
+ nouveauShaderInitFuncs(ctx);
+ /* Install Mesa's fixed-function texenv shader support */
+ if (nmesa->screen->card->type >= NV_40)
+ ctx->_MaintainTexEnvProgram = GL_TRUE;
+
+ /* Initialize the swrast */
+ _swrast_CreateContext( ctx );
+ _vbo_CreateContext( ctx );
+ _tnl_CreateContext( ctx );
+ _swsetup_CreateContext( ctx );
+
+ _math_matrix_ctr(&nmesa->viewport);
+
+ nouveauDDInitStateFuncs( ctx );
+ nouveauSpanInitFunctions( ctx );
+ nouveauDDInitState( nmesa );
+ switch(nmesa->screen->card->type)
+ {
+ case NV_03:
+ //nv03TriInitFunctions( ctx );
+ break;
+ case NV_04:
+ case NV_05:
+ //nv04TriInitFunctions( ctx );
+ break;
+ case NV_10:
+ case NV_20:
+ case NV_30:
+ case NV_40:
+ case NV_44:
+ case NV_50:
+ default:
+ nv10TriInitFunctions( ctx );
+ break;
+ }
+
+ nouveauInitBufferObjects(ctx);
+ if (!nouveauSyncInitFuncs(ctx))
+ return GL_FALSE;
+ nmesa->hw_func.InitCard(nmesa);
+ nouveauInitState(ctx);
+
+ driContextPriv->driverPrivate = (void *)nmesa;
+
+ NOUVEAU_DEBUG = driParseDebugString( getenv( "NOUVEAU_DEBUG" ),
+ debug_control );
+
+ if (driQueryOptionb(&nmesa->optionCache, "no_rast")) {
+ fprintf(stderr, "disabling 3D acceleration\n");
+ FALLBACK(nmesa, NOUVEAU_FALLBACK_DISABLE, 1);
+ }
+
+ return GL_TRUE;
+}
+
+/* Destroy the device specific context. */
+void nouveauDestroyContext( __DRIcontextPrivate *driContextPriv )
+{
+ nouveauContextPtr nmesa = (nouveauContextPtr) driContextPriv->driverPrivate;
+
+ assert(nmesa);
+ if ( nmesa ) {
+ /* free the option cache */
+ driDestroyOptionCache (&nmesa->optionCache);
+
+ FREE( nmesa );
+ }
+
+}
+
+
+/* Force the context `c' to be the current context and associate with it
+ * buffer `b'.
+ */
+GLboolean nouveauMakeCurrent( __DRIcontextPrivate *driContextPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ __DRIdrawablePrivate *driReadPriv )
+{
+ if ( driContextPriv ) {
+ nouveauContextPtr nmesa = (nouveauContextPtr) driContextPriv->driverPrivate;
+ struct gl_framebuffer *draw_fb =
+ (struct gl_framebuffer*)driDrawPriv->driverPrivate;
+ struct gl_framebuffer *read_fb =
+ (struct gl_framebuffer*)driReadPriv->driverPrivate;
+
+ driDrawableInitVBlank(driDrawPriv, nmesa->vblank_flags, &nmesa->vblank_seq );
+ nmesa->driDrawable = driDrawPriv;
+
+ _mesa_resize_framebuffer(nmesa->glCtx, draw_fb,
+ driDrawPriv->w, driDrawPriv->h);
+ if (draw_fb != read_fb) {
+ _mesa_resize_framebuffer(nmesa->glCtx, draw_fb,
+ driReadPriv->w,
+ driReadPriv->h);
+ }
+ _mesa_make_current(nmesa->glCtx, draw_fb, read_fb);
+
+ nouveau_build_framebuffer(nmesa->glCtx,
+ driDrawPriv->driverPrivate);
+ } else {
+ _mesa_make_current( NULL, NULL, NULL );
+ }
+
+ return GL_TRUE;
+}
+
+
+/* Force the context `c' to be unbound from its buffer.
+ */
+GLboolean nouveauUnbindContext( __DRIcontextPrivate *driContextPriv )
+{
+ return GL_TRUE;
+}
+
+static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
+ __DRIdrawablePrivate *dPriv)
+{
+ struct gl_framebuffer *fb;
+ nouveau_renderbuffer *src, *dst;
+ drm_clip_rect_t *box;
+ int nbox, i;
+
+ fb = (struct gl_framebuffer *)dPriv->driverPrivate;
+ dst = (nouveau_renderbuffer*)
+ fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
+ src = (nouveau_renderbuffer*)
+ fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
+
+#ifdef ALLOW_MULTI_SUBCHANNEL
+ LOCK_HARDWARE(nmesa);
+ nbox = dPriv->numClipRects;
+ box = dPriv->pClipRects;
+
+ if (nbox) {
+ BEGIN_RING_SIZE(NvSubCtxSurf2D,
+ NV10_CONTEXT_SURFACES_2D_FORMAT, 4);
+ if (src->mesa._ActualFormat == GL_RGBA8)
+ OUT_RING (6); /* X8R8G8B8 */
+ else
+ OUT_RING (4); /* R5G6B5 */
+ OUT_RING ((dst->pitch << 16) | src->pitch);
+ OUT_RING (src->offset);
+ OUT_RING (dst->offset);
+ }
+
+ for (i=0; i<nbox; i++, box++) {
+ BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_POINT, 3);
+ OUT_RING (((box->y1 - dPriv->y) << 16) |
+ (box->x1 - dPriv->x));
+ OUT_RING ((box->y1 << 16) | box->x1);
+ OUT_RING (((box->y2 - box->y1) << 16) |
+ (box->x2 - box->x1));
+ }
+
+ UNLOCK_HARDWARE(nmesa);
+#endif
+}
+
+void nouveauSwapBuffers(__DRIdrawablePrivate *dPriv)
+{
+ if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
+ nouveauContextPtr nmesa = dPriv->driContextPriv->driverPrivate;
+
+ if (nmesa->glCtx->Visual.doubleBufferMode) {
+ _mesa_notifySwapBuffers(nmesa->glCtx);
+ nouveauDoSwapBuffers(nmesa, dPriv);
+ }
+
+ }
+}
+
+void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv,
+ int x, int y, int w, int h)
+{
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h
new file mode 100644
index 00000000000..c7bf387210c
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h
@@ -0,0 +1,227 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NOUVEAU_CONTEXT_H__
+#define __NOUVEAU_CONTEXT_H__
+
+#include "dri_util.h"
+#include "drm.h"
+#include "nouveau_drm.h"
+
+#include "mtypes.h"
+#include "tnl/t_vertex.h"
+
+#include "nouveau_screen.h"
+#include "nouveau_state_cache.h"
+#include "nouveau_buffers.h"
+#include "nouveau_shader.h"
+#include "nouveau_sync.h"
+
+#include "xmlconfig.h"
+
+typedef struct nouveau_fifo_t{
+ u_int32_t* buffer;
+ u_int32_t* mmio;
+ u_int32_t put_base;
+ u_int32_t current;
+ u_int32_t put;
+ u_int32_t free;
+ u_int32_t max;
+}
+nouveau_fifo;
+
+#define TAG(x) nouveau##x
+#include "tnl_dd/t_dd_vertex.h"
+#undef TAG
+
+/* Subpixel offsets for window coordinates (triangles): */
+#define SUBPIXEL_X (0.0F)
+#define SUBPIXEL_Y (0.125F)
+
+struct nouveau_context;
+
+typedef void (*nouveau_tri_func)( struct nouveau_context*,
+ nouveauVertex *,
+ nouveauVertex *,
+ nouveauVertex * );
+
+typedef void (*nouveau_line_func)( struct nouveau_context*,
+ nouveauVertex *,
+ nouveauVertex * );
+
+typedef void (*nouveau_point_func)( struct nouveau_context*,
+ nouveauVertex * );
+
+typedef struct nouveau_hw_func_t {
+ /* Initialise any card-specific non-GL related state */
+ GLboolean (*InitCard)(struct nouveau_context *);
+ /* Update buffer offset/pitch/format */
+ GLboolean (*BindBuffers)(struct nouveau_context *, int num_color,
+ nouveau_renderbuffer **color,
+ nouveau_renderbuffer *depth);
+ /* Update anything that depends on the window position/size */
+ void (*WindowMoved)(struct nouveau_context *);
+} nouveau_hw_func;
+
+typedef struct nouveau_context {
+ /* Mesa context */
+ GLcontext *glCtx;
+
+ /* The per-context fifo */
+ nouveau_fifo fifo;
+
+ /* The read-only regs */
+ volatile unsigned char* mmio;
+
+ /* Physical addresses of AGP/VRAM apertures */
+ uint64_t vram_phys;
+ uint64_t agp_phys;
+
+ /* Channel synchronisation */
+ nouveau_notifier *syncNotifier;
+
+ /* Additional hw-specific functions */
+ nouveau_hw_func hw_func;
+
+ /* FIXME : do we want to put all state into a separate struct ? */
+ /* State for tris */
+ GLuint color_offset;
+ GLuint specular_offset;
+
+ /* Vertex state */
+ GLuint vertex_size;
+ GLubyte *verts;
+ struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
+ GLuint vertex_attr_count;
+
+ /* Color buffer clear value */
+ uint32_t clear_color_value;
+
+ /* Depth/stencil clear value */
+ uint32_t clear_value;
+
+ /* Light state */
+ GLboolean lighting_enabled;
+ uint32_t enabled_lights;
+
+ /* Cached state */
+ nouveau_state_cache state_cache;
+
+ /* The drawing fallbacks */
+ GLuint Fallback;
+ nouveau_tri_func draw_tri;
+ nouveau_line_func draw_line;
+ nouveau_point_func draw_point;
+
+ /* Cliprects information */
+ GLuint numClipRects;
+ drm_clip_rect_t *pClipRects;
+ drm_clip_rect_t osClipRect;
+ GLuint drawX, drawY;
+
+ /* The rendering context information */
+ GLenum current_primitive; /* the current primitive enum */
+ DECLARE_RENDERINPUTS(render_inputs_bitset); /* the current render inputs */
+
+ /* Shader state */
+ nvsFunc VPfunc;
+ nvsFunc FPfunc;
+ nouveauShader *current_fragprog;
+ nouveauShader *current_vertprog;
+ nouveauShader *passthrough_vp;
+
+ nouveauScreenRec *screen;
+ drm_nouveau_sarea_t *sarea;
+
+ __DRIcontextPrivate *driContext; /* DRI context */
+ __DRIscreenPrivate *driScreen; /* DRI screen */
+ __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */
+ GLint lastStamp;
+
+ drm_context_t hHWContext;
+ drm_hw_lock_t *driHwLock;
+ int driFd;
+
+ /* Configuration cache */
+ driOptionCache optionCache;
+
+ /* vblank stuff */
+ uint32_t vblank_flags;
+ uint32_t vblank_seq;
+
+ GLuint new_state;
+ GLuint new_render_state;
+ GLuint render_index;
+ GLmatrix viewport;
+ GLfloat depth_scale;
+
+}nouveauContextRec, *nouveauContextPtr;
+
+
+#define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx))
+
+/* Flags for software fallback cases: */
+#define NOUVEAU_FALLBACK_TEXTURE 0x0001
+#define NOUVEAU_FALLBACK_DRAW_BUFFER 0x0002
+#define NOUVEAU_FALLBACK_READ_BUFFER 0x0004
+#define NOUVEAU_FALLBACK_STENCIL 0x0008
+#define NOUVEAU_FALLBACK_RENDER_MODE 0x0010
+#define NOUVEAU_FALLBACK_LOGICOP 0x0020
+#define NOUVEAU_FALLBACK_SEP_SPECULAR 0x0040
+#define NOUVEAU_FALLBACK_BLEND_EQ 0x0080
+#define NOUVEAU_FALLBACK_BLEND_FUNC 0x0100
+#define NOUVEAU_FALLBACK_PROJTEX 0x0200
+#define NOUVEAU_FALLBACK_DISABLE 0x0400
+
+
+extern GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
+ __DRIcontextPrivate *driContextPriv,
+ void *sharedContextPrivate );
+
+extern void nouveauDestroyContext( __DRIcontextPrivate * );
+
+extern GLboolean nouveauMakeCurrent( __DRIcontextPrivate *driContextPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ __DRIdrawablePrivate *driReadPriv );
+
+extern GLboolean nouveauUnbindContext( __DRIcontextPrivate *driContextPriv );
+
+extern void nouveauSwapBuffers(__DRIdrawablePrivate *dPriv);
+
+extern void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv,
+ int x, int y, int w, int h);
+
+/* Debugging utils: */
+extern int NOUVEAU_DEBUG;
+
+#define DEBUG_SHADERS 0x00000001
+#define DEBUG_MEM 0x00000002
+#define DEBUG_BUFFEROBJ 0x00000004
+
+#endif /* __NOUVEAU_CONTEXT_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_ctrlreg.h b/src/mesa/drivers/dri/nouveau/nouveau_ctrlreg.h
new file mode 100644
index 00000000000..c9b2d590077
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_ctrlreg.h
@@ -0,0 +1,44 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin, Sylvain Munaut
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+
+#define NV03_STATUS 0x004006b0
+#define NV04_STATUS 0x00400700
+
+#define NV03_FIFO_REGS_SIZE 0x10000
+# define NV03_FIFO_REGS_DMAPUT 0x00000040
+# define NV03_FIFO_REGS_DMAGET 0x00000044
+
+/* Fifo commands. These are not regs, neither masks */
+#define NV03_FIFO_CMD_JUMP 0x20000000
+#define NV03_FIFO_CMD_JUMP_OFFSET_MASK 0x1ffffffc
+#define NV03_FIFO_CMD_REWIND (NV03_FIFO_CMD_JUMP | (0 & NV03_FIFO_CMD_JUMP_OFFSET_MASK))
+
+
+#define NONINC_METHOD 0x40000000
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_dri.h b/src/mesa/drivers/dri/nouveau/nouveau_dri.h
new file mode 100644
index 00000000000..ce3c3fb9cc4
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_dri.h
@@ -0,0 +1,28 @@
+#ifndef _NOUVEAU_DRI_
+#define _NOUVEAU_DRI_
+
+#include "xf86drm.h"
+#include "drm.h"
+#include "nouveau_drm.h"
+
+typedef struct {
+ uint32_t device_id; /**< \brief PCI device ID */
+ uint32_t width; /**< \brief width in pixels of display */
+ uint32_t height; /**< \brief height in scanlines of display */
+ uint32_t depth; /**< \brief depth of display (8, 15, 16, 24) */
+ uint32_t bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
+
+ uint32_t bus_type; /**< \brief ths bus type */
+ uint32_t bus_mode; /**< \brief bus mode (used for AGP, maybe also for PCI-E ?) */
+
+ uint32_t front_offset; /**< \brief front buffer offset */
+ uint32_t front_pitch; /**< \brief front buffer pitch */
+ uint32_t back_offset; /**< \brief private back buffer offset */
+ uint32_t back_pitch; /**< \brief private back buffer pitch */
+ uint32_t depth_offset; /**< \brief private depth buffer offset */
+ uint32_t depth_pitch; /**< \brief private depth buffer pitch */
+
+} NOUVEAUDRIRec, *NOUVEAUDRIPtr;
+
+#endif
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
new file mode 100644
index 00000000000..00956aa8f8b
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
@@ -0,0 +1,146 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "nouveau_context.h"
+//#include "nouveau_state.h"
+#include "nouveau_lock.h"
+#include "nouveau_fifo.h"
+#include "nouveau_driver.h"
+#include "swrast/swrast.h"
+
+#include "context.h"
+#include "framebuffer.h"
+
+#include "utils.h"
+
+/* Wrapper for DRM_NOUVEAU_GETPARAM ioctl */
+GLboolean nouveauDRMGetParam(nouveauContextPtr nmesa,
+ unsigned int param,
+ uint64_t* value)
+{
+ drm_nouveau_getparam_t getp;
+
+ getp.param = param;
+ if (!value || drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_GETPARAM,
+ &getp, sizeof(getp)))
+ return GL_FALSE;
+ *value = getp.value;
+ return GL_TRUE;
+}
+
+/* Wrapper for DRM_NOUVEAU_GETPARAM ioctl */
+GLboolean nouveauDRMSetParam(nouveauContextPtr nmesa,
+ unsigned int param,
+ uint64_t value)
+{
+ drm_nouveau_setparam_t setp;
+
+ setp.param = param;
+ setp.value = value;
+ if (drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_SETPARAM, &setp,
+ sizeof(setp)))
+ return GL_FALSE;
+ return GL_TRUE;
+}
+
+/* Return the width and height of the current color buffer */
+static void nouveauGetBufferSize( GLframebuffer *buffer,
+ GLuint *width, GLuint *height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ LOCK_HARDWARE( nmesa );
+ *width = nmesa->driDrawable->w;
+ *height = nmesa->driDrawable->h;
+ UNLOCK_HARDWARE( nmesa );
+}
+
+/* glGetString */
+static const GLubyte *nouveauGetString( GLcontext *ctx, GLenum name )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ static char buffer[128];
+ const char * card_name = "Unknown";
+ GLuint agp_mode = 0;
+
+ switch ( name ) {
+ case GL_VENDOR:
+ return (GLubyte *)DRIVER_AUTHOR;
+
+ case GL_RENDERER:
+ card_name=nmesa->screen->card->name;
+
+ switch(nmesa->screen->bus_type)
+ {
+ case NV_PCI:
+ case NV_PCIE:
+ default:
+ agp_mode=0;
+ break;
+ case NV_AGP:
+ agp_mode=nmesa->screen->agp_mode;
+ break;
+ }
+ driGetRendererString( buffer, card_name, DRIVER_DATE,
+ agp_mode );
+ return (GLubyte *)buffer;
+ default:
+ return NULL;
+ }
+}
+
+/* glFlush */
+static void nouveauFlush( GLcontext *ctx )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ FIRE_RING();
+}
+
+/* glFinish */
+static void nouveauFinish( GLcontext *ctx )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveauFlush( ctx );
+ nouveauWaitForIdle( nmesa );
+}
+
+/* glClear */
+static void nouveauClear( GLcontext *ctx, GLbitfield mask )
+{
+ // XXX we really should do something here...
+}
+
+void nouveauDriverInitFunctions( struct dd_function_table *functions )
+{
+ functions->GetBufferSize = nouveauGetBufferSize;
+ functions->ResizeBuffers = _mesa_resize_framebuffer;
+ functions->GetString = nouveauGetString;
+ functions->Flush = nouveauFlush;
+ functions->Finish = nouveauFinish;
+ functions->Clear = nouveauClear;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
new file mode 100644
index 00000000000..6164012b5b7
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
@@ -0,0 +1,42 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NOUVEAU_DRIVER_H__
+#define __NOUVEAU_DRIVER_H__
+
+#define DRIVER_DATE "20060219"
+#define DRIVER_AUTHOR "Stephane Marchesin"
+
+extern void nouveauDriverInitFunctions( struct dd_function_table *functions );
+extern GLboolean nouveauDRMGetParam(nouveauContextPtr nmesa, unsigned int param,
+ uint64_t *value);
+extern GLboolean nouveauDRMSetParam(nouveauContextPtr nmesa, unsigned int param,
+ uint64_t value);
+
+#endif /* __NOUVEAU_DRIVER_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
new file mode 100644
index 00000000000..7af9f1e3c2f
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
@@ -0,0 +1,137 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#include "vblank.h"
+#include <errno.h>
+#include "mtypes.h"
+#include "macros.h"
+#include "dd.h"
+#include "swrast/swrast.h"
+#include "nouveau_context.h"
+#include "nouveau_msg.h"
+#include "nouveau_fifo.h"
+#include "nouveau_lock.h"
+#include "nouveau_object.h"
+#include "nouveau_sync.h"
+
+
+#define RING_SKIPS 8
+
+void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size)
+{
+#ifdef NOUVEAU_RING_DEBUG
+ return;
+#endif
+ u_int32_t fifo_get;
+ while(nmesa->fifo.free < size+1) {
+ fifo_get = NV_FIFO_READ_GET();
+
+ if(nmesa->fifo.put >= fifo_get) {
+ nmesa->fifo.free = nmesa->fifo.max - nmesa->fifo.current;
+ if(nmesa->fifo.free < size+1) {
+ OUT_RING(NV03_FIFO_CMD_JUMP | nmesa->fifo.put_base);
+ if(fifo_get <= RING_SKIPS) {
+ if(nmesa->fifo.put <= RING_SKIPS) /* corner case - will be idle */
+ NV_FIFO_WRITE_PUT(RING_SKIPS + 1);
+ do { fifo_get = NV_FIFO_READ_GET(); }
+ while(fifo_get <= RING_SKIPS);
+ }
+ NV_FIFO_WRITE_PUT(RING_SKIPS);
+ nmesa->fifo.current = nmesa->fifo.put = RING_SKIPS;
+ nmesa->fifo.free = fifo_get - (RING_SKIPS + 1);
+ }
+ } else
+ nmesa->fifo.free = fifo_get - nmesa->fifo.current - 1;
+ }
+}
+
+/*
+ * Wait for the channel to be idle
+ */
+void nouveauWaitForIdleLocked(nouveauContextPtr nmesa)
+{
+ /* Wait for FIFO idle */
+ FIRE_RING();
+ while(RING_AHEAD()>0);
+
+ /* Wait on notifier to indicate all commands in the channel have
+ * been completed.
+ */
+ nouveau_notifier_wait_nop(nmesa->glCtx, nmesa->syncNotifier, NvSub3D);
+}
+
+void nouveauWaitForIdle(nouveauContextPtr nmesa)
+{
+ LOCK_HARDWARE(nmesa);
+ nouveauWaitForIdleLocked(nmesa);
+ UNLOCK_HARDWARE(nmesa);
+}
+
+// here we call the fifo initialization ioctl and fill in stuff accordingly
+GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
+{
+ drm_nouveau_fifo_alloc_t fifo_init;
+ int i;
+
+#ifdef NOUVEAU_RING_DEBUG
+ return GL_TRUE;
+#endif
+
+ int ret;
+ ret=drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_FIFO_ALLOC, &fifo_init, sizeof(fifo_init));
+ if (ret) {
+ FATAL("Fifo initialization ioctl failed (returned %d)\n",ret);
+ return GL_FALSE;
+ }
+
+ ret = drmMap(nmesa->driFd, fifo_init.cmdbuf, fifo_init.cmdbuf_size, &nmesa->fifo.buffer);
+ if (ret) {
+ FATAL("Unable to map the fifo (returned %d)\n",ret);
+ return GL_FALSE;
+ }
+ ret = drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio);
+ if (ret) {
+ FATAL("Unable to map the control regs (returned %d)\n",ret);
+ return GL_FALSE;
+ }
+
+ /* Setup our initial FIFO tracking params */
+ nmesa->fifo.put_base = fifo_init.put_base;
+ nmesa->fifo.current = 0;
+ nmesa->fifo.put = 0;
+ nmesa->fifo.max = (fifo_init.cmdbuf_size >> 2) - 1;
+ nmesa->fifo.free = nmesa->fifo.max - nmesa->fifo.current;
+
+ for (i=0; i<RING_SKIPS; i++)
+ OUT_RING(0);
+ nmesa->fifo.free -= RING_SKIPS;
+
+ MESSAGE("Fifo init ok. Using context %d\n", fifo_init.channel);
+ return GL_TRUE;
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
new file mode 100644
index 00000000000..9056bfb2557
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -0,0 +1,156 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NOUVEAU_FIFO_H__
+#define __NOUVEAU_FIFO_H__
+
+#include "nouveau_context.h"
+#include "nouveau_ctrlreg.h"
+#include "nouveau_state_cache.h"
+
+//#define NOUVEAU_RING_DEBUG
+//#define NOUVEAU_STATE_CACHE_DISABLE
+
+#define NV_READ(reg) *(volatile u_int32_t *)(nmesa->mmio + (reg))
+
+#define NV_FIFO_READ(reg) *(volatile u_int32_t *)(nmesa->fifo.mmio + (reg/4))
+#define NV_FIFO_WRITE(reg,value) *(volatile u_int32_t *)(nmesa->fifo.mmio + (reg/4)) = value;
+#define NV_FIFO_READ_GET() ((NV_FIFO_READ(NV03_FIFO_REGS_DMAGET) - nmesa->fifo.put_base) >> 2)
+#define NV_FIFO_WRITE_PUT(val) NV_FIFO_WRITE(NV03_FIFO_REGS_DMAPUT, ((val)<<2) + nmesa->fifo.put_base)
+
+/*
+ * Ring/fifo interface
+ *
+ * - Begin a ring section with BEGIN_RING_SIZE (if you know the full size in advance)
+ * - Output stuff to the ring with either OUT_RINGp (outputs a raw mem chunk), OUT_RING (1 uint32_t) or OUT_RINGf (1 float)
+ * - RING_AVAILABLE returns the available fifo (in uint32_ts)
+ * - RING_AHEAD returns how much ahead of the last submission point we are
+ * - FIRE_RING fires whatever we have that wasn't fired before
+ * - WAIT_RING waits for size (in uint32_ts) to be available in the fifo
+ */
+
+/* Enable for ring debugging. Prints out writes to the ring buffer
+ * but does not actually write to it.
+ */
+#ifdef NOUVEAU_RING_DEBUG
+
+#define OUT_RINGp(ptr,sz) do { \
+uint32_t* p=(uint32_t*)(ptr); \
+int i; printf("OUT_RINGp: (size 0x%x dwords)\n",sz); for(i=0;i<sz;i++) printf(" 0x%08x %f\n", *(p+i), *((float*)(p+i))); \
+}while(0)
+
+#define OUT_RING(n) do { \
+ printf("OUT_RINGn: 0x%08x (%s)\n", n, __func__); \
+}while(0)
+
+#define OUT_RINGf(n) do { \
+ printf("OUT_RINGf: %.04f (%s)\n", n, __func__); \
+}while(0)
+
+#else
+
+#define OUT_RINGp(ptr,sz) do{ \
+ memcpy(nmesa->fifo.buffer+nmesa->fifo.current,ptr,(sz)*4); \
+ nmesa->fifo.current+=(sz); \
+}while(0)
+
+#define OUT_RING(n) do { \
+nmesa->fifo.buffer[nmesa->fifo.current++]=(n); \
+}while(0)
+
+#define OUT_RINGf(n) do { \
+*((float*)(nmesa->fifo.buffer+nmesa->fifo.current++))=(n); \
+}while(0)
+
+#endif
+
+#define BEGIN_RING_SIZE(subchannel,tag,size) do { \
+ nouveau_state_cache_flush(nmesa); \
+ if (nmesa->fifo.free <= (size)) \
+ WAIT_RING(nmesa,(size)); \
+ OUT_RING( ((size)<<18) | ((subchannel) << 13) | (tag)); \
+ nmesa->fifo.free -= ((size) + 1); \
+}while(0)
+
+extern void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size);
+extern void nouveau_state_cache_flush(nouveauContextPtr nmesa);
+extern void nouveau_state_cache_init(nouveauContextPtr nmesa);
+
+#ifdef NOUVEAU_STATE_CACHE_DISABLE
+#define BEGIN_RING_CACHE(subc,tag,size) BEGIN_RING_SIZE((subc), (tag), (size))
+#define OUT_RING_CACHE(n) OUT_RING((n))
+#define OUT_RING_CACHEf(n) OUT_RINGf((n))
+#define OUT_RING_CACHEp(ptr, sz) OUT_RINGp((ptr), (sz))
+#else
+#define BEGIN_RING_CACHE(subchannel,tag,size) do { \
+ nmesa->state_cache.dirty=1; \
+ nmesa->state_cache.current_pos=((tag)/4); \
+}while(0)
+
+#define OUT_RING_CACHE(n) do { \
+ if (nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value!=(n)) { \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].dirty=1; \
+ nmesa->state_cache.hdirty[nmesa->state_cache.current_pos/NOUVEAU_STATE_CACHE_HIER_SIZE]=1; \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value=(n); \
+ } \
+ nmesa->state_cache.current_pos++; \
+}while(0)
+
+#define OUT_RING_CACHEf(n) do { \
+ if ((*(float*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))!=(n)){ \
+ nmesa->state_cache.atoms[nmesa->state_cache.current_pos].dirty=1; \
+ nmesa->state_cache.hdirty[nmesa->state_cache.current_pos/NOUVEAU_STATE_CACHE_HIER_SIZE]=1; \
+ (*(float*)(&nmesa->state_cache.atoms[nmesa->state_cache.current_pos].value))=(n);\
+ } \
+ nmesa->state_cache.current_pos++; \
+}while(0)
+
+#define OUT_RING_CACHEp(ptr,sz) do { \
+uint32_t* p=(uint32_t*)(ptr); \
+int i; for(i=0;i<sz;i++) OUT_RING_CACHE(*(p+i)); \
+}while(0)
+#endif
+
+#define RING_AVAILABLE() (nmesa->fifo.free-1)
+
+#define RING_AHEAD() ((nmesa->fifo.put<=nmesa->fifo.current)?(nmesa->fifo.current-nmesa->fifo.put):nmesa->fifo.max-nmesa->fifo.put+nmesa->fifo.current)
+
+#define FIRE_RING() do { \
+ if (nmesa->fifo.current!=nmesa->fifo.put) { \
+ nmesa->fifo.put=nmesa->fifo.current; \
+ NV_FIFO_WRITE_PUT(nmesa->fifo.put); \
+ } \
+}while(0)
+
+extern void nouveauWaitForIdle(nouveauContextPtr nmesa);
+extern void nouveauWaitForIdleLocked(nouveauContextPtr nmesa);
+extern GLboolean nouveauFifoInit(nouveauContextPtr nmesa);
+
+#endif /* __NOUVEAU_FIFO_H__ */
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_lock.c b/src/mesa/drivers/dri/nouveau/nouveau_lock.c
new file mode 100644
index 00000000000..c119d14dd75
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_lock.c
@@ -0,0 +1,81 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#include "nouveau_context.h"
+#include "nouveau_lock.h"
+
+#include "drirenderbuffer.h"
+#include "framebuffer.h"
+
+
+/* Update the hardware state. This is called if another context has
+ * grabbed the hardware lock, which includes the X server. This
+ * function also updates the driver's window state after the X server
+ * moves, resizes or restacks a window -- the change will be reflected
+ * in the drawable position and clip rects. Since the X server grabs
+ * the hardware lock when it changes the window state, this routine will
+ * automatically be called after such a change.
+ */
+void nouveauGetLock( nouveauContextPtr nmesa, GLuint flags )
+{
+ __DRIdrawablePrivate *dPriv = nmesa->driDrawable;
+ __DRIscreenPrivate *sPriv = nmesa->driScreen;
+ drm_nouveau_sarea_t *sarea = nmesa->sarea;
+
+ drmGetLock( nmesa->driFd, nmesa->hHWContext, flags );
+
+ /* The window might have moved, so we might need to get new clip
+ * rects.
+ *
+ * NOTE: This releases and regrabs the hw lock to allow the X server
+ * to respond to the DRI protocol request for new drawable info.
+ * Since the hardware state depends on having the latest drawable
+ * clip rects, all state checking must be done _after_ this call.
+ */
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+
+ /* If timestamps don't match, the window has been changed */
+ if (nmesa->lastStamp != dPriv->lastStamp) {
+ struct gl_framebuffer *fb = (struct gl_framebuffer *)dPriv->driverPrivate;
+
+ /* _mesa_resize_framebuffer will take care of calling the renderbuffer's
+ * AllocStorage function if we need more memory to hold it */
+ if (fb->Width != dPriv->w || fb->Height != dPriv->h) {
+ _mesa_resize_framebuffer(nmesa->glCtx, fb, dPriv->w, dPriv->h);
+ /* resize buffers, will call nouveau_window_moved */
+ nouveau_build_framebuffer(nmesa->glCtx, fb);
+ } else {
+ nouveau_window_moved(nmesa->glCtx);
+ }
+
+ nmesa->lastStamp = dPriv->lastStamp;
+ }
+
+ nmesa->numClipRects = dPriv->numClipRects;
+ nmesa->pClipRects = dPriv->pClipRects;
+
+}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_lock.h b/src/mesa/drivers/dri/nouveau/nouveau_lock.h
new file mode 100644
index 00000000000..38bb0014258
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_lock.h
@@ -0,0 +1,69 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#ifndef __NOUVEAU_LOCK_H__
+#define __NOUVEAU_LOCK_H__
+
+#include "nouveau_context.h"
+
+extern void nouveauGetLock( nouveauContextPtr nmesa, GLuint flags );
+
+/*
+ * !!! We may want to separate locks from locks with validation. This
+ * could be used to improve performance for those things commands that
+ * do not do any drawing !!!
+ */
+
+/* Lock the hardware and validate our state.
+ */
+#define LOCK_HARDWARE( nmesa ) \
+ do { \
+ char __ret = 0; \
+ DEBUG_CHECK_LOCK(); \
+ DRM_CAS( nmesa->driHwLock, nmesa->hHWContext, \
+ (DRM_LOCK_HELD | nmesa->hHWContext), __ret ); \
+ if ( __ret ) \
+ nouveauGetLock( nmesa, 0 ); \
+ DEBUG_LOCK(); \
+ } while (0)
+
+/* Unlock the hardware.
+ */
+#define UNLOCK_HARDWARE( nmesa ) \
+ do { \
+ DRM_UNLOCK( nmesa->driFd, \
+ nmesa->driHwLock, \
+ nmesa->hHWContext ); \
+ DEBUG_RESET(); \
+ } while (0)
+
+#define DEBUG_LOCK()
+#define DEBUG_RESET()
+#define DEBUG_CHECK_LOCK()
+
+
+#endif /* __NOUVEAU_LOCK_H__ */
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_msg.h b/src/mesa/drivers/dri/nouveau/nouveau_msg.h
new file mode 100644
index 00000000000..5dea2189c72
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_msg.h
@@ -0,0 +1,67 @@
+/*
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+Copyright 2006 Stephane Marchesin. All Rights Reserved
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ * Nicolai Haehnle <[email protected]>
+ */
+
+
+#ifndef __NOUVEAU_MSG_H__
+#define __NOUVEAU_MSG_H__
+
+#define WARN_ONCE(a, ...) do {\
+ static int warn##__LINE__=1;\
+ if(warn##__LINE__){\
+ fprintf(stderr, "*********************************WARN_ONCE*********************************\n");\
+ fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__);\
+ fprintf(stderr, a, ## __VA_ARGS__);\
+ fprintf(stderr, "***************************************************************************\n");\
+ warn##__LINE__=0;\
+ } \
+ }while(0)
+
+#define MESSAGE(a, ...) do{\
+ fprintf(stderr, "************************************INFO***********************************\n");\
+ fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__); \
+ fprintf(stderr, a, ## __VA_ARGS__);\
+ fprintf(stderr, "***************************************************************************\n");\
+ }while(0)
+
+#define FATAL(a, ...) do{\
+ fprintf(stderr, "***********************************FATAL***********************************\n");\
+ fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__); \
+ fprintf(stderr, a, ## __VA_ARGS__);\
+ fprintf(stderr, "***************************************************************************\n");\
+ }while(0)
+
+#endif /* __NOUVEAU_MSG_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.c b/src/mesa/drivers/dri/nouveau/nouveau_object.c
new file mode 100644
index 00000000000..1558f2963df
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_object.c
@@ -0,0 +1,92 @@
+
+#include "nouveau_fifo.h"
+#include "nouveau_object.h"
+#include "nouveau_reg.h"
+
+
+GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa, int handle, int class, uint32_t flags, uint32_t dma_in, uint32_t dma_out, uint32_t dma_notifier)
+{
+ drm_nouveau_object_init_t cto;
+ int ret;
+
+ cto.handle = handle;
+ cto.class = class;
+ cto.flags = flags;
+ cto.dma0= dma_in;
+ cto.dma1= dma_out;
+ cto.dma_notifier = dma_notifier;
+ ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_OBJECT_INIT, &cto, sizeof(cto));
+
+ return ret == 0;
+}
+
+GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
+ uint32_t handle,
+ uint32_t offset,
+ uint32_t size,
+ int target,
+ int access)
+{
+ drm_nouveau_dma_object_init_t dma;
+ int ret;
+
+ dma.handle = handle;
+ dma.target = target;
+ dma.access = access;
+ dma.offset = offset;
+ dma.size = size;
+ ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_DMA_OBJECT_INIT,
+ &dma, sizeof(dma));
+ return ret == 0;
+}
+
+void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle)
+{
+ BEGIN_RING_SIZE(subchannel, 0, 1);
+ OUT_RING(handle);
+}
+
+void nouveauObjectInit(nouveauContextPtr nmesa)
+{
+#ifdef NOUVEAU_RING_DEBUG
+ return;
+#endif
+
+/* We need to know vram size.. and AGP size (and even if the card is AGP..) */
+ nouveauCreateDmaObject( nmesa, NvDmaFB,
+ 0, (256*1024*1024),
+ 0 /*NV_DMA_TARGET_FB*/, 0 /*NV_DMA_ACCESS_RW*/);
+ nouveauCreateDmaObject( nmesa, NvDmaAGP,
+ nmesa->agp_phys, (128*1024*1024),
+ 3 /* AGP */, 0 /* RW */);
+
+ nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d,
+ 0, 0, 0, 0);
+ nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D,
+ 0, 0, 0, 0);
+ nouveauCreateContextObject(nmesa, NvImageBlit, NV10_IMAGE_BLIT,
+ NV_DMA_CONTEXT_FLAGS_PATCH_SRCCOPY, 0, 0, 0);
+ nouveauCreateContextObject(nmesa, NvMemFormat,
+ NV_MEMORY_TO_MEMORY_FORMAT,
+ 0, 0, 0, 0);
+
+#ifdef ALLOW_MULTI_SUBCHANNEL
+ nouveauObjectOnSubchannel(nmesa, NvSubCtxSurf2D, NvCtxSurf2D);
+ BEGIN_RING_SIZE(NvSubCtxSurf2D, NV10_CONTEXT_SURFACES_2D_SET_DMA_IN_MEMORY0, 2);
+ OUT_RING(NvDmaFB);
+ OUT_RING(NvDmaFB);
+
+ nouveauObjectOnSubchannel(nmesa, NvSubImageBlit, NvImageBlit);
+ BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_CONTEXT_SURFACES_2D, 1);
+ OUT_RING(NvCtxSurf2D);
+ BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_OPERATION, 1);
+ OUT_RING(3); /* SRCCOPY */
+
+ nouveauObjectOnSubchannel(nmesa, NvSubMemFormat, NvMemFormat);
+#endif
+
+ nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
+}
+
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.h b/src/mesa/drivers/dri/nouveau/nouveau_object.h
new file mode 100644
index 00000000000..b1ff5a5d0dc
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_object.h
@@ -0,0 +1,41 @@
+#ifndef __NOUVEAU_OBJECT_H__
+#define __NOUVEAU_OBJECT_H__
+
+#include "nouveau_context.h"
+
+#define ALLOW_MULTI_SUBCHANNEL
+
+void nouveauObjectInit(nouveauContextPtr nmesa);
+
+enum DMAObjects {
+ Nv3D = 0x80000019,
+ NvCtxSurf2D = 0x80000020,
+ NvImageBlit = 0x80000021,
+ NvMemFormat = 0x80000022,
+ NvDmaFB = 0xD0FB0001,
+ NvDmaAGP = 0xD0AA0001,
+ NvSyncNotify = 0xD0000001
+};
+
+enum DMASubchannel {
+ NvSubCtxSurf2D = 0,
+ NvSubImageBlit = 1,
+ NvSubMemFormat = 2,
+ NvSub3D = 7,
+};
+
+extern void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle);
+
+extern GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa,
+ int handle, int class,
+ uint32_t flags,
+ uint32_t dma_in,
+ uint32_t dma_out,
+ uint32_t dma_notifier);
+extern GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
+ uint32_t handle,
+ uint32_t offset,
+ uint32_t size,
+ int target,
+ int access);
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_reg.h b/src/mesa/drivers/dri/nouveau/nouveau_reg.h
new file mode 100644
index 00000000000..8758b538c85
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_reg.h
@@ -0,0 +1,1505 @@
+/*
+ Autogenerated file, do not edit !
+
+**************************************************************************
+
+ Copyright (C) 2006 :
+ Dmitry Baryshkov,
+ Laurent Carlier,
+ Matthieu Castet,
+ Dawid Gajownik,
+ Jeremy Kolb,
+ Stephane Loeuillet,
+ Patrice Mandin,
+ Stephane Marchesin,
+ Serge Martin,
+ Sylvain Munaut,
+ Ben Skeggs,
+ Erik Waling,
+ koala_br,
+ sturmflut.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 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.
+
+**************************************************************************
+
+ Created from objects.c rev. 1.398
+*/
+
+#ifndef _NOUVEAU_REG_H
+#define _NOUVEAU_REG_H
+
+/******************************************
+Object NV01_CONTEXT_CLIP_RECTANGLE used on: NV03 NV04 NV10 NV15 NV20 NV40 G70
+*/
+#define NV01_CONTEXT_CLIP_RECTANGLE 0x00000019
+# define NV01_CONTEXT_CLIP_RECTANGLE_SET_POINT 0x00000300 /* Parameters: x y */
+# define NV01_CONTEXT_CLIP_RECTANGLE_SET_SIZE 0x00000304 /* Parameters: width height */
+
+/******************************************
+Object NV_MEMORY_TO_MEMORY_FORMAT used on: NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV_MEMORY_TO_MEMORY_FORMAT 0x00000039
+# define NV_MEMORY_TO_MEMORY_FORMAT_NOP 0x00000100
+# define NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104
+# define NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY 0x00000180
+# define NV_MEMORY_TO_MEMORY_FORMAT_OBJECT_IN 0x00000184
+# define NV_MEMORY_TO_MEMORY_FORMAT_OBJECT_OUT 0x00000188
+# define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c
+# define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_OUT 0x00000310
+# define NV_MEMORY_TO_MEMORY_FORMAT_PITCH_IN 0x00000314
+# define NV_MEMORY_TO_MEMORY_FORMAT_PITCH_OUT 0x00000318
+# define NV_MEMORY_TO_MEMORY_FORMAT_LINE_LENGTH_IN 0x0000031c
+# define NV_MEMORY_TO_MEMORY_FORMAT_LINE_COUNT 0x00000320
+# define NV_MEMORY_TO_MEMORY_FORMAT_FORMAT 0x00000324 /* Parameters: src_inc dst_inc */
+# define NV_MEMORY_TO_MEMORY_FORMAT_BUF_NOTIFY 0x00000328
+
+/******************************************
+Object NV03_PRIMITIVE_RASTER_OP used on: NV03 NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV03_PRIMITIVE_RASTER_OP 0x00000043
+# define NV03_PRIMITIVE_RASTER_OP_NOTIFY 0x00000100
+# define NV03_PRIMITIVE_RASTER_OP_DMA_NOTIFY 0x00000180
+# define NV03_PRIMITIVE_RASTER_OP_LOGIC_OP 0x00000300 /* Parameters: logic_op */
+
+/******************************************
+Object NV04_GDI_RECTANGLE_TEXT used on: NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV04_GDI_RECTANGLE_TEXT 0x0000004a
+# define NV04_GDI_RECTANGLE_TEXT_SET_DMA_NOTIFY 0x00000180
+# define NV04_GDI_RECTANGLE_TEXT_PATTERN 0x00000188
+# define NV04_GDI_RECTANGLE_TEXT_ROP5 0x0000018c
+# define NV04_GDI_RECTANGLE_TEXT_SURFACE 0x00000198
+# define NV04_GDI_RECTANGLE_TEXT_OPERATION 0x000002fc
+# define NV04_GDI_RECTANGLE_TEXT_FORMAT 0x00000300
+# define NV04_GDI_RECTANGLE_TEXT_BLOCK_LEVEL1_TL 0x000005f4 /* Parameters: left top */
+# define NV04_GDI_RECTANGLE_TEXT_BLOCK_LEVEL1_BR 0x000005f8 /* Parameters: right bottom */
+# define NV04_GDI_RECTANGLE_TEXT_FILL_VALUE 0x000005fc
+# define NV04_GDI_RECTANGLE_TEXT_BLOCK_LEVEL2_TL 0x00000600 /* Parameters: left top */
+# define NV04_GDI_RECTANGLE_TEXT_BLOCK_LEVEL2_BR 0x00000604 /* Parameters: right bottom */
+
+/******************************************
+Object NV04_SWIZZLED_SURFACE used on: NV04 NV10 NV15
+*/
+#define NV04_SWIZZLED_SURFACE 0x00000052
+# define NV04_SWIZZLED_SURFACE_DMA_NOTIFY 0x00000180
+# define NV04_SWIZZLED_SURFACE_DMA_IMAGE 0x00000184
+# define NV04_SWIZZLED_SURFACE_FORMAT 0x00000300 /* Parameters: log2(height) log2(width) color */
+# define NV04_SWIZZLED_SURFACE_OFFSET 0x00000304
+
+/******************************************
+Object NV04_CONTEXT_SURFACES_3D used on: NV04
+*/
+#define NV04_CONTEXT_SURFACES_3D 0x00000053
+# 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 /* Parameters: x width */
+# define NV04_CONTEXT_SURFACES_3D_CLIP_VERTICAL 0x000002fc /* Parameters: y height */
+# define NV04_CONTEXT_SURFACES_3D_FORMAT 0x00000300 /* Parameters: color type width height */
+# define NV04_CONTEXT_SURFACES_3D_CLIP_SIZE 0x00000304 /* Parameters: width height */
+# define NV04_CONTEXT_SURFACES_3D_PITCH 0x00000308 /* Parameters: color zeta */
+# define NV04_CONTEXT_SURFACES_3D_OFFSET_COLOR 0x0000030c
+# define NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA 0x00000310
+
+/******************************************
+Object NV04_DX5_TEXTURED_TRIANGLE used on: NV04
+*/
+#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_1 0x00000184
+# define NV04_DX5_TEXTURED_TRIANGLE_DMA_2 0x00000188
+# define NV04_DX5_TEXTURED_TRIANGLE_SURFACE 0x0000018c
+# define NV04_DX5_TEXTURED_TRIANGLE_COLOR_KEY 0x00000300
+# define NV04_DX5_TEXTURED_TRIANGLE_TEXTURE_OFFSET 0x00000304
+# define NV04_DX5_TEXTURED_TRIANGLE_TEXTURE_FORMAT 0x00000308 /* Parameters: color mipmaps log(u) log(v) wrap_s wrap_t */
+# define NV04_DX5_TEXTURED_TRIANGLE_TEXTURE_FILTER 0x0000030c /* Parameters: magfilter minfilter lodbias */
+# define NV04_DX5_TEXTURED_TRIANGLE_BLEND 0x00000310 /* Parameters: texture benable dst src */
+# define NV04_DX5_TEXTURED_TRIANGLE_CONTROL 0x00000314 /* Parameters: alpharef alphafunc alphaenable zenable zwrite zfunc cullmode */
+# define NV04_DX5_TEXTURED_TRIANGLE_FOG_COLOR 0x00000318
+# define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX( d) (0x00000400 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SY( d) (0x00000404 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SZ( d) (0x00000408 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_INV_W( d) (0x0000040c + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_COLOR( d) (0x00000410 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_SPECULAR( d) (0x00000414 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_TEXTURE_S( d) (0x00000418 + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_TEXTURE_T( d) (0x0000041c + d * 0x0020)
+# define NV04_DX5_TEXTURED_TRIANGLE_DRAW 0x00000600 /* Parameters: v0 v1 v2 v3 v4 v5 */
+
+/******************************************
+Object NV04_DX6_MULTITEX_TRIANGLE used on: NV04 NV10 NV15
+*/
+#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_1 0x00000184
+# define NV04_DX6_MULTITEX_TRIANGLE_DMA_2 0x00000188
+# define NV04_DX6_MULTITEX_TRIANGLE_SURFACE 0x0000018c
+# define NV04_DX6_MULTITEX_TRIANGLE_OFFSET0 0x00000308
+# define NV04_DX6_MULTITEX_TRIANGLE_OFFSET1 0x0000030c
+# define NV04_DX6_MULTITEX_TRIANGLE_FORMAT0 0x00000310 /* Parameters: color mipmaps log(u) log(v) wrap_s wrap_t */
+# define NV04_DX6_MULTITEX_TRIANGLE_FORMAT1 0x00000314 /* Parameters: color mipmaps log(u) log(v) wrap_s wrap_t */
+# define NV04_DX6_MULTITEX_TRIANGLE_FILTER0 0x00000318 /* Parameters: magfilter minfilter lodbias */
+# define NV04_DX6_MULTITEX_TRIANGLE_FILTER1 0x0000031c /* Parameters: magfilter minfilter lodbias */
+# define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_ALPHA 0x00000320
+# define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_0_COLOR 0x00000324
+# define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_ALPHA 0x0000032c
+# define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_1_COLOR 0x00000330
+# define NV04_DX6_MULTITEX_TRIANGLE_COMBINE_FACTOR 0x00000334
+# define NV04_DX6_MULTITEX_TRIANGLE_BLEND 0x00000338 /* Parameters: benable dst src */
+# define NV04_DX6_MULTITEX_TRIANGLE_CONTROL0 0x0000033c /* Parameters: red_write green_write blue_write alpha_write alpha_write stencil_write alpharef alphafunc alphaenable zenable zwrite zfunc cullmode */
+# define NV04_DX6_MULTITEX_TRIANGLE_CONTROL1 0x00000340 /* Parameters: stencil_enable stencil_mask_write stencil_mask_read stencilref stencilfunc */
+# define NV04_DX6_MULTITEX_TRIANGLE_CONTROL2 0x00000344 /* Parameters: stencil_fail stencil_zfail stencil_zpass */
+# define NV04_DX6_MULTITEX_TRIANGLE_FOG_COLOR 0x00000348
+# define NV04_DX6_MULTITEX_TRIANGLE_TLVERTEX_SX( d) (0x00000400 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TLVERTEX_SY( d) (0x00000404 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TLVERTEX_SZ( d) (0x00000408 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_INV_W( d) (0x0000040c + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_COLOR( d) (0x00000410 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_SPECULAR( d) (0x00000414 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TEXTURE0_S( d) (0x00000418 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TEXTURE0_T( d) (0x0000041c + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TEXTURE1_S( d) (0x00000420 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_TEXTURE1_T( d) (0x00000424 + d * 0x0028)
+# define NV04_DX6_MULTITEX_TRIANGLE_DRAW 0x00000540 /* Parameters: v0 v1 v2 v3 v4 v5 */
+
+/******************************************
+Object NV04_COLOR_KEY used on: NV04 NV10 NV15 NV20 NV40
+*/
+#define NV04_COLOR_KEY 0x00000057
+# define NV04_COLOR_KEY_SET_DMA_NOTIFY 0x00000180
+# define NV04_COLOR_KEY_FORMAT 0x00000300
+# define NV04_COLOR_KEY_VALUE 0x00000304
+
+/******************************************
+Object NV04_SOLID_LINE used on: NV04
+*/
+#define NV04_SOLID_LINE 0x0000005c
+# define NV04_SOLID_LINE_CLIP_RECTANGLE 0x00000184
+# define NV04_SOLID_LINE_PATTERN 0x00000188
+# define NV04_SOLID_LINE_ROP 0x0000018c
+# define NV04_SOLID_LINE_SURFACE 0x00000198
+# define NV04_SOLID_LINE_OPERATION 0x000002fc
+# define NV04_SOLID_LINE_COLOR_FORMAT 0x00000300
+# define NV04_SOLID_LINE_COLOR_VALUE 0x00000304
+# define NV04_SOLID_LINE_START 0x00000400 /* Parameters: x y */
+# define NV04_SOLID_LINE_END 0x00000400 /* Parameters: x y */
+
+/******************************************
+Object NV04_UNK005E used on: NV04
+*/
+#define NV04_UNK005E 0x0000005e
+# define NV04_UNK005E_SET_SURFACE 0x00000198
+# define NV04_UNK005E_UNK02fc 0x000002fc
+# define NV04_UNK005E_UNK0300 0x00000300
+# define NV04_UNK005E_COUNTER 0x00000304
+
+/******************************************
+Object NV05_SCALED_IMAGE_FROM_MEMORY used on: NV04
+*/
+#define NV05_SCALED_IMAGE_FROM_MEMORY 0x00000063
+# define NV05_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000198
+# define NV05_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION 0x000002fc
+# define NV05_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304
+
+/******************************************
+Object NV04_SCALED_IMAGE_FROM_MEMORY used on: NV04
+*/
+#define NV04_SCALED_IMAGE_FROM_MEMORY 0x00000077
+# define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_NOTIFY 0x00000180
+# define NV04_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE 0x00000184
+# define NV04_SCALED_IMAGE_FROM_MEMORY_SURFACE 0x00000198
+# define NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT 0x00000300
+# define NV04_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304
+# define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_POS 0x00000308 /* Parameters: x y */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c /* Parameters: width height */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_POS 0x00000310 /* Parameters: x y */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE 0x00000314 /* Parameters: width height */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_DU_DX 0x00000318 /* Parameters: int frac*0x100000 */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_DV_DY 0x0000031c /* Parameters: int frac*0x100000 */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_SIZE 0x00000400 /* Parameters: width height */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT 0x00000404 /* Parameters: pitch origin filter */
+# define NV04_SCALED_IMAGE_FROM_MEMORY_OFFSET 0x00000408
+# define NV04_SCALED_IMAGE_FROM_MEMORY_POINT 0x0000040c /* Parameters: u_int u_frac*0x10 v_int v_frac*0x10 */
+
+/******************************************
+Object NV_IMAGE_FROM_CPU used on: NV04
+*/
+#define NV_IMAGE_FROM_CPU 0x00000061
+# define NV_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180
+# define NV_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x00000188
+# define NV_IMAGE_FROM_CPU_PATTERN 0x0000018c
+# define NV_IMAGE_FROM_CPU_ROP 0x00000190
+# define NV_IMAGE_FROM_CPU_SURFACE 0x0000019c
+# define NV_IMAGE_FROM_CPU_OPERATION 0x000002fc
+# define NV_IMAGE_FROM_CPU_FORMAT 0x00000300
+
+/******************************************
+Object NV05_IMAGE_FROM_CPU used on: NV04
+*/
+#define NV05_IMAGE_FROM_CPU 0x00000065
+# define NV05_IMAGE_FROM_CPU_DMA_NOTIFY 0x00000180
+# define NV05_IMAGE_FROM_CPU_CLIP_RECTANGLE 0x00000188
+# define NV05_IMAGE_FROM_CPU_PATTERN 0x0000018c
+# define NV05_IMAGE_FROM_CPU_ROP 0x00000190
+# define NV05_IMAGE_FROM_CPU_SURFACE 0x0000019c
+# define NV05_IMAGE_FROM_CPU_OPERATION 0x000002fc
+# define NV05_IMAGE_FROM_CPU_FORMAT 0x00000300
+# define NV05_IMAGE_FROM_CPU_POINT 0x00000304 /* Parameters: x y */
+# define NV05_IMAGE_FROM_CPU_SIZE_OUT 0x00000308 /* Parameters: x y */
+# define NV05_IMAGE_FROM_CPU_SIZE_IN 0x0000030c /* Parameters: x y */
+# define NV05_IMAGE_FROM_CPU_COLOR( d) (0x00000400 + d * 0x0004)
+
+/******************************************
+Object NV_IMAGE_BLIT used on: NV04 NV10 NV15 NV20 NV40
+*/
+#define NV_IMAGE_BLIT 0x0000005f
+# define NV_IMAGE_BLIT_DMA_NOTIFY 0x00000180
+# define NV_IMAGE_BLIT_COLOR_KEY 0x00000184
+# define NV_IMAGE_BLIT_CLIP_RECTANGLE 0x00000188
+# define NV_IMAGE_BLIT_PATTERN 0x0000018c
+# define NV_IMAGE_BLIT_ROP5 0x00000190
+# define NV_IMAGE_BLIT_SURFACE 0x0000019c
+# define NV_IMAGE_BLIT_OPERATION 0x000002fc
+# define NV_IMAGE_BLIT_POINT_IN 0x00000300 /* Parameters: x y */
+# define NV_IMAGE_BLIT_POINT_OUT 0x00000304 /* Parameters: x y */
+# define NV_IMAGE_BLIT_SIZE 0x00000308 /* Parameters: width height */
+
+/******************************************
+Object NV10_TCL_PRIMITIVE_3D used on: NV10
+*/
+#define NV10_TCL_PRIMITIVE_3D 0x00000056
+
+/******************************************
+Object NV17_TCL_PRIMITIVE_3D used on: NV15
+*/
+#define NV17_TCL_PRIMITIVE_3D 0x00000099
+
+/******************************************
+Object NV11_TCL_PRIMITIVE_3D used on: NV15
+*/
+#define NV11_TCL_PRIMITIVE_3D 0x00000096
+# define NV10_TCL_PRIMITIVE_3D_NOP 0x00000100
+# define NV10_TCL_PRIMITIVE_3D_NOTIFY 0x00000104
+# define NV10_TCL_PRIMITIVE_3D_SET_DMA_NOTIFY 0x00000180
+# define NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY0 0x00000184
+# define NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY1 0x00000188
+# define NV10_TCL_PRIMITIVE_3D_SET_DISPLAY_LIST 0x0000018c
+# define NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY2 0x00000194
+# define NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY3 0x00000198
+# define NV17_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY4 0x000001ac
+# define NV17_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY5 0x000001b0
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ 0x00000200 /* Parameters: width x */
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_VERT 0x00000204 /* Parameters: height y */
+# define NV10_TCL_PRIMITIVE_3D_BUFFER_FORMAT 0x00000208 /* Parameters: type color */
+# define NV10_TCL_PRIMITIVE_3D_BUFFER_PITCH 0x0000020c /* Parameters: depth/stencil buffer pitch color buffer pitch */
+# define NV10_TCL_PRIMITIVE_3D_COLOR_OFFSET 0x00000210
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_OFFSET 0x00000214
+# define NV10_TCL_PRIMITIVE_3D_TX_OFFSET(d) (0x00000218 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_TX_FORMAT(d) (0x00000220 + d * 0x0004) /* Parameters: wrap_t wrap_s log2(height) log2(width) lod npot format cube_map */
+# define NV10_TCL_PRIMITIVE_3D_TX_ENABLE(d) (0x00000228 + d * 0x0004) /* Parameters: enable anisotropy */
+# define NV10_TCL_PRIMITIVE_3D_TX_NPOT_PITCH(d) (0x00000230 + d * 0x0004) /* Parameters: pitch */
+# define NV10_TCL_PRIMITIVE_3D_TX_NPOT_SIZE(d) (0x00000240 + d * 0x0004) /* Parameters: width height */
+# define NV10_TCL_PRIMITIVE_3D_TX_FILTER(d) (0x00000248 + d * 0x0004) /* Parameters: mag_filter min_filter */
+# define NV10_TCL_PRIMITIVE_3D_TX_PALETTE_OFFSET(d) (0x00000250 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_TX_MATRIX_ENABLE(d) (0x000003e0 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_TX_MATRIX(x,y) (0x00000540 + y * 0x0010 + x * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_RC_IN_ALPHA(d) (0x00000260 + d * 0x0004) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV10_TCL_PRIMITIVE_3D_RC_IN_RGB(d) (0x00000268 + d * 0x0004) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV10_TCL_PRIMITIVE_3D_RC_OUT_ALPHA(d) (0x00000278 + d * 0x0004) /* Parameters: scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV10_TCL_PRIMITIVE_3D_RC_OUT_RGB(d) (0x00000280 + d * 0x0004) /* Parameters: rc1_tx_units_enabled rc1_rc_enabled scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV10_TCL_PRIMITIVE_3D_RC_COLOR0 0x00000270 /* Parameters: a r g b */
+# define NV10_TCL_PRIMITIVE_3D_RC_COLOR1 0x00000274 /* Parameters: a r g b */
+# define NV10_TCL_PRIMITIVE_3D_RC_FINAL0 0x00000288 /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV10_TCL_PRIMITIVE_3D_RC_FINAL1 0x0000028c /* Parameters: vare_mapping vare_component_usage vare_input varf_mapping varf_component_usage varf_input varg_mapping varg_component_usage varg_input color_sum_clamp */
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_MODEL 0x00000294 /* Parameters: local_viewer color_control */
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_ENABLE 0x00000298 /* Parameters: specular diffuse ambient emission */
+# define NV10_TCL_PRIMITIVE_3D_FOG_MODE 0x0000029c
+# define NV10_TCL_PRIMITIVE_3D_FOG_COORD_DIST 0x000002a0
+# define NV10_TCL_PRIMITIVE_3D_FOG_ENABLE 0x000002a4
+# define NV10_TCL_PRIMITIVE_3D_FOG_COLOR 0x000002a8 /* Parameters: a b g r */
+# define NV17_TCL_PRIMITIVE_3D_COLOR_MASK_ENABLE 0x000002bc
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(d) (0x000002c0 + d * 0x0004) /* Parameters: x2 x1 */
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(d) (0x000002e0 + d * 0x0004) /* Parameters: y2 y1 */
+# define NV10_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE 0x00000300
+# define NV10_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE 0x00000304
+# define NV10_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE 0x00000308
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE 0x0000030c
+# define NV10_TCL_PRIMITIVE_3D_DITHER_ENABLE 0x00000310
+# define NV10_TCL_PRIMITIVE_3D_LIGHTING_ENABLE 0x00000314
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETERS_ENABLE 0x00000318
+# define NV10_TCL_PRIMITIVE_3D_POINT_SMOOTH_ENABLE 0x0000031c
+# define NV10_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE 0x00000320
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE 0x00000324
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_WEIGHT_ENABLE 0x00000328
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_ENABLE 0x0000032c
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE 0x00000330
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE 0x00000334
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE 0x00000338
+# define NV10_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC 0x0000033c
+# define NV10_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF 0x00000340
+# define NV10_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC 0x00000344
+# define NV10_TCL_PRIMITIVE_3D_BLEND_FUNC_DST 0x00000348
+# define NV10_TCL_PRIMITIVE_3D_BLEND_COLOR 0x0000034c /* Parameters: a r g b */
+# define NV10_TCL_PRIMITIVE_3D_BLEND_EQUATION 0x00000350
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_FUNC 0x00000354
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MASK 0x00000358 /* Parameters: a r g b */
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE 0x0000035c
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_MASK 0x00000360
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_FUNC_FUNC 0x00000364
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_FUNC_REF 0x00000368
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_FUNC_MASK 0x0000036c
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_OP_FAIL 0x00000370
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_OP_ZFAIL 0x00000374
+# define NV10_TCL_PRIMITIVE_3D_STENCIL_OP_ZPASS 0x00000378
+# define NV10_TCL_PRIMITIVE_3D_SHADE_MODEL 0x0000037c
+# define NV10_TCL_PRIMITIVE_3D_LINE_WIDTH 0x00000380
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR 0x00000384
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_UNITS 0x00000388
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT 0x0000038c
+# define NV10_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK 0x00000390
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR 0x00000394
+# define NV10_TCL_PRIMITIVE_3D_DEPTH_RANGE_FAR 0x00000398
+# define NV10_TCL_PRIMITIVE_3D_CULL_FACE 0x0000039c
+# define NV10_TCL_PRIMITIVE_3D_FRONT_FACE 0x000003a0
+# define NV10_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE 0x000003a4
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_R 0x000003a8
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_G 0x000003ac
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_B 0x000003b0
+# define NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_A 0x000003b4
+# define NV10_TCL_PRIMITIVE_3D_COLOR_CONTROL 0x000003b8 /* Parameters: color_control */
+# define NV10_TCL_PRIMITIVE_3D_ENABLED_LIGHTS 0x000003bc /* Parameters: light 7 light 6 light 5 light 4 light 3 light 2 light 1 light 0 */
+# define NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE( d) (0x000003c0 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_VIEW_MATRIX_ENABLE 0x000003e8 /* Parameters: projection modelview0 modelview1 */
+# define NV10_TCL_PRIMITIVE_3D_POINT_SIZE 0x000003ec
+# define NV10_TCL_PRIMITIVE_3D_MODELVIEW0_MATRIX( d) (0x00000400 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_MODELVIEW1_MATRIX( d) (0x00000440 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW0_MATRIX( d) (0x00000480 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW1_MATRIX( d) (0x000004c0 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_PROJECTION_MATRIX( d) (0x00000500 + d * 0x0004)
+# define NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(d) (0x00000600 + d * 0x0010)
+# define NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_B(d) (0x00000604 + d * 0x0010)
+# define NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_C(d) (0x00000608 + d * 0x0010)
+# define NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_D(d) (0x0000060c + d * 0x0010)
+# define NV10_TCL_PRIMITIVE_3D_FOG_EQUATION_CONSTANT 0x00000680
+# define NV10_TCL_PRIMITIVE_3D_FOG_EQUATION_LINEAR 0x00000684
+# define NV10_TCL_PRIMITIVE_3D_FOG_EQUATION_QUADRATIC 0x00000688
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_A 0x000006a0
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_B 0x000006a4
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_C 0x000006a8
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_D 0x000006ac
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_E 0x000006b0
+# define NV10_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_F 0x000006b4
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000006c4
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000006c8
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000006cc
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X 0x000006e8
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_Y 0x000006ec
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_Z 0x000006f0
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_W 0x000006f4
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_A 0x000006f8
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_B 0x000006fc
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_C 0x00000700
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_D 0x00000704
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_E 0x00000708
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_F 0x0000070c
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_G 0x00000710
+# define NV10_TCL_PRIMITIVE_3D_POINT_PARAMETER_H 0x00000714
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(d) (0x00000800 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(d) (0x00000804 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(d) (0x00000808 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(d) (0x0000080c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(d) (0x00000810 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(d) (0x00000814 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(d) (0x00000818 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(d) (0x0000081c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(d) (0x00000820 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_X(d) (0x00000828 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Y(d) (0x0000082c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Z(d) (0x00000830 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_X(d) (0x00000834 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Y(d) (0x00000838 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Z(d) (0x0000083c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(d) (0x00000840 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_EXPONENT(d) (0x00000844 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_B(d) (0x00000848 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(d) (0x0000084c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Y(d) (0x00000850 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Z(d) (0x00000854 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_C(d) (0x00000858 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(d) (0x0000085c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_POSITION_Y(d) (0x00000860 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_POSITION_Z(d) (0x00000864 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(d) (0x00000868 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(d) (0x0000086c + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(d) (0x00000870 + d * 0x0080)
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_3F_X 0x00000c00
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Y 0x00000c04
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Z 0x00000c08
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_4F_X 0x00000c18
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Y 0x00000c1c
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Z 0x00000c20
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_POS_4F_W 0x00000c24
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_X 0x00000c30
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Y 0x00000c34
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Z 0x00000c38
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_XY 0x00000c40 /* Parameters: y x */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_Z 0x00000c44 /* Parameters: z */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_4F_R 0x00000c50
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_4F_G 0x00000c54
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_4F_B 0x00000c58
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_4F_A 0x00000c5c
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_3F_R 0x00000c60
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_3F_G 0x00000c64
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_3F_B 0x00000c68
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL_4I 0x00000c6c /* Parameters: a b g r */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_R 0x00000c80
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_G 0x00000c84
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_B 0x00000c88
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_COL2_3I 0x00000c8c /* Parameters: a b g r */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_S 0x00000c90
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_T 0x00000c94
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_2I 0x00000c98 /* Parameters: t s */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_S 0x00000ca0
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_T 0x00000ca4
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_R 0x00000ca8
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_Q 0x00000cac
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_ST 0x00000cb0 /* Parameters: t s */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_RQ 0x00000cb4 /* Parameters: q r */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_S 0x00000cb8
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_T 0x00000cbc
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_2I 0x00000cc0 /* Parameters: t s */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_S 0x00000cc8
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_T 0x00000ccc
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_R 0x00000cd0
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_Q 0x00000cd4
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_ST 0x00000cd8 /* Parameters: t s */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_RQ 0x00000cdc /* Parameters: q r */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_FOG_1F 0x00000ce0
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_WGH_1F 0x00000ce4
+# define NV10_TCL_PRIMITIVE_3D_EDGEFLAG_ENABLE 0x00000cec
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ATTR( d) (0x00000d04 + d * 0x0008) /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_VALIDATE 0x00000cf0
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_POS 0x00000d00
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_POS 0x00000d04 /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_COL 0x00000d08
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_COL 0x00000d0c /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_COL2 0x00000d10
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_COL2 0x00000d14 /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_TX0 0x00000d18
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_TX0 0x00000d1c /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_TX1 0x00000d20
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_TX1 0x00000d24 /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_NOR 0x00000d28
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_NOR 0x00000d2c /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_WGH 0x00000d30
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_WGH 0x00000d34 /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_OFFSET_FOG 0x00000d38
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_FORMAT_FOG 0x00000d3c /* Parameters: stride fields type */
+# define NV10_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE 0x00000d40
+# define NV10_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP 0x00000d44
+# define NV17_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_PITCH 0x00000d5c /* Parameters: pitch */
+# define NV17_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_OFFSET 0x00000d60
+# define NV17_TCL_PRIMITIVE_3D_LMA_DEPTH_FILL_VALUE 0x00000d68
+# define NV17_TCL_PRIMITIVE_3D_LMA_DEPTH_CLEAR_ENABLE 0x00000d6c
+# define NV10_TCL_PRIMITIVE_3D_BEGIN_END 0x00000dfc
+# define NV10_TCL_PRIMITIVE_3D_INDEX_DATA 0x00000e00 /* Parameters: index1 index0 */
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_BUFFER_BEGIN_END 0x000013fc
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_BUFFER_DRAW_ARRAYS 0x00001400 /* Parameters: count-1 first */
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X 0x00001638
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_Y 0x0000163c
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_Z 0x00001640
+# define NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_W 0x00001644
+# define NV17_TCL_PRIMITIVE_3D_LMA_DEPTH_ENABLE 0x00001658
+# define NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_DATA 0x00001800
+
+/******************************************
+Object NV10_IMAGE_FROM_CPU used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_IMAGE_FROM_CPU 0x0000008a
+# define NV10_IMAGE_FROM_CPU_SET_DMA_NOTIFY 0x00000180
+# define NV10_IMAGE_FROM_CPU_SET_CONTEXT_CLIP_RECTANGLE 0x00000188
+# define NV10_IMAGE_FROM_CPU_SET_IMAGE_PATTERN 0x0000018c
+# define NV10_IMAGE_FROM_CPU_SET_RASTER_OP 0x00000190
+# define NV10_IMAGE_FROM_CPU_SET_CONTEXT_SURFACES_2D 0x0000019c
+# define NV10_IMAGE_FROM_CPU_OPERATION 0x000002fc
+# define NV10_IMAGE_FROM_CPU_FORMAT 0x00000300
+# define NV10_IMAGE_FROM_CPU_POINT 0x00000304 /* Parameters: x y */
+# define NV10_IMAGE_FROM_CPU_SIZE_OUT 0x00000308 /* Parameters: width height */
+# define NV10_IMAGE_FROM_CPU_SIZE_IN 0x0000030c /* Parameters: width height */
+# define NV10_IMAGE_FROM_CPU_HLINE 0x00000400
+
+/******************************************
+Object NV10_PRIMITIVE_2D used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_PRIMITIVE_2D 0x0000007b
+# define NV10_PRIMITIVE_2D_SET_DMA_NOTIFY 0x00000180
+# define NV10_PRIMITIVE_2D_SET_SURFACE 0x00000184
+# define NV10_PRIMITIVE_2D_SET_FORMAT 0x00000300
+# define NV10_PRIMITIVE_2D_SET_POINT 0x00000304 /* Parameters: x y */
+# define NV10_PRIMITIVE_2D_SET_SIZE 0x00000308 /* Parameters: width height */
+# define NV10_PRIMITIVE_2D_SET_CLIP_HORIZ 0x0000030c /* Parameters: width x */
+# define NV10_PRIMITIVE_2D_SET_CLIP_VERT 0x00000310 /* Parameters: height y */
+# define NV10_PRIMITIVE_2D_SET_DATA( d) (0x00000400 + d * 0x0004)
+
+/******************************************
+Object NV10_IMAGE_BLIT used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_IMAGE_BLIT 0x0000009f
+# define NV10_IMAGE_BLIT_NOP 0x00000100
+# define NV10_IMAGE_BLIT_NOTIFY 0x00000104
+# define NV10_IMAGE_BLIT_SET_DMA_NOTIFY 0x00000180
+# define NV10_IMAGE_BLIT_SET_CONTEXT_CLIP_RECTANGLE 0x00000188
+# define NV10_IMAGE_BLIT_SET_IMAGE_PATTERN 0x0000018c
+# define NV10_IMAGE_BLIT_SET_RASTER_OP 0x00000190
+# define NV10_IMAGE_BLIT_SET_CONTEXT_SURFACES_2D 0x0000019c
+# define NV10_IMAGE_BLIT_SET_OPERATION 0x000002fc
+# define NV10_IMAGE_BLIT_SET_POINT 0x00000300 /* Parameters: x y */
+# define NV10_IMAGE_BLIT_SET_PITCH 0x00000304 /* Parameters: skip */
+# define NV10_IMAGE_BLIT_SET_SIZE 0x00000308 /* Parameters: width height */
+
+/******************************************
+Object NV10_VIDEO_DISPLAY used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_VIDEO_DISPLAY 0x0000007c
+# define NV10_VIDEO_DISPLAY_COUNTER 0x00000050
+# define NV10_VIDEO_DISPLAY_SET_DMA_FROM_MEMORY 0x00000180
+# define NV10_VIDEO_DISPLAY_SET_DMA_IN_MEMORY0 0x00000184
+# define NV10_VIDEO_DISPLAY_SET_DMA_IN_MEMORY1 0x00000188
+# define NV10_VIDEO_DISPLAY_SET_OBJECT3 0x0000019c
+# define NV10_VIDEO_DISPLAY_SIZE 0x000002f8 /* Parameters: height width */
+# define NV10_VIDEO_DISPLAY_OFFSET 0x00000300
+
+/******************************************
+Object NV10_UNK0072 used on: NV10 NV15 NV20 NV40 G70
+*/
+#define NV10_UNK0072 0x00000072
+# define NV10_UNK0072_COUNTER 0x00000050
+# define NV40_UNK0072_SET_OBJECT 0x00000060
+# define NV10_UNK0072_SET_DMA_NOTIFY 0x00000180
+
+/******************************************
+Object NV10_SCALED_IMAGE_FROM_MEMORY used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_SCALED_IMAGE_FROM_MEMORY 0x00000089
+# define NV10_SCALED_IMAGE_FROM_MEMORY_COUNTER 0x00000050
+# define NV10_SCALED_IMAGE_FROM_MEMORY_SET_DMA_IN_MEMORY 0x00000184
+# define NV10_SCALED_IMAGE_FROM_MEMORY_SET_RASTER_OP 0x0000018c
+# define NV10_SCALED_IMAGE_FROM_MEMORY_SET_IMAGE_PATTERN 0x00000188
+# define NV10_SCALED_IMAGE_FROM_MEMORY_SET_SURFACE 0x00000198
+# define NV10_SCALED_IMAGE_FROM_MEMORY_OPERATION 0x00000304
+# define NV10_SCALED_IMAGE_FROM_MEMORY_CLIP_POS 0x00000308 /* Parameters: x y */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_CLIP_SIZE 0x0000030c /* Parameters: width height */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_OUT_POS 0x00000310 /* Parameters: x y */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_OUT_SIZE 0x00000314 /* Parameters: width height */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_SIZE 0x00000400 /* Parameters: width height */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_FORMAT 0x00000404 /* Parameters: pitch */
+# define NV10_SCALED_IMAGE_FROM_MEMORY_OFFSET 0x00000408
+# define NV10_SCALED_IMAGE_FROM_MEMORY_POINT 0x0000040c /* Parameters: u_int u_frac*0x10 v_int v_frac*0x10 */
+
+/******************************************
+Object NV10_CONTEXT_SURFACES_2D used on: NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV10_CONTEXT_SURFACES_2D 0x00000062
+# define NV10_CONTEXT_SURFACES_2D_SET_DMA_NOTIFY 0x00000180
+# define NV10_CONTEXT_SURFACES_2D_SET_DMA_IN_MEMORY0 0x00000184
+# define NV10_CONTEXT_SURFACES_2D_SET_DMA_IN_MEMORY1 0x00000188
+# define NV10_CONTEXT_SURFACES_2D_FORMAT 0x00000300 /* Parameters: color type width height */
+# define NV10_CONTEXT_SURFACES_2D_PITCH 0x00000304 /* Parameters: src dst */
+# define NV10_CONTEXT_SURFACES_2D_OFFSET_SRC 0x00000308
+# define NV10_CONTEXT_SURFACES_2D_OFFSET_DST 0x0000030c
+
+/******************************************
+Object NV04_CONTEXT_SURFACES_2D used on: NV04 NV10 NV15
+*/
+#define NV04_CONTEXT_SURFACES_2D 0x00000042
+# define NV04_CONTEXT_SURFACES_2D_NOTIFY 0x00000104
+# define NV04_CONTEXT_SURFACES_2D_SET_DMA_NOTIFY 0x00000180
+# define NV04_CONTEXT_SURFACES_2D_SET_DMA_IMAGE_SRC 0x00000184
+# define NV04_CONTEXT_SURFACES_2D_SET_DMA_IMAGE_DST 0x00000188
+# define NV04_CONTEXT_SURFACES_2D_FORMAT 0x00000300
+# define NV04_CONTEXT_SURFACES_2D_PITCH 0x00000304 /* Parameters: src dst */
+# define NV04_CONTEXT_SURFACES_2D_OFFSET_SRC 0x00000308
+# define NV04_CONTEXT_SURFACES_2D_OFFSET_DST 0x0000030c
+
+/******************************************
+Object NV04_IMAGE_PATTERN used on: NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV04_IMAGE_PATTERN 0x00000044
+# define NV04_IMAGE_PATTERN_COLOR_FORMAT 0x00000300
+# define NV04_IMAGE_PATTERN_MONO_FORMAT 0x00000304
+# define NV04_IMAGE_PATTERN_SELECT 0x0000030c
+# define NV04_IMAGE_PATTERN_MONOCHROME_SHAPE 0x00000308
+# 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
+
+/******************************************
+Object NV20_SWIZZLED_SURFACE used on: NV20 NV30 NV40 G70
+*/
+#define NV20_SWIZZLED_SURFACE 0x0000009e
+# define NV20_SWIZZLED_SURFACE_SET_OBJECT0 0x00000180
+# define NV20_SWIZZLED_SURFACE_SET_OBJECT1 0x00000184
+# define NV20_SWIZZLED_SURFACE_FORMAT 0x00000300 /* Parameters: log2(height) log2(width) color */
+# define NV20_SWIZZLED_SURFACE_OFFSET 0x00000304
+
+/******************************************
+Object NV20_TCL_PRIMITIVE_3D used on: NV20
+*/
+#define NV20_TCL_PRIMITIVE_3D 0x00000097
+# define NV20_TCL_PRIMITIVE_3D_NOP 0x00000100
+# define NV20_TCL_PRIMITIVE_3D_NOTIFY 0x00000104
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT0 0x00000180
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT1 0x00000184
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT2 0x00000188
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT3 0x00000194
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT4 0x00000198
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT5 0x0000019c
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT6 0x000001a0
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT7 0x000001a4
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT8 0x000001a8
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT9 0x000001ac
+# define NV20_TCL_PRIMITIVE_3D_SET_OBJECT10 0x000001b0
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ 0x00000200 /* Parameters: width x */
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_VERT 0x00000204 /* Parameters: height y */
+# define NV20_TCL_PRIMITIVE_3D_BUFFER_FORMAT 0x00000208 /* Parameters: type color */
+# define NV20_TCL_PRIMITIVE_3D_BUFFER_PITCH 0x0000020c /* Parameters: depth/stencil buffer pitch color buffer pitch */
+# define NV20_TCL_PRIMITIVE_3D_COLOR_OFFSET 0x00000210
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_OFFSET 0x00000214
+# define NV20_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_PITCH 0x0000022c /* Parameters: pitch */
+# define NV20_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_OFFSET 0x00000230
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_CONTROL 0x00000294
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_CONTROL 0x00000298 /* Parameters: back_specular back_ambient back_diffuse back_emission front_specular front_ambient front_diffuse front_emission */
+# define NV20_TCL_PRIMITIVE_3D_FOG_MODE 0x0000029c
+# define NV20_TCL_PRIMITIVE_3D_FOG_COORD_DIST 0x000002a0
+# define NV20_TCL_PRIMITIVE_3D_FOG_ENABLE 0x000002a4
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(d) (0x000002c0 + d * 0x0004) /* Parameters: x2 x1 */
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(d) (0x000002e0 + d * 0x0004) /* Parameters: y2 y1 */
+# define NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE 0x00000300
+# define NV20_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE 0x00000304
+# define NV20_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE 0x00000308
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE 0x0000030c
+# define NV20_TCL_PRIMITIVE_3D_DITHER_ENABLE 0x00000310
+# define NV20_TCL_PRIMITIVE_3D_LIGHTING_ENABLE 0x00000314
+# define NV20_TCL_PRIMITIVE_3D_POINT_SMOOTH_ENABLE 0x0000031c
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETERS_ENABLE 0x00000318
+# define NV20_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE 0x00000320
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE 0x00000324
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_ENABLE 0x0000032c
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE 0x00000330
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE 0x00000334
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE 0x00000338
+# define NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC 0x0000033c
+# define NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF 0x00000340
+# define NV20_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC 0x00000344
+# define NV20_TCL_PRIMITIVE_3D_BLEND_FUNC_DST 0x00000348
+# define NV20_TCL_PRIMITIVE_3D_BLEND_COLOR 0x0000034c /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_BLEND_EQUATION 0x00000350
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_FUNC 0x00000354
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MASK 0x00000358 /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE 0x0000035c
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_MASK 0x00000360
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_FUNC_FUNC 0x00000364
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_FUNC_REF 0x00000368
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_FUNC_MASK 0x0000036c
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_OP_FAIL 0x00000370
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_OP_ZFAIL 0x00000374
+# define NV20_TCL_PRIMITIVE_3D_STENCIL_OP_ZPASS 0x00000378
+# define NV20_TCL_PRIMITIVE_3D_SHADE_MODEL 0x0000037c
+# define NV20_TCL_PRIMITIVE_3D_LINE_WIDTH 0x00000380
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR 0x00000384
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_UNITS 0x00000388
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT 0x0000038c
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK 0x00000390
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR 0x00000394
+# define NV20_TCL_PRIMITIVE_3D_DEPTH_RANGE_FAR 0x00000398
+# define NV20_TCL_PRIMITIVE_3D_CULL_FACE 0x0000039c
+# define NV20_TCL_PRIMITIVE_3D_FRONT_FACE 0x000003a0
+# define NV20_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE 0x000003a4
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_R 0x000003a8
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_G 0x000003ac
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_B 0x000003b0
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_A 0x000003b4
+# define NV20_TCL_PRIMITIVE_3D_SEPARATE_SPECULAR_ENABLE 0x000003b8
+# define NV20_TCL_PRIMITIVE_3D_ENABLED_LIGHTS 0x000003bc /* Parameters: light 7 light 6 light 5 light 4 light 3 light 2 light 1 light 0 */
+# define NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE(d) (0x000003c0 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_TX_MATRIX_ENABLE(d) (0x00000420 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_POINT_SIZE 0x0000043c
+# define NV20_TCL_PRIMITIVE_3D_MODELVIEW_MATRIX( d) (0x00000480 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW_MATRIX( d) (0x00000580 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_PROJECTION_MATRIX( d) (0x00000680 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_TX_MATRIX(x,y) (0x000006c0 + y * 0x0010 + x * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_A(d) (0x00000840 + d * 0x0010)
+# define NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_B(d) (0x00000844 + d * 0x0010)
+# define NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_C(d) (0x00000848 + d * 0x0010)
+# define NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_D(d) (0x0000084c + d * 0x0010)
+# define NV20_TCL_PRIMITIVE_3D_FOG_EQUATION_CONSTANT 0x000009c0
+# define NV20_TCL_PRIMITIVE_3D_FOG_EQUATION_LINEAR 0x000009c4
+# define NV20_TCL_PRIMITIVE_3D_FOG_EQUATION_QUADRATIC 0x000009c8
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_A 0x000009e0
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_B 0x000009e4
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_C 0x000009e8
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_D 0x000009ec
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_E 0x000009f0
+# define NV20_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_F 0x000009f4
+# define NV20_TCL_PRIMITIVE_3D_POINT_SPRITE 0x00000a1c /* Parameters: coord_replace r_mode enable */
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_OX 0x00000a20
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_OY 0x00000a24
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_DEPTH_AVG_S 0x00000a28
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_UNKNOWN_A 0x00000a2c
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_A 0x00000a30
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_B 0x00000a34
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_C 0x00000a38
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_D 0x00000a3c
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_E 0x00000a40
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_F 0x00000a44
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_G 0x00000a48
+# define NV20_TCL_PRIMITIVE_3D_POINT_PARAMETER_H 0x00000a4c
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_PX_DIV2 0x00000af0
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_PY_DIV2 0x00000af4
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_DEPTH_HALF_S 0x00000af8
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_UNKNOWN_B 0x00000afc
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_INST0 0x00000b00
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_INST1 0x00000b04
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_INST2 0x00000b08
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_INST3 0x00000b0c
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_X 0x00000b80
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_Y 0x00000b84
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_Z 0x00000b88
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_W 0x00000b8c
+# define NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_ID 0x00001ea4
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18
+# define NV20_TCL_PRIMITIVE_3D_TX_OFFSET(d) (0x00001b00 + d * 0x0040)
+# define NV20_TCL_PRIMITIVE_3D_TX_FORMAT(d) (0x00001b04 + d * 0x0040) /* Parameters: log2(height) log2(width) lod format cube_map */
+# define NV20_TCL_PRIMITIVE_3D_TX_WRAP(d) (0x00001b08 + d * 0x0040) /* Parameters: wrap_s wrap_t wrap_r */
+# define NV20_TCL_PRIMITIVE_3D_TX_ENABLE(d) (0x00001b0c + d * 0x0040) /* Parameters: enable anisotropy */
+# define NV20_TCL_PRIMITIVE_3D_TX_NPOT_PITCH(d) (0x00001b10 + d * 0x0040) /* Parameters: pitch */
+# define NV20_TCL_PRIMITIVE_3D_TX_FILTER(d) (0x00001b14 + d * 0x0040) /* Parameters: mag_filter min_filter */
+# define NV20_TCL_PRIMITIVE_3D_TX_NPOT_SIZE(d) (0x00001b1c + d * 0x0040) /* Parameters: width height */
+# define NV20_TCL_PRIMITIVE_3D_TX_PALETTE_OFFSET(d) (0x00001b20 + d * 0x0040)
+# define NV20_TCL_PRIMITIVE_3D_RC_ENABLE 0x00001e60 /* Parameters: number of rc enabled */
+# define NV20_TCL_PRIMITIVE_3D_TX_SHADER_OP 0x00001e70 /* Parameters: op0 op1 op2 op3 */
+# define NV20_TCL_PRIMITIVE_3D_TX_SHADER_CULL_MODE 0x000017f8 /* Parameters: cull0 cull1 cull2 cull3 */
+# define NV20_TCL_PRIMITIVE_3D_TX_SHADER_PREVIOUS 0x00001e78 /* Parameters: prev2 prev3 */
+# define NV20_TCL_PRIMITIVE_3D_RC_COLOR0 0x00001e20 /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_RC_COLOR1 0x00001e24 /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_RC_FINAL0 0x00000288 /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV20_TCL_PRIMITIVE_3D_RC_FINAL1 0x0000028c /* Parameters: vare_mapping vare_component_usage vare_input varf_mapping varf_component_usage varf_input varg_mapping varg_component_usage varg_input color_sum_clamp */
+# define NV20_TCL_PRIMITIVE_3D_RC_IN_ALPHA(d) (0x00000260 + d * 0x0004) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV20_TCL_PRIMITIVE_3D_RC_IN_RGB(d) (0x00000ac0 + d * 0x0004) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV20_TCL_PRIMITIVE_3D_RC_CONSTANT_COLOR0(d) (0x00000a60 + d * 0x0004) /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_RC_CONSTANT_COLOR1(d) (0x00000a80 + d * 0x0004) /* Parameters: a r g b */
+# define NV20_TCL_PRIMITIVE_3D_RC_OUT_ALPHA(d) (0x00000aa0 + d * 0x0004) /* Parameters: scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV20_TCL_PRIMITIVE_3D_RC_OUT_RGB(d) (0x00001e40 + d * 0x0004) /* Parameters: scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(d) (0x0000105c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_POSITION_Y(d) (0x00001060 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_POSITION_Z(d) (0x00001064 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_X(d) (0x00001028 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Y(d) (0x0000102c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Z(d) (0x00001030 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_X(d) (0x00001034 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Y(d) (0x00001038 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Z(d) (0x0000103c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(d) (0x00001000 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(d) (0x00001004 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(d) (0x00001008 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(d) (0x0000100c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(d) (0x00001010 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(d) (0x00001014 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(d) (0x00001018 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(d) (0x0000101c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(d) (0x00001020 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_BACK_SIDE_PRODUCT_AMBIENT(d) (0x00000c00 + d * 0x0040)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_BACK_SIDE_PRODUCT_DIFFUSE(d) (0x00000c0c + d * 0x0040)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_BACK_SIDE_PRODUCT_SPECULAR(d) (0x00000c18 + d * 0x0040)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(d) (0x00001068 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(d) (0x0000106c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(d) (0x00001070 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(d) (0x00001040 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_EXPONENT(d) (0x00001044 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_B(d) (0x00001048 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(d) (0x0000104c + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Y(d) (0x00001050 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Z(d) (0x00001054 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_C(d) (0x00001058 + d * 0x0080)
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_A 0x00001e28
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_B 0x00001e2c
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_C 0x00001e30
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_D 0x00001e34
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_E 0x00001e38
+# define NV20_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_F 0x00001e3c
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_ENABLE 0x0000147c
+# define NV20_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN(d) (0x00001480 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_3F_X 0x00001500
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Y 0x00001504
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Z 0x00001508
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4F_X 0x00001518
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Y 0x0000151c
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Z 0x00001520
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4F_W 0x00001524
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4I_XY 0x00001528 /* Parameters: y x */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_POS_4I_ZW 0x0000152c /* Parameters: w z */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_X 0x00001530
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Y 0x00001534
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Z 0x00001538
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_XY 0x00001540 /* Parameters: y x */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_Z 0x00001544 /* Parameters: z */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_4F_R 0x00001550
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_4F_G 0x00001554
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_4F_B 0x00001558
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_4F_A 0x0000155c
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_3F_R 0x00001560
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_3F_G 0x00001564
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_3F_B 0x00001568
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL_4I 0x0000156c /* Parameters: a b g r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_R 0x00001580
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_G 0x00001584
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_B 0x00001588
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_COL2_3I 0x0000158c /* Parameters: a b g r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_S 0x00001590
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_T 0x00001594
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_2I 0x00001598 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_S 0x000015a0
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_T 0x000015a4
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_R 0x000015a8
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_Q 0x000015ac
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_ST 0x000015b0 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_RQ 0x000015b4 /* Parameters: q r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_S 0x000015b8
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_T 0x000015bc
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_2I 0x000015c0 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_S 0x000015c8
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_T 0x000015cc
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_R 0x000015d0
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_Q 0x000015d4
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_ST 0x000015d8 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_RQ 0x000015dc /* Parameters: q r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_S 0x000015e0
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_T 0x000015e4
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_2I 0x000015e8 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_S 0x000015f0
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_T 0x000015f4
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_R 0x000015f8
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_Q 0x000015fc
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_ST 0x00001600 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_RQ 0x00001604 /* Parameters: q r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_S 0x00001608
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_T 0x0000160c
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_2I 0x00001610 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_S 0x00001620
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_T 0x00001624
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_R 0x00001628
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_Q 0x0000162c
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_ST 0x00001630 /* Parameters: t s */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_RQ 0x00001634 /* Parameters: q r */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_FOG_1F 0x00001698
+# define NV20_TCL_PRIMITIVE_3D_EDGE_FLAG 0x000016bc
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR0_POS 0x00001720 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR1_WGH 0x00001724 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR2_NOR 0x00001728 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR3_COL 0x0000172c /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR4_COL2 0x00001730 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR5_FOG 0x00001734 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR6 0x00001738 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR7 0x0000173c /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR8_TX0 0x00001740 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR9_TX1 0x00001744 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR10_TX2 0x00001748 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR11_TX3 0x0000174c /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR12_TX4 0x00001750 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR13_TX5 0x00001754 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR14_TX6 0x00001758 /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VB_POINTER_ATTR15_TX7 0x0000175c /* Parameters: enabled? offset */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR( d) (0x00001760 + d * 0x0004)
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR0_POS 0x00001760 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR1_WGH 0x00001764 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR2_NOR 0x00001768 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR3_COL 0x0000176c /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR4_COL2 0x00001770 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR5_FOG 0x00001774 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR6 0x00001778 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR7 0x0000177c /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR8_TX0 0x00001780 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR9_TX1 0x00001784 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR10_TX2 0x00001788 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR11_TX3 0x0000178c /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR12_TX4 0x00001790 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR13_TX5 0x00001794 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR14_TX6 0x00001798 /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR15_TX7 0x0000179c /* Parameters: stride fields type */
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_A 0x000017ac
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_R 0x000017b0
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_G 0x000017b4
+# define NV20_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_B 0x000017b8
+# define NV20_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE 0x000017bc
+# define NV20_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP 0x000017c0
+# define NV20_TCL_PRIMITIVE_3D_LIGHT_MODEL_TWO_SIDE_ENABLE 0x000017c4
+# define NV20_TCL_PRIMITIVE_3D_BEGIN_END 0x000017fc
+# define NV20_TCL_PRIMITIVE_3D_SCISSOR_X2_X1 0x00001c30 /* Parameters: x2 x1 */
+# define NV20_TCL_PRIMITIVE_3D_SCISSOR_Y2_Y1 0x00001c50 /* Parameters: y2 y1 */
+# define NV20_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH 0x00001d8c
+# define NV20_TCL_PRIMITIVE_3D_CLEAR_VALUE_ARGB 0x00001d90
+# define NV20_TCL_PRIMITIVE_3D_CLEAR_WHICH_BUFFERS 0x00001d94 /* Parameters: clear color a clear color b clear color g clear color r clear depth clear stencil */
+# define NV20_TCL_PRIMITIVE_3D_INDEX_DATA 0x00001800 /* Parameters: index1 index0 */
+# define NV20_TCL_PRIMITIVE_3D_VB_VERTEX_BATCH 0x00001810 /* Parameters: count_vertices offset_vertices */
+# define NV20_TCL_PRIMITIVE_3D_VERTEX_DATA 0x00001818
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X 0x00001f00
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_Y 0x00001f04
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_Z 0x00001f08
+# define NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_W 0x00001f0c
+
+/******************************************
+Object NV30_TCL_PRIMITIVE_3D used on: NV30 NV40 G70
+*/
+#define NV30_TCL_PRIMITIVE_3D 0x00000097
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT0 0x00000180
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT1 0x00000184
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT2 0x00000188
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT3 0x0000018c
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT4 0x00000194
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT5 0x00000198
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT6 0x000001a4
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT7 0x000001a8
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT8 0x000001ac
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT9 0x000001b4
+# define NV30_TCL_PRIMITIVE_3D_SET_OBJECT10 0x000001b8
+# define NV30_TCL_PRIMITIVE_3D_SET_VB_SRC0_OBJECT 0x0000019c
+# define NV30_TCL_PRIMITIVE_3D_SET_VB_SRC1_OBJECT 0x000001a0
+# define NV30_TCL_PRIMITIVE_3D_BUFFER0_PITCH 0x0000020c /* Parameters: depth/stencil buffer pitch color0 buffer pitch */
+# define NV30_TCL_PRIMITIVE_3D_COLOR0_OFFSET 0x00000210
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_OFFSET 0x00000214
+# define NV30_TCL_PRIMITIVE_3D_COLOR1_OFFSET 0x00000218
+# define NV30_TCL_PRIMITIVE_3D_BUFFER1_PITCH 0x0000021c /* Parameters: color1 buffer pitch */
+# define NV30_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_PITCH 0x0000022c /* Parameters: pitch */
+# define NV30_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_OFFSET 0x00000230
+# define NV30_TCL_PRIMITIVE_3D_TX_MATRIX_ENABLE(d) (0x00000240 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_BUFFER2_PITCH 0x00000280
+# define NV30_TCL_PRIMITIVE_3D_BUFFER3_PITCH 0x00000284
+# define NV30_TCL_PRIMITIVE_3D_BUFFER2_OFFSET 0x00000288
+# define NV30_TCL_PRIMITIVE_3D_BUFFER3_OFFSET 0x0000028c
+# define NV30_TCL_PRIMITIVE_3D_DITHER_ENABLE 0x00000300
+# define NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE 0x00000304
+# define NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC 0x00000308
+# define NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF 0x0000030c
+# define NV30_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE 0x00000310
+# define NV30_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC 0x00000314
+# define NV30_TCL_PRIMITIVE_3D_BLEND_FUNC_DST 0x00000318
+# define NV30_TCL_PRIMITIVE_3D_BLEND_COLOR 0x0000031c /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_BLEND_EQUATION 0x00000320
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MASK 0x00000324 /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_ENABLE 0x00000328
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_MASK 0x0000032c
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_FUNC 0x00000330
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_REF 0x00000334
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_MASK 0x00000338
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_FAIL 0x0000033c
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_ZFAIL 0x00000340
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_ZPASS 0x00000344
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_ENABLE 0x00000348
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_MASK 0x0000034c
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_FUNC 0x00000350
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_REF 0x00000354
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_MASK 0x00000358
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_FAIL 0x0000035c
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_ZFAIL 0x00000360
+# define NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_ZPASS 0x00000364
+# define NV30_TCL_PRIMITIVE_3D_SHADE_MODEL 0x00000368
+# define NV30_TCL_PRIMITIVE_3D_FOG_ENABLE 0x0000036c
+# define NV30_TCL_PRIMITIVE_3D_FOG_COLOR 0x00000370
+# define NV40_TCL_PRIMITIVE_3D_COLOR_MASK_BUFFER123 0x00000370 /* Parameters: buffer3 b buffer3 g buffer3 r buffer3 a buffer2 b buffer2 g buffer2 r buffer2 a buffer1 b buffer1 g buffer1 r buffer1 a */
+# define NV30_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE 0x0000037c
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR 0x00000394
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_RANGE_FAR 0x00000398
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_R 0x000003a0
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_G 0x000003a4
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_B 0x000003a8
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_FRONT_A 0x000003b4
+# define NV30_TCL_PRIMITIVE_3D_LINE_WIDTH_SMOOTH 0x000003b8
+# define NV30_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE 0x000003bc
+# define NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE(d) (0x00000400 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_MODELVIEW_MATRIX( d) (0x00000480 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW_MATRIX( d) (0x00000580 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_PROJECTION_MATRIX( d) (0x00000680 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_TX_MATRIX(x,y) (0x000006c0 + y * 0x0010 + x * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_FP_ACTIVE_PROGRAM 0x000008e4
+# define NV30_TCL_PRIMITIVE_3D_FOG_COORD_DIST 0x000008c8
+# define NV30_TCL_PRIMITIVE_3D_FOG_MODE 0x000008cc
+# define NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_CONSTANT 0x000008d0
+# define NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_LINEAR 0x000008d4
+# define NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_QUADRATIC 0x000008d8
+# define NV30_TCL_PRIMITIVE_3D_RC_COLOR0 0x000008ec /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_RC_COLOR1 0x000008f0 /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_RC_FINAL0 0x000008f4 /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV30_TCL_PRIMITIVE_3D_RC_FINAL1 0x000008f8 /* Parameters: vare_mapping vare_component_usage vare_input varf_mapping varf_component_usage varf_input varg_mapping varg_component_usage varg_input color_sum_clamp */
+# define NV30_TCL_PRIMITIVE_3D_RC_ENABLE 0x000008fc /* Parameters: number of rc enabled */
+# define NV30_TCL_PRIMITIVE_3D_RC_IN_ALPHA(d) (0x00000900 + d * 0x0020) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV30_TCL_PRIMITIVE_3D_RC_IN_RGB(d) (0x00000904 + d * 0x0020) /* Parameters: vara_mapping vara_component_usage vara_input varb_mapping varb_component_usage varb_input varc_mapping varc_component_usage varc_input vard_mapping vard_component_usage vard_input */
+# define NV30_TCL_PRIMITIVE_3D_RC_CONSTANT_COLOR0(d) (0x00000908 + d * 0x0020) /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_RC_CONSTANT_COLOR1(d) (0x0000090c + d * 0x0020) /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_RC_OUT_ALPHA(d) (0x00000910 + d * 0x0020) /* Parameters: scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV30_TCL_PRIMITIVE_3D_RC_OUT_RGB(d) (0x00000914 + d * 0x0020) /* Parameters: scale bias mux_sum ab_dot_product cd_dot_product sum_output ab_output cd_output */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_DIM0 0x00000200 /* Parameters: width x_offset */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_DIM1 0x00000204 /* Parameters: height y_offset */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS0 0x000002c0 /* Parameters: width x_offset */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS1 0x000002c4 /* Parameters: height y_offset */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0 0x00000a00 /* Parameters: width x_offset */
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_1 0x00000a04 /* Parameters: height y_offset */
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x00000a10
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x00000a14
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_FRONT_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x00000a18
+# define NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS 0x000008c0 /* Parameters: width x_offset */
+# define NV30_TCL_PRIMITIVE_3D_SCISSOR_HEIGHT_YPOS 0x000008c4 /* Parameters: height y_offset */
+# define NV30_TCL_PRIMITIVE_3D_POINT_SPRITE 0x00001ee8 /* Parameters: coord_replace r_mode enable */
+# define NV30_TCL_PRIMITIVE_3D_POINT_SIZE 0x00001ee0
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_A 0x00001ec0
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_B 0x00001ec4
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_C 0x00001ec8
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_D 0x00001ecc
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_E 0x00001ed0
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_F 0x00001ed4
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_G 0x00001ed8
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETER_H 0x00001edc
+# define NV30_TCL_PRIMITIVE_3D_POINT_PARAMETERS_ENABLE 0x00001ee4
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OX 0x00000a20
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OY 0x00000a24
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_NPF_DIV2 0x00000a28
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_UNK0_0x0 0x00000a2c
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_PX_DIV2 0x00000a30
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_PY_DIV2 0x00000a34
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_FMN_DIV2 0x00000a38
+# define NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_UNK1_0x0 0x00000a3c
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE 0x00000a60
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE 0x00000a64
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE 0x00000a68
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_FUNC 0x00000a6c
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE 0x00000a70
+# define NV30_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE 0x00000a74
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR 0x00000a78
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_UNITS 0x00000a7c
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_INST0 0x00000b80
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_INST1 0x00000b84
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_INST2 0x00000b88
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_INST3 0x00000b8c
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_R 0x000017b0
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_G 0x000017b4
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_B 0x000017b8
+# define NV30_TCL_PRIMITIVE_3D_COLOR_MATERIAL_BACK_A 0x000017c0
+# define NV30_TCL_PRIMITIVE_3D_OCC_QUERY_OR_COLOR_BUFF_ENABLE 0x000017c8
+# define NV30_TCL_PRIMITIVE_3D_STORE_RESULT 0x00001800
+# define NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_A(d) (0x00000e00 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_B(d) (0x00000e04 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_C(d) (0x00000e08 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_D(d) (0x00000e0c + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(d) (0x00001000 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_G(d) (0x00001004 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_B(d) (0x00001008 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(d) (0x0000100c + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_G(d) (0x00001010 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_B(d) (0x00001014 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(d) (0x00001018 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_G(d) (0x0000101c + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_B(d) (0x00001020 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_X(d) (0x00001028 + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Y(d) (0x0000102c + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_HALF_VECTOR_Z(d) (0x00001030 + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_X(d) (0x00001034 + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Y(d) (0x00001038 + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_DIRECTION_Z(d) (0x0000103c + d * 0x0080)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(d) (0x00001228 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(d) (0x0000122c + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(d) (0x00001230 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(d) (0x00001200 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_EXPONENT(d) (0x00001204 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_B(d) (0x00001208 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(d) (0x0000120c + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Y(d) (0x00001210 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_Z(d) (0x00001214 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_C(d) (0x00001218 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(d) (0x0000121c + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_POSITION_Y(d) (0x00001220 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_POSITION_Z(d) (0x00001224 + d * 0x0040)
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_A 0x00001400
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_B 0x00001404
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_C 0x00001408
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_D 0x0000140c
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_E 0x00001410
+# define NV30_TCL_PRIMITIVE_3D_FRONT_MATERIAL_SHININESS_F 0x00001414
+# define NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS 0x00001420 /* Parameters: light 7 light 6 light 5 light 4 light 3 light 2 light 1 light 0 */
+# define NV30_TCL_PRIMITIVE_3D_UNK1D6C_OFFSET 0x00001d6c
+# define NV30_TCL_PRIMITIVE_3D_UNK1D70_VALUE 0x00001d70
+# define NV30_TCL_PRIMITIVE_3D_LINE_STIPPLE_ENABLE 0x00001db4
+# define NV30_TCL_PRIMITIVE_3D_LINE_STIPPLE_PATTERN 0x00001db8 /* Parameters: factor pattern */
+# define NV30_TCL_PRIMITIVE_3D_BEGIN_END 0x00001808
+# define NV30_TCL_PRIMITIVE_3D_CULL_FACE 0x00001830
+# define NV30_TCL_PRIMITIVE_3D_FRONT_FACE 0x00001834
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE 0x00001838
+# define NV30_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE 0x0000183c
+# define NV30_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH 0x00001d8c
+# define NV30_TCL_PRIMITIVE_3D_CLEAR_VALUE_ARGB 0x00001d90 /* Parameters: a r g b */
+# define NV30_TCL_PRIMITIVE_3D_CLEAR_WHICH_BUFFERS 0x00001d94
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_A 0x00001e20
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_B 0x00001e24
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_C 0x00001e28
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_D 0x00001e2c
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_E 0x00001e30
+# define NV30_TCL_PRIMITIVE_3D_BACK_MATERIAL_SHININESS_F 0x00001e34
+# define NV30_TCL_PRIMITIVE_3D_DO_VERTICES 0x00001dac
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_FROM_ID 0x00001e9c
+# define NV30_TCL_PRIMITIVE_3D_VP_PROGRAM_START_ID 0x00001ea0
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_ID 0x00001efc
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P0_X 0x00001f00
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P0_Y 0x00001f04
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P0_Z 0x00001f08
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P0_W 0x00001f0c
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P1_X 0x00001f10
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P1_Y 0x00001f14
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P1_Z 0x00001f18
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P1_W 0x00001f1c
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P2_X 0x00001f20
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P2_Y 0x00001f24
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P2_Z 0x00001f28
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P2_W 0x00001f2c
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P3_X 0x00001f30
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P3_Y 0x00001f34
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P3_Z 0x00001f38
+# define NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_P3_W 0x00001f3c
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_3X(d) (0x00001500 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_3Y(d) (0x00001504 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_3Z(d) (0x00001508 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_3W(d) (0x0000150c + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_4X(d) (0x00001c00 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_4Y(d) (0x00001c04 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_4Z(d) (0x00001c08 + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VTX_ATTR_4W(d) (0x00001c0c + d * 0x0010)
+# define NV30_TCL_PRIMITIVE_3D_VB_POINTER_ATTR(d) (0x00001680 + d * 0x0004) /* Parameters: source: offset */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_XY 0x00000a90 /* Parameters: y x */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_Z 0x00000a94 /* Parameters: z */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_S 0x000018c0
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_T 0x000018c4
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_S 0x000018c8
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_T 0x000018cc
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_S 0x000018d0
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_T 0x000018d4
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_S 0x000018d8
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_T 0x000018dc
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX0_2I 0x00001920 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX1_2I 0x00001924 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX2_2I 0x00001928 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX3_2I 0x0000192c /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_COL_4I 0x0000194c /* Parameters: a b g r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_COL2_3I 0x00001950 /* Parameters: a b g r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_ST 0x000019c0 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_RQ 0x000019c4 /* Parameters: q r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_ST 0x000019c8 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_RQ 0x000019cc /* Parameters: q r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_ST 0x000019d0 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_RQ 0x000019d4 /* Parameters: q r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_ST 0x000019d8 /* Parameters: t s */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_RQ 0x000019dc /* Parameters: q r */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_FOG_1F 0x00001e54
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_UNK_0 0x00001718
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR( d) (0x00001740 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR0_POS 0x00001740 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR1_WGH 0x00001744 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR2_NOR 0x00001748 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR3_COL 0x0000174c /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR4_COL2 0x00001750 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR5_FOG 0x00001754 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR6 0x00001758 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR7 0x0000175c /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR8_TX0 0x00001760 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR9_TX1 0x00001764 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR10_TX2 0x00001768 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR11_TX3 0x0000176c /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR12_TX4 0x00001770 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR13_TX5 0x00001774 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR14_TX6 0x00001778 /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR15_TX7 0x0000177c /* Parameters: stride fields type */
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_R 0x000017a0
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_G 0x000017a4
+# define NV30_TCL_PRIMITIVE_3D_LIGHT_MODEL_BACK_SIDE_PRODUCT_AMBIENT_PLUS_EMISSION_B 0x000017a8
+# define NV30_TCL_PRIMITIVE_3D_FP_ACTIVE_PROGRAM 0x000008e4
+# define NV30_TCL_PRIMITIVE_3D_TX_ADDRESS_UNIT(d) (0x00001a00 + d * 0x0020)
+# define NV30_TCL_PRIMITIVE_3D_TX_FORMAT_UNIT(d) (0x00001a04 + d * 0x0020) /* Parameters: mipmap type format ncomp cubic */
+# define NV30_TCL_PRIMITIVE_3D_TX_WRAP_UNIT(d) (0x00001a08 + d * 0x0020) /* Parameters: wrap_s wrap_t wrap_r */
+# define NV30_TCL_PRIMITIVE_3D_TX_ENABLE_UNIT(d) (0x00001a0c + d * 0x0020) /* Parameters: nv40_enable nv30_enable anisotropy */
+# define NV30_TCL_PRIMITIVE_3D_TX_SWIZZLE_UNIT(d) (0x00001a10 + d * 0x0020)
+# define NV30_TCL_PRIMITIVE_3D_TX_FILTER_UNIT(d) (0x00001a14 + d * 0x0020) /* Parameters: filter_min filter_mag */
+# define NV30_TCL_PRIMITIVE_3D_TX_XY_DIM_UNIT(d) (0x00001a18 + d * 0x0020) /* Parameters: width height */
+# define NV30_TCL_PRIMITIVE_3D_TX_UNK07_UNIT(d) (0x00001a1c + d * 0x0020)
+# define NV30_TCL_PRIMITIVE_3D_TX_DEPTH_UNIT(d) (0x00001840 + d * 0x0004) /* Parameters: depth NPOT pitch */
+# define NV30_TCL_PRIMITIVE_3D_VB_VERTEX_BATCH 0x00001814 /* Parameters: count_vertices offset_vertices */
+# define NV30_TCL_PRIMITIVE_3D_VB_ELEMENT_U16 0x0000180c /* Parameters: 1: 0: */
+# define NV30_TCL_PRIMITIVE_3D_VB_ELEMENT_U32 0x00001810
+# define NV30_TCL_PRIMITIVE_3D_VERTEX_DATA 0x00001818
+# define NV30_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE 0x00000374
+# define NV30_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP 0x00000378
+# define NV30_TCL_PRIMITIVE_3D_SET_DISPLAY_LIST_MEM_OFFSET 0x0000181c
+# define NV30_TCL_PRIMITIVE_3D_EXECUTE_DISPLAY_LIST 0x00001824 /* Parameters: length start offset */
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT 0x00001828
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK 0x0000182c
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_ENABLE 0x0000147c
+# define NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN( d) (0x00001480 + d * 0x0004)
+# define NV30_TCL_PRIMITIVE_3D_SET_CLIPPING_PLANES 0x00001478
+# define NV30_TCL_PRIMITIVE_3D_VP_IN_REG 0x00001ff0 /* Parameters: vertex pos weight normal primary color secondary color fogcoord texture coords 0 texture ccords 1 texture coords 2 texture coords 3 texture coords 4 texture coords 5 texture coords 6 texture coords 7 */
+# define NV30_TCL_PRIMITIVE_3D_VP_OUT_REG 0x00001ff4 /* Parameters: primary color secondary color backface primary color backface secondary color fogcoord pointsize clip plane 0 clip plane 1 clip plane 2 clip plane 3 clip plane 4 clip plane 5 texture coords 0 texture coords 1 texture coords 2 texture coords 3 texture coords 4 texture coords 5 texture coords 6 texture coords 7 */
+
+/******************************************
+Object NV30_CLEAR_BUFFER used on: NV30 NV40 G70
+*/
+#define NV30_CLEAR_BUFFER 0x00000066
+# define NV30_CLEAR_BUFFER_SET_DMA_NOTIFY 0x00000180
+# define NV30_CLEAR_BUFFER_SET_IMAGE_PATTERN 0x00000188
+# define NV30_CLEAR_BUFFER_SET_RASTER_OP 0x0000018c
+# define NV30_CLEAR_BUFFER_SET_CONTEXT_SURFACE_2D 0x00000198
+# define NV30_CLEAR_BUFFER_UNK002fc 0x000002fc
+
+/******************************************
+Object NV50_TCL_PRIMITIVE_3D used on:
+*/
+#define NV50_TCL_PRIMITIVE_3D 0x00000097
+# define NV50_TCL_PRIMITIVE_3D_SET_OBJECT_0( d) (0x00000180 + d * 0x0004)
+# define NV50_TCL_PRIMITIVE_3D_SET_OBJECT_1( d) (0x000001c0 + d * 0x0004)
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_FOG_1F 0x00000314
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_2F_X 0x00000380
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_2F_Y 0x00000384
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_S 0x000003c0
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_2F_T 0x000003c4
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_S 0x000003c8
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_2F_T 0x000003cc
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_S 0x000003d0
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_2F_T 0x000003d4
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_S 0x000003d8
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_2F_T 0x000003dc
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_3F_X 0x00000400
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Y 0x00000404
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_3F_Z 0x00000408
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_X 0x00000420
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Y 0x00000424
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_NOR_3F_Z 0x00000428
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_3F_R 0x00000430
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_3F_G 0x00000434
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_3F_B 0x00000438
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_R 0x00000440
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_G 0x00000444
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL2_3F_B 0x00000448
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4F_X 0x00000500
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Y 0x00000504
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4F_Z 0x00000508
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4F_W 0x0000050c
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_4F_R 0x00000530
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_4F_G 0x00000534
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_4F_B 0x00000538
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_4F_A 0x0000053c
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_S 0x00000580
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_T 0x00000584
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_R 0x00000588
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4F_Q 0x0000058c
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_S 0x00000590
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_T 0x00000594
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_R 0x00000598
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4F_Q 0x0000059c
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_S 0x000005a0
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_T 0x000005a4
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_R 0x000005a8
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4F_Q 0x000005ac
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_S 0x000005b0
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_T 0x000005b4
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_R 0x000005b8
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4F_Q 0x000005bc
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_2I 0x000006a0 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_2I 0x000006a4 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_2I 0x000006a8 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_2I 0x000006ac /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4I_XY 0x00000700 /* Parameters: y x */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_POS_4I_ZW 0x00000704 /* Parameters: w z */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_ST 0x00000740 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX0_4I_RQ 0x00000744 /* Parameters: q r */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_ST 0x00000748 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX1_4I_RQ 0x0000074c /* Parameters: q r */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_ST 0x00000750 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX2_4I_RQ 0x00000754 /* Parameters: q r */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_ST 0x00000758 /* Parameters: t s */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_TX3_4I_RQ 0x0000075c /* Parameters: q r */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_XY 0x00000790 /* Parameters: y x */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_NOR_3I_Z 0x00000794 /* Parameters: z */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL_4I 0x0000088c /* Parameters: a b g r */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_COL2_3I 0x00000890 /* Parameters: a b g r */
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK0_X 0x00000a00
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK0_Y 0x00000a04
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK0_Z 0x00000a08
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK1_X 0x00000a0c
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK1_Y 0x00000a10
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_UNK1_Z 0x00000a14
+# define NV50_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR 0x00000c08
+# define NV50_TCL_PRIMITIVE_3D_DEPTH_RANGE_FAR 0x00000c0c
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(d) (0x00000d00 + d * 0x0008) /* Parameters: x2 x1 */
+# define NV50_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(d) (0x00000d04 + d * 0x0008) /* Parameters: y2 y1 */
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_BUFFER_FIRST 0x00000d74
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_BUFFER_COUNT 0x00000d78
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_COLOR_R 0x00000d80
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_COLOR_G 0x00000d84
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_COLOR_B 0x00000d88
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_COLOR_A 0x00000d8c
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_DEPTH 0x00000d90
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_STENCIL 0x00000da0
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT 0x00000dac
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK 0x00000db0
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE 0x00000db4
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE 0x00000dc0
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE 0x00000dc4
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE 0x00000dc8
+# define NV50_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS 0x00000e04 /* Parameters: w x */
+# define NV50_TCL_PRIMITIVE_3D_SCISSOR_HEIGHT_YPOS 0x00000e08 /* Parameters: h y */
+# define NV50_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_ID 0x00000f00
+# define NV50_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_X 0x00000f04
+# define NV50_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_Y 0x00000f08
+# define NV50_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_Z 0x00000f0c
+# define NV50_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_W 0x00000f10
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_REF 0x00000f54
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_MASK 0x00000f58
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_MASK 0x00000f5c
+# define NV50_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE 0x000012cc
+# define NV50_TCL_PRIMITIVE_3D_SHADE_MODEL 0x000012d4
+# define NV50_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE 0x000012e8
+# define NV50_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE 0x000012ec
+# define NV50_TCL_PRIMITIVE_3D_DEPTH_FUNC 0x0000130c
+# define NV50_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF 0x00001310
+# define NV50_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC 0x00001314
+# define NV50_TCL_PRIMITIVE_3D_BLEND_COLOR_R 0x0000131c
+# define NV50_TCL_PRIMITIVE_3D_BLEND_COLOR_G 0x00001320
+# define NV50_TCL_PRIMITIVE_3D_BLEND_COLOR_B 0x00001324
+# define NV50_TCL_PRIMITIVE_3D_BLEND_COLOR_A 0x00001328
+# define NV50_TCL_PRIMITIVE_3D_BLEND_EQUATION_RGB 0x00001340
+# define NV50_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC_RGB 0x00001344
+# define NV50_TCL_PRIMITIVE_3D_BLEND_FUNC_DST_RGB 0x00001348
+# define NV50_TCL_PRIMITIVE_3D_BLEND_EQUATION_ALPHA 0x0000134c
+# define NV50_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC_ALPHA 0x00001350
+# define NV50_TCL_PRIMITIVE_3D_BLEND_FUNC_DST_ALPHA 0x00001358
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_ENABLE 0x00001380
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_FAIL 0x00001384
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_ZFAIL 0x00001388
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_ZPASS 0x0000138c
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_FUNC 0x00001390
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_REF 0x00001394
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_MASK 0x00001398
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_MASK 0x0000139c
+# define NV50_TCL_PRIMITIVE_3D_LINE_WIDTH 0x000013b0
+# define NV50_TCL_PRIMITIVE_3D_POINT_SIZE 0x00001518
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR 0x0000156c
+# define NV50_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE 0x00001570
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_ENABLE 0x00001594
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_FAIL 0x00001598
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_ZFAIL 0x0000159c
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_ZPASS 0x000015a0
+# define NV50_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_FUNC 0x000015a4
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_OFFSET_UNITS 0x000015bc
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_BEGIN 0x000015dc
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_END 0x000015e0
+# define NV50_TCL_PRIMITIVE_3D_VERTEX_DATA 0x00001640
+# define NV50_TCL_PRIMITIVE_3D_LINE_STIPPLE_ENABLE 0x0000166c
+# define NV50_TCL_PRIMITIVE_3D_LINE_STIPPLE_PATTERN 0x00001680 /* Parameters: pattern factor */
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_ENABLE 0x0000168c
+# define NV50_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN( d) (0x00001700 + d * 0x0004)
+# define NV50_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE 0x00001918
+# define NV50_TCL_PRIMITIVE_3D_FRONT_FACE 0x0000191c
+# define NV50_TCL_PRIMITIVE_3D_CULL_FACE 0x00001920
+# define NV50_TCL_PRIMITIVE_3D_LOGIC_OP_ENABLE 0x000019c4
+# define NV50_TCL_PRIMITIVE_3D_LOGIC_OP_OP 0x000019c8
+# define NV50_TCL_PRIMITIVE_3D_CLEAR_BUFFERS 0x000019d0 /* Parameters: color stencil depth */
+# define NV50_TCL_PRIMITIVE_3D_COLOR_MASK( d) (0x00001a00 + d * 0x0004) /* Parameters: a b g r */
+
+/******************************************
+Object NV_DMA_FROM_MEMORY used on: NV03 NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV_DMA_FROM_MEMORY 0x00000002
+
+/******************************************
+Object NV_DMA_TO_MEMORY used on: NV03 NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV_DMA_TO_MEMORY 0x00000003
+
+/******************************************
+Object NV_DMA_IN_MEMORY used on: NV03 NV04 NV10 NV15 NV20 NV30 NV40 G70
+*/
+#define NV_DMA_IN_MEMORY 0x0000003d
+
+/******************************************
+Object NvType0046 used on: NV04
+*/
+#define NvType0046 0x00000046
+# define NvType0046_DMA_NOTIFY 0x00000180
+# define NvType0046_DMA_MEM_1 0x00000184
+# define NvType0046_DMA_MEM_2 0x00000188
+# define NvType0046_DMA_3 0x0000018c
+# define NvType0046_DMA_4 0x00000190
+# define NvType0046_OBJ_5 0x00000194
+# define NvType0046_OBJ_6 0x00000198
+# define NvType0046_PITCH1 0x00000304
+# define NvType0046_PITCH2 0x0000030c
+# define NvType0046_SIZE 0x00000340 /* Parameters: width height */
+# define NvType0046_WIDTH 0x00000344 /* Parameters: visible_width blank_width */
+# define NvType0046_HSYNC 0x00000348 /* Parameters: hsync_start hsync_len */
+# define NvType0046_HEIGHT 0x0000034c /* Parameters: visible_height blank_height */
+# define NvType0046_VSYNC 0x00000350 /* Parameters: vsync_start vsync_len */
+# define NvType0046_FULL_SIZE 0x00000354 /* Parameters: full_width full_height */
+# define NvType0046_PIXEL_CLK 0x00000358
+# define NvType0046_FLAGS 0x0000035c /* Parameters: doublescan -hsync -vsync depth */
+
+/******************************************
+Object NvType0047 used on: NV04
+*/
+#define NvType0047 0x00000047
+# define NvType0047_DMA_NOTIFY 0x00000180
+# define NvType0047_UNK19C 0x0000019c
+# define NvType0047_UNK1A0 0x000001a0
+
+/******************************************
+Object NvType0049 used on: NV04
+*/
+#define NvType0049 0x00000049
+# define NvType0049_DMA_NOTIFY 0x00000180
+# define NvType0049_DMA_MEM_1 0x00000184
+# define NvType0049_DMA_MEM_2 0x00000188
+
+/******************************************
+Object NvType004D used on: NV04
+*/
+#define NvType004D 0x0000004d
+# define NvType004D_DMA_NOTIFY 0x00000180
+# define NvType004D_DMA_MEM_1 0x00000184
+# define NvType004D_DMA_MEM_2 0x00000188
+# define NvType004D_DMA_MEM_3 0x0000018c
+# define NvType004D_DMA_MEM_4 0x00000190
+
+#endif /* _NOUVEAU_REG_H */
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
new file mode 100644
index 00000000000..ab7742df14f
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -0,0 +1,376 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "glheader.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "framebuffer.h"
+#include "renderbuffer.h"
+
+#include "nouveau_context.h"
+#include "nouveau_screen.h"
+#include "nouveau_object.h"
+#include "nouveau_span.h"
+
+#include "utils.h"
+#include "context.h"
+#include "vblank.h"
+#include "drirenderbuffer.h"
+
+#include "GL/internal/dri_interface.h"
+
+#include "xmlpool.h"
+
+PUBLIC const char __driConfigOptions[] =
+DRI_CONF_BEGIN
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+static const GLuint __driNConfigOptions = 1;
+
+extern const struct dri_extension common_extensions[];
+extern const struct dri_extension nv10_extensions[];
+extern const struct dri_extension nv20_extensions[];
+extern const struct dri_extension nv30_extensions[];
+extern const struct dri_extension nv40_extensions[];
+extern const struct dri_extension nv50_extensions[];
+
+static nouveauScreenPtr nouveauCreateScreen(__DRIscreenPrivate *sPriv)
+{
+ nouveauScreenPtr screen;
+ NOUVEAUDRIPtr dri_priv=(NOUVEAUDRIPtr)sPriv->pDevPriv;
+
+ /* allocate screen */
+ screen = (nouveauScreenPtr) CALLOC( sizeof(*screen) );
+ if ( !screen ) {
+ __driUtilMessage("%s: Could not allocate memory for screen structure",__FUNCTION__);
+ return NULL;
+ }
+
+ screen->card=nouveau_card_lookup(dri_priv->device_id);
+ if (!screen->card) {
+ __driUtilMessage("%s: Unknown card type 0x%04x:0x%04x\n",
+ __func__, dri_priv->device_id >> 16, dri_priv->device_id & 0xFFFF);
+ FREE(screen);
+ return NULL;
+ }
+
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo (&screen->optionCache,__driConfigOptions, __driNConfigOptions);
+
+ screen->fbFormat = dri_priv->bpp / 8;
+ screen->frontOffset = dri_priv->front_offset;
+ screen->frontPitch = dri_priv->front_pitch;
+ screen->backOffset = dri_priv->back_offset;
+ screen->backPitch = dri_priv->back_pitch;
+ screen->depthOffset = dri_priv->depth_offset;
+ screen->depthPitch = dri_priv->depth_pitch;
+
+ screen->driScreen = sPriv;
+ return screen;
+}
+
+static void
+nouveauDestroyScreen(__DRIscreenPrivate *sPriv)
+{
+ nouveauScreenPtr screen = (nouveauScreenPtr)sPriv->private;
+
+ if (!screen) return;
+
+ /* free all option information */
+ driDestroyOptionInfo (&screen->optionCache);
+
+ FREE(screen);
+ sPriv->private = NULL;
+}
+
+static GLboolean nouveauInitDriver(__DRIscreenPrivate *sPriv)
+{
+ sPriv->private = (void *) nouveauCreateScreen( sPriv );
+ if ( !sPriv->private ) {
+ nouveauDestroyScreen( sPriv );
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/**
+ * Create the Mesa framebuffer and renderbuffers for a given window/drawable.
+ *
+ * \todo This function (and its interface) will need to be updated to support
+ * pbuffers.
+ */
+static GLboolean
+nouveauCreateBuffer(__DRIscreenPrivate *driScrnPriv,
+ __DRIdrawablePrivate *driDrawPriv,
+ const __GLcontextModes *mesaVis,
+ GLboolean isPixmap)
+{
+ nouveauScreenPtr screen = (nouveauScreenPtr) driScrnPriv->private;
+ nouveau_renderbuffer *nrb;
+ struct gl_framebuffer *fb;
+ const GLboolean swAccum = mesaVis->accumRedBits > 0;
+ const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24;
+ GLenum color_format = screen->fbFormat == 4 ? GL_RGBA8 : GL_RGB5;
+
+ if (isPixmap)
+ return GL_FALSE; /* not implemented */
+
+ fb = _mesa_create_framebuffer(mesaVis);
+ if (!fb)
+ return GL_FALSE;
+
+ /* Front buffer */
+ nrb = nouveau_renderbuffer_new(color_format,
+ driScrnPriv->pFB + screen->frontOffset,
+ screen->frontOffset,
+ screen->frontPitch * screen->fbFormat,
+ driDrawPriv);
+ nouveauSpanSetFunctions(nrb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &nrb->mesa);
+
+ if (0 /* unified buffers if we choose to support them.. */) {
+ } else {
+ if (mesaVis->doubleBufferMode) {
+ nrb = nouveau_renderbuffer_new(color_format, NULL,
+ 0, 0,
+ NULL);
+ nouveauSpanSetFunctions(nrb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &nrb->mesa);
+ }
+
+ if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) {
+ nrb = nouveau_renderbuffer_new(GL_DEPTH24_STENCIL8_EXT, NULL,
+ 0, 0,
+ NULL);
+ nouveauSpanSetFunctions(nrb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &nrb->mesa);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &nrb->mesa);
+ } else if (mesaVis->depthBits == 24) {
+ nrb = nouveau_renderbuffer_new(GL_DEPTH_COMPONENT24, NULL,
+ 0, 0,
+ NULL);
+ nouveauSpanSetFunctions(nrb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &nrb->mesa);
+ } else if (mesaVis->depthBits == 16) {
+ nrb = nouveau_renderbuffer_new(GL_DEPTH_COMPONENT16, NULL,
+ 0, 0,
+ NULL);
+ nouveauSpanSetFunctions(nrb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &nrb->mesa);
+ }
+ }
+
+ _mesa_add_soft_renderbuffers(fb,
+ GL_FALSE, /* color */
+ GL_FALSE, /* depth */
+ swStencil,
+ swAccum,
+ GL_FALSE, /* alpha */
+ GL_FALSE /* aux */);
+
+ driDrawPriv->driverPrivate = (void *) fb;
+ return (driDrawPriv->driverPrivate != NULL);
+}
+
+
+static void
+nouveauDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
+{
+ _mesa_destroy_framebuffer((GLframebuffer *) (driDrawPriv->driverPrivate));
+}
+
+static int
+nouveauGetSwapInfo(__DRIdrawablePrivate *dpriv, __DRIswapInfo *sInfo)
+{
+ return -1;
+}
+
+static const struct __DriverAPIRec nouveauAPI = {
+ .InitDriver = nouveauInitDriver,
+ .DestroyScreen = nouveauDestroyScreen,
+ .CreateContext = nouveauCreateContext,
+ .DestroyContext = nouveauDestroyContext,
+ .CreateBuffer = nouveauCreateBuffer,
+ .DestroyBuffer = nouveauDestroyBuffer,
+ .SwapBuffers = nouveauSwapBuffers,
+ .MakeCurrent = nouveauMakeCurrent,
+ .UnbindContext = nouveauUnbindContext,
+ .GetSwapInfo = nouveauGetSwapInfo,
+ .GetMSC = driGetMSC32,
+ .WaitForMSC = driWaitForMSC32,
+ .WaitForSBC = NULL,
+ .SwapBuffersMSC = NULL,
+ .CopySubBuffer = nouveauCopySubBuffer
+};
+
+
+static __GLcontextModes *
+nouveauFillInModes( unsigned pixel_bits, unsigned depth_bits,
+ unsigned stencil_bits, GLboolean have_back_buffer )
+{
+ __GLcontextModes * modes;
+ __GLcontextModes * m;
+ unsigned num_modes;
+ unsigned depth_buffer_factor;
+ unsigned back_buffer_factor;
+ int i;
+
+ static const struct {
+ GLenum format;
+ GLenum type;
+ } fb_format_array[] = {
+ { GL_RGB , GL_UNSIGNED_SHORT_5_6_5 },
+ { GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV },
+ { GL_BGR , GL_UNSIGNED_INT_8_8_8_8_REV },
+ };
+
+ /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
+ * support pageflipping at all.
+ */
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ u_int8_t depth_bits_array[4] = { 0, 16, 24, 24 };
+ u_int8_t stencil_bits_array[4] = { 0, 0, 0, 8 };
+
+ depth_buffer_factor = 4;
+ back_buffer_factor = (have_back_buffer) ? 3 : 1;
+
+ num_modes = ((pixel_bits==16) ? 1 : 2) *
+ depth_buffer_factor * back_buffer_factor * 4;
+ modes = (*dri_interface->createContextModes)(num_modes,
+ sizeof(__GLcontextModes));
+ m = modes;
+
+ for (i=((pixel_bits==16)?0:1);i<((pixel_bits==16)?1:3);i++) {
+ if (!driFillInModes(&m, fb_format_array[i].format,
+ fb_format_array[i].type,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ GLX_TRUE_COLOR)) {
+ fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
+ __func__, __LINE__ );
+ return NULL;
+ }
+
+ if (!driFillInModes(&m, fb_format_array[i].format,
+ fb_format_array[i].type,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ GLX_DIRECT_COLOR)) {
+ fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
+ __func__, __LINE__ );
+ return NULL;
+ }
+ }
+
+ return modes;
+}
+
+
+/**
+ * This is the bootstrap function for the driver. libGL supplies all of the
+ * requisite information about the system, and the driver initializes itself.
+ * This routine also fills in the linked list pointed to by \c driver_modes
+ * with the \c __GLcontextModes that the driver can support for windows or
+ * pbuffers.
+ *
+ * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
+ * failure.
+ */
+PUBLIC
+void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+ const __GLcontextModes * modes,
+ const __DRIversion * ddx_version,
+ const __DRIversion * dri_version,
+ const __DRIversion * drm_version,
+ const __DRIframebuffer * frame_buffer,
+ drmAddress pSAREA, int fd,
+ int internal_api_version,
+ const __DRIinterfaceMethods * interface,
+ __GLcontextModes ** driver_modes)
+
+{
+ __DRIscreenPrivate *psp;
+ static const __DRIversion ddx_expected = { 1, 2, 0 };
+ static const __DRIversion dri_expected = { 4, 0, 0 };
+ static const __DRIversion drm_expected = { 0, 0, 2 };
+
+ dri_interface = interface;
+
+ if (!driCheckDriDdxDrmVersions2("nouveau",
+ dri_version, & dri_expected,
+ ddx_version, & ddx_expected,
+ drm_version, & drm_expected)) {
+ return NULL;
+ }
+
+ // temporary lock step versioning
+ if (drm_expected.patch!=drm_version->patch)
+ return NULL;
+
+ psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ ddx_version, dri_version, drm_version,
+ frame_buffer, pSAREA, fd,
+ internal_api_version, &nouveauAPI);
+ if ( psp != NULL ) {
+ NOUVEAUDRIPtr dri_priv = (NOUVEAUDRIPtr)psp->pDevPriv;
+
+ *driver_modes = nouveauFillInModes(dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ 1
+ );
+
+ /* Calling driInitExtensions here, with a NULL context pointer, does not actually
+ * enable the extensions. It just makes sure that all the dispatch offsets for all
+ * the extensions that *might* be enables are known. This is needed because the
+ * dispatch offsets need to be known when _mesa_context_create is called, but we can't
+ * enable the extensions until we have a context pointer.
+ *
+ * Hello chicken. Hello egg. How are you two today?
+ */
+ driInitExtensions( NULL, common_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv10_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv10_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv30_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv40_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv50_extensions, GL_FALSE );
+ }
+
+ return (void *) psp;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.h b/src/mesa/drivers/dri/nouveau/nouveau_screen.h
new file mode 100644
index 00000000000..decdafa86d5
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.h
@@ -0,0 +1,61 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#ifndef __NOUVEAU_SCREEN_H__
+#define __NOUVEAU_SCREEN_H__
+
+#include "xmlconfig.h"
+
+#include "nouveau_dri.h"
+#include "nouveau_card.h"
+
+typedef struct {
+ nouveau_card* card;
+ u_int32_t bus_type;
+ u_int32_t agp_mode;
+
+ GLint fbFormat;
+
+ GLuint frontOffset;
+ GLuint frontPitch;
+ GLuint backOffset;
+ GLuint backPitch;
+
+ GLuint depthOffset;
+ GLuint depthPitch;
+ GLuint spanOffset;
+
+ __DRIscreenPrivate *driScreen;
+ unsigned int sarea_priv_offset;
+
+ /* Configuration cache with default values for all contexts */
+ driOptionCache optionCache;
+
+} nouveauScreenRec, *nouveauScreenPtr;
+
+
+#endif /* __NOUVEAU_SCREEN_H__ */
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.c b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
new file mode 100644
index 00000000000..dc366b36c09
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
@@ -0,0 +1,798 @@
+/*
+ * Copyright (C) 2006 Ben Skeggs.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/*
+ * Authors:
+ * Ben Skeggs <[email protected]>
+ */
+
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+#include "extensions.h"
+
+#include "program.h"
+#include "tnl/tnl.h"
+#include "shader/arbprogparse.h"
+
+#include "nouveau_context.h"
+#include "nouveau_shader.h"
+
+/*****************************************************************************
+ * Mesa entry points
+ */
+static void
+nouveauBindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
+{
+}
+
+static struct gl_program *
+nouveauNewProgram(GLcontext *ctx, GLenum target, GLuint id)
+{
+ nouveauShader *nvs;
+
+ nvs = CALLOC_STRUCT(_nouveauShader);
+ switch (target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ return _mesa_init_vertex_program(ctx, &nvs->mesa.vp, target, id);
+ case GL_FRAGMENT_PROGRAM_ARB:
+ return _mesa_init_fragment_program(ctx, &nvs->mesa.fp, target, id);
+ default:
+ _mesa_problem(ctx, "Unsupported shader target");
+ break;
+ }
+
+ FREE(nvs);
+ return NULL;
+}
+
+static void
+nouveauDeleteProgram(GLcontext *ctx, struct gl_program *prog)
+{
+ nouveauShader *nvs = (nouveauShader *)prog;
+
+ if (nvs->translated)
+ FREE(nvs->program);
+ _mesa_delete_program(ctx, prog);
+}
+
+static void
+nouveauProgramStringNotify(GLcontext *ctx, GLenum target,
+ struct gl_program *prog)
+{
+ nouveauShader *nvs = (nouveauShader *)prog;
+
+ if (nvs->translated)
+ FREE(nvs->program);
+ nvs->translated = 0;
+
+ _tnl_program_string(ctx, target, prog);
+}
+
+static GLboolean
+nouveauIsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog)
+{
+ nouveauShader *nvs = (nouveauShader *)prog;
+
+ return nvs->translated;
+}
+
+GLboolean
+nvsUpdateShader(GLcontext *ctx, nouveauShader *nvs)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ struct gl_program_parameter_list *plist;
+ int i;
+
+ /* Translate to HW format now if necessary */
+ if (!nvs->translated) {
+ /* Mesa ASM shader -> nouveauShader */
+ if (!nouveau_shader_pass0_arb(ctx, nvs))
+ return GL_FALSE;
+ /* Basic dead code elimination + register usage info */
+ if (!nouveau_shader_pass1(nvs))
+ return GL_FALSE;
+ /* nouveauShader -> HW bytecode, HW register alloc */
+ if (!nouveau_shader_pass2(nvs))
+ return GL_FALSE;
+ assert(nvs->translated);
+ assert(nvs->program);
+ }
+
+ /* Update state parameters */
+ plist = nvs->mesa.vp.Base.Parameters;
+ _mesa_load_state_parameters(ctx, plist);
+ for (i=0; i<plist->NumParameters; i++) {
+ if (!nvs->on_hardware) {
+ /* if we've been kicked off the hardware there's no guarantee our
+ * consts are still there.. reupload them all
+ */
+ nvs->func->UpdateConst(ctx, nvs, i);
+ } else if (plist->Parameters[i].Type == PROGRAM_STATE_VAR) {
+ if (!nvs->params[i].source_val) /* this is a workaround when consts aren't alloc'd from id=0.. */
+ continue;
+ /* update any changed state parameters */
+ if (!TEST_EQ_4V(nvs->params[i].val, nvs->params[i].source_val))
+ nvs->func->UpdateConst(ctx, nvs, i);
+ }
+ }
+
+ /* Upload program to hardware, this must come after state param update
+ * as >=NV30 fragprogs inline consts into the bytecode.
+ */
+ if (!nvs->on_hardware) {
+ nouveauShader **current;
+
+ if (nvs->mesa.vp.Base.Target == GL_VERTEX_PROGRAM_ARB)
+ current = &nmesa->current_vertprog;
+ else
+ current = &nmesa->current_fragprog;
+ if (*current) (*current)->on_hardware = 0;
+
+ nvs->func->UploadToHW(ctx, nvs);
+ nvs->on_hardware = 1;
+
+ *current = nvs;
+ }
+
+ return GL_TRUE;
+}
+
+nouveauShader *
+nvsBuildTextShader(GLcontext *ctx, GLenum target, const char *text)
+{
+ nouveauShader *nvs;
+
+ nvs = CALLOC_STRUCT(_nouveauShader);
+ if (!nvs)
+ return NULL;
+
+ if (target == GL_VERTEX_PROGRAM_ARB) {
+ _mesa_init_vertex_program(ctx, &nvs->mesa.vp, GL_VERTEX_PROGRAM_ARB, 0);
+ _mesa_parse_arb_vertex_program(ctx,
+ GL_VERTEX_PROGRAM_ARB,
+ text,
+ strlen(text),
+ &nvs->mesa.vp);
+ } else if (target == GL_FRAGMENT_PROGRAM_ARB) {
+ _mesa_init_fragment_program(ctx, &nvs->mesa.fp, GL_VERTEX_PROGRAM_ARB, 0);
+ _mesa_parse_arb_fragment_program(ctx,
+ GL_FRAGMENT_PROGRAM_ARB,
+ text,
+ strlen(text),
+ &nvs->mesa.fp);
+ }
+
+ nouveau_shader_pass0_arb(ctx, nvs);
+ nouveau_shader_pass1(nvs);
+ nouveau_shader_pass2(nvs);
+
+ return nvs;
+}
+
+static void
+nvsBuildPassthroughVP(GLcontext *ctx)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ const char *vp_text =
+ "!!ARBvp1.0\n"
+ "OPTION ARB_position_invariant;"
+ ""
+ "MOV result.color, vertex.color;\n"
+ "MOV result.texcoord[0], vertex.texcoord[0];\n"
+ "MOV result.texcoord[1], vertex.texcoord[1];\n"
+ "MOV result.texcoord[2], vertex.texcoord[2];\n"
+ "MOV result.texcoord[3], vertex.texcoord[3];\n"
+ "MOV result.texcoord[4], vertex.texcoord[4];\n"
+ "MOV result.texcoord[5], vertex.texcoord[5];\n"
+ "MOV result.texcoord[6], vertex.texcoord[6];\n"
+ "MOV result.texcoord[7], vertex.texcoord[7];\n"
+ "END";
+
+ nmesa->passthrough_vp = nvsBuildTextShader(ctx,
+ GL_VERTEX_PROGRAM_ARB,
+ vp_text);
+}
+
+void
+nouveauShaderInitFuncs(GLcontext * ctx)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ switch (nmesa->screen->card->type) {
+ case NV_20:
+ NV20VPInitShaderFuncs(&nmesa->VPfunc);
+ break;
+ case NV_30:
+ NV30VPInitShaderFuncs(&nmesa->VPfunc);
+ NV30FPInitShaderFuncs(&nmesa->FPfunc);
+ break;
+ case NV_40:
+ case NV_44:
+ NV40VPInitShaderFuncs(&nmesa->VPfunc);
+ NV40FPInitShaderFuncs(&nmesa->FPfunc);
+ break;
+ case NV_50:
+ default:
+ return;
+ }
+
+ /* Build a vertex program that simply passes through all attribs.
+ * Needed to do swtcl on nv40
+ */
+ if (nmesa->screen->card->type >= NV_40)
+ nvsBuildPassthroughVP(ctx);
+
+ ctx->Const.VertexProgram.MaxNativeInstructions = nmesa->VPfunc.MaxInst;
+ ctx->Const.VertexProgram.MaxNativeAluInstructions = nmesa->VPfunc.MaxInst;
+ ctx->Const.VertexProgram.MaxNativeTexInstructions = nmesa->VPfunc.MaxInst;
+ ctx->Const.VertexProgram.MaxNativeTexIndirections =
+ ctx->Const.VertexProgram.MaxNativeTexInstructions;
+ ctx->Const.VertexProgram.MaxNativeAttribs = nmesa->VPfunc.MaxAttrib;
+ ctx->Const.VertexProgram.MaxNativeTemps = nmesa->VPfunc.MaxTemp;
+ ctx->Const.VertexProgram.MaxNativeAddressRegs = nmesa->VPfunc.MaxAddress;
+ ctx->Const.VertexProgram.MaxNativeParameters = nmesa->VPfunc.MaxConst;
+
+ if (nmesa->screen->card->type >= NV_30) {
+ ctx->Const.FragmentProgram.MaxNativeInstructions = nmesa->FPfunc.MaxInst;
+ ctx->Const.FragmentProgram.MaxNativeAluInstructions = nmesa->FPfunc.MaxInst;
+ ctx->Const.FragmentProgram.MaxNativeTexInstructions = nmesa->FPfunc.MaxInst;
+ ctx->Const.FragmentProgram.MaxNativeTexIndirections =
+ ctx->Const.FragmentProgram.MaxNativeTexInstructions;
+ ctx->Const.FragmentProgram.MaxNativeAttribs = nmesa->FPfunc.MaxAttrib;
+ ctx->Const.FragmentProgram.MaxNativeTemps = nmesa->FPfunc.MaxTemp;
+ ctx->Const.FragmentProgram.MaxNativeAddressRegs = nmesa->FPfunc.MaxAddress;
+ ctx->Const.FragmentProgram.MaxNativeParameters = nmesa->FPfunc.MaxConst;
+ }
+
+ ctx->Driver.NewProgram = nouveauNewProgram;
+ ctx->Driver.BindProgram = nouveauBindProgram;
+ ctx->Driver.DeleteProgram = nouveauDeleteProgram;
+ ctx->Driver.ProgramStringNotify = nouveauProgramStringNotify;
+ ctx->Driver.IsProgramNative = nouveauIsProgramNative;
+}
+
+
+/*****************************************************************************
+ * Disassembly support structs
+ */
+#define CHECK_RANGE(idx, arr) ((idx)<sizeof(_##arr)/sizeof(const char *)) \
+ ? _##arr[(idx)] : #arr"_OOB"
+
+#define NODS (1<<0)
+#define BRANCH_TR (1<<1)
+#define BRANCH_EL (1<<2)
+#define BRANCH_EN (1<<3)
+#define BRANCH_RE (1<<4)
+#define BRANCH_ALL (BRANCH_TR|BRANCH_EL|BRANCH_EN)
+#define COUNT_INC (1<<4)
+#define COUNT_IND (1<<5)
+#define COUNT_NUM (1<<6)
+#define COUNT_ALL (COUNT_INC|COUNT_IND|COUNT_NUM)
+#define TI_UNIT (1<<7)
+struct _opcode_info
+{
+ const char *name;
+ int numsrc;
+ int flags;
+};
+
+static struct _opcode_info ops[] = {
+ [NVS_OP_ABS] = {"ABS", 1, 0},
+ [NVS_OP_ADD] = {"ADD", 2, 0},
+ [NVS_OP_ARA] = {"ARA", 1, 0},
+ [NVS_OP_ARL] = {"ARL", 1, 0},
+ [NVS_OP_ARR] = {"ARR", 1, 0},
+ [NVS_OP_BRA] = {"BRA", 0, NODS | BRANCH_TR},
+ [NVS_OP_BRK] = {"BRK", 0, NODS},
+ [NVS_OP_CAL] = {"CAL", 0, NODS | BRANCH_TR},
+ [NVS_OP_CMP] = {"CMP", 2, 0},
+ [NVS_OP_COS] = {"COS", 1, 0},
+ [NVS_OP_DIV] = {"DIV", 2, 0},
+ [NVS_OP_DDX] = {"DDX", 1, 0},
+ [NVS_OP_DDY] = {"DDY", 1, 0},
+ [NVS_OP_DP2] = {"DP2", 2, 0},
+ [NVS_OP_DP2A] = {"DP2A", 3, 0},
+ [NVS_OP_DP3] = {"DP3", 2, 0},
+ [NVS_OP_DP4] = {"DP4", 2, 0},
+ [NVS_OP_DPH] = {"DPH", 2, 0},
+ [NVS_OP_DST] = {"DST", 2, 0},
+ [NVS_OP_EX2] = {"EX2", 1, 0},
+ [NVS_OP_EXP] = {"EXP", 1, 0},
+ [NVS_OP_FLR] = {"FLR", 1, 0},
+ [NVS_OP_FRC] = {"FRC", 1, 0},
+ [NVS_OP_IF] = {"IF", 0, NODS | BRANCH_EL | BRANCH_EN},
+ [NVS_OP_KIL] = {"KIL", 1, 0},
+ [NVS_OP_LG2] = {"LG2", 1, 0},
+ [NVS_OP_LIT] = {"LIT", 1, 0},
+ [NVS_OP_LOG] = {"LOG", 1, 0},
+ [NVS_OP_LOOP] = {"LOOP", 0, NODS | COUNT_ALL | BRANCH_EN},
+ [NVS_OP_LRP] = {"LRP", 3, 0},
+ [NVS_OP_MAD] = {"MAD", 3, 0},
+ [NVS_OP_MAX] = {"MAX", 2, 0},
+ [NVS_OP_MIN] = {"MIN", 2, 0},
+ [NVS_OP_MOV] = {"MOV", 1, 0},
+ [NVS_OP_MUL] = {"MUL", 2, 0},
+ [NVS_OP_NRM] = {"NRM", 1, 0},
+ [NVS_OP_PK2H] = {"PK2H", 1, 0},
+ [NVS_OP_PK2US] = {"PK2US", 1, 0},
+ [NVS_OP_PK4B] = {"PK4B", 1, 0},
+ [NVS_OP_PK4UB] = {"PK4UB", 1, 0},
+ [NVS_OP_POW] = {"POW", 2, 0},
+ [NVS_OP_POPA] = {"POPA", 0, 0},
+ [NVS_OP_PUSHA] = {"PUSHA", 1, NODS},
+ [NVS_OP_RCC] = {"RCC", 1, 0},
+ [NVS_OP_RCP] = {"RCP", 1, 0},
+ [NVS_OP_REP] = {"REP", 0, NODS | BRANCH_EN | COUNT_NUM},
+ [NVS_OP_RET] = {"RET", 0, NODS},
+ [NVS_OP_RFL] = {"RFL", 1, 0},
+ [NVS_OP_RSQ] = {"RSQ", 1, 0},
+ [NVS_OP_SCS] = {"SCS", 1, 0},
+ [NVS_OP_SEQ] = {"SEQ", 2, 0},
+ [NVS_OP_SFL] = {"SFL", 2, 0},
+ [NVS_OP_SGE] = {"SGE", 2, 0},
+ [NVS_OP_SGT] = {"SGT", 2, 0},
+ [NVS_OP_SIN] = {"SIN", 1, 0},
+ [NVS_OP_SLE] = {"SLE", 2, 0},
+ [NVS_OP_SLT] = {"SLT", 2, 0},
+ [NVS_OP_SNE] = {"SNE", 2, 0},
+ [NVS_OP_SSG] = {"SSG", 1, 0},
+ [NVS_OP_STR] = {"STR", 2, 0},
+ [NVS_OP_SUB] = {"SUB", 2, 0},
+ [NVS_OP_TEX] = {"TEX", 1, TI_UNIT},
+ [NVS_OP_TXB] = {"TXB", 1, TI_UNIT},
+ [NVS_OP_TXD] = {"TXD", 3, TI_UNIT},
+ [NVS_OP_TXL] = {"TXL", 1, TI_UNIT},
+ [NVS_OP_TXP] = {"TXP", 1, TI_UNIT},
+ [NVS_OP_UP2H] = {"UP2H", 1, 0},
+ [NVS_OP_UP2US] = {"UP2US", 1, 0},
+ [NVS_OP_UP4B] = {"UP4B", 1, 0},
+ [NVS_OP_UP4UB] = {"UP4UB", 1, 0},
+ [NVS_OP_X2D] = {"X2D", 3, 0},
+ [NVS_OP_XPD] = {"XPD", 2, 0},
+ [NVS_OP_NOP] = {"NOP", 0, NODS},
+};
+
+static struct _opcode_info *
+_get_op_info(int op)
+{
+ if (op >= (sizeof(ops) / sizeof(struct _opcode_info)))
+ return NULL;
+ if (ops[op].name == NULL)
+ return NULL;
+ return &ops[op];
+}
+
+static const char *_SFR_STRING[] = {
+ [NVS_FR_POSITION] = "position",
+ [NVS_FR_WEIGHT] = "weight",
+ [NVS_FR_NORMAL] = "normal",
+ [NVS_FR_COL0] = "color",
+ [NVS_FR_COL1] = "color.secondary",
+ [NVS_FR_BFC0] = "bfc",
+ [NVS_FR_BFC1] = "bfc.secondary",
+ [NVS_FR_FOGCOORD] = "fogcoord",
+ [NVS_FR_POINTSZ] = "pointsize",
+ [NVS_FR_TEXCOORD0] = "texcoord[0]",
+ [NVS_FR_TEXCOORD1] = "texcoord[1]",
+ [NVS_FR_TEXCOORD2] = "texcoord[2]",
+ [NVS_FR_TEXCOORD3] = "texcoord[3]",
+ [NVS_FR_TEXCOORD4] = "texcoord[4]",
+ [NVS_FR_TEXCOORD5] = "texcoord[5]",
+ [NVS_FR_TEXCOORD6] = "texcoord[6]",
+ [NVS_FR_TEXCOORD7] = "texcoord[7]",
+ [NVS_FR_FRAGDATA0] = "data[0]",
+ [NVS_FR_FRAGDATA1] = "data[1]",
+ [NVS_FR_FRAGDATA2] = "data[2]",
+ [NVS_FR_FRAGDATA3] = "data[3]",
+ [NVS_FR_CLIP0] = "clip_plane[0]",
+ [NVS_FR_CLIP1] = "clip_plane[1]",
+ [NVS_FR_CLIP2] = "clip_plane[2]",
+ [NVS_FR_CLIP3] = "clip_plane[3]",
+ [NVS_FR_CLIP4] = "clip_plane[4]",
+ [NVS_FR_CLIP5] = "clip_plane[5]",
+ [NVS_FR_CLIP6] = "clip_plane[6]",
+ [NVS_FR_FACING] = "facing",
+};
+
+#define SFR_STRING(idx) CHECK_RANGE((idx), SFR_STRING)
+
+static const char *_SWZ_STRING[] = {
+ [NVS_SWZ_X] = "x",
+ [NVS_SWZ_Y] = "y",
+ [NVS_SWZ_Z] = "z",
+ [NVS_SWZ_W] = "w"
+};
+
+#define SWZ_STRING(idx) CHECK_RANGE((idx), SWZ_STRING)
+
+static const char *_NVS_PREC_STRING[] = {
+ [NVS_PREC_FLOAT32] = "R",
+ [NVS_PREC_FLOAT16] = "H",
+ [NVS_PREC_FIXED12] = "X",
+ [NVS_PREC_UNKNOWN] = "?"
+};
+
+#define NVS_PREC_STRING(idx) CHECK_RANGE((idx), NVS_PREC_STRING)
+
+static const char *_NVS_COND_STRING[] = {
+ [NVS_COND_FL] = "FL",
+ [NVS_COND_LT] = "LT",
+ [NVS_COND_EQ] = "EQ",
+ [NVS_COND_LE] = "LE",
+ [NVS_COND_GT] = "GT",
+ [NVS_COND_NE] = "NE",
+ [NVS_COND_GE] = "GE",
+ [NVS_COND_TR] = "TR",
+ [NVS_COND_UNKNOWN] = "??"
+};
+
+#define NVS_COND_STRING(idx) CHECK_RANGE((idx), NVS_COND_STRING)
+
+/*****************************************************************************
+ * ShaderFragment dumping
+ */
+static void
+nvsDumpIndent(int lvl)
+{
+ while (lvl--)
+ printf(" ");
+}
+
+static void
+nvsDumpSwizzle(nvsSwzComp *swz)
+{
+ printf(".%s%s%s%s",
+ SWZ_STRING(swz[0]),
+ SWZ_STRING(swz[1]), SWZ_STRING(swz[2]), SWZ_STRING(swz[3])
+ );
+}
+
+static void
+nvsDumpReg(nvsInstruction * inst, nvsRegister * reg)
+{
+ if (reg->negate)
+ printf("-");
+ if (reg->abs)
+ printf("abs(");
+
+ switch (reg->file) {
+ case NVS_FILE_TEMP:
+ printf("R%d", reg->index);
+ nvsDumpSwizzle(reg->swizzle);
+ break;
+ case NVS_FILE_ATTRIB:
+ printf("attrib.%s", SFR_STRING(reg->index));
+ nvsDumpSwizzle(reg->swizzle);
+ break;
+ case NVS_FILE_ADDRESS:
+ printf("A%d", reg->index);
+ break;
+ case NVS_FILE_CONST:
+ if (reg->indexed)
+ printf("const[A%d.%s + %d]",
+ reg->addr_reg, SWZ_STRING(reg->addr_comp), reg->index);
+ else
+ printf("const[%d]", reg->index);
+ nvsDumpSwizzle(reg->swizzle);
+ break;
+ default:
+ printf("UNKNOWN_FILE");
+ break;
+ }
+
+ if (reg->abs)
+ printf(")");
+}
+
+static void
+nvsDumpInstruction(nvsInstruction * inst, int slot, int lvl)
+{
+ struct _opcode_info *opr = &ops[inst->op];
+ int i;
+
+ nvsDumpIndent(lvl);
+ printf("%s ", opr->name);
+
+ if (!opr->flags & NODS) {
+ switch (inst->dest.file) {
+ case NVS_FILE_RESULT:
+ printf("result.%s", SFR_STRING(inst->dest.index));
+ break;
+ case NVS_FILE_TEMP:
+ printf("R%d", inst->dest.index);
+ break;
+ case NVS_FILE_ADDRESS:
+ printf("A%d", inst->dest.index);
+ break;
+ default:
+ printf("UNKNOWN_DST_FILE");
+ break;
+ }
+
+ if (inst->mask != SMASK_ALL) {
+ printf(".");
+ if (inst->mask & SMASK_X)
+ printf("x");
+ if (inst->mask & SMASK_Y)
+ printf("y");
+ if (inst->mask & SMASK_Z)
+ printf("z");
+ if (inst->mask & SMASK_W)
+ printf("w");
+ }
+
+ if (opr->numsrc)
+ printf(", ");
+ }
+
+ for (i = 0; i < opr->numsrc; i++) {
+ nvsDumpReg(inst, &inst->src[i]);
+ if (i != opr->numsrc - 1)
+ printf(", ");
+ }
+ if (opr->flags & TI_UNIT)
+ printf(", texture[%d]", inst->tex_unit);
+
+ printf("\n");
+}
+
+void
+nvsDumpFragmentList(nvsFragmentList *f, int lvl)
+{
+ while (f) {
+ switch (f->fragment->type) {
+ case NVS_INSTRUCTION:
+ nvsDumpInstruction((nvsInstruction*)f->fragment, 0, lvl);
+ break;
+ default:
+ fprintf(stderr, "%s: Only NVS_INSTRUCTION fragments can be in"
+ "nvsFragmentList!\n", __func__);
+ return;
+ }
+ f = f->next;
+ }
+}
+
+/*****************************************************************************
+ * HW shader disassembly
+ */
+static void
+nvsDisasmHWShaderOp(nvsFunc * shader, int merged)
+{
+ struct _opcode_info *opi;
+ nvsOpcode op;
+ nvsRegFile file;
+ nvsSwzComp swz[4];
+ int i;
+
+ op = shader->GetOpcode(shader, merged);
+ opi = _get_op_info(op);
+ if (!opi) {
+ printf("NO OPINFO!");
+ return;
+ }
+
+ printf("%s", opi->name);
+ if (shader->GetPrecision &&
+ (!(opi->flags & BRANCH_ALL)) && (!(opi->flags * NODS)) &&
+ (op != NVS_OP_NOP))
+ printf("%s", NVS_PREC_STRING(shader->GetPrecision(shader)));
+ if (shader->SupportsConditional && shader->SupportsConditional(shader)) {
+ if (shader->GetConditionUpdate(shader)) {
+ printf("C%d", shader->GetCondRegID(shader));
+ }
+ }
+ if (shader->GetSaturate && shader->GetSaturate(shader))
+ printf("_SAT");
+
+ if (!(opi->flags & NODS)) {
+ int mask = shader->GetDestMask(shader, merged);
+
+ switch (shader->GetDestFile(shader, merged)) {
+ case NVS_FILE_ADDRESS:
+ printf(" A%d", shader->GetDestID(shader, merged));
+ break;
+ case NVS_FILE_TEMP:
+ printf(" R%d", shader->GetDestID(shader, merged));
+ break;
+ case NVS_FILE_RESULT:
+ printf(" result.%s", (SFR_STRING(shader->GetDestID(shader, merged))));
+ break;
+ default:
+ printf(" BAD_RESULT_FILE");
+ break;
+ }
+
+ if (mask != SMASK_ALL) {
+ printf(".");
+ if (mask & SMASK_X) printf("x");
+ if (mask & SMASK_Y) printf("y");
+ if (mask & SMASK_Z) printf("z");
+ if (mask & SMASK_W) printf("w");
+ }
+ }
+
+ if (shader->SupportsConditional && shader->SupportsConditional(shader) &&
+ shader->GetConditionTest(shader)) {
+ shader->GetCondRegSwizzle(shader, swz);
+
+ printf(" (%s%d.%s%s%s%s)",
+ NVS_COND_STRING(shader->GetCondition(shader)),
+ shader->GetCondRegID(shader),
+ SWZ_STRING(swz[NVS_SWZ_X]),
+ SWZ_STRING(swz[NVS_SWZ_Y]),
+ SWZ_STRING(swz[NVS_SWZ_Z]),
+ SWZ_STRING(swz[NVS_SWZ_W])
+ );
+ }
+
+ /* looping */
+ if (opi->flags & COUNT_ALL) {
+ printf(" { ");
+ if (opi->flags & COUNT_NUM) {
+ printf("%d", shader->GetLoopCount(shader));
+ }
+ if (opi->flags & COUNT_IND) {
+ printf(", %d", shader->GetLoopInitial(shader));
+ }
+ if (opi->flags & COUNT_INC) {
+ printf(", %d", shader->GetLoopIncrement(shader));
+ }
+ printf(" }");
+ }
+
+ /* branching */
+ if (opi->flags & BRANCH_TR)
+ printf(" %d", shader->GetBranch(shader));
+ if (opi->flags & BRANCH_EL)
+ printf(" ELSE %d", shader->GetBranchElse(shader));
+ if (opi->flags & BRANCH_EN)
+ printf(" END %d", shader->GetBranchEnd(shader));
+
+ if (!(opi->flags & NODS) && opi->numsrc)
+ printf(",");
+ printf(" ");
+
+ for (i = 0; i < opi->numsrc; i++) {
+ if (shader->GetSourceAbs(shader, merged, i))
+ printf("abs(");
+ if (shader->GetSourceNegate(shader, merged, i))
+ printf("-");
+
+ file = shader->GetSourceFile(shader, merged, i);
+ switch (file) {
+ case NVS_FILE_TEMP:
+ printf("R%d", shader->GetSourceID(shader, merged, i));
+ break;
+ case NVS_FILE_CONST:
+ if (shader->GetSourceIndexed(shader, merged, i)) {
+ printf("c[A%d.%s + 0x%x]",
+ shader->GetRelAddressRegID(shader),
+ SWZ_STRING(shader->GetRelAddressSwizzle(shader)),
+ shader->GetSourceID(shader, merged, i)
+ );
+ } else {
+ float val[4];
+
+ if (shader->GetSourceConstVal) {
+ shader->GetSourceConstVal(shader, merged, i, val);
+ printf("{ %.02f, %.02f, %.02f, %.02f }",
+ val[0], val[1], val[2], val[3]);
+ } else {
+ printf("c[0x%x]", shader->GetSourceID(shader, merged, i));
+ }
+ }
+ break;
+ case NVS_FILE_ATTRIB:
+ if (shader->GetSourceIndexed(shader, merged, i)) {
+ printf("attrib[A%d.%s + %d]",
+ shader->GetRelAddressRegID(shader),
+ SWZ_STRING(shader->GetRelAddressSwizzle(shader)),
+ shader->GetSourceID(shader, merged, i)
+ );
+ }
+ else {
+ printf("attrib.%s",
+ SFR_STRING(shader->GetSourceID(shader, merged, i))
+ );
+ }
+ break;
+ case NVS_FILE_ADDRESS:
+ printf("A%d", shader->GetRelAddressRegID(shader));
+ break;
+ default:
+ printf("UNKNOWN_SRC_FILE");
+ break;
+ }
+
+ shader->GetSourceSwizzle(shader, merged, i, swz);
+ if (file != NVS_FILE_ADDRESS &&
+ (swz[NVS_SWZ_X] != NVS_SWZ_X || swz[NVS_SWZ_Y] != NVS_SWZ_Y ||
+ swz[NVS_SWZ_Z] != NVS_SWZ_Z || swz[NVS_SWZ_W] != NVS_SWZ_W)) {
+ printf(".%s%s%s%s", SWZ_STRING(swz[NVS_SWZ_X]),
+ SWZ_STRING(swz[NVS_SWZ_Y]),
+ SWZ_STRING(swz[NVS_SWZ_Z]),
+ SWZ_STRING(swz[NVS_SWZ_W]));
+ }
+
+ if (shader->GetSourceAbs(shader, merged, i))
+ printf(")");
+ if (shader->GetSourceScale) {
+ int scale = shader->GetSourceScale(shader, merged, i);
+ if (scale > 1)
+ printf("{scaled %dx}", scale);
+ }
+ if (i < (opi->numsrc - 1))
+ printf(", ");
+ }
+
+ if (shader->IsLastInst(shader))
+ printf(" + END");
+}
+
+void
+nvsDisasmHWShader(nvsPtr nvs)
+{
+ nvsFunc *shader = nvs->func;
+ unsigned int iaddr = 0;
+
+ if (!nvs->program) {
+ fprintf(stderr, "No HW program present");
+ return;
+ }
+
+ shader->inst = nvs->program;
+ while (1) {
+ if (shader->inst >= (nvs->program + nvs->program_size)) {
+ fprintf(stderr, "Reached end of program, but HW inst has no END");
+ break;
+ }
+
+ printf("\t0x%08x:\n", shader->inst[0]);
+ printf("\t0x%08x:\n", shader->inst[1]);
+ printf("\t0x%08x:\n", shader->inst[2]);
+ printf("\t0x%08x:", shader->inst[3]);
+
+ printf("\n\t\tINST %d.0: ", iaddr);
+ nvsDisasmHWShaderOp(shader, 0);
+ if (shader->HasMergedInst(shader)) {
+ printf("\n\t\tINST %d.1: ", iaddr);
+ nvsDisasmHWShaderOp(shader, 1);
+ }
+ printf("\n");
+
+ if (shader->IsLastInst(shader))
+ break;
+
+ shader->inst += shader->GetOffsetNext(shader);
+ iaddr++;
+ }
+
+ printf("\n");
+}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.h b/src/mesa/drivers/dri/nouveau/nouveau_shader.h
new file mode 100644
index 00000000000..08cb7817cf0
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.h
@@ -0,0 +1,374 @@
+#ifndef __SHADER_COMMON_H__
+#define __SHADER_COMMON_H__
+
+#include "mtypes.h"
+#include "bufferobj.h"
+
+typedef struct _nvsFunc nvsFunc;
+
+#define NVS_MAX_TEMPS 32
+#define NVS_MAX_ATTRIBS 16
+#define NVS_MAX_CONSTS 256
+#define NVS_MAX_ADDRESS 2
+#define NVS_MAX_INSNS 4096
+
+typedef struct {
+ enum {
+ NVS_INSTRUCTION,
+ } type;
+ int position;
+} nvsFragmentHeader;
+
+typedef struct _nvs_fragment_list {
+ struct _nvs_fragment_list *prev;
+ struct _nvs_fragment_list *next;
+ nvsFragmentHeader *fragment;
+} nvsFragmentList;
+
+typedef struct _nouveauShader {
+ union {
+ struct gl_vertex_program vp;
+ struct gl_fragment_program fp;
+ } mesa;
+ GLcontext *ctx;
+ nvsFunc *func;
+
+ /* State of the final program */
+ GLboolean translated;
+ GLboolean on_hardware;
+ unsigned int *program;
+ unsigned int program_size;
+ unsigned int program_alloc_size;
+ unsigned int program_start_id;
+ unsigned int program_current;
+ struct gl_buffer_object *program_buffer;
+ unsigned int inputs_read;
+ unsigned int outputs_written;
+ int inst_count;
+
+ struct {
+ GLfloat *source_val; /* NULL if invariant */
+ float val[4];
+ /* Hardware-specific tracking, currently only nv30_fragprog
+ * makes use of it.
+ */
+ int *hw_index;
+ int hw_index_cnt;
+ } params[NVS_MAX_CONSTS];
+
+ struct {
+ int last_use;
+ } temps[NVS_MAX_TEMPS];
+
+ /* Pass-private data */
+ void *pass_rec;
+
+ nvsFragmentList *list_head;
+ nvsFragmentList *list_tail;
+} nouveauShader, *nvsPtr;
+
+typedef enum {
+ NVS_FILE_NONE,
+ NVS_FILE_TEMP,
+ NVS_FILE_ATTRIB,
+ NVS_FILE_CONST,
+ NVS_FILE_RESULT,
+ NVS_FILE_ADDRESS,
+ NVS_FILE_UNKNOWN
+} nvsRegFile;
+
+typedef enum {
+ NVS_OP_UNKNOWN = 0,
+ NVS_OP_NOP,
+ NVS_OP_ABS, NVS_OP_ADD, NVS_OP_ARA, NVS_OP_ARL, NVS_OP_ARR,
+ NVS_OP_BRA, NVS_OP_BRK,
+ NVS_OP_CAL, NVS_OP_CMP, NVS_OP_COS,
+ NVS_OP_DDX, NVS_OP_DDY, NVS_OP_DIV, NVS_OP_DP2, NVS_OP_DP2A, NVS_OP_DP3,
+ NVS_OP_DP4, NVS_OP_DPH, NVS_OP_DST,
+ NVS_OP_EX2, NVS_OP_EXP,
+ NVS_OP_FLR, NVS_OP_FRC,
+ NVS_OP_IF,
+ NVS_OP_KIL,
+ NVS_OP_LG2, NVS_OP_LIT, NVS_OP_LOG, NVS_OP_LOOP, NVS_OP_LRP,
+ NVS_OP_MAD, NVS_OP_MAX, NVS_OP_MIN, NVS_OP_MOV, NVS_OP_MUL,
+ NVS_OP_NRM,
+ NVS_OP_PK2H, NVS_OP_PK2US, NVS_OP_PK4B, NVS_OP_PK4UB, NVS_OP_POW,
+ NVS_OP_POPA, NVS_OP_PUSHA,
+ NVS_OP_RCC, NVS_OP_RCP, NVS_OP_REP, NVS_OP_RET, NVS_OP_RFL, NVS_OP_RSQ,
+ NVS_OP_SCS, NVS_OP_SEQ, NVS_OP_SFL, NVS_OP_SGE, NVS_OP_SGT, NVS_OP_SIN,
+ NVS_OP_SLE, NVS_OP_SLT, NVS_OP_SNE, NVS_OP_SSG, NVS_OP_STR, NVS_OP_SUB,
+ NVS_OP_SWZ,
+ NVS_OP_TEX, NVS_OP_TXB, NVS_OP_TXD, NVS_OP_TXL, NVS_OP_TXP,
+ NVS_OP_UP2H, NVS_OP_UP2US, NVS_OP_UP4B, NVS_OP_UP4UB,
+ NVS_OP_X2D, NVS_OP_XPD,
+ NVS_OP_EMUL
+} nvsOpcode;
+
+typedef enum {
+ NVS_PREC_FLOAT32,
+ NVS_PREC_FLOAT16,
+ NVS_PREC_FIXED12,
+ NVS_PREC_UNKNOWN
+} nvsPrecision;
+
+typedef enum {
+ NVS_SWZ_X = 0,
+ NVS_SWZ_Y = 1,
+ NVS_SWZ_Z = 2,
+ NVS_SWZ_W = 3
+} nvsSwzComp;
+
+typedef enum {
+ NVS_FR_POSITION,
+ NVS_FR_WEIGHT,
+ NVS_FR_NORMAL,
+ NVS_FR_COL0,
+ NVS_FR_COL1,
+ NVS_FR_BFC0,
+ NVS_FR_BFC1,
+ NVS_FR_FOGCOORD,
+ NVS_FR_POINTSZ,
+ NVS_FR_TEXCOORD0,
+ NVS_FR_TEXCOORD1,
+ NVS_FR_TEXCOORD2,
+ NVS_FR_TEXCOORD3,
+ NVS_FR_TEXCOORD4,
+ NVS_FR_TEXCOORD5,
+ NVS_FR_TEXCOORD6,
+ NVS_FR_TEXCOORD7,
+ NVS_FR_FRAGDATA0,
+ NVS_FR_FRAGDATA1,
+ NVS_FR_FRAGDATA2,
+ NVS_FR_FRAGDATA3,
+ NVS_FR_CLIP0,
+ NVS_FR_CLIP1,
+ NVS_FR_CLIP2,
+ NVS_FR_CLIP3,
+ NVS_FR_CLIP4,
+ NVS_FR_CLIP5,
+ NVS_FR_CLIP6,
+ NVS_FR_FACING,
+ NVS_FR_UNKNOWN
+} nvsFixedReg;
+
+typedef enum {
+ NVS_COND_FL, NVS_COND_LT, NVS_COND_EQ, NVS_COND_LE, NVS_COND_GT,
+ NVS_COND_NE, NVS_COND_GE, NVS_COND_TR, NVS_COND_UN,
+ NVS_COND_UNKNOWN
+} nvsCond;
+
+typedef struct {
+ nvsRegFile file;
+ unsigned int index;
+
+ unsigned int indexed;
+ unsigned int addr_reg;
+ nvsSwzComp addr_comp;
+
+ nvsSwzComp swizzle[4];
+ int negate;
+ int abs;
+} nvsRegister;
+
+static const nvsRegister nvr_unused = {
+ .file = NVS_FILE_ATTRIB,
+ .index = 0,
+ .indexed = 0,
+ .addr_reg = 0,
+ .addr_comp = NVS_SWZ_X,
+ .swizzle = {NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W},
+ .negate = 0,
+ .abs = 0,
+};
+
+typedef enum {
+ NVS_TEX_TARGET_1D,
+ NVS_TEX_TARGET_2D,
+ NVS_TEX_TARGET_3D,
+ NVS_TEX_TARGET_CUBE,
+ NVS_TEX_TARGET_RECT,
+ NVS_TEX_TARGET_UNKNOWN = 0
+} nvsTexTarget;
+
+typedef struct {
+ nvsFragmentHeader header;
+
+ nvsOpcode op;
+ unsigned int saturate;
+
+ nvsRegister dest;
+ unsigned int mask;
+
+ nvsRegister src[3];
+
+ unsigned int tex_unit;
+ nvsTexTarget tex_target;
+
+ nvsCond cond;
+ nvsSwzComp cond_swizzle[4];
+ int cond_reg;
+ int cond_test;
+ int cond_update;
+} nvsInstruction;
+
+#define SMASK_X (1<<0)
+#define SMASK_Y (1<<1)
+#define SMASK_Z (1<<2)
+#define SMASK_W (1<<3)
+#define SMASK_ALL (SMASK_X|SMASK_Y|SMASK_Z|SMASK_W)
+
+#define SPOS_ADDRESS 3
+struct _op_xlat {
+ unsigned int NV;
+ nvsOpcode SOP;
+ int srcpos[3];
+};
+#define MOD_OPCODE(t,hw,sop,s0,s1,s2) do { \
+ t[hw].NV = hw; \
+ t[hw].SOP = sop; \
+ t[hw].srcpos[0] = s0; \
+ t[hw].srcpos[1] = s1; \
+ t[hw].srcpos[2] = s2; \
+} while(0)
+
+extern unsigned int NVVP_TX_VOP_COUNT;
+extern unsigned int NVVP_TX_NVS_OP_COUNT;
+extern struct _op_xlat NVVP_TX_VOP[];
+extern struct _op_xlat NVVP_TX_SOP[];
+
+extern unsigned int NVFP_TX_AOP_COUNT;
+extern unsigned int NVFP_TX_BOP_COUNT;
+extern struct _op_xlat NVFP_TX_AOP[];
+extern struct _op_xlat NVFP_TX_BOP[];
+
+extern void NV20VPTXSwizzle(int hwswz, nvsSwzComp *swz);
+extern nvsSwzComp NV20VP_TX_SWIZZLE[4];
+
+#define SCAP_SRC_ABS (1<<0)
+
+struct _nvsFunc {
+ unsigned int MaxInst;
+ unsigned int MaxAttrib;
+ unsigned int MaxTemp;
+ unsigned int MaxAddress;
+ unsigned int MaxConst;
+ unsigned int caps;
+
+ unsigned int *inst;
+ void (*UploadToHW) (GLcontext *, nouveauShader *);
+ void (*UpdateConst) (GLcontext *, nouveauShader *, int);
+
+ struct _op_xlat*(*GetOPTXRec) (nvsFunc *, int merged);
+ struct _op_xlat*(*GetOPTXFromSOP) (nvsOpcode, int *id);
+
+ void (*InitInstruction) (nvsFunc *);
+ int (*SupportsOpcode) (nvsFunc *, nvsOpcode);
+ void (*SetOpcode) (nvsFunc *, unsigned int opcode,
+ int slot);
+ void (*SetCCUpdate) (nvsFunc *);
+ void (*SetCondition) (nvsFunc *, int on, nvsCond, int reg,
+ nvsSwzComp *swizzle);
+ void (*SetResult) (nvsFunc *, nvsRegister *,
+ unsigned int mask, int slot);
+ void (*SetSource) (nvsFunc *, nvsRegister *, int pos);
+ void (*SetTexImageUnit) (nvsFunc *, int unit);
+ void (*SetSaturate) (nvsFunc *);
+ void (*SetLastInst) (nvsFunc *);
+
+ int (*HasMergedInst) (nvsFunc *);
+ int (*IsLastInst) (nvsFunc *);
+ int (*GetOffsetNext) (nvsFunc *);
+
+ int (*GetOpcodeSlot) (nvsFunc *, int merged);
+ unsigned int (*GetOpcodeHW) (nvsFunc *, int slot);
+ nvsOpcode (*GetOpcode) (nvsFunc *, int merged);
+
+ nvsPrecision (*GetPrecision) (nvsFunc *);
+ int (*GetSaturate) (nvsFunc *);
+
+ nvsRegFile (*GetDestFile) (nvsFunc *, int merged);
+ unsigned int (*GetDestID) (nvsFunc *, int merged);
+ unsigned int (*GetDestMask) (nvsFunc *, int merged);
+
+ unsigned int (*GetSourceHW) (nvsFunc *, int merged, int pos);
+ nvsRegFile (*GetSourceFile) (nvsFunc *, int merged, int pos);
+ int (*GetSourceID) (nvsFunc *, int merged, int pos);
+ int (*GetTexImageUnit) (nvsFunc *);
+ int (*GetSourceNegate) (nvsFunc *, int merged, int pos);
+ int (*GetSourceAbs) (nvsFunc *, int merged, int pos);
+ void (*GetSourceSwizzle) (nvsFunc *, int merged, int pos,
+ nvsSwzComp *swz);
+ int (*GetSourceIndexed) (nvsFunc *, int merged, int pos);
+ void (*GetSourceConstVal) (nvsFunc *, int merged, int pos,
+ float *val);
+ int (*GetSourceScale) (nvsFunc *, int merged, int pos);
+
+ int (*GetRelAddressRegID) (nvsFunc *);
+ nvsSwzComp (*GetRelAddressSwizzle) (nvsFunc *);
+
+ int (*SupportsConditional) (nvsFunc *);
+ int (*GetConditionUpdate) (nvsFunc *);
+ int (*GetConditionTest) (nvsFunc *);
+ nvsCond (*GetCondition) (nvsFunc *);
+ void (*GetCondRegSwizzle) (nvsFunc *, nvsSwzComp *swz);
+ int (*GetCondRegID) (nvsFunc *);
+ int (*GetBranch) (nvsFunc *);
+ int (*GetBranchElse) (nvsFunc *);
+ int (*GetBranchEnd) (nvsFunc *);
+
+ int (*GetLoopCount) (nvsFunc *);
+ int (*GetLoopInitial) (nvsFunc *);
+ int (*GetLoopIncrement) (nvsFunc *);
+};
+
+static inline nvsRegister
+nvsNegate(nvsRegister reg)
+{
+ reg.negate = !reg.negate;
+ return reg;
+}
+
+static inline nvsRegister
+nvsAbs(nvsRegister reg)
+{
+ reg.abs = 1;
+ return reg;
+}
+
+static inline nvsRegister
+nvsSwizzle(nvsRegister reg, nvsSwzComp x, nvsSwzComp y,
+ nvsSwzComp z, nvsSwzComp w)
+{
+ nvsSwzComp sc[4] = { x, y, z, w };
+ nvsSwzComp oc[4];
+ int i;
+
+ for (i=0;i<4;i++)
+ oc[i] = reg.swizzle[i];
+ for (i=0;i<4;i++)
+ reg.swizzle[i] = oc[sc[i]];
+ return reg;
+}
+
+extern GLboolean nvsUpdateShader(GLcontext *ctx, nouveauShader *nvs);
+extern void nvsDisasmHWShader(nvsPtr);
+extern void nvsDumpFragmentList(nvsFragmentList *f, int lvl);
+extern nouveauShader *nvsBuildTextShader(GLcontext *ctx, GLenum target,
+ const char *text);
+
+extern void NV20VPInitShaderFuncs(nvsFunc *);
+extern void NV30VPInitShaderFuncs(nvsFunc *);
+extern void NV40VPInitShaderFuncs(nvsFunc *);
+
+extern void NV30FPInitShaderFuncs(nvsFunc *);
+extern void NV40FPInitShaderFuncs(nvsFunc *);
+
+extern void nouveauShaderInitFuncs(GLcontext *ctx);
+
+extern GLboolean nouveau_shader_pass0_arb(GLcontext *ctx, nouveauShader *nvs);
+extern GLboolean nouveau_shader_pass0_slang(GLcontext *ctx, nouveauShader *nvs);
+extern GLboolean nouveau_shader_pass1(nvsPtr nvs);
+extern GLboolean nouveau_shader_pass2(nvsPtr nvs);
+
+#endif
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_0_arb.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_0_arb.c
new file mode 100644
index 00000000000..afb889d4213
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_0_arb.c
@@ -0,0 +1,710 @@
+/*
+ * Copyright (C) 2006 Ben Skeggs.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/*
+ * Authors:
+ * Ben Skeggs <[email protected]>
+ */
+
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+
+#include "program.h"
+#include "programopt.h"
+#include "program_instruction.h"
+
+#include "nouveau_context.h"
+#include "nouveau_shader.h"
+
+static nvsFixedReg _tx_mesa_vp_dst_reg[VERT_RESULT_MAX] = {
+ NVS_FR_POSITION, NVS_FR_COL0, NVS_FR_COL1, NVS_FR_FOGCOORD,
+ NVS_FR_TEXCOORD0, NVS_FR_TEXCOORD1, NVS_FR_TEXCOORD2, NVS_FR_TEXCOORD3,
+ NVS_FR_TEXCOORD4, NVS_FR_TEXCOORD5, NVS_FR_TEXCOORD6, NVS_FR_TEXCOORD7,
+ NVS_FR_POINTSZ, NVS_FR_BFC0, NVS_FR_BFC1, NVS_FR_UNKNOWN /* EDGE */
+};
+
+static nvsFixedReg _tx_mesa_fp_dst_reg[FRAG_RESULT_MAX] = {
+ NVS_FR_FRAGDATA0 /* COLR */, NVS_FR_FRAGDATA0 /* COLH */,
+ NVS_FR_UNKNOWN /* DEPR */
+};
+
+static nvsFixedReg _tx_mesa_vp_src_reg[VERT_ATTRIB_MAX] = {
+ NVS_FR_POSITION, NVS_FR_WEIGHT, NVS_FR_NORMAL, NVS_FR_COL0, NVS_FR_COL1,
+ NVS_FR_FOGCOORD, NVS_FR_UNKNOWN /* COLOR_INDEX */, NVS_FR_UNKNOWN,
+ NVS_FR_TEXCOORD0, NVS_FR_TEXCOORD1, NVS_FR_TEXCOORD2, NVS_FR_TEXCOORD3,
+ NVS_FR_TEXCOORD4, NVS_FR_TEXCOORD5, NVS_FR_TEXCOORD6, NVS_FR_TEXCOORD7,
+/* Generic attribs 0-15, aliased to the above */
+ NVS_FR_POSITION, NVS_FR_WEIGHT, NVS_FR_NORMAL, NVS_FR_COL0, NVS_FR_COL1,
+ NVS_FR_FOGCOORD, NVS_FR_UNKNOWN /* COLOR_INDEX */, NVS_FR_UNKNOWN,
+ NVS_FR_TEXCOORD0, NVS_FR_TEXCOORD1, NVS_FR_TEXCOORD2, NVS_FR_TEXCOORD3,
+ NVS_FR_TEXCOORD4, NVS_FR_TEXCOORD5, NVS_FR_TEXCOORD6, NVS_FR_TEXCOORD7
+};
+
+static nvsFixedReg _tx_mesa_fp_src_reg[FRAG_ATTRIB_MAX] = {
+ NVS_FR_POSITION, NVS_FR_COL0, NVS_FR_COL1, NVS_FR_FOGCOORD,
+ NVS_FR_TEXCOORD0, NVS_FR_TEXCOORD1, NVS_FR_TEXCOORD2, NVS_FR_TEXCOORD3,
+ NVS_FR_TEXCOORD4, NVS_FR_TEXCOORD5, NVS_FR_TEXCOORD6, NVS_FR_TEXCOORD7
+};
+
+static nvsSwzComp _tx_mesa_swizzle[4] = {
+ NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W
+};
+
+static nvsOpcode _tx_mesa_opcode[] = {
+ [OPCODE_ABS] = NVS_OP_ABS, [OPCODE_ADD] = NVS_OP_ADD,
+ [OPCODE_ARA] = NVS_OP_ARA, [OPCODE_ARL] = NVS_OP_ARL,
+ [OPCODE_ARL_NV] = NVS_OP_ARL, [OPCODE_ARR] = NVS_OP_ARR,
+ [OPCODE_CMP] = NVS_OP_CMP, [OPCODE_COS] = NVS_OP_COS,
+ [OPCODE_DDX] = NVS_OP_DDX, [OPCODE_DDY] = NVS_OP_DDY,
+ [OPCODE_DP3] = NVS_OP_DP3, [OPCODE_DP4] = NVS_OP_DP4,
+ [OPCODE_DPH] = NVS_OP_DPH, [OPCODE_DST] = NVS_OP_DST,
+ [OPCODE_EX2] = NVS_OP_EX2, [OPCODE_EXP] = NVS_OP_EXP,
+ [OPCODE_FLR] = NVS_OP_FLR, [OPCODE_FRC] = NVS_OP_FRC,
+ [OPCODE_KIL] = NVS_OP_EMUL, [OPCODE_KIL_NV] = NVS_OP_KIL,
+ [OPCODE_LG2] = NVS_OP_LG2, [OPCODE_LIT] = NVS_OP_LIT,
+ [OPCODE_LOG] = NVS_OP_LOG,
+ [OPCODE_LRP] = NVS_OP_LRP,
+ [OPCODE_MAD] = NVS_OP_MAD, [OPCODE_MAX] = NVS_OP_MAX,
+ [OPCODE_MIN] = NVS_OP_MIN, [OPCODE_MOV] = NVS_OP_MOV,
+ [OPCODE_MUL] = NVS_OP_MUL,
+ [OPCODE_PK2H] = NVS_OP_PK2H, [OPCODE_PK2US] = NVS_OP_PK2US,
+ [OPCODE_PK4B] = NVS_OP_PK4B, [OPCODE_PK4UB] = NVS_OP_PK4UB,
+ [OPCODE_POW] = NVS_OP_POW, [OPCODE_POPA] = NVS_OP_POPA,
+ [OPCODE_PUSHA] = NVS_OP_PUSHA,
+ [OPCODE_RCC] = NVS_OP_RCC, [OPCODE_RCP] = NVS_OP_RCP,
+ [OPCODE_RFL] = NVS_OP_RFL, [OPCODE_RSQ] = NVS_OP_RSQ,
+ [OPCODE_SCS] = NVS_OP_SCS, [OPCODE_SEQ] = NVS_OP_SEQ,
+ [OPCODE_SFL] = NVS_OP_SFL, [OPCODE_SGE] = NVS_OP_SGE,
+ [OPCODE_SGT] = NVS_OP_SGT, [OPCODE_SIN] = NVS_OP_SIN,
+ [OPCODE_SLE] = NVS_OP_SLE, [OPCODE_SLT] = NVS_OP_SLT,
+ [OPCODE_SNE] = NVS_OP_SNE, [OPCODE_SSG] = NVS_OP_SSG,
+ [OPCODE_STR] = NVS_OP_STR, [OPCODE_SUB] = NVS_OP_SUB,
+ [OPCODE_SWZ] = NVS_OP_MOV,
+ [OPCODE_TEX] = NVS_OP_TEX, [OPCODE_TXB] = NVS_OP_TXB,
+ [OPCODE_TXD] = NVS_OP_TXD,
+ [OPCODE_TXL] = NVS_OP_TXL, [OPCODE_TXP] = NVS_OP_TXP,
+ [OPCODE_TXP_NV] = NVS_OP_TXP,
+ [OPCODE_UP2H] = NVS_OP_UP2H, [OPCODE_UP2US] = NVS_OP_UP2US,
+ [OPCODE_UP4B] = NVS_OP_UP4B, [OPCODE_UP4UB] = NVS_OP_UP4UB,
+ [OPCODE_X2D] = NVS_OP_X2D,
+ [OPCODE_XPD] = NVS_OP_XPD
+};
+
+static nvsCond _tx_mesa_condmask[] = {
+ NVS_COND_UNKNOWN, NVS_COND_GT, NVS_COND_LT, NVS_COND_UN, NVS_COND_GE,
+ NVS_COND_LE, NVS_COND_NE, NVS_COND_NE, NVS_COND_TR, NVS_COND_FL
+};
+
+struct pass0_rec {
+ int nvs_ipos;
+ int next_temp;
+ int swzconst_done;
+ int swzconst_id;
+ nvsRegister const_half;
+};
+
+#define X NVS_SWZ_X
+#define Y NVS_SWZ_Y
+#define Z NVS_SWZ_Z
+#define W NVS_SWZ_W
+
+static void
+pass0_append_fragment(nouveauShader *nvs, nvsFragmentHeader *fragment)
+{
+ nvsFragmentList *list = calloc(1, sizeof(nvsFragmentList));
+ if (!list)
+ return;
+
+ list->fragment = fragment;
+ list->prev = nvs->list_tail;
+ if ( nvs->list_tail)
+ nvs->list_tail->next = list;
+ if (!nvs->list_head)
+ nvs->list_head = list;
+ nvs->list_tail = list;
+
+ nvs->inst_count++;
+}
+
+static void
+pass0_make_reg(nouveauShader *nvs, nvsRegister *reg,
+ nvsRegFile file, unsigned int index)
+{
+ struct pass0_rec *rec = nvs->pass_rec;
+
+ /* defaults */
+ *reg = nvr_unused;
+ /* -1 == quick-and-dirty temp alloc */
+ if (file == NVS_FILE_TEMP && index == -1) {
+ index = rec->next_temp++;
+ assert(index < NVS_MAX_TEMPS);
+ }
+ reg->file = file;
+ reg->index = index;
+}
+
+static void
+pass0_make_swizzle(nvsSwzComp *swz, unsigned int mesa)
+{
+ int i;
+
+ for (i=0;i<4;i++)
+ swz[i] = _tx_mesa_swizzle[GET_SWZ(mesa, i)];
+}
+
+static nvsOpcode
+pass0_make_opcode(enum prog_opcode op)
+{
+ if (op > MAX_OPCODE)
+ return NVS_OP_UNKNOWN;
+ return _tx_mesa_opcode[op];
+}
+
+static nvsCond
+pass0_make_condmask(GLuint mesa)
+{
+ if (mesa > COND_FL)
+ return NVS_COND_UNKNOWN;
+ return _tx_mesa_condmask[mesa];
+}
+
+static unsigned int
+pass0_make_mask(GLuint mesa_mask)
+{
+ unsigned int mask = 0;
+
+ if (mesa_mask & WRITEMASK_X) mask |= SMASK_X;
+ if (mesa_mask & WRITEMASK_Y) mask |= SMASK_Y;
+ if (mesa_mask & WRITEMASK_Z) mask |= SMASK_Z;
+ if (mesa_mask & WRITEMASK_W) mask |= SMASK_W;
+
+ return mask;
+}
+
+static nvsTexTarget
+pass0_make_tex_target(GLuint mesa)
+{
+ switch (mesa) {
+ case TEXTURE_1D_INDEX: return NVS_TEX_TARGET_1D;
+ case TEXTURE_2D_INDEX: return NVS_TEX_TARGET_2D;
+ case TEXTURE_3D_INDEX: return NVS_TEX_TARGET_3D;
+ case TEXTURE_CUBE_INDEX: return NVS_TEX_TARGET_CUBE;
+ case TEXTURE_RECT_INDEX: return NVS_TEX_TARGET_RECT;
+ default:
+ return NVS_TEX_TARGET_UNKNOWN;
+ }
+}
+
+static void
+pass0_make_dst_reg(nvsPtr nvs, nvsRegister *reg,
+ struct prog_dst_register *dst)
+{
+ struct gl_program *mesa = (struct gl_program*)&nvs->mesa.vp;
+ nvsFixedReg sfr;
+
+ switch (dst->File) {
+ case PROGRAM_OUTPUT:
+ if (mesa->Target == GL_VERTEX_PROGRAM_ARB) {
+ sfr = (dst->Index < VERT_RESULT_MAX) ?
+ _tx_mesa_vp_dst_reg[dst->Index] : NVS_FR_UNKNOWN;
+ } else {
+ sfr = (dst->Index < FRAG_RESULT_MAX) ?
+ _tx_mesa_fp_dst_reg[dst->Index] : NVS_FR_UNKNOWN;
+ }
+ pass0_make_reg(nvs, reg, NVS_FILE_RESULT, sfr);
+ break;
+ case PROGRAM_TEMPORARY:
+ pass0_make_reg(nvs, reg, NVS_FILE_TEMP, dst->Index);
+ break;
+ case PROGRAM_ADDRESS:
+ pass0_make_reg(nvs, reg, NVS_FILE_ADDRESS, dst->Index);
+ break;
+ default:
+ fprintf(stderr, "Unknown dest file %d\n", dst->File);
+ assert(0);
+ }
+}
+
+static void
+pass0_make_src_reg(nvsPtr nvs, nvsRegister *reg, struct prog_src_register *src)
+{
+ struct gl_program *mesa = (struct gl_program *)&nvs->mesa.vp.Base;
+ struct gl_program_parameter_list *p = mesa->Parameters;
+
+ *reg = nvr_unused;
+
+ switch (src->File) {
+ case PROGRAM_INPUT:
+ reg->file = NVS_FILE_ATTRIB;
+ if (mesa->Target == GL_VERTEX_PROGRAM_ARB) {
+ reg->index = (src->Index < VERT_ATTRIB_MAX) ?
+ _tx_mesa_vp_src_reg[src->Index] : NVS_FR_UNKNOWN;
+ } else {
+ reg->index = (src->Index < FRAG_ATTRIB_MAX) ?
+ _tx_mesa_fp_src_reg[src->Index] : NVS_FR_UNKNOWN;
+ }
+ break;
+ /* All const types seem to get shoved into here, not really sure why */
+ case PROGRAM_STATE_VAR:
+ switch (p->Parameters[src->Index].Type) {
+ case PROGRAM_NAMED_PARAM:
+ case PROGRAM_CONSTANT:
+ nvs->params[src->Index].source_val = NULL;
+ COPY_4V(nvs->params[src->Index].val, p->ParameterValues[src->Index]);
+ break;
+ case PROGRAM_STATE_VAR:
+ nvs->params[src->Index].source_val = p->ParameterValues[src->Index];
+ break;
+ default:
+ fprintf(stderr, "Unknown parameter type %d\n",
+ p->Parameters[src->Index].Type);
+ assert(0);
+ break;
+ }
+
+ if (src->RelAddr) {
+ reg->indexed = 1;
+ reg->addr_reg = 0;
+ reg->addr_comp = NVS_SWZ_X;
+ } else
+ reg->indexed = 0;
+ reg->file = NVS_FILE_CONST;
+ reg->index = src->Index;
+ break;
+ case PROGRAM_TEMPORARY:
+ reg->file = NVS_FILE_TEMP;
+ reg->index = src->Index;
+ break;
+ default:
+ fprintf(stderr, "Unknown source type %d\n", src->File);
+ assert(0);
+ }
+
+ /* per-component negate handled elsewhere */
+ reg->negate = src->NegateBase != 0;
+ reg->abs = src->Abs;
+ pass0_make_swizzle(reg->swizzle, src->Swizzle);
+}
+
+static nvsInstruction *
+pass0_emit(nouveauShader *nvs, nvsOpcode op, nvsRegister dst,
+ unsigned int mask, int saturate,
+ nvsRegister src0, nvsRegister src1, nvsRegister src2)
+{
+ struct pass0_rec *rec = nvs->pass_rec;
+ nvsInstruction *sif = NULL;
+
+ /* Seems mesa doesn't explicitly 0 this.. */
+ if (nvs->mesa.vp.Base.Target == GL_VERTEX_PROGRAM_ARB)
+ saturate = 0;
+
+ sif = calloc(1, sizeof(nvsInstruction));
+ if (sif) {
+ sif->header.type = NVS_INSTRUCTION;
+ sif->header.position = rec->nvs_ipos++;
+ sif->op = op;
+ sif->saturate = saturate;
+ sif->dest = dst;
+ sif->mask = mask;
+ sif->src[0] = src0;
+ sif->src[1] = src1;
+ sif->src[2] = src2;
+ sif->cond = COND_TR;
+ sif->cond_reg = 0;
+ sif->cond_test = 0;
+ sif->cond_update = 0;
+ pass0_make_swizzle(sif->cond_swizzle, SWIZZLE_NOOP);
+ pass0_append_fragment(nvs, (nvsFragmentHeader *)sif);
+ }
+
+ return sif;
+}
+
+static void
+pass0_fixup_swizzle(nvsPtr nvs,
+ struct prog_src_register *src,
+ unsigned int sm1,
+ unsigned int sm2)
+{
+ static const float sc[4] = { 1.0, 0.0, -1.0, 0.0 };
+ struct pass0_rec *rec = nvs->pass_rec;
+ int fixup_1, fixup_2;
+ nvsRegister sr, dr = nvr_unused;
+ nvsRegister sm1const, sm2const;
+
+ if (!rec->swzconst_done) {
+ struct gl_program *prog = &nvs->mesa.vp.Base;
+ rec->swzconst_id = _mesa_add_unnamed_constant(prog->Parameters, sc, 4);
+ rec->swzconst_done = 1;
+ COPY_4V(nvs->params[rec->swzconst_id].val, sc);
+ }
+
+ fixup_1 = (sm1 != MAKE_SWIZZLE4(0,0,0,0) && sm2 != MAKE_SWIZZLE4(2,2,2,2));
+ fixup_2 = (sm2 != MAKE_SWIZZLE4(2,2,2,2));
+
+ if (src->File != PROGRAM_TEMPORARY && src->File != PROGRAM_INPUT) {
+ /* We can't use more than one const in an instruction, so move the const
+ * into a temp, and swizzle from there.
+ *TODO: should just emit the swizzled const, instead of swizzling it
+ * in the shader.. would need to reswizzle any state params when they
+ * change however..
+ */
+ pass0_make_reg(nvs, &dr, NVS_FILE_TEMP, -1);
+ pass0_make_src_reg(nvs, &sr, src);
+ pass0_emit(nvs, NVS_OP_MOV, dr, SMASK_ALL, 0, sr, nvr_unused, nvr_unused);
+ pass0_make_reg(nvs, &sr, NVS_FILE_TEMP, dr.index);
+ } else {
+ if (fixup_1)
+ src->NegateBase = 0;
+ pass0_make_src_reg(nvs, &sr, src);
+ pass0_make_reg(nvs, &dr, NVS_FILE_TEMP, -1);
+ }
+
+ pass0_make_reg(nvs, &sm1const, NVS_FILE_CONST, rec->swzconst_id);
+ pass0_make_swizzle(sm1const.swizzle, sm1);
+ if (fixup_1 && fixup_2) {
+ /* Any combination with SWIZZLE_ONE */
+ pass0_make_reg(nvs, &sm2const, NVS_FILE_CONST, rec->swzconst_id);
+ pass0_make_swizzle(sm2const.swizzle, sm2);
+ pass0_emit(nvs, NVS_OP_MAD, dr, SMASK_ALL, 0, sr, sm1const, sm2const);
+ } else {
+ /* SWIZZLE_ZERO || arbitrary negate */
+ pass0_emit(nvs, NVS_OP_MUL, dr, SMASK_ALL, 0, sr, sm1const, nvr_unused);
+ }
+
+ src->File = PROGRAM_TEMPORARY;
+ src->Index = dr.index;
+ src->Swizzle = SWIZZLE_NOOP;
+}
+
+#define SET_SWZ(fs, cp, c) fs = (fs & ~(0x7<<(cp*3))) | (c<<(cp*3))
+static void
+pass0_check_sources(nvsPtr nvs, struct prog_instruction *inst)
+{
+ unsigned int insrc = -1, constsrc = -1;
+ int i;
+
+ for (i=0;i<_mesa_num_inst_src_regs(inst->Opcode);i++) {
+ struct prog_src_register *src = &inst->SrcReg[i];
+ unsigned int sm_1 = 0, sm_2 = 0;
+ nvsRegister sr, dr;
+ int do_mov = 0, c;
+
+ /* Build up swizzle masks as if we were going to use
+ * "MAD new, src, const1, const2" to support arbitrary negation
+ * and SWIZZLE_ZERO/SWIZZLE_ONE.
+ */
+ for (c=0;c<4;c++) {
+ if (GET_SWZ(src->Swizzle, c) == SWIZZLE_ZERO) {
+ SET_SWZ(sm_1, c, SWIZZLE_Y); /* 0.0 */
+ SET_SWZ(sm_2, c, SWIZZLE_Y);
+ SET_SWZ(src->Swizzle, c, SWIZZLE_X);
+ } else if (GET_SWZ(src->Swizzle, c) == SWIZZLE_ONE) {
+ SET_SWZ(sm_1, c, SWIZZLE_Y);
+ if (src->NegateBase & (1<<c))
+ SET_SWZ(sm_2, c, SWIZZLE_Z); /* -1.0 */
+ else
+ SET_SWZ(sm_2, c, SWIZZLE_X); /* 1.0 */
+ SET_SWZ(src->Swizzle, c, SWIZZLE_X);
+ } else {
+ if (src->NegateBase & (1<<c))
+ SET_SWZ(sm_1, c, SWIZZLE_Z); /* -[xyzw] */
+ else
+ SET_SWZ(sm_1, c, SWIZZLE_X); /* [xyzw] */
+ SET_SWZ(sm_2, c, SWIZZLE_Y);
+ }
+ }
+ /* Unless we're multiplying by 1.0 or -1.0 on all components, and we're
+ * adding nothing to any component we have to emulate the swizzle.
+ */
+ if ((sm_1 != MAKE_SWIZZLE4(0,0,0,0) && sm_1 != MAKE_SWIZZLE4(2,2,2,2)) ||
+ sm_2 != MAKE_SWIZZLE4(1,1,1,1)) {
+ pass0_fixup_swizzle(nvs, src, sm_1, sm_2);
+ /* The source is definitely in a temp now, so don't bother checking
+ * for multiple ATTRIB/CONST regs.
+ */
+ continue;
+ }
+
+ /* HW can't use more than one ATTRIB or PARAM in a single instruction */
+ switch (src->File) {
+ case PROGRAM_INPUT:
+ if (insrc != -1 && insrc != src->Index)
+ do_mov = 1;
+ else insrc = src->Index;
+ break;
+ case PROGRAM_STATE_VAR:
+ if (constsrc != -1 && constsrc != src->Index)
+ do_mov = 1;
+ else constsrc = src->Index;
+ break;
+ default:
+ break;
+ }
+
+ /* Emit any extra ATTRIB/CONST to a temp, and modify the Mesa instruction
+ * to point at the temp.
+ */
+ if (do_mov) {
+ pass0_make_src_reg(nvs, &sr, src);
+ pass0_make_reg(nvs, &dr, NVS_FILE_TEMP, -1);
+ pass0_emit(nvs, NVS_OP_MOV, dr, SMASK_ALL, 0,
+ sr, nvr_unused, nvr_unused);
+
+ src->File = PROGRAM_TEMPORARY;
+ src->Index = dr.index;
+ src->Swizzle= SWIZZLE_NOOP;
+ }
+ }
+}
+
+static GLboolean
+pass0_emulate_instruction(nouveauShader *nvs, struct prog_instruction *inst)
+{
+ nvsFunc *shader = nvs->func;
+ nvsRegister src[3], dest, temp;
+ nvsInstruction *nvsinst;
+ struct pass0_rec *rec = nvs->pass_rec;
+ unsigned int mask = pass0_make_mask(inst->DstReg.WriteMask);
+ int i, sat;
+
+ sat = (inst->SaturateMode == SATURATE_ZERO_ONE);
+
+ /* Build all the "real" regs for the instruction */
+ for (i=0; i<_mesa_num_inst_src_regs(inst->Opcode); i++)
+ pass0_make_src_reg(nvs, &src[i], &inst->SrcReg[i]);
+ if (inst->Opcode != OPCODE_KIL)
+ pass0_make_dst_reg(nvs, &dest, &inst->DstReg);
+
+ switch (inst->Opcode) {
+ case OPCODE_ABS:
+ if (shader->caps & SCAP_SRC_ABS)
+ pass0_emit(nvs, NVS_OP_MOV, dest, mask, sat,
+ nvsAbs(src[0]), nvr_unused, nvr_unused);
+ else
+ pass0_emit(nvs, NVS_OP_MAX, dest, mask, sat,
+ src[0], nvsNegate(src[0]), nvr_unused);
+ break;
+ case OPCODE_KIL:
+ /* This is only in ARB shaders, so we don't have to worry
+ * about clobbering a CC reg as they aren't supported anyway.
+ */
+ /* MOVC0 temp, src */
+ pass0_make_reg(nvs, &temp, NVS_FILE_TEMP, -1);
+ nvsinst = pass0_emit(nvs, NVS_OP_MOV, temp, SMASK_ALL, 0,
+ src[0], nvr_unused, nvr_unused);
+ nvsinst->cond_update = 1;
+ nvsinst->cond_reg = 0;
+ /* KIL_NV (LT0.xyzw) temp */
+ nvsinst = pass0_emit(nvs, NVS_OP_KIL, nvr_unused, 0, 0,
+ nvr_unused, nvr_unused, nvr_unused);
+ nvsinst->cond = COND_LT;
+ nvsinst->cond_reg = 0;
+ nvsinst->cond_test = 1;
+ pass0_make_swizzle(nvsinst->cond_swizzle, MAKE_SWIZZLE4(0,1,2,3));
+ break;
+ case OPCODE_LIT:
+ break;
+ case OPCODE_LRP:
+ pass0_make_reg(nvs, &temp, NVS_FILE_TEMP, -1);
+ pass0_emit(nvs, NVS_OP_MAD, temp, mask, 0,
+ nvsNegate(src[0]), src[2], src[2]);
+ pass0_emit(nvs, NVS_OP_MAD, dest, mask, sat,
+ src[0], src[1], temp);
+ break;
+ case OPCODE_POW:
+ if (shader->SupportsOpcode(shader, NVS_OP_LG2) &&
+ shader->SupportsOpcode(shader, NVS_OP_EX2)) {
+ pass0_make_reg(nvs, &temp, NVS_FILE_TEMP, -1);
+ /* LG2 temp.x, src0.c */
+ pass0_emit(nvs, NVS_OP_LG2, temp, SMASK_X, 0,
+ nvsSwizzle(src[0], X, X, X, X),
+ nvr_unused,
+ nvr_unused);
+ /* MUL temp.x, temp.x, src1.c */
+ pass0_emit(nvs, NVS_OP_MUL, temp, SMASK_X, 0,
+ nvsSwizzle(temp, X, X, X, X),
+ nvsSwizzle(src[1], X, X, X, X),
+ nvr_unused);
+ /* EX2 dest, temp.x */
+ pass0_emit(nvs, NVS_OP_EX2, dest, mask, sat,
+ nvsSwizzle(temp, X, X, X, X),
+ nvr_unused,
+ nvr_unused);
+ } else {
+ /* can we use EXP/LOG instead of EX2/LG2?? */
+ fprintf(stderr, "Implement POW for NV20 vtxprog!\n");
+ return GL_FALSE;
+ }
+ break;
+ case OPCODE_RSQ:
+ if (rec->const_half.file != NVS_FILE_CONST) {
+ GLfloat const_half[4] = { 0.5, 0.0, 0.0, 0.0 };
+ pass0_make_reg(nvs, &rec->const_half, NVS_FILE_CONST,
+ _mesa_add_unnamed_constant(nvs->mesa.vp.Base.Parameters,
+ const_half, 4));
+ COPY_4V(nvs->params[rec->const_half.index].val, const_half);
+ }
+ pass0_make_reg(nvs, &temp, NVS_FILE_TEMP, -1);
+ pass0_emit(nvs, NVS_OP_LG2, temp, SMASK_X, 0,
+ nvsAbs(nvsSwizzle(src[0], X, X, X, X)),
+ nvr_unused,
+ nvr_unused);
+ pass0_emit(nvs, NVS_OP_MUL, temp, SMASK_X, 0,
+ nvsSwizzle(temp, X, X, X, X),
+ nvsNegate(rec->const_half),
+ nvr_unused);
+ pass0_emit(nvs, NVS_OP_EX2, dest, mask, sat,
+ nvsSwizzle(temp, X, X, X, X),
+ nvr_unused,
+ nvr_unused);
+ break;
+ case OPCODE_SCS:
+ if (mask & SMASK_X)
+ pass0_emit(nvs, NVS_OP_COS, dest, SMASK_X, sat,
+ nvsSwizzle(src[0], X, X, X, X),
+ nvr_unused,
+ nvr_unused);
+ if (mask & SMASK_Y)
+ pass0_emit(nvs, NVS_OP_SIN, dest, SMASK_Y, sat,
+ nvsSwizzle(src[0], X, X, X, X),
+ nvr_unused,
+ nvr_unused);
+ break;
+ case OPCODE_SUB:
+ pass0_emit(nvs, NVS_OP_ADD, dest, mask, sat,
+ src[0], nvsNegate(src[1]), nvr_unused);
+ break;
+ case OPCODE_XPD:
+ pass0_make_reg(nvs, &temp, NVS_FILE_TEMP, -1);
+ pass0_emit(nvs, NVS_OP_MUL, temp, SMASK_ALL, 0,
+ nvsSwizzle(src[0], Z, X, Y, Y),
+ nvsSwizzle(src[1], Y, Z, X, X),
+ nvr_unused);
+ pass0_emit(nvs, NVS_OP_MAD, dest, (mask & ~SMASK_W), sat,
+ nvsSwizzle(src[0], Y, Z, X, X),
+ nvsSwizzle(src[1], Z, X, Y, Y),
+ nvsNegate(temp));
+ break;
+ default:
+ fprintf(stderr, "hw doesn't support opcode \"%s\", and no emulation found\n",
+ _mesa_opcode_string(inst->Opcode));
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean
+pass0_translate_instructions(nouveauShader *nvs)
+{
+ struct gl_program *prog = (struct gl_program *)&nvs->mesa.vp;
+ nvsFunc *shader = nvs->func;
+ int ipos;
+
+ for (ipos=0; ipos<prog->NumInstructions; ipos++) {
+ struct prog_instruction *inst = &prog->Instructions[ipos];
+
+ if (inst->Opcode == OPCODE_END)
+ break;
+
+ /* Deal with multiple ATTRIB/PARAM in a single instruction */
+ pass0_check_sources(nvs, inst);
+
+ /* Now it's safe to do the prog_instruction->nvsInstruction conversion */
+ if (shader->SupportsOpcode(shader, pass0_make_opcode(inst->Opcode))) {
+ nvsInstruction *nvsinst;
+ nvsRegister src[3], dest;
+ int i;
+
+ for (i=0; i<_mesa_num_inst_src_regs(inst->Opcode); i++)
+ pass0_make_src_reg(nvs, &src[i], &inst->SrcReg[i]);
+ pass0_make_dst_reg(nvs, &dest, &inst->DstReg);
+
+ nvsinst = pass0_emit(nvs,
+ pass0_make_opcode(inst->Opcode),
+ dest,
+ pass0_make_mask(inst->DstReg.WriteMask),
+ (inst->SaturateMode != SATURATE_OFF),
+ src[0], src[1], src[2]);
+ nvsinst->tex_unit = inst->TexSrcUnit;
+ nvsinst->tex_target = pass0_make_tex_target(inst->TexSrcTarget);
+ /* TODO when NV_fp/vp is implemented */
+ nvsinst->cond = COND_TR;
+ } else {
+ if (!pass0_emulate_instruction(nvs, inst))
+ return GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean
+nouveau_shader_pass0_arb(GLcontext *ctx, nouveauShader *nvs)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ struct gl_program *prog = (struct gl_program*)nvs;
+ struct gl_vertex_program *vp = (struct gl_vertex_program *)prog;
+ struct gl_fragment_program *fp = (struct gl_fragment_program *)prog;
+ struct pass0_rec *rec;
+ int ret;
+
+ switch (prog->Target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ nvs->func = &nmesa->VPfunc;
+ if (vp->IsPositionInvariant)
+ _mesa_insert_mvp_code(ctx, vp);
+#if 0
+ if (IS_FIXEDFUNCTION_PROG && CLIP_PLANES_USED)
+ pass0_insert_ff_clip_planes();
+#endif
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ nvs->func = &nmesa->FPfunc;
+ if (fp->FogOption != GL_NONE)
+ _mesa_append_fog_code(ctx, fp);
+ break;
+ default:
+ fprintf(stderr, "Unknown program type %d", prog->Target);
+ return GL_FALSE;
+ }
+
+ rec = calloc(1, sizeof(struct pass0_rec));
+ rec->next_temp = prog->NumTemporaries;
+ nvs->pass_rec = rec;
+
+ ret = pass0_translate_instructions(nvs);
+ if (!ret) {
+ /* DESTROY list */
+ }
+
+ free(nvs->pass_rec);
+ return ret;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c
new file mode 100644
index 00000000000..5de9017f580
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (C) 2006 Ben Skeggs.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/*
+ * Authors:
+ * Ben Skeggs <[email protected]>
+ */
+
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+
+#include "nouveau_shader.h"
+
+#define PASS1_OK 0
+#define PASS1_KILL 1
+#define PASS1_FAIL 2
+
+struct pass1_rec {
+ unsigned int temp[NVS_MAX_TEMPS];
+ unsigned int result[NVS_MAX_ATTRIBS];
+ unsigned int address[NVS_MAX_ADDRESS];
+ unsigned int cc[2];
+};
+
+static void
+pass1_remove_fragment(nvsPtr nvs, nvsFragmentList *item)
+{
+ if (item->prev) item->prev->next = item->next;
+ if (item->next) item->next->prev = item->prev;
+ if (nvs->list_head == item) nvs->list_head = item->next;
+ if (nvs->list_tail == item) nvs->list_tail = item->prev;
+
+ nvs->inst_count--;
+}
+
+static int
+pass1_result_needed(struct pass1_rec *rec, nvsInstruction *inst)
+{
+ if (inst->cond_update && rec->cc[inst->cond_reg])
+ return 1;
+ /* Only write components that are read later */
+ if (inst->dest.file == NVS_FILE_TEMP)
+ return (inst->mask & rec->temp[inst->dest.index]);
+ if (inst->dest.file == NVS_FILE_ADDRESS)
+ return (inst->mask & rec->address[inst->dest.index]);
+ /* No point writing result components that are written later */
+ if (inst->dest.file == NVS_FILE_RESULT)
+ return (inst->mask & ~rec->result[inst->dest.index]);
+ assert(0);
+}
+
+static void
+pass1_track_result(struct pass1_rec *rec, nvsInstruction *inst)
+{
+ if (inst->cond_test)
+ rec->cc[inst->cond_reg] = 1;
+ if (inst->dest.file == NVS_FILE_TEMP) {
+ inst->mask &= rec->temp[inst->dest.index];
+ } else if (inst->dest.file == NVS_FILE_RESULT) {
+ inst->mask &= ~rec->result[inst->dest.index];
+ rec->result[inst->dest.index] |= inst->mask;
+ } else if (inst->dest.file == NVS_FILE_ADDRESS) {
+ inst->mask &= rec->address[inst->dest.index];
+ }
+}
+
+static void
+pass1_track_source(nouveauShader *nvs, nvsInstruction *inst, int pos,
+ unsigned int read)
+{
+ struct pass1_rec *rec = nvs->pass_rec;
+ nvsRegister *src = &inst->src[pos];
+ unsigned int really_read = 0;
+ int i,sc;
+
+ /* Account for swizzling */
+ for (i=0; i<4; i++)
+ if (read & (1<<i)) really_read |= (1 << src->swizzle[i]);
+
+ /* Track register reads */
+ if (src->file == NVS_FILE_TEMP) {
+ if (nvs->temps[src->index].last_use == -1)
+ nvs->temps[src->index].last_use = inst->header.position;
+ rec->temp [src->index] |= really_read;
+ } else if (src->indexed) {
+ rec->address[src->addr_reg] |= (1<<src->addr_comp);
+ }
+
+ /* Modify swizzle to only access read components */
+ /* Find a component that is used.. */
+ for (sc=0;sc<4;sc++)
+ if (really_read & (1<<sc))
+ break;
+ /* Now set all unused components to that value */
+ for (i=0;i<4;i++)
+ if (!(read & (1<<i))) src->swizzle[i] = sc;
+}
+
+static int
+pass1_check_instruction(nouveauShader *nvs, nvsInstruction *inst)
+{
+ struct pass1_rec *rec = nvs->pass_rec;
+ unsigned int read0, read1, read2;
+
+ if (inst->op != NVS_OP_KIL) {
+ if (!pass1_result_needed(rec, inst))
+ return PASS1_KILL;
+ }
+ pass1_track_result(rec, inst);
+
+ read0 = read1 = read2 = 0;
+
+ switch (inst->op) {
+ case NVS_OP_FLR:
+ case NVS_OP_FRC:
+ case NVS_OP_MOV:
+ case NVS_OP_SSG:
+ case NVS_OP_ARL:
+ read0 = inst->mask;
+ break;
+ case NVS_OP_ADD:
+ case NVS_OP_MAX:
+ case NVS_OP_MIN:
+ case NVS_OP_MUL:
+ case NVS_OP_SEQ:
+ case NVS_OP_SFL:
+ case NVS_OP_SGE:
+ case NVS_OP_SGT:
+ case NVS_OP_SLE:
+ case NVS_OP_SLT:
+ case NVS_OP_SNE:
+ case NVS_OP_STR:
+ case NVS_OP_SUB:
+ read0 = inst->mask;
+ read1 = inst->mask;
+ break;
+ case NVS_OP_CMP:
+ case NVS_OP_LRP:
+ case NVS_OP_MAD:
+ read0 = inst->mask;
+ read1 = inst->mask;
+ read2 = inst->mask;
+ break;
+ case NVS_OP_XPD:
+ if (inst->mask & SMASK_X) read0 |= SMASK_Y|SMASK_Z;
+ if (inst->mask & SMASK_Y) read0 |= SMASK_X|SMASK_Z;
+ if (inst->mask & SMASK_Z) read0 |= SMASK_X|SMASK_Y;
+ read1 = read0;
+ break;
+ case NVS_OP_COS:
+ case NVS_OP_EX2:
+ case NVS_OP_EXP:
+ case NVS_OP_LG2:
+ case NVS_OP_LOG:
+ case NVS_OP_RCC:
+ case NVS_OP_RCP:
+ case NVS_OP_RSQ:
+ case NVS_OP_SCS:
+ case NVS_OP_SIN:
+ read0 = SMASK_X;
+ break;
+ case NVS_OP_POW:
+ read0 = SMASK_X;
+ read1 = SMASK_X;
+ break;
+ case NVS_OP_DIV:
+ read0 = inst->mask;
+ read1 = SMASK_X;
+ break;
+ case NVS_OP_DP2:
+ read0 = SMASK_X|SMASK_Y;
+ read1 = SMASK_X|SMASK_Y;
+ break;
+ case NVS_OP_DP3:
+ case NVS_OP_RFL:
+ read0 = SMASK_X|SMASK_Y|SMASK_Z;
+ read1 = SMASK_X|SMASK_Y|SMASK_Z;
+ break;
+ case NVS_OP_DP4:
+ read0 = SMASK_ALL;
+ read1 = SMASK_ALL;
+ break;
+ case NVS_OP_DPH:
+ read0 = SMASK_X|SMASK_Y|SMASK_Z;
+ read1 = SMASK_ALL;
+ break;
+ case NVS_OP_DST:
+ if (inst->mask & SMASK_Y) read0 = read1 = SMASK_Y;
+ if (inst->mask & SMASK_Z) read0 |= SMASK_Z;
+ if (inst->mask & SMASK_W) read1 |= SMASK_W;
+ break;
+ case NVS_OP_NRM:
+ read0 = SMASK_X|SMASK_Y|SMASK_Z;
+ break;
+ case NVS_OP_PK2H:
+ case NVS_OP_PK2US:
+ read0 = SMASK_X|SMASK_Y;
+ break;
+ case NVS_OP_DDX:
+ case NVS_OP_DDY:
+ case NVS_OP_UP2H:
+ case NVS_OP_UP2US:
+ case NVS_OP_PK4B:
+ case NVS_OP_PK4UB:
+ case NVS_OP_UP4B:
+ case NVS_OP_UP4UB:
+ read0 = SMASK_ALL;
+ break;
+ case NVS_OP_X2D:
+ read1 = SMASK_X|SMASK_Y;
+ if (inst->mask & (SMASK_X|SMASK_Z)) {
+ read0 |= SMASK_X;
+ read2 |= SMASK_X|SMASK_Y;
+ }
+ if (inst->mask & (SMASK_Y|SMASK_W)) {
+ read0 |= SMASK_Y;
+ read2 |= SMASK_Z|SMASK_W;
+ }
+ break;
+ case NVS_OP_LIT:
+ read0 |= SMASK_X|SMASK_Y|SMASK_W;
+ break;
+ case NVS_OP_TEX:
+ case NVS_OP_TXP:
+ case NVS_OP_TXL:
+ case NVS_OP_TXB:
+ read0 = SMASK_ALL;
+ break;
+ case NVS_OP_TXD:
+ read0 = SMASK_ALL;
+ read1 = SMASK_ALL;
+ read2 = SMASK_ALL;
+ break;
+ case NVS_OP_KIL:
+ break;
+ default:
+ fprintf(stderr, "Unknown sop=%d", inst->op);
+ return PASS1_FAIL;
+ }
+
+ /* Any values that are written by this inst can't have been read further up */
+ if (inst->dest.file == NVS_FILE_TEMP)
+ rec->temp[inst->dest.index] &= ~inst->mask;
+
+ if (read0) pass1_track_source(nvs, inst, 0, read0);
+ if (read1) pass1_track_source(nvs, inst, 1, read1);
+ if (read2) pass1_track_source(nvs, inst, 2, read2);
+
+ return PASS1_OK;
+}
+
+/* Some basic dead code elimination
+ * - Remove unused instructions
+ * - Don't write unused register components
+ * - Modify swizzles to not reference unneeded components.
+ */
+GLboolean
+nouveau_shader_pass1(nvsPtr nvs)
+{
+ nvsFragmentList *list = nvs->list_tail;
+ int i;
+
+ for (i=0; i<NVS_MAX_TEMPS; i++)
+ nvs->temps[i].last_use = -1;
+
+ nvs->pass_rec = calloc(1, sizeof(struct pass1_rec));
+
+ while (list) {
+ assert(list->fragment->type == NVS_INSTRUCTION);
+
+ switch(pass1_check_instruction(nvs, (nvsInstruction *)list->fragment)) {
+ case PASS1_OK:
+ break;
+ case PASS1_KILL:
+ pass1_remove_fragment(nvs, list);
+ break;
+ case PASS1_FAIL:
+ default:
+ free(nvs->pass_rec);
+ nvs->pass_rec = NULL;
+ return GL_FALSE;
+ }
+
+ list = list->prev;
+ }
+
+ free(nvs->pass_rec);
+ nvs->pass_rec = NULL;
+
+ return GL_TRUE;
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
new file mode 100644
index 00000000000..2177413b66e
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2006 Ben Skeggs.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/*
+ * Authors:
+ * Ben Skeggs <[email protected]>
+ */
+
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+
+#include "program.h"
+
+#include "nouveau_context.h"
+#include "nouveau_shader.h"
+
+struct pass2_rec {
+ /* Map nvsRegister temp ID onto hw temp ID */
+ unsigned int temps[NVS_MAX_TEMPS];
+ /* Track free hw registers */
+ unsigned int hw_temps[NVS_MAX_TEMPS];
+};
+
+static int
+pass2_alloc_hw_temp(nvsPtr nvs)
+{
+ struct pass2_rec *rec = nvs->pass_rec;
+ int i;
+
+ for (i=0; i<nvs->func->MaxTemp; i++) {
+ /* This is a *horrible* hack.. R0 is both temp0 and result.color
+ * in NV30/40 fragprogs, we can use R0 as a temp before result is
+ * written however..
+ */
+ if (nvs->mesa.vp.Base.Target == GL_FRAGMENT_PROGRAM_ARB && i==0)
+ continue;
+
+ if (rec->hw_temps[i] == 0) {
+ rec->hw_temps[i] = 1;
+ return i;
+ }
+ }
+ return -1;
+}
+
+static void
+pass2_free_hw_temp(nvsPtr nvs, int reg)
+{
+ struct pass2_rec *rec = nvs->pass_rec;
+ rec->hw_temps[reg] = 0;
+}
+
+static nvsRegister
+pass2_mangle_reg(nvsPtr nvs, nvsInstruction *inst, nvsRegister reg)
+{
+ struct pass2_rec *rec = nvs->pass_rec;
+
+ if (reg.file == NVS_FILE_TEMP) {
+ int hwidx;
+
+ if (rec->temps[reg.index] == -1)
+ rec->temps[reg.index] = pass2_alloc_hw_temp(nvs);
+ hwidx = rec->temps[reg.index];
+
+ if (nvs->temps[reg.index].last_use <= inst->header.position)
+ pass2_free_hw_temp(nvs, hwidx);
+
+ reg.index = hwidx;
+ }
+
+ return reg;
+}
+
+static void
+pass2_add_instruction(nvsPtr nvs, nvsInstruction *inst,
+ struct _op_xlat *op, int slot)
+{
+ nvsSwzComp default_swz[4] = { NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W };
+ nvsFunc *shader = nvs->func;
+ nvsRegister reg;
+ int i;
+
+ shader->SetOpcode(shader, op->NV, slot);
+ if (inst->saturate ) shader->SetSaturate(shader);
+ if (inst->cond_update) shader->SetCCUpdate(shader);
+ if (inst->cond_test ) shader->SetCondition(shader, 1, inst->cond,
+ inst->cond_reg,
+ inst->cond_swizzle);
+ else shader->SetCondition(shader, 0, NVS_COND_TR,
+ 0,
+ default_swz);
+ switch (inst->op) {
+ case NVS_OP_TEX:
+ case NVS_OP_TXB:
+ case NVS_OP_TXL:
+ case NVS_OP_TXP:
+ case NVS_OP_TXD:
+ shader->SetTexImageUnit(shader, inst->tex_unit);
+ break;
+ default:
+ break;
+ }
+
+ for (i = 0; i < 3; i++) {
+ if (op->srcpos[i] != -1) {
+ reg = pass2_mangle_reg(nvs, inst, inst->src[i]);
+ if (reg.file == NVS_FILE_ATTRIB)
+ nvs->inputs_read |= (1 << reg.index);
+ shader->SetSource(shader, &reg, op->srcpos[i]);
+ if (reg.file == NVS_FILE_CONST && shader->GetSourceConstVal) {
+ int idx_slot = nvs->params[reg.index].hw_index_cnt++;
+ nvs->params[reg.index].hw_index = realloc(
+ nvs->params[reg.index].hw_index, sizeof(int) * idx_slot+1);
+ nvs->params[reg.index].hw_index[idx_slot] = nvs->program_current + 4;
+ }
+ }
+ }
+
+ reg = pass2_mangle_reg(nvs, inst, inst->dest);
+ if (reg.file == NVS_FILE_RESULT)
+ nvs->outputs_written |= (1 << reg.index);
+ shader->SetResult(shader, &reg, inst->mask, slot);
+}
+
+static int
+pass2_assemble_instruction(nvsPtr nvs, nvsInstruction *inst, int last)
+{
+ nvsFunc *shader = nvs->func;
+ struct _op_xlat *op;
+ unsigned int hw_inst[8];
+ int slot;
+ int instsz;
+ int i;
+
+ shader->inst = hw_inst;
+
+ /* Assemble this instruction */
+ if (!(op = shader->GetOPTXFromSOP(inst->op, &slot)))
+ return 0;
+ shader->InitInstruction(shader);
+ pass2_add_instruction(nvs, inst, op, slot);
+ if (last)
+ shader->SetLastInst(shader);
+
+ instsz = shader->GetOffsetNext(nvs->func);
+ if (nvs->program_size + instsz >= nvs->program_alloc_size) {
+ nvs->program_alloc_size *= 2;
+ nvs->program = realloc(nvs->program,
+ nvs->program_alloc_size * sizeof(uint32_t));
+ }
+
+ for (i=0; i<instsz; i++)
+ nvs->program[nvs->program_current++] = hw_inst[i];
+ nvs->program_size = nvs->program_current;
+ return 1;
+}
+
+/* Translate program into hardware format */
+GLboolean
+nouveau_shader_pass2(nvsPtr nvs)
+{
+ nvsFragmentList *list = nvs->list_head;
+ struct pass2_rec *rec;
+ int i;
+
+ rec = calloc(1, sizeof(struct pass2_rec));
+ for (i=0; i<NVS_MAX_TEMPS; i++)
+ rec->temps[i] = -1;
+ nvs->pass_rec = rec;
+
+ /* Start off with allocating 4 uint32_t's for each inst, will be grown
+ * if necessary..
+ */
+ nvs->program_alloc_size = nvs->inst_count * 4;
+ nvs->program = calloc(nvs->program_alloc_size, sizeof(uint32_t));
+ nvs->program_size = 0;
+ nvs->program_current = 0;
+
+ while (list) {
+ assert(list->fragment->type == NVS_INSTRUCTION);
+
+ if (!pass2_assemble_instruction(nvs, (nvsInstruction *)list->fragment, list->next ? 0 : 1)) {
+ free(nvs->program);
+ nvs->program = NULL;
+ return GL_FALSE;
+ }
+
+ list = list->next;
+ }
+
+ /* Shrink allocated memory to only what we need */
+ nvs->program = realloc(nvs->program, nvs->program_size * sizeof(uint32_t));
+ nvs->program_alloc_size = nvs->program_size;
+
+ nvs->translated = 1;
+ nvs->on_hardware = 0;
+
+ if (NOUVEAU_DEBUG & DEBUG_SHADERS) {
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "----------------MESA PROGRAM target=%s, id=0x%x\n",
+ _mesa_lookup_enum_by_nr(nvs->mesa.vp.Base.Target),
+ nvs->mesa.vp.Base.Id);
+ fflush(stdout); fflush(stderr);
+ _mesa_print_program(&nvs->mesa.vp.Base);
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "^^^^^^^^^^^^^^^^MESA PROGRAM\n");
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "----------------NV PROGRAM\n");
+ fflush(stdout); fflush(stderr);
+ nvsDisasmHWShader(nvs);
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "^^^^^^^^^^^^^^^^NV PROGRAM\n");
+ fflush(stdout); fflush(stderr);
+ }
+
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c
new file mode 100644
index 00000000000..74dec66afcf
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c
@@ -0,0 +1,125 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#include "nouveau_context.h"
+#include "nouveau_span.h"
+#include "nouveau_fifo.h"
+#include "nouveau_lock.h"
+
+#include "swrast/swrast.h"
+
+#define HAVE_HW_DEPTH_SPANS 0
+#define HAVE_HW_DEPTH_PIXELS 0
+#define HAVE_HW_STENCIL_SPANS 0
+#define HAVE_HW_STENCIL_PIXELS 0
+
+#define HW_CLIPLOOP() \
+ do { \
+ int _nc = nmesa->numClipRects; \
+ while ( _nc-- ) { \
+ int minx = nmesa->pClipRects[_nc].x1 - nmesa->drawX; \
+ int miny = nmesa->pClipRects[_nc].y1 - nmesa->drawY; \
+ int maxx = nmesa->pClipRects[_nc].x2 - nmesa->drawX; \
+ int maxy = nmesa->pClipRects[_nc].y2 - nmesa->drawY;
+
+#define LOCAL_VARS \
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); \
+ nouveau_renderbuffer *nrb = (nouveau_renderbuffer *)rb; \
+ GLuint height = nrb->mesa.Height; \
+ GLubyte *map = (GLubyte *)(nrb->map ? nrb->map : nrb->mem->map) + \
+ (nmesa->drawY * nrb->pitch) + (nmesa->drawX * nrb->cpp); \
+ GLuint p; \
+ (void) p;
+
+#define Y_FLIP( _y ) (height - _y - 1)
+
+#define HW_LOCK()
+
+#define HW_UNLOCK()
+
+
+
+/* ================================================================
+ * Color buffers
+ */
+
+/* RGB565 */
+#define SPANTMP_PIXEL_FMT GL_RGB
+#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5
+
+#define TAG(x) nouveau##x##_RGB565
+#define TAG2(x,y) nouveau##x##_RGB565##y
+#define GET_PTR(X,Y) (map + (Y)*nrb->pitch + (X)*nrb->cpp)
+#include "spantmp2.h"
+
+
+/* ARGB8888 */
+#define SPANTMP_PIXEL_FMT GL_BGRA
+#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
+
+#define TAG(x) nouveau##x##_ARGB8888
+#define TAG2(x,y) nouveau##x##_ARGB8888##y
+#define GET_PTR(X,Y) (map + (Y)*nrb->pitch + (X)*nrb->cpp)
+#include "spantmp2.h"
+
+static void
+nouveauSpanRenderStart( GLcontext *ctx )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ FIRE_RING();
+ LOCK_HARDWARE(nmesa);
+ nouveauWaitForIdleLocked( nmesa );
+}
+
+static void
+nouveauSpanRenderFinish( GLcontext *ctx )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ _swrast_flush( ctx );
+ nouveauWaitForIdleLocked( nmesa );
+ UNLOCK_HARDWARE( nmesa );
+}
+
+void nouveauSpanInitFunctions( GLcontext *ctx )
+{
+ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
+ swdd->SpanRenderStart = nouveauSpanRenderStart;
+ swdd->SpanRenderFinish = nouveauSpanRenderFinish;
+}
+
+
+/**
+ * Plug in the Get/Put routines for the given driRenderbuffer.
+ */
+void
+nouveauSpanSetFunctions(nouveau_renderbuffer *nrb, const GLvisual *vis)
+{
+ if (nrb->mesa._ActualFormat == GL_RGBA8)
+ nouveauInitPointers_ARGB8888(&nrb->mesa);
+ else if (nrb->mesa._ActualFormat == GL_RGB5)
+ nouveauInitPointers_RGB565(&nrb->mesa);
+}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.h b/src/mesa/drivers/dri/nouveau/nouveau_span.h
new file mode 100644
index 00000000000..bc39ecd17b5
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_span.h
@@ -0,0 +1,39 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NOUVEAU_SPAN_H__
+#define __NOUVEAU_SPAN_H__
+
+#include "drirenderbuffer.h"
+#include "nouveau_buffers.h"
+
+extern void nouveauSpanInitFunctions( GLcontext *ctx );
+extern void nouveauSpanSetFunctions(nouveau_renderbuffer *nrb, const GLvisual *vis);
+
+#endif /* __NOUVEAU_SPAN_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c
new file mode 100644
index 00000000000..8d3c018dffa
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c
@@ -0,0 +1,341 @@
+/**************************************************************************
+
+Copyright 2006 Jeremy Kolb
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "nouveau_context.h"
+#include "nouveau_state.h"
+#include "nouveau_swtcl.h"
+#include "nouveau_fifo.h"
+
+#include "swrast/swrast.h"
+#include "tnl/tnl.h"
+#include "swrast_setup/swrast_setup.h"
+
+#include "tnl/t_pipeline.h"
+
+#include "mtypes.h"
+#include "colormac.h"
+
+static __inline__ GLuint nouveauPackColor(GLuint format,
+ GLubyte r, GLubyte g,
+ GLubyte b, GLubyte a)
+{
+ switch (format) {
+ case 2:
+ return PACK_COLOR_565( r, g, b );
+ case 4:
+ return PACK_COLOR_8888( r, g, b, a);
+ default:
+ fprintf(stderr, "unknown format %d\n", (int)format);
+ return 0;
+ }
+}
+
+static void nouveauCalcViewport(GLcontext *ctx)
+{
+ /* Calculate the Viewport Matrix */
+
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ const GLfloat *v = ctx->Viewport._WindowMap.m;
+ GLfloat *m = nmesa->viewport.m;
+ GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY;
+
+ nmesa->depth_scale = 1.0 / ctx->DrawBuffer->_DepthMaxF;
+
+ m[MAT_SX] = v[MAT_SX];
+ m[MAT_TX] = v[MAT_TX] + xoffset + SUBPIXEL_X;
+ m[MAT_SY] = - v[MAT_SY];
+ m[MAT_TY] = v[MAT_TY] + yoffset + SUBPIXEL_Y;
+ m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale;
+ m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale;
+
+ nmesa->hw_func.WindowMoved(nmesa);
+}
+
+static void nouveauViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ /*
+ * Need to send (at least on an nv35 the following:
+ * cons = 4 (this may be bytes per pixel)
+ *
+ * The viewport:
+ * 445 0x0000bee0 {size: 0x0 channel: 0x1 cmd: 0x00009ee0} <-- VIEWPORT_SETUP/HEADER ?
+ * 446 0x00000000 {size: 0x0 channel: 0x0 cmd: 0x00000000} <-- x * cons
+ * 447 0x00000c80 {size: 0x0 channel: 0x0 cmd: 0x00000c80} <-- (height + x) * cons
+ * 448 0x00000000 {size: 0x0 channel: 0x0 cmd: 0x00000000} <-- y * cons
+ * 449 0x00000960 {size: 0x0 channel: 0x0 cmd: 0x00000960} <-- (width + y) * cons
+ * 44a 0x00082a00 {size: 0x2 channel: 0x1 cmd: 0x00000a00} <-- VIEWPORT_DIMS
+ * 44b 0x04000000 <-- (Width_from_glViewport << 16) | x
+ * 44c 0x03000000 <-- (Height_from_glViewport << 16) | (win_height - height - y)
+ *
+ */
+
+ nouveauCalcViewport(ctx);
+}
+
+static void nouveauDepthRange(GLcontext *ctx, GLclampd near, GLclampd far)
+{
+ nouveauCalcViewport(ctx);
+}
+
+static void nouveauDDUpdateHWState(GLcontext *ctx)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ int new_state = nmesa->new_state;
+
+ if ( new_state || nmesa->new_render_state & _NEW_TEXTURE )
+ {
+ nmesa->new_state = 0;
+
+ /* Update the various parts of the context's state.
+ */
+ /*
+ if ( new_state & NOUVEAU_NEW_ALPHA )
+ nouveauUpdateAlphaMode( ctx );
+
+ if ( new_state & NOUVEAU_NEW_DEPTH )
+ nouveauUpdateZMode( ctx );
+
+ if ( new_state & NOUVEAU_NEW_FOG )
+ nouveauUpdateFogAttrib( ctx );
+
+ if ( new_state & NOUVEAU_NEW_CLIP )
+ nouveauUpdateClipping( ctx );
+
+ if ( new_state & NOUVEAU_NEW_CULL )
+ nouveauUpdateCull( ctx );
+
+ if ( new_state & NOUVEAU_NEW_MASKS )
+ nouveauUpdateMasks( ctx );
+
+ if ( new_state & NOUVEAU_NEW_WINDOW )
+ nouveauUpdateWindow( ctx );
+
+ if ( nmesa->new_render_state & _NEW_TEXTURE ) {
+ nouveauUpdateTextureState( ctx );
+ }*/
+ }
+}
+
+static void nouveauDDInvalidateState(GLcontext *ctx, GLuint new_state)
+{
+ _swrast_InvalidateState( ctx, new_state );
+ _swsetup_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
+ _tnl_InvalidateState( ctx, new_state );
+ NOUVEAU_CONTEXT(ctx)->new_render_state |= new_state;
+}
+
+/* Initialize the context's hardware state. */
+void nouveauDDInitState(nouveauContextPtr nmesa)
+{
+ uint32_t type = nmesa->screen->card->type;
+ switch(type)
+ {
+ case NV_03:
+ case NV_04:
+ case NV_05:
+ /* No TCL engines for these ones */
+ break;
+ case NV_10:
+ nv10InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
+ break;
+ case NV_20:
+ nv20InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
+ break;
+ case NV_30:
+ case NV_40:
+ case NV_44:
+ case NV_50:
+ nv30InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
+ break;
+ default:
+ break;
+ }
+ nouveau_state_cache_init(nmesa);
+}
+
+/* Initialize the driver's state functions */
+void nouveauDDInitStateFuncs(GLcontext *ctx)
+{
+ ctx->Driver.UpdateState = nouveauDDInvalidateState;
+
+ ctx->Driver.ClearIndex = NULL;
+ ctx->Driver.ClearColor = NULL; //nouveauDDClearColor;
+ ctx->Driver.ClearStencil = NULL; //nouveauDDClearStencil;
+ ctx->Driver.DrawBuffer = NULL; //nouveauDDDrawBuffer;
+ ctx->Driver.ReadBuffer = NULL; //nouveauDDReadBuffer;
+
+ ctx->Driver.IndexMask = NULL;
+ ctx->Driver.ColorMask = NULL; //nouveauDDColorMask;
+ ctx->Driver.AlphaFunc = NULL; //nouveauDDAlphaFunc;
+ ctx->Driver.BlendEquationSeparate = NULL; //nouveauDDBlendEquationSeparate;
+ ctx->Driver.BlendFuncSeparate = NULL; //nouveauDDBlendFuncSeparate;
+ ctx->Driver.ClearDepth = NULL; //nouveauDDClearDepth;
+ ctx->Driver.CullFace = NULL; //nouveauDDCullFace;
+ ctx->Driver.FrontFace = NULL; //nouveauDDFrontFace;
+ ctx->Driver.DepthFunc = NULL; //nouveauDDDepthFunc;
+ ctx->Driver.DepthMask = NULL; //nouveauDDDepthMask;
+ ctx->Driver.Enable = NULL; //nouveauDDEnable;
+ ctx->Driver.Fogfv = NULL; //nouveauDDFogfv;
+ ctx->Driver.Hint = NULL;
+ ctx->Driver.Lightfv = NULL;
+ ctx->Driver.LightModelfv = NULL; //nouveauDDLightModelfv;
+ ctx->Driver.LogicOpcode = NULL; //nouveauDDLogicOpCode;
+ ctx->Driver.PolygonMode = NULL;
+ ctx->Driver.PolygonStipple = NULL; //nouveauDDPolygonStipple;
+ ctx->Driver.RenderMode = NULL; //nouveauDDRenderMode;
+ ctx->Driver.Scissor = NULL; //nouveauDDScissor;
+ ctx->Driver.ShadeModel = NULL; //nouveauDDShadeModel;
+ ctx->Driver.StencilFuncSeparate = NULL; //nouveauDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = NULL; //nouveauDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = NULL; //nouveauDDStencilOpSeparate;
+
+ ctx->Driver.DepthRange = nouveauDepthRange;
+ ctx->Driver.Viewport = nouveauViewport;
+
+ /* Pixel path fallbacks.
+ */
+ ctx->Driver.Accum = _swrast_Accum;
+ ctx->Driver.Bitmap = _swrast_Bitmap;
+ ctx->Driver.CopyPixels = _swrast_CopyPixels;
+ ctx->Driver.DrawPixels = _swrast_DrawPixels;
+ ctx->Driver.ReadPixels = _swrast_ReadPixels;
+
+ /* Swrast hooks for imaging extensions:
+ */
+ ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
+ ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
+ ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
+ ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
+}
+
+#define STATE_INIT(a) if (ctx->Driver.a) ctx->Driver.a
+
+void nouveauInitState(GLcontext *ctx)
+{
+ /*
+ * Mesa should do this for us:
+ */
+
+ STATE_INIT(AlphaFunc)( ctx,
+ ctx->Color.AlphaFunc,
+ ctx->Color.AlphaRef);
+
+ STATE_INIT(BlendColor)( ctx,
+ ctx->Color.BlendColor );
+
+ STATE_INIT(BlendEquationSeparate)( ctx,
+ ctx->Color.BlendEquationRGB,
+ ctx->Color.BlendEquationA);
+
+ STATE_INIT(BlendFuncSeparate)( ctx,
+ ctx->Color.BlendSrcRGB,
+ ctx->Color.BlendDstRGB,
+ ctx->Color.BlendSrcA,
+ ctx->Color.BlendDstA);
+
+ STATE_INIT(ClearColor)( ctx, ctx->Color.ClearColor);
+ STATE_INIT(ClearDepth)( ctx, ctx->Depth.Clear);
+ STATE_INIT(ClearStencil)( ctx, ctx->Stencil.Clear);
+
+ STATE_INIT(ColorMask)( ctx,
+ ctx->Color.ColorMask[RCOMP],
+ ctx->Color.ColorMask[GCOMP],
+ ctx->Color.ColorMask[BCOMP],
+ ctx->Color.ColorMask[ACOMP]);
+
+ STATE_INIT(CullFace)( ctx, ctx->Polygon.CullFaceMode );
+ STATE_INIT(DepthFunc)( ctx, ctx->Depth.Func );
+ STATE_INIT(DepthMask)( ctx, ctx->Depth.Mask );
+
+ STATE_INIT(Enable)( ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled );
+ STATE_INIT(Enable)( ctx, GL_BLEND, ctx->Color.BlendEnabled );
+ STATE_INIT(Enable)( ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled );
+ STATE_INIT(Enable)( ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled );
+ STATE_INIT(Enable)( ctx, GL_CULL_FACE, ctx->Polygon.CullFlag );
+ STATE_INIT(Enable)( ctx, GL_DEPTH_TEST, ctx->Depth.Test );
+ STATE_INIT(Enable)( ctx, GL_DITHER, ctx->Color.DitherFlag );
+ STATE_INIT(Enable)( ctx, GL_FOG, ctx->Fog.Enabled );
+ STATE_INIT(Enable)( ctx, GL_LIGHTING, ctx->Light.Enabled );
+ STATE_INIT(Enable)( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag );
+ STATE_INIT(Enable)( ctx, GL_LINE_STIPPLE, ctx->Line.StippleFlag );
+ STATE_INIT(Enable)( ctx, GL_POINT_SMOOTH, ctx->Point.SmoothFlag );
+ STATE_INIT(Enable)( ctx, GL_POLYGON_OFFSET_FILL, ctx->Polygon.OffsetFill);
+ STATE_INIT(Enable)( ctx, GL_POLYGON_OFFSET_LINE, ctx->Polygon.OffsetLine);
+ STATE_INIT(Enable)( ctx, GL_POLYGON_OFFSET_POINT, ctx->Polygon.OffsetPoint);
+ STATE_INIT(Enable)( ctx, GL_POLYGON_SMOOTH, ctx->Polygon.SmoothFlag );
+ STATE_INIT(Enable)( ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag );
+ STATE_INIT(Enable)( ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled );
+ STATE_INIT(Enable)( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled );
+ STATE_INIT(Enable)( ctx, GL_TEXTURE_1D, GL_FALSE );
+ STATE_INIT(Enable)( ctx, GL_TEXTURE_2D, GL_FALSE );
+ STATE_INIT(Enable)( ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE );
+ STATE_INIT(Enable)( ctx, GL_TEXTURE_3D, GL_FALSE );
+ STATE_INIT(Enable)( ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE );
+
+ STATE_INIT(Fogfv)( ctx, GL_FOG_COLOR, ctx->Fog.Color );
+ STATE_INIT(Fogfv)( ctx, GL_FOG_MODE, 0 );
+ STATE_INIT(Fogfv)( ctx, GL_FOG_DENSITY, &ctx->Fog.Density );
+ STATE_INIT(Fogfv)( ctx, GL_FOG_START, &ctx->Fog.Start );
+ STATE_INIT(Fogfv)( ctx, GL_FOG_END, &ctx->Fog.End );
+
+ STATE_INIT(FrontFace)( ctx, ctx->Polygon.FrontFace );
+
+ {
+ GLfloat f = (GLfloat)ctx->Light.Model.ColorControl;
+ STATE_INIT(LightModelfv)( ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f );
+ }
+
+ STATE_INIT(LineStipple)( ctx, ctx->Line.StippleFactor, ctx->Line.StipplePattern );
+ STATE_INIT(LineWidth)( ctx, ctx->Line.Width );
+ STATE_INIT(LogicOpcode)( ctx, ctx->Color.LogicOp );
+ STATE_INIT(PointSize)( ctx, ctx->Point.Size );
+ STATE_INIT(PolygonMode)( ctx, GL_FRONT, ctx->Polygon.FrontMode );
+ STATE_INIT(PolygonMode)( ctx, GL_BACK, ctx->Polygon.BackMode );
+ STATE_INIT(PolygonOffset)( ctx,
+ ctx->Polygon.OffsetFactor,
+ ctx->Polygon.OffsetUnits );
+ STATE_INIT(PolygonStipple)( ctx, (const GLubyte *)ctx->PolygonStipple );
+ STATE_INIT(ShadeModel)( ctx, ctx->Light.ShadeModel );
+ STATE_INIT(StencilFuncSeparate)( ctx, GL_FRONT,
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0] );
+ STATE_INIT(StencilFuncSeparate)( ctx, GL_BACK,
+ ctx->Stencil.Function[1],
+ ctx->Stencil.Ref[1],
+ ctx->Stencil.ValueMask[1] );
+ STATE_INIT(StencilMaskSeparate)( ctx, GL_FRONT, ctx->Stencil.WriteMask[0] );
+ STATE_INIT(StencilMaskSeparate)( ctx, GL_BACK, ctx->Stencil.WriteMask[1] );
+ STATE_INIT(StencilOpSeparate)( ctx, GL_FRONT,
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
+ STATE_INIT(StencilOpSeparate)( ctx, GL_BACK,
+ ctx->Stencil.FailFunc[1],
+ ctx->Stencil.ZFailFunc[1],
+ ctx->Stencil.ZPassFunc[1]);
+}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.h b/src/mesa/drivers/dri/nouveau/nouveau_state.h
new file mode 100644
index 00000000000..16d63a6ac23
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state.h
@@ -0,0 +1,48 @@
+/**************************************************************************
+
+Copyright 2006 Jeremy Kolb
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef __NOUVEAU_STATE_H__
+#define __NOUVEAU_STATE_H__
+
+#include "nouveau_context.h"
+
+extern void nouveauDDInitState(nouveauContextPtr nmesa);
+extern void nouveauDDInitStateFuncs(GLcontext *ctx);
+
+extern void nv10InitStateFuncs(GLcontext *ctx, struct dd_function_table *func);
+extern void nv20InitStateFuncs(GLcontext *ctx, struct dd_function_table *func);
+extern void nv30InitStateFuncs(GLcontext *ctx, struct dd_function_table *func);
+
+extern void nouveauInitState(GLcontext *ctx);
+
+/*
+extern void nouveauDDUpdateState(GLcontext *ctx);
+extern void nouveauDDUpdateHWState(GLcontext *ctx);
+
+extern void nouveauEmitHwStateLocked(nouveauContextPtr nmesa);
+*/
+#endif
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
new file mode 100644
index 00000000000..cb4b9d30270
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.c
@@ -0,0 +1,69 @@
+
+#include "nouveau_state_cache.h"
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+
+#define BEGIN_RING_NOFLUSH(subchannel,tag,size) do { \
+ if (nmesa->fifo.free <= (size)) \
+ WAIT_RING(nmesa,(size)); \
+ OUT_RING( ((size)<<18) | ((subchannel) << 13) | (tag)); \
+ nmesa->fifo.free -= ((size) + 1); \
+}while(0)
+
+// flush all the dirty state
+void nouveau_state_cache_flush(nouveauContextPtr nmesa)
+{
+ int i=0;
+ int run=0;
+
+ // fast-path no state changes
+ if (!nmesa->state_cache.dirty)
+ return;
+ nmesa->state_cache.dirty=0;
+
+ do
+ {
+ // jump to a dirty state
+ while((nmesa->state_cache.hdirty[i/NOUVEAU_STATE_CACHE_HIER_SIZE]==0)&&(i<NOUVEAU_STATE_CACHE_ENTRIES))
+ i=(i&~(NOUVEAU_STATE_CACHE_HIER_SIZE-1))+NOUVEAU_STATE_CACHE_HIER_SIZE;
+ while((nmesa->state_cache.atoms[i].dirty==0)&&(i<NOUVEAU_STATE_CACHE_ENTRIES))
+ i++;
+
+ // figure out a run of dirty values
+ run=0;
+ while((nmesa->state_cache.atoms[i+run].dirty)&&(i+run<NOUVEAU_STATE_CACHE_ENTRIES))
+ run++;
+
+ // output everything as a single run
+ if (run>0) {
+ int j;
+
+ BEGIN_RING_NOFLUSH(NvSub3D, i*4, run);
+ for(j=0;j<run;j++)
+ {
+ OUT_RING(nmesa->state_cache.atoms[i+j].value);
+ nmesa->state_cache.atoms[i+j].dirty=0;
+ if ((i+j)%NOUVEAU_STATE_CACHE_HIER_SIZE==0)
+ nmesa->state_cache.hdirty[(i+j)/NOUVEAU_STATE_CACHE_HIER_SIZE-1]=0;
+ }
+ i+=run;
+ }
+ }
+ while(i<NOUVEAU_STATE_CACHE_ENTRIES);
+ nmesa->state_cache.hdirty[NOUVEAU_STATE_CACHE_HIER_SIZE/NOUVEAU_STATE_CACHE_HIER_SIZE-1]=0;
+}
+
+
+// inits the state cache
+void nouveau_state_cache_init(nouveauContextPtr nmesa)
+{
+ int i;
+ for(i=0;i<NOUVEAU_STATE_CACHE_ENTRIES;i++)
+ {
+ nmesa->state_cache.atoms[i].dirty=0;
+ nmesa->state_cache.atoms[i].value=0xDEADBEEF; // nvidia cards like beef
+ }
+ nmesa->state_cache.dirty=0;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state_cache.h b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.h
new file mode 100644
index 00000000000..5f9d426450b
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state_cache.h
@@ -0,0 +1,29 @@
+
+#ifndef __NOUVEAU_STATE_CACHE_H__
+#define __NOUVEAU_STATE_CACHE_H__
+
+#include "mtypes.h"
+
+#define NOUVEAU_STATE_CACHE_ENTRIES 2048
+// size of a dirty requests block
+// you can play with that and tune the value to increase/decrease performance
+// but keep it a power of 2 !
+#define NOUVEAU_STATE_CACHE_HIER_SIZE 32
+
+typedef struct nouveau_state_atom_t{
+ uint32_t value;
+ uint32_t dirty;
+}nouveau_state_atom;
+
+typedef struct nouveau_state_cache_t{
+ nouveau_state_atom atoms[NOUVEAU_STATE_CACHE_ENTRIES];
+ uint32_t current_pos;
+ // hierarchical dirty flags
+ uint8_t hdirty[NOUVEAU_STATE_CACHE_ENTRIES/NOUVEAU_STATE_CACHE_HIER_SIZE];
+ // master dirty flag
+ uint8_t dirty;
+}nouveau_state_cache;
+
+
+#endif
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_swtcl.c b/src/mesa/drivers/dri/nouveau/nouveau_swtcl.c
new file mode 100644
index 00000000000..f5c92a1b4e6
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_swtcl.c
@@ -0,0 +1,127 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/* Common software TCL code */
+
+#include "nouveau_context.h"
+#include "nouveau_swtcl.h"
+#include "nv10_swtcl.h"
+#include "nouveau_span.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+
+/* Common tri functions */
+
+/* The fallbacks */
+void nouveau_fallback_tri(struct nouveau_context *nmesa,
+ nouveauVertex *v0,
+ nouveauVertex *v1,
+ nouveauVertex *v2)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ SWvertex v[3];
+ _swsetup_Translate(ctx, v0, &v[0]);
+ _swsetup_Translate(ctx, v1, &v[1]);
+ _swsetup_Translate(ctx, v2, &v[2]);
+ _swrast_Triangle(ctx, &v[0], &v[1], &v[2]);
+}
+
+
+void nouveau_fallback_line(struct nouveau_context *nmesa,
+ nouveauVertex *v0,
+ nouveauVertex *v1)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ SWvertex v[2];
+ _swsetup_Translate(ctx, v0, &v[0]);
+ _swsetup_Translate(ctx, v1, &v[1]);
+ _swrast_Line(ctx, &v[0], &v[1]);
+}
+
+
+void nouveau_fallback_point(struct nouveau_context *nmesa,
+ nouveauVertex *v0)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ SWvertex v[1];
+ _swsetup_Translate(ctx, v0, &v[0]);
+ _swrast_Point(ctx, &v[0]);
+}
+
+void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ GLuint oldfallback = nmesa->Fallback;
+
+ if (mode) {
+ nmesa->Fallback |= bit;
+ if (oldfallback == 0) {
+ if (nmesa->screen->card->type<NV_10) {
+ //nv04FinishPrimitive(nmesa);
+ } else {
+ nv10FinishPrimitive(nmesa);
+ }
+
+ _swsetup_Wakeup(ctx);
+ nmesa->render_index = ~0;
+ }
+ }
+ else {
+ nmesa->Fallback &= ~bit;
+ if (oldfallback == bit) {
+ _swrast_flush( ctx );
+
+ if (nmesa->screen->card->type<NV_10) {
+ //nv04TriInitFunctions(ctx);
+ } else {
+ nv10TriInitFunctions(ctx);
+ }
+
+ _tnl_invalidate_vertex_state( ctx, ~0 );
+ _tnl_invalidate_vertices( ctx, ~0 );
+ _tnl_install_attrs( ctx,
+ nmesa->vertex_attrs,
+ nmesa->vertex_attr_count,
+ nmesa->viewport.m, 0 );
+ }
+ }
+}
+
+
+void nouveauRunPipeline( GLcontext *ctx )
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (nmesa->new_state) {
+ nmesa->new_render_state |= nmesa->new_state;
+ }
+
+ _tnl_run_pipeline( ctx );
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_swtcl.h b/src/mesa/drivers/dri/nouveau/nouveau_swtcl.h
new file mode 100644
index 00000000000..ba4d8725a65
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_swtcl.h
@@ -0,0 +1,55 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NOUVEAU_SWTCL_H__
+#define __NOUVEAU_SWTCL_H__
+
+#include "nouveau_context.h"
+
+extern void nouveau_fallback_tri(struct nouveau_context *nmesa,
+ nouveauVertex *v0,
+ nouveauVertex *v1,
+ nouveauVertex *v2);
+
+extern void nouveau_fallback_line(struct nouveau_context *nmesa,
+ nouveauVertex *v0,
+ nouveauVertex *v1);
+
+extern void nouveau_fallback_point(struct nouveau_context *nmesa,
+ nouveauVertex *v0);
+
+extern void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode);
+
+extern void nouveauRunPipeline( GLcontext *ctx );
+
+extern void nouveauTriInitFunctions( GLcontext *ctx );
+
+
+#endif /* __NOUVEAU_SWTCL_H__ */
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.c b/src/mesa/drivers/dri/nouveau/nouveau_sync.c
new file mode 100644
index 00000000000..0bf20e723bb
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.c
@@ -0,0 +1,136 @@
+#include "vblank.h" /* for DO_USLEEP */
+
+#include "nouveau_context.h"
+#include "nouveau_buffers.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+#include "nouveau_msg.h"
+#include "nouveau_sync.h"
+
+nouveau_notifier *
+nouveau_notifier_new(GLcontext *ctx, GLuint handle)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nouveau_notifier *notifier;
+
+ notifier = CALLOC_STRUCT(nouveau_notifier_t);
+ if (!notifier)
+ return NULL;
+
+ notifier->mem = nouveau_mem_alloc(ctx,
+ NOUVEAU_MEM_FB | NOUVEAU_MEM_MAPPED,
+ 32,
+ 0);
+ if (!notifier->mem) {
+ FREE(notifier);
+ return NULL;
+ }
+
+ if (!nouveauCreateDmaObject(nmesa, handle, notifier->mem->offset,
+ notifier->mem->size,
+ 0 /* NV_DMA_TARGET_FB */,
+ 0 /* NV_DMA_ACCESS_RW */)) {
+ nouveau_mem_free(ctx, notifier->mem);
+ FREE(notifier);
+ return NULL;
+ }
+
+ notifier->handle = handle;
+ return notifier;
+}
+
+void
+nouveau_notifier_destroy(GLcontext *ctx, nouveau_notifier *notifier)
+{
+ /*XXX: free DMA object.. */
+ nouveau_mem_free(ctx, notifier->mem);
+ FREE(notifier);
+}
+
+void
+nouveau_notifier_reset(nouveau_notifier *notifier)
+{
+ volatile GLuint *n = notifier->mem->map;
+
+ 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);
+}
+
+GLboolean
+nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint status,
+ GLuint timeout)
+{
+ volatile GLuint *n = notifier->mem->map;
+ unsigned int time = 0;
+
+ while (time <= timeout) {
+ if (n[NV_NOTIFY_STATE/4] & NV_NOTIFY_STATE_ERROR_CODE_MASK) {
+ MESSAGE("Notifier returned error: 0x%04x\n",
+ n[NV_NOTIFY_STATE] &
+ NV_NOTIFY_STATE_ERROR_CODE_MASK);
+ return GL_FALSE;
+ }
+
+ if (((n[NV_NOTIFY_STATE/4] & NV_NOTIFY_STATE_STATUS_MASK) >>
+ NV_NOTIFY_STATE_STATUS_SHIFT) == status)
+ return GL_TRUE;
+
+ if (timeout) {
+ DO_USLEEP(1);
+ time++;
+ }
+ }
+
+ MESSAGE("Notifier timed out\n");
+ return GL_FALSE;
+}
+
+void
+nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier,
+ GLuint subc)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLboolean ret;
+
+ nouveau_notifier_reset(notifier);
+
+ BEGIN_RING_SIZE(subc, NV_NOTIFY, 1);
+ OUT_RING (NV_NOTIFY_STYLE_WRITE_ONLY);
+ BEGIN_RING_SIZE(subc, NV_NOP, 1);
+ OUT_RING (0);
+ FIRE_RING();
+
+ ret = nouveau_notifier_wait_status(notifier,
+ NV_NOTIFY_STATE_STATUS_COMPLETED,
+ 0 /* no timeout */);
+ if (ret == GL_FALSE) MESSAGE("wait on notifier failed\n");
+}
+
+GLboolean nouveauSyncInitFuncs(GLcontext *ctx)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ nmesa->syncNotifier = nouveau_notifier_new(ctx, NvSyncNotify);
+ if (!nmesa->syncNotifier) {
+ MESSAGE("Failed to create channel sync notifier\n");
+ return GL_FALSE;
+ }
+
+ /* 0x180 is SET_DMA_NOTIFY, should be correct for all supported 3D
+ * object classes
+ */
+ BEGIN_RING_CACHE(NvSub3D, 0x180, 1);
+ OUT_RING_CACHE (NvSyncNotify);
+#ifdef ALLOW_MULTI_SUBCHANNEL
+ BEGIN_RING_SIZE(NvSubMemFormat,
+ NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1);
+ OUT_RING (NvSyncNotify);
+#endif
+
+ return GL_TRUE;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.h b/src/mesa/drivers/dri/nouveau/nouveau_sync.h
new file mode 100644
index 00000000000..d9e3d4b80c1
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.h
@@ -0,0 +1,36 @@
+#ifndef __NOUVEAU_SYNC_H__
+#define __NOUVEAU_SYNC_H__
+
+#include "nouveau_buffers.h"
+
+#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
+
+/* Methods that (hopefully) all objects have */
+#define NV_NOP 0x00000100
+#define NV_NOTIFY 0x00000104
+#define NV_NOTIFY_STYLE_WRITE_ONLY 0
+
+typedef struct nouveau_notifier_t {
+ GLuint handle;
+ nouveau_mem *mem;
+} nouveau_notifier;
+
+extern nouveau_notifier *nouveau_notifier_new(GLcontext *, GLuint handle);
+extern void nouveau_notifier_destroy(GLcontext *, nouveau_notifier *);
+extern void nouveau_notifier_reset(nouveau_notifier *);
+extern GLboolean nouveau_notifier_wait_status(nouveau_notifier *r,
+ GLuint status, GLuint timeout);
+extern void nouveau_notifier_wait_nop(GLcontext *ctx,
+ nouveau_notifier *, GLuint subc);
+
+extern GLboolean nouveauSyncInitFuncs(GLcontext *ctx);
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_tex.c b/src/mesa/drivers/dri/nouveau/nouveau_tex.c
new file mode 100644
index 00000000000..0a8d2796695
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_tex.c
@@ -0,0 +1,49 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#include "nouveau_tex.h"
+
+// XXX needs some love
+void nouveauTexInitFunctions( struct dd_function_table *functions )
+{
+/*
+ functions->TexEnv = nouveauTexEnv;
+ functions->ChooseTextureFormat = nouveauChooseTextureFormat;
+ functions->TexImage1D = nouveauTexImage1D;
+ functions->TexSubImage1D = nouveauTexSubImage1D;
+ functions->TexImage2D = nouveauTexImage2D;
+ functions->TexSubImage2D = nouveauTexSubImage2D;
+ functions->TexParameter = nouveauTexParameter;
+ functions->BindTexture = nouveauBindTexture;
+ functions->NewTextureObject = nouveauNewTextureObject;
+ functions->DeleteTexture = nouveauDeleteTexture;
+ functions->IsTextureResident = driIsTextureResident;
+
+ driInitTextureFormats();
+*/
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_tex.h b/src/mesa/drivers/dri/nouveau/nouveau_tex.h
new file mode 100644
index 00000000000..7ac71f8300b
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_tex.h
@@ -0,0 +1,38 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+#ifndef __NOUVEAU_TEX_H__
+#define __NOUVEAU_TEX_H__
+
+#include <errno.h>
+#include "mtypes.h"
+#include "macros.h"
+#include "dd.h"
+
+extern void nouveauTexInitFunctions( struct dd_function_table *functions );
+
+#endif /* __NOUVEAU_TEX_H__ */
diff --git a/src/mesa/drivers/dri/nouveau/nv04_swtcl.c b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c
new file mode 100644
index 00000000000..f31c0d692de
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c
@@ -0,0 +1,570 @@
+/*
+ * Copyright 2007 Stephane Marchesin. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/* Software TCL for NV04, NV05, NV06 */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "glheader.h"
+#include "context.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "colormac.h"
+#include "enums.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+#include "nouveau_swtcl.h"
+#include "nv04_swtcl.h"
+#include "nouveau_context.h"
+#include "nouveau_span.h"
+#include "nouveau_reg.h"
+#include "nouveau_tex.h"
+#include "nouveau_fifo.h"
+#include "nouveau_msg.h"
+#include "nouveau_object.h"
+
+static void nv04RasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
+static void nv04RenderPrimitive( GLcontext *ctx, GLenum prim );
+static void nv04ResetLineStipple( GLcontext *ctx );
+
+
+static inline void nv04_2triangles(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3,nouveauVertex* v4,nouveauVertex* v5)
+{
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xA),49);
+ OUT_RINGp(v0,8);
+ OUT_RINGp(v1,8);
+ OUT_RINGp(v2,8);
+ OUT_RINGp(v3,8);
+ OUT_RINGp(v4,8);
+ OUT_RINGp(v5,8);
+ OUT_RING(0xFEDCBA);
+}
+
+static inline void nv04_1triangle(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2)
+{
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xD),25);
+ OUT_RINGp(v0,8);
+ OUT_RINGp(v1,8);
+ OUT_RINGp(v2,8);
+ OUT_RING(0xFED);
+}
+
+static inline void nv04_1quad(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3)
+{
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xC),33);
+ OUT_RINGp(v0,8);
+ OUT_RINGp(v1,8);
+ OUT_RINGp(v2,8);
+ OUT_RINGp(v3,8);
+ OUT_RING(0xFECEDC);
+}
+
+/**********************************************************************/
+/* Render unclipped begin/end objects */
+/**********************************************************************/
+
+static void nv04_render_points_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // erm
+}
+
+static void nv04_render_lines_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // umm
+}
+
+static void nv04_render_line_strip_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // yeah
+}
+
+static void nv04_render_line_loop_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // right
+}
+
+static void nv04_render_triangles_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ int i;
+
+ for(i=start;i<count-5;i+=6)
+ nv04_2triangles(nmesa,
+ (nouveauVertex*)(vertptr+(i+0)*vertsize),
+ (nouveauVertex*)(vertptr+(i+1)*vertsize),
+ (nouveauVertex*)(vertptr+(i+2)*vertsize),
+ (nouveauVertex*)(vertptr+(i+3)*vertsize),
+ (nouveauVertex*)(vertptr+(i+4)*vertsize),
+ (nouveauVertex*)(vertptr+(i+5)*vertsize)
+ );
+ if (i!=count)
+ {
+ nv04_1triangle(nmesa,
+ (nouveauVertex*)(vertptr+(i+0)*vertsize),
+ (nouveauVertex*)(vertptr+(i+1)*vertsize),
+ (nouveauVertex*)(vertptr+(i+2)*vertsize)
+ );
+ i+=3;
+ }
+ if (i!=count)
+ printf("oops\n");
+}
+
+static void nv04_render_tri_strip_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ uint32_t striptbl[]={0x321210,0x543432,0x765654,0x987876,0xBA9A98,0xDCBCBA,0xFEDEDC};
+ int i,j;
+
+ for(i=start;i<count;i+=14)
+ {
+ int numvert=MIN2(16,count-i);
+ int numtri=numvert-2;
+ if (numvert<3)
+ break;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x0),numvert*8);
+ for(j=0;j<numvert;j++)
+ OUT_RINGp((nouveauVertex*)(vertptr+(i+j)*vertsize),8);
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_DRAW|NONINC_METHOD,(numtri+1)/2);
+ for(j=0;j<numtri/2;j++)
+ OUT_RING(striptbl[j]);
+ if (numtri%2)
+ OUT_RING(striptbl[numtri/2]&0xFFF);
+ }
+}
+
+static void nv04_render_tri_fan_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ uint32_t fantbl[]={0x320210,0x540430,0x760650,0x980870,0xBA0A90,0xDC0CB0,0xFE0ED0};
+ int i,j;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x0),8);
+ OUT_RINGp((nouveauVertex*)(vertptr+start*vertsize),8);
+
+ for(i=start+1;i<count;i+=14)
+ {
+ int numvert=MIN2(15,count-i);
+ int numtri=numvert-1;
+ if (numvert<3)
+ break;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x1),numvert*8);
+
+ for(j=0;j<numvert;j++)
+ OUT_RINGp((nouveauVertex*)(vertptr+(i+j)*vertsize),8);
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_DRAW|NONINC_METHOD,(numtri+1)/2);
+ for(j=0;j<numtri/2;j++)
+ OUT_RING(fantbl[j]);
+ if (numtri%2)
+ OUT_RING(fantbl[numtri/2]&0xFFF);
+ }
+}
+
+static void nv04_render_quads_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ int i;
+
+ for(i=start;i<count;i+=4)
+ nv04_1quad(nmesa,
+ (nouveauVertex*)(vertptr+(i+0)*vertsize),
+ (nouveauVertex*)(vertptr+(i+1)*vertsize),
+ (nouveauVertex*)(vertptr+(i+2)*vertsize),
+ (nouveauVertex*)(vertptr+(i+3)*vertsize)
+ );
+}
+
+static void nv04_render_noop_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+}
+
+static void (*nv04_render_tab_verts[GL_POLYGON+2])(GLcontext *,
+ GLuint,
+ GLuint,
+ GLuint) =
+{
+ nv04_render_points_verts,
+ nv04_render_lines_verts,
+ nv04_render_line_loop_verts,
+ nv04_render_line_strip_verts,
+ nv04_render_triangles_verts,
+ nv04_render_tri_strip_verts,
+ nv04_render_tri_fan_verts,
+ nv04_render_quads_verts,
+ nv04_render_tri_strip_verts, //nv04_render_quad_strip_verts
+ nv04_render_tri_fan_verts, //nv04_render_poly_verts
+ nv04_render_noop_verts,
+};
+
+
+static void nv04_render_points_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // erm
+}
+
+static void nv04_render_lines_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // umm
+}
+
+static void nv04_render_line_strip_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // yeah
+}
+
+static void nv04_render_line_loop_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ // right
+}
+
+static void nv04_render_triangles_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+ int i;
+
+ for(i=start;i<count-5;i+=6)
+ nv04_2triangles(nmesa,
+ (nouveauVertex*)(vertptr+elt[i+0]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+1]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+2]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+3]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+4]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+5]*vertsize)
+ );
+ if (i!=count)
+ {
+ nv04_1triangle(nmesa,
+ (nouveauVertex*)(vertptr+elt[i+0]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+1]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+2]*vertsize)
+ );
+ i+=3;
+ }
+ if (i!=count)
+ printf("oops\n");
+}
+
+static void nv04_render_tri_strip_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ uint32_t striptbl[]={0x321210,0x543432,0x765654,0x987876,0xBA9A98,0xDCBCBA,0xFEDEDC};
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+ int i,j;
+
+ for(i=start;i<count;i+=14)
+ {
+ int numvert=MIN2(16,count-i);
+ int numtri=numvert-2;
+ if (numvert<3)
+ break;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x0),numvert*8);
+ for(j=0;j<numvert;j++)
+ OUT_RINGp((nouveauVertex*)(vertptr+elt[i+j]*vertsize),8);
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_DRAW|NONINC_METHOD,(numtri+1)/2);
+ for(j=0;j<numtri/2;j++)
+ OUT_RING(striptbl[j]);
+ if (numtri%2)
+ OUT_RING(striptbl[numtri/2]&0xFFF);
+ }
+}
+
+static void nv04_render_tri_fan_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ uint32_t fantbl[]={0x320210,0x540430,0x760650,0x980870,0xBA0A90,0xDC0CB0,0xFE0ED0};
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+ int i,j;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x0),8);
+ OUT_RINGp((nouveauVertex*)(vertptr+elt[start]*vertsize),8);
+
+ for(i=start+1;i<count;i+=14)
+ {
+ int numvert=MIN2(15,count-i);
+ int numtri=numvert-2;
+ if (numvert<3)
+ break;
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0x1),numvert*8);
+
+ for(j=0;j<numvert;j++)
+ OUT_RINGp((nouveauVertex*)(vertptr+elt[i+j]*vertsize),8);
+
+ BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_DRAW|NONINC_METHOD,(numtri+1)/2);
+ for(j=0;j<numtri/2;j++)
+ OUT_RING(fantbl[j]);
+ if (numtri%2)
+ OUT_RING(fantbl[numtri/2]&0xFFF);
+ }
+}
+
+static void nv04_render_quads_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+ int i;
+
+ for(i=start;i<count;i+=4)
+ nv04_1quad(nmesa,
+ (nouveauVertex*)(vertptr+elt[i+0]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+1]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+2]*vertsize),
+ (nouveauVertex*)(vertptr+elt[i+3]*vertsize)
+ );
+}
+
+static void nv04_render_noop_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+}
+
+static void (*nv04_render_tab_elts[GL_POLYGON+2])(GLcontext *,
+ GLuint,
+ GLuint,
+ GLuint) =
+{
+ nv04_render_points_elts,
+ nv04_render_lines_elts,
+ nv04_render_line_loop_elts,
+ nv04_render_line_strip_elts,
+ nv04_render_triangles_elts,
+ nv04_render_tri_strip_elts,
+ nv04_render_tri_fan_elts,
+ nv04_render_quads_elts,
+ nv04_render_tri_strip_elts, // nv04_render_quad_strip_elts,
+ nv04_render_tri_fan_elts, // nv04_render_poly_elts,
+ nv04_render_noop_elts,
+};
+
+
+/**********************************************************************/
+/* Choose render functions */
+/**********************************************************************/
+
+
+#define EMIT_ATTR( ATTR, STYLE ) \
+do { \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].attrib = (ATTR); \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].format = (STYLE); \
+ nmesa->vertex_attr_count++; \
+} while (0)
+
+#define EMIT_PAD( N ) \
+do { \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].attrib = 0; \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].format = EMIT_PAD; \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].offset = (N); \
+ nmesa->vertex_attr_count++; \
+} while (0)
+
+
+static void nv04ChooseRenderState(GLcontext *ctx)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ tnl->Driver.Render.PrimTabVerts = nv04_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = nv04_render_tab_elts;
+ tnl->Driver.Render.ClippedLine = NULL;
+ tnl->Driver.Render.ClippedPolygon = NULL;
+}
+
+
+
+static inline void nv04OutputVertexFormat(struct nouveau_context* nmesa)
+{
+ GLcontext* ctx=nmesa->glCtx;
+ DECLARE_RENDERINPUTS(index);
+
+ /*
+ * Tell t_vertex about the vertex format
+ */
+ RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset);
+
+ // SX SY SZ INVW
+ // FIXME : we use W instead of INVW, but since W=1 it doesn't matter
+ if (RENDERINPUTS_TEST(index, _TNL_ATTRIB_POS))
+ EMIT_ATTR(_TNL_ATTRIB_POS,EMIT_4F_VIEWPORT);
+ else
+ EMIT_PAD(4*sizeof(float));
+
+ // COLOR
+ if (RENDERINPUTS_TEST(index, _TNL_ATTRIB_COLOR0))
+ EMIT_ATTR(_TNL_ATTRIB_COLOR0,EMIT_4UB_4F_ABGR);
+ else
+ EMIT_PAD(4);
+
+ // SPECULAR
+ if (RENDERINPUTS_TEST(index, _TNL_ATTRIB_COLOR1))
+ EMIT_ATTR(_TNL_ATTRIB_COLOR1,EMIT_4UB_4F_ABGR);
+ else
+ EMIT_PAD(4);
+
+ // TEXTURE
+ if (RENDERINPUTS_TEST(index, _TNL_ATTRIB_TEX0))
+ EMIT_ATTR(_TNL_ATTRIB_TEX0,EMIT_2F);
+ else
+ EMIT_PAD(2*sizeof(float));
+
+ nmesa->vertex_size=_tnl_install_attrs( ctx,
+ nmesa->vertex_attrs,
+ nmesa->vertex_attr_count,
+ ctx->Viewport._WindowMap.m, 0 );
+}
+
+
+static void nv04ChooseVertexState( GLcontext *ctx )
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ DECLARE_RENDERINPUTS(index);
+
+ RENDERINPUTS_COPY(index, tnl->render_inputs_bitset);
+ if (!RENDERINPUTS_EQUAL(index, nmesa->render_inputs_bitset))
+ {
+ RENDERINPUTS_COPY(nmesa->render_inputs_bitset, index);
+ nv04OutputVertexFormat(nmesa);
+ }
+}
+
+
+/**********************************************************************/
+/* High level hooks for t_vb_render.c */
+/**********************************************************************/
+
+
+static void nv04RenderStart(GLcontext *ctx)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (nmesa->new_state) {
+ nmesa->new_render_state |= nmesa->new_state;
+ }
+
+ if (nmesa->new_render_state) {
+ nv04ChooseVertexState(ctx);
+ nv04ChooseRenderState(ctx);
+ nmesa->new_render_state = 0;
+ }
+}
+
+static void nv04RenderFinish(GLcontext *ctx)
+{
+}
+
+
+/* System to flush dma and emit state changes based on the rasterized
+ * primitive.
+ */
+void nv04RasterPrimitive(GLcontext *ctx,
+ GLenum glprim,
+ GLuint hwprim)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ assert (!nmesa->new_state);
+
+ if (hwprim != nmesa->current_primitive)
+ {
+ nmesa->current_primitive=hwprim;
+
+ }
+}
+
+static const GLuint hw_prim[GL_POLYGON+1] = {
+ GL_POINTS+1,
+ GL_LINES+1,
+ GL_LINE_STRIP+1,
+ GL_LINE_LOOP+1,
+ GL_TRIANGLES+1,
+ GL_TRIANGLE_STRIP+1,
+ GL_TRIANGLE_FAN+1,
+ GL_QUADS+1,
+ GL_QUAD_STRIP+1,
+ GL_POLYGON+1
+};
+
+/* Callback for mesa:
+ */
+static void nv04RenderPrimitive( GLcontext *ctx, GLuint prim )
+{
+ nv04RasterPrimitive( ctx, prim, hw_prim[prim] );
+}
+
+static void nv04ResetLineStipple( GLcontext *ctx )
+{
+ /* FIXME do something here */
+ WARN_ONCE("Unimplemented nv04ResetLineStipple\n");
+}
+
+
+/**********************************************************************/
+/* Initialization. */
+/**********************************************************************/
+
+void nv04TriInitFunctions(GLcontext *ctx)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ tnl->Driver.RunPipeline = nouveauRunPipeline;
+ tnl->Driver.Render.Start = nv04RenderStart;
+ tnl->Driver.Render.Finish = nv04RenderFinish;
+ tnl->Driver.Render.PrimitiveNotify = nv04RenderPrimitive;
+ tnl->Driver.Render.ResetLineStipple = nv04ResetLineStipple;
+ tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
+ tnl->Driver.Render.CopyPV = _tnl_copy_pv;
+ tnl->Driver.Render.Interp = _tnl_interp;
+
+ _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, 32 );
+
+ nmesa->verts = (GLubyte *)tnl->clipspace.vertex_buf;
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nv04_swtcl.h b/src/mesa/drivers/dri/nouveau/nv04_swtcl.h
new file mode 100644
index 00000000000..42dde5383eb
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv04_swtcl.h
@@ -0,0 +1,12 @@
+#ifndef __NV04_SWTCL_H__
+#define __NV04_SWTCL_H__
+
+#include "mtypes.h"
+
+extern void nv04Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
+extern void nv04FinishPrimitive(struct nouveau_context *nmesa);
+extern void nv04TriInitFunctions(GLcontext *ctx);
+#define FALLBACK( nmesa, bit, mode ) nouveauFallback( nmesa->glCtx, bit, mode )
+
+#endif /* __NV04_SWTCL_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
new file mode 100644
index 00000000000..0e912e73ffe
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -0,0 +1,746 @@
+/**************************************************************************
+
+Copyright 2006 Nouveau
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+
+#include "tnl/t_pipeline.h"
+
+#include "mtypes.h"
+#include "colormac.h"
+
+static void nv10AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte ubRef;
+ CLAMPED_FLOAT_TO_UBYTE(ubRef, ref);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC, 2);
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ubRef);
+}
+
+static void nv10BlendColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte cf[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(cf[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[3], color[3]);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_BLEND_COLOR, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(cf[3], cf[1], cf[2], cf[0]));
+}
+
+static void nv10BlendEquationSeparate(GLcontext *ctx, GLenum modeRGB, GLenum modeA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ assert( modeRGB == modeA );
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_BLEND_EQUATION, 1);
+ OUT_RING_CACHE(modeRGB);
+}
+
+
+static void nv10BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ assert( sfactorRGB == sfactorA );
+ assert( dfactorRGB == dfactorA );
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC, 2);
+ OUT_RING_CACHE(sfactorRGB);
+ OUT_RING_CACHE(dfactorRGB);
+}
+
+static void nv10Clear(GLcontext *ctx, GLbitfield mask)
+{
+ /* TODO */
+}
+
+static void nv10ClearColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte c[4];
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c,color);
+ nmesa->clear_color_value = PACK_COLOR_8888(c[3],c[0],c[1],c[2]);
+}
+
+static void nv10ClearDepth(GLcontext *ctx, GLclampd d)
+{
+ /* FIXME: check if 16 or 24/32 bits depth buffer */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0x000000FF)|(((uint32_t)(d*0xFFFFFF))<<8));
+}
+
+static void nv10ClearStencil(GLcontext *ctx, GLint s)
+{
+ /* FIXME: not valid for 16 bits depth buffer (0 stencil bits) */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0xFFFFFF00)|(s&0x000000FF));
+}
+
+static void nv10ClipPlane(GLcontext *ctx, GLenum plane, const GLfloat *equation)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(plane), 4);
+ OUT_RING_CACHEf(equation[0]);
+ OUT_RING_CACHEf(equation[1]);
+ OUT_RING_CACHEf(equation[2]);
+ OUT_RING_CACHEf(equation[3]);
+}
+
+static void nv10ColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask,
+ GLboolean bmask, GLboolean amask )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_COLOR_MASK, 1);
+ OUT_RING_CACHE(((amask && 0x01) << 24) | ((rmask && 0x01) << 16) | ((gmask && 0x01)<< 8) | ((bmask && 0x01) << 0));
+}
+
+static void nv10ColorMaterial(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ /* TODO I need love */
+}
+
+static void nv10CullFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CULL_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv10FrontFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FRONT_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv10DepthFunc(GLcontext *ctx, GLenum func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_FUNC, 1);
+ OUT_RING_CACHE(func);
+}
+
+static void nv10DepthMask(GLcontext *ctx, GLboolean flag)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE, 1);
+ OUT_RING_CACHE(flag);
+}
+
+static void nv10DepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR, 2);
+ OUT_RING_CACHEf(nearval);
+ OUT_RING_CACHEf(farval);
+}
+
+/** Specify the current buffer for writing */
+//void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
+/** Specify the buffers for writing for fragment programs*/
+//void (*DrawBuffers)( GLcontext *ctx, GLsizei n, const GLenum *buffers );
+
+static void nv10Enable(GLcontext *ctx, GLenum cap, GLboolean state)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ switch(cap)
+ {
+ case GL_ALPHA_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_AUTO_NORMAL:
+ case GL_BLEND:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE(cap-GL_CLIP_PLANE0), 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_COLOR_LOGIC_OP:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_COLOR_MATERIAL:
+// case GL_COLOR_SUM_EXT:
+// case GL_COLOR_TABLE:
+// case GL_CONVOLUTION_1D:
+// case GL_CONVOLUTION_2D:
+ case GL_CULL_FACE:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DEPTH_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DITHER:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DITHER_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_FOG:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FOG_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_HISTOGRAM:
+// case GL_INDEX_LOGIC_OP:
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ {
+ uint32_t mask=1<<(2*(cap-GL_LIGHT0));
+ nmesa->enabled_lights=((nmesa->enabled_lights&mask)|(mask*state));
+ if (nmesa->lighting_enabled)
+ {
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ }
+ break;
+ }
+ case GL_LIGHTING:
+ nmesa->lighting_enabled=state;
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ if (nmesa->lighting_enabled)
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ else
+ OUT_RING_CACHE(0x0);
+ break;
+ case GL_LINE_SMOOTH:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_LINE_STIPPLE:
+// case GL_MAP1_COLOR_4:
+// case GL_MAP1_INDEX:
+// case GL_MAP1_NORMAL:
+// case GL_MAP1_TEXTURE_COORD_1:
+// case GL_MAP1_TEXTURE_COORD_2:
+// case GL_MAP1_TEXTURE_COORD_3:
+// case GL_MAP1_TEXTURE_COORD_4:
+// case GL_MAP1_VERTEX_3:
+// case GL_MAP1_VERTEX_4:
+// case GL_MAP2_COLOR_4:
+// case GL_MAP2_INDEX:
+// case GL_MAP2_NORMAL:
+// case GL_MAP2_TEXTURE_COORD_1:
+// case GL_MAP2_TEXTURE_COORD_2:
+// case GL_MAP2_TEXTURE_COORD_3:
+// case GL_MAP2_TEXTURE_COORD_4:
+// case GL_MAP2_VERTEX_3:
+// case GL_MAP2_VERTEX_4:
+// case GL_MINMAX:
+ case GL_NORMALIZE:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_POINT_SMOOTH:
+ case GL_POLYGON_OFFSET_POINT:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_LINE:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_FILL:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_SMOOTH:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_POLYGON_STIPPLE:
+// case GL_POST_COLOR_MATRIX_COLOR_TABLE:
+// case GL_POST_CONVOLUTION_COLOR_TABLE:
+// case GL_RESCALE_NORMAL:
+// case GL_SCISSOR_TEST:
+// case GL_SEPARABLE_2D:
+ case GL_STENCIL_TEST:
+ // TODO BACK and FRONT ?
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_STENCIL_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_TEXTURE_GEN_Q:
+// case GL_TEXTURE_GEN_R:
+// case GL_TEXTURE_GEN_S:
+// case GL_TEXTURE_GEN_T:
+// case GL_TEXTURE_1D:
+// case GL_TEXTURE_2D:
+// case GL_TEXTURE_3D:
+ }
+}
+
+static void nv10Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ switch(pname)
+ {
+ case GL_FOG_MODE:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FOG_MODE, 1);
+ //OUT_RING_CACHE (params);
+ break;
+ /* TODO: unsure about the rest.*/
+ default:
+ break;
+ }
+
+}
+
+static void nv10Hint(GLcontext *ctx, GLenum target, GLenum mode)
+{
+ /* TODO I need love (fog and line_smooth hints) */
+}
+
+// void (*IndexMask)(GLcontext *ctx, GLuint mask);
+
+enum {
+ SPOTLIGHT_NO_UPDATE,
+ SPOTLIGHT_UPDATE_EXPONENT,
+ SPOTLIGHT_UPDATE_DIRECTION,
+ SPOTLIGHT_UPDATE_ALL
+};
+
+static void nv10Lightfv(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLint p = light - GL_LIGHT0;
+ struct gl_light *l = &ctx->Light.Light[p];
+ int spotlight_update = SPOTLIGHT_NO_UPDATE;
+
+ switch(pname)
+ {
+ case GL_AMBIENT:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_DIFFUSE:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPECULAR:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_POSITION:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPOT_DIRECTION:
+ spotlight_update = SPOTLIGHT_UPDATE_DIRECTION;
+ break;
+ case GL_SPOT_EXPONENT:
+ spotlight_update = SPOTLIGHT_UPDATE_EXPONENT;
+ break;
+ case GL_SPOT_CUTOFF:
+ spotlight_update = SPOTLIGHT_UPDATE_ALL;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_LINEAR_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ default:
+ break;
+ }
+
+ switch(spotlight_update) {
+ case SPOTLIGHT_UPDATE_DIRECTION:
+ {
+ GLfloat x,y,z;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(p), 3);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_EXPONENT:
+ {
+ GLfloat cc,lc,qc;
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 3);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_ALL:
+ {
+ GLfloat cc,lc,qc, x,y,z, c;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ c = spot_light_coef_a + 1.0;
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 7);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ OUT_RING_CACHEf(c);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/** Set the lighting model parameters */
+static void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
+
+
+static void nv10LineStipple(GLcontext *ctx, GLint factor, GLushort pattern )
+{
+ /* Not for NV10 */
+}
+
+static void nv10LineWidth(GLcontext *ctx, GLfloat width)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_LINE_WIDTH, 1);
+ OUT_RING_CACHE(((int) (width * 8.0)) & -4);
+}
+
+static void nv10LogicOpcode(GLcontext *ctx, GLenum opcode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP, 1);
+ OUT_RING_CACHE(opcode);
+}
+
+static void nv10PointParameterfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ /*TODO: not sure what goes here. */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+}
+
+static void nv10PointSize(GLcontext *ctx, GLfloat size)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POINT_SIZE, 1);
+ OUT_RING_CACHE(((int) (size * 8.0)) & -4);
+}
+
+static void nv10PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT, 1);
+ OUT_RING_CACHE(mode);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK, 1);
+ OUT_RING_CACHE(mode);
+ }
+}
+
+/** Set the scale and units used to calculate depth values */
+static void nv10PolygonOffset(GLcontext *ctx, GLfloat factor, GLfloat units)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR, 2);
+ OUT_RING_CACHEf(factor);
+ OUT_RING_CACHEf(units);
+}
+
+/** Set the polygon stippling pattern */
+static void nv10PolygonStipple(GLcontext *ctx, const GLubyte *mask )
+{
+ /* Not for NV10 */
+}
+
+/* Specifies the current buffer for reading */
+void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
+/** Set rasterization mode */
+void (*RenderMode)(GLcontext *ctx, GLenum mode );
+
+/** Define the scissor box */
+static void nv10Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+}
+
+/** Select flat or smooth shading */
+static void nv10ShadeModel(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_SHADE_MODEL, 1);
+ OUT_RING_CACHE(mode);
+}
+
+/** OpenGL 2.0 two-sided StencilFunc */
+static void nv10StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* NV10 do not have separate FRONT and BACK stencils */
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_STENCIL_FUNC_FUNC, 3);
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ref);
+ OUT_RING_CACHE(mask);
+}
+
+/** OpenGL 2.0 two-sided StencilMask */
+static void nv10StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* NV10 do not have separate FRONT and BACK stencils */
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_STENCIL_MASK, 1);
+ OUT_RING_CACHE(mask);
+}
+
+/** OpenGL 2.0 two-sided StencilOp */
+static void nv10StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* NV10 do not have separate FRONT and BACK stencils */
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_STENCIL_OP_FAIL, 3);
+ OUT_RING_CACHE(fail);
+ OUT_RING_CACHE(zfail);
+ OUT_RING_CACHE(zpass);
+}
+
+/** Control the generation of texture coordinates */
+void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname,
+ const GLfloat *params);
+/** Set texture environment parameters */
+void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname,
+ const GLfloat *param);
+/** Set texture parameters */
+void (*TexParameter)(GLcontext *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params);
+
+static void nv10TextureMatrix(GLcontext *ctx, GLuint unit, const GLmatrix *mat)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_TX_MATRIX(unit, 0), 16);
+ /*XXX: This SHOULD work.*/
+ OUT_RING_CACHEp(mat->m, 16);
+}
+
+/* Update anything that depends on the window position/size */
+static void nv10WindowMoved(nouveauContextPtr nmesa)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ GLfloat *v = nmesa->viewport.m;
+ GLuint w = ctx->Viewport.Width;
+ GLuint h = ctx->Viewport.Height;
+ GLuint x = ctx->Viewport.X + nmesa->drawX;
+ GLuint y = ctx->Viewport.Y + nmesa->drawY;
+ int i;
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 2);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+
+ /* something to do with clears, possibly doesn't belong here */
+ BEGIN_RING_CACHE(NvSub3D,
+ NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 2);
+ OUT_RING_CACHE(((w+x) << 16) | x | 0x800);
+ OUT_RING_CACHE(((h+y) << 16) | y | 0x800);
+ for (i=1; i<7; i++) {
+ BEGIN_RING_CACHE(NvSub3D,
+ NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(i), 1);
+ OUT_RING_CACHE(0);
+ BEGIN_RING_CACHE(NvSub3D,
+ NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(i), 1);
+ OUT_RING_CACHE(0);
+ }
+
+ /* viewport transform */
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
+ OUT_RING_CACHEf ((GLfloat) x);
+ OUT_RING_CACHEf ((GLfloat) (y+h));
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf (0.0);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X, 4);
+ OUT_RING_CACHEf ((((GLfloat) w) * 0.5) - 2048.0);
+ OUT_RING_CACHEf ((((GLfloat) h) * 0.5) - 2048.0);
+ OUT_RING_CACHEf (16777215.0 * 0.5);
+ OUT_RING_CACHEf (0.0);
+}
+
+/* Initialise any card-specific non-GL related state */
+static GLboolean nv10InitCard(nouveauContextPtr nmesa)
+{
+ nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
+
+ BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY0, 2);
+ OUT_RING(NvDmaFB); /* 184 dma_in_memory0 */
+ OUT_RING(NvDmaFB); /* 188 dma_in_memory1 */
+ BEGIN_RING_SIZE(NvSub3D, NV10_TCL_PRIMITIVE_3D_SET_DMA_IN_MEMORY2, 2);
+ OUT_RING(NvDmaFB); /* 194 dma_in_memory2 */
+ OUT_RING(NvDmaFB); /* 198 dma_in_memory3 */
+
+ BEGIN_RING_SIZE(NvSub3D, 0x02b4, 1);
+ OUT_RING(0);
+ BEGIN_RING_SIZE(NvSub3D, 0x0290, 1);
+ OUT_RING(0x00100001);
+ BEGIN_RING_SIZE(NvSub3D, 0x03f4, 1);
+ OUT_RING(0);
+
+ return GL_FALSE;
+}
+
+/* Update buffer offset/pitch/format */
+static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color,
+ nouveau_renderbuffer **color,
+ nouveau_renderbuffer *depth)
+{
+ GLuint x, y, w, h;
+ GLuint pitch, format;
+
+ w = color[0]->mesa.Width;
+ h = color[0]->mesa.Height;
+ x = nmesa->drawX;
+ y = nmesa->drawY;
+
+ if (num_color != 1)
+ return GL_FALSE;
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 6);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+ pitch = color[0]->pitch;
+ if (depth) {
+ pitch |= (depth->pitch << 16);
+ }
+ format = 0x108;
+ if (color[0]->mesa._ActualFormat != GL_RGBA8) {
+ format = 0x103; /* R5G6B5 color buffer */
+ }
+ OUT_RING(format);
+ OUT_RING(pitch);
+ OUT_RING(color[0]->offset);
+ OUT_RING(depth ? depth->offset : color[0]->offset);
+
+ return GL_TRUE;
+}
+
+void nv10InitStateFuncs(GLcontext *ctx, struct dd_function_table *func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ func->AlphaFunc = nv10AlphaFunc;
+ func->BlendColor = nv10BlendColor;
+ func->BlendEquationSeparate = nv10BlendEquationSeparate;
+ func->BlendFuncSeparate = nv10BlendFuncSeparate;
+ func->Clear = nv10Clear;
+ func->ClearColor = nv10ClearColor;
+ func->ClearDepth = nv10ClearDepth;
+ func->ClearStencil = nv10ClearStencil;
+ func->ClipPlane = nv10ClipPlane;
+ func->ColorMask = nv10ColorMask;
+ func->ColorMaterial = nv10ColorMaterial;
+ func->CullFace = nv10CullFace;
+ func->FrontFace = nv10FrontFace;
+ func->DepthFunc = nv10DepthFunc;
+ func->DepthMask = nv10DepthMask;
+ func->DepthRange = nv10DepthRange;
+ func->Enable = nv10Enable;
+ func->Fogfv = nv10Fogfv;
+ func->Hint = nv10Hint;
+ func->Lightfv = nv10Lightfv;
+/* func->LightModelfv = nv10LightModelfv; */
+ func->LineStipple = nv10LineStipple; /* Not for NV10 */
+ func->LineWidth = nv10LineWidth;
+ func->LogicOpcode = nv10LogicOpcode;
+ func->PointParameterfv = nv10PointParameterfv;
+ func->PointSize = nv10PointSize;
+ func->PolygonMode = nv10PolygonMode;
+ func->PolygonOffset = nv10PolygonOffset;
+ func->PolygonStipple = nv10PolygonStipple; /* Not for NV10 */
+/* func->ReadBuffer = nv10ReadBuffer;*/
+/* func->RenderMode = nv10RenderMode;*/
+ func->Scissor = nv10Scissor;
+ func->ShadeModel = nv10ShadeModel;
+ func->StencilFuncSeparate = nv10StencilFuncSeparate;
+ func->StencilMaskSeparate = nv10StencilMaskSeparate;
+ func->StencilOpSeparate = nv10StencilOpSeparate;
+/* func->TexGen = nv10TexGen;*/
+/* func->TexParameter = nv10TexParameter;*/
+ func->TextureMatrix = nv10TextureMatrix;
+
+ nmesa->hw_func.InitCard = nv10InitCard;
+ nmesa->hw_func.BindBuffers = nv10BindBuffers;
+ nmesa->hw_func.WindowMoved = nv10WindowMoved;
+}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
new file mode 100644
index 00000000000..12b277de456
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
@@ -0,0 +1,569 @@
+/*
+ * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
+ * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
+ * Copyright 2006 Stephane Marchesin. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/* Software TCL for NV10, NV20, NV30, NV40, G70 */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "glheader.h"
+#include "context.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "colormac.h"
+#include "enums.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+#include "nouveau_swtcl.h"
+#include "nv10_swtcl.h"
+#include "nouveau_context.h"
+#include "nouveau_span.h"
+#include "nouveau_reg.h"
+#include "nouveau_tex.h"
+#include "nouveau_fifo.h"
+#include "nouveau_msg.h"
+#include "nouveau_object.h"
+
+static void nv10RasterPrimitive( GLcontext *ctx, GLenum rprim, GLuint hwprim );
+static void nv10RenderPrimitive( GLcontext *ctx, GLenum prim );
+static void nv10ResetLineStipple( GLcontext *ctx );
+
+
+
+static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t primitive,uint32_t size)
+{
+ if (nmesa->screen->card->type==NV_10)
+ BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ else if (nmesa->screen->card->type==NV_20)
+ BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ else
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ OUT_RING(primitive);
+
+ if (nmesa->screen->card->type==NV_10)
+ BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_DATA|NONINC_METHOD,size);
+ else if (nmesa->screen->card->type==NV_20)
+ BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_VERTEX_DATA|NONINC_METHOD,size);
+ else
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_VERTEX_DATA|NONINC_METHOD,size);
+}
+
+inline void nv10FinishPrimitive(struct nouveau_context *nmesa)
+{
+ if (nmesa->screen->card->type==NV_10)
+ BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ else if (nmesa->screen->card->type==NV_20)
+ BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ else
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_BEGIN_END,1);
+ OUT_RING(0x0);
+ FIRE_RING();
+}
+
+
+static inline void nv10ExtendPrimitive(struct nouveau_context* nmesa, int size)
+{
+ /* make sure there's enough room. if not, wait */
+ if (RING_AVAILABLE()<size)
+ {
+ WAIT_RING(nmesa,size);
+ }
+}
+
+/**********************************************************************/
+/* Render unclipped begin/end objects */
+/**********************************************************************/
+
+static inline void nv10_render_generic_primitive_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags,GLuint prim)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ GLuint size_dword = vertsize*(count-start)/4;
+
+ nv10ExtendPrimitive(nmesa, size_dword);
+ nv10StartPrimitive(nmesa,prim+1,size_dword);
+ OUT_RINGp((nouveauVertex*)(vertptr+(start*vertsize)),size_dword);
+ nv10FinishPrimitive(nmesa);
+}
+
+static void nv10_render_points_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_POINTS);
+}
+
+static void nv10_render_lines_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_LINES);
+}
+
+static void nv10_render_line_strip_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_LINE_STRIP);
+}
+
+static void nv10_render_line_loop_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_LINE_LOOP);
+}
+
+static void nv10_render_triangles_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_TRIANGLES);
+}
+
+static void nv10_render_tri_strip_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_TRIANGLE_STRIP);
+}
+
+static void nv10_render_tri_fan_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_TRIANGLE_FAN);
+}
+
+static void nv10_render_quads_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_QUADS);
+}
+
+static void nv10_render_quad_strip_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_QUAD_STRIP);
+}
+
+static void nv10_render_poly_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_verts(ctx,start,count,flags,GL_POLYGON);
+}
+
+static void nv10_render_noop_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+}
+
+static void (*nv10_render_tab_verts[GL_POLYGON+2])(GLcontext *,
+ GLuint,
+ GLuint,
+ GLuint) =
+{
+ nv10_render_points_verts,
+ nv10_render_lines_verts,
+ nv10_render_line_loop_verts,
+ nv10_render_line_strip_verts,
+ nv10_render_triangles_verts,
+ nv10_render_tri_strip_verts,
+ nv10_render_tri_fan_verts,
+ nv10_render_quads_verts,
+ nv10_render_quad_strip_verts,
+ nv10_render_poly_verts,
+ nv10_render_noop_verts,
+};
+
+
+static inline void nv10_render_generic_primitive_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags,GLuint prim)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte *vertptr = (GLubyte *)nmesa->verts;
+ GLuint vertsize = nmesa->vertex_size;
+ GLuint size_dword = vertsize*(count-start)/4;
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+ GLuint j;
+
+ nv10ExtendPrimitive(nmesa, size_dword);
+ nv10StartPrimitive(nmesa,prim+1,size_dword);
+ for (j=start; j<count; j++ ) {
+ OUT_RINGp((nouveauVertex*)(vertptr+(elt[j]*vertsize)),vertsize);
+ }
+ nv10FinishPrimitive(nmesa);
+}
+
+static void nv10_render_points_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_POINTS);
+}
+
+static void nv10_render_lines_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_LINES);
+}
+
+static void nv10_render_line_strip_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_LINE_STRIP);
+}
+
+static void nv10_render_line_loop_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_LINE_LOOP);
+}
+
+static void nv10_render_triangles_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_TRIANGLES);
+}
+
+static void nv10_render_tri_strip_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_TRIANGLE_STRIP);
+}
+
+static void nv10_render_tri_fan_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_TRIANGLE_FAN);
+}
+
+static void nv10_render_quads_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_QUADS);
+}
+
+static void nv10_render_quad_strip_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_QUAD_STRIP);
+}
+
+static void nv10_render_poly_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ nv10_render_generic_primitive_elts(ctx,start,count,flags,GL_POLYGON);
+}
+
+static void nv10_render_noop_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+}
+
+static void (*nv10_render_tab_elts[GL_POLYGON+2])(GLcontext *,
+ GLuint,
+ GLuint,
+ GLuint) =
+{
+ nv10_render_points_elts,
+ nv10_render_lines_elts,
+ nv10_render_line_loop_elts,
+ nv10_render_line_strip_elts,
+ nv10_render_triangles_elts,
+ nv10_render_tri_strip_elts,
+ nv10_render_tri_fan_elts,
+ nv10_render_quads_elts,
+ nv10_render_quad_strip_elts,
+ nv10_render_poly_elts,
+ nv10_render_noop_elts,
+};
+
+
+/**********************************************************************/
+/* Choose render functions */
+/**********************************************************************/
+
+
+#define EMIT_ATTR( ATTR, STYLE ) \
+do { \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].attrib = (ATTR); \
+ nmesa->vertex_attrs[nmesa->vertex_attr_count].format = (STYLE); \
+ nmesa->vertex_attr_count++; \
+} while (0)
+
+
+static void nv10ChooseRenderState(GLcontext *ctx)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ tnl->Driver.Render.PrimTabVerts = nv10_render_tab_verts;
+ tnl->Driver.Render.PrimTabElts = nv10_render_tab_elts;
+ tnl->Driver.Render.ClippedLine = NULL;
+ tnl->Driver.Render.ClippedPolygon = NULL;
+}
+
+
+
+static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
+{
+ GLcontext* ctx=nmesa->glCtx;
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ DECLARE_RENDERINPUTS(index);
+ struct vertex_buffer *VB = &tnl->vb;
+ int attr_size[16];
+ int default_attr_size[8]={3,3,3,4,3,1,4,4};
+ int i;
+ int slots=0;
+ int total_size=0;
+ /* t_vertex_generic dereferences a NULL pointer if we
+ * pass NULL as the vp transform...
+ */
+ const GLfloat ident_vp[16] = {
+ 1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0
+ };
+
+ RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset);
+
+ /*
+ * Determine attribute sizes
+ */
+ for(i=0;i<8;i++)
+ {
+ if (RENDERINPUTS_TEST(index, i))
+ attr_size[i]=default_attr_size[i];
+ else
+ attr_size[i]=0;
+ }
+ for(i=8;i<16;i++)
+ {
+ if (RENDERINPUTS_TEST(index, i))
+ attr_size[i]=VB->TexCoordPtr[i-8]->size;
+ else
+ attr_size[i]=0;
+ }
+
+ /*
+ * Tell t_vertex about the vertex format
+ */
+ for(i=0;i<16;i++)
+ {
+ if (RENDERINPUTS_TEST(index, i))
+ {
+ slots=i+1;
+ if (i==_TNL_ATTRIB_POS)
+ {
+ /* special-case POS */
+ EMIT_ATTR(_TNL_ATTRIB_POS,EMIT_3F_VIEWPORT);
+ }
+ else
+ {
+ switch(attr_size[i])
+ {
+ case 1:
+ EMIT_ATTR(i,EMIT_1F);
+ break;
+ case 2:
+ EMIT_ATTR(i,EMIT_2F);
+ break;
+ case 3:
+ EMIT_ATTR(i,EMIT_3F);
+ break;
+ case 4:
+ EMIT_ATTR(i,EMIT_4F);
+ break;
+ }
+ }
+ if (i==_TNL_ATTRIB_COLOR0)
+ nmesa->color_offset=total_size;
+ if (i==_TNL_ATTRIB_COLOR1)
+ nmesa->specular_offset=total_size;
+ total_size+=attr_size[i];
+ }
+ }
+
+ nmesa->vertex_size=_tnl_install_attrs( ctx,
+ nmesa->vertex_attrs,
+ nmesa->vertex_attr_count,
+ ident_vp, 0 );
+ assert(nmesa->vertex_size==total_size*4);
+
+ /*
+ * Tell the hardware about the vertex format
+ */
+ if (nmesa->screen->card->type==NV_10) {
+ int size;
+
+#define NV_VERTEX_ATTRIBUTE_TYPE_FLOAT 2
+
+#define NV10_SET_VERTEX_ATTRIB(i,j) \
+ do { \
+ size = attr_size[j] << 4; \
+ size |= (attr_size[j]*4) << 8; \
+ size |= NV_VERTEX_ATTRIBUTE_TYPE_FLOAT; \
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VERTEX_ATTR(i),1); \
+ OUT_RING_CACHE(size); \
+ } while (0)
+
+ NV10_SET_VERTEX_ATTRIB(0, _TNL_ATTRIB_POS);
+ NV10_SET_VERTEX_ATTRIB(1, _TNL_ATTRIB_COLOR0);
+ NV10_SET_VERTEX_ATTRIB(2, _TNL_ATTRIB_COLOR1);
+ NV10_SET_VERTEX_ATTRIB(3, _TNL_ATTRIB_TEX0);
+ NV10_SET_VERTEX_ATTRIB(4, _TNL_ATTRIB_TEX1);
+ NV10_SET_VERTEX_ATTRIB(5, _TNL_ATTRIB_NORMAL);
+ NV10_SET_VERTEX_ATTRIB(6, _TNL_ATTRIB_WEIGHT);
+ NV10_SET_VERTEX_ATTRIB(7, _TNL_ATTRIB_FOG);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_VALIDATE,1);
+ OUT_RING_CACHE(0);
+ } else if (nmesa->screen->card->type==NV_20) {
+ for(i=0;i<16;i++)
+ {
+ int size=attr_size[i];
+ BEGIN_RING_CACHE(NvSub3D,NV20_TCL_PRIMITIVE_3D_VERTEX_ATTR(i),1);
+ OUT_RING_CACHE(NV_VERTEX_ATTRIBUTE_TYPE_FLOAT|(size*0x10));
+ }
+ } else {
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DO_VERTICES, 1);
+ OUT_RING(0);
+ BEGIN_RING_CACHE(NvSub3D,NV30_TCL_PRIMITIVE_3D_VERTEX_ATTR0_POS,slots);
+ for(i=0;i<slots;i++)
+ {
+ int size=attr_size[i];
+ OUT_RING_CACHE(NV_VERTEX_ATTRIBUTE_TYPE_FLOAT|(size*0x10));
+ }
+ // FIXME this is probably not needed
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_VERTEX_UNK_0,1);
+ OUT_RING(0);
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_VERTEX_UNK_0,1);
+ OUT_RING(0);
+ BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_VERTEX_UNK_0,1);
+ OUT_RING(0);
+ }
+}
+
+
+static void nv10ChooseVertexState( GLcontext *ctx )
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ DECLARE_RENDERINPUTS(index);
+
+ RENDERINPUTS_COPY(index, tnl->render_inputs_bitset);
+ if (!RENDERINPUTS_EQUAL(index, nmesa->render_inputs_bitset))
+ {
+ RENDERINPUTS_COPY(nmesa->render_inputs_bitset, index);
+ nv10OutputVertexFormat(nmesa);
+ }
+
+ if (nmesa->screen->card->type >= NV_40) {
+ /* Ensure passthrough shader is being used, and mvp matrix
+ * is up to date
+ */
+ nvsUpdateShader(ctx, nmesa->passthrough_vp);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_IN_REG, 2);
+ OUT_RING_CACHE (0xff09); /*IN : POS, COL, TC0-7 */
+ OUT_RING_CACHE (0x3fc001); /*OUT: COL, TC0-7, POS implied */
+
+ /* Update texenv shader / user fragprog */
+ nvsUpdateShader(ctx, (nouveauShader*)ctx->FragmentProgram._Current);
+ }
+}
+
+
+/**********************************************************************/
+/* High level hooks for t_vb_render.c */
+/**********************************************************************/
+
+
+static void nv10RenderStart(GLcontext *ctx)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (nmesa->new_state) {
+ nmesa->new_render_state |= nmesa->new_state;
+ }
+
+ if (nmesa->new_render_state) {
+ nv10ChooseVertexState(ctx);
+ nv10ChooseRenderState(ctx);
+ nmesa->new_render_state = 0;
+ }
+}
+
+static void nv10RenderFinish(GLcontext *ctx)
+{
+}
+
+
+/* System to flush dma and emit state changes based on the rasterized
+ * primitive.
+ */
+void nv10RasterPrimitive(GLcontext *ctx,
+ GLenum glprim,
+ GLuint hwprim)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ assert (!nmesa->new_state);
+
+ if (hwprim != nmesa->current_primitive)
+ {
+ nmesa->current_primitive=hwprim;
+
+ }
+}
+
+static const GLuint hw_prim[GL_POLYGON+1] = {
+ GL_POINTS+1,
+ GL_LINES+1,
+ GL_LINE_STRIP+1,
+ GL_LINE_LOOP+1,
+ GL_TRIANGLES+1,
+ GL_TRIANGLE_STRIP+1,
+ GL_TRIANGLE_FAN+1,
+ GL_QUADS+1,
+ GL_QUAD_STRIP+1,
+ GL_POLYGON+1
+};
+
+/* Callback for mesa:
+ */
+static void nv10RenderPrimitive( GLcontext *ctx, GLuint prim )
+{
+ nv10RasterPrimitive( ctx, prim, hw_prim[prim] );
+}
+
+static void nv10ResetLineStipple( GLcontext *ctx )
+{
+ /* FIXME do something here */
+ WARN_ONCE("Unimplemented nv10ResetLineStipple\n");
+}
+
+
+/**********************************************************************/
+/* Initialization. */
+/**********************************************************************/
+
+void nv10TriInitFunctions(GLcontext *ctx)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ tnl->Driver.RunPipeline = nouveauRunPipeline;
+ tnl->Driver.Render.Start = nv10RenderStart;
+ tnl->Driver.Render.Finish = nv10RenderFinish;
+ tnl->Driver.Render.PrimitiveNotify = nv10RenderPrimitive;
+ tnl->Driver.Render.ResetLineStipple = nv10ResetLineStipple;
+ tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
+ tnl->Driver.Render.CopyPV = _tnl_copy_pv;
+ tnl->Driver.Render.Interp = _tnl_interp;
+
+ _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
+ 64 * sizeof(GLfloat) );
+
+ nmesa->verts = (GLubyte *)tnl->clipspace.vertex_buf;
+}
+
+
diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.h b/src/mesa/drivers/dri/nouveau/nv10_swtcl.h
new file mode 100644
index 00000000000..7c854addd2d
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.h
@@ -0,0 +1,40 @@
+/**************************************************************************
+
+Copyright 2006 Stephane Marchesin
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+
+
+#ifndef __NV10_SWTCL_H__
+#define __NV10_SWTCL_H__
+
+#include "mtypes.h"
+
+extern void nv10Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
+extern void nv10FinishPrimitive(struct nouveau_context *nmesa);
+extern void nv10TriInitFunctions(GLcontext *ctx);
+#define FALLBACK( nmesa, bit, mode ) nouveauFallback( nmesa->glCtx, bit, mode )
+
+#endif /* __NV10_SWTCL_H__ */
+
diff --git a/src/mesa/drivers/dri/nouveau/nv20_shader.h b/src/mesa/drivers/dri/nouveau/nv20_shader.h
new file mode 100644
index 00000000000..7d2e29db668
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv20_shader.h
@@ -0,0 +1,121 @@
+/* NV20_TCL_PRIMITIVE_3D_0x0B00 */
+#define NV20_VP_INST_0B00 0x00000000 /* always 0? */
+#define NV20_VP_INST0_KNOWN 0
+
+/* NV20_TCL_PRIMITIVE_3D_0x0B04 */
+#define NV20_VP_INST_SCA_OPCODE_SHIFT 25
+#define NV20_VP_INST_SCA_OPCODE_MASK (0x0F << 25)
+#define NV20_VP_INST_OPCODE_RCP 0x2
+#define NV20_VP_INST_OPCODE_RCC 0x3
+#define NV20_VP_INST_OPCODE_RSQ 0x4
+#define NV20_VP_INST_OPCODE_EXP 0x5
+#define NV20_VP_INST_OPCODE_LOG 0x6
+#define NV20_VP_INST_OPCODE_LIT 0x7
+#define NV20_VP_INST_VEC_OPCODE_SHIFT 21
+#define NV20_VP_INST_VEC_OPCODE_MASK (0x0F << 21)
+#define NV20_VP_INST_OPCODE_NOP 0x0 /* guess */
+#define NV20_VP_INST_OPCODE_MOV 0x1
+#define NV20_VP_INST_OPCODE_MUL 0x2
+#define NV20_VP_INST_OPCODE_ADD 0x3
+#define NV20_VP_INST_OPCODE_MAD 0x4
+#define NV20_VP_INST_OPCODE_DP3 0x5
+#define NV20_VP_INST_OPCODE_DPH 0x6
+#define NV20_VP_INST_OPCODE_DP4 0x7
+#define NV20_VP_INST_OPCODE_DST 0x8
+#define NV20_VP_INST_OPCODE_MIN 0x9
+#define NV20_VP_INST_OPCODE_MAX 0xA
+#define NV20_VP_INST_OPCODE_SLT 0xB
+#define NV20_VP_INST_OPCODE_SGE 0xC
+#define NV20_VP_INST_OPCODE_ARL 0xD
+#define NV20_VP_INST_CONST_SRC_SHIFT 13
+#define NV20_VP_INST_CONST_SRC_MASK (0xFF << 13)
+#define NV20_VP_INST_INPUT_SRC_SHIFT 9
+#define NV20_VP_INST_INPUT_SRC_MASK (0xF << 9) /* guess */
+#define NV20_VP_INST_INPUT_SRC_POS 0
+#define NV20_VP_INST_INPUT_SRC_COL0 3
+#define NV20_VP_INST_INPUT_SRC_COL1 4
+#define NV20_VP_INST_INPUT_SRC_TC(n) (9+n)
+#define NV20_VP_INST_SRC0H_SHIFT 0
+#define NV20_VP_INST_SRC0H_MASK (0x1FF << 0)
+#define NV20_VP_INST1_KNOWN ( \
+ NV20_VP_INST_OPCODE_MASK | \
+ NV20_VP_INST_CONST_SRC_MASK | \
+ NV20_VP_INST_INPUT_SRC_MASK | \
+ NV20_VP_INST_SRC0H_MASK \
+ )
+
+/* NV20_TCL_PRIMITIVE_3D_0x0B08 */
+#define NV20_VP_INST_SRC0L_SHIFT 26
+#define NV20_VP_INST_SRC0L_MASK (0x3F <<26)
+#define NV20_VP_INST_SRC1_SHIFT 11
+#define NV20_VP_INST_SRC1_MASK (0x7FFF<<11)
+#define NV20_VP_INST_SRC2H_SHIFT 0
+#define NV20_VP_INST_SRC2H_MASK (0x7FF << 0)
+
+/* NV20_TCL_PRIMITIVE_3D_0x0B0C */
+#define NV20_VP_INST_SRC2L_SHIFT 28
+#define NV20_VP_INST_SRC2L_MASK (0x0F <<28)
+#define NV20_VP_INST_VTEMP_WRITEMASK_SHIFT 24
+#define NV20_VP_INST_VTEMP_WRITEMASK_MASK (0x0F <<24)
+# define NV20_VP_INST_TEMP_WRITEMASK_X (1<<27)
+# define NV20_VP_INST_TEMP_WRITEMASK_Y (1<<26)
+# define NV20_VP_INST_TEMP_WRITEMASK_Z (1<<25)
+# define NV20_VP_INST_TEMP_WRITEMASK_W (1<<24)
+#define NV20_VP_INST_DEST_TEMP_ID_SHIFT 20
+#define NV20_VP_INST_DEST_TEMP_ID_MASK (0x0F <<20)
+#define NV20_VP_INST_STEMP_WRITEMASK_SHIFT 16
+#define NV20_VP_INST_STEMP_WRITEMASK_MASK (0x0F <<16)
+# define NV20_VP_INST_STEMP_WRITEMASK_X (1<<19)
+# define NV20_VP_INST_STEMP_WRITEMASK_Y (1<<18)
+# define NV20_VP_INST_STEMP_WRITEMASK_Z (1<<17)
+# define NV20_VP_INST_STEMP_WRITEMASK_W (1<<16)
+#define NV20_VP_INST_DEST_WRITEMASK_SHIFT 12
+#define NV20_VP_INST_DEST_WRITEMASK_MASK (0x0F <<12)
+# define NV20_VP_INST_DEST_WRITEMASK_X (1<<15)
+# define NV20_VP_INST_DEST_WRITEMASK_Y (1<<14)
+# define NV20_VP_INST_DEST_WRITEMASK_Z (1<<13)
+# define NV20_VP_INST_DEST_WRITEMASK_W (1<<12)
+#define NV20_VP_INST_DEST_SHIFT 3
+#define NV20_VP_INST_DEST_MASK (0xF << 3) /* guess */
+#define NV20_VP_INST_DEST_POS 0
+#define NV20_VP_INST_DEST_COL0 3
+#define NV20_VP_INST_DEST_COL1 4
+#define NV20_VP_INST_DEST_TC(n) (9+n)
+#define NV20_VP_INST_INDEX_CONST (1<<1)
+#define NV20_VP_INST3_KNOWN ( \
+ NV20_VP_INST_SRC2L_MASK | \
+ NV20_VP_INST_TEMP_WRITEMASK_MASK | \
+ NV20_VP_INST_DEST_TEMP_ID_MASK | \
+ NV20_VP_INST_STEMP_WRITEMASK_MASK | \
+ NV20_VP_INST_DEST_WRITEMASK_MASK | \
+ NV20_VP_INST_DEST_MASK | \
+ NV20_VP_INST_INDEX_CONST \
+ )
+
+/* Useful to split the source selection regs into their pieces */
+#define NV20_VP_SRC0_HIGH_SHIFT 6
+#define NV20_VP_SRC0_HIGH_MASK 0x00007FC0
+#define NV20_VP_SRC0_LOW_MASK 0x0000003F
+#define NV20_VP_SRC2_HIGH_SHIFT 4
+#define NV20_VP_SRC2_HIGH_MASK 0x00007FF0
+#define NV20_VP_SRC2_LOW_MASK 0x0000000F
+
+#define NV20_VP_SRC_REG_NEGATE (1<<14)
+#define NV20_VP_SRC_REG_SWZ_X_SHIFT 12
+#define NV20_VP_SRC_REG_SWZ_X_MASK (0x03 <<12)
+#define NV20_VP_SRC_REG_SWZ_Y_SHIFT 10
+#define NV20_VP_SRC_REG_SWZ_Y_MASK (0x03 <<10)
+#define NV20_VP_SRC_REG_SWZ_Z_SHIFT 8
+#define NV20_VP_SRC_REG_SWZ_Z_MASK (0x03 << 8)
+#define NV20_VP_SRC_REG_SWZ_W_SHIFT 6
+#define NV20_VP_SRC_REG_SWZ_W_MASK (0x03 << 6)
+#define NV20_VP_SRC_REG_SWZ_ALL_SHIFT 6
+#define NV20_VP_SRC_REG_SWZ_ALL_MASK (0xFF << 6)
+#define NV20_VP_SRC_REG_TEMP_ID_SHIFT 2
+#define NV20_VP_SRC_REG_TEMP_ID_MASK (0x0F << 0)
+#define NV20_VP_SRC_REG_TYPE_SHIFT 0
+#define NV20_VP_SRC_REG_TYPE_MASK (0x03 << 0)
+#define NV20_VP_SRC_REG_TYPE_TEMP 1
+#define NV20_VP_SRC_REG_TYPE_INPUT 2
+#define NV20_VP_SRC_REG_TYPE_CONST 3 /* guess */
+
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state.c b/src/mesa/drivers/dri/nouveau/nv20_state.c
new file mode 100644
index 00000000000..8e38d6eba00
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv20_state.c
@@ -0,0 +1,662 @@
+/**************************************************************************
+
+Copyright 2006 Nouveau
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+
+#include "tnl/t_pipeline.h"
+
+#include "mtypes.h"
+#include "colormac.h"
+
+static void nv20AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte ubRef;
+ CLAMPED_FLOAT_TO_UBYTE(ubRef, ref);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC, 2);
+ OUT_RING_CACHE(func); /* NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC */
+ OUT_RING_CACHE(ubRef); /* NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF */
+}
+
+static void nv20BlendColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte cf[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(cf[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[3], color[3]);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_BLEND_COLOR, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(cf[3], cf[1], cf[2], cf[0]));
+}
+
+static void nv20BlendEquationSeparate(GLcontext *ctx, GLenum modeRGB, GLenum modeA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_BLEND_EQUATION, 1);
+ OUT_RING_CACHE((modeA<<16) | modeRGB);
+}
+
+
+static void nv20BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC, 2);
+ OUT_RING_CACHE((sfactorA<<16) | sfactorRGB);
+ OUT_RING_CACHE((dfactorA<<16) | dfactorRGB);
+}
+
+static void nv20ClearColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte c[4];
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c,color);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CLEAR_VALUE_ARGB, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(c[3],c[0],c[1],c[2]));
+}
+
+static void nv20ClearDepth(GLcontext *ctx, GLclampd d)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0x000000FF)|(((uint32_t)(d*0xFFFFFF))<<8));
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH, 1);
+ OUT_RING_CACHE(nmesa->clear_value);
+}
+
+/* we're don't support indexed buffers
+ void (*ClearIndex)(GLcontext *ctx, GLuint index)
+ */
+
+static void nv20ClearStencil(GLcontext *ctx, GLint s)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0xFFFFFF00)|(s&0x000000FF));
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH, 1);
+ OUT_RING_CACHE(nmesa->clear_value);
+}
+
+static void nv20ClipPlane(GLcontext *ctx, GLenum plane, const GLfloat *equation)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_A(plane), 4);
+ OUT_RING_CACHEf(equation[0]);
+ OUT_RING_CACHEf(equation[1]);
+ OUT_RING_CACHEf(equation[2]);
+ OUT_RING_CACHEf(equation[3]);
+}
+
+static void nv20ColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask,
+ GLboolean bmask, GLboolean amask )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_COLOR_MASK, 1);
+ OUT_RING_CACHE(((amask && 0x01) << 24) | ((rmask && 0x01) << 16) | ((gmask && 0x01)<< 8) | ((bmask && 0x01) << 0));
+}
+
+static void nv20ColorMaterial(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ // TODO I need love
+}
+
+static void nv20CullFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CULL_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv20FrontFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_FRONT_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv20DepthFunc(GLcontext *ctx, GLenum func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_DEPTH_FUNC, 1);
+ OUT_RING_CACHE(func);
+}
+
+static void nv20DepthMask(GLcontext *ctx, GLboolean flag)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE, 1);
+ OUT_RING_CACHE(flag);
+}
+
+static void nv20DepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR, 2);
+ OUT_RING_CACHEf(nearval);
+ OUT_RING_CACHEf(farval);
+}
+
+/** Specify the current buffer for writing */
+//void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
+/** Specify the buffers for writing for fragment programs*/
+//void (*DrawBuffers)( GLcontext *ctx, GLsizei n, const GLenum *buffers );
+
+static void nv20Enable(GLcontext *ctx, GLenum cap, GLboolean state)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ switch(cap)
+ {
+ case GL_ALPHA_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_AUTO_NORMAL:
+ case GL_BLEND:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE(cap-GL_CLIP_PLANE0), 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_COLOR_LOGIC_OP:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_COLOR_MATERIAL:
+// case GL_COLOR_SUM_EXT:
+// case GL_COLOR_TABLE:
+// case GL_CONVOLUTION_1D:
+// case GL_CONVOLUTION_2D:
+ case GL_CULL_FACE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DEPTH_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DITHER:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_DITHER_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_FOG:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_FOG_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_HISTOGRAM:
+// case GL_INDEX_LOGIC_OP:
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ {
+ uint32_t mask=0x11<<(2*(cap-GL_LIGHT0));
+ nmesa->enabled_lights=((nmesa->enabled_lights&mask)|(mask*state));
+ if (nmesa->lighting_enabled)
+ {
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ }
+ break;
+ }
+ case GL_LIGHTING:
+ nmesa->lighting_enabled=state;
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ if (nmesa->lighting_enabled)
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ else
+ OUT_RING_CACHE(0x0);
+ break;
+ case GL_LINE_SMOOTH:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LINE_SMOOTH_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_LINE_STIPPLE:
+// case GL_MAP1_COLOR_4:
+// case GL_MAP1_INDEX:
+// case GL_MAP1_NORMAL:
+// case GL_MAP1_TEXTURE_COORD_1:
+// case GL_MAP1_TEXTURE_COORD_2:
+// case GL_MAP1_TEXTURE_COORD_3:
+// case GL_MAP1_TEXTURE_COORD_4:
+// case GL_MAP1_VERTEX_3:
+// case GL_MAP1_VERTEX_4:
+// case GL_MAP2_COLOR_4:
+// case GL_MAP2_INDEX:
+// case GL_MAP2_NORMAL:
+// case GL_MAP2_TEXTURE_COORD_1:
+// case GL_MAP2_TEXTURE_COORD_2:
+// case GL_MAP2_TEXTURE_COORD_3:
+// case GL_MAP2_TEXTURE_COORD_4:
+// case GL_MAP2_VERTEX_3:
+// case GL_MAP2_VERTEX_4:
+// case GL_MINMAX:
+ case GL_NORMALIZE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_POINT_SMOOTH:
+ case GL_POLYGON_OFFSET_POINT:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_LINE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_FILL:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_SMOOTH:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_STIPPLE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_POST_COLOR_MATRIX_COLOR_TABLE:
+// case GL_POST_CONVOLUTION_COLOR_TABLE:
+// case GL_RESCALE_NORMAL:
+// case GL_SCISSOR_TEST:
+// case GL_SEPARABLE_2D:
+ case GL_STENCIL_TEST:
+ // TODO BACK and FRONT ?
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_STENCIL_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_TEXTURE_GEN_Q:
+// case GL_TEXTURE_GEN_R:
+// case GL_TEXTURE_GEN_S:
+// case GL_TEXTURE_GEN_T:
+// case GL_TEXTURE_1D:
+// case GL_TEXTURE_2D:
+// case GL_TEXTURE_3D:
+ }
+}
+
+static void nv20Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ switch(pname)
+ {
+ case GL_FOG_MODE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_FOG_MODE, 1);
+ //OUT_RING_CACHE (params);
+ break;
+ /* TODO: unsure about the rest.*/
+ default:
+ break;
+ }
+
+}
+
+static void nv20Hint(GLcontext *ctx, GLenum target, GLenum mode)
+{
+ // TODO I need love (fog and line_smooth hints)
+}
+
+// void (*IndexMask)(GLcontext *ctx, GLuint mask);
+
+enum {
+ SPOTLIGHT_NO_UPDATE,
+ SPOTLIGHT_UPDATE_EXPONENT,
+ SPOTLIGHT_UPDATE_DIRECTION,
+ SPOTLIGHT_UPDATE_ALL
+};
+
+static void nv20Lightfv(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLint p = light - GL_LIGHT0;
+ struct gl_light *l = &ctx->Light.Light[p];
+ int spotlight_update = SPOTLIGHT_NO_UPDATE;
+
+ /* not sure where the fourth param value goes...*/
+ switch(pname)
+ {
+ case GL_AMBIENT:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_DIFFUSE:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPECULAR:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_POSITION:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPOT_DIRECTION:
+ spotlight_update = SPOTLIGHT_UPDATE_DIRECTION;
+ break;
+ case GL_SPOT_EXPONENT:
+ spotlight_update = SPOTLIGHT_UPDATE_EXPONENT;
+ break;
+ case GL_SPOT_CUTOFF:
+ spotlight_update = SPOTLIGHT_UPDATE_ALL;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_LINEAR_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ default:
+ break;
+ }
+
+ switch(spotlight_update) {
+ case SPOTLIGHT_UPDATE_DIRECTION:
+ {
+ GLfloat x,y,z;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(p), 3);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_EXPONENT:
+ {
+ GLfloat cc,lc,qc;
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 3);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_ALL:
+ {
+ GLfloat cc,lc,qc, x,y,z, c;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ c = spot_light_coef_a + 1.0;
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 7);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ OUT_RING_CACHEf(c);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/** Set the lighting model parameters */
+static void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
+
+
+static void nv20LineStipple(GLcontext *ctx, GLint factor, GLushort pattern )
+{
+/* nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LINE_STIPPLE_PATTERN, 1);
+ OUT_RING_CACHE((pattern << 16) | factor);*/
+}
+
+static void nv20LineWidth(GLcontext *ctx, GLfloat width)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LINE_WIDTH, 1);
+ OUT_RING_CACHEf(width);
+}
+
+static void nv20LogicOpcode(GLcontext *ctx, GLenum opcode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP, 1);
+ OUT_RING_CACHE(opcode);
+}
+
+static void nv20PointParameterfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ /*TODO: not sure what goes here. */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+}
+
+/** Specify the diameter of rasterized points */
+static void nv20PointSize(GLcontext *ctx, GLfloat size)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POINT_SIZE, 1);
+ OUT_RING_CACHEf(size);
+}
+
+/** Select a polygon rasterization mode */
+static void nv20PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT, 1);
+ OUT_RING_CACHE(mode);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK, 1);
+ OUT_RING_CACHE(mode);
+ }
+}
+
+/** Set the scale and units used to calculate depth values */
+void (*PolygonOffset)(GLcontext *ctx, GLfloat factor, GLfloat units);
+/** Set the polygon stippling pattern */
+void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask );
+/* Specifies the current buffer for reading */
+void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
+/** Set rasterization mode */
+void (*RenderMode)(GLcontext *ctx, GLenum mode );
+
+/** Define the scissor box */
+static void nv20Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+}
+
+/** Select flat or smooth shading */
+static void nv20ShadeModel(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SHADE_MODEL, 1);
+ OUT_RING_CACHE(mode);
+}
+
+/** OpenGL 2.0 two-sided StencilFunc */
+static void nv20StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_STENCIL_FUNC_FUNC, 3);
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ref);
+ OUT_RING_CACHE(mask);
+}
+
+/** OpenGL 2.0 two-sided StencilMask */
+static void nv20StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_STENCIL_MASK, 1);
+ OUT_RING_CACHE(mask);
+}
+
+/** OpenGL 2.0 two-sided StencilOp */
+static void nv20StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_STENCIL_OP_FAIL, 1);
+ OUT_RING_CACHE(fail);
+ OUT_RING_CACHE(zfail);
+ OUT_RING_CACHE(zpass);
+}
+
+/** Control the generation of texture coordinates */
+void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname,
+ const GLfloat *params);
+/** Set texture environment parameters */
+void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname,
+ const GLfloat *param);
+/** Set texture parameters */
+void (*TexParameter)(GLcontext *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params);
+void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat);
+
+/** Set the viewport */
+static void nv20Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ /* TODO: Where do the VIEWPORT_XFRM_* regs come in? */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 2);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+}
+
+/* Initialise any card-specific non-GL related state */
+static GLboolean nv20InitCard(nouveauContextPtr nmesa)
+{
+ return GL_TRUE;
+}
+
+/* Update buffer offset/pitch/format */
+static GLboolean nv20BindBuffers(nouveauContextPtr nmesa, int num_color,
+ nouveau_renderbuffer **color,
+ nouveau_renderbuffer *depth)
+{
+ return GL_TRUE;
+}
+
+/* Update anything that depends on the window position/size */
+static void nv20WindowMoved(nouveauContextPtr nmesa)
+{
+}
+
+void nv20InitStateFuncs(GLcontext *ctx, struct dd_function_table *func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ nmesa->hw_func.InitCard = nv20InitCard;
+ nmesa->hw_func.BindBuffers = nv20BindBuffers;
+ nmesa->hw_func.WindowMoved = nv20WindowMoved;
+
+ func->AlphaFunc = nv20AlphaFunc;
+ func->BlendColor = nv20BlendColor;
+ func->BlendEquationSeparate = nv20BlendEquationSeparate;
+ func->BlendFuncSeparate = nv20BlendFuncSeparate;
+ func->ClearColor = nv20ClearColor;
+ func->ClearDepth = nv20ClearDepth;
+ func->ClearStencil = nv20ClearStencil;
+ func->ClipPlane = nv20ClipPlane;
+ func->ColorMask = nv20ColorMask;
+ func->ColorMaterial = nv20ColorMaterial;
+ func->CullFace = nv20CullFace;
+ func->FrontFace = nv20FrontFace;
+ func->DepthFunc = nv20DepthFunc;
+ func->DepthMask = nv20DepthMask;
+ func->DepthRange = nv20DepthRange;
+ func->Enable = nv20Enable;
+ func->Fogfv = nv20Fogfv;
+ func->Hint = nv20Hint;
+ func->Lightfv = nv20Lightfv;
+/* func->LightModelfv = nv20LightModelfv; */
+ func->LineStipple = nv20LineStipple;
+ func->LineWidth = nv20LineWidth;
+ func->LogicOpcode = nv20LogicOpcode;
+ func->PointParameterfv = nv20PointParameterfv;
+ func->PointSize = nv20PointSize;
+ func->PolygonMode = nv20PolygonMode;
+#if 0
+ func->PolygonOffset = nv20PolygonOffset;
+ func->PolygonStipple = nv20PolygonStipple;
+ func->ReadBuffer = nv20ReadBuffer;
+ func->RenderMode = nv20RenderMode;
+#endif
+ func->Scissor = nv20Scissor;
+ func->ShadeModel = nv20ShadeModel;
+ func->StencilFuncSeparate = nv20StencilFuncSeparate;
+ func->StencilMaskSeparate = nv20StencilMaskSeparate;
+ func->StencilOpSeparate = nv20StencilOpSeparate;
+#if 0
+ func->TexGen = nv20TexGen;
+ func->TexParameter = nv20TexParameter;
+ func->TextureMatrix = nv20TextureMatrix;
+#endif
+ func->Viewport = nv20Viewport;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nv20_vertprog.c b/src/mesa/drivers/dri/nouveau/nv20_vertprog.c
new file mode 100644
index 00000000000..60cfcd70561
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv20_vertprog.c
@@ -0,0 +1,447 @@
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+
+#include "nouveau_shader.h"
+#include "nv20_shader.h"
+
+unsigned int NVVP_TX_VOP_COUNT = 16;
+unsigned int NVVP_TX_NVS_OP_COUNT = 16;
+struct _op_xlat NVVP_TX_VOP[32];
+struct _op_xlat NVVP_TX_SOP[32];
+
+nvsSwzComp NV20VP_TX_SWIZZLE[4] = { NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W };
+
+/*****************************************************************************
+ * Support routines
+ */
+static void
+NV20VPUploadToHW(GLcontext *ctx, nouveauShader *nvs)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ int i;
+
+ /* XXX: missing a way to say what insn we're uploading from, and possible
+ * the program start position (if NV20 has one) */
+ for (i=0; i<nvs->program_size; i+=4) {
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_INST0, 4);
+ OUT_RING(nvs->program[i + 0]);
+ OUT_RING(nvs->program[i + 1]);
+ OUT_RING(nvs->program[i + 2]);
+ OUT_RING(nvs->program[i + 3]);
+ }
+}
+
+static void
+NV20VPUpdateConst(GLcontext *ctx, nouveauShader *nvs, int id)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* Worth checking if the value *actually* changed? Mesa doesn't tell us this
+ * as far as I know..
+ */
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_ID, 1);
+ OUT_RING (id);
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_X, 4);
+ OUT_RINGf(nvs->params[id].source_val[0]);
+ OUT_RINGf(nvs->params[id].source_val[1]);
+ OUT_RINGf(nvs->params[id].source_val[2]);
+ OUT_RINGf(nvs->params[id].source_val[3]);
+}
+
+/*****************************************************************************
+ * Assembly routines
+ */
+
+/*****************************************************************************
+ * Disassembly routines
+ */
+void
+NV20VPTXSwizzle(int hwswz, nvsSwzComp *swz)
+{
+ swz[NVS_SWZ_X] = NV20VP_TX_SWIZZLE[(hwswz & 0xC0) >> 6];
+ swz[NVS_SWZ_Y] = NV20VP_TX_SWIZZLE[(hwswz & 0x30) >> 4];
+ swz[NVS_SWZ_Z] = NV20VP_TX_SWIZZLE[(hwswz & 0x0C) >> 2];
+ swz[NVS_SWZ_W] = NV20VP_TX_SWIZZLE[(hwswz & 0x03) >> 0];
+}
+
+static int
+NV20VPHasMergedInst(nvsFunc * shader)
+{
+ if (shader->GetOpcodeHW(shader, 0) != NV20_VP_INST_OPCODE_NOP &&
+ shader->GetOpcodeHW(shader, 1) != NV20_VP_INST_OPCODE_NOP)
+ printf
+ ("\n\n*****both opcode fields have values - PLEASE REPORT*****\n");
+ return 0;
+}
+
+static int
+NV20VPIsLastInst(nvsFunc * shader)
+{
+ return ((shader->inst[3] & (1 << 0)) ? 1 : 0);
+}
+
+static int
+NV20VPGetOffsetNext(nvsFunc * shader)
+{
+ return 4;
+}
+
+static struct _op_xlat *
+NV20VPGetOPTXRec(nvsFunc * shader, int merged)
+{
+ struct _op_xlat *opr;
+ int op;
+
+ if (shader->GetOpcodeSlot(shader, merged)) {
+ opr = NVVP_TX_SOP;
+ op = shader->GetOpcodeHW(shader, 1);
+ if (op >= NVVP_TX_NVS_OP_COUNT)
+ return NULL;
+ }
+ else {
+ opr = NVVP_TX_VOP;
+ op = shader->GetOpcodeHW(shader, 0);
+ if (op >= NVVP_TX_VOP_COUNT)
+ return NULL;
+ }
+
+ if (opr[op].SOP == NVS_OP_UNKNOWN)
+ return NULL;
+ return &opr[op];
+}
+
+static struct _op_xlat *
+NV20VPGetOPTXFromSOP(nvsOpcode sop, int *id)
+{
+ int i;
+
+ for (i=0;i<NVVP_TX_VOP_COUNT;i++) {
+ if (NVVP_TX_VOP[i].SOP == sop) {
+ if (id) *id = 0;
+ return &NVVP_TX_VOP[i];
+ }
+ }
+
+ for (i=0;i<NVVP_TX_NVS_OP_COUNT;i++) {
+ if (NVVP_TX_SOP[i].SOP == sop) {
+ if (id) *id = 1;
+ return &NVVP_TX_SOP[i];
+ }
+ }
+
+ return NULL;
+}
+
+static int
+NV20VPGetOpcodeSlot(nvsFunc * shader, int merged)
+{
+ if (shader->HasMergedInst(shader))
+ return merged;
+ if (shader->GetOpcodeHW(shader, 0) == NV20_VP_INST_OPCODE_NOP)
+ return 1;
+ return 0;
+}
+
+static nvsOpcode
+NV20VPGetOpcode(nvsFunc * shader, int merged)
+{
+ struct _op_xlat *opr;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr)
+ return NVS_OP_UNKNOWN;
+
+ return opr->SOP;
+}
+
+static nvsOpcode
+NV20VPGetOpcodeHW(nvsFunc * shader, int slot)
+{
+ if (slot)
+ return (shader->inst[1] & NV20_VP_INST_SCA_OPCODE_MASK)
+ >> NV20_VP_INST_SCA_OPCODE_SHIFT;
+ return (shader->inst[1] & NV20_VP_INST_VEC_OPCODE_MASK)
+ >> NV20_VP_INST_VEC_OPCODE_SHIFT;
+}
+
+static nvsRegFile
+NV20VPGetDestFile(nvsFunc * shader, int merged)
+{
+ switch (shader->GetOpcode(shader, merged)) {
+ case NVS_OP_ARL:
+ return NVS_FILE_ADDRESS;
+ default:
+ /*FIXME: This probably isn't correct.. */
+ if ((shader->inst[3] & NV20_VP_INST_DEST_WRITEMASK_MASK) == 0)
+ return NVS_FILE_TEMP;
+ return NVS_FILE_RESULT;
+ }
+}
+
+static unsigned int
+NV20VPGetDestID(nvsFunc * shader, int merged)
+{
+ int id;
+
+ switch (shader->GetDestFile(shader, merged)) {
+ case NVS_FILE_RESULT:
+ id = ((shader->inst[3] & NV20_VP_INST_DEST_MASK)
+ >> NV20_VP_INST_DEST_SHIFT);
+ switch (id) {
+ case NV20_VP_INST_DEST_POS : return NVS_FR_POSITION;
+ case NV20_VP_INST_DEST_COL0 : return NVS_FR_COL0;
+ case NV20_VP_INST_DEST_COL1 : return NVS_FR_COL1;
+ case NV20_VP_INST_DEST_TC(0): return NVS_FR_TEXCOORD0;
+ case NV20_VP_INST_DEST_TC(1): return NVS_FR_TEXCOORD1;
+ case NV20_VP_INST_DEST_TC(2): return NVS_FR_TEXCOORD2;
+ case NV20_VP_INST_DEST_TC(3): return NVS_FR_TEXCOORD3;
+ default:
+ return -1;
+ }
+ case NVS_FILE_ADDRESS:
+ return 0;
+ case NVS_FILE_TEMP:
+ id = ((shader->inst[3] & NV20_VP_INST_DEST_TEMP_ID_MASK)
+ >> NV20_VP_INST_DEST_TEMP_ID_SHIFT);
+ return id;
+ default:
+ return -1;
+ }
+}
+
+static unsigned int
+NV20VPGetDestMask(nvsFunc * shader, int merged)
+{
+ int hwmask, mask = 0;
+
+ /* Special handling for ARL - hardware only supports a
+ * 1-component address reg
+ */
+ if (shader->GetOpcode(shader, merged) == NVS_OP_ARL)
+ return SMASK_X;
+
+ if (shader->GetDestFile(shader, merged) == NVS_FILE_RESULT)
+ hwmask = (shader->inst[3] & NV20_VP_INST_DEST_WRITEMASK_MASK)
+ >> NV20_VP_INST_DEST_WRITEMASK_SHIFT;
+ else if (shader->GetOpcodeSlot(shader, merged))
+ hwmask = (shader->inst[3] & NV20_VP_INST_STEMP_WRITEMASK_MASK)
+ >> NV20_VP_INST_STEMP_WRITEMASK_SHIFT;
+ else
+ hwmask = (shader->inst[3] & NV20_VP_INST_VTEMP_WRITEMASK_MASK)
+ >> NV20_VP_INST_VTEMP_WRITEMASK_SHIFT;
+
+ if (hwmask & (1 << 3)) mask |= SMASK_X;
+ if (hwmask & (1 << 2)) mask |= SMASK_Y;
+ if (hwmask & (1 << 1)) mask |= SMASK_Z;
+ if (hwmask & (1 << 0)) mask |= SMASK_W;
+
+ return mask;
+}
+
+static unsigned int
+NV20VPGetSourceHW(nvsFunc * shader, int merged, int pos)
+{
+ struct _op_xlat *opr;
+ unsigned int src;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr)
+ return -1;
+
+ switch (opr->srcpos[pos]) {
+ case 0:
+ src = ((shader->inst[1] & NV20_VP_INST_SRC0H_MASK)
+ >> NV20_VP_INST_SRC0H_SHIFT)
+ << NV20_VP_SRC0_HIGH_SHIFT;
+ src |= ((shader->inst[2] & NV20_VP_INST_SRC0L_MASK)
+ >> NV20_VP_INST_SRC0L_SHIFT);
+ break;
+ case 1:
+ src = ((shader->inst[2] & NV20_VP_INST_SRC1_MASK)
+ >> NV20_VP_INST_SRC1_SHIFT);
+ break;
+ case 2:
+ src = ((shader->inst[2] & NV20_VP_INST_SRC2H_MASK)
+ >> NV20_VP_INST_SRC2H_SHIFT)
+ << NV20_VP_SRC2_HIGH_SHIFT;
+ src |= ((shader->inst[3] & NV20_VP_INST_SRC2L_MASK)
+ >> NV20_VP_INST_SRC2L_SHIFT);
+ break;
+ default:
+ src = -1;
+ }
+
+ return src;
+}
+
+static nvsRegFile
+NV20VPGetSourceFile(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+ struct _op_xlat *opr;
+ int file;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1)
+ return -1;
+
+ switch (opr->srcpos[pos]) {
+ case SPOS_ADDRESS:
+ return NVS_FILE_ADDRESS;
+ default:
+ src = NV20VPGetSourceHW(shader, merged, pos);
+ file = (src & NV20_VP_SRC_REG_TYPE_MASK) >> NV20_VP_SRC_REG_TYPE_SHIFT;
+
+ switch (file) {
+ case NV20_VP_SRC_REG_TYPE_TEMP : return NVS_FILE_TEMP;
+ case NV20_VP_SRC_REG_TYPE_INPUT: return NVS_FILE_ATTRIB;
+ case NV20_VP_SRC_REG_TYPE_CONST: return NVS_FILE_CONST;
+ default:
+ return NVS_FILE_UNKNOWN;
+ }
+ }
+}
+
+static int
+NV20VPGetSourceID(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_TEMP:
+ src = shader->GetSourceHW(shader, merged, pos);
+ return ((src & NV20_VP_SRC_REG_TEMP_ID_MASK) >>
+ NV20_VP_SRC_REG_TEMP_ID_SHIFT);
+ case NVS_FILE_CONST:
+ return ((shader->inst[1] & NV20_VP_INST_CONST_SRC_MASK)
+ >> NV20_VP_INST_CONST_SRC_SHIFT);
+ case NVS_FILE_ATTRIB:
+ src = ((shader->inst[1] & NV20_VP_INST_INPUT_SRC_MASK)
+ >> NV20_VP_INST_INPUT_SRC_SHIFT);
+ switch (src) {
+ case NV20_VP_INST_INPUT_SRC_POS : return NVS_FR_POSITION;
+ case NV20_VP_INST_INPUT_SRC_COL0 : return NVS_FR_COL0;
+ case NV20_VP_INST_INPUT_SRC_COL1 : return NVS_FR_COL1;
+ case NV20_VP_INST_INPUT_SRC_TC(0): return NVS_FR_TEXCOORD0;
+ case NV20_VP_INST_INPUT_SRC_TC(1): return NVS_FR_TEXCOORD1;
+ case NV20_VP_INST_INPUT_SRC_TC(2): return NVS_FR_TEXCOORD2;
+ case NV20_VP_INST_INPUT_SRC_TC(3): return NVS_FR_TEXCOORD3;
+ default:
+ return NVS_FR_UNKNOWN;
+ }
+ default:
+ return -1;
+ }
+}
+
+static int
+NV20VPGetSourceNegate(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+
+ return ((src & NV20_VP_SRC_REG_NEGATE) ? 1 : 0);
+}
+
+static int
+NV20VPGetSourceAbs(nvsFunc * shader, int merged, int pos)
+{
+ /* NV20 can't do ABS on sources? Appears to be emulated with
+ * MAX reg, reg, -reg
+ */
+ return 0;
+}
+
+static void
+NV20VPGetSourceSwizzle(nvsFunc * shader, int merged, int pos, nvsSwzComp *swz)
+{
+ unsigned int src;
+ int swzbits;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ swzbits =
+ (src & NV20_VP_SRC_REG_SWZ_ALL_MASK) >> NV20_VP_SRC_REG_SWZ_ALL_SHIFT;
+ return NV20VPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV20VPGetSourceIndexed(nvsFunc * shader, int merged, int pos)
+{
+ /* I don't think NV20 can index into attribs, at least no GL
+ * extension is exposed that will allow it.
+ */
+ if (shader->GetSourceFile(shader, merged, pos) != NVS_FILE_CONST)
+ return 0;
+ if (shader->inst[3] & NV20_VP_INST_INDEX_CONST)
+ return 1;
+ return 0;
+}
+
+static int
+NV20VPGetAddressRegID(nvsFunc * shader)
+{
+ /* Only 1 address reg */
+ return 0;
+}
+
+static nvsSwzComp
+NV20VPGetAddressRegSwizzle(nvsFunc * shader)
+{
+ /* Only A0.x available */
+ return NVS_SWZ_X;
+}
+
+void
+NV20VPInitShaderFuncs(nvsFunc * shader)
+{
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_NOP, NVS_OP_NOP, -1, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_MOV, NVS_OP_MOV, 0, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_MUL, NVS_OP_MUL, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_ADD, NVS_OP_ADD, 0, 2, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_MAD, NVS_OP_MAD, 0, 1, 2);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_DP3, NVS_OP_DP3, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_DPH, NVS_OP_DPH, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_DP4, NVS_OP_DP4, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_DST, NVS_OP_DST, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_MIN, NVS_OP_MIN, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_MAX, NVS_OP_MAX, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_SLT, NVS_OP_SLT, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_SGE, NVS_OP_SGE, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV20_VP_INST_OPCODE_ARL, NVS_OP_ARL, 0, -1, -1);
+
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_NOP, NVS_OP_NOP, -1, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_RCP, NVS_OP_RCP, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_RCC, NVS_OP_RCC, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_RSQ, NVS_OP_RSQ, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_EXP, NVS_OP_EXP, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_LOG, NVS_OP_LOG, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV20_VP_INST_OPCODE_LIT, NVS_OP_LIT, 2, -1, -1);
+
+ shader->UploadToHW = NV20VPUploadToHW;
+ shader->UpdateConst = NV20VPUpdateConst;
+
+ shader->GetOPTXRec = NV20VPGetOPTXRec;
+ shader->GetOPTXFromSOP = NV20VPGetOPTXFromSOP;
+
+ shader->HasMergedInst = NV20VPHasMergedInst;
+ shader->IsLastInst = NV20VPIsLastInst;
+ shader->GetOffsetNext = NV20VPGetOffsetNext;
+ shader->GetOpcodeSlot = NV20VPGetOpcodeSlot;
+ shader->GetOpcode = NV20VPGetOpcode;
+ shader->GetOpcodeHW = NV20VPGetOpcodeHW;
+ shader->GetDestFile = NV20VPGetDestFile;
+ shader->GetDestID = NV20VPGetDestID;
+ shader->GetDestMask = NV20VPGetDestMask;
+ shader->GetSourceHW = NV20VPGetSourceHW;
+ shader->GetSourceFile = NV20VPGetSourceFile;
+ shader->GetSourceID = NV20VPGetSourceID;
+ shader->GetSourceNegate = NV20VPGetSourceNegate;
+ shader->GetSourceAbs = NV20VPGetSourceAbs;
+ shader->GetSourceSwizzle = NV20VPGetSourceSwizzle;
+ shader->GetSourceIndexed = NV20VPGetSourceIndexed;
+ shader->GetRelAddressRegID = NV20VPGetAddressRegID;
+ shader->GetRelAddressSwizzle = NV20VPGetAddressRegSwizzle;
+}
diff --git a/src/mesa/drivers/dri/nouveau/nv30_fragprog.c b/src/mesa/drivers/dri/nouveau/nv30_fragprog.c
new file mode 100644
index 00000000000..cd7c955c9ee
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv30_fragprog.c
@@ -0,0 +1,716 @@
+#include <stdint.h>
+
+#include "glheader.h"
+#include "macros.h"
+
+#include "nouveau_context.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+#include "nouveau_drm.h"
+#include "nouveau_shader.h"
+#include "nouveau_object.h"
+#include "nouveau_msg.h"
+#include "nouveau_bufferobj.h"
+#include "nv30_shader.h"
+
+unsigned int NVFP_TX_AOP_COUNT = 64;
+struct _op_xlat NVFP_TX_AOP[64];
+
+/*******************************************************************************
+ * Support routines
+ */
+
+static void
+NV30FPUploadToHW(GLcontext *ctx, nouveauShader *nvs)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ uint32_t offset;
+
+ if (!nvs->program_buffer)
+ nvs->program_buffer = ctx->Driver.NewBufferObject(ctx, 0,
+ GL_ARRAY_BUFFER_ARB);
+
+ /* Should use STATIC_DRAW_ARB if shader doesn't use changable params */
+ ctx->Driver.BufferData(ctx, GL_ARRAY_BUFFER_ARB,
+ nvs->program_size * sizeof(uint32_t),
+ (const GLvoid *)nvs->program,
+ GL_DYNAMIC_DRAW_ARB,
+ nvs->program_buffer);
+
+ offset = nouveau_bufferobj_gpu_ref(ctx, GL_READ_ONLY_ARB,
+ nvs->program_buffer);
+
+ /* Not using state cache here, updated programs at the same address don't
+ * seem to take effect unless the ACTIVE_PROGRAM method is called again.
+ * HW caches the program somewhere?
+ */
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FP_ACTIVE_PROGRAM, 1);
+ OUT_RING (offset | 1);
+}
+
+static void
+NV30FPUpdateConst(GLcontext *ctx, nouveauShader *nvs, int id)
+{
+ uint32_t *new = nvs->params[id].source_val ?
+ (uint32_t*)nvs->params[id].source_val : (uint32_t*)nvs->params[id].val;
+ uint32_t *current;
+ int i;
+
+ for (i=0; i<nvs->params[id].hw_index_cnt; i++) {
+ current = nvs->program + nvs->params[id].hw_index[i];
+ COPY_4V(current, new);
+ }
+ nvs->on_hardware = 0;
+}
+
+/*******************************************************************************
+ * Assembly helpers
+ */
+static struct _op_xlat *
+NV30FPGetOPTXFromSOP(nvsOpcode op, int *id)
+{
+ int i;
+
+ for (i=0; i<NVFP_TX_AOP_COUNT; i++) {
+ if (NVFP_TX_AOP[i].SOP == op) {
+ if (id) *id = 0;
+ return &NVFP_TX_AOP[i];
+ }
+ }
+
+ return NULL;
+}
+
+static int
+NV30FPSupportsOpcode(nvsFunc *shader, nvsOpcode op)
+{
+ if (shader->GetOPTXFromSOP(op, NULL))
+ return 1;
+ return 0;
+}
+
+static void
+NV30FPSetOpcode(nvsFunc *shader, unsigned int opcode, int slot)
+{
+ shader->inst[0] &= ~NV30_FP_OP_OPCODE_MASK;
+ shader->inst[0] |= (opcode << NV30_FP_OP_OPCODE_SHIFT);
+}
+
+static void
+NV30FPSetCCUpdate(nvsFunc *shader)
+{
+ shader->inst[0] |= NV30_FP_OP_COND_WRITE_ENABLE;
+}
+
+static void
+NV30FPSetCondition(nvsFunc *shader, int on, nvsCond cond, int reg,
+ nvsSwzComp *swz)
+{
+ nvsSwzComp default_swz[4] = { NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W };
+ unsigned int hwcond;
+
+ /* cond masking is always enabled */
+ if (!on) {
+ cond = NVS_COND_TR;
+ reg = 0;
+ swz = default_swz;
+ }
+
+ switch (cond) {
+ case NVS_COND_TR: hwcond = NV30_FP_OP_COND_TR; break;
+ case NVS_COND_FL: hwcond = NV30_FP_OP_COND_FL; break;
+ case NVS_COND_LT: hwcond = NV30_FP_OP_COND_LT; break;
+ case NVS_COND_GT: hwcond = NV30_FP_OP_COND_GT; break;
+ case NVS_COND_LE: hwcond = NV30_FP_OP_COND_LE; break;
+ case NVS_COND_GE: hwcond = NV30_FP_OP_COND_GE; break;
+ case NVS_COND_EQ: hwcond = NV30_FP_OP_COND_EQ; break;
+ case NVS_COND_NE: hwcond = NV30_FP_OP_COND_NE; break;
+ default:
+ WARN_ONCE("unknown fp condmask=%d\n", cond);
+ hwcond = NV30_FP_OP_COND_TR;
+ break;
+ }
+
+ shader->inst[1] &= ~NV30_FP_OP_COND_MASK;
+ shader->inst[1] |= (hwcond << NV30_FP_OP_COND_SHIFT);
+
+ shader->inst[1] &= ~NV30_FP_OP_COND_SWZ_ALL_MASK;
+ shader->inst[1] |= (swz[NVS_SWZ_X] << NV30_FP_OP_COND_SWZ_X_SHIFT);
+ shader->inst[1] |= (swz[NVS_SWZ_Y] << NV30_FP_OP_COND_SWZ_Y_SHIFT);
+ shader->inst[1] |= (swz[NVS_SWZ_Z] << NV30_FP_OP_COND_SWZ_Z_SHIFT);
+ shader->inst[1] |= (swz[NVS_SWZ_W] << NV30_FP_OP_COND_SWZ_W_SHIFT);
+}
+
+static void
+NV30FPSetResult(nvsFunc *shader, nvsRegister *reg, unsigned int mask, int slot)
+{
+ unsigned int hwreg;
+
+ if (mask & SMASK_X) shader->inst[0] |= NV30_FP_OP_OUT_X;
+ if (mask & SMASK_Y) shader->inst[0] |= NV30_FP_OP_OUT_Y;
+ if (mask & SMASK_Z) shader->inst[0] |= NV30_FP_OP_OUT_Z;
+ if (mask & SMASK_W) shader->inst[0] |= NV30_FP_OP_OUT_W;
+
+ if (reg->file == NVS_FILE_RESULT) {
+ hwreg = 0; /* FIXME: this is only fragment.color */
+ /* This is *not* correct, I have no idea what it is either */
+ shader->inst[0] |= NV30_FP_OP_UNK0_7;
+ } else {
+ shader->inst[0] &= ~NV30_FP_OP_UNK0_7;
+ hwreg = reg->index;
+ }
+ shader->inst[0] &= ~NV30_FP_OP_OUT_REG_SHIFT;
+ shader->inst[0] |= (hwreg << NV30_FP_OP_OUT_REG_SHIFT);
+}
+
+static void
+NV30FPSetSource(nvsFunc *shader, nvsRegister *reg, int pos)
+{
+ unsigned int hwsrc = 0;
+
+ switch (reg->file) {
+ case NVS_FILE_TEMP:
+ hwsrc |= (NV30_FP_REG_TYPE_TEMP << NV30_FP_REG_TYPE_SHIFT);
+ hwsrc |= (reg->index << NV30_FP_REG_SRC_SHIFT);
+ break;
+ case NVS_FILE_ATTRIB:
+ {
+ unsigned int hwin;
+
+ switch (reg->index) {
+ case NVS_FR_POSITION : hwin = NV30_FP_OP_INPUT_SRC_POSITION; break;
+ case NVS_FR_COL0 : hwin = NV30_FP_OP_INPUT_SRC_COL0; break;
+ case NVS_FR_COL1 : hwin = NV30_FP_OP_INPUT_SRC_COL1; break;
+ case NVS_FR_FOGCOORD : hwin = NV30_FP_OP_INPUT_SRC_FOGC; break;
+ case NVS_FR_TEXCOORD0: hwin = NV30_FP_OP_INPUT_SRC_TC(0); break;
+ case NVS_FR_TEXCOORD1: hwin = NV30_FP_OP_INPUT_SRC_TC(1); break;
+ case NVS_FR_TEXCOORD2: hwin = NV30_FP_OP_INPUT_SRC_TC(2); break;
+ case NVS_FR_TEXCOORD3: hwin = NV30_FP_OP_INPUT_SRC_TC(3); break;
+ case NVS_FR_TEXCOORD4: hwin = NV30_FP_OP_INPUT_SRC_TC(4); break;
+ case NVS_FR_TEXCOORD5: hwin = NV30_FP_OP_INPUT_SRC_TC(5); break;
+ case NVS_FR_TEXCOORD6: hwin = NV30_FP_OP_INPUT_SRC_TC(6); break;
+ case NVS_FR_TEXCOORD7: hwin = NV30_FP_OP_INPUT_SRC_TC(7); break;
+ default:
+ WARN_ONCE("unknown fp input %d\n", reg->index);
+ hwin = NV30_FP_OP_INPUT_SRC_COL0;
+ break;
+ }
+ shader->inst[0] &= ~NV30_FP_OP_INPUT_SRC_MASK;
+ shader->inst[0] |= (hwin << NV30_FP_OP_INPUT_SRC_SHIFT);
+ hwsrc |= (hwin << NV30_FP_REG_SRC_SHIFT);
+ }
+ hwsrc |= (NV30_FP_REG_TYPE_INPUT << NV30_FP_REG_TYPE_SHIFT);
+ break;
+ case NVS_FILE_CONST:
+ /* consts are inlined after the inst */
+ hwsrc |= (NV30_FP_REG_TYPE_CONST << NV30_FP_REG_TYPE_SHIFT);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ if (reg->negate)
+ hwsrc |= NV30_FP_REG_NEGATE;
+ if (reg->abs)
+ shader->inst[1] |= (1 << (29+pos));
+ hwsrc |= (reg->swizzle[NVS_SWZ_X] << NV30_FP_REG_SWZ_X_SHIFT);
+ hwsrc |= (reg->swizzle[NVS_SWZ_Y] << NV30_FP_REG_SWZ_Y_SHIFT);
+ hwsrc |= (reg->swizzle[NVS_SWZ_Z] << NV30_FP_REG_SWZ_Z_SHIFT);
+ hwsrc |= (reg->swizzle[NVS_SWZ_W] << NV30_FP_REG_SWZ_W_SHIFT);
+
+ shader->inst[pos+1] &= ~NV30_FP_REG_ALL_MASK;
+ shader->inst[pos+1] |= hwsrc;
+}
+
+static void
+NV30FPSetTexImageUnit(nvsFunc *shader, int unit)
+{
+ shader->inst[0] &= ~NV30_FP_OP_TEX_UNIT_SHIFT;
+ shader->inst[0] |= (unit << NV30_FP_OP_TEX_UNIT_SHIFT);
+}
+
+static void
+NV30FPSetSaturate(nvsFunc *shader)
+{
+ shader->inst[0] |= NV30_FP_OP_OUT_SAT;
+}
+
+static void
+NV30FPInitInstruction(nvsFunc *shader)
+{
+ unsigned int hwsrc;
+
+ shader->inst[0] = 0;
+
+ hwsrc = (NV30_FP_REG_TYPE_INPUT << NV30_FP_REG_TYPE_SHIFT) |
+ (NVS_SWZ_X << NV30_FP_REG_SWZ_X_SHIFT) |
+ (NVS_SWZ_Y << NV30_FP_REG_SWZ_Y_SHIFT) |
+ (NVS_SWZ_Z << NV30_FP_REG_SWZ_Z_SHIFT) |
+ (NVS_SWZ_W << NV30_FP_REG_SWZ_W_SHIFT);
+ shader->inst[1] = hwsrc;
+ shader->inst[2] = hwsrc;
+ shader->inst[3] = hwsrc;
+}
+
+static void
+NV30FPSetLastInst(nvsFunc *shader)
+{
+ shader->inst[0] |= 1;
+}
+
+/*******************************************************************************
+ * Disassembly helpers
+ */
+static struct _op_xlat *
+NV30FPGetOPTXRec(nvsFunc * shader, int merged)
+{
+ int op;
+
+ op = shader->GetOpcodeHW(shader, 0);
+ if (op > NVFP_TX_AOP_COUNT)
+ return NULL;
+ if (NVFP_TX_AOP[op].SOP == NVS_OP_UNKNOWN)
+ return NULL;
+ return &NVFP_TX_AOP[op];
+}
+
+static int
+NV30FPHasMergedInst(nvsFunc * shader)
+{
+ return 0;
+}
+
+static int
+NV30FPIsLastInst(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV30_FP_OP_PROGRAM_END) ? 1 : 0);
+}
+
+static int
+NV30FPGetOffsetNext(nvsFunc * shader)
+{
+ int i;
+
+ for (i = 0; i < 3; i++)
+ if (shader->GetSourceFile(shader, 0, i) == NVS_FILE_CONST)
+ return 8;
+ return 4;
+}
+
+static nvsOpcode
+NV30FPGetOpcode(nvsFunc * shader, int merged)
+{
+ struct _op_xlat *opr;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr)
+ return NVS_OP_UNKNOWN;
+
+ return opr->SOP;
+}
+
+static unsigned int
+NV30FPGetOpcodeHW(nvsFunc * shader, int slot)
+{
+ int op;
+
+ op = (shader->inst[0] & NV30_FP_OP_OPCODE_MASK) >> NV30_FP_OP_OPCODE_SHIFT;
+
+ return op;
+}
+
+static nvsRegFile
+NV30FPGetDestFile(nvsFunc * shader, int merged)
+{
+ /* Result regs overlap temporary regs */
+ return NVS_FILE_TEMP;
+}
+
+static unsigned int
+NV30FPGetDestID(nvsFunc * shader, int merged)
+{
+ int id;
+
+ switch (shader->GetDestFile(shader, merged)) {
+ case NVS_FILE_TEMP:
+ id = ((shader->inst[0] & NV30_FP_OP_OUT_REG_MASK)
+ >> NV30_FP_OP_OUT_REG_SHIFT);
+ return id;
+ default:
+ return -1;
+ }
+}
+
+static unsigned int
+NV30FPGetDestMask(nvsFunc * shader, int merged)
+{
+ unsigned int mask = 0;
+
+ if (shader->inst[0] & NV30_FP_OP_OUT_X) mask |= SMASK_X;
+ if (shader->inst[0] & NV30_FP_OP_OUT_Y) mask |= SMASK_Y;
+ if (shader->inst[0] & NV30_FP_OP_OUT_Z) mask |= SMASK_Z;
+ if (shader->inst[0] & NV30_FP_OP_OUT_W) mask |= SMASK_W;
+
+ return mask;
+}
+
+static unsigned int
+NV30FPGetSourceHW(nvsFunc * shader, int merged, int pos)
+{
+ struct _op_xlat *opr;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1)
+ return -1;
+
+ return shader->inst[opr->srcpos[pos] + 1];
+}
+
+static nvsRegFile
+NV30FPGetSourceFile(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+ struct _op_xlat *opr;
+ int file;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1)
+ return NVS_FILE_UNKNOWN;
+
+ switch (opr->srcpos[pos]) {
+ case SPOS_ADDRESS: return NVS_FILE_ADDRESS;
+ default:
+ src = shader->GetSourceHW(shader, merged, pos);
+ file = (src & NV30_FP_REG_TYPE_MASK) >> NV30_FP_REG_TYPE_SHIFT;
+
+ switch (file) {
+ case NV30_FP_REG_TYPE_TEMP : return NVS_FILE_TEMP;
+ case NV30_FP_REG_TYPE_INPUT: return NVS_FILE_ATTRIB;
+ case NV30_FP_REG_TYPE_CONST: return NVS_FILE_CONST;
+ default:
+ return NVS_FILE_UNKNOWN;
+ }
+ }
+}
+
+static int
+NV30FPGetSourceID(nvsFunc * shader, int merged, int pos)
+{
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_ATTRIB:
+ switch ((shader->inst[0] & NV30_FP_OP_INPUT_SRC_MASK)
+ >> NV30_FP_OP_INPUT_SRC_SHIFT) {
+ case NV30_FP_OP_INPUT_SRC_POSITION: return NVS_FR_POSITION;
+ case NV30_FP_OP_INPUT_SRC_COL0 : return NVS_FR_COL0;
+ case NV30_FP_OP_INPUT_SRC_COL1 : return NVS_FR_COL1;
+ case NV30_FP_OP_INPUT_SRC_FOGC : return NVS_FR_FOGCOORD;
+ case NV30_FP_OP_INPUT_SRC_TC(0) : return NVS_FR_TEXCOORD0;
+ case NV30_FP_OP_INPUT_SRC_TC(1) : return NVS_FR_TEXCOORD1;
+ case NV30_FP_OP_INPUT_SRC_TC(2) : return NVS_FR_TEXCOORD2;
+ case NV30_FP_OP_INPUT_SRC_TC(3) : return NVS_FR_TEXCOORD3;
+ case NV30_FP_OP_INPUT_SRC_TC(4) : return NVS_FR_TEXCOORD4;
+ case NV30_FP_OP_INPUT_SRC_TC(5) : return NVS_FR_TEXCOORD5;
+ case NV30_FP_OP_INPUT_SRC_TC(6) : return NVS_FR_TEXCOORD6;
+ case NV30_FP_OP_INPUT_SRC_TC(7) : return NVS_FR_TEXCOORD7;
+ default:
+ return -1;
+ }
+ break;
+ case NVS_FILE_TEMP:
+ {
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ return ((src & NV30_FP_REG_SRC_MASK) >> NV30_FP_REG_SRC_SHIFT);
+ }
+ case NVS_FILE_CONST: /* inlined into fragprog */
+ default:
+ return -1;
+ }
+}
+
+static int
+NV30FPGetTexImageUnit(nvsFunc *shader)
+{
+ return ((shader->inst[0] & NV30_FP_OP_TEX_UNIT_MASK)
+ >> NV30_FP_OP_TEX_UNIT_SHIFT);
+}
+
+static int
+NV30FPGetSourceNegate(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+
+ if (src == -1)
+ return -1;
+ return ((src & NV30_FP_REG_NEGATE) ? 1 : 0);
+}
+
+static int
+NV30FPGetSourceAbs(nvsFunc * shader, int merged, int pos)
+{
+ struct _op_xlat *opr;
+ static unsigned int abspos[3] = {
+ NV30_FP_OP_OUT_ABS,
+ (1 << 30), /* guess */
+ (1 << 31) /* guess */
+ };
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1)
+ return -1;
+
+ return ((shader->inst[1] & abspos[opr->srcpos[pos]]) ? 1 : 0);
+}
+
+nvsSwzComp NV30FP_TX_SWIZZLE[4] = {NVS_SWZ_X, NVS_SWZ_Y, NVS_SWZ_Z, NVS_SWZ_W };
+
+static void
+NV30FPTXSwizzle(int hwswz, nvsSwzComp *swz)
+{
+ swz[NVS_SWZ_W] = NV30FP_TX_SWIZZLE[(hwswz & 0xC0) >> 6];
+ swz[NVS_SWZ_Z] = NV30FP_TX_SWIZZLE[(hwswz & 0x30) >> 4];
+ swz[NVS_SWZ_Y] = NV30FP_TX_SWIZZLE[(hwswz & 0x0C) >> 2];
+ swz[NVS_SWZ_X] = NV30FP_TX_SWIZZLE[(hwswz & 0x03) >> 0];
+}
+
+static void
+NV30FPGetSourceSwizzle(nvsFunc * shader, int merged, int pos, nvsSwzComp *swz)
+{
+ unsigned int src;
+ int swzbits;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ swzbits = (src & NV30_FP_REG_SWZ_ALL_MASK) >> NV30_FP_REG_SWZ_ALL_SHIFT;
+ NV30FPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV30FPGetSourceIndexed(nvsFunc * shader, int merged, int pos)
+{
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_ATTRIB:
+ return ((shader->inst[3] & NV30_FP_OP_INDEX_INPUT) ? 1 : 0);
+ default:
+ return 0;
+ }
+}
+
+static void
+NV30FPGetSourceConstVal(nvsFunc * shader, int merged, int pos, float *val)
+{
+ val[0] = *(float *) &(shader->inst[4]);
+ val[1] = *(float *) &(shader->inst[5]);
+ val[2] = *(float *) &(shader->inst[6]);
+ val[3] = *(float *) &(shader->inst[7]);
+}
+
+static int
+NV30FPGetSourceScale(nvsFunc * shader, int merged, int pos)
+{
+/*FIXME: is this per-source, only for a specific source, or all sources??*/
+ return (1 << ((shader->inst[2] & NV30_FP_OP_SRC_SCALE_MASK)
+ >> NV30_FP_OP_SRC_SCALE_SHIFT));
+}
+
+static int
+NV30FPGetAddressRegID(nvsFunc * shader)
+{
+ return 0;
+}
+
+static nvsSwzComp
+NV30FPGetAddressRegSwizzle(nvsFunc * shader)
+{
+ return NVS_SWZ_X;
+}
+
+static int
+NV30FPSupportsConditional(nvsFunc * shader)
+{
+ /*FIXME: Is this true of all ops? */
+ return 1;
+}
+
+static int
+NV30FPGetConditionUpdate(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV30_FP_OP_COND_WRITE_ENABLE) ? 1 : 0);
+}
+
+static int
+NV30FPGetConditionTest(nvsFunc * shader)
+{
+ /*FIXME: always? */
+ return 1;
+}
+
+static nvsCond
+NV30FPGetCondition(nvsFunc * shader)
+{
+ int cond;
+
+ cond = ((shader->inst[1] & NV30_FP_OP_COND_MASK)
+ >> NV30_FP_OP_COND_SHIFT);
+
+ switch (cond) {
+ case NV30_FP_OP_COND_FL: return NVS_COND_FL;
+ case NV30_FP_OP_COND_LT: return NVS_COND_LT;
+ case NV30_FP_OP_COND_EQ: return NVS_COND_EQ;
+ case NV30_FP_OP_COND_LE: return NVS_COND_LE;
+ case NV30_FP_OP_COND_GT: return NVS_COND_GT;
+ case NV30_FP_OP_COND_NE: return NVS_COND_NE;
+ case NV30_FP_OP_COND_GE: return NVS_COND_GE;
+ case NV30_FP_OP_COND_TR: return NVS_COND_TR;
+ default:
+ return NVS_COND_UNKNOWN;
+ }
+}
+
+static void
+NV30FPGetCondRegSwizzle(nvsFunc * shader, nvsSwzComp *swz)
+{
+ int swzbits;
+
+ swzbits = (shader->inst[1] & NV30_FP_OP_COND_SWZ_ALL_MASK)
+ >> NV30_FP_OP_COND_SWZ_ALL_SHIFT;
+ NV30FPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV30FPGetCondRegID(nvsFunc * shader)
+{
+ return 0;
+}
+
+static nvsPrecision
+NV30FPGetPrecision(nvsFunc * shader)
+{
+ int p;
+
+ p = (shader->inst[0] & NV30_FP_OP_PRECISION_MASK)
+ >> NV30_FP_OP_PRECISION_SHIFT;
+
+ switch (p) {
+ case NV30_FP_PRECISION_FP32: return NVS_PREC_FLOAT32;
+ case NV30_FP_PRECISION_FP16: return NVS_PREC_FLOAT16;
+ case NV30_FP_PRECISION_FX12: return NVS_PREC_FIXED12;
+ default:
+ return NVS_PREC_UNKNOWN;
+ }
+}
+
+static int
+NV30FPGetSaturate(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV30_FP_OP_OUT_SAT) ? 1 : 0);
+}
+
+/*******************************************************************************
+ * Init
+ */
+void
+NV30FPInitShaderFuncs(nvsFunc * shader)
+{
+ /* These are probably bogus, I made them up... */
+ shader->MaxInst = 1024;
+ shader->MaxAttrib = 16;
+ shader->MaxTemp = 32;
+ shader->MaxAddress = 1;
+ shader->MaxConst = 256;
+ shader->caps = SCAP_SRC_ABS;
+
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_MOV, NVS_OP_MOV, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_MUL, NVS_OP_MUL, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_ADD, NVS_OP_ADD, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_MAD, NVS_OP_MAD, 0, 1, 2);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_DP3, NVS_OP_DP3, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_DP4, NVS_OP_DP4, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_DST, NVS_OP_DST, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_MIN, NVS_OP_MIN, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_MAX, NVS_OP_MAX, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SLT, NVS_OP_SLT, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SGE, NVS_OP_SGE, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_FRC, NVS_OP_FRC, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_FLR, NVS_OP_FLR, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_TEX, NVS_OP_TEX, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_TXD, NVS_OP_TXD, 0, 1, 2);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_TXP, NVS_OP_TXP, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_TXB, NVS_OP_TXB, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SEQ, NVS_OP_SEQ, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SGT, NVS_OP_SGT, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SLE, NVS_OP_SLE, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SNE, NVS_OP_SNE, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_RCP, NVS_OP_RCP, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_LG2, NVS_OP_LG2, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_EX2, NVS_OP_EX2, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_COS, NVS_OP_COS, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_SIN, NVS_OP_SIN, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_NOP, NVS_OP_NOP, -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_DDX, NVS_OP_DDX, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_DDY, NVS_OP_DDY, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_KIL, NVS_OP_KIL, -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_PK4B, NVS_OP_PK4B, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_UP4B, NVS_OP_UP4B, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_PK2H, NVS_OP_PK2H, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_UP2H, NVS_OP_UP2H, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_PK4UB, NVS_OP_PK4UB, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_UP4UB, NVS_OP_UP4UB, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_PK2US, NVS_OP_PK2US, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_UP2US, NVS_OP_UP2US, 0, -1, -1);
+ /*FIXME: Haven't confirmed the source positions for the below opcodes */
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_LIT, NVS_OP_LIT, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_LRP, NVS_OP_LRP, 0, 1, 2);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_POW, NVS_OP_POW, 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_RSQ, NVS_OP_RSQ, 0, -1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV30_FP_OP_OPCODE_RFL, NVS_OP_RFL, 0, 1, -1);
+
+ shader->GetOPTXRec = NV30FPGetOPTXRec;
+ shader->GetOPTXFromSOP = NV30FPGetOPTXFromSOP;
+
+ shader->UploadToHW = NV30FPUploadToHW;
+ shader->UpdateConst = NV30FPUpdateConst;
+
+ shader->InitInstruction = NV30FPInitInstruction;
+ shader->SupportsOpcode = NV30FPSupportsOpcode;
+ shader->SetOpcode = NV30FPSetOpcode;
+ shader->SetCCUpdate = NV30FPSetCCUpdate;
+ shader->SetCondition = NV30FPSetCondition;
+ shader->SetResult = NV30FPSetResult;
+ shader->SetSource = NV30FPSetSource;
+ shader->SetTexImageUnit = NV30FPSetTexImageUnit;
+ shader->SetSaturate = NV30FPSetSaturate;
+ shader->SetLastInst = NV30FPSetLastInst;
+
+ shader->HasMergedInst = NV30FPHasMergedInst;
+ shader->IsLastInst = NV30FPIsLastInst;
+ shader->GetOffsetNext = NV30FPGetOffsetNext;
+ shader->GetOpcode = NV30FPGetOpcode;
+ shader->GetOpcodeHW = NV30FPGetOpcodeHW;
+ shader->GetDestFile = NV30FPGetDestFile;
+ shader->GetDestID = NV30FPGetDestID;
+ shader->GetDestMask = NV30FPGetDestMask;
+ shader->GetSourceHW = NV30FPGetSourceHW;
+ shader->GetSourceFile = NV30FPGetSourceFile;
+ shader->GetSourceID = NV30FPGetSourceID;
+ shader->GetTexImageUnit = NV30FPGetTexImageUnit;
+ shader->GetSourceNegate = NV30FPGetSourceNegate;
+ shader->GetSourceAbs = NV30FPGetSourceAbs;
+ shader->GetSourceSwizzle = NV30FPGetSourceSwizzle;
+ shader->GetSourceIndexed = NV30FPGetSourceIndexed;
+ shader->GetSourceConstVal = NV30FPGetSourceConstVal;
+ shader->GetSourceScale = NV30FPGetSourceScale;
+ shader->GetRelAddressRegID = NV30FPGetAddressRegID;
+ shader->GetRelAddressSwizzle = NV30FPGetAddressRegSwizzle;
+ shader->GetPrecision = NV30FPGetPrecision;
+ shader->GetSaturate = NV30FPGetSaturate;
+ shader->SupportsConditional = NV30FPSupportsConditional;
+ shader->GetConditionUpdate = NV30FPGetConditionUpdate;
+ shader->GetConditionTest = NV30FPGetConditionTest;
+ shader->GetCondition = NV30FPGetCondition;
+ shader->GetCondRegSwizzle = NV30FPGetCondRegSwizzle;
+ shader->GetCondRegID = NV30FPGetCondRegID;
+}
diff --git a/src/mesa/drivers/dri/nouveau/nv30_shader.h b/src/mesa/drivers/dri/nouveau/nv30_shader.h
new file mode 100644
index 00000000000..7a027dd4273
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv30_shader.h
@@ -0,0 +1,379 @@
+#ifndef __NV30_SHADER_H__
+#define __NV30_SHADER_H__
+
+/* Vertex programs instruction set
+ *
+ * 128bit opcodes, split into 4 32-bit ones for ease of use.
+ *
+ * Non-native instructions
+ * ABS - MOV + NV40_VP_INST0_DEST_ABS
+ * POW - EX2 + MUL + LG2
+ * SUB - ADD, second source negated
+ * SWZ - MOV
+ * XPD -
+ *
+ * Register access
+ * - Only one INPUT can be accessed per-instruction (move extras into TEMPs)
+ * - Only one CONST can be accessed per-instruction (move extras into TEMPs)
+ *
+ * Relative Addressing
+ * According to the value returned for MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB
+ * there are only two address registers available. The destination in the ARL
+ * instruction is set to TEMP <n> (The temp isn't actually written).
+ *
+ * When using vanilla ARB_v_p, the proprietary driver will squish both the available
+ * ADDRESS regs into the first hardware reg in the X and Y components.
+ *
+ * To use an address reg as an index into consts, the CONST_SRC is set to
+ * (const_base + offset) and INDEX_CONST is set.
+ *
+ * To access the second address reg use ADDR_REG_SELECT_1. A particular component
+ * of the address regs is selected with ADDR_SWZ.
+ *
+ * Only one address register can be accessed per instruction.
+ *
+ * Conditional execution (see NV_vertex_program{2,3} for details)
+ * Conditional execution of an instruction is enabled by setting COND_TEST_ENABLE, and
+ * selecting the condition which will allow the test to pass with COND_{FL,LT,...}.
+ * It is possible to swizzle the values in the condition register, which allows for
+ * testing against an individual component.
+ *
+ * Branching
+ * The BRA/CAL instructions seem to follow a slightly different opcode layout. The
+ * destination instruction ID (IADDR) overlaps a source field. Instruction ID's seem to
+ * be numbered based on the UPLOAD_FROM_ID FIFO command, and is incremented automatically
+ * on each UPLOAD_INST FIFO command.
+ *
+ * Conditional branching is achieved by using the condition tests described above.
+ * There doesn't appear to be dedicated looping instructions, but this can be done
+ * using a temp reg + conditional branching.
+ *
+ * Subroutines may be uploaded before the main program itself, but the first executed
+ * instruction is determined by the PROGRAM_START_ID FIFO command.
+ *
+ */
+
+/* DWORD 0 */
+#define NV30_VP_INST_ADDR_REG_SELECT_1 (1 << 24)
+#define NV30_VP_INST_SRC2_ABS (1 << 23) /* guess */
+#define NV30_VP_INST_SRC1_ABS (1 << 22) /* guess */
+#define NV30_VP_INST_SRC0_ABS (1 << 21) /* guess */
+#define NV30_VP_INST_OUT_RESULT (1 << 20)
+#define NV30_VP_INST_DEST_TEMP_ID_SHIFT 16
+#define NV30_VP_INST_DEST_TEMP_ID_MASK (0x0F << 16)
+#define NV30_VP_INST_COND_UPDATE_ENABLE (1<<15)
+#define NV30_VP_INST_COND_TEST_ENABLE (1<<14)
+#define NV30_VP_INST_COND_SHIFT 11
+#define NV30_VP_INST_COND_MASK (0x07 << 11)
+# define NV30_VP_INST_COND_FL 0 /* guess */
+# define NV30_VP_INST_COND_LT 1
+# define NV30_VP_INST_COND_EQ 2
+# define NV30_VP_INST_COND_LE 3
+# define NV30_VP_INST_COND_GT 4
+# define NV30_VP_INST_COND_NE 5
+# define NV30_VP_INST_COND_GE 6
+# define NV30_VP_INST_COND_TR 7 /* guess */
+#define NV30_VP_INST_COND_SWZ_X_SHIFT 9
+#define NV30_VP_INST_COND_SWZ_X_MASK (0x03 << 9)
+#define NV30_VP_INST_COND_SWZ_Y_SHIFT 7
+#define NV30_VP_INST_COND_SWZ_Y_MASK (0x03 << 7)
+#define NV30_VP_INST_COND_SWZ_Z_SHIFT 5
+#define NV30_VP_INST_COND_SWZ_Z_MASK (0x03 << 5)
+#define NV30_VP_INST_COND_SWZ_W_SHIFT 3
+#define NV30_VP_INST_COND_SWZ_W_MASK (0x03 << 3)
+#define NV30_VP_INST_COND_SWZ_ALL_SHIFT 3
+#define NV30_VP_INST_COND_SWZ_ALL_MASK (0xFF << 3)
+#define NV30_VP_INST_ADDR_SWZ_SHIFT 1
+#define NV30_VP_INST_ADDR_SWZ_MASK (0x03 << 1)
+#define NV30_VP_INST_SCA_OPCODEH_SHIFT 0
+#define NV30_VP_INST_SCA_OPCODEH_MASK (0x01 << 0)
+
+/* DWORD 1 */
+#define NV30_VP_INST_SCA_OPCODEL_SHIFT 28
+#define NV30_VP_INST_SCA_OPCODEL_MASK (0x0F << 28)
+# define NV30_VP_INST_OP_NOP 0x00
+# define NV30_VP_INST_OP_RCP 0x02
+# define NV30_VP_INST_OP_RCC 0x03
+# define NV30_VP_INST_OP_RSQ 0x04
+# define NV30_VP_INST_OP_EXP 0x05
+# define NV30_VP_INST_OP_LOG 0x06
+# define NV30_VP_INST_OP_LIT 0x07
+# define NV30_VP_INST_OP_BRA 0x09
+# define NV30_VP_INST_OP_CAL 0x0B
+# define NV30_VP_INST_OP_RET 0x0C
+# define NV30_VP_INST_OP_LG2 0x0D
+# define NV30_VP_INST_OP_EX2 0x0E
+# define NV30_VP_INST_OP_SIN 0x0F
+# define NV30_VP_INST_OP_COS 0x10
+#define NV30_VP_INST_VEC_OPCODE_SHIFT 23
+#define NV30_VP_INST_VEC_OPCODE_MASK (0x1F << 23)
+# define NV30_VP_INST_OP_NOPV 0x00
+# define NV30_VP_INST_OP_MOV 0x01
+# define NV30_VP_INST_OP_MUL 0x02
+# define NV30_VP_INST_OP_ADD 0x03
+# define NV30_VP_INST_OP_MAD 0x04
+# define NV30_VP_INST_OP_DP3 0x05
+# define NV30_VP_INST_OP_DP4 0x07
+# define NV30_VP_INST_OP_DPH 0x06
+# define NV30_VP_INST_OP_DST 0x08
+# define NV30_VP_INST_OP_MIN 0x09
+# define NV30_VP_INST_OP_MAX 0x0A
+# define NV30_VP_INST_OP_SLT 0x0B
+# define NV30_VP_INST_OP_SGE 0x0C
+# define NV30_VP_INST_OP_ARL 0x0D
+# define NV30_VP_INST_OP_FRC 0x0E
+# define NV30_VP_INST_OP_FLR 0x0F
+# define NV30_VP_INST_OP_SEQ 0x10
+# define NV30_VP_INST_OP_SFL 0x11
+# define NV30_VP_INST_OP_SGT 0x12
+# define NV30_VP_INST_OP_SLE 0x13
+# define NV30_VP_INST_OP_SNE 0x14
+# define NV30_VP_INST_OP_STR 0x15
+# define NV30_VP_INST_OP_SSG 0x16
+# define NV30_VP_INST_OP_ARR 0x17
+# define NV30_VP_INST_OP_ARA 0x18
+#define NV30_VP_INST_CONST_SRC_SHIFT 14
+#define NV30_VP_INST_CONST_SRC_MASK (0xFF << 14)
+#define NV30_VP_INST_INPUT_SRC_SHIFT 9 /*NV20*/
+#define NV30_VP_INST_INPUT_SRC_MASK (0x0F << 9) /*NV20*/
+# define NV30_VP_INST_IN_POS 0 /* These seem to match the bindings specified in */
+# define NV30_VP_INST_IN_WEIGHT 1 /* the ARB_v_p spec (2.14.3.1) */
+# define NV30_VP_INST_IN_NORMAL 2
+# define NV30_VP_INST_IN_COL0 3 /* Should probably confirm them all though */
+# define NV30_VP_INST_IN_COL1 4
+# define NV30_VP_INST_IN_FOGC 5
+# define NV30_VP_INST_IN_TC0 8
+# define NV30_VP_INST_IN_TC(n) (8+n)
+#define NV30_VP_INST_SRC0H_SHIFT 0 /*NV20*/
+#define NV30_VP_INST_SRC0H_MASK (0x1FF << 0) /*NV20*/
+
+/* DWORD 2 */
+#define NV30_VP_INST_SRC0L_SHIFT 26 /*NV20*/
+#define NV30_VP_INST_SRC0L_MASK (0x3F <<26) /*NV20*/
+#define NV30_VP_INST_SRC1_SHIFT 11 /*NV20*/
+#define NV30_VP_INST_SRC1_MASK (0x7FFF<<11) /*NV20*/
+#define NV30_VP_INST_SRC2H_SHIFT 0 /*NV20*/
+#define NV30_VP_INST_SRC2H_MASK (0x7FF << 0) /*NV20*/
+#define NV30_VP_INST_IADDR_SHIFT 2
+#define NV30_VP_INST_IADDR_MASK (0xFF << 2) /* guess */
+
+/* DWORD 3 */
+#define NV30_VP_INST_SRC2L_SHIFT 28 /*NV20*/
+#define NV30_VP_INST_SRC2L_MASK (0x0F <<28) /*NV20*/
+#define NV30_VP_INST_STEMP_WRITEMASK_SHIFT 24
+#define NV30_VP_INST_STEMP_WRITEMASK_MASK (0x0F << 24)
+#define NV30_VP_INST_VTEMP_WRITEMASK_SHIFT 20
+#define NV30_VP_INST_VTEMP_WRITEMASK_MASK (0x0F << 20)
+#define NV30_VP_INST_SDEST_WRITEMASK_SHIFT 16
+#define NV30_VP_INST_SDEST_WRITEMASK_MASK (0x0F << 16)
+#define NV30_VP_INST_VDEST_WRITEMASK_SHIFT 12 /*NV20*/
+#define NV30_VP_INST_VDEST_WRITEMASK_MASK (0x0F << 12) /*NV20*/
+#define NV30_VP_INST_DEST_ID_SHIFT 2
+#define NV30_VP_INST_DEST_ID_MASK (0x0F << 2)
+# define NV30_VP_INST_DEST_POS 0
+# define NV30_VP_INST_DEST_COL0 3
+# define NV30_VP_INST_DEST_COL1 4
+# define NV30_VP_INST_DEST_TC(n) (8+n)
+
+/* Source-register definition - matches NV20 exactly */
+#define NV30_VP_SRC_REG_NEGATE (1<<14)
+#define NV30_VP_SRC_REG_SWZ_X_SHIFT 12
+#define NV30_VP_SRC_REG_SWZ_X_MASK (0x03 <<12)
+#define NV30_VP_SRC_REG_SWZ_Y_SHIFT 10
+#define NV30_VP_SRC_REG_SWZ_Y_MASK (0x03 <<10)
+#define NV30_VP_SRC_REG_SWZ_Z_SHIFT 8
+#define NV30_VP_SRC_REG_SWZ_Z_MASK (0x03 << 8)
+#define NV30_VP_SRC_REG_SWZ_W_SHIFT 6
+#define NV30_VP_SRC_REG_SWZ_W_MASK (0x03 << 6)
+#define NV30_VP_SRC_REG_SWZ_ALL_SHIFT 6
+#define NV30_VP_SRC_REG_SWZ_ALL_MASK (0xFF << 6)
+#define NV30_VP_SRC_REG_TEMP_ID_SHIFT 2
+#define NV30_VP_SRC_REG_TEMP_ID_MASK (0x0F << 0)
+#define NV30_VP_SRC_REG_TYPE_SHIFT 0
+#define NV30_VP_SRC_REG_TYPE_MASK (0x03 << 0)
+#define NV30_VP_SRC_REG_TYPE_TEMP 1
+#define NV30_VP_SRC_REG_TYPE_INPUT 2
+#define NV30_VP_SRC_REG_TYPE_CONST 3 /* guess */
+
+/*
+ * Each fragment program opcode appears to be comprised of 4 32-bit values.
+ *
+ * 0 - Opcode, output reg/mask, ATTRIB source
+ * 1 - Source 0
+ * 2 - Source 1
+ * 3 - Source 2
+ *
+ * There appears to be no special difference between result regs and temp regs.
+ * result.color == R0.xyzw
+ * result.depth == R1.z
+ * When the fragprog contains instructions to write depth, NV30_TCL_PRIMITIVE_3D_UNK1D78=0
+ * otherwise it is set to 1.
+ *
+ * Constants are inserted directly after the instruction that uses them.
+ *
+ * It appears that it's not possible to use two input registers in one
+ * instruction as the input sourcing is done in the instruction dword
+ * and not the source selection dwords. As such instructions such as:
+ *
+ * ADD result.color, fragment.color, fragment.texcoord[0];
+ *
+ * must be split into two MOV's and then an ADD (nvidia does this) but
+ * I'm not sure why it's not just one MOV and then source the second input
+ * in the ADD instruction..
+ *
+ * Negation of the full source is done with NV30_FP_REG_NEGATE, arbitrary
+ * negation requires multiplication with a const.
+ *
+ * Arbitrary swizzling is supported with the exception of SWIZZLE_ZERO/SWIZZLE_ONE
+ * The temp/result regs appear to be initialised to (0.0, 0.0, 0.0, 0.0) as SWIZZLE_ZERO
+ * is implemented simply by not writing to the relevant components of the destination.
+ *
+ * Conditional execution
+ * TODO
+ *
+ * Non-native instructions:
+ * LIT
+ * LRP - MAD+MAD
+ * SUB - ADD, negate second source
+ * RSQ - LG2 + EX2
+ * POW - LG2 + MUL + EX2
+ * SCS - COS + SIN
+ * XPD
+ */
+
+//== Opcode / Destination selection ==
+#define NV30_FP_OP_PROGRAM_END (1 << 0)
+#define NV30_FP_OP_OUT_REG_SHIFT 1
+#define NV30_FP_OP_OUT_REG_MASK (31 << 1) /* uncertain */
+/* Needs to be set when writing outputs to get expected result.. */
+#define NV30_FP_OP_UNK0_7 (1 << 7)
+#define NV30_FP_OP_COND_WRITE_ENABLE (1 << 8)
+#define NV30_FP_OP_OUTMASK_SHIFT 9
+#define NV30_FP_OP_OUTMASK_MASK (0xF << 9)
+# define NV30_FP_OP_OUT_X (1<<9)
+# define NV30_FP_OP_OUT_Y (1<<10)
+# define NV30_FP_OP_OUT_Z (1<<11)
+# define NV30_FP_OP_OUT_W (1<<12)
+/* Uncertain about these, especially the input_src values.. it's possible that
+ * they can be dynamically changed.
+ */
+#define NV30_FP_OP_INPUT_SRC_SHIFT 13
+#define NV30_FP_OP_INPUT_SRC_MASK (15 << 13)
+# define NV30_FP_OP_INPUT_SRC_POSITION 0x0
+# define NV30_FP_OP_INPUT_SRC_COL0 0x1
+# define NV30_FP_OP_INPUT_SRC_COL1 0x2
+# define NV30_FP_OP_INPUT_SRC_FOGC 0x3
+# define NV30_FP_OP_INPUT_SRC_TC0 0x4
+# define NV30_FP_OP_INPUT_SRC_TC(n) (0x4 + n)
+#define NV30_FP_OP_TEX_UNIT_SHIFT 17
+#define NV30_FP_OP_TEX_UNIT_MASK (0xF << 17) /* guess */
+#define NV30_FP_OP_PRECISION_SHIFT 22
+#define NV30_FP_OP_PRECISION_MASK (3 << 22)
+# define NV30_FP_PRECISION_FP32 0
+# define NV30_FP_PRECISION_FP16 1
+# define NV30_FP_PRECISION_FX12 2
+#define NV30_FP_OP_OPCODE_SHIFT 24
+#define NV30_FP_OP_OPCODE_MASK (0x3F << 24)
+# define NV30_FP_OP_OPCODE_NOP 0x00
+# define NV30_FP_OP_OPCODE_MOV 0x01
+# define NV30_FP_OP_OPCODE_MUL 0x02
+# define NV30_FP_OP_OPCODE_ADD 0x03
+# define NV30_FP_OP_OPCODE_MAD 0x04
+# define NV30_FP_OP_OPCODE_DP3 0x05
+# define NV30_FP_OP_OPCODE_DP4 0x06
+# define NV30_FP_OP_OPCODE_DST 0x07
+# define NV30_FP_OP_OPCODE_MIN 0x08
+# define NV30_FP_OP_OPCODE_MAX 0x09
+# define NV30_FP_OP_OPCODE_SLT 0x0A
+# define NV30_FP_OP_OPCODE_SGE 0x0B
+# define NV30_FP_OP_OPCODE_SLE 0x0C
+# define NV30_FP_OP_OPCODE_SGT 0x0D
+# define NV30_FP_OP_OPCODE_SNE 0x0E
+# define NV30_FP_OP_OPCODE_SEQ 0x0F
+# define NV30_FP_OP_OPCODE_FRC 0x10
+# define NV30_FP_OP_OPCODE_FLR 0x11
+# define NV30_FP_OP_OPCODE_KIL 0x12
+# define NV30_FP_OP_OPCODE_PK4B 0x13
+# define NV30_FP_OP_OPCODE_UP4B 0x14
+# define NV30_FP_OP_OPCODE_DDX 0x15 /* can only write XY */
+# define NV30_FP_OP_OPCODE_DDY 0x16 /* can only write XY */
+# define NV30_FP_OP_OPCODE_TEX 0x17
+# define NV30_FP_OP_OPCODE_TXP 0x18
+# define NV30_FP_OP_OPCODE_TXD 0x19
+# define NV30_FP_OP_OPCODE_RCP 0x1A
+# define NV30_FP_OP_OPCODE_RSQ 0x1B
+# define NV30_FP_OP_OPCODE_EX2 0x1C
+# define NV30_FP_OP_OPCODE_LG2 0x1D
+# define NV30_FP_OP_OPCODE_LIT 0x1E
+# define NV30_FP_OP_OPCODE_LRP 0x1F
+# define NV30_FP_OP_OPCODE_COS 0x22
+# define NV30_FP_OP_OPCODE_SIN 0x23
+# define NV30_FP_OP_OPCODE_PK2H 0x24
+# define NV30_FP_OP_OPCODE_UP2H 0x25
+# define NV30_FP_OP_OPCODE_POW 0x26
+# define NV30_FP_OP_OPCODE_PK4UB 0x27
+# define NV30_FP_OP_OPCODE_UP4UB 0x28
+# define NV30_FP_OP_OPCODE_PK2US 0x29
+# define NV30_FP_OP_OPCODE_UP2US 0x2A
+# define NV30_FP_OP_OPCODE_DP2A 0x2E
+# define NV30_FP_OP_OPCODE_TXB 0x31
+# define NV30_FP_OP_OPCODE_RFL 0x36
+#define NV30_FP_OP_OUT_SAT (1 << 31)
+
+/* high order bits of SRC0 */
+#define NV30_FP_OP_OUT_ABS (1 << 29)
+#define NV30_FP_OP_COND_SWZ_W_SHIFT 27
+#define NV30_FP_OP_COND_SWZ_W_MASK (3 << 27)
+#define NV30_FP_OP_COND_SWZ_Z_SHIFT 25
+#define NV30_FP_OP_COND_SWZ_Z_MASK (3 << 25)
+#define NV30_FP_OP_COND_SWZ_Y_SHIFT 23
+#define NV30_FP_OP_COND_SWZ_Y_MASK (3 << 23)
+#define NV30_FP_OP_COND_SWZ_X_SHIFT 21
+#define NV30_FP_OP_COND_SWZ_X_MASK (3 << 21)
+#define NV30_FP_OP_COND_SWZ_ALL_SHIFT 21
+#define NV30_FP_OP_COND_SWZ_ALL_MASK (0xFF << 21)
+#define NV30_FP_OP_COND_SHIFT 18
+#define NV30_FP_OP_COND_MASK (0x07 << 18)
+# define NV30_FP_OP_COND_FL 0
+# define NV30_FP_OP_COND_LT 1
+# define NV30_FP_OP_COND_EQ 2
+# define NV30_FP_OP_COND_LE 3
+# define NV30_FP_OP_COND_GT 4
+# define NV30_FP_OP_COND_NE 5
+# define NV30_FP_OP_COND_GE 6
+# define NV30_FP_OP_COND_TR 7
+
+/* high order bits of SRC1 */
+#define NV30_FP_OP_SRC_SCALE_SHIFT 28
+#define NV30_FP_OP_SRC_SCALE_MASK (3 << 28)
+
+/* high order bits of SRC2 */
+#define NV30_FP_OP_INDEX_INPUT (1 << 30)
+
+//== Register selection ==
+#define NV30_FP_REG_ALL_MASK (0x1FFFF<<0)
+#define NV30_FP_REG_TYPE_SHIFT 0
+#define NV30_FP_REG_TYPE_MASK (3 << 0)
+# define NV30_FP_REG_TYPE_TEMP 0
+# define NV30_FP_REG_TYPE_INPUT 1
+# define NV30_FP_REG_TYPE_CONST 2
+#define NV30_FP_REG_SRC_SHIFT 2 /* uncertain */
+#define NV30_FP_REG_SRC_MASK (31 << 2)
+#define NV30_FP_REG_UNK_0 (1 << 8)
+#define NV30_FP_REG_SWZ_ALL_SHIFT 9
+#define NV30_FP_REG_SWZ_ALL_MASK (255 << 9)
+#define NV30_FP_REG_SWZ_X_SHIFT 9
+#define NV30_FP_REG_SWZ_X_MASK (3 << 9)
+#define NV30_FP_REG_SWZ_Y_SHIFT 11
+#define NV30_FP_REG_SWZ_Y_MASK (3 << 11)
+#define NV30_FP_REG_SWZ_Z_SHIFT 13
+#define NV30_FP_REG_SWZ_Z_MASK (3 << 13)
+#define NV30_FP_REG_SWZ_W_SHIFT 15
+#define NV30_FP_REG_SWZ_W_MASK (3 << 15)
+# define NV30_FP_SWIZZLE_X 0
+# define NV30_FP_SWIZZLE_Y 1
+# define NV30_FP_SWIZZLE_Z 2
+# define NV30_FP_SWIZZLE_W 3
+#define NV30_FP_REG_NEGATE (1 << 17)
+
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c
new file mode 100644
index 00000000000..4d79bb6127c
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv30_state.c
@@ -0,0 +1,901 @@
+/**************************************************************************
+
+Copyright 2006 Nouveau
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+#include "nouveau_state.h"
+
+#include "tnl/t_pipeline.h"
+
+#include "mtypes.h"
+#include "colormac.h"
+
+#define NOUVEAU_CARD_USING_SHADERS (nmesa->screen->card->type >= NV_40)
+
+static void nv30AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte ubRef;
+ CLAMPED_FLOAT_TO_UBYTE(ubRef, ref);
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC, 2);
+ OUT_RING_CACHE(func); /* NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC */
+ OUT_RING_CACHE(ubRef); /* NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF */
+}
+
+static void nv30BlendColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte cf[4];
+
+ CLAMPED_FLOAT_TO_UBYTE(cf[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[3], color[3]);
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_BLEND_COLOR, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(cf[3], cf[1], cf[2], cf[0]));
+}
+
+static void nv30BlendEquationSeparate(GLcontext *ctx, GLenum modeRGB, GLenum modeA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_BLEND_EQUATION, 1);
+ OUT_RING_CACHE((modeA<<16) | modeRGB);
+}
+
+
+static void nv30BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_BLEND_FUNC_SRC, 2);
+ OUT_RING_CACHE((sfactorA<<16) | sfactorRGB);
+ OUT_RING_CACHE((dfactorA<<16) | dfactorRGB);
+}
+
+static void nv30Clear(GLcontext *ctx, GLbitfield mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLuint hw_bufs = 0;
+
+ if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT))
+ hw_bufs |= 0xf0;
+ if (mask & (BUFFER_BIT_DEPTH))
+ hw_bufs |= 0x03;
+
+ if (hw_bufs) {
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLEAR_WHICH_BUFFERS, 1);
+ OUT_RING(hw_bufs);
+ }
+}
+
+static void nv30ClearColor(GLcontext *ctx, const GLfloat color[4])
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte c[4];
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c,color);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLEAR_VALUE_ARGB, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(c[3],c[0],c[1],c[2]));
+}
+
+static void nv30ClearDepth(GLcontext *ctx, GLclampd d)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0x000000FF)|(((uint32_t)(d*0xFFFFFF))<<8));
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH, 1);
+ OUT_RING_CACHE(nmesa->clear_value);
+}
+
+/* we're don't support indexed buffers
+ void (*ClearIndex)(GLcontext *ctx, GLuint index)
+ */
+
+static void nv30ClearStencil(GLcontext *ctx, GLint s)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ nmesa->clear_value=((nmesa->clear_value&0xFFFFFF00)|(s&0x000000FF));
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLEAR_VALUE_DEPTH, 1);
+ OUT_RING_CACHE(nmesa->clear_value);
+}
+
+static void nv30ClipPlane(GLcontext *ctx, GLenum plane, const GLfloat *equation)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_A(plane), 4);
+ OUT_RING_CACHEf(equation[0]);
+ OUT_RING_CACHEf(equation[1]);
+ OUT_RING_CACHEf(equation[2]);
+ OUT_RING_CACHEf(equation[3]);
+}
+
+static void nv30ColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask,
+ GLboolean bmask, GLboolean amask )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_COLOR_MASK, 1);
+ OUT_RING_CACHE(((amask && 0x01) << 24) | ((rmask && 0x01) << 16) | ((gmask && 0x01)<< 8) | ((bmask && 0x01) << 0));
+}
+
+static void nv30ColorMaterial(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ // TODO I need love
+}
+
+static void nv30CullFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CULL_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv30FrontFace(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FRONT_FACE, 1);
+ OUT_RING_CACHE(mode);
+}
+
+static void nv30DepthFunc(GLcontext *ctx, GLenum func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DEPTH_FUNC, 1);
+ OUT_RING_CACHE(func);
+}
+
+static void nv30DepthMask(GLcontext *ctx, GLboolean flag)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DEPTH_WRITE_ENABLE, 1);
+ OUT_RING_CACHE(flag);
+}
+
+static void nv30DepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR, 2);
+ OUT_RING_CACHEf(nearval);
+ OUT_RING_CACHEf(farval);
+}
+
+/** Specify the current buffer for writing */
+//void (*DrawBuffer)( GLcontext *ctx, GLenum buffer );
+/** Specify the buffers for writing for fragment programs*/
+//void (*DrawBuffers)( GLcontext *ctx, GLsizei n, const GLenum *buffers );
+
+static void nv30Enable(GLcontext *ctx, GLenum cap, GLboolean state)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ switch(cap)
+ {
+ case GL_ALPHA_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ALPHA_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_AUTO_NORMAL:
+ case GL_BLEND:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_BLEND_FUNC_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE(cap-GL_CLIP_PLANE0), 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_COLOR_LOGIC_OP:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_COLOR_MATERIAL:
+// case GL_COLOR_SUM_EXT:
+// case GL_COLOR_TABLE:
+// case GL_CONVOLUTION_1D:
+// case GL_CONVOLUTION_2D:
+ case GL_CULL_FACE:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_CULL_FACE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DEPTH_TEST:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DEPTH_TEST_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_DITHER:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DITHER_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_FOG:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_HISTOGRAM:
+// case GL_INDEX_LOGIC_OP:
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ {
+ uint32_t mask=0x11<<(2*(cap-GL_LIGHT0));
+
+ if (NOUVEAU_CARD_USING_SHADERS)
+ break;
+
+ nmesa->enabled_lights=((nmesa->enabled_lights&mask)|(mask*state));
+ if (nmesa->lighting_enabled)
+ {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ }
+ break;
+ }
+ case GL_LIGHTING:
+ if (NOUVEAU_CARD_USING_SHADERS)
+ break;
+
+ nmesa->lighting_enabled=state;
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+ if (nmesa->lighting_enabled)
+ OUT_RING_CACHE(nmesa->enabled_lights);
+ else
+ OUT_RING_CACHE(0x0);
+ break;
+// case GL_LINE_SMOOTH:
+// case GL_LINE_STIPPLE:
+// case GL_MAP1_COLOR_4:
+// case GL_MAP1_INDEX:
+// case GL_MAP1_NORMAL:
+// case GL_MAP1_TEXTURE_COORD_1:
+// case GL_MAP1_TEXTURE_COORD_2:
+// case GL_MAP1_TEXTURE_COORD_3:
+// case GL_MAP1_TEXTURE_COORD_4:
+// case GL_MAP1_VERTEX_3:
+// case GL_MAP1_VERTEX_4:
+// case GL_MAP2_COLOR_4:
+// case GL_MAP2_INDEX:
+// case GL_MAP2_NORMAL:
+// case GL_MAP2_TEXTURE_COORD_1:
+// case GL_MAP2_TEXTURE_COORD_2:
+// case GL_MAP2_TEXTURE_COORD_3:
+// case GL_MAP2_TEXTURE_COORD_4:
+// case GL_MAP2_VERTEX_3:
+// case GL_MAP2_VERTEX_4:
+// case GL_MINMAX:
+ case GL_NORMALIZE:
+ if (nmesa->screen->card->type != NV_44) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_NORMALIZE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ }
+ break;
+// case GL_POINT_SMOOTH:
+ case GL_POLYGON_OFFSET_POINT:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_POINT_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_LINE:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_LINE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_OFFSET_FILL:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FILL_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_SMOOTH:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_SMOOTH_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+ case GL_POLYGON_STIPPLE:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_POST_COLOR_MATRIX_COLOR_TABLE:
+// case GL_POST_CONVOLUTION_COLOR_TABLE:
+// case GL_RESCALE_NORMAL:
+ case GL_SCISSOR_TEST:
+ /* No enable bit, nv30Scissor will adjust to max range */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+ break;
+// case GL_SEPARABLE_2D:
+ case GL_STENCIL_TEST:
+ // TODO BACK and FRONT ?
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_ENABLE, 1);
+ OUT_RING_CACHE(state);
+ break;
+// case GL_TEXTURE_GEN_Q:
+// case GL_TEXTURE_GEN_R:
+// case GL_TEXTURE_GEN_S:
+// case GL_TEXTURE_GEN_T:
+// case GL_TEXTURE_1D:
+// case GL_TEXTURE_2D:
+// case GL_TEXTURE_3D:
+ }
+}
+
+static void nv30Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (NOUVEAU_CARD_USING_SHADERS)
+ return;
+
+ switch(pname)
+ {
+ case GL_FOG_MODE:
+ {
+ int mode = 0;
+ /* The modes are different in GL and the card. */
+ switch(ctx->Fog.Mode)
+ {
+ case GL_LINEAR:
+ mode = 0x804;
+ break;
+ case GL_EXP:
+ mode = 0x802;
+ break;
+ case GL_EXP2:
+ mode = 0x803;
+ break;
+ }
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_MODE, 1);
+ OUT_RING_CACHE (mode);
+ break;
+ }
+ case GL_FOG_COLOR:
+ {
+ GLubyte c[4];
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c,params);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_COLOR, 1);
+ /* nvidia ignores the alpha channel */
+ OUT_RING_CACHE(PACK_COLOR_8888_REV(c[0],c[1],c[2],c[3]));
+ break;
+ }
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ {
+ GLfloat f=0., c=0.;
+ switch(ctx->Fog.Mode)
+ {
+ case GL_LINEAR:
+ f = -1.0/(ctx->Fog.End - ctx->Fog.Start);
+ c = ctx->Fog.Start/(ctx->Fog.End - ctx->Fog.Start) + 2.001953;
+ break;
+ case GL_EXP:
+ f = -0.090168*ctx->Fog.Density;
+ c = 1.5;
+ case GL_EXP2:
+ f = -0.212330*ctx->Fog.Density;
+ c = 1.5;
+ }
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_LINEAR, 1);
+ OUT_RING_CACHE(f);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_CONSTANT, 1);
+ OUT_RING_CACHE(c);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_FOG_EQUATION_QUADRATIC, 1);
+ OUT_RING_CACHE(0); /* Is this always the same? */
+ break;
+ }
+// case GL_FOG_COORD_SRC:
+ default:
+ break;
+ }
+}
+
+static void nv30Hint(GLcontext *ctx, GLenum target, GLenum mode)
+{
+ // TODO I need love (fog and line_smooth hints)
+}
+
+// void (*IndexMask)(GLcontext *ctx, GLuint mask);
+
+enum {
+ SPOTLIGHT_NO_UPDATE,
+ SPOTLIGHT_UPDATE_EXPONENT,
+ SPOTLIGHT_UPDATE_DIRECTION,
+ SPOTLIGHT_UPDATE_ALL
+};
+
+static void nv30Lightfv(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLint p = light - GL_LIGHT0;
+ struct gl_light *l = &ctx->Light.Light[p];
+ int spotlight_update = SPOTLIGHT_NO_UPDATE;
+
+ if (NOUVEAU_CARD_USING_SHADERS)
+ return;
+
+ /* not sure where the fourth param value goes...*/
+ switch(pname)
+ {
+ case GL_AMBIENT:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_AMBIENT_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_DIFFUSE:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_DIFFUSE_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPECULAR:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_FRONT_SIDE_PRODUCT_SPECULAR_R(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_POSITION:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_POSITION_X(p), 3);
+ OUT_RING_CACHEf(params[0]);
+ OUT_RING_CACHEf(params[1]);
+ OUT_RING_CACHEf(params[2]);
+ break;
+ case GL_SPOT_DIRECTION:
+ spotlight_update = SPOTLIGHT_UPDATE_DIRECTION;
+ break;
+ case GL_SPOT_EXPONENT:
+ spotlight_update = SPOTLIGHT_UPDATE_EXPONENT;
+ break;
+ case GL_SPOT_CUTOFF:
+ spotlight_update = SPOTLIGHT_UPDATE_ALL;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_CONSTANT_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_LINEAR_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_LINEAR_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_QUADRATIC_ATTENUATION(p), 1);
+ OUT_RING_CACHEf(*params);
+ break;
+ default:
+ break;
+ }
+
+ switch(spotlight_update) {
+ case SPOTLIGHT_UPDATE_DIRECTION:
+ {
+ GLfloat x,y,z;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_DIR_X(p), 3);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_EXPONENT:
+ {
+ GLfloat cc,lc,qc;
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 3);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ }
+ break;
+ case SPOTLIGHT_UPDATE_ALL:
+ {
+ GLfloat cc,lc,qc, x,y,z, c;
+ GLfloat spot_light_coef_a = 1.0 / (l->_CosCutoff - 1.0);
+ cc = 1.0; /* FIXME: These need to be correctly computed */
+ lc = 0.0;
+ qc = 2.0;
+ x = spot_light_coef_a * l->_NormDirection[0];
+ y = spot_light_coef_a * l->_NormDirection[1];
+ z = spot_light_coef_a * l->_NormDirection[2];
+ c = spot_light_coef_a + 1.0;
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LIGHT_SPOT_CUTOFF_A(p), 7);
+ OUT_RING_CACHEf(cc);
+ OUT_RING_CACHEf(lc);
+ OUT_RING_CACHEf(qc);
+ OUT_RING_CACHEf(x);
+ OUT_RING_CACHEf(y);
+ OUT_RING_CACHEf(z);
+ OUT_RING_CACHEf(c);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/** Set the lighting model parameters */
+void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
+
+
+static void nv30LineStipple(GLcontext *ctx, GLint factor, GLushort pattern )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LINE_STIPPLE_PATTERN, 1);
+ OUT_RING_CACHE((pattern << 16) | factor);
+}
+
+static void nv30LineWidth(GLcontext *ctx, GLfloat width)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte ubWidth;
+
+ CLAMPED_FLOAT_TO_UBYTE(ubWidth, width);
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LINE_WIDTH_SMOOTH, 1);
+ OUT_RING_CACHE(ubWidth);
+}
+
+static void nv30LogicOpcode(GLcontext *ctx, GLenum opcode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP, 1);
+ OUT_RING_CACHE(opcode);
+}
+
+static void nv30PointParameterfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
+{
+ /*TODO: not sure what goes here. */
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+}
+
+/** Specify the diameter of rasterized points */
+static void nv30PointSize(GLcontext *ctx, GLfloat size)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POINT_SIZE, 1);
+ OUT_RING_CACHEf(size);
+}
+
+/** Select a polygon rasterization mode */
+static void nv30PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_MODE_FRONT, 1);
+ OUT_RING_CACHE(mode);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_MODE_BACK, 1);
+ OUT_RING_CACHE(mode);
+ }
+}
+
+/** Set the scale and units used to calculate depth values */
+static void nv30PolygonOffset(GLcontext *ctx, GLfloat factor, GLfloat units)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR, 2);
+ OUT_RING_CACHEf(factor);
+
+ /* Looks like we always multiply units by 2.0... according to the dumps.*/
+ OUT_RING_CACHEf(units * 2.0);
+}
+
+/** Set the polygon stippling pattern */
+static void nv30PolygonStipple(GLcontext *ctx, const GLubyte *mask )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN(0), 32);
+ OUT_RING_CACHEp(mask, 32);
+}
+
+/* Specifies the current buffer for reading */
+void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
+/** Set rasterization mode */
+void (*RenderMode)(GLcontext *ctx, GLenum mode );
+
+/** Define the scissor box */
+static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* There's no scissor enable bit, so adjust the scissor to cover the
+ * maximum draw buffer bounds
+ */
+ if (!ctx->Scissor.Enabled) {
+ x = y = 0;
+ w = h = 4095;
+ } else {
+ x += nmesa->drawX;
+ y += nmesa->drawY;
+ }
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2);
+ OUT_RING_CACHE(((w) << 16) | x);
+ OUT_RING_CACHE(((h) << 16) | y);
+}
+
+/** Select flat or smooth shading */
+static void nv30ShadeModel(GLcontext *ctx, GLenum mode)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SHADE_MODEL, 1);
+ OUT_RING_CACHE(mode);
+}
+
+/** OpenGL 2.0 two-sided StencilFunc */
+static void nv30StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_FUNC_FUNC, 3);
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ref);
+ OUT_RING_CACHE(mask);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_FUNC_FUNC, 3);
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ref);
+ OUT_RING_CACHE(mask);
+ }
+}
+
+/** OpenGL 2.0 two-sided StencilMask */
+static void nv30StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_MASK, 1);
+ OUT_RING_CACHE(mask);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_MASK, 1);
+ OUT_RING_CACHE(mask);
+ }
+}
+
+/** OpenGL 2.0 two-sided StencilOp */
+static void nv30StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_FRONT_OP_FAIL, 3);
+ OUT_RING_CACHE(fail);
+ OUT_RING_CACHE(zfail);
+ OUT_RING_CACHE(zpass);
+ }
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_STENCIL_BACK_OP_FAIL, 3);
+ OUT_RING_CACHE(fail);
+ OUT_RING_CACHE(zfail);
+ OUT_RING_CACHE(zpass);
+ }
+}
+
+/** Control the generation of texture coordinates */
+void (*TexGen)(GLcontext *ctx, GLenum coord, GLenum pname,
+ const GLfloat *params);
+/** Set texture environment parameters */
+void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname,
+ const GLfloat *param);
+/** Set texture parameters */
+void (*TexParameter)(GLcontext *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params);
+
+static void nv30TextureMatrix(GLcontext *ctx, GLuint unit, const GLmatrix *mat)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_TX_MATRIX(unit, 0), 16);
+ /*XXX: This SHOULD work.*/
+ OUT_RING_CACHEp(mat->m, 16);
+}
+
+static void nv30WindowMoved(nouveauContextPtr nmesa)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ GLfloat *v = nmesa->viewport.m;
+ GLuint w = ctx->Viewport.Width;
+ GLuint h = ctx->Viewport.Height;
+ GLuint x = ctx->Viewport.X + nmesa->drawX;
+ GLuint y = ctx->Viewport.Y + nmesa->drawY;
+
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0, 2);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+ /* something to do with clears, possibly doesn't belong here */
+ BEGIN_RING_CACHE(NvSub3D,
+ NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS0, 2);
+ OUT_RING_CACHE(((w+x) << 16) | x);
+ OUT_RING_CACHE(((h+y) << 16) | y);
+ /* viewport transform */
+ BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OX, 8);
+ OUT_RING_CACHEf (v[MAT_TX]);
+ OUT_RING_CACHEf (v[MAT_TY]);
+ OUT_RING_CACHEf (v[MAT_TZ]);
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf (v[MAT_SX]);
+ OUT_RING_CACHEf (v[MAT_SY]);
+ OUT_RING_CACHEf (v[MAT_SZ]);
+ OUT_RING_CACHEf (0.0);
+
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+}
+
+static GLboolean nv30InitCard(nouveauContextPtr nmesa)
+{
+ /* Need some love.. */
+ return GL_FALSE;
+}
+
+static GLboolean nv40InitCard(nouveauContextPtr nmesa)
+{
+ nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
+
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT1, 2);
+ OUT_RING(NvDmaFB);
+ OUT_RING(NvDmaFB);
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT8, 1);
+ OUT_RING(NvDmaFB);
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT4, 2);
+ OUT_RING(NvDmaFB);
+ OUT_RING(NvDmaFB);
+ BEGIN_RING_SIZE(NvSub3D, 0x0220, 1);
+ OUT_RING(1);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1ea4, 3);
+ OUT_RING(0x00000010);
+ OUT_RING(0x01000100);
+ OUT_RING(0xff800006);
+ BEGIN_RING_SIZE(NvSub3D, 0x1fc4, 1);
+ OUT_RING(0x06144321);
+ BEGIN_RING_SIZE(NvSub3D, 0x1fc8, 2);
+ OUT_RING(0xedcba987);
+ OUT_RING(0x00000021);
+ BEGIN_RING_SIZE(NvSub3D, 0x1fd0, 1);
+ OUT_RING(0x00171615);
+ BEGIN_RING_SIZE(NvSub3D, 0x1fd4, 1);
+ OUT_RING(0x001b1a19);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1ef8, 1);
+ OUT_RING(0x0020ffff);
+ BEGIN_RING_SIZE(NvSub3D, 0x1d64, 1);
+ OUT_RING(0x00d30000);
+ BEGIN_RING_SIZE(NvSub3D, 0x1e94, 1);
+ OUT_RING(0x00000001);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1d60, 1);
+ OUT_RING(0x03008000);
+
+ return GL_TRUE;
+}
+
+static GLboolean nv30BindBuffers(nouveauContextPtr nmesa, int num_color,
+ nouveau_renderbuffer **color,
+ nouveau_renderbuffer *depth)
+{
+ GLuint x, y, w, h;
+
+ w = color[0]->mesa.Width;
+ h = color[0]->mesa.Height;
+ x = nmesa->drawX;
+ y = nmesa->drawY;
+
+ if (num_color != 1)
+ return GL_FALSE;
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_DIM0, 5);
+ OUT_RING (((w+x)<<16)|x);
+ OUT_RING (((h+y)<<16)|y);
+ if (color[0]->mesa._ActualFormat == GL_RGBA8)
+ OUT_RING (0x148);
+ else
+ OUT_RING (0x143);
+ OUT_RING (color[0]->pitch);
+ OUT_RING (color[0]->offset);
+
+ if (depth) {
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_DEPTH_OFFSET, 1);
+ OUT_RING (depth->offset);
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_PITCH, 1);
+ OUT_RING (depth->pitch);
+ }
+
+ return GL_TRUE;
+}
+
+void nv30InitStateFuncs(GLcontext *ctx, struct dd_function_table *func)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ func->AlphaFunc = nv30AlphaFunc;
+ func->BlendColor = nv30BlendColor;
+ func->BlendEquationSeparate = nv30BlendEquationSeparate;
+ func->BlendFuncSeparate = nv30BlendFuncSeparate;
+ func->Clear = nv30Clear;
+ func->ClearColor = nv30ClearColor;
+ func->ClearDepth = nv30ClearDepth;
+ func->ClearStencil = nv30ClearStencil;
+ func->ClipPlane = nv30ClipPlane;
+ func->ColorMask = nv30ColorMask;
+ func->ColorMaterial = nv30ColorMaterial;
+ func->CullFace = nv30CullFace;
+ func->FrontFace = nv30FrontFace;
+ func->DepthFunc = nv30DepthFunc;
+ func->DepthMask = nv30DepthMask;
+ func->Enable = nv30Enable;
+ func->Fogfv = nv30Fogfv;
+ func->Hint = nv30Hint;
+ func->Lightfv = nv30Lightfv;
+/* func->LightModelfv = nv30LightModelfv; */
+ func->LineStipple = nv30LineStipple;
+ func->LineWidth = nv30LineWidth;
+ func->LogicOpcode = nv30LogicOpcode;
+ func->PointParameterfv = nv30PointParameterfv;
+ func->PointSize = nv30PointSize;
+ func->PolygonMode = nv30PolygonMode;
+ func->PolygonOffset = nv30PolygonOffset;
+ func->PolygonStipple = nv30PolygonStipple;
+#if 0
+ func->ReadBuffer = nv30ReadBuffer;
+ func->RenderMode = nv30RenderMode;
+#endif
+ func->Scissor = nv30Scissor;
+ func->ShadeModel = nv30ShadeModel;
+ func->StencilFuncSeparate = nv30StencilFuncSeparate;
+ func->StencilMaskSeparate = nv30StencilMaskSeparate;
+ func->StencilOpSeparate = nv30StencilOpSeparate;
+#if 0
+ func->TexGen = nv30TexGen;
+ func->TexParameter = nv30TexParameter;
+#endif
+ func->TextureMatrix = nv30TextureMatrix;
+
+
+ if (nmesa->screen->card->type >= NV_40)
+ nmesa->hw_func.InitCard = nv40InitCard;
+ else
+ nmesa->hw_func.InitCard = nv30InitCard;
+ nmesa->hw_func.BindBuffers = nv30BindBuffers;
+ nmesa->hw_func.WindowMoved = nv30WindowMoved;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nv30_vertprog.c b/src/mesa/drivers/dri/nouveau/nv30_vertprog.c
new file mode 100644
index 00000000000..6ba8e35d55f
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv30_vertprog.c
@@ -0,0 +1,353 @@
+#include "nouveau_context.h"
+#include "nouveau_object.h"
+#include "nouveau_fifo.h"
+#include "nouveau_reg.h"
+
+#include "nouveau_shader.h"
+#include "nv30_shader.h"
+
+/*****************************************************************************
+ * Support routines
+ */
+static void
+NV30VPUploadToHW(GLcontext *ctx, nouveauShader *nvs)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ int i;
+
+ /* We can do better here and keep more than one VP on the hardware, and
+ * switch between them with PROGRAM_START_ID..
+ */
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_FROM_ID, 1);
+ OUT_RING(0);
+ for (i=0; i<nvs->program_size; i+=4) {
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_INST0, 4);
+ OUT_RING(nvs->program[i + 0]);
+ OUT_RING(nvs->program[i + 1]);
+ OUT_RING(nvs->program[i + 2]);
+ OUT_RING(nvs->program[i + 3]);
+ }
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_PROGRAM_START_ID, 1);
+ OUT_RING(0);
+}
+
+static void
+NV30VPUpdateConst(GLcontext *ctx, nouveauShader *nvs, int id)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLfloat *val;
+
+ val = nvs->params[id].source_val ?
+ nvs->params[id].source_val : nvs->params[id].val;
+
+ BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VP_UPLOAD_CONST_ID, 5);
+ OUT_RING (id);
+ OUT_RINGp(val, 4);
+}
+
+/*****************************************************************************
+ * Assembly routines
+ */
+
+/*****************************************************************************
+ * Disassembly routines
+ */
+static unsigned int
+NV30VPGetOpcodeHW(nvsFunc * shader, int slot)
+{
+ int op;
+
+ if (slot) {
+ op = (shader->inst[1] & NV30_VP_INST_SCA_OPCODEL_MASK)
+ >> NV30_VP_INST_SCA_OPCODEL_SHIFT;
+ op |= ((shader->inst[0] & NV30_VP_INST_SCA_OPCODEH_MASK)
+ >> NV30_VP_INST_SCA_OPCODEH_SHIFT) << 4;
+ }
+ else {
+ op = (shader->inst[1] & NV30_VP_INST_VEC_OPCODE_MASK)
+ >> NV30_VP_INST_VEC_OPCODE_SHIFT;
+ }
+
+ return op;
+}
+
+static nvsRegFile
+NV30VPGetDestFile(nvsFunc * shader, int merged)
+{
+ switch (shader->GetOpcode(shader, merged)) {
+ case NVS_OP_ARL:
+ case NVS_OP_ARR:
+ case NVS_OP_ARA:
+ return NVS_FILE_ADDRESS;
+ default:
+ /*FIXME: This probably isn't correct.. */
+ if ((shader->inst[3] & NV30_VP_INST_VDEST_WRITEMASK_MASK) != 0)
+ return NVS_FILE_RESULT;
+ if ((shader->inst[3] & NV30_VP_INST_SDEST_WRITEMASK_MASK) != 0)
+ return NVS_FILE_RESULT;
+ return NVS_FILE_TEMP;
+ }
+}
+
+static unsigned int
+NV30VPGetDestID(nvsFunc * shader, int merged)
+{
+ int id;
+
+ switch (shader->GetDestFile(shader, merged)) {
+ case NVS_FILE_RESULT:
+ id = ((shader->inst[3] & NV30_VP_INST_DEST_ID_MASK)
+ >> NV30_VP_INST_DEST_ID_SHIFT);
+ switch (id) {
+ case NV30_VP_INST_DEST_POS : return NVS_FR_POSITION;
+ case NV30_VP_INST_DEST_COL0 : return NVS_FR_COL0;
+ case NV30_VP_INST_DEST_COL1 : return NVS_FR_COL1;
+ case NV30_VP_INST_DEST_TC(0): return NVS_FR_TEXCOORD0;
+ case NV30_VP_INST_DEST_TC(1): return NVS_FR_TEXCOORD1;
+ case NV30_VP_INST_DEST_TC(2): return NVS_FR_TEXCOORD2;
+ case NV30_VP_INST_DEST_TC(3): return NVS_FR_TEXCOORD3;
+ case NV30_VP_INST_DEST_TC(4): return NVS_FR_TEXCOORD4;
+ case NV30_VP_INST_DEST_TC(5): return NVS_FR_TEXCOORD5;
+ case NV30_VP_INST_DEST_TC(6): return NVS_FR_TEXCOORD6;
+ case NV30_VP_INST_DEST_TC(7): return NVS_FR_TEXCOORD7;
+ default:
+ return -1;
+ }
+ case NVS_FILE_ADDRESS:
+ case NVS_FILE_TEMP:
+ return (shader->inst[0] & NV30_VP_INST_DEST_TEMP_ID_MASK)
+ >> NV30_VP_INST_DEST_TEMP_ID_SHIFT;
+ default:
+ return -1;
+ }
+}
+
+static unsigned int
+NV30VPGetDestMask(nvsFunc * shader, int merged)
+{
+ int hwmask, mask = 0;
+
+ if (shader->GetDestFile(shader, merged) == NVS_FILE_RESULT)
+ if (shader->GetOpcodeSlot(shader, merged))
+ hwmask = (shader->inst[3] & NV30_VP_INST_SDEST_WRITEMASK_MASK)
+ >> NV30_VP_INST_SDEST_WRITEMASK_SHIFT;
+ else
+ hwmask = (shader->inst[3] & NV30_VP_INST_VDEST_WRITEMASK_MASK)
+ >> NV30_VP_INST_VDEST_WRITEMASK_SHIFT;
+ else if (shader->GetOpcodeSlot(shader, merged))
+ hwmask = (shader->inst[3] & NV30_VP_INST_STEMP_WRITEMASK_MASK)
+ >> NV30_VP_INST_STEMP_WRITEMASK_SHIFT;
+ else
+ hwmask = (shader->inst[3] & NV30_VP_INST_VTEMP_WRITEMASK_MASK)
+ >> NV30_VP_INST_VTEMP_WRITEMASK_SHIFT;
+
+ if (hwmask & (1 << 3)) mask |= SMASK_X;
+ if (hwmask & (1 << 2)) mask |= SMASK_Y;
+ if (hwmask & (1 << 1)) mask |= SMASK_Z;
+ if (hwmask & (1 << 0)) mask |= SMASK_W;
+
+ return mask;
+}
+
+static int
+NV30VPGetSourceID(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_TEMP:
+ src = shader->GetSourceHW(shader, merged, pos);
+ return ((src & NV30_VP_SRC_REG_TEMP_ID_MASK) >>
+ NV30_VP_SRC_REG_TEMP_ID_SHIFT);
+ case NVS_FILE_CONST:
+ return ((shader->inst[1] & NV30_VP_INST_CONST_SRC_MASK)
+ >> NV30_VP_INST_CONST_SRC_SHIFT);
+ case NVS_FILE_ATTRIB:
+ src = ((shader->inst[1] & NV30_VP_INST_INPUT_SRC_MASK)
+ >> NV30_VP_INST_INPUT_SRC_SHIFT);
+ switch (src) {
+ case NV30_VP_INST_IN_POS : return NVS_FR_POSITION;
+ case NV30_VP_INST_IN_COL0 : return NVS_FR_COL0;
+ case NV30_VP_INST_IN_COL1 : return NVS_FR_COL1;
+ case NV30_VP_INST_IN_TC(0): return NVS_FR_TEXCOORD0;
+ case NV30_VP_INST_IN_TC(1): return NVS_FR_TEXCOORD1;
+ case NV30_VP_INST_IN_TC(2): return NVS_FR_TEXCOORD2;
+ case NV30_VP_INST_IN_TC(3): return NVS_FR_TEXCOORD3;
+ case NV30_VP_INST_IN_TC(4): return NVS_FR_TEXCOORD4;
+ case NV30_VP_INST_IN_TC(5): return NVS_FR_TEXCOORD5;
+ case NV30_VP_INST_IN_TC(6): return NVS_FR_TEXCOORD6;
+ case NV30_VP_INST_IN_TC(7): return NVS_FR_TEXCOORD7;
+ default:
+ return NVS_FR_UNKNOWN;
+ }
+ default:
+ return -1;
+ }
+}
+
+static int
+NV30VPGetSourceAbs(nvsFunc * shader, int merged, int pos)
+{
+ struct _op_xlat *opr;
+ static unsigned int abspos[3] = {
+ NV30_VP_INST_SRC0_ABS,
+ NV30_VP_INST_SRC1_ABS,
+ NV30_VP_INST_SRC2_ABS,
+ };
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1 || opr->srcpos[pos] > 2)
+ return 0;
+
+ return ((shader->inst[0] & abspos[opr->srcpos[pos]]) ? 1 : 0);
+}
+
+static int
+NV30VPGetRelAddressRegID(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV30_VP_INST_ADDR_REG_SELECT_1) ? 1 : 0);
+}
+
+static nvsSwzComp
+NV30VPGetRelAddressSwizzle(nvsFunc * shader)
+{
+ nvsSwzComp swz;
+
+ swz = NV20VP_TX_SWIZZLE[(shader->inst[0] & NV30_VP_INST_ADDR_SWZ_MASK)
+ >> NV30_VP_INST_ADDR_SWZ_SHIFT];
+ return swz;
+}
+
+static int
+NV30VPSupportsConditional(nvsFunc * shader)
+{
+ /*FIXME: Is this true of all ops? */
+ return 1;
+}
+
+static int
+NV30VPGetConditionUpdate(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV30_VP_INST_COND_UPDATE_ENABLE) ? 1 : 0);
+}
+
+static int
+NV30VPGetConditionTest(nvsFunc * shader)
+{
+ int op;
+
+ /* The condition test is unconditionally enabled on some
+ * instructions. ie: the condition test bit does *NOT* have
+ * to be set.
+ *
+ * FIXME: check other relevant ops for this situation.
+ */
+ op = shader->GetOpcodeHW(shader, 1);
+ switch (op) {
+ case NV30_VP_INST_OP_BRA:
+ return 1;
+ default:
+ return ((shader->inst[0] & NV30_VP_INST_COND_TEST_ENABLE) ? 1 : 0);
+ }
+}
+
+static nvsCond
+NV30VPGetCondition(nvsFunc * shader)
+{
+ int cond;
+
+ cond = ((shader->inst[0] & NV30_VP_INST_COND_MASK)
+ >> NV30_VP_INST_COND_SHIFT);
+
+ switch (cond) {
+ case NV30_VP_INST_COND_FL: return NVS_COND_FL;
+ case NV30_VP_INST_COND_LT: return NVS_COND_LT;
+ case NV30_VP_INST_COND_EQ: return NVS_COND_EQ;
+ case NV30_VP_INST_COND_LE: return NVS_COND_LE;
+ case NV30_VP_INST_COND_GT: return NVS_COND_GT;
+ case NV30_VP_INST_COND_NE: return NVS_COND_NE;
+ case NV30_VP_INST_COND_GE: return NVS_COND_GE;
+ case NV30_VP_INST_COND_TR: return NVS_COND_TR;
+ default:
+ return NVS_COND_UNKNOWN;
+ }
+}
+
+static void
+NV30VPGetCondRegSwizzle(nvsFunc * shader, nvsSwzComp *swz)
+{
+ int swzbits;
+
+ swzbits = (shader->inst[0] & NV30_VP_INST_COND_SWZ_ALL_MASK)
+ >> NV30_VP_INST_COND_SWZ_ALL_SHIFT;
+ NV20VPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV30VPGetCondRegID(nvsFunc * shader)
+{
+ return 0;
+}
+
+
+static int
+NV30VPGetBranch(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV30_VP_INST_IADDR_MASK)
+ >> NV30_VP_INST_IADDR_SHIFT);
+}
+
+void
+NV30VPInitShaderFuncs(nvsFunc * shader)
+{
+ /* Inherit NV20 code, a lot of it is the same */
+ NV20VPInitShaderFuncs(shader);
+
+ /* Increase max valid opcode ID, and add new instructions */
+ NVVP_TX_VOP_COUNT = NVVP_TX_NVS_OP_COUNT = 32;
+
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_FRC, NVS_OP_FRC, 0, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_FLR, NVS_OP_FLR, 0, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SEQ, NVS_OP_SEQ, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SFL, NVS_OP_SFL, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SGT, NVS_OP_SGT, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SLE, NVS_OP_SLE, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SNE, NVS_OP_SNE, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_STR, NVS_OP_STR, 0, 1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_SSG, NVS_OP_SSG, 0, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_ARR, NVS_OP_ARR, 0, -1, -1);
+ MOD_OPCODE(NVVP_TX_VOP, NV30_VP_INST_OP_ARA, NVS_OP_ARA, 3, -1, -1);
+
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_BRA, NVS_OP_BRA, -1, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_CAL, NVS_OP_CAL, -1, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_RET, NVS_OP_RET, -1, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_LG2, NVS_OP_LG2, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_EX2, NVS_OP_EX2, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_SIN, NVS_OP_SIN, 2, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV30_VP_INST_OP_COS, NVS_OP_COS, 2, -1, -1);
+
+ shader->UploadToHW = NV30VPUploadToHW;
+ shader->UpdateConst = NV30VPUpdateConst;
+
+ shader->GetOpcodeHW = NV30VPGetOpcodeHW;
+
+ shader->GetDestFile = NV30VPGetDestFile;
+ shader->GetDestID = NV30VPGetDestID;
+ shader->GetDestMask = NV30VPGetDestMask;
+
+ shader->GetSourceID = NV30VPGetSourceID;
+ shader->GetSourceAbs = NV30VPGetSourceAbs;
+
+ shader->GetRelAddressRegID = NV30VPGetRelAddressRegID;
+ shader->GetRelAddressSwizzle = NV30VPGetRelAddressSwizzle;
+
+ shader->SupportsConditional = NV30VPSupportsConditional;
+ shader->GetConditionUpdate = NV30VPGetConditionUpdate;
+ shader->GetConditionTest = NV30VPGetConditionTest;
+ shader->GetCondition = NV30VPGetCondition;
+ shader->GetCondRegSwizzle = NV30VPGetCondRegSwizzle;
+ shader->GetCondRegID = NV30VPGetCondRegID;
+
+ shader->GetBranch = NV30VPGetBranch;
+}
+
diff --git a/src/mesa/drivers/dri/nouveau/nv40_fragprog.c b/src/mesa/drivers/dri/nouveau/nv40_fragprog.c
new file mode 100644
index 00000000000..3d58d6b6667
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv40_fragprog.c
@@ -0,0 +1,152 @@
+#include "nouveau_shader.h"
+#include "nv40_shader.h"
+
+/* branching ops */
+unsigned int NVFP_TX_BOP_COUNT = 5;
+struct _op_xlat NVFP_TX_BOP[64];
+
+static struct _op_xlat *
+NV40FPGetOPTXRec(nvsFunc * shader, int merged)
+{
+ struct _op_xlat *opr;
+ int op;
+
+ op = shader->GetOpcodeHW(shader, 0);
+ if (shader->inst[2] & NV40_FP_OP_OPCODE_IS_BRANCH) {
+ opr = NVFP_TX_BOP;
+ op &= ~NV40_FP_OP_OPCODE_IS_BRANCH;
+ if (op > NVFP_TX_BOP_COUNT)
+ return NULL;
+ }
+ else {
+ opr = NVFP_TX_AOP;
+ if (op > NVFP_TX_AOP_COUNT)
+ return NULL;
+ }
+
+ if (opr[op].SOP == NVS_OP_UNKNOWN)
+ return NULL;
+ return &opr[op];
+}
+
+static int
+NV40FPGetSourceID(nvsFunc * shader, int merged, int pos)
+{
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_ATTRIB:
+ switch ((shader->inst[0] & NV40_FP_OP_INPUT_SRC_MASK)
+ >> NV40_FP_OP_INPUT_SRC_SHIFT) {
+ case NV40_FP_OP_INPUT_SRC_POSITION: return NVS_FR_POSITION;
+ case NV40_FP_OP_INPUT_SRC_COL0 : return NVS_FR_COL0;
+ case NV40_FP_OP_INPUT_SRC_COL1 : return NVS_FR_COL1;
+ case NV40_FP_OP_INPUT_SRC_FOGC : return NVS_FR_FOGCOORD;
+ case NV40_FP_OP_INPUT_SRC_TC(0) : return NVS_FR_TEXCOORD0;
+ case NV40_FP_OP_INPUT_SRC_TC(1) : return NVS_FR_TEXCOORD1;
+ case NV40_FP_OP_INPUT_SRC_TC(2) : return NVS_FR_TEXCOORD2;
+ case NV40_FP_OP_INPUT_SRC_TC(3) : return NVS_FR_TEXCOORD3;
+ case NV40_FP_OP_INPUT_SRC_TC(4) : return NVS_FR_TEXCOORD4;
+ case NV40_FP_OP_INPUT_SRC_TC(5) : return NVS_FR_TEXCOORD5;
+ case NV40_FP_OP_INPUT_SRC_TC(6) : return NVS_FR_TEXCOORD6;
+ case NV40_FP_OP_INPUT_SRC_TC(7) : return NVS_FR_TEXCOORD7;
+ case NV40_FP_OP_INPUT_SRC_FACING : return NVS_FR_FACING;
+ default:
+ return -1;
+ }
+ break;
+ case NVS_FILE_TEMP:
+ {
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ return ((src & NV40_FP_REG_SRC_MASK) >> NV40_FP_REG_SRC_SHIFT);
+ }
+ case NVS_FILE_CONST: /* inlined into fragprog */
+ default:
+ return -1;
+ }
+}
+
+static int
+NV40FPGetBranch(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV40_FP_OP_IADDR_MASK)
+ >> NV40_FP_OP_IADDR_SHIFT);;
+}
+
+static int
+NV40FPGetBranchElse(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV40_FP_OP_ELSE_ID_MASK)
+ >> NV40_FP_OP_ELSE_ID_SHIFT);
+}
+
+static int
+NV40FPGetBranchEnd(nvsFunc * shader)
+{
+ return ((shader->inst[3] & NV40_FP_OP_END_ID_MASK)
+ >> NV40_FP_OP_END_ID_SHIFT);
+}
+
+static int
+NV40FPGetLoopCount(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV40_FP_OP_LOOP_COUNT_MASK)
+ >> NV40_FP_OP_LOOP_COUNT_SHIFT);
+}
+
+static int
+NV40FPGetLoopInitial(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV40_FP_OP_LOOP_INDEX_MASK)
+ >> NV40_FP_OP_LOOP_INDEX_SHIFT);
+}
+
+static int
+NV40FPGetLoopIncrement(nvsFunc * shader)
+{
+ return ((shader->inst[2] & NV40_FP_OP_LOOP_INCR_MASK)
+ >> NV40_FP_OP_LOOP_INCR_SHIFT);
+}
+
+void
+NV40FPInitShaderFuncs(nvsFunc * shader)
+{
+ /* Inherit NV30 FP code, it's mostly the same */
+ NV30FPInitShaderFuncs(shader);
+
+ /* Kill off opcodes seen on NV30, but not seen on NV40 - need to find
+ * out if these actually work or not.
+ *
+ * update: either LIT/RSQ don't work on nv40, or I generate bad code for
+ * them. haven't tested the others yet
+ */
+ MOD_OPCODE(NVFP_TX_AOP, 0x1B, NVS_OP_UNKNOWN, -1, -1, -1); /* NV30 RSQ */
+ MOD_OPCODE(NVFP_TX_AOP, 0x1E, NVS_OP_UNKNOWN, -1, -1, -1); /* NV30 LIT */
+ MOD_OPCODE(NVFP_TX_AOP, 0x1F, NVS_OP_UNKNOWN, -1, -1, -1); /* NV30 LRP */
+ MOD_OPCODE(NVFP_TX_AOP, 0x26, NVS_OP_UNKNOWN, -1, -1, -1); /* NV30 POW */
+ MOD_OPCODE(NVFP_TX_AOP, 0x36, NVS_OP_UNKNOWN, -1, -1, -1); /* NV30 RFL */
+
+ /* Extra opcodes supported on NV40 */
+ MOD_OPCODE(NVFP_TX_AOP, NV40_FP_OP_OPCODE_DIV , NVS_OP_DIV , 0, 1, -1);
+ MOD_OPCODE(NVFP_TX_AOP, NV40_FP_OP_OPCODE_DP2A , NVS_OP_DP2A, 0, 1, 2);
+ MOD_OPCODE(NVFP_TX_AOP, NV40_FP_OP_OPCODE_TXL , NVS_OP_TXL , 0, -1, -1);
+
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_BRK , NVS_OP_BRK , -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_CAL , NVS_OP_CAL , -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_IF , NVS_OP_IF , -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_LOOP, NVS_OP_LOOP, -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_REP , NVS_OP_REP , -1, -1, -1);
+ MOD_OPCODE(NVFP_TX_BOP, NV40_FP_OP_BRA_OPCODE_RET , NVS_OP_RET , -1, -1, -1);
+
+ /* fragment.facing */
+ shader->GetSourceID = NV40FPGetSourceID;
+
+ /* branching */
+ shader->GetOPTXRec = NV40FPGetOPTXRec;
+ shader->GetBranch = NV40FPGetBranch;
+ shader->GetBranchElse = NV40FPGetBranchElse;
+ shader->GetBranchEnd = NV40FPGetBranchEnd;
+ shader->GetLoopCount = NV40FPGetLoopCount;
+ shader->GetLoopInitial = NV40FPGetLoopInitial;
+ shader->GetLoopIncrement = NV40FPGetLoopIncrement;
+}
diff --git a/src/mesa/drivers/dri/nouveau/nv40_shader.h b/src/mesa/drivers/dri/nouveau/nv40_shader.h
new file mode 100644
index 00000000000..2a2b5639b6c
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv40_shader.h
@@ -0,0 +1,467 @@
+#ifndef __NV40_SHADER_H__
+#define __NV40_SHADER_H__
+
+/* Vertex programs instruction set
+ *
+ * The NV40 instruction set is very similar to NV30. Most fields are in
+ * a slightly different position in the instruction however.
+ *
+ * Merged instructions
+ * In some cases it is possible to put two instructions into one opcode
+ * slot. The rules for when this is OK is not entirely clear to me yet.
+ *
+ * There are separate writemasks and dest temp register fields for each
+ * grouping of instructions. There is however only one field with the
+ * ID of a result register. Writing to temp/result regs is selected by
+ * setting VEC_RESULT/SCA_RESULT.
+ *
+ * Temporary registers
+ * The source/dest temp register fields have been extended by 1 bit, to
+ * give a total of 32 temporary registers.
+ *
+ * Relative Addressing
+ * NV40 can use an address register to index into vertex attribute regs.
+ * This is done by putting the offset value into INPUT_SRC and setting
+ * the INDEX_INPUT flag.
+ *
+ * Conditional execution (see NV_vertex_program{2,3} for details)
+ * There is a second condition code register on NV40, it's use is enabled
+ * by setting the COND_REG_SELECT_1 flag.
+ *
+ * Texture lookup
+ * TODO
+ */
+
+/* ---- OPCODE BITS 127:96 / data DWORD 0 --- */
+#define NV40_VP_INST_VEC_RESULT (1 << 30)
+/* uncertain.. */
+#define NV40_VP_INST_COND_UPDATE_ENABLE ((1 << 14)|1<<29)
+/* use address reg as index into attribs */
+#define NV40_VP_INST_INDEX_INPUT (1 << 27)
+#define NV40_VP_INST_COND_REG_SELECT_1 (1 << 25)
+#define NV40_VP_INST_ADDR_REG_SELECT_1 (1 << 24)
+#define NV40_VP_INST_SRC2_ABS (1 << 23)
+#define NV40_VP_INST_SRC1_ABS (1 << 22)
+#define NV40_VP_INST_SRC0_ABS (1 << 21)
+#define NV40_VP_INST_VEC_DEST_TEMP_SHIFT 15
+#define NV40_VP_INST_VEC_DEST_TEMP_MASK (0x1F << 15)
+#define NV40_VP_INST_COND_TEST_ENABLE (1 << 13)
+#define NV40_VP_INST_COND_SHIFT 10
+#define NV40_VP_INST_COND_MASK (0x7 << 10)
+# define NV40_VP_INST_COND_FL 0
+# define NV40_VP_INST_COND_LT 1
+# define NV40_VP_INST_COND_EQ 2
+# define NV40_VP_INST_COND_LE 3
+# define NV40_VP_INST_COND_GT 4
+# define NV40_VP_INST_COND_NE 5
+# define NV40_VP_INST_COND_GE 6
+# define NV40_VP_INST_COND_TR 7
+#define NV40_VP_INST_COND_SWZ_X_SHIFT 8
+#define NV40_VP_INST_COND_SWZ_X_MASK (3 << 8)
+#define NV40_VP_INST_COND_SWZ_Y_SHIFT 6
+#define NV40_VP_INST_COND_SWZ_Y_MASK (3 << 6)
+#define NV40_VP_INST_COND_SWZ_Z_SHIFT 4
+#define NV40_VP_INST_COND_SWZ_Z_MASK (3 << 4)
+#define NV40_VP_INST_COND_SWZ_W_SHIFT 2
+#define NV40_VP_INST_COND_SWZ_W_MASK (3 << 2)
+#define NV40_VP_INST_COND_SWZ_ALL_SHIFT 2
+#define NV40_VP_INST_COND_SWZ_ALL_MASK (0xFF << 2)
+#define NV40_VP_INST_ADDR_SWZ_SHIFT 0
+#define NV40_VP_INST_ADDR_SWZ_MASK (0x03 << 0)
+#define NV40_VP_INST0_KNOWN ( \
+ NV40_VP_INST_INDEX_INPUT | \
+ NV40_VP_INST_COND_REG_SELECT_1 | \
+ NV40_VP_INST_ADDR_REG_SELECT_1 | \
+ NV40_VP_INST_SRC2_ABS | \
+ NV40_VP_INST_SRC1_ABS | \
+ NV40_VP_INST_SRC0_ABS | \
+ NV40_VP_INST_VEC_DEST_TEMP_MASK | \
+ NV40_VP_INST_COND_TEST_ENABLE | \
+ NV40_VP_INST_COND_MASK | \
+ NV40_VP_INST_COND_SWZ_ALL_MASK | \
+ NV40_VP_INST_ADDR_SWZ_MASK)
+
+/* ---- OPCODE BITS 95:64 / data DWORD 1 --- */
+#define NV40_VP_INST_VEC_OPCODE_SHIFT 22
+#define NV40_VP_INST_VEC_OPCODE_MASK (0x1F << 22)
+# define NV40_VP_INST_OP_NOP 0x00
+# define NV40_VP_INST_OP_MOV 0x01
+# define NV40_VP_INST_OP_MUL 0x02
+# define NV40_VP_INST_OP_ADD 0x03
+# define NV40_VP_INST_OP_MAD 0x04
+# define NV40_VP_INST_OP_DP3 0x05
+# define NV40_VP_INST_OP_DP4 0x07
+# define NV40_VP_INST_OP_DPH 0x06
+# define NV40_VP_INST_OP_DST 0x08
+# define NV40_VP_INST_OP_MIN 0x09
+# define NV40_VP_INST_OP_MAX 0x0A
+# define NV40_VP_INST_OP_SLT 0x0B
+# define NV40_VP_INST_OP_SGE 0x0C
+# define NV40_VP_INST_OP_ARL 0x0D
+# define NV40_VP_INST_OP_FRC 0x0E
+# define NV40_VP_INST_OP_FLR 0x0F
+# define NV40_VP_INST_OP_SEQ 0x10
+# define NV40_VP_INST_OP_SFL 0x11
+# define NV40_VP_INST_OP_SGT 0x12
+# define NV40_VP_INST_OP_SLE 0x13
+# define NV40_VP_INST_OP_SNE 0x14
+# define NV40_VP_INST_OP_STR 0x15
+# define NV40_VP_INST_OP_SSG 0x16
+# define NV40_VP_INST_OP_ARR 0x17
+# define NV40_VP_INST_OP_ARA 0x18
+# define NV40_VP_INST_OP_TXWHAT 0x19
+#define NV40_VP_INST_SCA_OPCODE_SHIFT 27
+#define NV40_VP_INST_SCA_OPCODE_MASK (0x1F << 27)
+# define NV40_VP_INST_OP_RCP 0x02
+# define NV40_VP_INST_OP_RCC 0x03
+# define NV40_VP_INST_OP_RSQ 0x04
+# define NV40_VP_INST_OP_EXP 0x05
+# define NV40_VP_INST_OP_LOG 0x06
+# define NV40_VP_INST_OP_LIT 0x07
+# define NV40_VP_INST_OP_BRA 0x09
+# define NV40_VP_INST_OP_CAL 0x0B
+# define NV40_VP_INST_OP_RET 0x0C
+# define NV40_VP_INST_OP_LG2 0x0D
+# define NV40_VP_INST_OP_EX2 0x0E
+# define NV40_VP_INST_OP_SIN 0x0F
+# define NV40_VP_INST_OP_COS 0x10
+# define NV40_VP_INST_OP_PUSHA 0x13
+# define NV40_VP_INST_OP_POPA 0x14
+#define NV40_VP_INST_CONST_SRC_SHIFT 12
+#define NV40_VP_INST_CONST_SRC_MASK (0xFF << 12)
+#define NV40_VP_INST_INPUT_SRC_SHIFT 8
+#define NV40_VP_INST_INPUT_SRC_MASK (0x0F << 8)
+# define NV40_VP_INST_IN_POS 0
+# define NV40_VP_INST_IN_WEIGHT 1
+# define NV40_VP_INST_IN_NORMAL 2
+# define NV40_VP_INST_IN_COL0 3
+# define NV40_VP_INST_IN_COL1 4
+# define NV40_VP_INST_IN_FOGC 5
+# define NV40_VP_INST_IN_TC0 8
+# define NV40_VP_INST_IN_TC(n) (8+n)
+#define NV40_VP_INST_SRC0H_SHIFT 0
+#define NV40_VP_INST_SRC0H_MASK (0xFF << 0)
+#define NV40_VP_INST1_KNOWN ( \
+ NV40_VP_INST_VEC_OPCODE_MASK | \
+ NV40_VP_INST_SCA_OPCODE_MASK | \
+ NV40_VP_INST_CONST_SRC_MASK | \
+ NV40_VP_INST_INPUT_SRC_MASK | \
+ NV40_VP_INST_SRC0H_MASK \
+ )
+
+/* ---- OPCODE BITS 63:32 / data DWORD 2 --- */
+#define NV40_VP_INST_SRC0L_SHIFT 23
+#define NV40_VP_INST_SRC0L_MASK (0x1FF << 23)
+#define NV40_VP_INST_SRC1_SHIFT 6
+#define NV40_VP_INST_SRC1_MASK (0x1FFFF << 6)
+#define NV40_VP_INST_SRC2H_SHIFT 0
+#define NV40_VP_INST_SRC2H_MASK (0x3F << 0)
+#define NV40_VP_INST_IADDRH_SHIFT 0
+#define NV40_VP_INST_IADDRH_MASK (0x1F << 0)
+
+/* ---- OPCODE BITS 31:0 / data DWORD 3 --- */
+#define NV40_VP_INST_IADDRL_SHIFT 29
+#define NV40_VP_INST_IADDRL_MASK (7 << 29)
+#define NV40_VP_INST_SRC2L_SHIFT 21
+#define NV40_VP_INST_SRC2L_MASK (0x7FF << 21)
+#define NV40_VP_INST_SCA_WRITEMASK_SHIFT 17
+#define NV40_VP_INST_SCA_WRITEMASK_MASK (0xF << 17)
+# define NV40_VP_INST_SCA_WRITEMASK_X (1 << 20)
+# define NV40_VP_INST_SCA_WRITEMASK_Y (1 << 19)
+# define NV40_VP_INST_SCA_WRITEMASK_Z (1 << 18)
+# define NV40_VP_INST_SCA_WRITEMASK_W (1 << 17)
+#define NV40_VP_INST_VEC_WRITEMASK_SHIFT 13
+#define NV40_VP_INST_VEC_WRITEMASK_MASK (0xF << 13)
+# define NV40_VP_INST_VEC_WRITEMASK_X (1 << 16)
+# define NV40_VP_INST_VEC_WRITEMASK_Y (1 << 15)
+# define NV40_VP_INST_VEC_WRITEMASK_Z (1 << 14)
+# define NV40_VP_INST_VEC_WRITEMASK_W (1 << 13)
+#define NV40_VP_INST_SCA_RESULT (1 << 12)
+#define NV40_VP_INST_SCA_DEST_TEMP_SHIFT 7
+#define NV40_VP_INST_SCA_DEST_TEMP_MASK (0x1F << 7)
+#define NV40_VP_INST_DEST_SHIFT 2
+#define NV40_VP_INST_DEST_MASK (31 << 2)
+# define NV40_VP_INST_DEST_POS 0
+# define NV40_VP_INST_DEST_COL0 1
+# define NV40_VP_INST_DEST_COL1 2
+# define NV40_VP_INST_DEST_BFC0 3
+# define NV40_VP_INST_DEST_BFC1 4
+# define NV40_VP_INST_DEST_FOGC 5
+# define NV40_VP_INST_DEST_PSZ 6
+# define NV40_VP_INST_DEST_TC0 7
+# define NV40_VP_INST_DEST_TC(n) (7+n)
+# define NV40_VP_INST_DEST_TEMP 0x1F
+#define NV40_VP_INST_INDEX_CONST (1 << 1)
+#define NV40_VP_INST_LAST (1 << 0)
+#define NV40_VP_INST3_KNOWN ( \
+ NV40_VP_INST_SRC2L_MASK |\
+ NV40_VP_INST_SCA_WRITEMASK_MASK |\
+ NV40_VP_INST_VEC_WRITEMASK_MASK |\
+ NV40_VP_INST_SCA_DEST_TEMP_MASK |\
+ NV40_VP_INST_DEST_MASK |\
+ NV40_VP_INST_INDEX_CONST)
+
+/* Useful to split the source selection regs into their pieces */
+#define NV40_VP_SRC0_HIGH_SHIFT 9
+#define NV40_VP_SRC0_HIGH_MASK 0x0001FE00
+#define NV40_VP_SRC0_LOW_MASK 0x000001FF
+#define NV40_VP_SRC2_HIGH_SHIFT 11
+#define NV40_VP_SRC2_HIGH_MASK 0x0001F800
+#define NV40_VP_SRC2_LOW_MASK 0x000007FF
+
+/* Source selection - these are the bits you fill NV40_VP_INST_SRCn with */
+#define NV40_VP_SRC_NEGATE (1 << 16)
+#define NV40_VP_SRC_SWZ_X_SHIFT 14
+#define NV40_VP_SRC_SWZ_X_MASK (3 << 14)
+#define NV40_VP_SRC_SWZ_Y_SHIFT 12
+#define NV40_VP_SRC_SWZ_Y_MASK (3 << 12)
+#define NV40_VP_SRC_SWZ_Z_SHIFT 10
+#define NV40_VP_SRC_SWZ_Z_MASK (3 << 10)
+#define NV40_VP_SRC_SWZ_W_SHIFT 8
+#define NV40_VP_SRC_SWZ_W_MASK (3 << 8)
+#define NV40_VP_SRC_SWZ_ALL_SHIFT 8
+#define NV40_VP_SRC_SWZ_ALL_MASK (0xFF << 8)
+#define NV40_VP_SRC_TEMP_SRC_SHIFT 2
+#define NV40_VP_SRC_TEMP_SRC_MASK (0x1F << 2)
+#define NV40_VP_SRC_REG_TYPE_SHIFT 0
+#define NV40_VP_SRC_REG_TYPE_MASK (3 << 0)
+# define NV40_VP_SRC_REG_TYPE_UNK0 0
+# define NV40_VP_SRC_REG_TYPE_TEMP 1
+# define NV40_VP_SRC_REG_TYPE_INPUT 2
+# define NV40_VP_SRC_REG_TYPE_CONST 3
+
+
+/*
+ * Each fragment program opcode appears to be comprised of 4 32-bit values.
+ *
+ * 0 - Opcode, output reg/mask, ATTRIB source
+ * 1 - Source 0
+ * 2 - Source 1
+ * 3 - Source 2
+ *
+ * There appears to be no special difference between result regs and temp regs.
+ * result.color == R0.xyzw
+ * result.depth == R1.z
+ * When the fragprog contains instructions to write depth,
+ * NV30_TCL_PRIMITIVE_3D_UNK1D78=0 otherwise it is set to 1.
+ *
+ * Constants are inserted directly after the instruction that uses them.
+ *
+ * It appears that it's not possible to use two input registers in one
+ * instruction as the input sourcing is done in the instruction dword
+ * and not the source selection dwords. As such instructions such as:
+ *
+ * ADD result.color, fragment.color, fragment.texcoord[0];
+ *
+ * must be split into two MOV's and then an ADD (nvidia does this) but
+ * I'm not sure why it's not just one MOV and then source the second input
+ * in the ADD instruction..
+ *
+ * Negation of the full source is done with NV30_FP_REG_NEGATE, arbitrary
+ * negation requires multiplication with a const.
+ *
+ * Arbitrary swizzling is supported with the exception of SWIZZLE_ZERO and
+ * SWIZZLE_ONE.
+ *
+ * The temp/result regs appear to be initialised to (0.0, 0.0, 0.0, 0.0) as
+ * SWIZZLE_ZERO is implemented simply by not writing to the relevant components
+ * of the destination.
+ *
+ * Looping
+ * Loops appear to be fairly expensive on NV40 at least, the proprietary
+ * driver goes to a lot of effort to avoid using the native looping
+ * instructions. If the total number of *executed* instructions between
+ * REP/ENDREP or LOOP/ENDLOOP is <=500, the driver will unroll the loop.
+ * The maximum loop count is 255.
+ *
+ * Conditional execution
+ * TODO
+ *
+ * Non-native instructions:
+ * LIT
+ * LRP - MAD+MAD
+ * SUB - ADD, negate second source
+ * RSQ - LG2 + EX2
+ * POW - LG2 + MUL + EX2
+ * SCS - COS + SIN
+ * XPD
+ * DP2 - MUL + ADD
+ * NRM
+ */
+
+//== Opcode / Destination selection ==
+#define NV40_FP_OP_PROGRAM_END (1 << 0)
+#define NV40_FP_OP_OUT_REG_SHIFT 1
+#define NV40_FP_OP_OUT_REG_MASK (31 << 1)
+/* Needs to be set when writing outputs to get expected result.. */
+#define NV40_FP_OP_UNK0_7 (1 << 7)
+#define NV40_FP_OP_COND_WRITE_ENABLE (1 << 8)
+#define NV40_FP_OP_OUTMASK_SHIFT 9
+#define NV40_FP_OP_OUTMASK_MASK (0xF << 9)
+# define NV40_FP_OP_OUT_X (1 << 9)
+# define NV40_FP_OP_OUT_Y (1 <<10)
+# define NV40_FP_OP_OUT_Z (1 <<11)
+# define NV40_FP_OP_OUT_W (1 <<12)
+/* Uncertain about these, especially the input_src values.. it's possible that
+ * they can be dynamically changed.
+ */
+#define NV40_FP_OP_INPUT_SRC_SHIFT 13
+#define NV40_FP_OP_INPUT_SRC_MASK (15 << 13)
+# define NV40_FP_OP_INPUT_SRC_POSITION 0x0
+# define NV40_FP_OP_INPUT_SRC_COL0 0x1
+# define NV40_FP_OP_INPUT_SRC_COL1 0x2
+# define NV40_FP_OP_INPUT_SRC_FOGC 0x3
+# define NV40_FP_OP_INPUT_SRC_TC0 0x4
+# define NV40_FP_OP_INPUT_SRC_TC(n) (0x4 + n)
+# define NV40_FP_OP_INPUT_SRC_FACING 0xE
+#define NV40_FP_OP_TEX_UNIT_SHIFT 17
+#define NV40_FP_OP_TEX_UNIT_MASK (0xF << 17)
+#define NV40_FP_OP_PRECISION_SHIFT 22
+#define NV40_FP_OP_PRECISION_MASK (3 << 22)
+# define NV40_FP_PRECISION_FP32 0
+# define NV40_FP_PRECISION_FP16 1
+# define NV40_FP_PRECISION_FX12 2
+#define NV40_FP_OP_OPCODE_SHIFT 24
+#define NV40_FP_OP_OPCODE_MASK (0x3F << 24)
+# define NV40_FP_OP_OPCODE_NOP 0x00
+# define NV40_FP_OP_OPCODE_MOV 0x01
+# define NV40_FP_OP_OPCODE_MUL 0x02
+# define NV40_FP_OP_OPCODE_ADD 0x03
+# define NV40_FP_OP_OPCODE_MAD 0x04
+# define NV40_FP_OP_OPCODE_DP3 0x05
+# define NV40_FP_OP_OPCODE_DP4 0x06
+# define NV40_FP_OP_OPCODE_DST 0x07
+# define NV40_FP_OP_OPCODE_MIN 0x08
+# define NV40_FP_OP_OPCODE_MAX 0x09
+# define NV40_FP_OP_OPCODE_SLT 0x0A
+# define NV40_FP_OP_OPCODE_SGE 0x0B
+# define NV40_FP_OP_OPCODE_SLE 0x0C
+# define NV40_FP_OP_OPCODE_SGT 0x0D
+# define NV40_FP_OP_OPCODE_SNE 0x0E
+# define NV40_FP_OP_OPCODE_SEQ 0x0F
+# define NV40_FP_OP_OPCODE_FRC 0x10
+# define NV40_FP_OP_OPCODE_FLR 0x11
+# define NV40_FP_OP_OPCODE_KIL 0x12
+# define NV40_FP_OP_OPCODE_PK4B 0x13
+# define NV40_FP_OP_OPCODE_UP4B 0x14
+/* DDX/DDY can only write to XY */
+# define NV40_FP_OP_OPCODE_DDX 0x15
+# define NV40_FP_OP_OPCODE_DDY 0x16
+# define NV40_FP_OP_OPCODE_TEX 0x17
+# define NV40_FP_OP_OPCODE_TXP 0x18
+# define NV40_FP_OP_OPCODE_TXD 0x19
+# define NV40_FP_OP_OPCODE_RCP 0x1A
+# define NV40_FP_OP_OPCODE_EX2 0x1C
+# define NV40_FP_OP_OPCODE_LG2 0x1D
+# define NV40_FP_OP_OPCODE_COS 0x22
+# define NV40_FP_OP_OPCODE_SIN 0x23
+# define NV40_FP_OP_OPCODE_PK2H 0x24
+# define NV40_FP_OP_OPCODE_UP2H 0x25
+# define NV40_FP_OP_OPCODE_PK4UB 0x27
+# define NV40_FP_OP_OPCODE_UP4UB 0x28
+# define NV40_FP_OP_OPCODE_PK2US 0x29
+# define NV40_FP_OP_OPCODE_UP2US 0x2A
+# define NV40_FP_OP_OPCODE_DP2A 0x2E
+# define NV40_FP_OP_OPCODE_TXL 0x2F
+# define NV40_FP_OP_OPCODE_TXB 0x31
+# define NV40_FP_OP_OPCODE_DIV 0x3A
+/* The use of these instructions appears to be indicated by bit 31 of DWORD 2.*/
+# define NV40_FP_OP_BRA_OPCODE_BRK 0x0
+# define NV40_FP_OP_BRA_OPCODE_CAL 0x1
+# define NV40_FP_OP_BRA_OPCODE_IF 0x2
+# define NV40_FP_OP_BRA_OPCODE_LOOP 0x3
+# define NV40_FP_OP_BRA_OPCODE_REP 0x4
+# define NV40_FP_OP_BRA_OPCODE_RET 0x5
+#define NV40_FP_OP_OUT_SAT (1 << 31)
+
+/* high order bits of SRC0 */
+#define NV40_FP_OP_OUT_ABS (1 << 29)
+#define NV40_FP_OP_COND_SWZ_W_SHIFT 27
+#define NV40_FP_OP_COND_SWZ_W_MASK (3 << 27)
+#define NV40_FP_OP_COND_SWZ_Z_SHIFT 25
+#define NV40_FP_OP_COND_SWZ_Z_MASK (3 << 25)
+#define NV40_FP_OP_COND_SWZ_Y_SHIFT 23
+#define NV40_FP_OP_COND_SWZ_Y_MASK (3 << 23)
+#define NV40_FP_OP_COND_SWZ_X_SHIFT 21
+#define NV40_FP_OP_COND_SWZ_X_MASK (3 << 21)
+#define NV40_FP_OP_COND_SWZ_ALL_SHIFT 21
+#define NV40_FP_OP_COND_SWZ_ALL_MASK (0xFF << 21)
+#define NV40_FP_OP_COND_SHIFT 18
+#define NV40_FP_OP_COND_MASK (0x07 << 18)
+# define NV40_FP_OP_COND_FL 0
+# define NV40_FP_OP_COND_LT 1
+# define NV40_FP_OP_COND_EQ 2
+# define NV40_FP_OP_COND_LE 3
+# define NV40_FP_OP_COND_GT 4
+# define NV40_FP_OP_COND_NE 5
+# define NV40_FP_OP_COND_GE 6
+# define NV40_FP_OP_COND_TR 7
+
+/* high order bits of SRC1 */
+#define NV40_FP_OP_OPCODE_IS_BRANCH (1<<31)
+#define NV40_FP_OP_SRC_SCALE_SHIFT 28
+#define NV40_FP_OP_SRC_SCALE_MASK (3 << 28)
+
+/* SRC1 LOOP */
+#define NV40_FP_OP_LOOP_INCR_SHIFT 19
+#define NV40_FP_OP_LOOP_INCR_MASK (0xFF << 19)
+#define NV40_FP_OP_LOOP_INDEX_SHIFT 10
+#define NV40_FP_OP_LOOP_INDEX_MASK (0xFF << 10)
+#define NV40_FP_OP_LOOP_COUNT_SHIFT 2
+#define NV40_FP_OP_LOOP_COUNT_MASK (0xFF << 2)
+
+/* SRC1 IF */
+#define NV40_FP_OP_ELSE_ID_SHIFT 2
+#define NV40_FP_OP_ELSE_ID_MASK (0xFF << 2)
+
+/* SRC1 CAL */
+#define NV40_FP_OP_IADDR_SHIFT 2
+#define NV40_FP_OP_IADDR_MASK (0xFF << 2)
+
+/* SRC1 REP
+ * I have no idea why there are 3 count values here.. but they
+ * have always been filled with the same value in my tests so
+ * far..
+ */
+#define NV40_FP_OP_REP_COUNT1_SHIFT 2
+#define NV40_FP_OP_REP_COUNT1_MASK (0xFF << 2)
+#define NV40_FP_OP_REP_COUNT2_SHIFT 10
+#define NV40_FP_OP_REP_COUNT2_MASK (0xFF << 10)
+#define NV40_FP_OP_REP_COUNT3_SHIFT 19
+#define NV40_FP_OP_REP_COUNT3_MASK (0xFF << 19)
+
+/* SRC2 REP/IF */
+#define NV40_FP_OP_END_ID_SHIFT 2
+#define NV40_FP_OP_END_ID_MASK (0xFF << 2)
+
+// SRC2 high-order
+#define NV40_FP_OP_INDEX_INPUT (1 << 30)
+#define NV40_FP_OP_ADDR_INDEX_SHIFT 19
+#define NV40_FP_OP_ADDR_INDEX_MASK (0xF << 19)
+
+//== Register selection ==
+#define NV40_FP_REG_TYPE_SHIFT 0
+#define NV40_FP_REG_TYPE_MASK (3 << 0)
+# define NV40_FP_REG_TYPE_TEMP 0
+# define NV40_FP_REG_TYPE_INPUT 1
+# define NV40_FP_REG_TYPE_CONST 2
+#define NV40_FP_REG_SRC_SHIFT 2
+#define NV40_FP_REG_SRC_MASK (31 << 2)
+#define NV40_FP_REG_UNK_0 (1 << 8)
+#define NV40_FP_REG_SWZ_ALL_SHIFT 9
+#define NV40_FP_REG_SWZ_ALL_MASK (255 << 9)
+#define NV40_FP_REG_SWZ_X_SHIFT 9
+#define NV40_FP_REG_SWZ_X_MASK (3 << 9)
+#define NV40_FP_REG_SWZ_Y_SHIFT 11
+#define NV40_FP_REG_SWZ_Y_MASK (3 << 11)
+#define NV40_FP_REG_SWZ_Z_SHIFT 13
+#define NV40_FP_REG_SWZ_Z_MASK (3 << 13)
+#define NV40_FP_REG_SWZ_W_SHIFT 15
+#define NV40_FP_REG_SWZ_W_MASK (3 << 15)
+# define NV40_FP_SWIZZLE_X 0
+# define NV40_FP_SWIZZLE_Y 1
+# define NV40_FP_SWIZZLE_Z 2
+# define NV40_FP_SWIZZLE_W 3
+#define NV40_FP_REG_NEGATE (1 << 17)
+
+#endif
diff --git a/src/mesa/drivers/dri/nouveau/nv40_vertprog.c b/src/mesa/drivers/dri/nouveau/nv40_vertprog.c
new file mode 100644
index 00000000000..0493e184033
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nv40_vertprog.c
@@ -0,0 +1,685 @@
+#include "nouveau_shader.h"
+#include "nouveau_msg.h"
+#include "nv40_shader.h"
+
+/*****************************************************************************
+ * Assembly routines
+ */
+static int
+NV40VPSupportsOpcode(nvsFunc * shader, nvsOpcode op)
+{
+ if (shader->GetOPTXFromSOP(op, NULL))
+ return 1;
+ return 0;
+}
+
+static void
+NV40VPSetOpcode(nvsFunc *shader, unsigned int opcode, int slot)
+{
+ if (slot) {
+ shader->inst[1] &= ~NV40_VP_INST_SCA_OPCODE_MASK;
+ shader->inst[1] |= (opcode << NV40_VP_INST_SCA_OPCODE_SHIFT);
+ } else {
+ shader->inst[1] &= ~NV40_VP_INST_VEC_OPCODE_MASK;
+ shader->inst[1] |= (opcode << NV40_VP_INST_VEC_OPCODE_SHIFT);
+ }
+}
+
+static void
+NV40VPSetCCUpdate(nvsFunc *shader)
+{
+ shader->inst[0] |= NV40_VP_INST_COND_UPDATE_ENABLE;
+}
+
+static void
+NV40VPSetCondition(nvsFunc *shader, int on, nvsCond cond, int reg,
+ nvsSwzComp *swizzle)
+{
+ unsigned int hwcond;
+
+ if (on ) shader->inst[0] |= NV40_VP_INST_COND_TEST_ENABLE;
+ else shader->inst[0] &= ~NV40_VP_INST_COND_TEST_ENABLE;
+ if (reg) shader->inst[0] |= NV40_VP_INST_COND_REG_SELECT_1;
+ else shader->inst[0] &= ~NV40_VP_INST_COND_REG_SELECT_1;
+
+ switch (cond) {
+ case NVS_COND_TR: hwcond = NV40_VP_INST_COND_TR; break;
+ case NVS_COND_FL: hwcond = NV40_VP_INST_COND_FL; break;
+ case NVS_COND_LT: hwcond = NV40_VP_INST_COND_LT; break;
+ case NVS_COND_GT: hwcond = NV40_VP_INST_COND_GT; break;
+ case NVS_COND_NE: hwcond = NV40_VP_INST_COND_NE; break;
+ case NVS_COND_EQ: hwcond = NV40_VP_INST_COND_EQ; break;
+ case NVS_COND_GE: hwcond = NV40_VP_INST_COND_GE; break;
+ case NVS_COND_LE: hwcond = NV40_VP_INST_COND_LE; break;
+ default:
+ WARN_ONCE("unknown vp cond %d\n", cond);
+ hwcond = NV40_VP_INST_COND_TR;
+ break;
+ }
+ shader->inst[0] &= ~NV40_VP_INST_COND_MASK;
+ shader->inst[0] |= (hwcond << NV40_VP_INST_COND_SHIFT);
+
+ shader->inst[0] &= ~NV40_VP_INST_COND_SWZ_ALL_MASK;
+ shader->inst[0] |= (swizzle[NVS_SWZ_X] << NV40_VP_INST_COND_SWZ_X_SHIFT);
+ shader->inst[0] |= (swizzle[NVS_SWZ_Y] << NV40_VP_INST_COND_SWZ_Y_SHIFT);
+ shader->inst[0] |= (swizzle[NVS_SWZ_Z] << NV40_VP_INST_COND_SWZ_Z_SHIFT);
+ shader->inst[0] |= (swizzle[NVS_SWZ_W] << NV40_VP_INST_COND_SWZ_W_SHIFT);
+}
+
+static void
+NV40VPSetResult(nvsFunc *shader, nvsRegister * dest, unsigned int mask,
+ int slot)
+{
+ unsigned int hwmask = 0;
+
+ if (mask & SMASK_X) hwmask |= (1 << 3);
+ if (mask & SMASK_Y) hwmask |= (1 << 2);
+ if (mask & SMASK_Z) hwmask |= (1 << 1);
+ if (mask & SMASK_W) hwmask |= (1 << 0);
+
+ if (dest->file == NVS_FILE_RESULT) {
+ int hwidx;
+
+ switch (dest->index) {
+ case NVS_FR_POSITION : hwidx = NV40_VP_INST_DEST_POS; break;
+ case NVS_FR_COL0 : hwidx = NV40_VP_INST_DEST_COL0; break;
+ case NVS_FR_COL1 : hwidx = NV40_VP_INST_DEST_COL1; break;
+ case NVS_FR_BFC0 : hwidx = NV40_VP_INST_DEST_BFC0; break;
+ case NVS_FR_BFC1 : hwidx = NV40_VP_INST_DEST_BFC1; break;
+ case NVS_FR_FOGCOORD : hwidx = NV40_VP_INST_DEST_FOGC; break;
+ case NVS_FR_POINTSZ : hwidx = NV40_VP_INST_DEST_PSZ; break;
+ case NVS_FR_TEXCOORD0: hwidx = NV40_VP_INST_DEST_TC(0); break;
+ case NVS_FR_TEXCOORD1: hwidx = NV40_VP_INST_DEST_TC(1); break;
+ case NVS_FR_TEXCOORD2: hwidx = NV40_VP_INST_DEST_TC(2); break;
+ case NVS_FR_TEXCOORD3: hwidx = NV40_VP_INST_DEST_TC(3); break;
+ case NVS_FR_TEXCOORD4: hwidx = NV40_VP_INST_DEST_TC(4); break;
+ case NVS_FR_TEXCOORD5: hwidx = NV40_VP_INST_DEST_TC(5); break;
+ case NVS_FR_TEXCOORD6: hwidx = NV40_VP_INST_DEST_TC(6); break;
+ case NVS_FR_TEXCOORD7: hwidx = NV40_VP_INST_DEST_TC(7); break;
+ default:
+ WARN_ONCE("unknown vtxprog output %d\n", dest->index);
+ hwidx = 0;
+ break;
+ }
+ shader->inst[3] &= ~NV40_VP_INST_DEST_MASK;
+ shader->inst[3] |= (hwidx << NV40_VP_INST_DEST_SHIFT);
+
+ if (slot) shader->inst[3] |= NV40_VP_INST_SCA_RESULT;
+ else shader->inst[0] |= NV40_VP_INST_VEC_RESULT;
+ } else {
+ /* NVS_FILE_TEMP || NVS_FILE_ADDRESS */
+ if (slot) {
+ shader->inst[3] &= ~NV40_VP_INST_SCA_RESULT;
+ shader->inst[3] &= ~NV40_VP_INST_SCA_DEST_TEMP_MASK;
+ shader->inst[3] |= (dest->index << NV40_VP_INST_SCA_DEST_TEMP_SHIFT);
+ } else {
+ shader->inst[0] &= ~NV40_VP_INST_VEC_RESULT;
+ shader->inst[0] &= ~(NV40_VP_INST_VEC_DEST_TEMP_MASK | (1<<20));
+ shader->inst[0] |= (dest->index << NV40_VP_INST_VEC_DEST_TEMP_SHIFT);
+ }
+ }
+
+ if (slot) {
+ shader->inst[3] &= ~NV40_VP_INST_SCA_WRITEMASK_MASK;
+ shader->inst[3] |= (hwmask << NV40_VP_INST_SCA_WRITEMASK_SHIFT);
+ } else {
+ shader->inst[3] &= ~NV40_VP_INST_VEC_WRITEMASK_MASK;
+ shader->inst[3] |= (hwmask << NV40_VP_INST_VEC_WRITEMASK_SHIFT);
+ }
+}
+
+static void
+NV40VPInsertSource(nvsFunc *shader, unsigned int hw, int pos)
+{
+ switch (pos) {
+ case 0:
+ shader->inst[1] &= ~NV40_VP_INST_SRC0H_MASK;
+ shader->inst[2] &= ~NV40_VP_INST_SRC0L_MASK;
+ shader->inst[1] |= ((hw & NV40_VP_SRC0_HIGH_MASK) >>
+ NV40_VP_SRC0_HIGH_SHIFT)
+ << NV40_VP_INST_SRC0H_SHIFT;
+ shader->inst[2] |= (hw & NV40_VP_SRC0_LOW_MASK)
+ << NV40_VP_INST_SRC0L_SHIFT;
+ break;
+ case 1:
+ shader->inst[2] &= ~NV40_VP_INST_SRC1_MASK;
+ shader->inst[2] |= hw
+ << NV40_VP_INST_SRC1_SHIFT;
+ break;
+ case 2:
+ shader->inst[2] &= ~NV40_VP_INST_SRC2H_MASK;
+ shader->inst[3] &= ~NV40_VP_INST_SRC2L_MASK;
+ shader->inst[2] |= ((hw & NV40_VP_SRC2_HIGH_MASK) >>
+ NV40_VP_SRC2_HIGH_SHIFT)
+ << NV40_VP_INST_SRC2H_SHIFT;
+ shader->inst[3] |= (hw & NV40_VP_SRC2_LOW_MASK)
+ << NV40_VP_INST_SRC2L_SHIFT;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+static void
+NV40VPSetSource(nvsFunc *shader, nvsRegister * src, int pos)
+{
+ unsigned int hw = 0;
+
+ switch (src->file) {
+ case NVS_FILE_ADDRESS:
+ break;
+ case NVS_FILE_ATTRIB:
+ hw |= (NV40_VP_SRC_REG_TYPE_INPUT << NV40_VP_SRC_REG_TYPE_SHIFT);
+
+ shader->inst[1] &= ~NV40_VP_INST_INPUT_SRC_MASK;
+ shader->inst[1] |= (src->index << NV40_VP_INST_INPUT_SRC_SHIFT);
+ if (src->indexed) {
+ shader->inst[0] |= NV40_VP_INST_INDEX_INPUT;
+ if (src->addr_reg)
+ shader->inst[0] |= NV40_VP_INST_ADDR_REG_SELECT_1;
+ else
+ shader->inst[0] &= ~NV40_VP_INST_ADDR_REG_SELECT_1;
+ shader->inst[0] &= ~NV40_VP_INST_ADDR_SWZ_SHIFT;
+ shader->inst[0] |= (src->addr_comp << NV40_VP_INST_ADDR_SWZ_SHIFT);
+ } else
+ shader->inst[0] &= ~NV40_VP_INST_INDEX_INPUT;
+ break;
+ case NVS_FILE_CONST:
+ hw |= (NV40_VP_SRC_REG_TYPE_CONST << NV40_VP_SRC_REG_TYPE_SHIFT);
+
+ shader->inst[1] &= ~NV40_VP_INST_CONST_SRC_MASK;
+ shader->inst[1] |= (src->index << NV40_VP_INST_CONST_SRC_SHIFT);
+ if (src->indexed) {
+ shader->inst[3] |= NV40_VP_INST_INDEX_CONST;
+ if (src->addr_reg)
+ shader->inst[0] |= NV40_VP_INST_ADDR_REG_SELECT_1;
+ else
+ shader->inst[0] &= ~NV40_VP_INST_ADDR_REG_SELECT_1;
+ shader->inst[0] &= ~NV40_VP_INST_ADDR_SWZ_MASK;
+ shader->inst[0] |= (src->addr_comp << NV40_VP_INST_ADDR_SWZ_SHIFT);
+ } else
+ shader->inst[3] &= ~NV40_VP_INST_INDEX_CONST;
+ break;
+ case NVS_FILE_TEMP:
+ hw |= (NV40_VP_SRC_REG_TYPE_TEMP << NV40_VP_SRC_REG_TYPE_SHIFT);
+ hw |= (src->index << NV40_VP_SRC_TEMP_SRC_SHIFT);
+ break;
+ default:
+ fprintf(stderr, "unknown source file %d\n", src->file);
+ assert(0);
+ break;
+ }
+
+ if (src->file != NVS_FILE_ADDRESS) {
+ if (src->negate)
+ hw |= NV40_VP_SRC_NEGATE;
+ if (src->abs)
+ shader->inst[0] |= (1 << (21 + pos));
+ else
+ shader->inst[0] &= ~(1 << (21 + pos));
+ hw |= (src->swizzle[0] << NV40_VP_SRC_SWZ_X_SHIFT);
+ hw |= (src->swizzle[1] << NV40_VP_SRC_SWZ_Y_SHIFT);
+ hw |= (src->swizzle[2] << NV40_VP_SRC_SWZ_Z_SHIFT);
+ hw |= (src->swizzle[3] << NV40_VP_SRC_SWZ_W_SHIFT);
+
+ NV40VPInsertSource(shader, hw, pos);
+ }
+}
+
+static void
+NV40VPInitInstruction(nvsFunc *shader)
+{
+ unsigned int hwsrc = 0;
+
+ shader->inst[0] = /*NV40_VP_INST_VEC_RESULT | */
+ NV40_VP_INST_VEC_DEST_TEMP_MASK | (1<<20);
+ shader->inst[1] = 0;
+ shader->inst[2] = 0;
+ shader->inst[3] = NV40_VP_INST_SCA_RESULT |
+ NV40_VP_INST_SCA_DEST_TEMP_MASK |
+ NV40_VP_INST_DEST_MASK;
+
+ hwsrc = (NV40_VP_SRC_REG_TYPE_INPUT << NV40_VP_SRC_REG_TYPE_SHIFT) |
+ (NVS_SWZ_X << NV40_VP_SRC_SWZ_X_SHIFT) |
+ (NVS_SWZ_Y << NV40_VP_SRC_SWZ_Y_SHIFT) |
+ (NVS_SWZ_Z << NV40_VP_SRC_SWZ_Z_SHIFT) |
+ (NVS_SWZ_W << NV40_VP_SRC_SWZ_W_SHIFT);
+ NV40VPInsertSource(shader, hwsrc, 0);
+ NV40VPInsertSource(shader, hwsrc, 1);
+ NV40VPInsertSource(shader, hwsrc, 2);
+}
+
+static void
+NV40VPSetLastInst(nvsFunc *shader)
+{
+ shader->inst[3] |= 1;
+}
+
+/*****************************************************************************
+ * Disassembly routines
+ */
+static int
+NV40VPHasMergedInst(nvsFunc * shader)
+{
+ if (shader->GetOpcodeHW(shader, 0) != NV40_VP_INST_OP_NOP &&
+ shader->GetOpcodeHW(shader, 1) != NV40_VP_INST_OP_NOP)
+ return 1;
+ return 0;
+}
+
+static unsigned int
+NV40VPGetOpcodeHW(nvsFunc * shader, int slot)
+{
+ int op;
+
+ if (slot)
+ op = (shader->inst[1] & NV40_VP_INST_SCA_OPCODE_MASK)
+ >> NV40_VP_INST_SCA_OPCODE_SHIFT;
+ else
+ op = (shader->inst[1] & NV40_VP_INST_VEC_OPCODE_MASK)
+ >> NV40_VP_INST_VEC_OPCODE_SHIFT;
+
+ return op;
+}
+
+static nvsRegFile
+NV40VPGetDestFile(nvsFunc * shader, int merged)
+{
+ nvsOpcode op;
+
+ op = shader->GetOpcode(shader, merged);
+ switch (op) {
+ case NVS_OP_ARL:
+ case NVS_OP_ARR:
+ case NVS_OP_ARA:
+ case NVS_OP_POPA:
+ return NVS_FILE_ADDRESS;
+ default:
+ if (shader->GetOpcodeSlot(shader, merged)) {
+ if (shader->inst[3] & NV40_VP_INST_SCA_RESULT)
+ return NVS_FILE_RESULT;
+ }
+ else {
+ if (shader->inst[0] & NV40_VP_INST_VEC_RESULT)
+ return NVS_FILE_RESULT;
+ }
+ return NVS_FILE_TEMP;
+ }
+
+}
+
+static unsigned int
+NV40VPGetDestID(nvsFunc * shader, int merged)
+{
+ int id;
+
+ switch (shader->GetDestFile(shader, merged)) {
+ case NVS_FILE_RESULT:
+ id = ((shader->inst[3] & NV40_VP_INST_DEST_MASK)
+ >> NV40_VP_INST_DEST_SHIFT);
+ switch (id) {
+ case NV40_VP_INST_DEST_POS : return NVS_FR_POSITION;
+ case NV40_VP_INST_DEST_COL0: return NVS_FR_COL0;
+ case NV40_VP_INST_DEST_COL1: return NVS_FR_COL1;
+ case NV40_VP_INST_DEST_BFC0: return NVS_FR_BFC0;
+ case NV40_VP_INST_DEST_BFC1: return NVS_FR_BFC1;
+ case NV40_VP_INST_DEST_FOGC: {
+ int mask = shader->GetDestMask(shader, merged);
+ switch (mask) {
+ case SMASK_X: return NVS_FR_FOGCOORD;
+ case SMASK_Y: return NVS_FR_CLIP0;
+ case SMASK_Z: return NVS_FR_CLIP1;
+ case SMASK_W: return NVS_FR_CLIP2;
+ default:
+ printf("more than 1 mask component set in FOGC writemask!\n");
+ return NVS_FR_UNKNOWN;
+ }
+ }
+ case NV40_VP_INST_DEST_PSZ:
+ {
+ int mask = shader->GetDestMask(shader, merged);
+ switch (mask) {
+ case SMASK_X: return NVS_FR_POINTSZ;
+ case SMASK_Y: return NVS_FR_CLIP3;
+ case SMASK_Z: return NVS_FR_CLIP4;
+ case SMASK_W: return NVS_FR_CLIP5;
+ default:
+ printf("more than 1 mask component set in PSZ writemask!\n");
+ return NVS_FR_UNKNOWN;
+ }
+ }
+ case NV40_VP_INST_DEST_TC(0): return NVS_FR_TEXCOORD0;
+ case NV40_VP_INST_DEST_TC(1): return NVS_FR_TEXCOORD1;
+ case NV40_VP_INST_DEST_TC(2): return NVS_FR_TEXCOORD2;
+ case NV40_VP_INST_DEST_TC(3): return NVS_FR_TEXCOORD3;
+ case NV40_VP_INST_DEST_TC(4): return NVS_FR_TEXCOORD4;
+ case NV40_VP_INST_DEST_TC(5): return NVS_FR_TEXCOORD5;
+ case NV40_VP_INST_DEST_TC(6): return NVS_FR_TEXCOORD6;
+ case NV40_VP_INST_DEST_TC(7): return NVS_FR_TEXCOORD7;
+ default:
+ return -1;
+ }
+ case NVS_FILE_ADDRESS:
+ /* Instructions that write address regs are encoded as if
+ * they would write temps.
+ */
+ case NVS_FILE_TEMP:
+ if (shader->GetOpcodeSlot(shader, merged))
+ id = ((shader->inst[3] & NV40_VP_INST_SCA_DEST_TEMP_MASK)
+ >> NV40_VP_INST_SCA_DEST_TEMP_SHIFT);
+ else
+ id = ((shader->inst[0] & NV40_VP_INST_VEC_DEST_TEMP_MASK)
+ >> NV40_VP_INST_VEC_DEST_TEMP_SHIFT);
+ return id;
+ default:
+ return -1;
+ }
+}
+
+static unsigned int
+NV40VPGetDestMask(nvsFunc * shader, int merged)
+{
+ unsigned int mask = 0;
+
+ if (shader->GetOpcodeSlot(shader, merged)) {
+ if (shader->inst[3] & NV40_VP_INST_SCA_WRITEMASK_X) mask |= SMASK_X;
+ if (shader->inst[3] & NV40_VP_INST_SCA_WRITEMASK_Y) mask |= SMASK_Y;
+ if (shader->inst[3] & NV40_VP_INST_SCA_WRITEMASK_Z) mask |= SMASK_Z;
+ if (shader->inst[3] & NV40_VP_INST_SCA_WRITEMASK_W) mask |= SMASK_W;
+ } else {
+ if (shader->inst[3] & NV40_VP_INST_VEC_WRITEMASK_X) mask |= SMASK_X;
+ if (shader->inst[3] & NV40_VP_INST_VEC_WRITEMASK_Y) mask |= SMASK_Y;
+ if (shader->inst[3] & NV40_VP_INST_VEC_WRITEMASK_Z) mask |= SMASK_Z;
+ if (shader->inst[3] & NV40_VP_INST_VEC_WRITEMASK_W) mask |= SMASK_W;
+ }
+
+ return mask;
+}
+
+static unsigned int
+NV40VPGetSourceHW(nvsFunc * shader, int merged, int pos)
+{
+ struct _op_xlat *opr;
+ unsigned int src;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr)
+ return -1;
+
+ switch (opr->srcpos[pos]) {
+ case 0:
+ src = ((shader->inst[1] & NV40_VP_INST_SRC0H_MASK)
+ >> NV40_VP_INST_SRC0H_SHIFT)
+ << NV40_VP_SRC0_HIGH_SHIFT;
+ src |= ((shader->inst[2] & NV40_VP_INST_SRC0L_MASK)
+ >> NV40_VP_INST_SRC0L_SHIFT);
+ break;
+ case 1:
+ src = ((shader->inst[2] & NV40_VP_INST_SRC1_MASK)
+ >> NV40_VP_INST_SRC1_SHIFT);
+ break;
+ case 2:
+ src = ((shader->inst[2] & NV40_VP_INST_SRC2H_MASK)
+ >> NV40_VP_INST_SRC2H_SHIFT)
+ << NV40_VP_SRC2_HIGH_SHIFT;
+ src |= ((shader->inst[3] & NV40_VP_INST_SRC2L_MASK)
+ >> NV40_VP_INST_SRC2L_SHIFT);
+ break;
+ default:
+ src = -1;
+ }
+
+ return src;
+}
+
+static nvsRegFile
+NV40VPGetSourceFile(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+ struct _op_xlat *opr;
+ int file;
+
+ opr = shader->GetOPTXRec(shader, merged);
+ if (!opr || opr->srcpos[pos] == -1)
+ return -1;
+
+ switch (opr->srcpos[pos]) {
+ case SPOS_ADDRESS: return NVS_FILE_ADDRESS;
+ default:
+ src = shader->GetSourceHW(shader, merged, pos);
+ file = (src & NV40_VP_SRC_REG_TYPE_MASK) >> NV40_VP_SRC_REG_TYPE_SHIFT;
+
+ switch (file) {
+ case NV40_VP_SRC_REG_TYPE_TEMP : return NVS_FILE_TEMP;
+ case NV40_VP_SRC_REG_TYPE_INPUT: return NVS_FILE_ATTRIB;
+ case NV40_VP_SRC_REG_TYPE_CONST: return NVS_FILE_CONST;
+ default:
+ return NVS_FILE_UNKNOWN;
+ }
+ }
+}
+
+static int
+NV40VPGetSourceID(nvsFunc * shader, int merged, int pos)
+{
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_ATTRIB:
+ switch ((shader->inst[1] & NV40_VP_INST_INPUT_SRC_MASK)
+ >> NV40_VP_INST_INPUT_SRC_SHIFT) {
+ case NV40_VP_INST_IN_POS: return NVS_FR_POSITION;
+ case NV40_VP_INST_IN_WEIGHT: return NVS_FR_WEIGHT;
+ case NV40_VP_INST_IN_NORMAL: return NVS_FR_NORMAL;
+ case NV40_VP_INST_IN_COL0: return NVS_FR_COL0;
+ case NV40_VP_INST_IN_COL1: return NVS_FR_COL1;
+ case NV40_VP_INST_IN_FOGC: return NVS_FR_FOGCOORD;
+ case NV40_VP_INST_IN_TC(0): return NVS_FR_TEXCOORD0;
+ case NV40_VP_INST_IN_TC(1): return NVS_FR_TEXCOORD1;
+ case NV40_VP_INST_IN_TC(2): return NVS_FR_TEXCOORD2;
+ case NV40_VP_INST_IN_TC(3): return NVS_FR_TEXCOORD3;
+ case NV40_VP_INST_IN_TC(4): return NVS_FR_TEXCOORD4;
+ case NV40_VP_INST_IN_TC(5): return NVS_FR_TEXCOORD5;
+ case NV40_VP_INST_IN_TC(6): return NVS_FR_TEXCOORD6;
+ case NV40_VP_INST_IN_TC(7): return NVS_FR_TEXCOORD7;
+ default:
+ return -1;
+ }
+ break;
+ case NVS_FILE_CONST:
+ return ((shader->inst[1] & NV40_VP_INST_CONST_SRC_MASK)
+ >> NV40_VP_INST_CONST_SRC_SHIFT);
+ case NVS_FILE_TEMP:
+ {
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ return ((src & NV40_VP_SRC_TEMP_SRC_MASK) >>
+ NV40_VP_SRC_TEMP_SRC_SHIFT);
+ }
+ default:
+ return -1;
+ }
+}
+
+static int
+NV40VPGetSourceNegate(nvsFunc * shader, int merged, int pos)
+{
+ unsigned int src;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+
+ if (src == -1)
+ return -1;
+ return ((src & NV40_VP_SRC_NEGATE) ? 1 : 0);
+}
+
+static void
+NV40VPGetSourceSwizzle(nvsFunc * shader, int merged, int pos, nvsSwzComp *swz)
+{
+ unsigned int src;
+ int swzbits;
+
+ src = shader->GetSourceHW(shader, merged, pos);
+ swzbits = (src & NV40_VP_SRC_SWZ_ALL_MASK) >> NV40_VP_SRC_SWZ_ALL_SHIFT;
+ NV20VPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV40VPGetSourceIndexed(nvsFunc * shader, int merged, int pos)
+{
+ switch (shader->GetSourceFile(shader, merged, pos)) {
+ case NVS_FILE_ATTRIB:
+ return ((shader->inst[0] & NV40_VP_INST_INDEX_INPUT) ? 1 : 0);
+ case NVS_FILE_CONST:
+ return ((shader->inst[3] & NV40_VP_INST_INDEX_CONST) ? 1 : 0);
+ default:
+ return 0;
+ }
+}
+
+static nvsSwzComp
+NV40VPGetAddressRegSwizzle(nvsFunc * shader)
+{
+ nvsSwzComp swz;
+
+ swz = NV20VP_TX_SWIZZLE[(shader->inst[0] & NV40_VP_INST_ADDR_SWZ_MASK)
+ >> NV40_VP_INST_ADDR_SWZ_SHIFT];
+ return swz;
+}
+
+static int
+NV40VPSupportsConditional(nvsFunc * shader)
+{
+ /*FIXME: Is this true of all ops? */
+ return 1;
+}
+
+static int
+NV40VPGetConditionUpdate(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV40_VP_INST_COND_UPDATE_ENABLE) ? 1 : 0);
+}
+
+static int
+NV40VPGetConditionTest(nvsFunc * shader)
+{
+ int op;
+
+ /* The condition test is unconditionally enabled on some
+ * instructions. ie: the condition test bit does *NOT* have
+ * to be set.
+ *
+ * FIXME: check other relevant ops for this situation.
+ */
+ op = shader->GetOpcodeHW(shader, 1);
+ switch (op) {
+ case NV40_VP_INST_OP_BRA:
+ return 1;
+ default:
+ return ((shader->inst[0] & NV40_VP_INST_COND_TEST_ENABLE) ? 1 : 0);
+ }
+}
+
+static nvsCond
+NV40VPGetCondition(nvsFunc * shader)
+{
+ int cond;
+
+ cond = ((shader->inst[0] & NV40_VP_INST_COND_MASK)
+ >> NV40_VP_INST_COND_SHIFT);
+
+ switch (cond) {
+ case NV40_VP_INST_COND_FL: return NVS_COND_FL;
+ case NV40_VP_INST_COND_LT: return NVS_COND_LT;
+ case NV40_VP_INST_COND_EQ: return NVS_COND_EQ;
+ case NV40_VP_INST_COND_LE: return NVS_COND_LE;
+ case NV40_VP_INST_COND_GT: return NVS_COND_GT;
+ case NV40_VP_INST_COND_NE: return NVS_COND_NE;
+ case NV40_VP_INST_COND_GE: return NVS_COND_GE;
+ case NV40_VP_INST_COND_TR: return NVS_COND_TR;
+ default:
+ return NVS_COND_UNKNOWN;
+ }
+}
+
+static void
+NV40VPGetCondRegSwizzle(nvsFunc * shader, nvsSwzComp *swz)
+{
+ int swzbits;
+
+ swzbits = (shader->inst[0] & NV40_VP_INST_COND_SWZ_ALL_MASK)
+ >> NV40_VP_INST_COND_SWZ_ALL_SHIFT;
+ NV20VPTXSwizzle(swzbits, swz);
+}
+
+static int
+NV40VPGetCondRegID(nvsFunc * shader)
+{
+ return ((shader->inst[0] & NV40_VP_INST_COND_REG_SELECT_1) ? 1 : 0);
+}
+
+static int
+NV40VPGetBranch(nvsFunc * shader)
+{
+ int addr;
+
+ addr = ((shader->inst[2] & NV40_VP_INST_IADDRH_MASK)
+ >> NV40_VP_INST_IADDRH_SHIFT) << 3;
+ addr |= ((shader->inst[3] & NV40_VP_INST_IADDRL_MASK)
+ >> NV40_VP_INST_IADDRL_SHIFT);
+ return addr;
+}
+
+void
+NV40VPInitShaderFuncs(nvsFunc * shader)
+{
+ /* Inherit NV30 VP code, we share some of it */
+ NV30VPInitShaderFuncs(shader);
+
+ /* Limits */
+ shader->MaxInst = 4096;
+ shader->MaxAttrib = 16;
+ shader->MaxTemp = 32;
+ shader->MaxAddress = 2;
+ shader->MaxConst = 256;
+ shader->caps = SCAP_SRC_ABS;
+
+ /* Add extra opcodes for NV40+ */
+// MOD_OPCODE(NVVP_TX_VOP, NV40_VP_INST_OP_TXWHAT, NVS_OP_TEX , 0, 4, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV40_VP_INST_OP_PUSHA, NVS_OP_PUSHA, 3, -1, -1);
+ MOD_OPCODE(NVVP_TX_SOP, NV40_VP_INST_OP_POPA , NVS_OP_POPA , -1, -1, -1);
+
+ shader->InitInstruction = NV40VPInitInstruction;
+ shader->SupportsOpcode = NV40VPSupportsOpcode;
+ shader->SetOpcode = NV40VPSetOpcode;
+ shader->SetCCUpdate = NV40VPSetCCUpdate;
+ shader->SetCondition = NV40VPSetCondition;
+ shader->SetResult = NV40VPSetResult;
+ shader->SetSource = NV40VPSetSource;
+ shader->SetLastInst = NV40VPSetLastInst;
+
+ shader->HasMergedInst = NV40VPHasMergedInst;
+ shader->GetOpcodeHW = NV40VPGetOpcodeHW;
+
+ shader->GetDestFile = NV40VPGetDestFile;
+ shader->GetDestID = NV40VPGetDestID;
+ shader->GetDestMask = NV40VPGetDestMask;
+
+ shader->GetSourceHW = NV40VPGetSourceHW;
+ shader->GetSourceFile = NV40VPGetSourceFile;
+ shader->GetSourceID = NV40VPGetSourceID;
+ shader->GetSourceNegate = NV40VPGetSourceNegate;
+ shader->GetSourceSwizzle = NV40VPGetSourceSwizzle;
+ shader->GetSourceIndexed = NV40VPGetSourceIndexed;
+
+ shader->GetRelAddressSwizzle = NV40VPGetAddressRegSwizzle;
+
+ shader->SupportsConditional = NV40VPSupportsConditional;
+ shader->GetConditionUpdate = NV40VPGetConditionUpdate;
+ shader->GetConditionTest = NV40VPGetConditionTest;
+ shader->GetCondition = NV40VPGetCondition;
+ shader->GetCondRegSwizzle = NV40VPGetCondRegSwizzle;
+ shader->GetCondRegID = NV40VPGetCondRegID;
+
+ shader->GetBranch = NV40VPGetBranch;
+}
diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c
index 25e57133cc3..85798c16013 100644
--- a/src/mesa/drivers/dri/r128/r128_span.c
+++ b/src/mesa/drivers/dri/r128/r128_span.c
@@ -209,7 +209,7 @@ do { \
*/
#define WRITE_DEPTH_SPAN() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint i; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
r128scrn->spanOffset); \
@@ -228,7 +228,7 @@ do { \
#define WRITE_DEPTH_PIXELS() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint ox[MAX_WIDTH]; \
GLint oy[MAX_WIDTH]; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
@@ -309,7 +309,7 @@ do { \
*/
#define WRITE_STENCIL_SPAN() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint i; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
r128scrn->spanOffset); \
@@ -328,7 +328,7 @@ do { \
#define WRITE_STENCIL_PIXELS() \
do { \
- GLint buf[n]; \
+ GLuint buf[n]; \
GLint ox[MAX_WIDTH]; \
GLint oy[MAX_WIDTH]; \
GLuint *readbuf = (GLuint *)((GLubyte *)sPriv->pFB + \
diff --git a/src/mesa/drivers/dri/r200/.gitignore b/src/mesa/drivers/dri/r200/.gitignore
new file mode 100644
index 00000000000..3773d8ea73f
--- /dev/null
+++ b/src/mesa/drivers/dri/r200/.gitignore
@@ -0,0 +1,3 @@
+radeon_chipset.h
+radeon_screen.*
+server
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index a1533d7f3e4..fc6eb93daa8 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -86,21 +86,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int R200_DEBUG = (0);
#endif
-
-/* Return the width and height of the given buffer.
- */
-static void r200GetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- LOCK_HARDWARE( rmesa );
- *width = rmesa->dri.drawable->w;
- *height = rmesa->dri.drawable->h;
- UNLOCK_HARDWARE( rmesa );
-}
-
/* Return various strings for glGetString().
*/
static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
@@ -232,12 +217,8 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
*/
static void r200InitDriverFuncs( struct dd_function_table *functions )
{
- functions->GetBufferSize = r200GetBufferSize;
+ functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = r200GetString;
-
- functions->Error = NULL;
- functions->DrawPixels = NULL;
- functions->Bitmap = NULL;
}
static const struct dri_debug_control debug_control[] =
@@ -690,7 +671,13 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
if ( newCtx->dri.drawable != driDrawPriv ) {
driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
&newCtx->vbl_seq );
+ }
+
+ if ( newCtx->dri.drawable != driDrawPriv ||
+ newCtx->dri.readable != driReadPriv ) {
newCtx->dri.drawable = driDrawPriv;
+ newCtx->dri.readable = driReadPriv;
+
r200UpdateWindow( newCtx->glCtx );
r200UpdateViewportOffset( newCtx->glCtx );
}
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index 07b6d6e12db..44c67b68cbc 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -107,6 +107,8 @@ struct r200_vertex_program {
VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6];
int pos_end;
int inputs[VERT_ATTRIB_MAX];
+ int rev_inputs[16];
+ int gen_inputs_mapped;
int native;
int fogpidx;
int fogmode;
@@ -699,6 +701,7 @@ struct r200_dri_mirror {
__DRIcontextPrivate *context; /* DRI context */
__DRIscreenPrivate *screen; /* DRI screen */
__DRIdrawablePrivate *drawable; /* DRI drawable bound to this ctx */
+ __DRIdrawablePrivate *readable; /* DRI readable bound to this ctx */
drm_context_t hwContext;
drm_hw_lock_t *hwLock;
@@ -725,19 +728,21 @@ struct r200_tcl_info {
GLint last_offset;
GLuint hw_primitive;
-/* FIXME: what's the maximum number of components? */
- struct r200_dma_region *aos_components[11];
+/* hw can handle 12 components max */
+ struct r200_dma_region *aos_components[12];
GLuint nr_aos_components;
GLuint *Elts;
struct r200_dma_region indexed_verts;
+ struct r200_dma_region weight;
struct r200_dma_region obj;
struct r200_dma_region rgba;
struct r200_dma_region spec;
struct r200_dma_region fog;
struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
struct r200_dma_region norm;
+ struct r200_dma_region generic[16];
};
diff --git a/src/mesa/drivers/dri/r200/r200_fragshader.c b/src/mesa/drivers/dri/r200/r200_fragshader.c
index 7993e3015a4..5dd3adaef69 100644
--- a/src/mesa/drivers/dri/r200/r200_fragshader.c
+++ b/src/mesa/drivers/dri/r200/r200_fragshader.c
@@ -132,10 +132,10 @@ static void r200UpdateFSArith( GLcontext *ctx )
R200_STATECHANGE( rmesa, afs[1] );
if (shader->NumPasses < 2) {
- afs_cmd = rmesa->hw.afs[1].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd;
}
else {
- afs_cmd = rmesa->hw.afs[0].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[0].cmd;
}
for (pass = 0; pass < shader->NumPasses; pass++) {
GLuint opnum = 0;
@@ -317,7 +317,7 @@ static void r200UpdateFSArith( GLcontext *ctx )
SET_INST(opnum, 1), SET_INST_2(opnum, 1));*/
opnum++;
}
- afs_cmd = rmesa->hw.afs[1].cmd;
+ afs_cmd = (GLuint *) rmesa->hw.afs[1].cmd;
}
rmesa->afs_loaded = ctx->ATIFragmentShader.Current;
}
@@ -362,7 +362,7 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
if (shader->NumPasses < 2) {
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
R200_STATECHANGE( rmesa, tex[reg] );
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@ -385,15 +385,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_x |= R200_TEXCOORD_PROJ;
}
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
- shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
+ shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
txformat_x |= R200_TEXCOORD_NONPROJ;
}
else {
@@ -401,16 +402,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
- /* is this a good idea? Could potentially sample from not enabled unit.
- results are probably undefined anyway (?) but I hope it doesn't lock up... */
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
+ /* enabling texturing when unit isn't correctly configured may not be safe */
+ if (targetbit)
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
} else {
/* setup 1st pass */
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
R200_STATECHANGE( rmesa, tex[reg] );
GLuint txformat_multi = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@ -425,11 +426,12 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
+ rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_multi |= R200_PASS1_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_multi |= R200_PASS1_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
@@ -439,14 +441,15 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
- rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
+ if (targetbit)
+ rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = txformat_multi;
}
/* setup 2nd pass */
for (reg=0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current;
+ GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled;
if (shader->SetupInst[1][reg].Opcode) {
GLuint coord = shader->SetupInst[1][reg].src;
GLuint txformat = rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT]
@@ -463,15 +466,16 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_x |= R200_TEXCOORD_PROJ;
}
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (texObj->Target == GL_TEXTURE_3D) {
+ else if (targetbit == TEXTURE_3D_BIT) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
+ else if (targetbit == TEXTURE_CUBE_BIT) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STR_ATI ||
- shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
+ shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STQ_ATI) {
txformat_x |= R200_TEXCOORD_NONPROJ;
}
else {
@@ -488,7 +492,8 @@ static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
- rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
+ if (targetbit)
+ rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
}
diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c
index 66bb075864f..bcc0c916396 100644
--- a/src/mesa/drivers/dri/r200/r200_lock.c
+++ b/src/mesa/drivers/dri/r200/r200_lock.c
@@ -69,7 +69,8 @@ r200UpdatePageFlipping( r200ContextPtr rmesa )
*/
void r200GetLock( r200ContextPtr rmesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *readable = rmesa->dri.readable;
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
drm_radeon_sarea_t *sarea = rmesa->sarea;
int i;
@@ -84,17 +85,20 @@ void r200GetLock( r200ContextPtr rmesa, GLuint flags )
* Since the hardware state depends on having the latest drawable
* clip rects, all state checking must be done _after_ this call.
*/
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable );
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable );
+ }
- if ( rmesa->lastStamp != dPriv->lastStamp ) {
+ if ( rmesa->lastStamp != drawable->lastStamp ) {
r200UpdatePageFlipping( rmesa );
if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
r200SetCliprects( rmesa, GL_BACK_LEFT );
else
r200SetCliprects( rmesa, GL_FRONT_LEFT );
r200UpdateViewportOffset( rmesa->glCtx );
- driUpdateFramebufferSize(rmesa->glCtx, dPriv);
- rmesa->lastStamp = dPriv->lastStamp;
+ driUpdateFramebufferSize(rmesa->glCtx, drawable);
+ rmesa->lastStamp = drawable->lastStamp;
}
R200_STATECHANGE( rmesa, ctx );
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 92348c90caa..270dc35a46a 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -385,8 +385,16 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
GLuint vfmt0 = 0, vfmt1 = 0;
GLuint count = VB->Count;
GLuint i;
-
- if (1) {
+ GLuint generic_in_mapped = 0;
+ struct r200_vertex_program *vp = NULL;
+
+ /* this looks way more complicated than necessary... */
+ if (ctx->VertexProgram._Enabled) {
+ vp = rmesa->curr_vp_hw;
+ generic_in_mapped = vp->gen_inputs_mapped;
+ }
+
+ if (inputs & VERT_BIT_POS) {
if (!rmesa->tcl.obj.buf)
emit_vector( ctx,
&rmesa->tcl.obj,
@@ -404,7 +412,33 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
}
component[nr++] = &rmesa->tcl.obj;
}
-
+ else if (generic_in_mapped & (1 << 0)) {
+ int geninput = vp->rev_inputs[0] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ }
+
+ if (inputs & VERT_BIT_WEIGHT) {
+ if (!rmesa->tcl.weight.buf)
+ emit_vector( ctx,
+ &rmesa->tcl.weight,
+ (char *)VB->AttribPtr[VERT_ATTRIB_WEIGHT]->data,
+ VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size,
+ VB->AttribPtr[VERT_ATTRIB_WEIGHT]->stride,
+ count);
+
+ assert(VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size <= 4);
+ vfmt0 |= VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size << R200_VTX_WEIGHT_COUNT_SHIFT;
+ component[nr++] = &rmesa->tcl.weight;
+ }
if (inputs & VERT_BIT_NORMAL) {
if (!rmesa->tcl.norm.buf)
@@ -464,6 +498,23 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
component[nr++] = &rmesa->tcl.rgba;
}
+/* vfmt0 |= R200_VTX_PK_RGBA << R200_VTX_COLOR_0_SHIFT;
+ emit_ubyte_rgba( ctx, &rmesa->tcl.rgba,
+ (char *)VB->ColorPtr[0]->data, 4,
+ VB->ColorPtr[0]->stride, count);*/
+ else if (generic_in_mapped & (1 << 2)) {
+ int geninput = vp->rev_inputs[2] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT;
+ }
if (inputs & VERT_BIT_COLOR1) {
@@ -481,8 +532,49 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
vfmt0 |= R200_VTX_FP_RGB << R200_VTX_COLOR_1_SHIFT;
component[nr++] = &rmesa->tcl.spec;
}
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
+ else if (generic_in_mapped & (1 << 3)) {
+ int geninput = vp->rev_inputs[3] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT;
+ }
+
+ if (generic_in_mapped & (1 << 4)) {
+ int geninput = vp->rev_inputs[4] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_2_SHIFT;
+ }
+
+ if (generic_in_mapped & (1 << 5)) {
+ int geninput = vp->rev_inputs[5] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_3_SHIFT;
+ }
+
+ for ( i = 0 ; i < 6 ; i++ ) {
if (inputs & (VERT_BIT_TEX0 << i)) {
if (!rmesa->tcl.tex[i].buf)
emit_vector( ctx,
@@ -495,8 +587,82 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
vfmt1 |= VB->TexCoordPtr[i]->size << (i * 3);
component[nr++] = &rmesa->tcl.tex[i];
}
+ else if (generic_in_mapped & (1 << (i + 6))) {
+ int geninput = vp->rev_inputs[i + 6] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (i * 3));
+ }
}
+ if (generic_in_mapped & (1 << 13)) {
+ int geninput = vp->rev_inputs[13] - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->data,
+ 4,
+ VB->AttribPtr[geninput + VERT_ATTRIB_GENERIC0]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1;
+ }
+
+/* doesn't work. Wrong order with mixed generic & conventional! */
+/*
+ if (ctx->VertexProgram._Enabled) {
+ int *vp_inputs = rmesa->curr_vp_hw->inputs;
+ for ( i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++ ) {
+ if (inputs & (1 << i)) {
+ int geninput = i - VERT_ATTRIB_GENERIC0;
+ if (!rmesa->tcl.generic[geninput].buf) {
+ emit_vector( ctx,
+ &(rmesa->tcl.generic[geninput]),
+ (char *)VB->AttribPtr[i]->data,
+ 4,
+ VB->AttribPtr[i]->stride,
+ count );
+ }
+ component[nr++] = &rmesa->tcl.generic[geninput];
+ switch (vp_inputs[i]) {
+ case 0:
+ vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ vfmt0 |= R200_VTX_FP_RGBA << (R200_VTX_COLOR_0_SHIFT + (vp_inputs[i] - 2) * 2);
+ break;
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ vfmt1 |= 4 << (R200_VTX_TEX0_COMP_CNT_SHIFT + (vp_inputs[i] - 6) * 3);
+ break;
+ case 13:
+ vfmt0 |= R200_VTX_XY1 | R200_VTX_Z1 | R200_VTX_W1;
+ break;
+ case 1:
+ case 12:
+ default:
+ assert(0);
+ }
+ }
+ }
+ }
+*/
+
if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||
vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) {
R200_STATECHANGE( rmesa, vtx );
@@ -520,9 +686,12 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
if (newinputs & VERT_BIT_POS)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
+ if (newinputs & VERT_BIT_WEIGHT)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.weight, __FUNCTION__ );
+
if (newinputs & VERT_BIT_NORMAL)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
-
+
if (newinputs & VERT_BIT_FOG)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.fog, __FUNCTION__ );
@@ -536,4 +705,14 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
if (newinputs & VERT_BIT_TEX(unit))
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.tex[unit], __FUNCTION__ );
}
+
+ if (ctx->VertexProgram._Enabled) {
+ int i;
+ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
+ if (newinputs & (1 << i))
+ r200ReleaseDmaRegion( rmesa,
+ &rmesa->tcl.generic[i - VERT_ATTRIB_GENERIC0], __FUNCTION__ );
+ }
+ }
+
}
diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c
index ca5b926a944..3f2a8665309 100644
--- a/src/mesa/drivers/dri/r200/r200_sanity.c
+++ b/src/mesa/drivers/dri/r200/r200_sanity.c
@@ -978,7 +978,7 @@ static int radeon_emit_veclinear(
}
}
else if ((start >= 0x180) && (start < 0x1c0)) {
- for (i = start ; (i < start + sz) ; i += 4) {
+ for (i = 0 ; i < sz ; i += 4) {
fprintf(stderr, "R200_VS_PROG %d OPDST %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i]);
fprintf(stderr, "R200_VS_PROG %d SRC1 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+1]);
fprintf(stderr, "R200_VS_PROG %d SRC2 %08x\n", (i >> 2) + start - 0x180 + 0x40, data[i+2]);
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index e68f1e30f3a..bab767838d8 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "enums.h"
#include "colormac.h"
#include "light.h"
+#include "framebuffer.h"
#include "swrast/swrast.h"
#include "vbo/vbo.h"
@@ -1844,23 +1845,26 @@ static void r200LogicOpCode( GLcontext *ctx, GLenum opcode )
void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
{
- __DRIdrawablePrivate *dPriv = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
+ __DRIdrawablePrivate *const readable = rmesa->dri.readable;
+ GLframebuffer *const draw_fb = (GLframebuffer*) drawable->driverPrivate;
+ GLframebuffer *const read_fb = (GLframebuffer*) readable->driverPrivate;
switch ( mode ) {
case GL_FRONT_LEFT:
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->pClipRects;
break;
case GL_BACK_LEFT:
/* Can't ignore 2d windows if we are page flipping.
*/
- if ( dPriv->numBackClipRects == 0 || rmesa->doPageFlip ) {
- rmesa->numClipRects = dPriv->numClipRects;
- rmesa->pClipRects = dPriv->pClipRects;
+ if ( drawable->numBackClipRects == 0 || rmesa->doPageFlip ) {
+ rmesa->numClipRects = drawable->numClipRects;
+ rmesa->pClipRects = drawable->pClipRects;
}
else {
- rmesa->numClipRects = dPriv->numBackClipRects;
- rmesa->pClipRects = dPriv->pBackClipRects;
+ rmesa->numClipRects = drawable->numBackClipRects;
+ rmesa->pClipRects = drawable->pBackClipRects;
}
break;
default:
@@ -1868,6 +1872,21 @@ void r200SetCliprects( r200ContextPtr rmesa, GLenum mode )
return;
}
+ if ((draw_fb->Width != drawable->w) || (draw_fb->Height != drawable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, draw_fb,
+ drawable->w, drawable->h);
+ draw_fb->Initialized = GL_TRUE;
+ }
+
+ if (drawable != readable) {
+ if ((read_fb->Width != readable->w) ||
+ (read_fb->Height != readable->h)) {
+ _mesa_resize_framebuffer(rmesa->glCtx, read_fb,
+ readable->w, readable->h);
+ read_fb->Initialized = GL_TRUE;
+ }
+ }
+
if (rmesa->state.scissor.enabled)
r200RecalcScissorRects( rmesa );
}
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 0b3bb281e01..62c335a707f 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -384,7 +384,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
r200ContextPtr rmesa = R200_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
+ GLuint inputs = 0;
GLuint i;
/* TODO: separate this from the swtnl pipeline
@@ -404,6 +404,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
r200ValidateState( ctx );
if (!ctx->VertexProgram._Enabled) {
+ inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
/* NOTE: inputs != tnl->render_inputs - these are the untransformed
* inputs.
*/
@@ -436,11 +437,13 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
We only need to change compsel. */
GLuint out_compsel = 0;
GLuint vp_out = rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten;
+#if 0
/* can't handle other inputs, generic attribs etc. currently - should never arrive here */
assert ((rmesa->curr_vp_hw->mesa_program.Base.InputsRead &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
VERT_BIT_TEX3 | VERT_BIT_TEX4 | VERT_BIT_TEX5)) == 0);
+#endif
inputs |= rmesa->curr_vp_hw->mesa_program.Base.InputsRead;
assert(vp_out & (1 << VERT_RESULT_HPOS));
out_compsel = R200_OUTPUT_XYZW;
@@ -577,7 +580,7 @@ static void transition_to_hwtnl( GLcontext *ctx )
rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] &= ~R200_FOG_USE_MASK;
rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR] |= R200_FOG_USE_VTX_FOG;
}
-
+
R200_STATECHANGE( rmesa, vte );
rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] &= ~(R200_VTX_XY_FMT|R200_VTX_Z_FMT);
rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] |= R200_VTX_W0_FMT;
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 397b27ae52e..875d3bab73f 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -1178,7 +1178,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa,
r200TexObjPtr texobj )
{
/* do not use RADEON_DB_STATE to avoid stale texture caches */
- GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
+ int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
R200_STATECHANGE( rmesa, tex[unit] );
@@ -1199,7 +1199,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa,
}
if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
+ int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
GLuint bytesPerFace = texobj->base.totalSize / 6;
ASSERT(texobj->base.totalSize % 6 == 0);
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 9ac7a96827a..491701b796e 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -404,6 +404,9 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
unsigned long hw_op;
int dofogfix = 0;
int fog_temp_i = 0;
+ int free_inputs;
+ int free_inputs_conv;
+ int array_count = 0;
vp->native = GL_FALSE;
vp->translated = GL_TRUE;
@@ -412,6 +415,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
if (mesa_vp->Base.NumInstructions == 0)
return GL_FALSE;
+#if 0
if ((mesa_vp->Base.InputsRead &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
@@ -422,6 +426,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
}
return GL_FALSE;
}
+#endif
if ((mesa_vp->Base.OutputsWritten &
~((1 << VERT_RESULT_HPOS) | (1 << VERT_RESULT_COL0) | (1 << VERT_RESULT_COL1) |
@@ -470,35 +475,87 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
else
mesa_vp->Base.NumNativeParameters = 0;
- for(i=0; i < VERT_ATTRIB_MAX; i++)
+ for(i = 0; i < VERT_ATTRIB_MAX; i++)
vp->inputs[i] = -1;
+ free_inputs = 0x2ffd;
+
/* fglrx uses fixed inputs as follows for conventional attribs.
- generic attribs use non-fixed assignment, fglrx will always use the lowest attrib values available.
- There are 12 generic attribs possible, corresponding to attrib 0, 2-11 and 13 in a hw vertex prog.
- attr 1 and 12 are not available for generic attribs as those cannot be made vec4 (correspond to
- vertex normal/weight)
+ generic attribs use non-fixed assignment, fglrx will always use the
+ lowest attrib values available. We'll just do the same.
+ There are 12 generic attribs possible, corresponding to attrib 0, 2-11
+ and 13 in a hw vertex prog.
+ attr 1 and 12 aren't used for generic attribs as those cannot be made vec4
+ (correspond to vertex normal/weight - maybe weight actually could be made vec4).
+ Additionally, not more than 12 arrays in total are possible I think.
attr 0 is pos, R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0
attr 2-5 use colors 0-3 (R200_VTX_FP_RGBA << R200_VTX_COLOR_0/1/2/3_SHIFT in R200_SE_VTX_FMT_0)
attr 6-11 use tex 0-5 (4 << R200_VTX_TEX0/1/2/3/4/5_COMP_CNT_SHIFT in R200_SE_VTX_FMT_1)
attr 13 uses vtx1 pos (R200_VTX_XY1|R200_VTX_Z1|R200_VTX_W1 in R200_SE_VTX_FMT_0)
- generic attribs would require some more work (dma regions, renaming). */
+*/
-/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
- vp->inputs[VERT_ATTRIB_POS] = 0;
- vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
- vp->inputs[VERT_ATTRIB_NORMAL] = 1;
- vp->inputs[VERT_ATTRIB_COLOR0] = 2;
- vp->inputs[VERT_ATTRIB_COLOR1] = 3;
- vp->inputs[VERT_ATTRIB_FOG] = 15;
- vp->inputs[VERT_ATTRIB_TEX0] = 6;
- vp->inputs[VERT_ATTRIB_TEX1] = 7;
- vp->inputs[VERT_ATTRIB_TEX2] = 8;
- vp->inputs[VERT_ATTRIB_TEX3] = 9;
- vp->inputs[VERT_ATTRIB_TEX4] = 10;
- vp->inputs[VERT_ATTRIB_TEX5] = 11;
/* attr 4,5 and 13 are only used with generic attribs.
Haven't seen attr 14 used, maybe that's for the hw pointsize vec1 (which is
not possibe to use with vertex progs as it is lacking in vert prog specification) */
+/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
+ if (mesa_vp->Base.InputsRead & VERT_BIT_POS) {
+ vp->inputs[VERT_ATTRIB_POS] = 0;
+ free_inputs &= ~(1 << 0);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_WEIGHT) {
+ vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_NORMAL) {
+ vp->inputs[VERT_ATTRIB_NORMAL] = 1;
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR0) {
+ vp->inputs[VERT_ATTRIB_COLOR0] = 2;
+ free_inputs &= ~(1 << 2);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR1) {
+ vp->inputs[VERT_ATTRIB_COLOR1] = 3;
+ free_inputs &= ~(1 << 3);
+ array_count++;
+ }
+ if (mesa_vp->Base.InputsRead & VERT_BIT_FOG) {
+ vp->inputs[VERT_ATTRIB_FOG] = 15; array_count++;
+ }
+ for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX5; i++) {
+ if (mesa_vp->Base.InputsRead & (1 << i)) {
+ vp->inputs[i] = i - VERT_ATTRIB_TEX0 + 6;
+ free_inputs &= ~(1 << (i - VERT_ATTRIB_TEX0 + 6));
+ array_count++;
+ }
+ }
+ free_inputs_conv = free_inputs;
+ /* using VERT_ATTRIB_TEX6/7 would be illegal */
+ /* completely ignore aliasing? */
+ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
+ int j;
+ /* completely ignore aliasing? */
+ if (mesa_vp->Base.InputsRead & (1 << i)) {
+ array_count++;
+ if (array_count > 12) {
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "more than 12 attribs used in vert prog\n");
+ }
+ return GL_FALSE;
+ }
+ for (j = 0; j < 14; j++) {
+ /* will always find one due to limited array_count */
+ if (free_inputs & (1 << j)) {
+ free_inputs &= ~(1 << j);
+ vp->inputs[i] = j;
+ vp->rev_inputs[j] = i;
+ break;
+ }
+ }
+ }
+ }
+ vp->gen_inputs_mapped = free_inputs ^ free_inputs_conv;
if (!(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) {
if (R200_DEBUG & DEBUG_FALLBACKS) {
@@ -506,6 +563,12 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
}
return GL_FALSE;
}
+ if (free_inputs & 1) {
+ if (R200_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "can't handle vert prog without position input\n");
+ }
+ return GL_FALSE;
+ }
o_inst = vp->instr;
for (vpi = mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
@@ -1145,6 +1208,9 @@ r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
r200_translate_vertex_program(ctx, vp);
rmesa->curr_vp_hw = NULL;
break;
+ case GL_FRAGMENT_SHADER_ATI:
+ rmesa->afs_loaded = NULL;
+ break;
}
/* need this for tcl fallbacks */
_tnl_program_string(ctx, target, prog);
diff --git a/src/mesa/drivers/dri/r300/.gitignore b/src/mesa/drivers/dri/r300/.gitignore
new file mode 100644
index 00000000000..3773d8ea73f
--- /dev/null
+++ b/src/mesa/drivers/dri/r300/.gitignore
@@ -0,0 +1,3 @@
+radeon_chipset.h
+radeon_screen.*
+server
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 02ffbfcbefb..02f8e9107d8 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -552,6 +552,7 @@ struct r300_stencilbuffer_state {
/* Can be tested with colormat currently. */
#define VSF_MAX_FRAGMENT_TEMPS (14)
+#define STATE_R300_WINDOW_DIMENSION (STATE_INTERNAL_DRIVER+0)
struct r300_vertex_shader_fragment {
int length;
@@ -595,7 +596,8 @@ struct r300_vertex_shader_state {
extern int hw_tcl_on;
-#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current)
+//#define CURRENT_VERTEX_SHADER(ctx) (ctx->VertexProgram._Current)
+#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->selected_vp)
/* Should but doesnt work */
//#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->curr_vp)
@@ -610,15 +612,22 @@ extern int hw_tcl_on;
/* r300_vertex_shader_state and r300_vertex_program should probably be merged together someday.
* Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly.
*/
+
+struct r300_vertex_program_key {
+ GLuint InputsRead;
+ GLuint OutputsWritten;
+};
+
struct r300_vertex_program {
- struct gl_vertex_program mesa_program; /* Must be first */
+ struct r300_vertex_program *next;
+ struct r300_vertex_program_key key;
int translated;
struct r300_vertex_shader_fragment program;
- struct r300_vertex_shader_fragment params;
int pos_end;
int num_temporaries; /* Number of temp vars used by program */
+ int wpos_idx;
int inputs[VERT_ATTRIB_MAX];
int outputs[VERT_RESULT_MAX];
int native;
@@ -626,6 +635,12 @@ struct r300_vertex_program {
int use_ref_count;
};
+struct r300_vertex_program_cont {
+ struct gl_vertex_program mesa_program; /* Must be first */
+ struct r300_vertex_shader_fragment params;
+ struct r300_vertex_program *progs;
+};
+
#define PFS_MAX_ALU_INST 64
#define PFS_MAX_TEX_INST 64
#define PFS_MAX_TEX_INDIRECT 4
@@ -800,6 +815,7 @@ struct r300_context {
struct r300_cmdbuf cmdbuf;
struct r300_state state;
struct gl_vertex_program *curr_vp;
+ struct r300_vertex_program *selected_vp;
/* Vertex buffers
*/
@@ -857,9 +873,9 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim);
-void r300_translate_vertex_shader(struct r300_vertex_program *vp);
+extern void r300_select_vertex_shader(r300ContextPtr r300);
extern void r300InitShaderFuncs(struct dd_function_table *functions);
-extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst);
+extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst);
extern int r300Fallback(GLcontext *ctx);
extern void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, struct vertex_buffer *vb);
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index 91ec4f855c2..6e85f0b5ddc 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -28,14 +28,14 @@
/*
* Authors:
* Ben Skeggs <[email protected]>
+ * Jerome Glisse <[email protected]>
*/
/*TODO'S
*
- * - COS/SIN/SCS/LIT instructions
+ * - COS/SIN/SCS instructions
* - Depth write, WPOS/FOGC inputs
* - FogOption
- * - Negate on individual components (implement in swizzle code?)
* - Verify results of opcodes for accuracy, I've only checked them
* in specific cases.
* - and more...
@@ -51,18 +51,110 @@
#include "r300_fragprog.h"
#include "r300_reg.h"
+/*
+ * Usefull macros and values
+ */
+#define ERROR(fmt, args...) do { \
+ fprintf(stderr, "%s::%s(): " fmt "\n", \
+ __FILE__, __func__, ##args); \
+ rp->error = GL_TRUE; \
+ } while(0)
+
#define PFS_INVAL 0xFFFFFFFF
#define COMPILE_STATE struct r300_pfs_compile_state *cs = rp->cs
-static void dump_program(struct r300_fragment_program *rp);
-static void emit_arith(struct r300_fragment_program *rp, int op,
- pfs_reg_t dest, int mask,
- pfs_reg_t src0, pfs_reg_t src1, pfs_reg_t src2,
- int flags);
+#define SWIZZLE_XYZ 0
+#define SWIZZLE_XXX 1
+#define SWIZZLE_YYY 2
+#define SWIZZLE_ZZZ 3
+#define SWIZZLE_WWW 4
+#define SWIZZLE_YZX 5
+#define SWIZZLE_ZXY 6
+#define SWIZZLE_WZY 7
+#define SWIZZLE_111 8
+#define SWIZZLE_000 9
+#define SWIZZLE_HHH 10
+
+#define swizzle(r, x, y, z, w) do_swizzle(rp, r, \
+ ((SWIZZLE_##x<<0)| \
+ (SWIZZLE_##y<<3)| \
+ (SWIZZLE_##z<<6)| \
+ (SWIZZLE_##w<<9)), \
+ 0)
-/***************************************
- * begin: useful data structions for fragment program generation
- ***************************************/
+#define REG_TYPE_INPUT 0
+#define REG_TYPE_OUTPUT 1
+#define REG_TYPE_TEMP 2
+#define REG_TYPE_CONST 3
+
+#define REG_TYPE_SHIFT 0
+#define REG_INDEX_SHIFT 2
+#define REG_VSWZ_SHIFT 8
+#define REG_SSWZ_SHIFT 13
+#define REG_NEGV_SHIFT 18
+#define REG_NEGS_SHIFT 19
+#define REG_ABS_SHIFT 20
+#define REG_NO_USE_SHIFT 21
+#define REG_VALID_SHIFT 22
+
+#define REG_TYPE_MASK (0x03 << REG_TYPE_SHIFT)
+#define REG_INDEX_MASK (0x3F << REG_INDEX_SHIFT)
+#define REG_VSWZ_MASK (0x1F << REG_VSWZ_SHIFT)
+#define REG_SSWZ_MASK (0x1F << REG_SSWZ_SHIFT)
+#define REG_NEGV_MASK (0x01 << REG_NEGV_SHIFT)
+#define REG_NEGS_MASK (0x01 << REG_NEGS_SHIFT)
+#define REG_ABS_MASK (0x01 << REG_ABS_SHIFT)
+#define REG_NO_USE_MASK (0x01 << REG_NO_USE_SHIFT)
+#define REG_VALID_MASK (0x01 << REG_VALID_SHIFT)
+
+#define REG(type, index, vswz, sswz, nouse, valid) \
+ (((type << REG_TYPE_SHIFT) & REG_TYPE_MASK) | \
+ ((index << REG_INDEX_SHIFT) & REG_INDEX_MASK) | \
+ ((nouse << REG_NO_USE_SHIFT) & REG_NO_USE_MASK) | \
+ ((valid << REG_VALID_SHIFT) & REG_VALID_MASK) | \
+ ((vswz << REG_VSWZ_SHIFT) & REG_VSWZ_MASK) | \
+ ((sswz << REG_SSWZ_SHIFT) & REG_SSWZ_MASK))
+#define REG_GET_TYPE(reg) \
+ ((reg & REG_TYPE_MASK) >> REG_TYPE_SHIFT)
+#define REG_GET_INDEX(reg) \
+ ((reg & REG_INDEX_MASK) >> REG_INDEX_SHIFT)
+#define REG_GET_VSWZ(reg) \
+ ((reg & REG_VSWZ_MASK) >> REG_VSWZ_SHIFT)
+#define REG_GET_SSWZ(reg) \
+ ((reg & REG_SSWZ_MASK) >> REG_SSWZ_SHIFT)
+#define REG_GET_NO_USE(reg) \
+ ((reg & REG_NO_USE_MASK) >> REG_NO_USE_SHIFT)
+#define REG_GET_VALID(reg) \
+ ((reg & REG_VALID_MASK) >> REG_VALID_SHIFT)
+#define REG_SET_TYPE(reg, type) \
+ reg = ((reg & ~REG_TYPE_MASK) | \
+ ((type << REG_TYPE_SHIFT) & REG_TYPE_MASK))
+#define REG_SET_INDEX(reg, index) \
+ reg = ((reg & ~REG_INDEX_MASK) | \
+ ((index << REG_INDEX_SHIFT) & REG_INDEX_MASK))
+#define REG_SET_VSWZ(reg, vswz) \
+ reg = ((reg & ~REG_VSWZ_MASK) | \
+ ((vswz << REG_VSWZ_SHIFT) & REG_VSWZ_MASK))
+#define REG_SET_SSWZ(reg, sswz) \
+ reg = ((reg & ~REG_SSWZ_MASK) | \
+ ((sswz << REG_SSWZ_SHIFT) & REG_SSWZ_MASK))
+#define REG_SET_NO_USE(reg, nouse) \
+ reg = ((reg & ~REG_NO_USE_MASK) | \
+ ((nouse << REG_NO_USE_SHIFT) & REG_NO_USE_MASK))
+#define REG_SET_VALID(reg, valid) \
+ reg = ((reg & ~REG_VALID_MASK) | \
+ ((valid << REG_VALID_SHIFT) & REG_VALID_MASK))
+#define REG_ABS(reg) \
+ reg = (reg | REG_ABS_MASK)
+#define REG_NEGV(reg) \
+ reg = (reg | REG_NEGV_MASK)
+#define REG_NEGS(reg) \
+ reg = (reg | REG_NEGS_MASK)
+
+
+/*
+ * Datas structures for fragment program generation
+ */
/* description of r300 native hw instructions */
static const struct {
@@ -86,20 +178,19 @@ static const struct {
{ "CMPH", 3, R300_FPI0_OUTC_CMPH, PFS_INVAL },
};
-#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, \
- SWIZZLE_##y, \
- SWIZZLE_##z, \
- SWIZZLE_ZERO))
-
-#define SLOT_VECTOR (1<<0)
-#define SLOT_SCALAR (1<<3)
-#define SLOT_BOTH (SLOT_VECTOR|SLOT_SCALAR)
/* vector swizzles r300 can support natively, with a couple of
* cases we handle specially
*
- * pfs_reg_t.v_swz/pfs_reg_t.s_swz is an index into this table
- **/
+ * REG_VSWZ/REG_SSWZ is an index into this table
+ */
+#define SLOT_VECTOR (1<<0)
+#define SLOT_SCALAR (1<<3)
+#define SLOT_BOTH (SLOT_VECTOR | SLOT_SCALAR)
+#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, \
+ SWIZZLE_##y, \
+ SWIZZLE_##z, \
+ SWIZZLE_ZERO))
static const struct r300_pfs_swizzle {
GLuint hash; /* swizzle value this matches */
GLuint base; /* base value for hw swizzle */
@@ -120,39 +211,29 @@ static const struct r300_pfs_swizzle {
{ PFS_INVAL, R300_FPI0_ARGC_HALF, 0, 0},
{ PFS_INVAL, 0, 0, 0},
};
-#define SWIZZLE_XYZ 0
-#define SWIZZLE_XXX 1
-#define SWIZZLE_YYY 2
-#define SWIZZLE_ZZZ 3
-#define SWIZZLE_WWW 4
-#define SWIZZLE_YZX 5
-#define SWIZZLE_ZXY 6
-#define SWIZZLE_WZY 7
-#define SWIZZLE_111 8
-#define SWIZZLE_000 9
-#define SWIZZLE_HHH 10
+/* used during matching of non-native swizzles */
#define SWZ_X_MASK (7 << 0)
#define SWZ_Y_MASK (7 << 3)
#define SWZ_Z_MASK (7 << 6)
#define SWZ_W_MASK (7 << 9)
-/* used during matching of non-native swizzles */
static const struct {
- GLuint hash; /* used to mask matching swizzle components */
+ GLuint hash; /* used to mask matching swizzle components */
int mask; /* actual outmask */
int count; /* count of components matched */
} s_mask[] = {
- { SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK, 1|2|4, 3},
- { SWZ_X_MASK|SWZ_Y_MASK, 1|2, 2},
- { SWZ_X_MASK|SWZ_Z_MASK, 1|4, 2},
- { SWZ_Y_MASK|SWZ_Z_MASK, 2|4, 2},
- { SWZ_X_MASK, 1, 1},
- { SWZ_Y_MASK, 2, 1},
- { SWZ_Z_MASK, 4, 1},
- { PFS_INVAL, PFS_INVAL, PFS_INVAL}
+ { SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK, 1|2|4, 3},
+ { SWZ_X_MASK|SWZ_Y_MASK, 1|2, 2},
+ { SWZ_X_MASK|SWZ_Z_MASK, 1|4, 2},
+ { SWZ_Y_MASK|SWZ_Z_MASK, 2|4, 2},
+ { SWZ_X_MASK, 1, 1},
+ { SWZ_Y_MASK, 2, 1},
+ { SWZ_Z_MASK, 4, 1},
+ { PFS_INVAL, PFS_INVAL, PFS_INVAL}
};
/* mapping from SWIZZLE_* to r300 native values for scalar insns */
+#define SWIZZLE_HALF 6
static const struct {
int base; /* hw value of swizzle */
int stride; /* difference between SRC0/1/2 */
@@ -166,58 +247,51 @@ static const struct {
{ R300_FPI2_ARGA_ONE , 0, 0 },
{ R300_FPI2_ARGA_HALF , 0, 0 }
};
-#define SWIZZLE_HALF 6
/* boiler-plate reg, for convenience */
-static const pfs_reg_t undef = {
- type: REG_TYPE_TEMP,
- index: 0,
- v_swz: SWIZZLE_XYZ,
- s_swz: SWIZZLE_W,
- negate_v: 0,
- negate_s: 0,
- absolute: 0,
- no_use: GL_FALSE,
- valid: GL_FALSE
-};
+static const GLuint undef = REG(REG_TYPE_TEMP,
+ 0,
+ SWIZZLE_XYZ,
+ SWIZZLE_W,
+ GL_FALSE,
+ GL_FALSE);
/* constant one source */
-static const pfs_reg_t pfs_one = {
- type: REG_TYPE_CONST,
- index: 0,
- v_swz: SWIZZLE_111,
- s_swz: SWIZZLE_ONE,
- valid: GL_TRUE
-};
+static const GLuint pfs_one = REG(REG_TYPE_CONST,
+ 0,
+ SWIZZLE_111,
+ SWIZZLE_ONE,
+ GL_FALSE,
+ GL_TRUE);
/* constant half source */
-static const pfs_reg_t pfs_half = {
- type: REG_TYPE_CONST,
- index: 0,
- v_swz: SWIZZLE_HHH,
- s_swz: SWIZZLE_HALF,
- valid: GL_TRUE
-};
+static const GLuint pfs_half = REG(REG_TYPE_CONST,
+ 0,
+ SWIZZLE_HHH,
+ SWIZZLE_HALF,
+ GL_FALSE,
+ GL_TRUE);
/* constant zero source */
-static const pfs_reg_t pfs_zero = {
- type: REG_TYPE_CONST,
- index: 0,
- v_swz: SWIZZLE_000,
- s_swz: SWIZZLE_ZERO,
- valid: GL_TRUE
-};
-
-/***************************************
- * end: data structures
- ***************************************/
+static const GLuint pfs_zero = REG(REG_TYPE_CONST,
+ 0,
+ SWIZZLE_000,
+ SWIZZLE_ZERO,
+ GL_FALSE,
+ GL_TRUE);
-#define ERROR(fmt, args...) do { \
- fprintf(stderr, "%s::%s(): " fmt "\n",\
- __FILE__, __func__, ##args); \
- rp->error = GL_TRUE; \
-} while(0)
+/*
+ * Common functions prototypes
+ */
+static void dump_program(struct r300_fragment_program *rp);
+static void emit_arith(struct r300_fragment_program *rp, int op,
+ GLuint dest, int mask,
+ GLuint src0, GLuint src1, GLuint src2,
+ int flags);
+/*
+ * Helper functions prototypes
+ */
static int get_hw_temp(struct r300_fragment_program *rp)
{
COMPILE_STATE;
@@ -256,266 +330,339 @@ static void free_hw_temp(struct r300_fragment_program *rp, int idx)
cs->hwreg_in_use &= ~(1<<idx);
}
-static pfs_reg_t get_temp_reg(struct r300_fragment_program *rp)
+static GLuint get_temp_reg(struct r300_fragment_program *rp)
{
COMPILE_STATE;
- pfs_reg_t r = undef;
+ GLuint r = undef;
+ GLuint index;
- r.index = ffs(~cs->temp_in_use);
- if (!r.index) {
+ index = ffs(~cs->temp_in_use);
+ if (!index) {
ERROR("Out of program temps\n");
return r;
}
- cs->temp_in_use |= (1 << --r.index);
-
- cs->temps[r.index].refcount = 0xFFFFFFFF;
- cs->temps[r.index].reg = -1;
- r.valid = GL_TRUE;
+
+ cs->temp_in_use |= (1 << --index);
+ cs->temps[index].refcount = 0xFFFFFFFF;
+ cs->temps[index].reg = -1;
+
+ REG_SET_TYPE(r, REG_TYPE_TEMP);
+ REG_SET_INDEX(r, index);
+ REG_SET_VALID(r, GL_TRUE);
return r;
}
-static pfs_reg_t get_temp_reg_tex(struct r300_fragment_program *rp)
+static GLuint get_temp_reg_tex(struct r300_fragment_program *rp)
{
COMPILE_STATE;
- pfs_reg_t r = undef;
+ GLuint r = undef;
+ GLuint index;
- r.index = ffs(~cs->temp_in_use);
- if (!r.index) {
+ index = ffs(~cs->temp_in_use);
+ if (!index) {
ERROR("Out of program temps\n");
return r;
}
- cs->temp_in_use |= (1 << --r.index);
-
- cs->temps[r.index].refcount = 0xFFFFFFFF;
- cs->temps[r.index].reg = get_hw_temp_tex(rp);
- r.valid = GL_TRUE;
+
+ cs->temp_in_use |= (1 << --index);
+ cs->temps[index].refcount = 0xFFFFFFFF;
+ cs->temps[index].reg = get_hw_temp_tex(rp);
+
+ REG_SET_TYPE(r, REG_TYPE_TEMP);
+ REG_SET_INDEX(r, index);
+ REG_SET_VALID(r, GL_TRUE);
return r;
}
-static void free_temp(struct r300_fragment_program *rp, pfs_reg_t r)
+static void free_temp(struct r300_fragment_program *rp, GLuint r)
{
COMPILE_STATE;
- if (!(cs->temp_in_use & (1<<r.index))) return;
+ GLuint index = REG_GET_INDEX(r);
+
+ if (!(cs->temp_in_use & (1 << index)))
+ return;
- if (r.type == REG_TYPE_TEMP) {
- free_hw_temp(rp, cs->temps[r.index].reg);
- cs->temps[r.index].reg = -1;
- cs->temp_in_use &= ~(1<<r.index);
- } else if (r.type == REG_TYPE_INPUT) {
- free_hw_temp(rp, cs->inputs[r.index].reg);
- cs->inputs[r.index].reg = -1;
+ if (REG_GET_TYPE(r) == REG_TYPE_TEMP) {
+ free_hw_temp(rp, cs->temps[index].reg);
+ cs->temps[index].reg = -1;
+ cs->temp_in_use &= ~(1 << index);
+ } else if (REG_GET_TYPE(r) == REG_TYPE_INPUT) {
+ free_hw_temp(rp, cs->inputs[index].reg);
+ cs->inputs[index].reg = -1;
}
}
-static pfs_reg_t emit_param4fv(struct r300_fragment_program *rp,
- GLfloat *values)
+static GLuint emit_param4fv(struct r300_fragment_program *rp,
+ GLfloat *values)
{
- pfs_reg_t r = undef;
- r.type = REG_TYPE_CONST;
+ GLuint r = undef;
+ GLuint index;
int pidx;
pidx = rp->param_nr++;
- r.index = rp->const_nr++;
- if (pidx >= PFS_NUM_CONST_REGS || r.index >= PFS_NUM_CONST_REGS) {
+ index = rp->const_nr++;
+ if (pidx >= PFS_NUM_CONST_REGS || index >= PFS_NUM_CONST_REGS) {
ERROR("Out of const/param slots!\n");
return r;
}
-
- rp->param[pidx].idx = r.index;
+
+ rp->param[pidx].idx = index;
rp->param[pidx].values = values;
rp->params_uptodate = GL_FALSE;
- r.valid = GL_TRUE;
+ REG_SET_TYPE(r, REG_TYPE_CONST);
+ REG_SET_INDEX(r, index);
+ REG_SET_VALID(r, GL_TRUE);
return r;
}
-static pfs_reg_t emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp)
+static GLuint emit_const4fv(struct r300_fragment_program *rp, GLfloat *cp)
{
- pfs_reg_t r = undef;
- r.type = REG_TYPE_CONST;
+ GLuint r = undef;
+ GLuint index;
- r.index = rp->const_nr++;
- if (r.index >= PFS_NUM_CONST_REGS) {
+ index = rp->const_nr++;
+ if (index >= PFS_NUM_CONST_REGS) {
ERROR("Out of hw constants!\n");
return r;
}
- COPY_4V(rp->constant[r.index], cp);
- r.valid = GL_TRUE;
+ COPY_4V(rp->constant[index], cp);
+
+ REG_SET_TYPE(r, REG_TYPE_CONST);
+ REG_SET_INDEX(r, index);
+ REG_SET_VALID(r, GL_TRUE);
return r;
}
-static __inline pfs_reg_t negate(pfs_reg_t r)
+static inline GLuint negate(GLuint r)
{
- r.negate_v = 1;
- r.negate_s = 1;
+ REG_NEGS(r);
+ REG_NEGV(r);
return r;
}
/* Hack, to prevent clobbering sources used multiple times when
* emulating non-native instructions
*/
-static __inline pfs_reg_t keep(pfs_reg_t r)
+static inline GLuint keep(GLuint r)
{
- r.no_use = GL_TRUE;
+ REG_SET_NO_USE(r, GL_TRUE);
return r;
}
-static __inline pfs_reg_t absolute(pfs_reg_t r)
+static inline GLuint absolute(GLuint r)
{
- r.absolute = 1;
+ REG_ABS(r);
return r;
}
static int swz_native(struct r300_fragment_program *rp,
- pfs_reg_t src, pfs_reg_t *r, GLuint arbneg)
+ GLuint src,
+ GLuint *r,
+ GLuint arbneg)
{
- /* Native swizzle, nothing to see here */
- src.negate_s = (arbneg >> 3) & 1;
+ /* Native swizzle, handle negation */
+ src = (src & ~REG_NEGS_MASK) |
+ (((arbneg >> 3) & 1) << REG_NEGS_SHIFT);
if ((arbneg & 0x7) == 0x0) {
- src.negate_v = 0;
+ src = src & ~REG_NEGV_MASK;
*r = src;
} else if ((arbneg & 0x7) == 0x7) {
- src.negate_v = 1;
+ src |= REG_NEGV_MASK;
*r = src;
} else {
- if (!r->valid)
+ if (!REG_GET_VALID(*r))
*r = get_temp_reg(rp);
- src.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, *r, arbneg & 0x7,
- keep(src), pfs_one, pfs_zero, 0);
- src.negate_v = 0;
- emit_arith(rp, PFS_OP_MAD, *r,
+ src |= REG_NEGV_MASK;
+ emit_arith(rp,
+ PFS_OP_MAD,
+ *r,
+ arbneg & 0x7,
+ keep(src),
+ pfs_one,
+ pfs_zero,
+ 0);
+ src = src & ~REG_NEGV_MASK;
+ emit_arith(rp,
+ PFS_OP_MAD,
+ *r,
(arbneg ^ 0x7) | WRITEMASK_W,
- src, pfs_one, pfs_zero, 0);
+ src,
+ pfs_one,
+ pfs_zero,
+ 0);
}
return 3;
}
-static int swz_emit_partial(struct r300_fragment_program *rp, pfs_reg_t src,
- pfs_reg_t *r, int mask, int mc, GLuint arbneg)
+static int swz_emit_partial(struct r300_fragment_program *rp,
+ GLuint src,
+ GLuint *r,
+ int mask,
+ int mc,
+ GLuint arbneg)
{
GLuint tmp;
GLuint wmask = 0;
- if (!r->valid)
+ if (!REG_GET_VALID(*r))
*r = get_temp_reg(rp);
- /* A partial match, src.v_swz/mask define what parts of the
- * desired swizzle we match */
+ /* A partial match, VSWZ/mask define what parts of the
+ * desired swizzle we match
+ */
if (mc + s_mask[mask].count == 3) {
wmask = WRITEMASK_W;
- src.negate_s = (arbneg >> 3) & 1;
+ src |= ((arbneg >> 3) & 1) << REG_NEGS_SHIFT;
}
tmp = arbneg & s_mask[mask].mask;
if (tmp) {
tmp = tmp ^ s_mask[mask].mask;
if (tmp) {
- src.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, *r,
+ emit_arith(rp,
+ PFS_OP_MAD,
+ *r,
arbneg & s_mask[mask].mask,
- keep(src), pfs_one, pfs_zero, 0);
- src.negate_v = 0;
- if (!wmask) src.no_use = GL_TRUE;
- else src.no_use = GL_FALSE;
- emit_arith(rp, PFS_OP_MAD, *r, tmp | wmask,
- src, pfs_one, pfs_zero, 0);
+ keep(src) | REG_NEGV_MASK,
+ pfs_one,
+ pfs_zero,
+ 0);
+ if (!wmask) {
+ REG_SET_NO_USE(src, GL_TRUE);
+ } else {
+ REG_SET_NO_USE(src, GL_FALSE);
+ }
+ emit_arith(rp,
+ PFS_OP_MAD,
+ *r,
+ tmp | wmask,
+ src,
+ pfs_one,
+ pfs_zero,
+ 0);
} else {
- src.negate_v = 1;
- if (!wmask) src.no_use = GL_TRUE;
- else src.no_use = GL_FALSE;
- emit_arith(rp, PFS_OP_MAD, *r,
+ if (!wmask) {
+ REG_SET_NO_USE(src, GL_TRUE);
+ } else {
+ REG_SET_NO_USE(src, GL_FALSE);
+ }
+ emit_arith(rp,
+ PFS_OP_MAD,
+ *r,
(arbneg & s_mask[mask].mask) | wmask,
- src, pfs_one, pfs_zero, 0);
- src.negate_v = 0;
+ src | REG_NEGV_MASK,
+ pfs_one,
+ pfs_zero,
+ 0);
}
} else {
- if (!wmask) src.no_use = GL_TRUE;
- else src.no_use = GL_FALSE;
- emit_arith(rp, PFS_OP_MAD, *r,
+ if (!wmask) {
+ REG_SET_NO_USE(src, GL_TRUE);
+ } else {
+ REG_SET_NO_USE(src, GL_FALSE);
+ }
+ emit_arith(rp, PFS_OP_MAD,
+ *r,
s_mask[mask].mask | wmask,
- src, pfs_one, pfs_zero, 0);
+ src,
+ pfs_one,
+ pfs_zero,
+ 0);
}
return s_mask[mask].count;
}
-#define swizzle(r, x, y, z, w) do_swizzle(rp, r, \
- ((SWIZZLE_##x<<0)| \
- (SWIZZLE_##y<<3)| \
- (SWIZZLE_##z<<6)| \
- (SWIZZLE_##w<<9)), \
- 0)
-
-static pfs_reg_t do_swizzle(struct r300_fragment_program *rp,
- pfs_reg_t src, GLuint arbswz, GLuint arbneg)
+static GLuint do_swizzle(struct r300_fragment_program *rp,
+ GLuint src,
+ GLuint arbswz,
+ GLuint arbneg)
{
- pfs_reg_t r = undef;
-
+ GLuint r = undef;
+ GLuint vswz;
int c_mask = 0;
- int v_matched = 0;
+ int v_match = 0;
/* If swizzling from something without an XYZW native swizzle,
* emit result to a temp, and do new swizzle from the temp.
*/
- if (src.v_swz != SWIZZLE_XYZ || src.s_swz != SWIZZLE_W) {
- pfs_reg_t temp = get_temp_reg(rp);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_XYZW, src, pfs_one,
- pfs_zero, 0);
+ if (REG_GET_VSWZ(src) != SWIZZLE_XYZ ||
+ REG_GET_SSWZ(src) != SWIZZLE_W) {
+ GLuint temp = get_temp_reg(rp);
+ emit_arith(rp,
+ PFS_OP_MAD,
+ temp,
+ WRITEMASK_XYZW,
+ src,
+ pfs_one,
+ pfs_zero,
+ 0);
src = temp;
}
- src.s_swz = GET_SWZ(arbswz, 3);
+
+ /* set scalar swizzling */
+ REG_SET_SSWZ(src, GET_SWZ(arbswz, 3));
do {
+ vswz = REG_GET_VSWZ(src);
do {
-#define CUR_HASH (v_swiz[src.v_swz].hash & s_mask[c_mask].hash)
- if (CUR_HASH == (arbswz & s_mask[c_mask].hash)) {
- if (s_mask[c_mask].count == 3)
- v_matched += swz_native(rp, src, &r,
+ int chash;
+
+ REG_SET_VSWZ(src, vswz);
+ chash = v_swiz[REG_GET_VSWZ(src)].hash &
+ s_mask[c_mask].hash;
+
+ if (chash == (arbswz & s_mask[c_mask].hash)) {
+ if (s_mask[c_mask].count == 3) {
+ v_match += swz_native(rp,
+ src,
+ &r,
arbneg);
- else
- v_matched += swz_emit_partial(rp, src,
- &r,
- c_mask,
- v_matched,
- arbneg);
-
- if (v_matched == 3)
+ } else {
+ v_match += swz_emit_partial(rp,
+ src,
+ &r,
+ c_mask,
+ v_match,
+ arbneg);
+ }
+
+ if (v_match == 3)
return r;
/* Fill with something invalid.. all 0's was
* wrong before, matched SWIZZLE_X. So all
- * 1's will be okay for now */
+ * 1's will be okay for now
+ */
arbswz |= (PFS_INVAL & s_mask[c_mask].hash);
}
- } while(v_swiz[++src.v_swz].hash != PFS_INVAL);
- src.v_swz = SWIZZLE_XYZ;
+ } while(v_swiz[++vswz].hash != PFS_INVAL);
+ REG_SET_VSWZ(src, SWIZZLE_XYZ);
} while (s_mask[++c_mask].hash != PFS_INVAL);
ERROR("should NEVER get here\n");
return r;
}
-
-static pfs_reg_t t_src(struct r300_fragment_program *rp,
- struct prog_src_register fpsrc)
+
+static GLuint t_src(struct r300_fragment_program *rp,
+ struct prog_src_register fpsrc)
{
- pfs_reg_t r = undef;
-#if 0
- pfs_reg_t n = undef;
-#endif
+ GLuint r = undef;
switch (fpsrc.File) {
case PROGRAM_TEMPORARY:
- r.index = fpsrc.Index;
- r.valid = GL_TRUE;
+ REG_SET_INDEX(r, fpsrc.Index);
+ REG_SET_VALID(r, GL_TRUE);
+ REG_SET_TYPE(r, REG_TYPE_TEMP);
break;
case PROGRAM_INPUT:
- r.index = fpsrc.Index;
- r.type = REG_TYPE_INPUT;
- r.valid = GL_TRUE;
+ REG_SET_INDEX(r, fpsrc.Index);
+ REG_SET_VALID(r, GL_TRUE);
+ REG_SET_TYPE(r, REG_TYPE_INPUT);
break;
case PROGRAM_LOCAL_PARAM:
r = emit_param4fv(rp,
@@ -536,72 +683,40 @@ static pfs_reg_t t_src(struct r300_fragment_program *rp,
}
/* no point swizzling ONE/ZERO/HALF constants... */
- if (r.v_swz < SWIZZLE_111 || r.s_swz < SWIZZLE_ZERO)
+ if (REG_GET_VSWZ(r) < SWIZZLE_111 || REG_GET_SSWZ(r) < SWIZZLE_ZERO)
r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase);
-#if 0
- /* WRONG! Need to be able to do individual component negation,
- * should probably handle this in the swizzling code unless
- * all components are negated, then we can do this natively */
- if ((fpsrc.NegateBase & 0xf) == 0xf)
- r.negate = GL_TRUE;
-
- r.negate_s = (fpsrc.NegateBase >> 3) & 1;
-
- if ((fpsrc.NegateBase & 0x7) == 0x0) {
- r.negate_v = 0;
- } else if ((fpsrc.NegateBase & 0x7) == 0x7) {
- r.negate_v = 1;
- } else {
- if (r.type != REG_TYPE_TEMP) {
- n = get_temp_reg(rp);
- emit_arith(rp, PFS_OP_MAD, n, 0x7 ^ fpsrc.NegateBase,
- keep(r), pfs_one, pfs_zero, 0);
- r.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, n,
- fpsrc.NegateBase & 0x7 | WRITEMASK_W,
- r, pfs_one, pfs_zero, 0);
- r.negate_v = 0;
- r = n;
- } else {
- r.negate_v = 1;
- emit_arith(rp, PFS_OP_MAD, r,
- fpsrc.NegateBase & 0x7 | WRITEMASK_W,
- r, pfs_one, pfs_zero, 0);
- r.negate_v = 0;
- }
- }
-#endif
-
return r;
}
-static pfs_reg_t t_scalar_src(struct r300_fragment_program *rp,
- struct prog_src_register fpsrc)
+static GLuint t_scalar_src(struct r300_fragment_program *rp,
+ struct prog_src_register fpsrc)
{
struct prog_src_register src = fpsrc;
int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */
-
+
src.Swizzle = ((sc<<0)|(sc<<3)|(sc<<6)|(sc<<9));
return t_src(rp, src);
}
-static pfs_reg_t t_dst(struct r300_fragment_program *rp,
- struct prog_dst_register dest) {
- pfs_reg_t r = undef;
+static GLuint t_dst(struct r300_fragment_program *rp,
+ struct prog_dst_register dest)
+{
+ GLuint r = undef;
switch (dest.File) {
case PROGRAM_TEMPORARY:
- r.index = dest.Index;
- r.valid = GL_TRUE;
+ REG_SET_INDEX(r, dest.Index);
+ REG_SET_VALID(r, GL_TRUE);
+ REG_SET_TYPE(r, REG_TYPE_TEMP);
return r;
case PROGRAM_OUTPUT:
- r.type = REG_TYPE_OUTPUT;
+ REG_SET_TYPE(r, REG_TYPE_OUTPUT);
switch (dest.Index) {
case FRAG_RESULT_COLR:
case FRAG_RESULT_DEPR:
- r.index = dest.Index;
- r.valid = GL_TRUE;
+ REG_SET_INDEX(r, dest.Index);
+ REG_SET_VALID(r, GL_TRUE);
return r;
default:
ERROR("Bad DstReg->Index 0x%x\n", dest.Index);
@@ -613,66 +728,77 @@ static pfs_reg_t t_dst(struct r300_fragment_program *rp,
}
}
-static int t_hw_src(struct r300_fragment_program *rp, pfs_reg_t src,
+static int t_hw_src(struct r300_fragment_program *rp,
+ GLuint src,
GLboolean tex)
{
COMPILE_STATE;
int idx;
+ int index = REG_GET_INDEX(src);
- switch (src.type) {
+ switch(REG_GET_TYPE(src)) {
case REG_TYPE_TEMP:
/* NOTE: if reg==-1 here, a source is being read that
- * hasn't been written to. Undefined results */
- if (cs->temps[src.index].reg == -1)
- cs->temps[src.index].reg = get_hw_temp(rp);
- idx = cs->temps[src.index].reg;
+ * hasn't been written to. Undefined results
+ */
+ if (cs->temps[index].reg == -1)
+ cs->temps[index].reg = get_hw_temp(rp);
+
+ idx = cs->temps[index].reg;
- if (!src.no_use && (--cs->temps[src.index].refcount == 0))
+ if (!REG_GET_NO_USE(src) &&
+ (--cs->temps[index].refcount == 0))
free_temp(rp, src);
break;
case REG_TYPE_INPUT:
- idx = cs->inputs[src.index].reg;
+ idx = cs->inputs[index].reg;
- if (!src.no_use && (--cs->inputs[src.index].refcount == 0))
- free_hw_temp(rp, cs->inputs[src.index].reg);
+ if (!REG_GET_NO_USE(src) &&
+ (--cs->inputs[index].refcount == 0))
+ free_hw_temp(rp, cs->inputs[index].reg);
break;
case REG_TYPE_CONST:
- return (src.index | SRC_CONST);
+ return (index | SRC_CONST);
default:
ERROR("Invalid type for source reg\n");
return (0 | SRC_CONST);
}
- if (!tex) cs->used_in_node |= (1 << idx);
+ if (!tex)
+ cs->used_in_node |= (1 << idx);
return idx;
}
-static int t_hw_dst(struct r300_fragment_program *rp, pfs_reg_t dest,
+static int t_hw_dst(struct r300_fragment_program *rp,
+ GLuint dest,
GLboolean tex)
{
COMPILE_STATE;
int idx;
- assert(dest.valid);
+ GLuint index = REG_GET_INDEX(dest);
+ assert(REG_GET_VALID(dest));
- switch (dest.type) {
+ switch(REG_GET_TYPE(dest)) {
case REG_TYPE_TEMP:
- if (cs->temps[dest.index].reg == -1) {
- if (!tex)
- cs->temps[dest.index].reg = get_hw_temp(rp);
- else
- cs->temps[dest.index].reg = get_hw_temp_tex(rp);
+ if (cs->temps[REG_GET_INDEX(dest)].reg == -1) {
+ if (!tex) {
+ cs->temps[index].reg = get_hw_temp(rp);
+ } else {
+ cs->temps[index].reg = get_hw_temp_tex(rp);
+ }
}
- idx = cs->temps[dest.index].reg;
+ idx = cs->temps[index].reg;
- if (!dest.no_use && (--cs->temps[dest.index].refcount == 0))
+ if (!REG_GET_NO_USE(dest) &&
+ (--cs->temps[index].refcount == 0))
free_temp(rp, dest);
cs->dest_in_node |= (1 << idx);
cs->used_in_node |= (1 << idx);
break;
case REG_TYPE_OUTPUT:
- switch (dest.index) {
+ switch(index) {
case FRAG_RESULT_COLR:
rp->node[rp->cur_node].flags |= R300_PFS_NODE_OUTPUT_COLOR;
break;
@@ -680,17 +806,18 @@ static int t_hw_dst(struct r300_fragment_program *rp, pfs_reg_t dest,
rp->node[rp->cur_node].flags |= R300_PFS_NODE_OUTPUT_DEPTH;
break;
}
- return dest.index;
+ return index;
break;
default:
- ERROR("invalid dest reg type %d\n", dest.type);
+ ERROR("invalid dest reg type %d\n", REG_GET_TYPE(dest));
return 0;
}
return idx;
}
-static void emit_nop(struct r300_fragment_program *rp, GLuint mask,
+static void emit_nop(struct r300_fragment_program *rp,
+ GLuint mask,
GLboolean sync)
{
COMPILE_STATE;
@@ -716,8 +843,8 @@ static void emit_tex(struct r300_fragment_program *rp,
int opcode)
{
COMPILE_STATE;
- pfs_reg_t coord = t_src(rp, fpi->SrcReg[0]);
- pfs_reg_t dest = undef, rdest = undef;
+ GLuint coord = t_src(rp, fpi->SrcReg[0]);
+ GLuint dest = undef, rdest = undef;
GLuint din = cs->dest_in_node, uin = cs->used_in_node;
int unit = fpi->TexSrcUnit;
int hwsrc, hwdest;
@@ -728,7 +855,7 @@ static void emit_tex(struct r300_fragment_program *rp,
dest = t_dst(rp, fpi->DstReg);
/* r300 doesn't seem to be able to do TEX->output reg */
- if (dest.type == REG_TYPE_OUTPUT) {
+ if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) {
rdest = dest;
dest = get_temp_reg_tex(rp);
}
@@ -740,7 +867,7 @@ static void emit_tex(struct r300_fragment_program *rp,
if (uin & (1 << hwdest)) {
free_hw_temp(rp, hwdest);
hwdest = get_hw_temp_tex(rp);
- cs->temps[dest.index].reg = hwdest;
+ cs->temps[REG_GET_INDEX(dest)].reg = hwdest;
}
} else {
hwdest = 0;
@@ -750,8 +877,8 @@ static void emit_tex(struct r300_fragment_program *rp,
/* Indirection if source has been written in this node, or if the
* dest has been read/written in this node
*/
- if ((coord.type != REG_TYPE_CONST && (din & (1<<hwsrc))) ||
- (uin & (1<<hwdest))) {
+ if ((REG_GET_TYPE(coord) != REG_TYPE_CONST &&
+ (din & (1<<hwsrc))) || (uin & (1<<hwdest))) {
/* Finish off current node */
cs->v_pos = cs->s_pos = MAX2(cs->v_pos, cs->s_pos);
@@ -791,13 +918,13 @@ static void emit_tex(struct r300_fragment_program *rp,
| (opcode << R300_FPITX_OPCODE_SHIFT);
cs->dest_in_node |= (1 << hwdest);
- if (coord.type != REG_TYPE_CONST)
+ if (REG_GET_TYPE(coord) != REG_TYPE_CONST)
cs->used_in_node |= (1 << hwsrc);
rp->node[rp->cur_node].tex_end++;
/* Copy from temp to output if needed */
- if (rdest.valid) {
+ if (REG_GET_VALID(rdest)) {
emit_arith(rp, PFS_OP_MAD, rdest, WRITEMASK_XYZW, dest,
pfs_one, pfs_zero, 0);
free_temp(rp, dest);
@@ -807,7 +934,9 @@ static void emit_tex(struct r300_fragment_program *rp,
/* Add sources to FPI1/FPI3 lists. If source is already on list,
* reuse the index instead of wasting a source.
*/
-static int add_src(struct r300_fragment_program *rp, int reg, int pos,
+static int add_src(struct r300_fragment_program *rp,
+ int reg,
+ int pos,
int srcmask)
{
COMPILE_STATE;
@@ -856,9 +985,12 @@ static int add_src(struct r300_fragment_program *rp, int reg, int pos,
* It's not necessary to force the first case, but it makes disassembled
* shaders easier to read.
*/
-static GLboolean force_same_slot(int vop, int sop,
- GLboolean emit_vop, GLboolean emit_sop,
- int argc, pfs_reg_t *src)
+static GLboolean force_same_slot(int vop,
+ int sop,
+ GLboolean emit_vop,
+ GLboolean emit_sop,
+ int argc,
+ GLuint *src)
{
int i;
@@ -870,20 +1002,24 @@ static GLboolean force_same_slot(int vop, int sop,
if (emit_vop) {
for (i=0;i<argc;i++)
- if (src[i].v_swz == SWIZZLE_WZY)
+ if (REG_GET_VSWZ(src[i]) == SWIZZLE_WZY)
return GL_TRUE;
}
return GL_FALSE;
}
-static void emit_arith(struct r300_fragment_program *rp, int op,
- pfs_reg_t dest, int mask,
- pfs_reg_t src0, pfs_reg_t src1, pfs_reg_t src2,
+static void emit_arith(struct r300_fragment_program *rp,
+ int op,
+ GLuint dest,
+ int mask,
+ GLuint src0,
+ GLuint src1,
+ GLuint src2,
int flags)
{
COMPILE_STATE;
- pfs_reg_t src[3] = { src0, src1, src2 };
+ GLuint src[3] = { src0, src1, src2 };
int hwsrc[3], sswz[3], vswz[3];
int hwdest;
GLboolean emit_vop = GL_FALSE, emit_sop = GL_FALSE;
@@ -900,7 +1036,8 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
if ((mask & WRITEMASK_W) || vop == R300_FPI0_OUTC_REPL_ALPHA)
emit_sop = GL_TRUE;
- if (dest.type == REG_TYPE_OUTPUT && dest.index == FRAG_RESULT_DEPR)
+ if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT &&
+ REG_GET_INDEX(dest) == FRAG_RESULT_DEPR)
emit_vop = GL_FALSE;
if (force_same_slot(vop, sop, emit_vop, emit_sop, argc, src)) {
@@ -916,12 +1053,12 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
*/
for (i=0;i<3;i++) {
if (emit_vop &&
- (v_swiz[src[i].v_swz].flags & SLOT_SCALAR)) {
+ (v_swiz[REG_GET_VSWZ(src[i])].flags & SLOT_SCALAR)) {
vpos = spos = MAX2(vpos, spos);
break;
}
if (emit_sop &&
- (s_swiz[src[i].s_swz].flags & SLOT_VECTOR)) {
+ (s_swiz[REG_GET_VSWZ(src[i])].flags & SLOT_VECTOR)) {
vpos = spos = MAX2(vpos, spos);
break;
}
@@ -945,20 +1082,22 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
if (emit_vop && vop != R300_FPI0_OUTC_REPL_ALPHA) {
srcpos = add_src(rp, hwsrc[i], vpos,
- v_swiz[src[i].v_swz].flags);
- vswz[i] = (v_swiz[src[i].v_swz].base +
- (srcpos * v_swiz[src[i].v_swz].stride)) |
- (src[i].negate_v ? ARG_NEG : 0) |
- (src[i].absolute ? ARG_ABS : 0);
+ v_swiz[REG_GET_VSWZ(src[i])].flags);
+ vswz[i] = (v_swiz[REG_GET_VSWZ(src[i])].base +
+ (srcpos *
+ v_swiz[REG_GET_VSWZ(src[i])].stride)) |
+ ((src[i] & REG_NEGV_MASK) ? ARG_NEG : 0) |
+ ((src[i] & REG_ABS_MASK) ? ARG_ABS : 0);
} else vswz[i] = R300_FPI0_ARGC_ZERO;
if (emit_sop) {
srcpos = add_src(rp, hwsrc[i], spos,
- s_swiz[src[i].s_swz].flags);
- sswz[i] = (s_swiz[src[i].s_swz].base +
- (srcpos * s_swiz[src[i].s_swz].stride)) |
- (src[i].negate_s ? ARG_NEG : 0) |
- (src[i].absolute ? ARG_ABS : 0);
+ s_swiz[REG_GET_SSWZ(src[i])].flags);
+ sswz[i] = (s_swiz[REG_GET_SSWZ(src[i])].base +
+ (srcpos *
+ s_swiz[REG_GET_SSWZ(src[i])].stride)) |
+ ((src[i] & REG_NEGS_MASK) ? ARG_NEG : 0) |
+ ((src[i] & REG_ABS_MASK) ? ARG_ABS : 0);
} else sswz[i] = R300_FPI2_ARGA_ZERO;
}
hwdest = t_hw_dst(rp, dest, GL_FALSE);
@@ -980,8 +1119,8 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
(vswz[2] << R300_FPI0_ARG2C_SHIFT);
rp->alu.inst[vpos].inst1 |= hwdest << R300_FPI1_DSTC_SHIFT;
- if (dest.type == REG_TYPE_OUTPUT) {
- if (dest.index == FRAG_RESULT_COLR) {
+ if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) {
+ if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) {
rp->alu.inst[vpos].inst1 |=
(mask & WRITEMASK_XYZ) << R300_FPI1_DSTC_OUTPUT_MASK_SHIFT;
} else assert(0);
@@ -1005,11 +1144,11 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
sswz[2] << R300_FPI2_ARG2A_SHIFT;
if (mask & WRITEMASK_W) {
- if (dest.type == REG_TYPE_OUTPUT) {
- if (dest.index == FRAG_RESULT_COLR) {
+ if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) {
+ if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) {
rp->alu.inst[spos].inst3 |=
(hwdest << R300_FPI3_DSTA_SHIFT) | R300_FPI3_DSTA_OUTPUT;
- } else if (dest.index == FRAG_RESULT_DEPR) {
+ } else if (REG_GET_INDEX(dest) == FRAG_RESULT_DEPR) {
rp->alu.inst[spos].inst3 |= R300_FPI3_DSTA_DEPTH;
} else assert(0);
} else {
@@ -1022,22 +1161,22 @@ static void emit_arith(struct r300_fragment_program *rp, int op,
rp->alu.inst[vpos].inst2 = NOP_INST2;
return;
-};
+}
#if 0
-static pfs_reg_t get_attrib(struct r300_fragment_program *rp, GLuint attr)
+static GLuint get_attrib(struct r300_fragment_program *rp, GLuint attr)
{
struct gl_fragment_program *mp = &rp->mesa_program;
- pfs_reg_t r = undef;
+ GLuint r = undef;
if (!(mp->Base.InputsRead & (1<<attr))) {
ERROR("Attribute %d was not provided!\n", attr);
return undef;
}
- r.type = REG_TYPE_INPUT;
- r.index = attr;
- r.valid = GL_TRUE;
+ REG_SET_TYPE(r, REG_TYPE_INPUT);
+ REG_SET_INDEX(r, attr);
+ REG_SET_VALID(r, GL_TRUE);
return r;
}
#endif
@@ -1047,8 +1186,8 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
struct gl_fragment_program *mp = &rp->mesa_program;
const struct prog_instruction *inst = mp->Base.Instructions;
struct prog_instruction *fpi;
- pfs_reg_t src[3], dest, temp;
- pfs_reg_t cnst;
+ GLuint src[3], dest, temp;
+ GLuint cnst;
int flags, mask = 0;
GLfloat cnstv[4] = {0.0, 0.0, 0.0, 0.0};
@@ -1094,7 +1233,64 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
flags);
break;
case OPCODE_COS:
- ERROR("COS not implemented\n");
+ /*
+ * cos using taylor serie:
+ * cos(x) = 1 - x^2/2! + x^4/4! - x^6/6!
+ */
+ temp = get_temp_reg(rp);
+ cnstv[0] = 0.5;
+ cnstv[1] = 0.041666667;
+ cnstv[2] = 0.001388889;
+ cnstv[4] = 0.0;
+ cnst = emit_const4fv(rp, cnstv);
+ src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
+
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ src[0],
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Y | WRITEMASK_Z,
+ temp, temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Z,
+ temp,
+ swizzle(temp, X, X, X, W),
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ temp, cnst,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ pfs_one,
+ pfs_one,
+ negate(temp),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ swizzle(temp, Y, Y, Y, W),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ negate(swizzle(temp, Z, Z, Z, W)),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, X, X, X, X),
+ pfs_one,
+ pfs_zero,
+ flags);
+ free_temp(rp, temp);
break;
case OPCODE_DP3:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1147,7 +1343,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
/* result.x = 1.0
* result.w = src1.w */
if (mask & WRITEMASK_XW) {
- src[1].v_swz = SWIZZLE_111; /* Cheat.. */
+ REG_SET_VSWZ(src[1], SWIZZLE_111); /*Cheat*/
emit_arith(rp, PFS_OP_MAD, dest,
mask & WRITEMASK_XW,
src[1], pfs_one, pfs_zero,
@@ -1351,7 +1547,70 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
free_temp(rp, temp);
break;
case OPCODE_SIN:
- ERROR("SIN not implemented\n");
+ /*
+ * sin using taylor serie:
+ * sin(x) = x - x^3/3! + x^5/5! - x^7/7!
+ */
+ temp = get_temp_reg(rp);
+ cnstv[0] = 0.333333333;
+ cnstv[1] = 0.008333333;
+ cnstv[2] = 0.000198413;
+ cnstv[4] = 0.0;
+ cnst = emit_const4fv(rp, cnstv);
+ src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
+
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ src[0],
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Y | WRITEMASK_Z,
+ temp, temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_Z,
+ temp,
+ swizzle(temp, X, X, X, W),
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ src[0],
+ temp,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_XYZ,
+ temp, cnst,
+ pfs_zero,
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ src[0],
+ pfs_one,
+ negate(temp),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ swizzle(temp, Y, Y, Y, W),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, temp,
+ WRITEMASK_X,
+ temp,
+ pfs_one,
+ negate(swizzle(temp, Z, Z, Z, W)),
+ flags);
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, X, X, X, X),
+ pfs_one,
+ pfs_zero,
+ flags);
+ free_temp(rp, temp);
break;
case OPCODE_SLT:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1470,6 +1729,13 @@ static void init_program(struct r300_fragment_program *rp)
}
InputsRead &= ~FRAG_BITS_TEX_ANY;
+ /* fragment position treated as a texcoord */
+ if (InputsRead & FRAG_BIT_WPOS) {
+ cs->inputs[FRAG_ATTRIB_WPOS].refcount = 0;
+ cs->inputs[FRAG_ATTRIB_WPOS].reg = get_hw_temp(rp);
+ }
+ InputsRead &= ~FRAG_BIT_WPOS;
+
/* Then primary colour */
if (InputsRead & FRAG_BIT_COL0) {
cs->inputs[FRAG_ATTRIB_COL0].refcount = 0;
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h
index 4bbaa07e012..b0cebe60bb0 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.h
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.h
@@ -41,6 +41,7 @@
#include "r300_context.h"
#include "program_instruction.h"
+#if 0
/* representation of a register for emit_arith/swizzle */
typedef struct _pfs_reg_t {
enum {
@@ -58,7 +59,7 @@ typedef struct _pfs_reg_t {
GLboolean no_use:1;
GLboolean valid:1;
} pfs_reg_t;
-
+#endif
typedef struct r300_fragment_program_swizzle {
GLuint length;
GLuint src[4];
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_swz.c b/src/mesa/drivers/dri/r300/r300_fragprog_swz.c
deleted file mode 100644
index b29331d7bde..00000000000
--- a/src/mesa/drivers/dri/r300/r300_fragprog_swz.c
+++ /dev/null
@@ -1,1328 +0,0 @@
-/*
- * Copyright (C) 2005 Jerome Glisse. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-#include "r300_fragprog.h"
-#include "r300_reg.h"
-
-
-#define I0_000 ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_ZERO) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_111 ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_ZERO) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG2C_SHIFT) )
-#define I0_XXX ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_XXX) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_YYY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_YYY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_ZZZ ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_ZZZ) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_XYZ ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_XYZ) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_YZX ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_YZX) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_ZXY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0C_ZXY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_WZY ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0CA_WZY) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-#define I0_WWW ( (R300_FPI0_OUTC_MAD) | \
- (R300_FPI0_ARGC_SRC0A) | \
- (R300_FPI0_ARGC_ONE << R300_FPI0_ARG1C_SHIFT) | \
- (R300_FPI0_ARGC_ZERO << R300_FPI0_ARG2C_SHIFT) )
-
-#define IEMPTY 0
-
-#define I1_XYZ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Y | \
- R300_FPI1_DSTC_REG_Z )
-#define I1_XY_ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Y )
-#define I1_X_Z ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X | \
- R300_FPI1_DSTC_REG_Z )
-#define I1__YZ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Y | \
- R300_FPI1_DSTC_REG_Z )
-#define I1_X__ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_X )
-#define I1__Y_ ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Y )
-#define I1___Z ( R300_FPI1_SRC1C_CONST | \
- R300_FPI1_SRC2C_CONST | \
- R300_FPI1_DSTC_REG_Z )
-
-#define SEMPTY {0,{0,0,0,0},{0,0,0,0,0,0,0,0}}
-
-struct r300_fragment_program_swizzle r300_swizzle [512] = {
- /* XXX */
- {1,{0,0,0,0},{ I0_XXX, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* YXX */
- {2,{0,0,0,0},{ I0_YZX, I1_X_Z,
- I0_XXX, I1__Y_,
- 0,0,
- 0,0 } },
- /* ZXX */
- {2,{0,0,0,0},{ I0_ZZZ, I1_X__,
- I0_XXX, I1__YZ,
- 0,0,
- 0,0 } },
- /* WXX */
- {2,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__YZ,
- 0,0,
- 0,0} },
- /* 0XX */
- {2,{0,2,0,0},{ I0_XXX, I1__YZ,
- I0_000, I1_X__,
- 0,0,
- 0,0 } },
- /* 1XX */
- {2,{0,2,0,0},{ I0_XXX, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XYX */
- {2,{0,0,0,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1_X_Z,
- 0,0,0,0}},
- /* YYX */
- {2,{0,0,0,0},{ I0_YYY, I1_XY_,
- I0_XXX, I1___Z,
- 0,0,0,0}},
- /* ZYX */
- {3,{0,0,0,0},{ I0_ZZZ, I1_X__,
- I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- 0,0}},
- /* WYX */
- {3,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- 0,0}},
- /* 0YX */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1YX */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_XXX, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XZX */
- {2,{0,0,0,0},{ I0_YZX, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZX */
- {1,{0,0,0,0},{ I0_YZX, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* ZZX */
- {2,{0,0,0,0},{ I0_YZX, I1__YZ,
- I0_ZZZ, I1_X__,0,0,0,0}},
- /* WZX */
- {2,{0,0,0,0},{ I0_WZY, I1_XY_,
- I0_XXX, I1___Z,0,0,0,0}},
- /* 0ZX */
- {2,{0,2,0,0},{ I0_YZX, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1ZX */
- {2,{0,2,0,0},{ I0_YZX, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWX */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_XXX, I1_X_Z,
- 0,0,0,0}},
- /* YWX */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_YZX, I1_X_Z,
- 0,0,0,0}},
- /* ZWX */
- {3,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_ZZZ, I1_X__,
- I0_XXX, I1___Z,
- 0,0}},
- /* WWX */
- {2,{0,0,0,0},{ I0_WWW, I1_XY_,
- I0_YZX, I1___Z,
- 0,0,0,0}},
- /* 0WX */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XXX, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1WX */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XXX, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X0X */
- {2,{0,2,0,0},{ I0_XXX, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* Y0X */
- {2,{0,2,0,0},{ I0_YZX, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* Z0X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1__Y_,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* W0X */
- {3,{0,0,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* 00X */
- {2,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1_XY_,
- 0,0,0,0}},
- /* 10X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_000, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1X */
- {2,{0,2,0,0},{ I0_XXX, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* Y1X */
- {2,{0,2,0,0},{ I0_YZX, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* Z1X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1__Y_,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* W1X */
- {3,{0,0,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* 01X */
- {3,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 11X */
- {2,{0,2,0,0},{ I0_XXX, I1___Z,
- I0_111, I1_XY_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXY */
- {2,{0,0,0,0},{ I0_YYY, I1___Z,
- I0_XXX, I1_XY_,
- 0,0,0,0}},
- /* YXY */
- {2,{0,0,0,0},{ I0_YYY, I1_X_Z,
- I0_XXX, I1__Y_,
- 0,0,0,0}},
- /* ZXY */
- {1,{0,0,0,0},{ I0_ZXY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* WXY */
- {2,{0,0,0,0},{ I0_WZY, I1_X__,
- I0_ZXY, I1__YZ,
- 0,0,0,0}},
- /* 0XY */
- {2,{0,0,0,0},{ I0_ZXY, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1XY */
- {2,{0,0,0,0},{ I0_ZXY, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XYY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YYY */
- {1,{0,0,0,0},{ I0_YYY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* ZYY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* WYY */
- {2,{0,0,0,0},{ I0_WZY, I1_XYZ,
- I0_YYY, I1__YZ,
- 0,0,0,0}},
- /* 0YY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1YY */
- {2,{0,0,0,0},{ I0_YYY, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* ZZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* WZY */
- {1,{0,0,0,0},{ I0_WZY, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* 0ZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1ZY */
- {2,{0,0,0,0},{ I0_WZY, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWY */
- {3,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_XXX, I1_X__,
- I0_YYY, I1___Z,
- 0,0}},
- /* YWY */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_YYY, I1_X_Z,
- 0,0,0,0}},
- /* ZWY */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_ZXY, I1_X_Z,
- 0,0,0,0}},
- /* WWY */
- {2,{0,0,0,0},{ I0_WWW, I1_XY_,
- I0_ZXY, I1___Z,
- 0,0,0,0}},
- /* 0WY */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_ZXY, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1WY */
- {3,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_ZXY, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X0Y */
- {3,{0,2,0,0},{ I0_XXX, I1_X__,
- I0_000, I1__Y_,
- I0_YYY, I1___Z,
- 0,0}},
- /* Y0Y */
- {2,{0,2,0,0},{ I0_YYY, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* Z0Y */
- {2,{0,2,0,0},{ I0_ZXY, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* W0Y */
- {2,{0,2,0,0},{ I0_WZY, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* 00Y */
- {2,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_000, I1_XY_,
- 0,0,0,0}},
- /* 10Y */
- {3,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_000, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1Y */
- {3,{0,2,0,0},{ I0_XXX, I1_X__,
- I0_111, I1__Y_,
- I0_YYY, I1___Z,
- 0,0}},
- /* Y1Y */
- {2,{0,2,0,0},{ I0_YYY, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* Z1Y */
- {2,{0,2,0,0},{ I0_ZXY, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* W1Y */
- {3,{0,2,0,0},{ I0_WZY, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* 01Y */
- {3,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_111, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 11Y */
- {2,{0,2,0,0},{ I0_YYY, I1___Z,
- I0_111, I1_XY_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXZ */
- {2,{0,0,0,0},{ I0_XXX, I1_XY_,
- I0_ZZZ, I1___Z,
- 0,0,0,0}},
- /* YXZ */
- {3,{0,0,0,0},{ I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- I0_ZZZ, I1___Z,
- 0,0}},
- /* ZXZ */
- {2,{0,0,0,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1_X_Z,
- 0,0,0,0}},
- /* WXZ */
- {3,{0,0,0,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- 0,0}},
- /* 0XZ */
- {3,{0,0,2,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1XZ */
- {3,{0,0,2,0},{ I0_XXX, I1__Y_,
- I0_ZZZ, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XYZ */
- {1,{0,0,0,0},{ I0_XYZ, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* YYZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1___Z,
- I0_YYY, I1_XY_,
- 0,0,0,0}},
- /* ZYZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1_X_Z,
- I0_YYY, I1__Y_,
- 0,0,0,0}},
- /* WYZ */
- {2,{0,0,0,0},{ I0_WZY, I1_XYZ,
- I0_XYZ, I1__YZ,
- 0,0,0,0}},
- /* 0YZ */
- {2,{0,2,0,0},{ I0_XYZ, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1YZ */
- {2,{0,2,0,0},{ I0_XYZ, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1__YZ,
- I0_XXX, I1_X__,
- 0,0,0,0}},
- /* YZZ */
- {2,{0,0,0,0},{ I0_ZZZ, I1__YZ,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* ZZZ */
- {1,{0,0,0,0},{ I0_ZZZ, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* WZZ */
- {2,{0,0,0,0},{ I0_WZY, I1_XYZ,
- I0_ZZZ, I1__YZ,
- 0,0,0,0}},
- /* 0ZZ */
- {2,{0,2,0,0},{ I0_ZZZ, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1ZZ */
- {2,{0,2,0,0},{ I0_ZZZ, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XWZ */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_XYZ, I1_X_Z,
- 0,0,0,0}},
- /* YWZ */
- {3,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_YYY, I1_X__,
- I0_XYZ, I1___Z,
- 0,0}},
- /* ZWZ */
- {2,{0,0,0,0},{ I0_WWW, I1__Y_,
- I0_ZZZ, I1_X_Z,
- 0,0,0,0}},
- /* WWZ */
- {2,{0,0,0,0},{ I0_WWW, I1_XY_,
- I0_XYZ, I1___Z,
- 0,0,0,0}},
- /* 0WZ */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XYZ, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1WZ */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XYZ, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X0Z */
- {2,{0,2,0,0},{ I0_XYZ, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* Y0Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_000, I1__Y_,
- I0_YYY, I1_X__,
- 0,0}},
- /* Z0Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* W0Z */
- {3,{0,0,2,0},{ I0_WZY, I1_X_Z,
- I0_ZZZ, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* 00Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_000, I1_XY_,
- 0,0,0,0}},
- /* 10Z */
- {3,{0,2,2,0},{ I0_ZZZ, I1___Z,
- I0_000, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1Z */
- {2,{0,2,0,0},{ I0_XYZ, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* Y1Z */
- {3,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_111, I1__Y_,
- I0_YYY, I1_X__,
- 0,0}},
- /* Z1Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X_Z,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* W1Z */
- {3,{0,0,2,0},{ I0_WZY, I1_XYZ,
- I0_ZZZ, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* 01Z */
- {3,{0,2,2,0},{ I0_ZZZ, I1___Z,
- I0_111, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 11Z */
- {2,{0,2,0,0},{ I0_ZZZ, I1___Z,
- I0_111, I1_XY_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XXW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_XXX, I1_XY_,
- 0,0,0,0}},
- /* YXW */
- {3,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_XXX, I1__Y_,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZXW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_ZXY, I1_XY_,
- 0,0,0,0}},
- /* WXW */
- {2,{0,0,0,0},{ I0_WWW, I1_X_Z,
- I0_XXX, I1__Y_,
- 0,0,0,0}},
- /* 0XW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_XXX, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 1XW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_XXX, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XYW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_XYZ, I1_XY_,
- 0,0,0,0}},
- /* YYW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_YYY, I1_XY_,
- 0,0}},
- /* ZYW */
- {3,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_XYZ, I1__Y_,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* WYW */
- {2,{0,0,0,0},{ I0_WWW, I1_X_Z,
- I0_YYY, I1__Y_,
- 0,0,0,0}},
- /* 0YW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_YYY, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 1YW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_YYY, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
-
- SEMPTY,SEMPTY,
- /* XZW */
- {3,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_XYZ, I1_X__,
- I0_ZZZ, I1__Y_,
- 0,0}},
- /* YZW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_YZX, I1_XY_,
- 0,0,0,0}},
- /* ZZW */
- {2,{0,0,0,0},{ I0_WWW, I1___Z,
- I0_ZZZ, I1_XY_,
- 0,0,0,0}},
- /* WZW */
- {2,{0,0,0,0},{ I0_WWW, I1_X_Z,
- I0_ZZZ, I1__Y_,
- 0,0,0,0}},
- /* 0ZW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_ZZZ, I1__Y_,
- I0_000, I1_X__,
- 0,0}},
- /* 1ZW */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_ZZZ, I1__Y_,
- I0_111, I1_X__,
- 0,0}},
-
- SEMPTY,SEMPTY,
- /* XWW */
- {2,{0,0,0,0},{ I0_WWW, I1__YZ,
- I0_XYZ, I1_X__,
- 0,0,0,0}},
- /* YWW */
- {2,{0,0,0,0},{ I0_WWW, I1__YZ,
- I0_YYY, I1_X__,
- 0,0,0,0}},
- /* ZWW */
- {2,{0,0,0,0},{ I0_WWW, I1__YZ,
- I0_ZZZ, I1_X__,
- 0,0,0,0}},
- /* WWW */
- {1,{0,0,0,0},{ I0_WWW, I1_XYZ,
- 0,0,0,0,0,0}},
- /* 0WW */
- {2,{0,2,0,0},{ I0_WWW, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 1WW */
- {2,{0,2,0,0},{ I0_WWW, I1__YZ,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X0W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_XYZ, I1_X__,
- I0_000, I1__Y_,
- 0,0}},
- /* Y0W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_YYY, I1_X__,
- I0_000, I1__Y_,
- 0,0}},
- /* Z0W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_ZZZ, I1_X__,
- I0_000, I1__Y_,
- 0,0}},
- /* W0W */
- {2,{0,2,0,0},{ I0_WWW, I1_X_Z,
- I0_000, I1__Y_,
- 0,0,0,0}},
- /* 00W */
- {2,{0,2,0,0},{ I0_WWW, I1___Z,
- I0_000, I1_XY_,
- 0,0,0,0}},
- /* 10W */
- {3,{0,2,2,0},{ I0_WWW, I1___Z,
- I0_111, I1_X__,
- I0_000, I1__Y_,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X1W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_XYZ, I1_X__,
- I0_111, I1__Y_,
- 0,0}},
- /* Y1W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_YYY, I1_X__,
- I0_111, I1__Y_,
- 0,0}},
- /* Z1W */
- {3,{0,0,2,0},{ I0_WWW, I1___Z,
- I0_ZZZ, I1_X__,
- I0_111, I1__Y_,
- 0,0}},
- /* W1W */
- {2,{0,2,0,0},{ I0_WWW, I1_XYZ,
- I0_111, I1__Y_,
- 0,0,0,0}},
- /* 01W */
- {3,{0,2,2,0},{ I0_WWW, I1___Z,
- I0_000, I1_X__,
- I0_111, I1__Y_,
- 0,0}},
- /* 11W */
- {2,{0,2,0,0},{ I0_WWW, I1___Z,
- I0_111, I1_XY_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- /* XX0 */
- {2,{0,2,0,0},{ I0_XXX, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* YX0 */
- {3,{0,0,2,0},{ I0_YYY, I1_X__,
- I0_XXX, I1__Y_,
- I0_000, I1___Z,
- 0,0}},
- /* ZX0 */
- {2,{0,2,0,0},{ I0_ZXY, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* WX0 */
- {3,{0,0,2,0},{ I0_WZY, I1_X__,
- I0_XXX, I1__Y_,
- I0_000, I1___Z,
- 0,0}},
- /* 0X0 */
- {2,{0,2,0,0},{ I0_XXX, I1__Y_,
- I0_000, I1_X_Z,
- 0,0,0,0}},
- /* 1X0 */
- {3,{0,2,2,0},{ I0_XXX, I1__Y_,
- I0_000, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XY0 */
- {2,{0,2,0,0},{ I0_XYZ, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* YY0 */
- {2,{0,2,0,0},{ I0_YYY, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* ZY0 */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_ZZZ, I1_X__,
- I0_000, I1___Z,
- 0,0}},
- /* WY0 */
- {3,{0,0,2,0},{ I0_WZY, I1_X__,
- I0_XYZ, I1__Y_,
- I0_000, I1___Z,
- 0,0}},
- /* 0Y0 */
- {2,{0,2,0,0},{ I0_XYZ, I1__Y_,
- I0_000, I1_X_Z,
- 0,0,0,0}},
- /* 1Y0 */
- {3,{0,2,2,0},{ I0_XYZ, I1__Y_,
- I0_000, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XZ0 */
- {3,{0,0,2,0},{ I0_ZZZ, I1__Y_,
- I0_XYZ, I1_X__,
- I0_000, I1___Z,
- 0,0}},
- /* YZ0 */
- {2,{0,2,0,0},{ I0_YZX, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* ZZ0 */
- {2,{0,2,0,0},{ I0_ZZZ, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* WZ0 */
- {3,{0,0,2,0},{ I0_XYZ, I1_XYZ,
- I0_WZY, I1_XY_,
- I0_000, I1___Z,
- 0,0}},
- /* 0Z0 */
- {2,{0,2,0,0},{ I0_ZZZ, I1__Y_,
- I0_000, I1_X_Z,
- 0,0,0,0}},
- /* 1Z0 */
- {3,{0,2,2,0},{ I0_ZZZ, I1__Y_,
- I0_000, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* XW0 */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XYZ, I1_X__,
- I0_000, I1___Z,
- 0,0}},
- /* YW0 */
- {3,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_000, I1___Z,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZW0 */
- {3,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_000, I1___Z,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* WW0 */
- {2,{0,2,0,0},{ I0_WWW, I1_XY_,
- I0_000, I1___Z,
- 0,0,0,0}},
- /* 0W0 */
- {2,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_000, I1_X_Z,
- 0,0,0,0}},
- /* 1W0 */
- {3,{0,2,2,0},{ I0_WWW, I1__Y_,
- I0_000, I1___Z,
- I0_111, I1_X__,
- 0,0}},
- SEMPTY,SEMPTY,
- /* X00 */
- {2,{0,2,0,0},{ I0_XYZ, I1_X__,
- I0_000, I1__YZ,
- 0,0,0,0}},
- /* Y00 */
- {2,{0,2,0,0},{ I0_YYY, I1_X__,
- I0_000, I1__YZ,
- 0,0,0,0}},
- /* Z00 */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X__,
- I0_000, I1__YZ,
- 0,0,0,0}},
- /* W00 */
- {2,{2,0,0,0},{ I0_WZY, I1_X__,
- I0_000, I1__YZ,
- 0,0,0,0}},
- /* 000 */
- {1,{2,0,0,0},{ I0_000, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- /* 100 */
- {2,{2,2,0,0},{ I0_000, I1__YZ,
- I0_111, I1_X__,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* X10 */
- {3,{0,2,2,0},{ I0_XYZ, I1_XYZ,
- I0_000, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* Y10 */
- {3,{0,2,2,0},{ I0_YYY, I1_XYZ,
- I0_000, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* Z10 */
- {3,{0,2,2,0},{ I0_ZZZ, I1_XYZ,
- I0_000, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* W10 */
- {3,{0,2,2,0},{ I0_WZY, I1_XYZ,
- I0_000, I1___Z,
- I0_111, I1__Y_,
- 0,0}},
- /* 010 */
- {2,{2,2,0,0},{ I0_000, I1_X_Z,
- I0_111, I1__Y_,
- 0, 0, 0, 0 } },
- /* 110 */
- {2,{2,2,0,0},{ I0_000, I1___Z,
- I0_111, I1_XY_,
- 0,0,0,0}},
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
-
-
-
- /* XX1 */
- {2,{0,2,0,0},{ I0_XXX, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* YX1 */
- {3,{0,0,2,0},{ I0_YYY, I1_X__,
- I0_XXX, I1__Y_,
- I0_111, I1___Z,
- 0,0}},
- /* ZX1 */
- {2,{0,2,0,0},{ I0_ZXY, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* WX1 */
- {3,{0,0,2,0},{ I0_WZY, I1_XYZ,
- I0_XXX, I1__Y_,
- I0_111, I1___Z,
- 0,0}},
- /* 0X1 */
- {3,{0,2,2,0},{ I0_XXX, I1__Y_,
- I0_111, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1X1 */
- {2,{0,2,0,0},{ I0_XXX, I1__Y_,
- I0_111, I1_X_Z,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XY1 */
- {2,{0,2,0,0},{ I0_XYZ, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* YY1 */
- {2,{0,2,0,0},{ I0_YYY, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* ZY1 */
- {3,{0,0,2,0},{ I0_YYY, I1__Y_,
- I0_ZZZ, I1_X__,
- I0_111, I1___Z,
- 0,0}},
- /* WY1 */
- {3,{0,0,2,0},{ I0_WZY, I1_XYZ,
- I0_XYZ, I1__Y_,
- I0_111, I1___Z,
- 0,0}},
- /* 0Y1 */
- {3,{0,2,2,0},{ I0_XYZ, I1__Y_,
- I0_111, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1Y1 */
- {2,{0,2,0,0},{ I0_XYZ, I1__Y_,
- I0_111, I1_X_Z,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XZ1 */
- {3,{0,0,2,0},{ I0_ZZZ, I1__Y_,
- I0_XYZ, I1_X__,
- I0_111, I1___Z,
- 0,0}},
- /* YZ1 */
- {2,{0,2,0,0},{ I0_YZX, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* ZZ1 */
- {2,{0,2,0,0},{ I0_ZZZ, I1_XYZ,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* WZ1 */
- {2,{0,2,0,0},{ I0_WZY, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* 0Z1 */
- {3,{0,2,2,0},{ I0_ZZZ, I1_XYZ,
- I0_111, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1Z1 */
- {2,{0,2,0,0},{ I0_ZZZ, I1__Y_,
- I0_111, I1_X_Z,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* XW1 */
- {3,{0,0,2,0},{ I0_WWW, I1__Y_,
- I0_XYZ, I1_X__,
- I0_111, I1___Z,
- 0,0}},
- /* YW1 */
- {3,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_111, I1___Z,
- I0_YYY, I1_X__,
- 0,0}},
- /* ZW1 */
- {3,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_111, I1___Z,
- I0_ZZZ, I1_X__,
- 0,0}},
- /* WW1 */
- {2,{0,2,0,0},{ I0_WWW, I1_XY_,
- I0_111, I1___Z,
- 0,0,0,0}},
- /* 0W1 */
- {3,{0,2,2,0},{ I0_WWW, I1__Y_,
- I0_111, I1___Z,
- I0_000, I1_X__,
- 0,0}},
- /* 1W1 */
- {2,{0,2,0,0},{ I0_WWW, I1__Y_,
- I0_111, I1_X_Z,
- 0,0,0,0}},
- SEMPTY,SEMPTY,
- /* X01 */
- {3,{0,2,2,0},{ I0_XYZ, I1_X__,
- I0_111, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* Y01 */
- {3,{0,2,2,0},{ I0_YYY, I1_X__,
- I0_111, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* Z01 */
- {3,{0,2,2,0},{ I0_ZZZ, I1_X__,
- I0_111, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* W01 */
- {3,{0,2,2,0},{ I0_WZY, I1_XYZ,
- I0_111, I1___Z,
- I0_000, I1__Y_,
- 0,0}},
- /* 001 */
- {2,{2,2,0,0},{ I0_111, I1___Z,
- I0_000, I1_XY_,
- 0,0,0,0}},
- /* 101 */
- {2,{2,2,0,0},{ I0_111, I1_X_Z,
- I0_000, I1__Y_,
- 0, 0, 0, 0 } },
- SEMPTY,SEMPTY,
- /* X11 */
- {2,{0,2,0,0},{ I0_XYZ, I1_X__,
- I0_111, I1__YZ,
- 0,0,0,0}},
- /* Y11 */
- {2,{0,2,0,0},{ I0_YYY, I1_X__,
- I0_111, I1__YZ,
- 0,0,0,0}},
- /* Z11 */
- {2,{0,2,0,0},{ I0_ZZZ, I1_X__,
- I0_111, I1__YZ,
- 0,0,0,0}},
- /* W11 */
- {2,{0,2,0,0},{ I0_WZY, I1_XYZ,
- I0_111, I1__YZ,
- 0,0,0,0}},
- /* 011 */
- {2,{2,2,0,0},{ I0_111, I1__YZ,
- I0_000, I1_X__,
- 0,0,0,0}},
- /* 111 */
- {1,{2,0,0,0},{ I0_111, I1_XYZ,
- 0, 0, 0, 0, 0, 0 } },
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,
- SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY,SEMPTY
-};
-
-/******************************************************************************
-* Color source mask table
-******************************************************************************/
-
-#define S_111 R300_FPI0_ARGC_ONE
-#define S_000 R300_FPI0_ARGC_ZERO
-
-#define S0XXX R300_FPI0_ARGC_SRC0C_XXX
-#define S0YYY R300_FPI0_ARGC_SRC0C_YYY
-#define S0ZZZ R300_FPI0_ARGC_SRC0C_ZZZ
-#define S0WWW R300_FPI0_ARGC_SRC0A
-#define S0XYZ R300_FPI0_ARGC_SRC0C_XYZ
-#define S0ZXY R300_FPI0_ARGC_SRC0C_ZXY
-#define S0YZX R300_FPI0_ARGC_SRC0C_YZX
-#define S0WZY R300_FPI0_ARGC_SRC0CA_WZY
-#define S0WZY R300_FPI0_ARGC_SRC0CA_WZY
-
-#define S1XXX R300_FPI0_ARGC_SRC1C_XXX
-#define S1YYY R300_FPI0_ARGC_SRC1C_YYY
-#define S1ZZZ R300_FPI0_ARGC_SRC1C_ZZZ
-#define S1WWW R300_FPI0_ARGC_SRC1A
-#define S1XYZ R300_FPI0_ARGC_SRC1C_XYZ
-#define S1ZXY R300_FPI0_ARGC_SRC1C_ZXY
-#define S1YZX R300_FPI0_ARGC_SRC1C_YZX
-#define S1WZY R300_FPI0_ARGC_SRC1CA_WZY
-
-#define S2XXX R300_FPI0_ARGC_SRC2C_XXX
-#define S2YYY R300_FPI0_ARGC_SRC2C_YYY
-#define S2ZZZ R300_FPI0_ARGC_SRC2C_ZZZ
-#define S2WWW R300_FPI0_ARGC_SRC2A
-#define S2XYZ R300_FPI0_ARGC_SRC2C_XYZ
-#define S2ZXY R300_FPI0_ARGC_SRC2C_ZXY
-#define S2YZX R300_FPI0_ARGC_SRC2C_YZX
-#define S2WZY R300_FPI0_ARGC_SRC2CA_WZY
-
-#define ntnat 32
-
-const GLuint r300_swz_srcc_mask[3][512] = {
- {
- S0XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S0YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S0WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S0WWW,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- },
- {
- S1XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S1YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S1WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S1WWW,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- },
- {
- S2XXX,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2YZX,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2ZXY,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S2YYY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,S2WZY,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2XYZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2ZZZ,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,S2WWW,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,S_000,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,S_111,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,ntnat,
- ntnat,ntnat
- }
-};
-
-/******************************************************************************
-* Alpha source mask table
-******************************************************************************/
-
-GLuint r300_swz_srca_mask[3][6] = {
- { R300_FPI2_ARGA_SRC0C_X,
- R300_FPI2_ARGA_SRC0C_Y,
- R300_FPI2_ARGA_SRC0C_Z,
- R300_FPI2_ARGA_SRC0A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
- { R300_FPI2_ARGA_SRC1C_X,
- R300_FPI2_ARGA_SRC1C_Y,
- R300_FPI2_ARGA_SRC1C_Z,
- R300_FPI2_ARGA_SRC1A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
- { R300_FPI2_ARGA_SRC2C_X,
- R300_FPI2_ARGA_SRC2C_Y,
- R300_FPI2_ARGA_SRC2C_Z,
- R300_FPI2_ARGA_SRC2A,
- R300_FPI2_ARGA_ZERO,
- R300_FPI2_ARGA_ONE },
-};
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index 87276a11aed..0774a2af6b4 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -570,9 +570,10 @@ void r300Flush(GLcontext * ctx)
#ifdef USER_BUFFERS
#include "radeon_mm.h"
-void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
+void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
{
struct r300_dma_buffer *dmabuf;
+ size = MAX2(size, RADEON_BUFFER_SIZE*16);
if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
fprintf(stderr, "%s\n", __FUNCTION__);
@@ -591,20 +592,20 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
dmabuf->buf = (void *)1; /* hack */
dmabuf->refcount = 1;
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
if (dmabuf->id == 0) {
LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */
r300FlushCmdBufLocked(rmesa, __FUNCTION__);
radeonWaitForIdleLocked(&rmesa->radeon);
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
#ifdef HW_VBOS
if (dmabuf->id == 0) {
/* Just kick all */
r300_evict_vbos(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30);
- dmabuf->id = radeon_mm_alloc(rmesa, 4, RADEON_BUFFER_SIZE*16);
+ dmabuf->id = radeon_mm_alloc(rmesa, 4, size);
}
#endif
UNLOCK_HARDWARE(&rmesa->radeon);
@@ -617,7 +618,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
rmesa->dma.current.buf = dmabuf;
rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id);
- rmesa->dma.current.end = RADEON_BUFFER_SIZE*16;
+ rmesa->dma.current.end = size;
rmesa->dma.current.start = 0;
rmesa->dma.current.ptr = 0;
}
@@ -665,7 +666,8 @@ void r300AllocDmaRegion(r300ContextPtr rmesa,
(rmesa->dma.current.ptr + alignment) & ~alignment;
if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end)
- r300RefillCurrentDmaRegion(rmesa);
+ r300RefillCurrentDmaRegion(rmesa,
+ (bytes + 0x7) & ~0x7);
region->start = rmesa->dma.current.start;
region->ptr = rmesa->dma.current.start;
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h
index 5514214cc6b..52325646e9f 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.h
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.h
@@ -50,7 +50,6 @@ extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa,
extern void r300Flush(GLcontext * ctx);
-extern void r300RefillCurrentDmaRegion(r300ContextPtr rmesa);
extern void r300ReleaseDmaRegion(r300ContextPtr rmesa,
struct r300_dma_region *region, const char *caller);
extern void r300AllocDmaRegion(r300ContextPtr rmesa,
diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c
index 2fdad519fd5..fcb87cbbb59 100644
--- a/src/mesa/drivers/dri/r300/r300_maos.c
+++ b/src/mesa/drivers/dri/r300/r300_maos.c
@@ -407,8 +407,8 @@ int r300EmitArrays(GLcontext *ctx)
if (hw_tcl_on) {
struct r300_vertex_program *prog=(struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
inputs = prog->inputs;
- InputsRead = CURRENT_VERTEX_SHADER(ctx)->Base.InputsRead;
- OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
+ InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead;
+ OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
} else {
DECLARE_RENDERINPUTS(inputs_bitset);
inputs = r300->state.sw_tcl_inputs;
diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c
index 576b18953f9..26721e8dfda 100644
--- a/src/mesa/drivers/dri/r300/r300_shader.c
+++ b/src/mesa/drivers/dri/r300/r300_shader.c
@@ -12,13 +12,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct r300_vertex_program *vp=(void *)prog;
+ struct r300_vertex_program_cont *vp=(void *)prog;
switch(target){
case GL_VERTEX_PROGRAM_ARB:
- rmesa->curr_vp = (struct gl_vertex_program *)vp;
- vp->ref_count++;
+ //rmesa->curr_vp = (struct gl_vertex_program *)vp;
+ //vp->ref_count++;
#if 0
if((vp->ref_count % 1500) == 0) {
fprintf(stderr, "id %p, ref_count %d\n", vp, vp->ref_count);
@@ -37,13 +37,13 @@ r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
static struct gl_program *
r300NewProgram(GLcontext *ctx, GLenum target, GLuint id)
{
- struct r300_vertex_program *vp;
+ struct r300_vertex_program_cont *vp;
struct r300_fragment_program *fp;
switch(target){
case GL_VERTEX_STATE_PROGRAM_NV:
case GL_VERTEX_PROGRAM_ARB:
- vp=CALLOC_STRUCT(r300_vertex_program);
+ vp=CALLOC_STRUCT(r300_vertex_program_cont);
return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id);
case GL_FRAGMENT_PROGRAM_ARB:
fp=CALLOC_STRUCT(r300_fragment_program);
@@ -77,13 +77,14 @@ r300DeleteProgram(GLcontext *ctx, struct gl_program *prog)
static void
r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
- struct r300_vertex_program *vp=(void *)prog;
+ struct r300_vertex_program_cont *vp=(void *)prog;
struct r300_fragment_program *fp = (struct r300_fragment_program *) prog;
switch(target) {
case GL_VERTEX_PROGRAM_ARB:
- vp->translated = GL_FALSE;
- memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));
+ vp->progs = NULL;
+ /*vp->translated = GL_FALSE;
+ memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));*/
/*r300_translate_vertex_shader(vp);*/
break;
case GL_FRAGMENT_PROGRAM_ARB:
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 6aff04fd27f..1930a683f17 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -206,7 +206,7 @@ static void r300_set_blend_state(GLcontext * ctx)
(R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT);
int eqnA = R300_COMB_FCN_ADD_CLAMP;
- if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) {
+ if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) {
r300_set_blend_cntl(r300,
func, eqn, 0,
func, eqn);
@@ -1044,6 +1044,59 @@ r300UpdateDrawBuffer(GLcontext *ctx)
#endif
}
+static void r300FetchStateParameter(GLcontext *ctx, const enum state_index state[],
+ GLfloat *value)
+{
+ r300ContextPtr r300 = R300_CONTEXT(ctx);
+
+ switch(state[0])
+ {
+ case STATE_INTERNAL:
+ switch(state[1])
+ {
+ case STATE_R300_WINDOW_DIMENSION:
+ value[0] = r300->radeon.dri.drawable->w; /* width */
+ value[1] = r300->radeon.dri.drawable->h; /* height */
+ value[2] = 0.5F; /* for moving range [-1 1] -> [0 1] */
+ value[3] = 1.0F; /* not used */
+ break;
+ default:;
+ }
+ default:;
+ }
+}
+
+/**
+ * Update R300's own internal state parameters.
+ * For now just STATE_R300_WINDOW_DIMENSION
+ */
+static void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
+{
+ struct r300_vertex_program_cont *vpc;
+ struct gl_program_parameter_list *paramList;
+ GLuint i;
+
+ if(!(new_state & (_NEW_BUFFERS|_NEW_PROGRAM)))
+ return;
+
+ vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current;
+ if (!vpc)
+ return;
+
+ paramList = vpc->mesa_program.Base.Parameters;
+
+ if (!paramList)
+ return;
+
+ for (i = 0; i < paramList->NumParameters; i++) {
+ if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR){
+ r300FetchStateParameter(ctx,
+ paramList->Parameters[i].StateIndexes,
+ paramList->ParameterValues[i]);
+ }
+ }
+}
+
/* =============================================================
* Polygon state
*/
@@ -1285,7 +1338,7 @@ void r300_setup_rs_unit(GLcontext *ctx)
int i;
if(hw_tcl_on)
- OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
+ OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
else
RENDERINPUTS_COPY( OutputsWritten.index_bitset, r300->state.render_inputs_bitset );
@@ -1304,6 +1357,20 @@ void r300_setup_rs_unit(GLcontext *ctx)
r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0;
+ if (InputsRead & FRAG_BIT_WPOS){
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
+ break;
+
+ if(i == ctx->Const.MaxTextureUnits){
+ fprintf(stderr, "\tno free texcoord found...\n");
+ exit(0);
+ }
+
+ InputsRead |= (FRAG_BIT_TEX0 << i);
+ InputsRead &= ~FRAG_BIT_WPOS;
+ }
+
for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0
| R300_RS_INTERP_USED
@@ -1610,7 +1677,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa)
((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0;
R300_STATECHANGE(rmesa, vpp);
- param_count = r300VertexProgUpdateParams(ctx, prog, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]);
+ param_count = r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *)ctx->VertexProgram._Current/*prog*/, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]);
bump_vpu_count(rmesa->hw.vpp.cmd, param_count);
param_count /= 4;
@@ -1669,9 +1736,10 @@ void r300UpdateShaders(r300ContextPtr rmesa)
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
+ r300_select_vertex_shader(rmesa);
vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
- if (vp->translated == GL_FALSE)
- r300_translate_vertex_shader(vp);
+ /*if (vp->translated == GL_FALSE)
+ r300_translate_vertex_shader(vp);*/
if (vp->translated == GL_FALSE) {
fprintf(stderr, "Failing back to sw-tcl\n");
hw_tcl_on = future_hw_tcl_on = 0;
@@ -1679,6 +1747,7 @@ void r300UpdateShaders(r300ContextPtr rmesa)
return ;
}
+ r300UpdateStateParameters(ctx, _NEW_PROGRAM);
}
}
@@ -1812,6 +1881,9 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
r300UpdateDrawBuffer(ctx);
}
+
+ r300UpdateStateParameters(ctx, new_state);
+
#ifndef CB_DPATH
/* Go inefficiency! */
r300ResetHwState(r300);
diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c
index cc932b86d99..c08c98767e5 100644
--- a/src/mesa/drivers/dri/r300/r300_vertexprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c
@@ -95,7 +95,7 @@ static struct{
};
#undef OPN
-int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst)
+int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst)
{
int pi;
struct gl_vertex_program *mesa_vp = &vp->mesa_program;
@@ -177,17 +177,9 @@ static unsigned long t_dst_class(enum register_file file)
static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst_register *dst)
{
- if(dst->File == PROGRAM_OUTPUT) {
- if (vp->outputs[dst->Index] != -1)
- return vp->outputs[dst->Index];
- else {
- WARN_ONCE("Unknown output %d\n", dst->Index);
- return 10;
- }
- }else if(dst->File == PROGRAM_ADDRESS) {
- assert(dst->Index == 0);
- }
-
+ if(dst->File == PROGRAM_OUTPUT)
+ return vp->outputs[dst->Index];
+
return dst->Index;
}
@@ -335,6 +327,18 @@ static unsigned long op_operands(enum prog_opcode opcode)
return 0;
}
+static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst)
+{
+ if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1){
+ WARN_ONCE("Output %d not used by fragment program\n", dst->Index);
+ return GL_FALSE;
+ }else if(dst->File == PROGRAM_ADDRESS) {
+ assert(dst->Index == 0);
+ }
+
+ return GL_TRUE;
+}
+
/* TODO: Get rid of t_src_class call */
#define CMP_SRCS(a, b) ((a.RelAddr != b.RelAddr) || (a.Index != b.Index && \
((t_src_class(a.File) == VSF_IN_CLASS_PARAM && \
@@ -384,10 +388,8 @@ static unsigned long op_operands(enum prog_opcode opcode)
u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \
} while (0)
-void r300_translate_vertex_shader(struct r300_vertex_program *vp)
+static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct prog_instruction *vpi)
{
- struct gl_vertex_program *mesa_vp= &vp->mesa_program;
- struct prog_instruction *vpi;
int i, cur_reg=0;
VERTEX_SHADER_INSTRUCTION *o_inst;
unsigned long operands;
@@ -399,131 +401,9 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1;
struct prog_src_register src[3];
- if (mesa_vp->Base.NumInstructions == 0)
- return;
-
- if (getenv("R300_VP_SAFETY")) {
- WARN_ONCE("R300_VP_SAFETY enabled.\n");
-
- vpi = malloc((mesa_vp->Base.NumInstructions + VSF_MAX_FRAGMENT_TEMPS) * sizeof(struct prog_instruction));
- memset(vpi, 0, VSF_MAX_FRAGMENT_TEMPS * sizeof(struct prog_instruction));
-
- for (i=0; i < VSF_MAX_FRAGMENT_TEMPS; i++) {
- vpi[i].Opcode = OPCODE_MOV;
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- vpi[i].DstReg.File = PROGRAM_TEMPORARY;
- vpi[i].DstReg.Index = i;
- vpi[i].DstReg.WriteMask = WRITEMASK_XYZW;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = 0;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE);
- }
-
- memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction));
-
- free(mesa_vp->Base.Instructions);
-
- mesa_vp->Base.Instructions = vpi;
-
- mesa_vp->Base.NumInstructions += VSF_MAX_FRAGMENT_TEMPS;
- vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1];
-
- assert(vpi->Opcode == OPCODE_END);
- }
-
- if (mesa_vp->IsPositionInvariant) {
- struct gl_program_parameter_list *paramList;
- GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
-
-#ifdef PREFER_DP4
- tokens[5] = STATE_MATRIX;
-#else
- tokens[5] = STATE_MATRIX_TRANSPOSE;
-#endif
- paramList = mesa_vp->Base.Parameters;
-
- vpi = malloc((mesa_vp->Base.NumInstructions + 4) * sizeof(struct prog_instruction));
- memset(vpi, 0, 4 * sizeof(struct prog_instruction));
-
- for (i=0; i < 4; i++) {
- GLint idx;
- tokens[3] = tokens[4] = i;
- idx = _mesa_add_state_reference(paramList, tokens);
-#ifdef PREFER_DP4
- vpi[i].Opcode = OPCODE_DP4;
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- vpi[i].DstReg.Index = VERT_RESULT_HPOS;
- vpi[i].DstReg.WriteMask = 1 << i;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-#else
- if (i == 0)
- vpi[i].Opcode = OPCODE_MUL;
- else
- vpi[i].Opcode = OPCODE_MAD;
-
- vpi[i].StringPos = 0;
- vpi[i].Data = 0;
-
- if (i == 3)
- vpi[i].DstReg.File = PROGRAM_OUTPUT;
- else
- vpi[i].DstReg.File = PROGRAM_TEMPORARY;
- vpi[i].DstReg.Index = 0;
- vpi[i].DstReg.WriteMask = 0xf;
- vpi[i].DstReg.CondMask = COND_TR;
-
- vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- vpi[i].SrcReg[0].Index = idx;
- vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
-
- vpi[i].SrcReg[1].File = PROGRAM_INPUT;
- vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i);
-
- if (i > 0) {
- vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY;
- vpi[i].SrcReg[2].Index = 0;
- vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
- }
-#endif
- }
-
- memcpy(&vpi[i], mesa_vp->Base.Instructions, mesa_vp->Base.NumInstructions * sizeof(struct prog_instruction));
-
- free(mesa_vp->Base.Instructions);
-
- mesa_vp->Base.Instructions = vpi;
-
- mesa_vp->Base.NumInstructions += 4;
- vpi = &mesa_vp->Base.Instructions[mesa_vp->Base.NumInstructions-1];
-
- assert(vpi->Opcode == OPCODE_END);
-
- mesa_vp->Base.InputsRead |= (1 << VERT_ATTRIB_POS);
- mesa_vp->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS);
-
- //fprintf(stderr, "IsPositionInvariant is set!\n");
- //_mesa_print_program(&mesa_vp->Base);
- }
-
vp->pos_end=0; /* Not supported yet */
vp->program.length=0;
- vp->num_temporaries=mesa_vp->Base.NumTemporaries;
+ /*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/
for(i=0; i < VERT_ATTRIB_MAX; i++)
vp->inputs[i] = -1;
@@ -531,42 +411,49 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
for(i=0; i < VERT_RESULT_MAX; i++)
vp->outputs[i] = -1;
- assert(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS));
+ assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS));
/* Assign outputs */
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS))
vp->outputs[VERT_RESULT_HPOS] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ))
vp->outputs[VERT_RESULT_PSIZ] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL0))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0))
vp->outputs[VERT_RESULT_COL0] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_COL1))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1))
vp->outputs[VERT_RESULT_COL1] = cur_reg++;
#if 0 /* Not supported yet */
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC0))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0))
vp->outputs[VERT_RESULT_BFC0] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_BFC1))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1))
vp->outputs[VERT_RESULT_BFC1] = cur_reg++;
- if(mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC))
+ if(vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC))
vp->outputs[VERT_RESULT_FOGC] = cur_reg++;
#endif
for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++)
- if(mesa_vp->Base.OutputsWritten & (1 << i))
+ if(vp->key.OutputsWritten & (1 << i))
vp->outputs[i] = cur_reg++;
vp->translated = GL_TRUE;
vp->native = GL_TRUE;
o_inst=vp->program.body.i;
- for(vpi=mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
+ for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
FREE_TEMPS();
+
+ if(!valid_dst(vp, &vpi->DstReg))
+ {
+ /* redirect result to unused temp */
+ vpi->DstReg.File = PROGRAM_TEMPORARY;
+ vpi->DstReg.Index = u_temp_i;
+ }
operands=op_operands(vpi->Opcode);
are_srcs_scalar=operands & SCALAR_FLAG;
@@ -987,3 +874,308 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
#endif
}
+static void position_invariant(struct gl_program *prog)
+{
+ struct prog_instruction *vpi;
+ struct gl_program_parameter_list *paramList;
+ int i;
+
+ GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
+
+#ifdef PREFER_DP4
+ tokens[5] = STATE_MATRIX;
+#else
+ tokens[5] = STATE_MATRIX_TRANSPOSE;
+#endif
+ paramList = prog->Parameters;
+
+ vpi = malloc((prog->NumInstructions + 4) * sizeof(struct prog_instruction));
+ memset(vpi, 0, 4 * sizeof(struct prog_instruction));
+
+ for (i=0; i < 4; i++) {
+ GLint idx;
+ tokens[3] = tokens[4] = i;
+ idx = _mesa_add_state_reference(paramList, tokens);
+#ifdef PREFER_DP4
+ vpi[i].Opcode = OPCODE_DP4;
+ vpi[i].StringPos = 0;
+ vpi[i].Data = 0;
+
+ vpi[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi[i].DstReg.Index = VERT_RESULT_HPOS;
+ vpi[i].DstReg.WriteMask = 1 << i;
+ vpi[i].DstReg.CondMask = COND_TR;
+
+ vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
+ vpi[i].SrcReg[0].Index = idx;
+ vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi[i].SrcReg[1].File = PROGRAM_INPUT;
+ vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
+ vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+#else
+ if (i == 0)
+ vpi[i].Opcode = OPCODE_MUL;
+ else
+ vpi[i].Opcode = OPCODE_MAD;
+
+ vpi[i].StringPos = 0;
+ vpi[i].Data = 0;
+
+ if (i == 3)
+ vpi[i].DstReg.File = PROGRAM_OUTPUT;
+ else
+ vpi[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi[i].DstReg.Index = 0;
+ vpi[i].DstReg.WriteMask = 0xf;
+ vpi[i].DstReg.CondMask = COND_TR;
+
+ vpi[i].SrcReg[0].File = PROGRAM_STATE_VAR;
+ vpi[i].SrcReg[0].Index = idx;
+ vpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi[i].SrcReg[1].File = PROGRAM_INPUT;
+ vpi[i].SrcReg[1].Index = VERT_ATTRIB_POS;
+ vpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(i, i, i, i);
+
+ if (i > 0) {
+ vpi[i].SrcReg[2].File = PROGRAM_TEMPORARY;
+ vpi[i].SrcReg[2].Index = 0;
+ vpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+ }
+#endif
+ }
+
+ memcpy(&vpi[i], prog->Instructions, prog->NumInstructions * sizeof(struct prog_instruction));
+
+ free(prog->Instructions);
+
+ prog->Instructions = vpi;
+
+ prog->NumInstructions += 4;
+ vpi = &prog->Instructions[prog->NumInstructions-1];
+
+ assert(vpi->Opcode == OPCODE_END);
+}
+
+static void insert_wpos(struct r300_vertex_program *vp,
+ struct gl_program *prog,
+ GLint pos)
+{
+
+ GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 };
+ struct prog_instruction *vpi;
+ struct prog_instruction *vpi_insert;
+ GLuint temp_index;
+ GLuint window_index;
+ int i = 0;
+
+ vpi = malloc((prog->NumInstructions + 5) * sizeof(struct prog_instruction));
+ memcpy(vpi, prog->Instructions, (pos+1) * sizeof(struct prog_instruction));
+
+ vpi_insert = &vpi[pos];
+
+ /* make a copy before outputting VERT_RESULT_HPOS */
+ vpi_insert->DstReg.File = vpi_insert->SrcReg[2].File;
+ vpi_insert->DstReg.Index = temp_index = vpi_insert->SrcReg[2].Index;
+
+ vpi_insert++;
+ memset(vpi_insert, 0, 5 * sizeof(struct prog_instruction));
+
+ vpi_insert[i].Opcode = OPCODE_MOV;
+
+ vpi_insert[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi_insert[i].DstReg.Index = VERT_RESULT_HPOS;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+ i++;
+
+ /* perspective divide */
+ vpi_insert[i].Opcode = OPCODE_RCP;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_W;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO);
+ i++;
+
+ vpi_insert[i].Opcode = OPCODE_MUL;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[1].Index = temp_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_ZERO);
+ i++;
+
+ /* viewport transformation */
+ window_index = _mesa_add_state_reference(prog->Parameters, tokens);
+
+ vpi_insert[i].Opcode = OPCODE_MAD;
+
+ vpi_insert[i].DstReg.File = PROGRAM_TEMPORARY;
+ vpi_insert[i].DstReg.Index = temp_index;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZ;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[1].Index = window_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO);
+
+ vpi_insert[i].SrcReg[2].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[2].Index = window_index;
+ vpi_insert[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_ZERO);
+ i++;
+
+ vpi_insert[i].Opcode = OPCODE_MUL;
+
+ vpi_insert[i].DstReg.File = PROGRAM_OUTPUT;
+ vpi_insert[i].DstReg.Index = VERT_RESULT_TEX0+vp->wpos_idx;
+ vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ vpi_insert[i].DstReg.CondMask = COND_TR;
+
+ vpi_insert[i].SrcReg[0].File = PROGRAM_TEMPORARY;
+ vpi_insert[i].SrcReg[0].Index = temp_index;
+ vpi_insert[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W);
+
+ vpi_insert[i].SrcReg[1].File = PROGRAM_STATE_VAR;
+ vpi_insert[i].SrcReg[1].Index = window_index;
+ vpi_insert[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ONE, SWIZZLE_ONE);
+ i++;
+
+ memcpy(&vpi_insert[i], &prog->Instructions[pos+1], (prog->NumInstructions-(pos+1)) * sizeof(struct prog_instruction));
+
+ free(prog->Instructions);
+
+ prog->Instructions = vpi;
+
+ prog->NumInstructions += i;
+ vpi = &prog->Instructions[prog->NumInstructions-1];
+
+ assert(vpi->Opcode == OPCODE_END);
+ /* we need position, don't we ? :) */
+ prog->InputsRead |= (1 << VERT_ATTRIB_POS);
+}
+
+static void pos_as_texcoord(struct r300_vertex_program *vp,
+ struct gl_program *prog)
+{
+ struct prog_instruction *vpi;
+ int pos = 0;
+
+ for(vpi = prog->Instructions; vpi->Opcode != OPCODE_END; vpi++, pos++){
+ if( vpi->DstReg.File == PROGRAM_OUTPUT &&
+ vpi->DstReg.Index == VERT_RESULT_HPOS ){
+ insert_wpos(vp, prog, pos);
+ break;
+ }
+ }
+
+}
+
+static struct r300_vertex_program *build_program(struct r300_vertex_program_key *wanted_key,
+ struct gl_vertex_program *mesa_vp,
+ GLint wpos_idx)
+{
+ struct r300_vertex_program *vp;
+
+ vp = _mesa_calloc(sizeof(*vp));
+ _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key));
+
+ vp->wpos_idx = wpos_idx;
+
+ if(mesa_vp->IsPositionInvariant) {
+ position_invariant(&mesa_vp->Base);
+ }
+
+ if(wpos_idx > -1)
+ pos_as_texcoord(vp, &mesa_vp->Base);
+
+ assert(mesa_vp->Base.NumInstructions);
+
+ vp->num_temporaries=mesa_vp->Base.NumTemporaries;
+
+ r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions);
+
+ return vp;
+}
+
+void r300_select_vertex_shader(r300ContextPtr r300)
+{
+ GLcontext *ctx = ctx = r300->radeon.glCtx;
+ GLuint InputsRead;
+ struct r300_vertex_program_key wanted_key = { 0 };
+ GLint i;
+ struct r300_vertex_program_cont *vpc;
+ struct r300_vertex_program *vp;
+ GLint wpos_idx;
+
+ vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current;
+ InputsRead = ctx->FragmentProgram._Current->Base.InputsRead;
+
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_HPOS;
+
+ wpos_idx = -1;
+ if (InputsRead & FRAG_BIT_WPOS){
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
+ break;
+
+ if(i == ctx->Const.MaxTextureUnits){
+ fprintf(stderr, "\tno free texcoord found\n");
+ exit(0);
+ }
+
+ InputsRead |= (FRAG_BIT_TEX0 << i);
+ wpos_idx = i;
+ }
+
+ if (InputsRead & FRAG_BIT_COL0)
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL0;
+
+ if ((InputsRead & FRAG_BIT_COL1) /*||
+ (InputsRead & FRAG_BIT_FOGC)*/)
+ wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1;
+
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ if (InputsRead & (FRAG_BIT_TEX0 << i))
+ wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
+
+ wanted_key.InputsRead = vpc->mesa_program.Base.InputsRead;
+ if(vpc->mesa_program.IsPositionInvariant) {
+ /* we wan't position don't we ? */
+ wanted_key.InputsRead |= (1 << VERT_ATTRIB_POS);
+ }
+
+ for (vp = vpc->progs; vp; vp = vp->next)
+ if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == 0) {
+ r300->selected_vp = vp;
+ return ;
+ }
+
+ //_mesa_print_program(&vpc->mesa_program.Base);
+
+ vp = build_program(&wanted_key, &vpc->mesa_program, wpos_idx);
+ vp->next = vpc->progs;
+ vpc->progs = vp;
+ r300->selected_vp = vp;
+}
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c
index 62a6e1e5f79..3a6bde8fc31 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.c
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
@@ -102,7 +102,6 @@ static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name)
*/
static void radeonInitDriverFuncs(struct dd_function_table *functions)
{
- functions->GetBufferSize = NULL;
functions->GetString = radeonGetString;
}
@@ -267,12 +266,14 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
radeon->glCtx);
- if ( (radeon->dri.drawable != driDrawPriv)
- || (radeon->dri.readable != driReadPriv) ) {
-
+ if (radeon->dri.drawable != driDrawPriv) {
driDrawableInitVBlank(driDrawPriv,
radeon->vblank_flags,
&radeon->vbl_seq);
+ }
+
+ if (radeon->dri.drawable != driDrawPriv ||
+ radeon->dri.readable != driReadPriv) {
radeon->dri.drawable = driDrawPriv;
radeon->dri.readable = driReadPriv;
diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c
index 7595d2144f7..f86a1b4e72e 100644
--- a/src/mesa/drivers/dri/r300/radeon_mm.c
+++ b/src/mesa/drivers/dri/r300/radeon_mm.c
@@ -213,7 +213,7 @@ int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size)
}
goto again;
#else
- WARN_ONCE("Ran out of GART memory!\nPlease consider adjusting GARTSize option.\n");
+ WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size);
return 0;
#endif
}
diff --git a/src/mesa/drivers/dri/r300/radeon_state.c b/src/mesa/drivers/dri/r300/radeon_state.c
index 1b1ec3df3ce..ddadf83a003 100644
--- a/src/mesa/drivers/dri/r300/radeon_state.c
+++ b/src/mesa/drivers/dri/r300/radeon_state.c
@@ -169,10 +169,6 @@ void radeonSetCliprects(radeonContextPtr radeon)
if ((draw_fb->Width != drawable->w) ||
(draw_fb->Height != drawable->h)) {
- printf("w,h %d %d\n",
- radeon->glCtx->DrawBuffer->Width,
- radeon->glCtx->DrawBuffer->Height);
-
_mesa_resize_framebuffer(radeon->glCtx, draw_fb,
drawable->w, drawable->h);
draw_fb->Initialized = GL_TRUE;
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 8845881e3fb..6bc2c4aa5c5 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -170,7 +170,6 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
*/
static void radeonInitDriverFuncs( struct dd_function_table *functions )
{
- functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = radeonGetString;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index cfa8d4c9fa2..37bb749223a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -865,7 +865,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa,
radeonTexObjPtr texobj )
{
/* do not use RADEON_DB_STATE to avoid stale texture caches */
- GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
+ int *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
RADEON_STATECHANGE( rmesa, tex[unit] );
@@ -888,7 +888,7 @@ static void import_tex_obj_state( radeonContextPtr rmesa,
se_coord_fmt &= ~(RADEON_VTX_ST0_NONPARAMETRIC << unit);
if (texobj->base.tObj->Target == GL_TEXTURE_CUBE_MAP) {
- GLuint *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
+ int *cube_cmd = &rmesa->hw.cube[unit].cmd[CUBE_CMD_0];
GLuint bytesPerFace = texobj->base.totalSize / 6;
ASSERT(texobj->base.totalSize % 6 == 0);
diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h
index 0dec397b7ba..43fb969c693 100644
--- a/src/mesa/drivers/dri/savage/savage_init.h
+++ b/src/mesa/drivers/dri/savage/savage_init.h
@@ -80,21 +80,10 @@ typedef struct {
} savageScreenPrivate;
-/**
- * savageRenderbuffer, derived from Mesa's gl_renderbuffer
- */
-typedef struct {
- struct gl_renderbuffer Base;
- /* XXX per-window info should go here */
- int foo, bar;
-} savageRenderbuffer;
-
-
#include "savagecontext.h"
extern void savageGetLock( savageContextPtr imesa, GLuint flags );
-extern void savageXMesaSetBackClipRects( savageContextPtr imesa );
-extern void savageXMesaSetFrontClipRects( savageContextPtr imesa );
+extern void savageXMesaSetClipRects(savageContextPtr imesa);
#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index 3557ce01187..ad79b9235c1 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -173,6 +173,9 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
{
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
+
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
@@ -260,6 +263,11 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
driParseOptionInfo (&savageScreen->optionCache,
__driConfigOptions, __driNConfigOptions);
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension)(sPriv->psc->screenConfigs,
+ "GLX_SGI_make_current_read");
+ }
+
#if 0
savageDDFastPathInit();
savageDDTrifuncInit();
@@ -716,34 +724,18 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv)
}
#endif
-void savageXMesaSetFrontClipRects( savageContextPtr imesa )
-{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
-
- imesa->numClipRects = dPriv->numClipRects;
- imesa->pClipRects = dPriv->pClipRects;
- imesa->drawX = dPriv->x;
- imesa->drawY = dPriv->y;
- savageCalcViewport( imesa->glCtx );
-}
-
-
-void savageXMesaSetBackClipRects( savageContextPtr imesa )
+void savageXMesaSetClipRects(savageContextPtr imesa)
{
__DRIdrawablePrivate *dPriv = imesa->driDrawable;
- if (dPriv->numBackClipRects == 0)
- {
-
-
+ if ((dPriv->numBackClipRects == 0)
+ || (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT)) {
imesa->numClipRects = dPriv->numClipRects;
imesa->pClipRects = dPriv->pClipRects;
imesa->drawX = dPriv->x;
imesa->drawY = dPriv->y;
} else {
-
-
imesa->numClipRects = dPriv->numBackClipRects;
imesa->pClipRects = dPriv->pBackClipRects;
imesa->drawX = dPriv->backX;
@@ -756,18 +748,17 @@ void savageXMesaSetBackClipRects( savageContextPtr imesa )
static void savageXMesaWindowMoved( savageContextPtr imesa )
{
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
+
if (0)
fprintf(stderr, "savageXMesaWindowMoved\n\n");
- switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
- case BUFFER_BIT_FRONT_LEFT:
- savageXMesaSetFrontClipRects( imesa );
- break;
- case BUFFER_BIT_BACK_LEFT:
- savageXMesaSetBackClipRects( imesa );
- break;
- default:
- break;
+ savageXMesaSetClipRects(imesa);
+
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(imesa->glCtx, readable);
}
}
@@ -858,11 +849,12 @@ savageMakeCurrent(__DRIcontextPrivate *driContextPriv,
void savageGetLock( savageContextPtr imesa, GLuint flags )
{
- __DRIdrawablePrivate *dPriv = imesa->driDrawable;
+ __DRIdrawablePrivate *const drawable = imesa->driDrawable;
+ __DRIdrawablePrivate *const readable = imesa->driReadable;
__DRIscreenPrivate *sPriv = imesa->driScreen;
drm_savage_sarea_t *sarea = imesa->sarea;
int me = imesa->hHWContext;
- int stamp = dPriv->lastStamp;
+ int stamp = drawable->lastStamp;
int heap;
unsigned int timestamp = 0;
@@ -882,10 +874,11 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
* NOTE: This releases and regains the hw lock, so all state
* checking must be done *after* this call:
*/
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
-
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
+ }
-
/* If we lost context, need to dump all registers to hardware.
* Note that we don't care about 2d contexts, even if they perform
@@ -916,8 +909,8 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
DRI_AGE_TEXTURES( imesa->textureHeaps[heap] );
}
- if (dPriv->lastStamp != stamp) {
- driUpdateFramebufferSize(imesa->glCtx, dPriv);
+ if (drawable->lastStamp != stamp) {
+ driUpdateFramebufferSize(imesa->glCtx, drawable);
savageXMesaWindowMoved( imesa );
}
}
diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c
index ae19481f039..a5c5310e287 100644
--- a/src/mesa/drivers/dri/savage/savagedd.c
+++ b/src/mesa/drivers/dri/savage/savagedd.c
@@ -42,7 +42,7 @@
#include "utils.h"
-#define DRIVER_DATE "20050829"
+#define DRIVER_DATE "20061110"
/***************************************
* Mesa's Driver Functions
@@ -95,24 +95,7 @@ static GLint savageGetParameteri(const GLcontext *ctx, GLint param)
#endif
-static void savageBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
-
- /* Need to lock to make sure the driDrawable is uptodate. This
- * information is used to resize Mesa's software buffers, so it has
- * to be correct.
- */
- LOCK_HARDWARE(imesa);
- *width = imesa->driDrawable->w;
- *height = imesa->driDrawable->h;
- UNLOCK_HARDWARE(imesa);
-}
-
-
void savageDDInitDriverFuncs( GLcontext *ctx )
{
- ctx->Driver.GetBufferSize = savageBufferSize;
ctx->Driver.GetString = savageDDGetString;
}
diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c
index 5d6246797f2..61ab9e6d64a 100644
--- a/src/mesa/drivers/dri/savage/savagespan.c
+++ b/src/mesa/drivers/dri/savage/savagespan.c
@@ -33,9 +33,8 @@
#define DBG 0
#define LOCAL_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint cpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
@@ -44,9 +43,8 @@
(void) p
#define LOCAL_DEPTH_VARS \
- savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = imesa->driDrawable; \
driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
GLuint zpp = drb->cpp; \
GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index 5c2b397bdeb..741a9dda4f7 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -647,23 +647,20 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode )
case BUFFER_BIT_FRONT_LEFT:
imesa->IsDouble = GL_FALSE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11;
-
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetFrontClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BIT_BACK_LEFT:
imesa->IsDouble = GL_TRUE;
imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11;
- imesa->NotFirstFrame = GL_FALSE;
- savageXMesaSetBackClipRects( imesa );
- FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
+ imesa->NotFirstFrame = GL_FALSE;
+ savageXMesaSetClipRects(imesa);
+ FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE);
+
if (destCtrl != imesa->regs.s4.destCtrl.ui)
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
}
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index 07d2cb1db5f..a9163f49a8f 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -23,19 +23,14 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.12 2003/05/08 09:25:35 herrb Exp $ */
-/*
- * New fixes:
- * Daniel Borca <[email protected]>, 19 Jul 2004
- *
- * Original rewrite:
- * Gareth Hughes <[email protected]>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <[email protected]>
- * Brian Paul <[email protected]>
+/**
+ * \file tdfx_context.c
+ * Context management functions for 3Dfx hardware.
*
+ * \author Gareth Hughes <[email protected]> (original rewrite 29 Sep - 1 Oct 2000)
+ * \author Brian Paul <[email protected]>
+ * \author Daniel Borca <[email protected]> (new fixes 19 Jul 2004)
*/
#include <dlfcn.h>
@@ -65,6 +60,7 @@
#define need_GL_ARB_multisample
/* #define need_GL_ARB_point_parameters */
+#define need_GL_ARB_occlusion_query
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
/* #define need_GL_ARB_vertex_program */
@@ -87,6 +83,7 @@
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
+ { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
@@ -660,8 +657,10 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
GLcontext *newCtx = newFx->glCtx;
GET_CURRENT_CONTEXT(curCtx);
- if ( newFx->driDrawable != driDrawPriv ) {
+ if ((newFx->driDrawable != driDrawPriv)
+ || (newFx->driReadable != driReadPriv)) {
newFx->driDrawable = driDrawPriv;
+ newFx->driReadable = driReadPriv;
newFx->dirty = ~0;
}
else {
@@ -679,6 +678,11 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
newFx->dirty = ~0;
}
+ driUpdateFramebufferSize(newCtx, driDrawPriv);
+ if (driDrawPriv != driReadPriv) {
+ driUpdateFramebufferSize(newCtx, driReadPriv);
+ }
+
if ( !newFx->Glide.Initialized ) {
if ( !tdfxInitContext( driDrawPriv, newFx ) )
return GL_FALSE;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h
index b8349fec73b..89a7a9d6c4e 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.h
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h
@@ -895,7 +895,17 @@ struct tdfx_context {
/* stuff added for DRI */
__DRIscreenPrivate *driScreen;
__DRIcontextPrivate *driContext;
- __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadable;
+
drm_context_t hHWContext;
drm_hw_lock_t *driHwLock;
int driFd;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
index c2f3185dc47..adbe0c0f33f 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
@@ -23,16 +23,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.10 2002/10/30 12:52:00 alanh Exp $ */
-/*
- * Original rewrite:
- * Gareth Hughes <[email protected]>, 29 Sep - 1 Oct 2000
- *
- * Authors:
- * Gareth Hughes <[email protected]>
- * Brian Paul <[email protected]>
- *
+/**
+ * \file tdfx_dd.c
+ * Device driver interface functions for 3Dfx based cards.
+ *
+ * \author Gareth Hughes <[email protected]> (Original rewrite 29 Sep - 1 Oct 2000)
+ * \author Brian Paul <[email protected]>
*/
#include "tdfx_context.h"
@@ -41,6 +38,7 @@
#include "tdfx_vb.h"
#include "tdfx_pixels.h"
+#include "utils.h"
#include "context.h"
#include "enums.h"
#include "framebuffer.h"
@@ -50,7 +48,7 @@
#endif
-#define TDFX_DATE "20040719"
+#define DRIVER_DATE "20061113"
/* These are used in calls to FX_grColorMaskv() */
@@ -67,67 +65,40 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- switch ( name ) {
+ switch (name) {
case GL_RENDERER:
{
/* The renderer string must be per-context state to handle
* multihead correctly.
*/
- char *buffer = fxMesa->rendererString;
- char hardware[100];
+ char *const buffer = fxMesa->rendererString;
+ char hardware[64];
LOCK_HARDWARE(fxMesa);
- strcpy( hardware, fxMesa->Glide.grGetString(GR_HARDWARE) );
+ strncpy(hardware, fxMesa->Glide.grGetString(GR_HARDWARE),
+ sizeof(hardware));
+ hardware[sizeof(hardware) - 1] = '\0';
UNLOCK_HARDWARE(fxMesa);
- strcpy( buffer, "Mesa DRI " );
- strcat( buffer, TDFX_DATE );
- strcat( buffer, " " );
-
- if ( strcmp( hardware, "Voodoo3 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo3" );
- }
- else if ( strcmp( hardware, "Voodoo Banshee (tm)" ) == 0 ) {
- strcat( buffer, "VoodooBanshee" );
+ if ((strncmp(hardware, "Voodoo3", 7) == 0)
+ || (strncmp(hardware, "Voodoo4", 7) == 0)
+ || (strncmp(hardware, "Voodoo5", 7) == 0)) {
+ hardware[7] = '\0';
}
- else if ( strcmp( hardware, "Voodoo4 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo4" );
- }
- else if ( strcmp( hardware, "Voodoo5 (tm)" ) == 0 ) {
- strcat( buffer, "Voodoo5" );
+ else if (strncmp(hardware, "Voodoo Banshee", 14) == 0) {
+ strcpy(&hardware[6], "Banshee");
}
else {
/* unexpected result: replace spaces with hyphens */
int i;
- for ( i = 0 ; hardware[i] && i < 60 ; i++ ) {
- if ( hardware[i] == ' ' || hardware[i] == '\t' )
+ for (i = 0; hardware[i] && (i < sizeof(hardware)); i++) {
+ if (hardware[i] == ' ' || hardware[i] == '\t') {
hardware[i] = '-';
+ }
}
- strcat( buffer, hardware );
}
- /* Append any CPU-specific information.
- */
-#ifdef USE_X86_ASM
- if ( _mesa_x86_cpu_features ) {
- strncat( buffer, " x86", 4 );
- }
-#endif
-#ifdef USE_MMX_ASM
- if ( cpu_has_mmx ) {
- strncat( buffer, "/MMX", 4 );
- }
-#endif
-#ifdef USE_3DNOW_ASM
- if ( cpu_has_3dnow ) {
- strncat( buffer, "/3DNow!", 7 );
- }
-#endif
-#ifdef USE_SSE_ASM
- if ( cpu_has_xmm ) {
- strncat( buffer, "/SSE", 4 );
- }
-#endif
+ (void) driGetRendererString(buffer, hardware, DRIVER_DATE, 0);
return (const GLubyte *) buffer;
}
case GL_VENDOR:
@@ -138,18 +109,52 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
}
-/* Return uptodate buffer size information.
- */
-static void tdfxDDGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
+static void
+tdfxBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
+{
+ tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
+
+ (void) q;
+
+ if (target == GL_SAMPLES_PASSED_ARB) {
+ LOCK_HARDWARE(fxMesa);
+ fxMesa->Glide.grFinish();
+ fxMesa->Glide.grReset(GR_STATS_PIXELS);
+ UNLOCK_HARDWARE(fxMesa);
+ }
+}
+
+
+static void
+tdfxEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
{
- GET_CURRENT_CONTEXT(ctx);
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
+ FxI32 total_pixels;
+ FxI32 z_fail_pixels;
+
- LOCK_HARDWARE( fxMesa );
- *width = fxMesa->width;
- *height = fxMesa->height;
- UNLOCK_HARDWARE( fxMesa );
+ if (target == GL_SAMPLES_PASSED_ARB) {
+ LOCK_HARDWARE(fxMesa);
+ fxMesa->Glide.grFinish();
+
+ fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, sizeof(FxI32),
+ &z_fail_pixels);
+ fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, sizeof(FxI32), &total_pixels);
+
+ q->Result = total_pixels - z_fail_pixels;
+
+ /* Apparently, people have seen z_fail_pixels > total_pixels under
+ * some conditions on some 3Dfx hardware. The occlusion query spec
+ * requires that we clamp to 0.
+ */
+ if (q->Result < 0) {
+ q->Result = 0;
+ }
+
+ q->Ready = GL_TRUE;
+
+ UNLOCK_HARDWARE(fxMesa);
+ }
}
@@ -166,8 +171,9 @@ void tdfxDDInitDriverFuncs( const __GLcontextModes *visual,
fprintf( stderr, "tdfx: %s()\n", __FUNCTION__ );
}
- functions->GetString = tdfxDDGetString;
- functions->GetBufferSize = tdfxDDGetBufferSize;
+ functions->GetString = tdfxDDGetString;
+ functions->BeginQuery = tdfxBeginQuery;
+ functions->EndQuery = tdfxEndQuery;
/* Accelerated paths
*/
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_lock.c b/src/mesa/drivers/dri/tdfx/tdfx_lock.c
index ae3ba1a8321..a20c91d030a 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_lock.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_lock.c
@@ -47,16 +47,20 @@
void tdfxGetLock( tdfxContextPtr fxMesa )
{
__DRIcontextPrivate *cPriv = fxMesa->driContext;
- __DRIdrawablePrivate *dPriv = cPriv->driDrawablePriv;
- __DRIscreenPrivate *sPriv = dPriv->driScreenPriv;
+ __DRIdrawablePrivate *const drawable = cPriv->driDrawablePriv;
+ __DRIdrawablePrivate *const readable = cPriv->driReadablePriv;
+ __DRIscreenPrivate *sPriv = drawable->driScreenPriv;
TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) +
fxMesa->fxScreen->sarea_priv_offset);
- unsigned int stamp = dPriv->lastStamp;
+ unsigned int stamp = drawable->lastStamp;
drmGetLock( fxMesa->driFd, fxMesa->hHWContext, 0 );
- /* This macro will update dPriv's cliprects if needed */
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+ /* This macro will update drawable's cliprects if needed */
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (drawable != readable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
+ }
if ( saPriv->fifoOwner != fxMesa->hHWContext ) {
fxMesa->Glide.grDRIImportFifo( saPriv->fifoPtr, saPriv->fifoRead );
@@ -83,10 +87,15 @@ void tdfxGetLock( tdfxContextPtr fxMesa )
}
#endif
- if ( *dPriv->pStamp != stamp || saPriv->ctxOwner != fxMesa->hHWContext ) {
+ if ((*drawable->pStamp != stamp)
+ || (saPriv->ctxOwner != fxMesa->hHWContext)) {
+ driUpdateFramebufferSize(fxMesa->glCtx, drawable);
+ if (drawable != readable) {
+ driUpdateFramebufferSize(fxMesa->glCtx, readable);
+ }
+
tdfxUpdateClipping(fxMesa->glCtx);
tdfxUploadClipping(fxMesa);
- driUpdateFramebufferSize(fxMesa->glCtx, dPriv);
}
DEBUG_LOCK();
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
index 1a5a2b11090..732270b2bd3 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c
@@ -496,9 +496,9 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y,
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ __DRIdrawablePrivate *const readable = fxMesa->driReadable;
+ const GLint winX = readable->x;
+ const GLint winY = readable->y + readable->h - 1;
const GLint scrX = winX + x;
const GLint scrY = winY - y;
@@ -554,9 +554,9 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y,
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
GrLfbInfo_t info;
-
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ __DRIdrawablePrivate *const readable = fxMesa->driReadable;
+ const GLint winX = readable->x;
+ const GLint winY = readable->y + readable->h - 1;
const GLint scrX = winX + x;
const GLint scrY = winY - y;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index 0a4499cfae7..646f5126eb0 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -73,6 +73,9 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
{
tdfxScreenPrivate *fxScreen;
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
+ void *const psc = sPriv->psc->screenConfigs;
if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
@@ -113,6 +116,10 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
return GL_FALSE;
}
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension)(psc, "GLX_SGI_make_current_read");
+ }
+
return GL_TRUE;
}
@@ -180,6 +187,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv,
driDrawPriv);
tdfxSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
+ backRb->backBuffer = GL_TRUE;
}
if (mesaVis->depthBits == 16) {
@@ -265,7 +273,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
return;
LOCK_HARDWARE( fxMesa );
fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
+#ifdef DEBUG
printf("SwapBuf SetState 1\n");
+#endif
fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
}
}
@@ -325,7 +335,9 @@ tdfxSwapBuffers( __DRIdrawablePrivate *driDrawPriv )
if (ctx->DriverCtx != fxMesa) {
fxMesa = TDFX_CONTEXT(ctx);
fxMesa->Glide.grSstSelect( fxMesa->Glide.Board );
+#ifdef DEBUG
printf("SwapBuf SetState 2\n");
+#endif
fxMesa->Glide.grGlideSetState(fxMesa->Glide.State );
}
UNLOCK_HARDWARE( fxMesa );
@@ -393,7 +405,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
m->accumRedBits = accum ? 16 : 0;
m->accumGreenBits = accum ? 16 : 0;
m->accumBlueBits = accum ? 16 : 0;
- m->accumAlphaBits = accum ? 16 : 0;
+ m->accumAlphaBits = (accum && deep) ? 16 : 0;
m->stencilBits = stencil ? 8 : 0;
m->depthBits = deep
? (depth ? 24 : 0)
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c
index ce895f82542..d9d52d2b6f5 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_span.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c
@@ -47,21 +47,19 @@
#define LOCAL_VARS \
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
- tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \
- GLboolean isFront = (ctx->DrawBuffer->_ColorDrawBufferMask[0] \
- == BUFFER_BIT_FRONT_LEFT); \
- GLuint pitch = isFront ? (fxMesa->screen_width * BYTESPERPIXEL) \
- : info.strideInBytes; \
- GLuint height = fxMesa->height; \
+ driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
+ GLuint pitch = drb->backBuffer ? info.strideInBytes \
+ : (drb->pitch * drb->cpp); \
+ const GLuint bottom = dPriv->h - 1; \
char *buf = (char *)((char *)info.lfbPtr + \
- dPriv->x * fxPriv->cpp + \
- dPriv->y * pitch); \
+ (dPriv->x * drb->cpp) + \
+ (dPriv->y * pitch)); \
GLuint p; \
(void) buf; (void) p;
-#define Y_FLIP(_y) (height - _y - 1)
+#define Y_FLIP(_y) (bottom - _y)
#define HW_WRITE_LOCK() \
@@ -71,10 +69,9 @@
UNLOCK_HARDWARE( fxMesa ); \
LOCK_HARDWARE( fxMesa ); \
info.size = sizeof(GrLfbInfo_t); \
- if ( fxMesa->Glide.grLfbLock( GR_LFB_WRITE_ONLY, \
- fxMesa->DrawBuffer, LFB_MODE, \
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) \
- {
+ if (fxMesa->Glide.grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer, \
+ LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, \
+ &info)) {
#define HW_WRITE_UNLOCK() \
fxMesa->Glide.grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer );\
@@ -976,7 +973,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb,
GetFbParams(fxMesa, &info, &backBufferInfo,
&ReadParams, sizeof(GLushort));
for (i = 0; i < n; i++) {
- if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) {
+ if ((!mask || mask[i]) && visible_pixel(fxMesa, x[i], y[i])) {
xpos = x[i] + fxMesa->x_offset;
ypos = bottom - y[i];
d16 = depth[i];
@@ -1000,7 +997,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb,
GetFbParams(fxMesa, &info, &backBufferInfo,
&ReadParams, sizeof(GLuint));
for (i = 0; i < n; i++) {
- if (mask[i]) {
+ if (!mask || mask[i]) {
if (visible_pixel(fxMesa, x[i], y[i])) {
xpos = x[i] + fxMesa->x_offset;
ypos = bottom - y[i];
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
index c3fe7bebd3e..89865d96379 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
@@ -1755,7 +1755,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target,
for (i = 0; i < rows; i++) {
MEMCPY(dest, data, srcRowStride);
dest += destRowStride;
- data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride);
+ data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride);
}
/* [dBorca] Hack alert:
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
index f5f385fad7c..fda9ce56849 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
@@ -1015,9 +1015,12 @@ SetupSingleTexEnvVoodoo3(GLcontext *ctx, int unit,
}
break;
- default:
+ default: {
+ (void) memcpy(&colorComb, &fxMesa->ColorCombine, sizeof(colorComb));
+ (void) memcpy(&alphaComb, &fxMesa->AlphaCombine, sizeof(alphaComb));
_mesa_problem(ctx, "bad texture env mode in %s", __FUNCTION__);
}
+ }
if (colorComb.Function != fxMesa->ColorCombine.Function ||
colorComb.Factor != fxMesa->ColorCombine.Factor ||
diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c
index a07b40fd5d2..dbbd1ac0c69 100644
--- a/src/mesa/drivers/dri/trident/trident_context.c
+++ b/src/mesa/drivers/dri/trident/trident_context.c
@@ -50,6 +50,7 @@
#include "drivers/common/driverfuncs.h"
#include "dri_util.h"
+#include "utils.h"
static const struct tnl_pipeline_stage *trident_pipeline[] = {
&_tnl_vertex_transform_stage,
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index 38dcf458db8..bc5a414df60 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -147,10 +147,13 @@ viaRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format)
+viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format,
+ __DRIdrawablePrivate *dPriv)
{
const GLuint name = 0;
+ struct gl_renderbuffer *rb = & vrb->Base;
+ vrb->dPriv = dPriv;
_mesa_init_renderbuffer(rb, name);
/* Make sure we're using a null-valued GetPointer routine */
@@ -198,8 +201,9 @@ viaInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format)
* \sa AllocateBuffer
*/
static GLboolean
-calculate_buffer_parameters( struct via_context *vmesa,
- struct gl_framebuffer *fb )
+calculate_buffer_parameters(struct via_context *vmesa,
+ struct gl_framebuffer *fb,
+ __DRIdrawablePrivate *dPriv)
{
const unsigned shift = vmesa->viaScreen->bitsPerPixel / 16;
const unsigned extra = 32;
@@ -215,26 +219,28 @@ calculate_buffer_parameters( struct via_context *vmesa,
if (!vmesa->front.Base.InternalFormat) {
/* do one-time init for the renderbuffers */
- viaInitRenderbuffer(&vmesa->front.Base, GL_RGBA);
+ viaInitRenderbuffer(&vmesa->front, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->front, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &vmesa->front.Base);
if (fb->Visual.doubleBufferMode) {
- viaInitRenderbuffer(&vmesa->back.Base, GL_RGBA);
+ viaInitRenderbuffer(&vmesa->back, GL_RGBA, dPriv);
viaSetSpanFunctions(&vmesa->back, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &vmesa->back.Base);
}
if (vmesa->glCtx->Visual.depthBits > 0) {
- viaInitRenderbuffer(&vmesa->depth.Base,
+ viaInitRenderbuffer(&vmesa->depth,
(vmesa->glCtx->Visual.depthBits == 16
- ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24));
+ ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24),
+ dPriv);
viaSetSpanFunctions(&vmesa->depth, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &vmesa->depth.Base);
}
if (vmesa->glCtx->Visual.stencilBits > 0) {
- viaInitRenderbuffer(&vmesa->stencil.Base, GL_STENCIL_INDEX8_EXT);
+ viaInitRenderbuffer(&vmesa->stencil, GL_STENCIL_INDEX8_EXT,
+ dPriv);
viaSetSpanFunctions(&vmesa->stencil, &fb->Visual);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &vmesa->stencil.Base);
}
@@ -243,11 +249,9 @@ calculate_buffer_parameters( struct via_context *vmesa,
assert(vmesa->front.Base.InternalFormat);
assert(vmesa->front.Base.AllocStorage);
if (fb->Visual.doubleBufferMode) {
- assert(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
- assert(vmesa->front.Base.AllocStorage);
+ assert(vmesa->back.Base.AllocStorage);
}
if (fb->Visual.depthBits) {
- assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
assert(vmesa->depth.Base.AllocStorage);
}
@@ -352,19 +356,11 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
- calculate_buffer_parameters( vmesa, drawbuffer );
+ calculate_buffer_parameters(vmesa, drawbuffer, vmesa->driDrawable);
_mesa_resize_framebuffer(ctx, drawbuffer, width, height);
}
-static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct via_context *vmesa = VIA_CONTEXT(ctx);
- *width = vmesa->driDrawable->w;
- *height = vmesa->driDrawable->h;
-}
-
/* Extension strings exported by the Unichrome driver.
*/
const struct dri_extension card_extensions[] =
@@ -579,7 +575,6 @@ viaCreateContext(const __GLcontextModes *visual,
ctx->Const.MaxPointSizeAA = 1.0;
ctx->Const.PointSizeGranularity = 1.0;
- ctx->Driver.GetBufferSize = viaBufferSize;
ctx->Driver.GetString = viaGetString;
ctx->DriverCtx = (void *)vmesa;
@@ -734,50 +729,72 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv)
void viaXMesaWindowMoved(struct via_context *vmesa)
{
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ __DRIdrawablePrivate *const drawable = vmesa->driDrawable;
+ __DRIdrawablePrivate *const readable = vmesa->driReadable;
+ struct via_renderbuffer *const draw_buffer =
+ (struct via_renderbuffer *) drawable->driverPrivate;
+ struct via_renderbuffer *const read_buffer =
+ (struct via_renderbuffer *) readable->driverPrivate;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
- if (!dPriv)
+ if (!drawable)
return;
switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_BACK_LEFT:
- if (dPriv->numBackClipRects == 0) {
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
+ if (drawable->numBackClipRects == 0) {
+ vmesa->numClipRects = drawable->numClipRects;
+ vmesa->pClipRects = drawable->pClipRects;
}
else {
- vmesa->numClipRects = dPriv->numBackClipRects;
- vmesa->pClipRects = dPriv->pBackClipRects;
+ vmesa->numClipRects = drawable->numBackClipRects;
+ vmesa->pClipRects = drawable->pBackClipRects;
}
break;
case BUFFER_BIT_FRONT_LEFT:
- vmesa->numClipRects = dPriv->numClipRects;
- vmesa->pClipRects = dPriv->pClipRects;
+ vmesa->numClipRects = drawable->numClipRects;
+ vmesa->pClipRects = drawable->pClipRects;
break;
default:
vmesa->numClipRects = 0;
break;
}
- if (vmesa->drawW != dPriv->w ||
- vmesa->drawH != dPriv->h)
- calculate_buffer_parameters( vmesa, vmesa->glCtx->DrawBuffer );
+ if ((draw_buffer->drawW != drawable->w)
+ || (draw_buffer->drawH != drawable->h)) {
+ calculate_buffer_parameters(vmesa, vmesa->glCtx->DrawBuffer,
+ drawable);
+ }
- vmesa->drawXoff = (GLuint)(((dPriv->x * bytePerPixel) & 0x1f) /
+ draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) /
bytePerPixel);
- vmesa->drawX = dPriv->x - vmesa->drawXoff;
- vmesa->drawY = dPriv->y;
- vmesa->drawW = dPriv->w;
- vmesa->drawH = dPriv->h;
+ draw_buffer->drawX = drawable->x - draw_buffer->drawXoff;
+ draw_buffer->drawY = drawable->y;
+ draw_buffer->drawW = drawable->w;
+ draw_buffer->drawH = drawable->h;
+
+ if (drawable != readable) {
+ if ((read_buffer->drawW != readable->w)
+ || (read_buffer->drawH != readable->h)) {
+ calculate_buffer_parameters(vmesa, vmesa->glCtx->ReadBuffer,
+ readable);
+ }
+
+ read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) /
+ bytePerPixel);
+ read_buffer->drawX = readable->x - read_buffer->drawXoff;
+ read_buffer->drawY = readable->y;
+ read_buffer->drawW = readable->w;
+ read_buffer->drawH = readable->h;
+ }
vmesa->front.orig = (vmesa->front.offset +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
vmesa->front.origMap = (vmesa->front.map +
- vmesa->drawY * vmesa->front.pitch +
- vmesa->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
vmesa->back.orig = vmesa->back.offset;
vmesa->depth.orig = vmesa->depth.offset;
@@ -813,15 +830,41 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
- if ( vmesa->driDrawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, vmesa->vblank_flags,
- &vmesa->vbl_seq );
- vmesa->driDrawable = driDrawPriv;
- if ( ! calculate_buffer_parameters( vmesa, drawBuffer ) ) {
- return GL_FALSE;
- }
+ if (vmesa->driDrawable != driDrawPriv) {
+ driDrawableInitVBlank(driDrawPriv, vmesa->vblank_flags,
+ &vmesa->vbl_seq);
}
+ if ((vmesa->driDrawable != driDrawPriv)
+ || (vmesa->driReadable != driReadPriv)) {
+ vmesa->driDrawable = driDrawPriv;
+ vmesa->driReadable = driReadPriv;
+
+ if ((drawBuffer->Width != driDrawPriv->w)
+ || (drawBuffer->Height != driDrawPriv->h)) {
+ _mesa_resize_framebuffer(ctx, drawBuffer,
+ driDrawPriv->w, driDrawPriv->h);
+ drawBuffer->Initialized = GL_TRUE;
+ }
+
+ if (!calculate_buffer_parameters(vmesa, drawBuffer, driDrawPriv)) {
+ return GL_FALSE;
+ }
+
+ if (driDrawPriv != driReadPriv) {
+ if ((readBuffer->Width != driReadPriv->w)
+ || (readBuffer->Height != driReadPriv->h)) {
+ _mesa_resize_framebuffer(ctx, readBuffer,
+ driReadPriv->w, driReadPriv->h);
+ readBuffer->Initialized = GL_TRUE;
+ }
+
+ if (!calculate_buffer_parameters(vmesa, readBuffer, driReadPriv)) {
+ return GL_FALSE;
+ }
+ }
+ }
+
_mesa_make_current(vmesa->glCtx, drawBuffer, readBuffer);
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
@@ -847,7 +890,10 @@ void viaGetLock(struct via_context *vmesa, GLuint flags)
drmGetLock(vmesa->driFd, vmesa->hHWContext, flags);
- DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
+ if (dPriv != vmesa->driReadable) {
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, vmesa->driReadable);
+ }
if (vmesa->sarea->ctxOwner != vmesa->hHWContext) {
vmesa->sarea->ctxOwner = vmesa->hHWContext;
diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h
index 9d7a0e6cb64..77161a8d5df 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.h
+++ b/src/mesa/drivers/dri/unichrome/via_context.h
@@ -98,6 +98,18 @@ struct via_renderbuffer {
* at (drawX,drawY) in screen space.
*/
char *origMap;
+
+ int drawX; /* origin of drawable in draw buffer */
+ int drawY;
+ int drawW;
+ int drawH;
+
+ int drawXoff; /* drawX is 32byte aligned - this is
+ * the delta to the real origin, in
+ * pixel units.
+ */
+
+ __DRIdrawablePrivate *dPriv;
};
@@ -272,16 +284,6 @@ struct via_context {
struct via_renderbuffer *drawBuffer;
- int drawX; /* origin of drawable in draw buffer */
- int drawY;
- int drawW;
- int drawH;
-
- int drawXoff; /* drawX is 32byte aligned - this is
- * the delta to the real origin, in
- * pixel units.
- */
-
GLuint numClipRects; /* cliprects for that buffer */
drm_clip_rect_t *pClipRects;
@@ -294,7 +296,16 @@ struct via_context {
int driFd;
__DRInativeDisplay *display;
- __DRIdrawablePrivate *driDrawable;
+ /**
+ * DRI drawable bound to this context for drawing.
+ */
+ __DRIdrawablePrivate *driDrawable;
+
+ /**
+ * DRI drawable bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadable;
+
__DRIscreenPrivate *driScreen;
viaScreenPrivate *viaScreen;
drm_via_sarea_t *sarea;
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index dd2e93b286f..5d102de93ed 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -182,8 +182,8 @@ static void viaFillBuffer(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nboxes ; i++) {
- int x = pbox[i].x1 - vmesa->drawX;
- int y = pbox[i].y1 - vmesa->drawY;
+ int x = pbox[i].x1 - buffer->drawX;
+ int y = pbox[i].y1 - buffer->drawY;
int w = pbox[i].x2 - pbox[i].x1;
int h = pbox[i].y2 - pbox[i].y1;
@@ -206,6 +206,8 @@ static void viaClear(GLcontext *ctx, GLbitfield mask)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
int flag = 0;
GLuint i = 0;
GLuint clear_depth_mask = 0xf << 28;
@@ -274,8 +276,8 @@ static void viaClear(GLcontext *ctx, GLbitfield mask)
/* flip top to bottom */
cy = dPriv->h - cy - ch;
- cx += vmesa->drawX + vmesa->drawXoff;
- cy += vmesa->drawY;
+ cx += vrb->drawX + vrb->drawXoff;
+ cy += vrb->drawY;
if (!all) {
drm_clip_rect_t *b = vmesa->pClipRects;
@@ -352,8 +354,8 @@ static void viaDoSwapBuffers(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nbox; i++, b++) {
- GLint x = b->x1 - vmesa->drawX;
- GLint y = b->y1 - vmesa->drawY;
+ GLint x = b->x1 - back->drawX;
+ GLint y = b->y1 - back->drawY;
GLint w = b->x2 - b->x1;
GLint h = b->y2 - b->y1;
@@ -766,7 +768,7 @@ static void via_emit_cliprect(struct via_context *vmesa,
vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF);
vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24);
- vb[6] = (HC_SubA_HSPXYOS << 24) | ((31-vmesa->drawXoff) << HC_HSPXOS_SHIFT);
+ vb[6] = (HC_SubA_HSPXYOS << 24) | ((31 - buffer->drawXoff) << HC_HSPXOS_SHIFT);
vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
}
@@ -881,21 +883,25 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags)
}
else if (vmesa->numClipRects) {
drm_clip_rect_t *pbox = vmesa->pClipRects;
-
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
+
+
for (i = 0; i < vmesa->numClipRects; i++) {
drm_clip_rect_t b;
- b.x1 = pbox[i].x1 - (vmesa->drawX + vmesa->drawXoff);
- b.x2 = pbox[i].x2 - (vmesa->drawX + vmesa->drawXoff);
- b.y1 = pbox[i].y1 - vmesa->drawY;
- b.y2 = pbox[i].y2 - vmesa->drawY;
+ b.x1 = pbox[i].x1 - (vrb->drawX + vrb->drawXoff);
+ b.x2 = pbox[i].x2 - (vrb->drawX + vrb->drawXoff);
+ b.y1 = pbox[i].y1 - vrb->drawY;
+ b.y2 = pbox[i].y2 - vrb->drawY;
if (vmesa->scissor &&
!intersect_rect(&b, &b, &vmesa->scissorRect))
continue;
- b.x1 += vmesa->drawXoff;
- b.x2 += vmesa->drawXoff;
+ b.x1 += vrb->drawXoff;
+ b.x2 += vrb->drawXoff;
via_emit_cliprect(vmesa, &b);
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index 98a742c720f..28e1f9451e6 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -182,6 +182,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
}
diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c
index 6ff95cc444c..f1ed98036bf 100644
--- a/src/mesa/drivers/dri/unichrome/via_span.c
+++ b/src/mesa/drivers/dri/unichrome/via_span.c
@@ -41,13 +41,12 @@
#undef LOCAL_VARS
#define LOCAL_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \
+ __DRIdrawablePrivate *dPriv = vrb->dPriv; \
GLuint pitch = vrb->pitch; \
GLuint height = dPriv->h; \
GLint p = 0; \
- char *buf = (char *)(vrb->origMap + vmesa->drawXoff * vrb->bpp); \
+ char *buf = (char *)(vrb->origMap + vrb->drawXoff * vrb->bpp); \
(void) p;
/* ================================================================
@@ -79,12 +78,11 @@
/* 16 bit depthbuffer functions.
*/
#define LOCAL_DEPTH_VARS \
- struct via_context *vmesa = VIA_CONTEXT(ctx); \
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \
struct via_renderbuffer *vrb = (struct via_renderbuffer *) rb; \
+ __DRIdrawablePrivate *dPriv = vrb->dPriv; \
GLuint depth_pitch = vrb->pitch; \
GLuint height = dPriv->h; \
- char *buf = (char *)(vrb->map + (vmesa->drawXoff * vrb->bpp/8))
+ char *buf = (char *)(vrb->map + (vrb->drawXoff * vrb->bpp/8))
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 102a333068f..30b9dc289a7 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -476,6 +476,9 @@ void viaEmitState(struct via_context *vmesa)
*/
if (ctx->Polygon.StippleFlag) {
GLuint *stipple = &ctx->PolygonStipple[0];
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
GLint i;
BEGIN_RING(38);
@@ -498,9 +501,9 @@ void viaEmitState(struct via_context *vmesa)
OUT_RING( HC_HEADER2 );
OUT_RING( (HC_ParaType_NotTex << 16) );
OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32- vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
+ (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32 - vmesa->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
+ (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
ADVANCE_RING();
}
@@ -720,15 +723,18 @@ static void viaColorMask(GLcontext *ctx,
void viaCalcViewport(GLcontext *ctx)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
+ __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
const GLfloat *v = ctx->Viewport._WindowMap.m;
GLfloat *m = vmesa->ViewportMatrix.m;
/* See also via_translate_vertex.
*/
m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vmesa->drawXoff;
+ m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vrb->drawXoff;
m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + vmesa->driDrawable->h + SUBPIXEL_Y;
+ m[MAT_TY] = - v[MAT_TY] + dPriv->h + SUBPIXEL_Y;
m[MAT_SZ] = v[MAT_SZ] * (1.0 / vmesa->depth_max);
m[MAT_TZ] = v[MAT_TZ] * (1.0 / vmesa->depth_max);
}
diff --git a/src/mesa/drivers/ggi/default/.cvsignore b/src/mesa/drivers/ggi/default/.gitignore
index c8a526b14d7..c8a526b14d7 100644
--- a/src/mesa/drivers/ggi/default/.cvsignore
+++ b/src/mesa/drivers/ggi/default/.gitignore
diff --git a/src/mesa/drivers/ggi/display/.cvsignore b/src/mesa/drivers/ggi/display/.gitignore
index 98858db2c0e..98858db2c0e 100644
--- a/src/mesa/drivers/ggi/display/.cvsignore
+++ b/src/mesa/drivers/ggi/display/.gitignore
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index ff0557800ae..a24966b3aeb 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1453,7 +1453,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel &= 0x00ffffff;
pixel |= rgba[i][BCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffff0000;
+ pixel = *ptr4 & 0xffff0000;
pixel |= rgba[i][GCOMP];
pixel |= rgba[i][RCOMP] << 8;
*ptr4 = pixel;
@@ -1463,7 +1463,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel |= rgba[i][BCOMP] << 16;
pixel |= rgba[i][GCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffffff00;
+ pixel = *ptr4 & 0xffffff00;
pixel |= rgba[i][RCOMP];
*ptr4 = pixel;
break;
@@ -1493,7 +1493,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel &= 0x00ffffff;
pixel |= rgba[i][BCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffff0000;
+ pixel = *ptr4 & 0xffff0000;
pixel |= rgba[i][GCOMP];
pixel |= rgba[i++][RCOMP] << 8;
*ptr4 = pixel;
@@ -1504,7 +1504,7 @@ static void put_row_8R8G8B24_ximage( PUT_ROW_ARGS )
pixel |= rgba[i][BCOMP] << 16;
pixel |= rgba[i][GCOMP] << 24;
*ptr4++ = pixel;
- pixel = *ptr4 && 0xffffff00;
+ pixel = *ptr4 & 0xffffff00;
pixel |= rgba[i++][RCOMP];
*ptr4 = pixel;
if (0 == --w)
diff --git a/src/mesa/glapi/.cvsignore b/src/mesa/glapi/.gitignore
index e706bc23cab..e706bc23cab 100644
--- a/src/mesa/glapi/.cvsignore
+++ b/src/mesa/glapi/.gitignore
diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile
index 2f8da126b8e..c52c0903478 100644
--- a/src/mesa/glapi/Makefile
+++ b/src/mesa/glapi/Makefile
@@ -26,6 +26,8 @@ GLX_DIR = $(XORG_BASE)/GL/glx
SERVER_OUTPUTS = $(GLX_DIR)/indirect_dispatch.c \
$(GLX_DIR)/indirect_dispatch_swap.c \
$(GLX_DIR)/indirect_dispatch.h \
+ $(GLX_DIR)/indirect_reqsize.c \
+ $(GLX_DIR)/indirect_reqsize.h \
$(GLX_DIR)/indirect_size_get.c \
$(GLX_DIR)/indirect_size_get.h \
$(GLX_DIR)/indirect_table.c
@@ -37,7 +39,7 @@ API_XML = gl_API.xml \
COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py
COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
-INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce
+INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
all: $(OUTPUTS)
@@ -104,6 +106,12 @@ $(GLX_DIR)/indirect_size_get.h: $(COMMON_GLX) glX_proto_size.py
$(GLX_DIR)/indirect_size_get.c: $(COMMON_GLX) glX_proto_size.py
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m size_c | indent $(INDENT_FLAGS) > $@
+$(GLX_DIR)/indirect_reqsize.h: $(COMMON_GLX) glX_proto_size.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' | indent $(INDENT_FLAGS) -l200 > $@
+
+$(GLX_DIR)/indirect_reqsize.c: $(COMMON_GLX) glX_proto_size.py
+ $(PYTHON2) $(PYTHON_FLAGS) glX_proto_size.py -m reqsize_c | indent $(INDENT_FLAGS) > $@
+
$(GLX_DIR)/indirect_table.c: $(COMMON_GLX) glX_server_table.py glX_API.xml
$(PYTHON2) $(PYTHON_FLAGS) glX_server_table.py -f gl_and_glX_API.xml > $@
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index 1179ac463cf..a128164323a 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -1282,6 +1282,45 @@
#if !defined(IN_DRI_DRIVER)
+#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters
+#define GET_AttachShader(disp) ((disp)->AttachShader)
+#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn)
+#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters
+#define GET_CreateProgram(disp) ((disp)->CreateProgram)
+#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn)
+#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters
+#define GET_CreateShader(disp) ((disp)->CreateShader)
+#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn)
+#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters
+#define GET_DeleteProgram(disp) ((disp)->DeleteProgram)
+#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn)
+#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters
+#define GET_DeleteShader(disp) ((disp)->DeleteShader)
+#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn)
+#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters
+#define GET_DetachShader(disp) ((disp)->DetachShader)
+#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn)
+#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters
+#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders)
+#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn)
+#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters
+#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog)
+#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn)
+#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters
+#define GET_GetProgramiv(disp) ((disp)->GetProgramiv)
+#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn)
+#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters
+#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog)
+#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn)
+#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters
+#define GET_GetShaderiv(disp) ((disp)->GetShaderiv)
+#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn)
+#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters
+#define GET_IsProgram(disp) ((disp)->IsProgram)
+#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn)
+#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters
+#define GET_IsShader(disp) ((disp)->IsShader)
+#define SET_IsShader(disp, fn) ((disp)->IsShader = fn)
#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters
#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate)
#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn)
@@ -1291,6 +1330,24 @@
#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters
#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate)
#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn)
+#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters
+#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv)
+#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn)
+#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters
+#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv)
+#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn)
+#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters
+#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv)
+#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn)
+#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters
+#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv)
+#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn)
+#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters
+#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv)
+#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn)
+#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters
+#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv)
+#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn)
#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters
#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB)
#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn)
@@ -2320,355 +2377,413 @@
#else
-#define driDispatchRemapTable_size 345
+#define driDispatchRemapTable_size 364
extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
-#define StencilFuncSeparate_remap_index 0
-#define StencilMaskSeparate_remap_index 1
-#define StencilOpSeparate_remap_index 2
-#define LoadTransposeMatrixdARB_remap_index 3
-#define LoadTransposeMatrixfARB_remap_index 4
-#define MultTransposeMatrixdARB_remap_index 5
-#define MultTransposeMatrixfARB_remap_index 6
-#define SampleCoverageARB_remap_index 7
-#define CompressedTexImage1DARB_remap_index 8
-#define CompressedTexImage2DARB_remap_index 9
-#define CompressedTexImage3DARB_remap_index 10
-#define CompressedTexSubImage1DARB_remap_index 11
-#define CompressedTexSubImage2DARB_remap_index 12
-#define CompressedTexSubImage3DARB_remap_index 13
-#define GetCompressedTexImageARB_remap_index 14
-#define DisableVertexAttribArrayARB_remap_index 15
-#define EnableVertexAttribArrayARB_remap_index 16
-#define GetProgramEnvParameterdvARB_remap_index 17
-#define GetProgramEnvParameterfvARB_remap_index 18
-#define GetProgramLocalParameterdvARB_remap_index 19
-#define GetProgramLocalParameterfvARB_remap_index 20
-#define GetProgramStringARB_remap_index 21
-#define GetProgramivARB_remap_index 22
-#define GetVertexAttribdvARB_remap_index 23
-#define GetVertexAttribfvARB_remap_index 24
-#define GetVertexAttribivARB_remap_index 25
-#define ProgramEnvParameter4dARB_remap_index 26
-#define ProgramEnvParameter4dvARB_remap_index 27
-#define ProgramEnvParameter4fARB_remap_index 28
-#define ProgramEnvParameter4fvARB_remap_index 29
-#define ProgramLocalParameter4dARB_remap_index 30
-#define ProgramLocalParameter4dvARB_remap_index 31
-#define ProgramLocalParameter4fARB_remap_index 32
-#define ProgramLocalParameter4fvARB_remap_index 33
-#define ProgramStringARB_remap_index 34
-#define VertexAttrib1dARB_remap_index 35
-#define VertexAttrib1dvARB_remap_index 36
-#define VertexAttrib1fARB_remap_index 37
-#define VertexAttrib1fvARB_remap_index 38
-#define VertexAttrib1sARB_remap_index 39
-#define VertexAttrib1svARB_remap_index 40
-#define VertexAttrib2dARB_remap_index 41
-#define VertexAttrib2dvARB_remap_index 42
-#define VertexAttrib2fARB_remap_index 43
-#define VertexAttrib2fvARB_remap_index 44
-#define VertexAttrib2sARB_remap_index 45
-#define VertexAttrib2svARB_remap_index 46
-#define VertexAttrib3dARB_remap_index 47
-#define VertexAttrib3dvARB_remap_index 48
-#define VertexAttrib3fARB_remap_index 49
-#define VertexAttrib3fvARB_remap_index 50
-#define VertexAttrib3sARB_remap_index 51
-#define VertexAttrib3svARB_remap_index 52
-#define VertexAttrib4NbvARB_remap_index 53
-#define VertexAttrib4NivARB_remap_index 54
-#define VertexAttrib4NsvARB_remap_index 55
-#define VertexAttrib4NubARB_remap_index 56
-#define VertexAttrib4NubvARB_remap_index 57
-#define VertexAttrib4NuivARB_remap_index 58
-#define VertexAttrib4NusvARB_remap_index 59
-#define VertexAttrib4bvARB_remap_index 60
-#define VertexAttrib4dARB_remap_index 61
-#define VertexAttrib4dvARB_remap_index 62
-#define VertexAttrib4fARB_remap_index 63
-#define VertexAttrib4fvARB_remap_index 64
-#define VertexAttrib4ivARB_remap_index 65
-#define VertexAttrib4sARB_remap_index 66
-#define VertexAttrib4svARB_remap_index 67
-#define VertexAttrib4ubvARB_remap_index 68
-#define VertexAttrib4uivARB_remap_index 69
-#define VertexAttrib4usvARB_remap_index 70
-#define VertexAttribPointerARB_remap_index 71
-#define BindBufferARB_remap_index 72
-#define BufferDataARB_remap_index 73
-#define BufferSubDataARB_remap_index 74
-#define DeleteBuffersARB_remap_index 75
-#define GenBuffersARB_remap_index 76
-#define GetBufferParameterivARB_remap_index 77
-#define GetBufferPointervARB_remap_index 78
-#define GetBufferSubDataARB_remap_index 79
-#define IsBufferARB_remap_index 80
-#define MapBufferARB_remap_index 81
-#define UnmapBufferARB_remap_index 82
-#define BeginQueryARB_remap_index 83
-#define DeleteQueriesARB_remap_index 84
-#define EndQueryARB_remap_index 85
-#define GenQueriesARB_remap_index 86
-#define GetQueryObjectivARB_remap_index 87
-#define GetQueryObjectuivARB_remap_index 88
-#define GetQueryivARB_remap_index 89
-#define IsQueryARB_remap_index 90
-#define AttachObjectARB_remap_index 91
-#define CompileShaderARB_remap_index 92
-#define CreateProgramObjectARB_remap_index 93
-#define CreateShaderObjectARB_remap_index 94
-#define DeleteObjectARB_remap_index 95
-#define DetachObjectARB_remap_index 96
-#define GetActiveUniformARB_remap_index 97
-#define GetAttachedObjectsARB_remap_index 98
-#define GetHandleARB_remap_index 99
-#define GetInfoLogARB_remap_index 100
-#define GetObjectParameterfvARB_remap_index 101
-#define GetObjectParameterivARB_remap_index 102
-#define GetShaderSourceARB_remap_index 103
-#define GetUniformLocationARB_remap_index 104
-#define GetUniformfvARB_remap_index 105
-#define GetUniformivARB_remap_index 106
-#define LinkProgramARB_remap_index 107
-#define ShaderSourceARB_remap_index 108
-#define Uniform1fARB_remap_index 109
-#define Uniform1fvARB_remap_index 110
-#define Uniform1iARB_remap_index 111
-#define Uniform1ivARB_remap_index 112
-#define Uniform2fARB_remap_index 113
-#define Uniform2fvARB_remap_index 114
-#define Uniform2iARB_remap_index 115
-#define Uniform2ivARB_remap_index 116
-#define Uniform3fARB_remap_index 117
-#define Uniform3fvARB_remap_index 118
-#define Uniform3iARB_remap_index 119
-#define Uniform3ivARB_remap_index 120
-#define Uniform4fARB_remap_index 121
-#define Uniform4fvARB_remap_index 122
-#define Uniform4iARB_remap_index 123
-#define Uniform4ivARB_remap_index 124
-#define UniformMatrix2fvARB_remap_index 125
-#define UniformMatrix3fvARB_remap_index 126
-#define UniformMatrix4fvARB_remap_index 127
-#define UseProgramObjectARB_remap_index 128
-#define ValidateProgramARB_remap_index 129
-#define BindAttribLocationARB_remap_index 130
-#define GetActiveAttribARB_remap_index 131
-#define GetAttribLocationARB_remap_index 132
-#define DrawBuffersARB_remap_index 133
-#define PolygonOffsetEXT_remap_index 134
-#define GetPixelTexGenParameterfvSGIS_remap_index 135
-#define GetPixelTexGenParameterivSGIS_remap_index 136
-#define PixelTexGenParameterfSGIS_remap_index 137
-#define PixelTexGenParameterfvSGIS_remap_index 138
-#define PixelTexGenParameteriSGIS_remap_index 139
-#define PixelTexGenParameterivSGIS_remap_index 140
-#define SampleMaskSGIS_remap_index 141
-#define SamplePatternSGIS_remap_index 142
-#define ColorPointerEXT_remap_index 143
-#define EdgeFlagPointerEXT_remap_index 144
-#define IndexPointerEXT_remap_index 145
-#define NormalPointerEXT_remap_index 146
-#define TexCoordPointerEXT_remap_index 147
-#define VertexPointerEXT_remap_index 148
-#define PointParameterfEXT_remap_index 149
-#define PointParameterfvEXT_remap_index 150
-#define LockArraysEXT_remap_index 151
-#define UnlockArraysEXT_remap_index 152
-#define CullParameterdvEXT_remap_index 153
-#define CullParameterfvEXT_remap_index 154
-#define SecondaryColor3bEXT_remap_index 155
-#define SecondaryColor3bvEXT_remap_index 156
-#define SecondaryColor3dEXT_remap_index 157
-#define SecondaryColor3dvEXT_remap_index 158
-#define SecondaryColor3fEXT_remap_index 159
-#define SecondaryColor3fvEXT_remap_index 160
-#define SecondaryColor3iEXT_remap_index 161
-#define SecondaryColor3ivEXT_remap_index 162
-#define SecondaryColor3sEXT_remap_index 163
-#define SecondaryColor3svEXT_remap_index 164
-#define SecondaryColor3ubEXT_remap_index 165
-#define SecondaryColor3ubvEXT_remap_index 166
-#define SecondaryColor3uiEXT_remap_index 167
-#define SecondaryColor3uivEXT_remap_index 168
-#define SecondaryColor3usEXT_remap_index 169
-#define SecondaryColor3usvEXT_remap_index 170
-#define SecondaryColorPointerEXT_remap_index 171
-#define MultiDrawArraysEXT_remap_index 172
-#define MultiDrawElementsEXT_remap_index 173
-#define FogCoordPointerEXT_remap_index 174
-#define FogCoorddEXT_remap_index 175
-#define FogCoorddvEXT_remap_index 176
-#define FogCoordfEXT_remap_index 177
-#define FogCoordfvEXT_remap_index 178
-#define PixelTexGenSGIX_remap_index 179
-#define BlendFuncSeparateEXT_remap_index 180
-#define FlushVertexArrayRangeNV_remap_index 181
-#define VertexArrayRangeNV_remap_index 182
-#define CombinerInputNV_remap_index 183
-#define CombinerOutputNV_remap_index 184
-#define CombinerParameterfNV_remap_index 185
-#define CombinerParameterfvNV_remap_index 186
-#define CombinerParameteriNV_remap_index 187
-#define CombinerParameterivNV_remap_index 188
-#define FinalCombinerInputNV_remap_index 189
-#define GetCombinerInputParameterfvNV_remap_index 190
-#define GetCombinerInputParameterivNV_remap_index 191
-#define GetCombinerOutputParameterfvNV_remap_index 192
-#define GetCombinerOutputParameterivNV_remap_index 193
-#define GetFinalCombinerInputParameterfvNV_remap_index 194
-#define GetFinalCombinerInputParameterivNV_remap_index 195
-#define ResizeBuffersMESA_remap_index 196
-#define WindowPos2dMESA_remap_index 197
-#define WindowPos2dvMESA_remap_index 198
-#define WindowPos2fMESA_remap_index 199
-#define WindowPos2fvMESA_remap_index 200
-#define WindowPos2iMESA_remap_index 201
-#define WindowPos2ivMESA_remap_index 202
-#define WindowPos2sMESA_remap_index 203
-#define WindowPos2svMESA_remap_index 204
-#define WindowPos3dMESA_remap_index 205
-#define WindowPos3dvMESA_remap_index 206
-#define WindowPos3fMESA_remap_index 207
-#define WindowPos3fvMESA_remap_index 208
-#define WindowPos3iMESA_remap_index 209
-#define WindowPos3ivMESA_remap_index 210
-#define WindowPos3sMESA_remap_index 211
-#define WindowPos3svMESA_remap_index 212
-#define WindowPos4dMESA_remap_index 213
-#define WindowPos4dvMESA_remap_index 214
-#define WindowPos4fMESA_remap_index 215
-#define WindowPos4fvMESA_remap_index 216
-#define WindowPos4iMESA_remap_index 217
-#define WindowPos4ivMESA_remap_index 218
-#define WindowPos4sMESA_remap_index 219
-#define WindowPos4svMESA_remap_index 220
-#define MultiModeDrawArraysIBM_remap_index 221
-#define MultiModeDrawElementsIBM_remap_index 222
-#define DeleteFencesNV_remap_index 223
-#define FinishFenceNV_remap_index 224
-#define GenFencesNV_remap_index 225
-#define GetFenceivNV_remap_index 226
-#define IsFenceNV_remap_index 227
-#define SetFenceNV_remap_index 228
-#define TestFenceNV_remap_index 229
-#define AreProgramsResidentNV_remap_index 230
-#define BindProgramNV_remap_index 231
-#define DeleteProgramsNV_remap_index 232
-#define ExecuteProgramNV_remap_index 233
-#define GenProgramsNV_remap_index 234
-#define GetProgramParameterdvNV_remap_index 235
-#define GetProgramParameterfvNV_remap_index 236
-#define GetProgramStringNV_remap_index 237
-#define GetProgramivNV_remap_index 238
-#define GetTrackMatrixivNV_remap_index 239
-#define GetVertexAttribPointervNV_remap_index 240
-#define GetVertexAttribdvNV_remap_index 241
-#define GetVertexAttribfvNV_remap_index 242
-#define GetVertexAttribivNV_remap_index 243
-#define IsProgramNV_remap_index 244
-#define LoadProgramNV_remap_index 245
-#define ProgramParameter4dNV_remap_index 246
-#define ProgramParameter4dvNV_remap_index 247
-#define ProgramParameter4fNV_remap_index 248
-#define ProgramParameter4fvNV_remap_index 249
-#define ProgramParameters4dvNV_remap_index 250
-#define ProgramParameters4fvNV_remap_index 251
-#define RequestResidentProgramsNV_remap_index 252
-#define TrackMatrixNV_remap_index 253
-#define VertexAttrib1dNV_remap_index 254
-#define VertexAttrib1dvNV_remap_index 255
-#define VertexAttrib1fNV_remap_index 256
-#define VertexAttrib1fvNV_remap_index 257
-#define VertexAttrib1sNV_remap_index 258
-#define VertexAttrib1svNV_remap_index 259
-#define VertexAttrib2dNV_remap_index 260
-#define VertexAttrib2dvNV_remap_index 261
-#define VertexAttrib2fNV_remap_index 262
-#define VertexAttrib2fvNV_remap_index 263
-#define VertexAttrib2sNV_remap_index 264
-#define VertexAttrib2svNV_remap_index 265
-#define VertexAttrib3dNV_remap_index 266
-#define VertexAttrib3dvNV_remap_index 267
-#define VertexAttrib3fNV_remap_index 268
-#define VertexAttrib3fvNV_remap_index 269
-#define VertexAttrib3sNV_remap_index 270
-#define VertexAttrib3svNV_remap_index 271
-#define VertexAttrib4dNV_remap_index 272
-#define VertexAttrib4dvNV_remap_index 273
-#define VertexAttrib4fNV_remap_index 274
-#define VertexAttrib4fvNV_remap_index 275
-#define VertexAttrib4sNV_remap_index 276
-#define VertexAttrib4svNV_remap_index 277
-#define VertexAttrib4ubNV_remap_index 278
-#define VertexAttrib4ubvNV_remap_index 279
-#define VertexAttribPointerNV_remap_index 280
-#define VertexAttribs1dvNV_remap_index 281
-#define VertexAttribs1fvNV_remap_index 282
-#define VertexAttribs1svNV_remap_index 283
-#define VertexAttribs2dvNV_remap_index 284
-#define VertexAttribs2fvNV_remap_index 285
-#define VertexAttribs2svNV_remap_index 286
-#define VertexAttribs3dvNV_remap_index 287
-#define VertexAttribs3fvNV_remap_index 288
-#define VertexAttribs3svNV_remap_index 289
-#define VertexAttribs4dvNV_remap_index 290
-#define VertexAttribs4fvNV_remap_index 291
-#define VertexAttribs4svNV_remap_index 292
-#define VertexAttribs4ubvNV_remap_index 293
-#define AlphaFragmentOp1ATI_remap_index 294
-#define AlphaFragmentOp2ATI_remap_index 295
-#define AlphaFragmentOp3ATI_remap_index 296
-#define BeginFragmentShaderATI_remap_index 297
-#define BindFragmentShaderATI_remap_index 298
-#define ColorFragmentOp1ATI_remap_index 299
-#define ColorFragmentOp2ATI_remap_index 300
-#define ColorFragmentOp3ATI_remap_index 301
-#define DeleteFragmentShaderATI_remap_index 302
-#define EndFragmentShaderATI_remap_index 303
-#define GenFragmentShadersATI_remap_index 304
-#define PassTexCoordATI_remap_index 305
-#define SampleMapATI_remap_index 306
-#define SetFragmentShaderConstantATI_remap_index 307
-#define PointParameteriNV_remap_index 308
-#define PointParameterivNV_remap_index 309
-#define ActiveStencilFaceEXT_remap_index 310
-#define BindVertexArrayAPPLE_remap_index 311
-#define DeleteVertexArraysAPPLE_remap_index 312
-#define GenVertexArraysAPPLE_remap_index 313
-#define IsVertexArrayAPPLE_remap_index 314
-#define GetProgramNamedParameterdvNV_remap_index 315
-#define GetProgramNamedParameterfvNV_remap_index 316
-#define ProgramNamedParameter4dNV_remap_index 317
-#define ProgramNamedParameter4dvNV_remap_index 318
-#define ProgramNamedParameter4fNV_remap_index 319
-#define ProgramNamedParameter4fvNV_remap_index 320
-#define DepthBoundsEXT_remap_index 321
-#define BlendEquationSeparateEXT_remap_index 322
-#define BindFramebufferEXT_remap_index 323
-#define BindRenderbufferEXT_remap_index 324
-#define CheckFramebufferStatusEXT_remap_index 325
-#define DeleteFramebuffersEXT_remap_index 326
-#define DeleteRenderbuffersEXT_remap_index 327
-#define FramebufferRenderbufferEXT_remap_index 328
-#define FramebufferTexture1DEXT_remap_index 329
-#define FramebufferTexture2DEXT_remap_index 330
-#define FramebufferTexture3DEXT_remap_index 331
-#define GenFramebuffersEXT_remap_index 332
-#define GenRenderbuffersEXT_remap_index 333
-#define GenerateMipmapEXT_remap_index 334
-#define GetFramebufferAttachmentParameterivEXT_remap_index 335
-#define GetRenderbufferParameterivEXT_remap_index 336
-#define IsFramebufferEXT_remap_index 337
-#define IsRenderbufferEXT_remap_index 338
-#define RenderbufferStorageEXT_remap_index 339
-#define BlitFramebufferEXT_remap_index 340
-#define ProgramEnvParameters4fvEXT_remap_index 341
-#define ProgramLocalParameters4fvEXT_remap_index 342
-#define GetQueryObjecti64vEXT_remap_index 343
-#define GetQueryObjectui64vEXT_remap_index 344
+#define AttachShader_remap_index 0
+#define CreateProgram_remap_index 1
+#define CreateShader_remap_index 2
+#define DeleteProgram_remap_index 3
+#define DeleteShader_remap_index 4
+#define DetachShader_remap_index 5
+#define GetAttachedShaders_remap_index 6
+#define GetProgramInfoLog_remap_index 7
+#define GetProgramiv_remap_index 8
+#define GetShaderInfoLog_remap_index 9
+#define GetShaderiv_remap_index 10
+#define IsProgram_remap_index 11
+#define IsShader_remap_index 12
+#define StencilFuncSeparate_remap_index 13
+#define StencilMaskSeparate_remap_index 14
+#define StencilOpSeparate_remap_index 15
+#define UniformMatrix2x3fv_remap_index 16
+#define UniformMatrix2x4fv_remap_index 17
+#define UniformMatrix3x2fv_remap_index 18
+#define UniformMatrix3x4fv_remap_index 19
+#define UniformMatrix4x2fv_remap_index 20
+#define UniformMatrix4x3fv_remap_index 21
+#define LoadTransposeMatrixdARB_remap_index 22
+#define LoadTransposeMatrixfARB_remap_index 23
+#define MultTransposeMatrixdARB_remap_index 24
+#define MultTransposeMatrixfARB_remap_index 25
+#define SampleCoverageARB_remap_index 26
+#define CompressedTexImage1DARB_remap_index 27
+#define CompressedTexImage2DARB_remap_index 28
+#define CompressedTexImage3DARB_remap_index 29
+#define CompressedTexSubImage1DARB_remap_index 30
+#define CompressedTexSubImage2DARB_remap_index 31
+#define CompressedTexSubImage3DARB_remap_index 32
+#define GetCompressedTexImageARB_remap_index 33
+#define DisableVertexAttribArrayARB_remap_index 34
+#define EnableVertexAttribArrayARB_remap_index 35
+#define GetProgramEnvParameterdvARB_remap_index 36
+#define GetProgramEnvParameterfvARB_remap_index 37
+#define GetProgramLocalParameterdvARB_remap_index 38
+#define GetProgramLocalParameterfvARB_remap_index 39
+#define GetProgramStringARB_remap_index 40
+#define GetProgramivARB_remap_index 41
+#define GetVertexAttribdvARB_remap_index 42
+#define GetVertexAttribfvARB_remap_index 43
+#define GetVertexAttribivARB_remap_index 44
+#define ProgramEnvParameter4dARB_remap_index 45
+#define ProgramEnvParameter4dvARB_remap_index 46
+#define ProgramEnvParameter4fARB_remap_index 47
+#define ProgramEnvParameter4fvARB_remap_index 48
+#define ProgramLocalParameter4dARB_remap_index 49
+#define ProgramLocalParameter4dvARB_remap_index 50
+#define ProgramLocalParameter4fARB_remap_index 51
+#define ProgramLocalParameter4fvARB_remap_index 52
+#define ProgramStringARB_remap_index 53
+#define VertexAttrib1dARB_remap_index 54
+#define VertexAttrib1dvARB_remap_index 55
+#define VertexAttrib1fARB_remap_index 56
+#define VertexAttrib1fvARB_remap_index 57
+#define VertexAttrib1sARB_remap_index 58
+#define VertexAttrib1svARB_remap_index 59
+#define VertexAttrib2dARB_remap_index 60
+#define VertexAttrib2dvARB_remap_index 61
+#define VertexAttrib2fARB_remap_index 62
+#define VertexAttrib2fvARB_remap_index 63
+#define VertexAttrib2sARB_remap_index 64
+#define VertexAttrib2svARB_remap_index 65
+#define VertexAttrib3dARB_remap_index 66
+#define VertexAttrib3dvARB_remap_index 67
+#define VertexAttrib3fARB_remap_index 68
+#define VertexAttrib3fvARB_remap_index 69
+#define VertexAttrib3sARB_remap_index 70
+#define VertexAttrib3svARB_remap_index 71
+#define VertexAttrib4NbvARB_remap_index 72
+#define VertexAttrib4NivARB_remap_index 73
+#define VertexAttrib4NsvARB_remap_index 74
+#define VertexAttrib4NubARB_remap_index 75
+#define VertexAttrib4NubvARB_remap_index 76
+#define VertexAttrib4NuivARB_remap_index 77
+#define VertexAttrib4NusvARB_remap_index 78
+#define VertexAttrib4bvARB_remap_index 79
+#define VertexAttrib4dARB_remap_index 80
+#define VertexAttrib4dvARB_remap_index 81
+#define VertexAttrib4fARB_remap_index 82
+#define VertexAttrib4fvARB_remap_index 83
+#define VertexAttrib4ivARB_remap_index 84
+#define VertexAttrib4sARB_remap_index 85
+#define VertexAttrib4svARB_remap_index 86
+#define VertexAttrib4ubvARB_remap_index 87
+#define VertexAttrib4uivARB_remap_index 88
+#define VertexAttrib4usvARB_remap_index 89
+#define VertexAttribPointerARB_remap_index 90
+#define BindBufferARB_remap_index 91
+#define BufferDataARB_remap_index 92
+#define BufferSubDataARB_remap_index 93
+#define DeleteBuffersARB_remap_index 94
+#define GenBuffersARB_remap_index 95
+#define GetBufferParameterivARB_remap_index 96
+#define GetBufferPointervARB_remap_index 97
+#define GetBufferSubDataARB_remap_index 98
+#define IsBufferARB_remap_index 99
+#define MapBufferARB_remap_index 100
+#define UnmapBufferARB_remap_index 101
+#define BeginQueryARB_remap_index 102
+#define DeleteQueriesARB_remap_index 103
+#define EndQueryARB_remap_index 104
+#define GenQueriesARB_remap_index 105
+#define GetQueryObjectivARB_remap_index 106
+#define GetQueryObjectuivARB_remap_index 107
+#define GetQueryivARB_remap_index 108
+#define IsQueryARB_remap_index 109
+#define AttachObjectARB_remap_index 110
+#define CompileShaderARB_remap_index 111
+#define CreateProgramObjectARB_remap_index 112
+#define CreateShaderObjectARB_remap_index 113
+#define DeleteObjectARB_remap_index 114
+#define DetachObjectARB_remap_index 115
+#define GetActiveUniformARB_remap_index 116
+#define GetAttachedObjectsARB_remap_index 117
+#define GetHandleARB_remap_index 118
+#define GetInfoLogARB_remap_index 119
+#define GetObjectParameterfvARB_remap_index 120
+#define GetObjectParameterivARB_remap_index 121
+#define GetShaderSourceARB_remap_index 122
+#define GetUniformLocationARB_remap_index 123
+#define GetUniformfvARB_remap_index 124
+#define GetUniformivARB_remap_index 125
+#define LinkProgramARB_remap_index 126
+#define ShaderSourceARB_remap_index 127
+#define Uniform1fARB_remap_index 128
+#define Uniform1fvARB_remap_index 129
+#define Uniform1iARB_remap_index 130
+#define Uniform1ivARB_remap_index 131
+#define Uniform2fARB_remap_index 132
+#define Uniform2fvARB_remap_index 133
+#define Uniform2iARB_remap_index 134
+#define Uniform2ivARB_remap_index 135
+#define Uniform3fARB_remap_index 136
+#define Uniform3fvARB_remap_index 137
+#define Uniform3iARB_remap_index 138
+#define Uniform3ivARB_remap_index 139
+#define Uniform4fARB_remap_index 140
+#define Uniform4fvARB_remap_index 141
+#define Uniform4iARB_remap_index 142
+#define Uniform4ivARB_remap_index 143
+#define UniformMatrix2fvARB_remap_index 144
+#define UniformMatrix3fvARB_remap_index 145
+#define UniformMatrix4fvARB_remap_index 146
+#define UseProgramObjectARB_remap_index 147
+#define ValidateProgramARB_remap_index 148
+#define BindAttribLocationARB_remap_index 149
+#define GetActiveAttribARB_remap_index 150
+#define GetAttribLocationARB_remap_index 151
+#define DrawBuffersARB_remap_index 152
+#define PolygonOffsetEXT_remap_index 153
+#define GetPixelTexGenParameterfvSGIS_remap_index 154
+#define GetPixelTexGenParameterivSGIS_remap_index 155
+#define PixelTexGenParameterfSGIS_remap_index 156
+#define PixelTexGenParameterfvSGIS_remap_index 157
+#define PixelTexGenParameteriSGIS_remap_index 158
+#define PixelTexGenParameterivSGIS_remap_index 159
+#define SampleMaskSGIS_remap_index 160
+#define SamplePatternSGIS_remap_index 161
+#define ColorPointerEXT_remap_index 162
+#define EdgeFlagPointerEXT_remap_index 163
+#define IndexPointerEXT_remap_index 164
+#define NormalPointerEXT_remap_index 165
+#define TexCoordPointerEXT_remap_index 166
+#define VertexPointerEXT_remap_index 167
+#define PointParameterfEXT_remap_index 168
+#define PointParameterfvEXT_remap_index 169
+#define LockArraysEXT_remap_index 170
+#define UnlockArraysEXT_remap_index 171
+#define CullParameterdvEXT_remap_index 172
+#define CullParameterfvEXT_remap_index 173
+#define SecondaryColor3bEXT_remap_index 174
+#define SecondaryColor3bvEXT_remap_index 175
+#define SecondaryColor3dEXT_remap_index 176
+#define SecondaryColor3dvEXT_remap_index 177
+#define SecondaryColor3fEXT_remap_index 178
+#define SecondaryColor3fvEXT_remap_index 179
+#define SecondaryColor3iEXT_remap_index 180
+#define SecondaryColor3ivEXT_remap_index 181
+#define SecondaryColor3sEXT_remap_index 182
+#define SecondaryColor3svEXT_remap_index 183
+#define SecondaryColor3ubEXT_remap_index 184
+#define SecondaryColor3ubvEXT_remap_index 185
+#define SecondaryColor3uiEXT_remap_index 186
+#define SecondaryColor3uivEXT_remap_index 187
+#define SecondaryColor3usEXT_remap_index 188
+#define SecondaryColor3usvEXT_remap_index 189
+#define SecondaryColorPointerEXT_remap_index 190
+#define MultiDrawArraysEXT_remap_index 191
+#define MultiDrawElementsEXT_remap_index 192
+#define FogCoordPointerEXT_remap_index 193
+#define FogCoorddEXT_remap_index 194
+#define FogCoorddvEXT_remap_index 195
+#define FogCoordfEXT_remap_index 196
+#define FogCoordfvEXT_remap_index 197
+#define PixelTexGenSGIX_remap_index 198
+#define BlendFuncSeparateEXT_remap_index 199
+#define FlushVertexArrayRangeNV_remap_index 200
+#define VertexArrayRangeNV_remap_index 201
+#define CombinerInputNV_remap_index 202
+#define CombinerOutputNV_remap_index 203
+#define CombinerParameterfNV_remap_index 204
+#define CombinerParameterfvNV_remap_index 205
+#define CombinerParameteriNV_remap_index 206
+#define CombinerParameterivNV_remap_index 207
+#define FinalCombinerInputNV_remap_index 208
+#define GetCombinerInputParameterfvNV_remap_index 209
+#define GetCombinerInputParameterivNV_remap_index 210
+#define GetCombinerOutputParameterfvNV_remap_index 211
+#define GetCombinerOutputParameterivNV_remap_index 212
+#define GetFinalCombinerInputParameterfvNV_remap_index 213
+#define GetFinalCombinerInputParameterivNV_remap_index 214
+#define ResizeBuffersMESA_remap_index 215
+#define WindowPos2dMESA_remap_index 216
+#define WindowPos2dvMESA_remap_index 217
+#define WindowPos2fMESA_remap_index 218
+#define WindowPos2fvMESA_remap_index 219
+#define WindowPos2iMESA_remap_index 220
+#define WindowPos2ivMESA_remap_index 221
+#define WindowPos2sMESA_remap_index 222
+#define WindowPos2svMESA_remap_index 223
+#define WindowPos3dMESA_remap_index 224
+#define WindowPos3dvMESA_remap_index 225
+#define WindowPos3fMESA_remap_index 226
+#define WindowPos3fvMESA_remap_index 227
+#define WindowPos3iMESA_remap_index 228
+#define WindowPos3ivMESA_remap_index 229
+#define WindowPos3sMESA_remap_index 230
+#define WindowPos3svMESA_remap_index 231
+#define WindowPos4dMESA_remap_index 232
+#define WindowPos4dvMESA_remap_index 233
+#define WindowPos4fMESA_remap_index 234
+#define WindowPos4fvMESA_remap_index 235
+#define WindowPos4iMESA_remap_index 236
+#define WindowPos4ivMESA_remap_index 237
+#define WindowPos4sMESA_remap_index 238
+#define WindowPos4svMESA_remap_index 239
+#define MultiModeDrawArraysIBM_remap_index 240
+#define MultiModeDrawElementsIBM_remap_index 241
+#define DeleteFencesNV_remap_index 242
+#define FinishFenceNV_remap_index 243
+#define GenFencesNV_remap_index 244
+#define GetFenceivNV_remap_index 245
+#define IsFenceNV_remap_index 246
+#define SetFenceNV_remap_index 247
+#define TestFenceNV_remap_index 248
+#define AreProgramsResidentNV_remap_index 249
+#define BindProgramNV_remap_index 250
+#define DeleteProgramsNV_remap_index 251
+#define ExecuteProgramNV_remap_index 252
+#define GenProgramsNV_remap_index 253
+#define GetProgramParameterdvNV_remap_index 254
+#define GetProgramParameterfvNV_remap_index 255
+#define GetProgramStringNV_remap_index 256
+#define GetProgramivNV_remap_index 257
+#define GetTrackMatrixivNV_remap_index 258
+#define GetVertexAttribPointervNV_remap_index 259
+#define GetVertexAttribdvNV_remap_index 260
+#define GetVertexAttribfvNV_remap_index 261
+#define GetVertexAttribivNV_remap_index 262
+#define IsProgramNV_remap_index 263
+#define LoadProgramNV_remap_index 264
+#define ProgramParameter4dNV_remap_index 265
+#define ProgramParameter4dvNV_remap_index 266
+#define ProgramParameter4fNV_remap_index 267
+#define ProgramParameter4fvNV_remap_index 268
+#define ProgramParameters4dvNV_remap_index 269
+#define ProgramParameters4fvNV_remap_index 270
+#define RequestResidentProgramsNV_remap_index 271
+#define TrackMatrixNV_remap_index 272
+#define VertexAttrib1dNV_remap_index 273
+#define VertexAttrib1dvNV_remap_index 274
+#define VertexAttrib1fNV_remap_index 275
+#define VertexAttrib1fvNV_remap_index 276
+#define VertexAttrib1sNV_remap_index 277
+#define VertexAttrib1svNV_remap_index 278
+#define VertexAttrib2dNV_remap_index 279
+#define VertexAttrib2dvNV_remap_index 280
+#define VertexAttrib2fNV_remap_index 281
+#define VertexAttrib2fvNV_remap_index 282
+#define VertexAttrib2sNV_remap_index 283
+#define VertexAttrib2svNV_remap_index 284
+#define VertexAttrib3dNV_remap_index 285
+#define VertexAttrib3dvNV_remap_index 286
+#define VertexAttrib3fNV_remap_index 287
+#define VertexAttrib3fvNV_remap_index 288
+#define VertexAttrib3sNV_remap_index 289
+#define VertexAttrib3svNV_remap_index 290
+#define VertexAttrib4dNV_remap_index 291
+#define VertexAttrib4dvNV_remap_index 292
+#define VertexAttrib4fNV_remap_index 293
+#define VertexAttrib4fvNV_remap_index 294
+#define VertexAttrib4sNV_remap_index 295
+#define VertexAttrib4svNV_remap_index 296
+#define VertexAttrib4ubNV_remap_index 297
+#define VertexAttrib4ubvNV_remap_index 298
+#define VertexAttribPointerNV_remap_index 299
+#define VertexAttribs1dvNV_remap_index 300
+#define VertexAttribs1fvNV_remap_index 301
+#define VertexAttribs1svNV_remap_index 302
+#define VertexAttribs2dvNV_remap_index 303
+#define VertexAttribs2fvNV_remap_index 304
+#define VertexAttribs2svNV_remap_index 305
+#define VertexAttribs3dvNV_remap_index 306
+#define VertexAttribs3fvNV_remap_index 307
+#define VertexAttribs3svNV_remap_index 308
+#define VertexAttribs4dvNV_remap_index 309
+#define VertexAttribs4fvNV_remap_index 310
+#define VertexAttribs4svNV_remap_index 311
+#define VertexAttribs4ubvNV_remap_index 312
+#define AlphaFragmentOp1ATI_remap_index 313
+#define AlphaFragmentOp2ATI_remap_index 314
+#define AlphaFragmentOp3ATI_remap_index 315
+#define BeginFragmentShaderATI_remap_index 316
+#define BindFragmentShaderATI_remap_index 317
+#define ColorFragmentOp1ATI_remap_index 318
+#define ColorFragmentOp2ATI_remap_index 319
+#define ColorFragmentOp3ATI_remap_index 320
+#define DeleteFragmentShaderATI_remap_index 321
+#define EndFragmentShaderATI_remap_index 322
+#define GenFragmentShadersATI_remap_index 323
+#define PassTexCoordATI_remap_index 324
+#define SampleMapATI_remap_index 325
+#define SetFragmentShaderConstantATI_remap_index 326
+#define PointParameteriNV_remap_index 327
+#define PointParameterivNV_remap_index 328
+#define ActiveStencilFaceEXT_remap_index 329
+#define BindVertexArrayAPPLE_remap_index 330
+#define DeleteVertexArraysAPPLE_remap_index 331
+#define GenVertexArraysAPPLE_remap_index 332
+#define IsVertexArrayAPPLE_remap_index 333
+#define GetProgramNamedParameterdvNV_remap_index 334
+#define GetProgramNamedParameterfvNV_remap_index 335
+#define ProgramNamedParameter4dNV_remap_index 336
+#define ProgramNamedParameter4dvNV_remap_index 337
+#define ProgramNamedParameter4fNV_remap_index 338
+#define ProgramNamedParameter4fvNV_remap_index 339
+#define DepthBoundsEXT_remap_index 340
+#define BlendEquationSeparateEXT_remap_index 341
+#define BindFramebufferEXT_remap_index 342
+#define BindRenderbufferEXT_remap_index 343
+#define CheckFramebufferStatusEXT_remap_index 344
+#define DeleteFramebuffersEXT_remap_index 345
+#define DeleteRenderbuffersEXT_remap_index 346
+#define FramebufferRenderbufferEXT_remap_index 347
+#define FramebufferTexture1DEXT_remap_index 348
+#define FramebufferTexture2DEXT_remap_index 349
+#define FramebufferTexture3DEXT_remap_index 350
+#define GenFramebuffersEXT_remap_index 351
+#define GenRenderbuffersEXT_remap_index 352
+#define GenerateMipmapEXT_remap_index 353
+#define GetFramebufferAttachmentParameterivEXT_remap_index 354
+#define GetRenderbufferParameterivEXT_remap_index 355
+#define IsFramebufferEXT_remap_index 356
+#define IsRenderbufferEXT_remap_index 357
+#define RenderbufferStorageEXT_remap_index 358
+#define BlitFramebufferEXT_remap_index 359
+#define ProgramEnvParameters4fvEXT_remap_index 360
+#define ProgramLocalParameters4fvEXT_remap_index 361
+#define GetQueryObjecti64vEXT_remap_index 362
+#define GetQueryObjectui64vEXT_remap_index 363
+#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters)
+#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index])
+#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn)
+#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters)
+#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index])
+#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn)
+#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters)
+#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index])
+#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn)
+#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters)
+#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index])
+#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn)
+#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters)
+#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index])
+#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn)
+#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters)
+#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index])
+#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn)
+#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters)
+#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index])
+#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn)
+#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters)
+#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index])
+#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn)
+#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters)
+#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index])
+#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn)
+#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters)
+#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index])
+#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn)
+#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters)
+#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index])
+#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn)
+#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters)
+#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index])
+#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn)
+#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters)
+#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index])
+#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn)
#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters)
#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index])
#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn)
@@ -2678,6 +2793,24 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters)
#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index])
#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn)
+#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters)
+#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index])
+#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn)
+#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters)
+#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index])
+#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn)
+#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters)
+#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index])
+#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn)
+#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters)
+#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index])
+#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn)
+#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters)
+#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index])
+#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn)
+#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters)
+#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index])
+#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn)
#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters)
#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index])
#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn)
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py
index 3759e8da02e..1b5c3239e01 100644
--- a/src/mesa/glapi/glX_XML.py
+++ b/src/mesa/glapi/glX_XML.py
@@ -262,7 +262,7 @@ class glx_function(gl_XML.gl_function):
if param.name != self.img_reset:
param.offset = offset
- if not param.is_variable_length():
+ if not param.is_variable_length() and not param.is_client_only:
offset += param.size()
if self.pad_after( param ):
@@ -331,7 +331,7 @@ class glx_function(gl_XML.gl_function):
size = 0
for param in self.parameterIterateGlxSend(0):
- if param.name != self.img_reset:
+ if param.name != self.img_reset and not param.is_client_only:
if size == 0:
size = param.offset + param.size()
else:
diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py
index 527f6f10eef..20f75575cf1 100644
--- a/src/mesa/glapi/glX_proto_recv.py
+++ b/src/mesa/glapi/glX_proto_recv.py
@@ -81,31 +81,12 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto):
print '#include <GL/gl.h>'
print '#include <GL/glxproto.h>'
-
- # FIXME: Since this block will require changes as other
- # FIXME: platforms are added, it should probably be in a
- # FIXME: header file that is not generated by a script.
-
- if self.do_swap:
- print '#ifdef __linux__'
- print '#include <byteswap.h>'
- print '#elif defined(__OpenBSD__)'
- print '#include <sys/endian.h>'
- print '#define bswap_16 __swap16'
- print '#define bswap_32 __swap32'
- print '#define bswap_64 __swap64'
- print '#else'
- print '#include <sys/endian.h>'
- print '#define bswap_16 bswap16'
- print '#define bswap_32 bswap32'
- print '#define bswap_64 bswap64'
- print '#endif'
-
print '#include <inttypes.h>'
print '#include "indirect_size.h"'
print '#include "indirect_size_get.h"'
print '#include "indirect_dispatch.h"'
print '#include "glxserver.h"'
+ print '#include "glxbyteorder.h"'
print '#include "indirect_util.h"'
print '#include "singlesize.h"'
print '#include "glapitable.h"'
diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py
index 18bfa1b71bc..2b9a6433622 100644
--- a/src/mesa/glapi/glX_proto_size.py
+++ b/src/mesa/glapi/glX_proto_size.py
@@ -447,18 +447,10 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
print ''
print '#include <GL/gl.h>'
print '#include "glxserver.h"'
+ print '#include "glxbyteorder.h"'
print '#include "indirect_size.h"'
print '#include "indirect_reqsize.h"'
print ''
- print '#if defined(linux)'
- print '# include <byteswap.h>'
- print '# define SWAP_32(v) do { (v) = bswap_32(v); } while(0)'
- print '#else'
- print '# include <X11/misc.h>'
- print '# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0)'
- print '#endif'
-
- print ''
print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
print ''
print '#if defined(__CYGWIN__) || defined(__MINGW32__)'
@@ -538,7 +530,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
if fixup:
print ' if (swap) {'
for name in fixup:
- print ' SWAP_32( %s );' % (name)
+ print ' %s = bswap_32(%s);' % (name, name)
print ' }'
return
diff --git a/src/mesa/glapi/gl_API.dtd b/src/mesa/glapi/gl_API.dtd
index 2f0c88aae5b..f89d3818663 100644
--- a/src/mesa/glapi/gl_API.dtd
+++ b/src/mesa/glapi/gl_API.dtd
@@ -40,6 +40,7 @@
mode (get | set) "set">
<!ATTLIST param name NMTOKEN #REQUIRED
type CDATA #REQUIRED
+ client_only (true | false) "false"
count NMTOKEN #IMPLIED
counter (true | false) "false"
count_scale NMTOKEN "1"
@@ -79,6 +80,9 @@ will just mean adding a '<glx ignore="true"/>' tag.
param:
name - name of the parameter
type - fully qualified type (e.g., with "const", etc.)
+ client_only - boolean flag set on parameters which are interpreted only
+ by the client and are not present in the protocol encoding (e.g.,
+ the stride parameters to Map1f, etc.)
count - for counted arrays (e.g., the 'lists' parameter to glCallLists),
the parameter or literal that represents the count. For functions
like glVertex3fv it will be a litteral, for others it will be one of
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index b6169f060d1..905c4a03a67 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -2364,9 +2364,9 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLdouble"/>
<param name="u2" type="GLdouble"/>
- <param name="stride" type="GLint"/>
+ <param name="stride" type="GLint" client_only="true"/>
<param name="order" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
+ <param name="points" type="const GLdouble *" variable_param="order"/>
<glx rop="143" handcode="true"/>
</function>
@@ -2374,9 +2374,9 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLfloat"/>
<param name="u2" type="GLfloat"/>
- <param name="stride" type="GLint"/>
+ <param name="stride" type="GLint" client_only="true"/>
<param name="order" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
+ <param name="points" type="const GLfloat *" variable_param="order"/>
<glx rop="144" handcode="true"/>
</function>
@@ -2384,13 +2384,13 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLdouble"/>
<param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint"/>
+ <param name="ustride" type="GLint" client_only="true"/>
<param name="uorder" type="GLint"/>
<param name="v1" type="GLdouble"/>
<param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint"/>
+ <param name="vstride" type="GLint" client_only="true"/>
<param name="vorder" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
+ <param name="points" type="const GLdouble *" variable_param="uorder"/>
<glx rop="145" handcode="true"/>
</function>
@@ -2398,13 +2398,13 @@
<param name="target" type="GLenum"/>
<param name="u1" type="GLfloat"/>
<param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint"/>
+ <param name="ustride" type="GLint" client_only="true"/>
<param name="uorder" type="GLint"/>
<param name="v1" type="GLfloat"/>
<param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint"/>
+ <param name="vstride" type="GLint" client_only="true"/>
<param name="vorder" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
+ <param name="points" type="const GLfloat *" variable_param="uorder"/>
<glx rop="146" handcode="true"/>
</function>
@@ -5021,13 +5021,98 @@
<category name="2.0">
- <!-- XXX this section is very much incomplete!!! -->
- <!-- These function offsets may change too!!! -->
-
- <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <type name="char" size="1" glx_name="CARD8"/>
+
+ <enum name="GL_BLEND_EQUATION_RGB" value="0x8009"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" value="0x8622"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_SIZE" value="0x8623"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" value="0x8624"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_TYPE" value="0x8625"/>
+ <enum name="CURRENT_VERTEX_ATTRIB" value="0x8626"/>
+ <enum name="VERTEX_PROGRAM_POINT_SIZE" value="0x8642"/>
+ <enum name="VERTEX_PROGRAM_TWO_SIDE" value="0x8643"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
+ <enum name="STENCIL_BACK_FUNC" value="0x8800"/>
+ <enum name="STENCIL_BACK_FAIL" value="0x8801"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" value="0x8802"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_PASS" value="0x8803"/>
+ <enum name="MAX_DRAW_BUFFERS" value="0x8824"/>
+ <enum name="DRAW_BUFFER0" value="0x8825"/>
+ <enum name="DRAW_BUFFER1" value="0x8826"/>
+ <enum name="DRAW_BUFFER2" value="0x8827"/>
+ <enum name="DRAW_BUFFER3" value="0x8828"/>
+ <enum name="DRAW_BUFFER4" value="0x8829"/>
+ <enum name="DRAW_BUFFER5" value="0x882A"/>
+ <enum name="DRAW_BUFFER6" value="0x882B"/>
+ <enum name="DRAW_BUFFER7" value="0x882C"/>
+ <enum name="DRAW_BUFFER8" value="0x882D"/>
+ <enum name="DRAW_BUFFER9" value="0x882E"/>
+ <enum name="DRAW_BUFFER10" value="0x882F"/>
+ <enum name="DRAW_BUFFER11" value="0x8830"/>
+ <enum name="DRAW_BUFFER12" value="0x8831"/>
+ <enum name="DRAW_BUFFER13" value="0x8832"/>
+ <enum name="DRAW_BUFFER14" value="0x8833"/>
+ <enum name="DRAW_BUFFER15" value="0x8834"/>
+ <enum name="BLEND_EQUATION_ALPHA" value="0x883D"/>
+ <enum name="POINT_SPRITE" value="0x8861"/>
+ <enum name="COORD_REPLACE" value="0x8862"/>
+ <enum name="MAX_VERTEX_ATTRIBS" value="0x8869"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
+ <enum name="MAX_TEXTURE_COORDS" value="0x8871"/>
+ <enum name="MAX_TEXTURE_IMAGE_UNITS" value="0x8872"/>
+ <enum name="FRAGMENT_SHADER" value="0x8B30"/>
+ <enum name="VERTEX_SHADER" value="0x8B31"/>
+ <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS" value="0x8B49"/>
+ <enum name="MAX_VERTEX_UNIFORM_COMPONENTS" value="0x8B4A"/>
+ <enum name="MAX_VARYING_FLOATS" value="0x8B4B"/>
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
+ <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
+ <enum name="SHADER_TYPE" value="0x8B4F"/>
+ <enum name="FLOAT_VEC2" value="0x8B50"/>
+ <enum name="FLOAT_VEC3" value="0x8B51"/>
+ <enum name="FLOAT_VEC4" value="0x8B52"/>
+ <enum name="INT_VEC2" value="0x8B53"/>
+ <enum name="INT_VEC3" value="0x8B54"/>
+ <enum name="INT_VEC4" value="0x8B55"/>
+ <enum name="BOOL" value="0x8B56"/>
+ <enum name="BOOL_VEC2" value="0x8B57"/>
+ <enum name="BOOL_VEC3" value="0x8B58"/>
+ <enum name="BOOL_VEC4" value="0x8B59"/>
+ <enum name="FLOAT_MAT2" value="0x8B5A"/>
+ <enum name="FLOAT_MAT3" value="0x8B5B"/>
+ <enum name="FLOAT_MAT4" value="0x8B5C"/>
+ <enum name="SAMPLER_1D" value="0x8B5D"/>
+ <enum name="SAMPLER_2D" value="0x8B5E"/>
+ <enum name="SAMPLER_3D" value="0x8B5F"/>
+ <enum name="SAMPLER_CUBE" value="0x8B60"/>
+ <enum name="SAMPLER_1D_SHADOW" value="0x8B61"/>
+ <enum name="SAMPLER_2D_SHADOW" value="0x8B62"/>
+ <enum name="DELETE_STATUS" value="0x8B80"/>
+ <enum name="COMPILE_STATUS" value="0x8B81"/>
+ <enum name="LINK_STATUS" value="0x8B82"/>
+ <enum name="VALIDATE_STATUS" value="0x8B83"/>
+ <enum name="INFO_LOG_LENGTH" value="0x8B84"/>
+ <enum name="ATTACHED_SHADERS" value="0x8B85"/>
+ <enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
+ <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
+ <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
+ <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
+ <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
+ <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT" value="0x8B8B"/>
+ <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
+ <enum name="CURRENT_PROGRAM" value="0x8B8D"/>
+ <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
<size name="PointParameterfvEXT"/>
<size name="PointParameterivNV"/>
</enum>
+ <enum name="LOWER_LEFT" value="0x8CA1"/>
+ <enum name="UPPER_LEFT" value="0x8CA2"/>
+ <enum name="STENCIL_BACK_REF" value="0x8CA3"/>
+ <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
+ <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
<function name="BlendEquationSeparate" alias="BlendEquationSeparateEXT">
<param name="modeRGB" type="GLenum"/>
@@ -5044,6 +5129,7 @@
<param name="func" type="GLenum"/>
<param name="ref" type="GLint"/>
<param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
</function>
<function name="StencilOpSeparate" offset="assign">
@@ -5051,12 +5137,588 @@
<param name="fail" type="GLenum"/>
<param name="zfail" type="GLenum"/>
<param name="zpass" type="GLenum"/>
+ <glx ignore="true"/>
</function>
<function name="StencilMaskSeparate" offset="assign">
<param name="face" type="GLenum"/>
<param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AttachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BindAttribLocation" alias="BindAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CompileShader" alias="CompileShaderARB">
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateProgram" offset="assign">
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateShader" offset="assign">
+ <param name="type" type="GLenum"/>
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DetachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DisableVertexAttribArray" alias="DisableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="EnableVertexAttribArray" alias="EnableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveAttrib" alias="GetActiveAttribARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei "/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveUniform" alias="GetActiveUniformARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttachedShaders" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="maxCount" type="GLsizei"/>
+ <param name="count" type="GLsizei *" output="true"/>
+ <param name="obj" type="GLuint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttribLocation" alias="GetAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramiv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramInfoLog" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderiv" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderInfoLog" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderSource" alias="GetShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="source" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformLocation" alias="GetUniformLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformfv" alias="GetUniformfvARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformiv" alias="GetUniformivARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribdv" alias="GetVertexAttribdvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribfv" alias="GetVertexAttribfvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribiv" alias="GetVertexAttribivARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribPointerv" alias="GetVertexAttribPointervARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsShader" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LinkProgram" alias="LinkProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ShaderSource" alias="ShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLchar **"/>
+ <param name="length" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UseProgram" alias="UseProgramObjectARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1f" alias="Uniform1fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2f" alias="Uniform2fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3f" alias="Uniform3fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4f" alias="Uniform4fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="v3" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1i" alias="Uniform1iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2i" alias="Uniform2iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3i" alias="Uniform3iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4i" alias="Uniform4iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <param name="v3" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fv" alias="Uniform1fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2fv" alias="Uniform2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3fv" alias="Uniform3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4fv" alias="Uniform4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1iv" alias="Uniform1ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2iv" alias="Uniform2ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3iv" alias="Uniform3ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4iv" alias="Uniform4ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix2fv" alias="UniformMatrix2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3fv" alias="UniformMatrix3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4fv" alias="UniformMatrix4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ValidateProgram" alias="ValidateProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexAttrib1d" alias="VertexAttrib1dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib1dv" alias="VertexAttrib1dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib1f" alias="VertexAttrib1fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib1fv" alias="VertexAttrib1fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib1s" alias="VertexAttrib1sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib1sv" alias="VertexAttrib1svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib2d" alias="VertexAttrib2dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib2dv" alias="VertexAttrib2dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib2f" alias="VertexAttrib2fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib2fv" alias="VertexAttrib2fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib2s" alias="VertexAttrib2sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib2sv" alias="VertexAttrib2svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib3d" alias="VertexAttrib3dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib3dv" alias="VertexAttrib3dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib3f" alias="VertexAttrib3fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib3fv" alias="VertexAttrib3fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib3s" alias="VertexAttrib3sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib3sv" alias="VertexAttrib3svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib4Nbv" alias="VertexAttrib4NbvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *"/>
+ </function>
+ <function name="VertexAttrib4Niv" alias="VertexAttrib4NivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+ <function name="VertexAttrib4Nsv" alias="VertexAttrib4NsvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+ <function name="VertexAttrib4Nub" alias="VertexAttrib4NubARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLubyte"/>
+ <param name="y" type="GLubyte"/>
+ <param name="z" type="GLubyte"/>
+ <param name="w" type="GLubyte"/>
+ </function>
+ <function name="VertexAttrib4Nubv" alias="VertexAttrib4NubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *"/>
+ </function>
+ <function name="VertexAttrib4Nuiv" alias="VertexAttrib4NuivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+ <function name="VertexAttrib4Nusv" alias="VertexAttrib4NusvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *"/>
+ </function>
+
+ <function name="VertexAttrib4d" alias="VertexAttrib4dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib4dv" alias="VertexAttrib4dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib4f" alias="VertexAttrib4fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib4fv" alias="VertexAttrib4fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
</function>
+ <function name="VertexAttrib4s" alias="VertexAttrib4sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib4sv" alias="VertexAttrib4svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttribPointer" alias="VertexAttribPointerARB">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+</category>
+
+
+<category name="2.1">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <enum name="GL_CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/>
+ <enum name="GL_PIXEL_PACK_BUFFER" value="0x88EB"/>
+ <enum name="GL_PIXEL_UNPACK_BUFFER" value="0x88EC"/>
+ <enum name="GL_PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/>
+ <enum name="GL_PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/>
+ <enum name="GL_FLOAT_MAT2x3" value="0x8B65"/>
+ <enum name="GL_FLOAT_MAT2x4" value="0x8B66"/>
+ <enum name="GL_FLOAT_MAT3x2" value="0x8B67"/>
+ <enum name="GL_FLOAT_MAT3x4" value="0x8B68"/>
+ <enum name="GL_FLOAT_MAT4x2" value="0x8B69"/>
+ <enum name="GL_FLOAT_MAT4x3" value="0x8B6A"/>
+ <enum name="GL_SRGB" value="0x8C40"/>
+ <enum name="GL_SRGB8" value="0x8C41"/>
+ <enum name="GL_SRGB_ALPHA" value="0x8C42"/>
+ <enum name="GL_SRGB8_ALPHA8" value="0x8C43"/>
+ <enum name="GL_SLUMINANCE_ALPHA" value="0x8C44"/>
+ <enum name="GL_SLUMINANCE8_ALPHA8" value="0x8C45"/>
+ <enum name="GL_SLUMINANCE" value="0x8C46"/>
+ <enum name="GL_SLUMINANCE8" value="0x8C47"/>
+ <enum name="GL_COMPRESSED_SRGB" value="0x8C48"/>
+ <enum name="GL_COMPRESSED_SRGB_ALPHA" value="0x8C49"/>
+ <enum name="GL_COMPRESSED_SLUMINANCE" value="0x8C4A"/>
+ <enum name="GL_COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/>
+
+ <function name="UniformMatrix2x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix2x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
</category>
@@ -6834,7 +7496,7 @@
</function>
<function name="ShaderSourceARB" offset="assign">
- <param name="shaderObj" type="GLhandleARB"/>
+ <param name="shader" type="GLhandleARB"/>
<param name="count" type="GLsizei"/>
<param name="string" type="const GLcharARB **"/>
<param name="length" type="const GLint *"/>
@@ -6842,7 +7504,7 @@
</function>
<function name="CompileShaderARB" offset="assign">
- <param name="shaderObj" type="GLhandleARB"/>
+ <param name="shader" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
@@ -6858,17 +7520,17 @@
</function>
<function name="LinkProgramARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
<function name="UseProgramObjectARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
<function name="ValidateProgramARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<glx ignore="true"/>
</function>
@@ -7043,16 +7705,16 @@
</function>
<function name="GetUniformLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="name" type="const GLcharARB *"/>
<return type="GLint"/>
<glx ignore="true"/>
</function>
<function name="GetActiveUniformARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
@@ -7061,22 +7723,22 @@
</function>
<function name="GetUniformfvARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="location" type="GLint"/>
<param name="params" type="GLfloat *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetUniformivARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="location" type="GLint"/>
<param name="params" type="GLint *" output="true"/>
<glx ignore="true"/>
</function>
<function name="GetShaderSourceARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="shader" type="GLhandleARB"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="source" type="GLcharARB *" output="true"/>
<glx ignore="true"/>
@@ -7093,16 +7755,16 @@
<enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" value="0x8B8A"/>
<function name="BindAttribLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
<param name="name" type="const GLcharARB *"/>
<glx ignore="true"/>
</function>
<function name="GetActiveAttribARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="index" type="GLuint"/>
- <param name="maxLength" type="GLsizei"/>
+ <param name="bufSize" type="GLsizei"/>
<param name="length" type="GLsizei *" output="true"/>
<param name="size" type="GLint *" output="true"/>
<param name="type" type="GLenum *" output="true"/>
@@ -7111,7 +7773,7 @@
</function>
<function name="GetAttribLocationARB" offset="assign">
- <param name="programObj" type="GLhandleARB"/>
+ <param name="program" type="GLhandleARB"/>
<param name="name" type="const GLcharARB *"/>
<return type="GLint"/>
<glx ignore="true"/>
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index 15c3adc02b7..b7a7388400d 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -438,8 +438,9 @@ class gl_parameter:
#if ts == "GLdouble":
# print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())
- self.is_counter = is_attr_true( element, 'counter' )
- self.is_output = is_attr_true( element, 'output' )
+ self.is_client_only = is_attr_true( element, 'client_only' )
+ self.is_counter = is_attr_true( element, 'counter' )
+ self.is_output = is_attr_true( element, 'output' )
# Pixel data has special parameters.
diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index e8c0576fd9b..0e3c57042a6 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -148,7 +148,7 @@ int _mesa_lookup_enum_by_name( const char *symbol )
string_offsets = {}
i = 0;
- print 'static const char enum_string_table[] = '
+ print 'LONGSTRING static const char enum_string_table[] = '
for [name, enum] in name_table:
print ' "%s\\0"' % (name)
string_offsets[ name ] = i
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py
index 425943d25d2..96e59a58ca1 100644
--- a/src/mesa/glapi/gl_procs.py
+++ b/src/mesa/glapi/gl_procs.py
@@ -124,6 +124,16 @@ typedef struct {
print '};'
print ''
+ print ''
+ print "#ifdef USE_MGL_NAMESPACE"
+ for func in api.functionIterateByOffset():
+ for n in func.entry_points:
+ if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
+ print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset)
+ break
+ print "#endif /* USE_MGL_NAMESPACE */"
+ print ''
+ print ''
print '/* FIXME: Having these (incorrect) prototypes here is ugly. */'
print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)'
for func in api.functionIterateByOffset():
diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py
index 2a375d1ae94..fa45406f47b 100644
--- a/src/mesa/glapi/gl_x86-64_asm.py
+++ b/src/mesa/glapi/gl_x86-64_asm.py
@@ -133,6 +133,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print ''
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
+ print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
print '# endif'
diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py
index 977e0329cc5..650331a0c5a 100644
--- a/src/mesa/glapi/gl_x86_asm.py
+++ b/src/mesa/glapi/gl_x86_asm.py
@@ -62,6 +62,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '#else'
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
+ print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
print '# endif'
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index ef3118911d4..cb0d21083ef 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -440,358 +440,396 @@
#if !defined(IN_DRI_DRIVER)
-#define _gloffset_StencilFuncSeparate 408
-#define _gloffset_StencilMaskSeparate 409
-#define _gloffset_StencilOpSeparate 410
-#define _gloffset_LoadTransposeMatrixdARB 411
-#define _gloffset_LoadTransposeMatrixfARB 412
-#define _gloffset_MultTransposeMatrixdARB 413
-#define _gloffset_MultTransposeMatrixfARB 414
-#define _gloffset_SampleCoverageARB 415
-#define _gloffset_CompressedTexImage1DARB 416
-#define _gloffset_CompressedTexImage2DARB 417
-#define _gloffset_CompressedTexImage3DARB 418
-#define _gloffset_CompressedTexSubImage1DARB 419
-#define _gloffset_CompressedTexSubImage2DARB 420
-#define _gloffset_CompressedTexSubImage3DARB 421
-#define _gloffset_GetCompressedTexImageARB 422
-#define _gloffset_DisableVertexAttribArrayARB 423
-#define _gloffset_EnableVertexAttribArrayARB 424
-#define _gloffset_GetProgramEnvParameterdvARB 425
-#define _gloffset_GetProgramEnvParameterfvARB 426
-#define _gloffset_GetProgramLocalParameterdvARB 427
-#define _gloffset_GetProgramLocalParameterfvARB 428
-#define _gloffset_GetProgramStringARB 429
-#define _gloffset_GetProgramivARB 430
-#define _gloffset_GetVertexAttribdvARB 431
-#define _gloffset_GetVertexAttribfvARB 432
-#define _gloffset_GetVertexAttribivARB 433
-#define _gloffset_ProgramEnvParameter4dARB 434
-#define _gloffset_ProgramEnvParameter4dvARB 435
-#define _gloffset_ProgramEnvParameter4fARB 436
-#define _gloffset_ProgramEnvParameter4fvARB 437
-#define _gloffset_ProgramLocalParameter4dARB 438
-#define _gloffset_ProgramLocalParameter4dvARB 439
-#define _gloffset_ProgramLocalParameter4fARB 440
-#define _gloffset_ProgramLocalParameter4fvARB 441
-#define _gloffset_ProgramStringARB 442
-#define _gloffset_VertexAttrib1dARB 443
-#define _gloffset_VertexAttrib1dvARB 444
-#define _gloffset_VertexAttrib1fARB 445
-#define _gloffset_VertexAttrib1fvARB 446
-#define _gloffset_VertexAttrib1sARB 447
-#define _gloffset_VertexAttrib1svARB 448
-#define _gloffset_VertexAttrib2dARB 449
-#define _gloffset_VertexAttrib2dvARB 450
-#define _gloffset_VertexAttrib2fARB 451
-#define _gloffset_VertexAttrib2fvARB 452
-#define _gloffset_VertexAttrib2sARB 453
-#define _gloffset_VertexAttrib2svARB 454
-#define _gloffset_VertexAttrib3dARB 455
-#define _gloffset_VertexAttrib3dvARB 456
-#define _gloffset_VertexAttrib3fARB 457
-#define _gloffset_VertexAttrib3fvARB 458
-#define _gloffset_VertexAttrib3sARB 459
-#define _gloffset_VertexAttrib3svARB 460
-#define _gloffset_VertexAttrib4NbvARB 461
-#define _gloffset_VertexAttrib4NivARB 462
-#define _gloffset_VertexAttrib4NsvARB 463
-#define _gloffset_VertexAttrib4NubARB 464
-#define _gloffset_VertexAttrib4NubvARB 465
-#define _gloffset_VertexAttrib4NuivARB 466
-#define _gloffset_VertexAttrib4NusvARB 467
-#define _gloffset_VertexAttrib4bvARB 468
-#define _gloffset_VertexAttrib4dARB 469
-#define _gloffset_VertexAttrib4dvARB 470
-#define _gloffset_VertexAttrib4fARB 471
-#define _gloffset_VertexAttrib4fvARB 472
-#define _gloffset_VertexAttrib4ivARB 473
-#define _gloffset_VertexAttrib4sARB 474
-#define _gloffset_VertexAttrib4svARB 475
-#define _gloffset_VertexAttrib4ubvARB 476
-#define _gloffset_VertexAttrib4uivARB 477
-#define _gloffset_VertexAttrib4usvARB 478
-#define _gloffset_VertexAttribPointerARB 479
-#define _gloffset_BindBufferARB 480
-#define _gloffset_BufferDataARB 481
-#define _gloffset_BufferSubDataARB 482
-#define _gloffset_DeleteBuffersARB 483
-#define _gloffset_GenBuffersARB 484
-#define _gloffset_GetBufferParameterivARB 485
-#define _gloffset_GetBufferPointervARB 486
-#define _gloffset_GetBufferSubDataARB 487
-#define _gloffset_IsBufferARB 488
-#define _gloffset_MapBufferARB 489
-#define _gloffset_UnmapBufferARB 490
-#define _gloffset_BeginQueryARB 491
-#define _gloffset_DeleteQueriesARB 492
-#define _gloffset_EndQueryARB 493
-#define _gloffset_GenQueriesARB 494
-#define _gloffset_GetQueryObjectivARB 495
-#define _gloffset_GetQueryObjectuivARB 496
-#define _gloffset_GetQueryivARB 497
-#define _gloffset_IsQueryARB 498
-#define _gloffset_AttachObjectARB 499
-#define _gloffset_CompileShaderARB 500
-#define _gloffset_CreateProgramObjectARB 501
-#define _gloffset_CreateShaderObjectARB 502
-#define _gloffset_DeleteObjectARB 503
-#define _gloffset_DetachObjectARB 504
-#define _gloffset_GetActiveUniformARB 505
-#define _gloffset_GetAttachedObjectsARB 506
-#define _gloffset_GetHandleARB 507
-#define _gloffset_GetInfoLogARB 508
-#define _gloffset_GetObjectParameterfvARB 509
-#define _gloffset_GetObjectParameterivARB 510
-#define _gloffset_GetShaderSourceARB 511
-#define _gloffset_GetUniformLocationARB 512
-#define _gloffset_GetUniformfvARB 513
-#define _gloffset_GetUniformivARB 514
-#define _gloffset_LinkProgramARB 515
-#define _gloffset_ShaderSourceARB 516
-#define _gloffset_Uniform1fARB 517
-#define _gloffset_Uniform1fvARB 518
-#define _gloffset_Uniform1iARB 519
-#define _gloffset_Uniform1ivARB 520
-#define _gloffset_Uniform2fARB 521
-#define _gloffset_Uniform2fvARB 522
-#define _gloffset_Uniform2iARB 523
-#define _gloffset_Uniform2ivARB 524
-#define _gloffset_Uniform3fARB 525
-#define _gloffset_Uniform3fvARB 526
-#define _gloffset_Uniform3iARB 527
-#define _gloffset_Uniform3ivARB 528
-#define _gloffset_Uniform4fARB 529
-#define _gloffset_Uniform4fvARB 530
-#define _gloffset_Uniform4iARB 531
-#define _gloffset_Uniform4ivARB 532
-#define _gloffset_UniformMatrix2fvARB 533
-#define _gloffset_UniformMatrix3fvARB 534
-#define _gloffset_UniformMatrix4fvARB 535
-#define _gloffset_UseProgramObjectARB 536
-#define _gloffset_ValidateProgramARB 537
-#define _gloffset_BindAttribLocationARB 538
-#define _gloffset_GetActiveAttribARB 539
-#define _gloffset_GetAttribLocationARB 540
-#define _gloffset_DrawBuffersARB 541
-#define _gloffset_PolygonOffsetEXT 542
-#define _gloffset_GetPixelTexGenParameterfvSGIS 543
-#define _gloffset_GetPixelTexGenParameterivSGIS 544
-#define _gloffset_PixelTexGenParameterfSGIS 545
-#define _gloffset_PixelTexGenParameterfvSGIS 546
-#define _gloffset_PixelTexGenParameteriSGIS 547
-#define _gloffset_PixelTexGenParameterivSGIS 548
-#define _gloffset_SampleMaskSGIS 549
-#define _gloffset_SamplePatternSGIS 550
-#define _gloffset_ColorPointerEXT 551
-#define _gloffset_EdgeFlagPointerEXT 552
-#define _gloffset_IndexPointerEXT 553
-#define _gloffset_NormalPointerEXT 554
-#define _gloffset_TexCoordPointerEXT 555
-#define _gloffset_VertexPointerEXT 556
-#define _gloffset_PointParameterfEXT 557
-#define _gloffset_PointParameterfvEXT 558
-#define _gloffset_LockArraysEXT 559
-#define _gloffset_UnlockArraysEXT 560
-#define _gloffset_CullParameterdvEXT 561
-#define _gloffset_CullParameterfvEXT 562
-#define _gloffset_SecondaryColor3bEXT 563
-#define _gloffset_SecondaryColor3bvEXT 564
-#define _gloffset_SecondaryColor3dEXT 565
-#define _gloffset_SecondaryColor3dvEXT 566
-#define _gloffset_SecondaryColor3fEXT 567
-#define _gloffset_SecondaryColor3fvEXT 568
-#define _gloffset_SecondaryColor3iEXT 569
-#define _gloffset_SecondaryColor3ivEXT 570
-#define _gloffset_SecondaryColor3sEXT 571
-#define _gloffset_SecondaryColor3svEXT 572
-#define _gloffset_SecondaryColor3ubEXT 573
-#define _gloffset_SecondaryColor3ubvEXT 574
-#define _gloffset_SecondaryColor3uiEXT 575
-#define _gloffset_SecondaryColor3uivEXT 576
-#define _gloffset_SecondaryColor3usEXT 577
-#define _gloffset_SecondaryColor3usvEXT 578
-#define _gloffset_SecondaryColorPointerEXT 579
-#define _gloffset_MultiDrawArraysEXT 580
-#define _gloffset_MultiDrawElementsEXT 581
-#define _gloffset_FogCoordPointerEXT 582
-#define _gloffset_FogCoorddEXT 583
-#define _gloffset_FogCoorddvEXT 584
-#define _gloffset_FogCoordfEXT 585
-#define _gloffset_FogCoordfvEXT 586
-#define _gloffset_PixelTexGenSGIX 587
-#define _gloffset_BlendFuncSeparateEXT 588
-#define _gloffset_FlushVertexArrayRangeNV 589
-#define _gloffset_VertexArrayRangeNV 590
-#define _gloffset_CombinerInputNV 591
-#define _gloffset_CombinerOutputNV 592
-#define _gloffset_CombinerParameterfNV 593
-#define _gloffset_CombinerParameterfvNV 594
-#define _gloffset_CombinerParameteriNV 595
-#define _gloffset_CombinerParameterivNV 596
-#define _gloffset_FinalCombinerInputNV 597
-#define _gloffset_GetCombinerInputParameterfvNV 598
-#define _gloffset_GetCombinerInputParameterivNV 599
-#define _gloffset_GetCombinerOutputParameterfvNV 600
-#define _gloffset_GetCombinerOutputParameterivNV 601
-#define _gloffset_GetFinalCombinerInputParameterfvNV 602
-#define _gloffset_GetFinalCombinerInputParameterivNV 603
-#define _gloffset_ResizeBuffersMESA 604
-#define _gloffset_WindowPos2dMESA 605
-#define _gloffset_WindowPos2dvMESA 606
-#define _gloffset_WindowPos2fMESA 607
-#define _gloffset_WindowPos2fvMESA 608
-#define _gloffset_WindowPos2iMESA 609
-#define _gloffset_WindowPos2ivMESA 610
-#define _gloffset_WindowPos2sMESA 611
-#define _gloffset_WindowPos2svMESA 612
-#define _gloffset_WindowPos3dMESA 613
-#define _gloffset_WindowPos3dvMESA 614
-#define _gloffset_WindowPos3fMESA 615
-#define _gloffset_WindowPos3fvMESA 616
-#define _gloffset_WindowPos3iMESA 617
-#define _gloffset_WindowPos3ivMESA 618
-#define _gloffset_WindowPos3sMESA 619
-#define _gloffset_WindowPos3svMESA 620
-#define _gloffset_WindowPos4dMESA 621
-#define _gloffset_WindowPos4dvMESA 622
-#define _gloffset_WindowPos4fMESA 623
-#define _gloffset_WindowPos4fvMESA 624
-#define _gloffset_WindowPos4iMESA 625
-#define _gloffset_WindowPos4ivMESA 626
-#define _gloffset_WindowPos4sMESA 627
-#define _gloffset_WindowPos4svMESA 628
-#define _gloffset_MultiModeDrawArraysIBM 629
-#define _gloffset_MultiModeDrawElementsIBM 630
-#define _gloffset_DeleteFencesNV 631
-#define _gloffset_FinishFenceNV 632
-#define _gloffset_GenFencesNV 633
-#define _gloffset_GetFenceivNV 634
-#define _gloffset_IsFenceNV 635
-#define _gloffset_SetFenceNV 636
-#define _gloffset_TestFenceNV 637
-#define _gloffset_AreProgramsResidentNV 638
-#define _gloffset_BindProgramNV 639
-#define _gloffset_DeleteProgramsNV 640
-#define _gloffset_ExecuteProgramNV 641
-#define _gloffset_GenProgramsNV 642
-#define _gloffset_GetProgramParameterdvNV 643
-#define _gloffset_GetProgramParameterfvNV 644
-#define _gloffset_GetProgramStringNV 645
-#define _gloffset_GetProgramivNV 646
-#define _gloffset_GetTrackMatrixivNV 647
-#define _gloffset_GetVertexAttribPointervNV 648
-#define _gloffset_GetVertexAttribdvNV 649
-#define _gloffset_GetVertexAttribfvNV 650
-#define _gloffset_GetVertexAttribivNV 651
-#define _gloffset_IsProgramNV 652
-#define _gloffset_LoadProgramNV 653
-#define _gloffset_ProgramParameter4dNV 654
-#define _gloffset_ProgramParameter4dvNV 655
-#define _gloffset_ProgramParameter4fNV 656
-#define _gloffset_ProgramParameter4fvNV 657
-#define _gloffset_ProgramParameters4dvNV 658
-#define _gloffset_ProgramParameters4fvNV 659
-#define _gloffset_RequestResidentProgramsNV 660
-#define _gloffset_TrackMatrixNV 661
-#define _gloffset_VertexAttrib1dNV 662
-#define _gloffset_VertexAttrib1dvNV 663
-#define _gloffset_VertexAttrib1fNV 664
-#define _gloffset_VertexAttrib1fvNV 665
-#define _gloffset_VertexAttrib1sNV 666
-#define _gloffset_VertexAttrib1svNV 667
-#define _gloffset_VertexAttrib2dNV 668
-#define _gloffset_VertexAttrib2dvNV 669
-#define _gloffset_VertexAttrib2fNV 670
-#define _gloffset_VertexAttrib2fvNV 671
-#define _gloffset_VertexAttrib2sNV 672
-#define _gloffset_VertexAttrib2svNV 673
-#define _gloffset_VertexAttrib3dNV 674
-#define _gloffset_VertexAttrib3dvNV 675
-#define _gloffset_VertexAttrib3fNV 676
-#define _gloffset_VertexAttrib3fvNV 677
-#define _gloffset_VertexAttrib3sNV 678
-#define _gloffset_VertexAttrib3svNV 679
-#define _gloffset_VertexAttrib4dNV 680
-#define _gloffset_VertexAttrib4dvNV 681
-#define _gloffset_VertexAttrib4fNV 682
-#define _gloffset_VertexAttrib4fvNV 683
-#define _gloffset_VertexAttrib4sNV 684
-#define _gloffset_VertexAttrib4svNV 685
-#define _gloffset_VertexAttrib4ubNV 686
-#define _gloffset_VertexAttrib4ubvNV 687
-#define _gloffset_VertexAttribPointerNV 688
-#define _gloffset_VertexAttribs1dvNV 689
-#define _gloffset_VertexAttribs1fvNV 690
-#define _gloffset_VertexAttribs1svNV 691
-#define _gloffset_VertexAttribs2dvNV 692
-#define _gloffset_VertexAttribs2fvNV 693
-#define _gloffset_VertexAttribs2svNV 694
-#define _gloffset_VertexAttribs3dvNV 695
-#define _gloffset_VertexAttribs3fvNV 696
-#define _gloffset_VertexAttribs3svNV 697
-#define _gloffset_VertexAttribs4dvNV 698
-#define _gloffset_VertexAttribs4fvNV 699
-#define _gloffset_VertexAttribs4svNV 700
-#define _gloffset_VertexAttribs4ubvNV 701
-#define _gloffset_AlphaFragmentOp1ATI 702
-#define _gloffset_AlphaFragmentOp2ATI 703
-#define _gloffset_AlphaFragmentOp3ATI 704
-#define _gloffset_BeginFragmentShaderATI 705
-#define _gloffset_BindFragmentShaderATI 706
-#define _gloffset_ColorFragmentOp1ATI 707
-#define _gloffset_ColorFragmentOp2ATI 708
-#define _gloffset_ColorFragmentOp3ATI 709
-#define _gloffset_DeleteFragmentShaderATI 710
-#define _gloffset_EndFragmentShaderATI 711
-#define _gloffset_GenFragmentShadersATI 712
-#define _gloffset_PassTexCoordATI 713
-#define _gloffset_SampleMapATI 714
-#define _gloffset_SetFragmentShaderConstantATI 715
-#define _gloffset_PointParameteriNV 716
-#define _gloffset_PointParameterivNV 717
-#define _gloffset_ActiveStencilFaceEXT 718
-#define _gloffset_BindVertexArrayAPPLE 719
-#define _gloffset_DeleteVertexArraysAPPLE 720
-#define _gloffset_GenVertexArraysAPPLE 721
-#define _gloffset_IsVertexArrayAPPLE 722
-#define _gloffset_GetProgramNamedParameterdvNV 723
-#define _gloffset_GetProgramNamedParameterfvNV 724
-#define _gloffset_ProgramNamedParameter4dNV 725
-#define _gloffset_ProgramNamedParameter4dvNV 726
-#define _gloffset_ProgramNamedParameter4fNV 727
-#define _gloffset_ProgramNamedParameter4fvNV 728
-#define _gloffset_DepthBoundsEXT 729
-#define _gloffset_BlendEquationSeparateEXT 730
-#define _gloffset_BindFramebufferEXT 731
-#define _gloffset_BindRenderbufferEXT 732
-#define _gloffset_CheckFramebufferStatusEXT 733
-#define _gloffset_DeleteFramebuffersEXT 734
-#define _gloffset_DeleteRenderbuffersEXT 735
-#define _gloffset_FramebufferRenderbufferEXT 736
-#define _gloffset_FramebufferTexture1DEXT 737
-#define _gloffset_FramebufferTexture2DEXT 738
-#define _gloffset_FramebufferTexture3DEXT 739
-#define _gloffset_GenFramebuffersEXT 740
-#define _gloffset_GenRenderbuffersEXT 741
-#define _gloffset_GenerateMipmapEXT 742
-#define _gloffset_GetFramebufferAttachmentParameterivEXT 743
-#define _gloffset_GetRenderbufferParameterivEXT 744
-#define _gloffset_IsFramebufferEXT 745
-#define _gloffset_IsRenderbufferEXT 746
-#define _gloffset_RenderbufferStorageEXT 747
-#define _gloffset_BlitFramebufferEXT 748
-#define _gloffset_ProgramEnvParameters4fvEXT 749
-#define _gloffset_ProgramLocalParameters4fvEXT 750
-#define _gloffset_GetQueryObjecti64vEXT 751
-#define _gloffset_GetQueryObjectui64vEXT 752
-#define _gloffset_FIRST_DYNAMIC 753
+#define _gloffset_AttachShader 408
+#define _gloffset_CreateProgram 409
+#define _gloffset_CreateShader 410
+#define _gloffset_DeleteProgram 411
+#define _gloffset_DeleteShader 412
+#define _gloffset_DetachShader 413
+#define _gloffset_GetAttachedShaders 414
+#define _gloffset_GetProgramInfoLog 415
+#define _gloffset_GetProgramiv 416
+#define _gloffset_GetShaderInfoLog 417
+#define _gloffset_GetShaderiv 418
+#define _gloffset_IsProgram 419
+#define _gloffset_IsShader 420
+#define _gloffset_StencilFuncSeparate 421
+#define _gloffset_StencilMaskSeparate 422
+#define _gloffset_StencilOpSeparate 423
+#define _gloffset_UniformMatrix2x3fv 424
+#define _gloffset_UniformMatrix2x4fv 425
+#define _gloffset_UniformMatrix3x2fv 426
+#define _gloffset_UniformMatrix3x4fv 427
+#define _gloffset_UniformMatrix4x2fv 428
+#define _gloffset_UniformMatrix4x3fv 429
+#define _gloffset_LoadTransposeMatrixdARB 430
+#define _gloffset_LoadTransposeMatrixfARB 431
+#define _gloffset_MultTransposeMatrixdARB 432
+#define _gloffset_MultTransposeMatrixfARB 433
+#define _gloffset_SampleCoverageARB 434
+#define _gloffset_CompressedTexImage1DARB 435
+#define _gloffset_CompressedTexImage2DARB 436
+#define _gloffset_CompressedTexImage3DARB 437
+#define _gloffset_CompressedTexSubImage1DARB 438
+#define _gloffset_CompressedTexSubImage2DARB 439
+#define _gloffset_CompressedTexSubImage3DARB 440
+#define _gloffset_GetCompressedTexImageARB 441
+#define _gloffset_DisableVertexAttribArrayARB 442
+#define _gloffset_EnableVertexAttribArrayARB 443
+#define _gloffset_GetProgramEnvParameterdvARB 444
+#define _gloffset_GetProgramEnvParameterfvARB 445
+#define _gloffset_GetProgramLocalParameterdvARB 446
+#define _gloffset_GetProgramLocalParameterfvARB 447
+#define _gloffset_GetProgramStringARB 448
+#define _gloffset_GetProgramivARB 449
+#define _gloffset_GetVertexAttribdvARB 450
+#define _gloffset_GetVertexAttribfvARB 451
+#define _gloffset_GetVertexAttribivARB 452
+#define _gloffset_ProgramEnvParameter4dARB 453
+#define _gloffset_ProgramEnvParameter4dvARB 454
+#define _gloffset_ProgramEnvParameter4fARB 455
+#define _gloffset_ProgramEnvParameter4fvARB 456
+#define _gloffset_ProgramLocalParameter4dARB 457
+#define _gloffset_ProgramLocalParameter4dvARB 458
+#define _gloffset_ProgramLocalParameter4fARB 459
+#define _gloffset_ProgramLocalParameter4fvARB 460
+#define _gloffset_ProgramStringARB 461
+#define _gloffset_VertexAttrib1dARB 462
+#define _gloffset_VertexAttrib1dvARB 463
+#define _gloffset_VertexAttrib1fARB 464
+#define _gloffset_VertexAttrib1fvARB 465
+#define _gloffset_VertexAttrib1sARB 466
+#define _gloffset_VertexAttrib1svARB 467
+#define _gloffset_VertexAttrib2dARB 468
+#define _gloffset_VertexAttrib2dvARB 469
+#define _gloffset_VertexAttrib2fARB 470
+#define _gloffset_VertexAttrib2fvARB 471
+#define _gloffset_VertexAttrib2sARB 472
+#define _gloffset_VertexAttrib2svARB 473
+#define _gloffset_VertexAttrib3dARB 474
+#define _gloffset_VertexAttrib3dvARB 475
+#define _gloffset_VertexAttrib3fARB 476
+#define _gloffset_VertexAttrib3fvARB 477
+#define _gloffset_VertexAttrib3sARB 478
+#define _gloffset_VertexAttrib3svARB 479
+#define _gloffset_VertexAttrib4NbvARB 480
+#define _gloffset_VertexAttrib4NivARB 481
+#define _gloffset_VertexAttrib4NsvARB 482
+#define _gloffset_VertexAttrib4NubARB 483
+#define _gloffset_VertexAttrib4NubvARB 484
+#define _gloffset_VertexAttrib4NuivARB 485
+#define _gloffset_VertexAttrib4NusvARB 486
+#define _gloffset_VertexAttrib4bvARB 487
+#define _gloffset_VertexAttrib4dARB 488
+#define _gloffset_VertexAttrib4dvARB 489
+#define _gloffset_VertexAttrib4fARB 490
+#define _gloffset_VertexAttrib4fvARB 491
+#define _gloffset_VertexAttrib4ivARB 492
+#define _gloffset_VertexAttrib4sARB 493
+#define _gloffset_VertexAttrib4svARB 494
+#define _gloffset_VertexAttrib4ubvARB 495
+#define _gloffset_VertexAttrib4uivARB 496
+#define _gloffset_VertexAttrib4usvARB 497
+#define _gloffset_VertexAttribPointerARB 498
+#define _gloffset_BindBufferARB 499
+#define _gloffset_BufferDataARB 500
+#define _gloffset_BufferSubDataARB 501
+#define _gloffset_DeleteBuffersARB 502
+#define _gloffset_GenBuffersARB 503
+#define _gloffset_GetBufferParameterivARB 504
+#define _gloffset_GetBufferPointervARB 505
+#define _gloffset_GetBufferSubDataARB 506
+#define _gloffset_IsBufferARB 507
+#define _gloffset_MapBufferARB 508
+#define _gloffset_UnmapBufferARB 509
+#define _gloffset_BeginQueryARB 510
+#define _gloffset_DeleteQueriesARB 511
+#define _gloffset_EndQueryARB 512
+#define _gloffset_GenQueriesARB 513
+#define _gloffset_GetQueryObjectivARB 514
+#define _gloffset_GetQueryObjectuivARB 515
+#define _gloffset_GetQueryivARB 516
+#define _gloffset_IsQueryARB 517
+#define _gloffset_AttachObjectARB 518
+#define _gloffset_CompileShaderARB 519
+#define _gloffset_CreateProgramObjectARB 520
+#define _gloffset_CreateShaderObjectARB 521
+#define _gloffset_DeleteObjectARB 522
+#define _gloffset_DetachObjectARB 523
+#define _gloffset_GetActiveUniformARB 524
+#define _gloffset_GetAttachedObjectsARB 525
+#define _gloffset_GetHandleARB 526
+#define _gloffset_GetInfoLogARB 527
+#define _gloffset_GetObjectParameterfvARB 528
+#define _gloffset_GetObjectParameterivARB 529
+#define _gloffset_GetShaderSourceARB 530
+#define _gloffset_GetUniformLocationARB 531
+#define _gloffset_GetUniformfvARB 532
+#define _gloffset_GetUniformivARB 533
+#define _gloffset_LinkProgramARB 534
+#define _gloffset_ShaderSourceARB 535
+#define _gloffset_Uniform1fARB 536
+#define _gloffset_Uniform1fvARB 537
+#define _gloffset_Uniform1iARB 538
+#define _gloffset_Uniform1ivARB 539
+#define _gloffset_Uniform2fARB 540
+#define _gloffset_Uniform2fvARB 541
+#define _gloffset_Uniform2iARB 542
+#define _gloffset_Uniform2ivARB 543
+#define _gloffset_Uniform3fARB 544
+#define _gloffset_Uniform3fvARB 545
+#define _gloffset_Uniform3iARB 546
+#define _gloffset_Uniform3ivARB 547
+#define _gloffset_Uniform4fARB 548
+#define _gloffset_Uniform4fvARB 549
+#define _gloffset_Uniform4iARB 550
+#define _gloffset_Uniform4ivARB 551
+#define _gloffset_UniformMatrix2fvARB 552
+#define _gloffset_UniformMatrix3fvARB 553
+#define _gloffset_UniformMatrix4fvARB 554
+#define _gloffset_UseProgramObjectARB 555
+#define _gloffset_ValidateProgramARB 556
+#define _gloffset_BindAttribLocationARB 557
+#define _gloffset_GetActiveAttribARB 558
+#define _gloffset_GetAttribLocationARB 559
+#define _gloffset_DrawBuffersARB 560
+#define _gloffset_PolygonOffsetEXT 561
+#define _gloffset_GetPixelTexGenParameterfvSGIS 562
+#define _gloffset_GetPixelTexGenParameterivSGIS 563
+#define _gloffset_PixelTexGenParameterfSGIS 564
+#define _gloffset_PixelTexGenParameterfvSGIS 565
+#define _gloffset_PixelTexGenParameteriSGIS 566
+#define _gloffset_PixelTexGenParameterivSGIS 567
+#define _gloffset_SampleMaskSGIS 568
+#define _gloffset_SamplePatternSGIS 569
+#define _gloffset_ColorPointerEXT 570
+#define _gloffset_EdgeFlagPointerEXT 571
+#define _gloffset_IndexPointerEXT 572
+#define _gloffset_NormalPointerEXT 573
+#define _gloffset_TexCoordPointerEXT 574
+#define _gloffset_VertexPointerEXT 575
+#define _gloffset_PointParameterfEXT 576
+#define _gloffset_PointParameterfvEXT 577
+#define _gloffset_LockArraysEXT 578
+#define _gloffset_UnlockArraysEXT 579
+#define _gloffset_CullParameterdvEXT 580
+#define _gloffset_CullParameterfvEXT 581
+#define _gloffset_SecondaryColor3bEXT 582
+#define _gloffset_SecondaryColor3bvEXT 583
+#define _gloffset_SecondaryColor3dEXT 584
+#define _gloffset_SecondaryColor3dvEXT 585
+#define _gloffset_SecondaryColor3fEXT 586
+#define _gloffset_SecondaryColor3fvEXT 587
+#define _gloffset_SecondaryColor3iEXT 588
+#define _gloffset_SecondaryColor3ivEXT 589
+#define _gloffset_SecondaryColor3sEXT 590
+#define _gloffset_SecondaryColor3svEXT 591
+#define _gloffset_SecondaryColor3ubEXT 592
+#define _gloffset_SecondaryColor3ubvEXT 593
+#define _gloffset_SecondaryColor3uiEXT 594
+#define _gloffset_SecondaryColor3uivEXT 595
+#define _gloffset_SecondaryColor3usEXT 596
+#define _gloffset_SecondaryColor3usvEXT 597
+#define _gloffset_SecondaryColorPointerEXT 598
+#define _gloffset_MultiDrawArraysEXT 599
+#define _gloffset_MultiDrawElementsEXT 600
+#define _gloffset_FogCoordPointerEXT 601
+#define _gloffset_FogCoorddEXT 602
+#define _gloffset_FogCoorddvEXT 603
+#define _gloffset_FogCoordfEXT 604
+#define _gloffset_FogCoordfvEXT 605
+#define _gloffset_PixelTexGenSGIX 606
+#define _gloffset_BlendFuncSeparateEXT 607
+#define _gloffset_FlushVertexArrayRangeNV 608
+#define _gloffset_VertexArrayRangeNV 609
+#define _gloffset_CombinerInputNV 610
+#define _gloffset_CombinerOutputNV 611
+#define _gloffset_CombinerParameterfNV 612
+#define _gloffset_CombinerParameterfvNV 613
+#define _gloffset_CombinerParameteriNV 614
+#define _gloffset_CombinerParameterivNV 615
+#define _gloffset_FinalCombinerInputNV 616
+#define _gloffset_GetCombinerInputParameterfvNV 617
+#define _gloffset_GetCombinerInputParameterivNV 618
+#define _gloffset_GetCombinerOutputParameterfvNV 619
+#define _gloffset_GetCombinerOutputParameterivNV 620
+#define _gloffset_GetFinalCombinerInputParameterfvNV 621
+#define _gloffset_GetFinalCombinerInputParameterivNV 622
+#define _gloffset_ResizeBuffersMESA 623
+#define _gloffset_WindowPos2dMESA 624
+#define _gloffset_WindowPos2dvMESA 625
+#define _gloffset_WindowPos2fMESA 626
+#define _gloffset_WindowPos2fvMESA 627
+#define _gloffset_WindowPos2iMESA 628
+#define _gloffset_WindowPos2ivMESA 629
+#define _gloffset_WindowPos2sMESA 630
+#define _gloffset_WindowPos2svMESA 631
+#define _gloffset_WindowPos3dMESA 632
+#define _gloffset_WindowPos3dvMESA 633
+#define _gloffset_WindowPos3fMESA 634
+#define _gloffset_WindowPos3fvMESA 635
+#define _gloffset_WindowPos3iMESA 636
+#define _gloffset_WindowPos3ivMESA 637
+#define _gloffset_WindowPos3sMESA 638
+#define _gloffset_WindowPos3svMESA 639
+#define _gloffset_WindowPos4dMESA 640
+#define _gloffset_WindowPos4dvMESA 641
+#define _gloffset_WindowPos4fMESA 642
+#define _gloffset_WindowPos4fvMESA 643
+#define _gloffset_WindowPos4iMESA 644
+#define _gloffset_WindowPos4ivMESA 645
+#define _gloffset_WindowPos4sMESA 646
+#define _gloffset_WindowPos4svMESA 647
+#define _gloffset_MultiModeDrawArraysIBM 648
+#define _gloffset_MultiModeDrawElementsIBM 649
+#define _gloffset_DeleteFencesNV 650
+#define _gloffset_FinishFenceNV 651
+#define _gloffset_GenFencesNV 652
+#define _gloffset_GetFenceivNV 653
+#define _gloffset_IsFenceNV 654
+#define _gloffset_SetFenceNV 655
+#define _gloffset_TestFenceNV 656
+#define _gloffset_AreProgramsResidentNV 657
+#define _gloffset_BindProgramNV 658
+#define _gloffset_DeleteProgramsNV 659
+#define _gloffset_ExecuteProgramNV 660
+#define _gloffset_GenProgramsNV 661
+#define _gloffset_GetProgramParameterdvNV 662
+#define _gloffset_GetProgramParameterfvNV 663
+#define _gloffset_GetProgramStringNV 664
+#define _gloffset_GetProgramivNV 665
+#define _gloffset_GetTrackMatrixivNV 666
+#define _gloffset_GetVertexAttribPointervNV 667
+#define _gloffset_GetVertexAttribdvNV 668
+#define _gloffset_GetVertexAttribfvNV 669
+#define _gloffset_GetVertexAttribivNV 670
+#define _gloffset_IsProgramNV 671
+#define _gloffset_LoadProgramNV 672
+#define _gloffset_ProgramParameter4dNV 673
+#define _gloffset_ProgramParameter4dvNV 674
+#define _gloffset_ProgramParameter4fNV 675
+#define _gloffset_ProgramParameter4fvNV 676
+#define _gloffset_ProgramParameters4dvNV 677
+#define _gloffset_ProgramParameters4fvNV 678
+#define _gloffset_RequestResidentProgramsNV 679
+#define _gloffset_TrackMatrixNV 680
+#define _gloffset_VertexAttrib1dNV 681
+#define _gloffset_VertexAttrib1dvNV 682
+#define _gloffset_VertexAttrib1fNV 683
+#define _gloffset_VertexAttrib1fvNV 684
+#define _gloffset_VertexAttrib1sNV 685
+#define _gloffset_VertexAttrib1svNV 686
+#define _gloffset_VertexAttrib2dNV 687
+#define _gloffset_VertexAttrib2dvNV 688
+#define _gloffset_VertexAttrib2fNV 689
+#define _gloffset_VertexAttrib2fvNV 690
+#define _gloffset_VertexAttrib2sNV 691
+#define _gloffset_VertexAttrib2svNV 692
+#define _gloffset_VertexAttrib3dNV 693
+#define _gloffset_VertexAttrib3dvNV 694
+#define _gloffset_VertexAttrib3fNV 695
+#define _gloffset_VertexAttrib3fvNV 696
+#define _gloffset_VertexAttrib3sNV 697
+#define _gloffset_VertexAttrib3svNV 698
+#define _gloffset_VertexAttrib4dNV 699
+#define _gloffset_VertexAttrib4dvNV 700
+#define _gloffset_VertexAttrib4fNV 701
+#define _gloffset_VertexAttrib4fvNV 702
+#define _gloffset_VertexAttrib4sNV 703
+#define _gloffset_VertexAttrib4svNV 704
+#define _gloffset_VertexAttrib4ubNV 705
+#define _gloffset_VertexAttrib4ubvNV 706
+#define _gloffset_VertexAttribPointerNV 707
+#define _gloffset_VertexAttribs1dvNV 708
+#define _gloffset_VertexAttribs1fvNV 709
+#define _gloffset_VertexAttribs1svNV 710
+#define _gloffset_VertexAttribs2dvNV 711
+#define _gloffset_VertexAttribs2fvNV 712
+#define _gloffset_VertexAttribs2svNV 713
+#define _gloffset_VertexAttribs3dvNV 714
+#define _gloffset_VertexAttribs3fvNV 715
+#define _gloffset_VertexAttribs3svNV 716
+#define _gloffset_VertexAttribs4dvNV 717
+#define _gloffset_VertexAttribs4fvNV 718
+#define _gloffset_VertexAttribs4svNV 719
+#define _gloffset_VertexAttribs4ubvNV 720
+#define _gloffset_AlphaFragmentOp1ATI 721
+#define _gloffset_AlphaFragmentOp2ATI 722
+#define _gloffset_AlphaFragmentOp3ATI 723
+#define _gloffset_BeginFragmentShaderATI 724
+#define _gloffset_BindFragmentShaderATI 725
+#define _gloffset_ColorFragmentOp1ATI 726
+#define _gloffset_ColorFragmentOp2ATI 727
+#define _gloffset_ColorFragmentOp3ATI 728
+#define _gloffset_DeleteFragmentShaderATI 729
+#define _gloffset_EndFragmentShaderATI 730
+#define _gloffset_GenFragmentShadersATI 731
+#define _gloffset_PassTexCoordATI 732
+#define _gloffset_SampleMapATI 733
+#define _gloffset_SetFragmentShaderConstantATI 734
+#define _gloffset_PointParameteriNV 735
+#define _gloffset_PointParameterivNV 736
+#define _gloffset_ActiveStencilFaceEXT 737
+#define _gloffset_BindVertexArrayAPPLE 738
+#define _gloffset_DeleteVertexArraysAPPLE 739
+#define _gloffset_GenVertexArraysAPPLE 740
+#define _gloffset_IsVertexArrayAPPLE 741
+#define _gloffset_GetProgramNamedParameterdvNV 742
+#define _gloffset_GetProgramNamedParameterfvNV 743
+#define _gloffset_ProgramNamedParameter4dNV 744
+#define _gloffset_ProgramNamedParameter4dvNV 745
+#define _gloffset_ProgramNamedParameter4fNV 746
+#define _gloffset_ProgramNamedParameter4fvNV 747
+#define _gloffset_DepthBoundsEXT 748
+#define _gloffset_BlendEquationSeparateEXT 749
+#define _gloffset_BindFramebufferEXT 750
+#define _gloffset_BindRenderbufferEXT 751
+#define _gloffset_CheckFramebufferStatusEXT 752
+#define _gloffset_DeleteFramebuffersEXT 753
+#define _gloffset_DeleteRenderbuffersEXT 754
+#define _gloffset_FramebufferRenderbufferEXT 755
+#define _gloffset_FramebufferTexture1DEXT 756
+#define _gloffset_FramebufferTexture2DEXT 757
+#define _gloffset_FramebufferTexture3DEXT 758
+#define _gloffset_GenFramebuffersEXT 759
+#define _gloffset_GenRenderbuffersEXT 760
+#define _gloffset_GenerateMipmapEXT 761
+#define _gloffset_GetFramebufferAttachmentParameterivEXT 762
+#define _gloffset_GetRenderbufferParameterivEXT 763
+#define _gloffset_IsFramebufferEXT 764
+#define _gloffset_IsRenderbufferEXT 765
+#define _gloffset_RenderbufferStorageEXT 766
+#define _gloffset_BlitFramebufferEXT 767
+#define _gloffset_ProgramEnvParameters4fvEXT 768
+#define _gloffset_ProgramLocalParameters4fvEXT 769
+#define _gloffset_GetQueryObjecti64vEXT 770
+#define _gloffset_GetQueryObjectui64vEXT 771
+#define _gloffset_FIRST_DYNAMIC 772
#else
+#define _gloffset_AttachShader driDispatchRemapTable[AttachShader_remap_index]
+#define _gloffset_CreateProgram driDispatchRemapTable[CreateProgram_remap_index]
+#define _gloffset_CreateShader driDispatchRemapTable[CreateShader_remap_index]
+#define _gloffset_DeleteProgram driDispatchRemapTable[DeleteProgram_remap_index]
+#define _gloffset_DeleteShader driDispatchRemapTable[DeleteShader_remap_index]
+#define _gloffset_DetachShader driDispatchRemapTable[DetachShader_remap_index]
+#define _gloffset_GetAttachedShaders driDispatchRemapTable[GetAttachedShaders_remap_index]
+#define _gloffset_GetProgramInfoLog driDispatchRemapTable[GetProgramInfoLog_remap_index]
+#define _gloffset_GetProgramiv driDispatchRemapTable[GetProgramiv_remap_index]
+#define _gloffset_GetShaderInfoLog driDispatchRemapTable[GetShaderInfoLog_remap_index]
+#define _gloffset_GetShaderiv driDispatchRemapTable[GetShaderiv_remap_index]
+#define _gloffset_IsProgram driDispatchRemapTable[IsProgram_remap_index]
+#define _gloffset_IsShader driDispatchRemapTable[IsShader_remap_index]
#define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index]
#define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index]
#define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index]
+#define _gloffset_UniformMatrix2x3fv driDispatchRemapTable[UniformMatrix2x3fv_remap_index]
+#define _gloffset_UniformMatrix2x4fv driDispatchRemapTable[UniformMatrix2x4fv_remap_index]
+#define _gloffset_UniformMatrix3x2fv driDispatchRemapTable[UniformMatrix3x2fv_remap_index]
+#define _gloffset_UniformMatrix3x4fv driDispatchRemapTable[UniformMatrix3x4fv_remap_index]
+#define _gloffset_UniformMatrix4x2fv driDispatchRemapTable[UniformMatrix4x2fv_remap_index]
+#define _gloffset_UniformMatrix4x3fv driDispatchRemapTable[UniformMatrix4x3fv_remap_index]
#define _gloffset_LoadTransposeMatrixdARB driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]
#define _gloffset_LoadTransposeMatrixfARB driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]
#define _gloffset_MultTransposeMatrixdARB driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]
diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h
index 576916e9f40..026af32af8f 100644
--- a/src/mesa/glapi/glapitable.h
+++ b/src/mesa/glapi/glapitable.h
@@ -445,351 +445,370 @@ struct _glapi_table
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
- void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 408 */
- void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 409 */
- void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 410 */
- void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 411 */
- void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 412 */
- void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 413 */
- void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 414 */
- void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 415 */
- void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 416 */
- void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 417 */
- void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 418 */
- void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 419 */
- void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 420 */
- void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 421 */
- void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 422 */
- void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 423 */
- void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 424 */
- void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 425 */
- void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 426 */
- void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 427 */
- void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 428 */
- void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 429 */
- void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 430 */
- void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 431 */
- void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 432 */
- void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 433 */
- void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 434 */
- void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 435 */
- void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 436 */
- void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 437 */
- void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 438 */
- void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 439 */
- void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 440 */
- void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 441 */
- void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 442 */
- void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 443 */
- void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 444 */
- void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 445 */
- void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 446 */
- void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 447 */
- void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 448 */
- void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 449 */
- void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 450 */
- void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 451 */
- void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 452 */
- void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 453 */
- void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 454 */
- void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 455 */
- void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 456 */
- void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 457 */
- void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 458 */
- void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 459 */
- void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 460 */
- void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 461 */
- void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 462 */
- void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 463 */
- void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 464 */
- void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 465 */
- void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 466 */
- void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 467 */
- void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 468 */
- void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 469 */
- void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 470 */
- void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 471 */
- void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 472 */
- void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 473 */
- void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 474 */
- void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 475 */
- void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 476 */
- void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 477 */
- void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 478 */
- void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 479 */
- void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 480 */
- void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 481 */
- void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 482 */
- void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 483 */
- void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 484 */
- void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 485 */
- void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 486 */
- void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 487 */
- GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 488 */
- GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 489 */
- GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 490 */
- void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 491 */
- void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 492 */
- void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 493 */
- void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 494 */
- void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 495 */
- void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 496 */
- void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 497 */
- GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 498 */
- void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 499 */
- void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shaderObj); /* 500 */
- GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 501 */
- GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 502 */
- void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 503 */
- void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 504 */
- void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 505 */
- void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 506 */
- GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 507 */
- void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 508 */
- void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 509 */
- void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 510 */
- void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); /* 511 */
- GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 512 */
- void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params); /* 513 */
- void (GLAPIENTRYP GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params); /* 514 */
- void (GLAPIENTRYP LinkProgramARB)(GLhandleARB programObj); /* 515 */
- void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length); /* 516 */
- void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 517 */
- void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 518 */
- void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 519 */
- void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 520 */
- void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 521 */
- void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 522 */
- void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 523 */
- void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 524 */
- void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 525 */
- void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 526 */
- void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 527 */
- void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 528 */
- void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 529 */
- void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 530 */
- void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 531 */
- void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 532 */
- void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 533 */
- void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 534 */
- void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 535 */
- void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB programObj); /* 536 */
- void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB programObj); /* 537 */
- void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name); /* 538 */
- void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 539 */
- GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 540 */
- void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 541 */
- void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 542 */
- void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 543 */
- void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 544 */
- void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 545 */
- void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 546 */
- void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 547 */
- void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 548 */
- void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 549 */
- void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 550 */
- void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 551 */
- void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 552 */
- void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 553 */
- void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 554 */
- void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 555 */
- void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 556 */
- void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 557 */
- void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 558 */
- void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 559 */
- void (GLAPIENTRYP UnlockArraysEXT)(void); /* 560 */
- void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 561 */
- void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 562 */
- void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 563 */
- void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 564 */
- void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 565 */
- void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 566 */
- void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 567 */
- void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 568 */
- void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 569 */
- void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 570 */
- void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 571 */
- void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 572 */
- void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 573 */
- void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 574 */
- void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 575 */
- void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 576 */
- void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 577 */
- void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 578 */
- void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 579 */
- void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 580 */
- void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 581 */
- void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 582 */
- void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 583 */
- void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 584 */
- void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 585 */
- void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 586 */
- void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 587 */
- void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 588 */
- void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 589 */
- void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 590 */
- void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 591 */
- void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 592 */
- void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 593 */
- void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 594 */
- void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 595 */
- void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 596 */
- void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 597 */
- void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 598 */
- void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 599 */
- void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 600 */
- void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 601 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 602 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 603 */
- void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 604 */
- void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 605 */
- void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 606 */
- void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 607 */
- void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 608 */
- void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 609 */
- void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 610 */
- void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 611 */
- void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 612 */
- void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 613 */
- void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 614 */
- void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 615 */
- void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 616 */
- void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 617 */
- void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 618 */
- void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 619 */
- void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 620 */
- void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 621 */
- void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 622 */
- void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 623 */
- void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 624 */
- void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 625 */
- void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 626 */
- void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 627 */
- void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 628 */
- void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 629 */
- void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 630 */
- void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 631 */
- void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 632 */
- void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 633 */
- void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 634 */
- GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 635 */
- void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 636 */
- GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 637 */
- GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 638 */
- void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 639 */
- void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 640 */
- void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 641 */
- void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 642 */
- void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 643 */
- void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 644 */
- void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 645 */
- void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 646 */
- void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 647 */
- void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 648 */
- void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 649 */
- void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 650 */
- void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 651 */
- GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 652 */
- void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 653 */
- void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 654 */
- void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 655 */
- void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 656 */
- void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 657 */
- void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 658 */
- void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 659 */
- void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 660 */
- void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 661 */
- void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 662 */
- void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 663 */
- void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 664 */
- void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 665 */
- void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 666 */
- void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 667 */
- void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 668 */
- void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 669 */
- void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 670 */
- void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 671 */
- void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 672 */
- void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 673 */
- void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 674 */
- void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 675 */
- void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 676 */
- void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 677 */
- void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 678 */
- void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 679 */
- void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 680 */
- void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 681 */
- void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 682 */
- void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 683 */
- void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 684 */
- void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 685 */
- void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 686 */
- void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 687 */
- void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 688 */
- void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 689 */
- void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 690 */
- void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 691 */
- void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 692 */
- void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 693 */
- void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 694 */
- void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 695 */
- void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 696 */
- void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 697 */
- void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 698 */
- void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 699 */
- void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 700 */
- void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 701 */
- void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 702 */
- void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 703 */
- 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); /* 704 */
- void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 705 */
- void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 706 */
- void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 707 */
- void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 708 */
- 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); /* 709 */
- void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 710 */
- void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 711 */
- GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 712 */
- void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 713 */
- void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 714 */
- void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 715 */
- void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 716 */
- void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 717 */
- void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 718 */
- void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 719 */
- void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 720 */
- void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 721 */
- GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 722 */
- void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 723 */
- void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 724 */
- void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 725 */
- void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 726 */
- void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 727 */
- void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 728 */
- void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 729 */
- void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 730 */
- void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 731 */
- void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 732 */
- GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 733 */
- void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 734 */
- void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 735 */
- void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 736 */
- void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 737 */
- void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 738 */
- void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 739 */
- void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 740 */
- void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 741 */
- void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 742 */
- void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 743 */
- void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 744 */
- GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 745 */
- GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 746 */
- void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 747 */
- void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 748 */
- void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 749 */
- void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 750 */
- void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 751 */
- void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 752 */
+ void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
+ GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
+ GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
+ void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
+ void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
+ void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
+ void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
+ void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
+ void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
+ void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
+ void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
+ GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
+ GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
+ void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
+ void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
+ void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 423 */
+ void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
+ void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
+ void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
+ void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
+ void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
+ void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
+ void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */
+ void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */
+ void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */
+ void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */
+ void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */
+ void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */
+ void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */
+ void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
+ void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */
+ void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */
+ void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
+ void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */
+ void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */
+ void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */
+ void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */
+ void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */
+ void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
+ void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
+ void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */
+ void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */
+ void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */
+ void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */
+ void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */
+ void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */
+ void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */
+ void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */
+ void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */
+ void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */
+ void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */
+ void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */
+ void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */
+ void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */
+ void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */
+ void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */
+ void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */
+ void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */
+ void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */
+ void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */
+ void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */
+ void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */
+ void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */
+ void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */
+ void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */
+ void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */
+ void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */
+ void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */
+ void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */
+ void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */
+ void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */
+ void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */
+ void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */
+ void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */
+ void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */
+ void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */
+ void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */
+ void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */
+ void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */
+ void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */
+ void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */
+ void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */
+ void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */
+ void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */
+ void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */
+ void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */
+ void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */
+ void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */
+ void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */
+ void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */
+ void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */
+ void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */
+ void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */
+ void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */
+ void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */
+ void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */
+ void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */
+ void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */
+ void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */
+ GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */
+ GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */
+ GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */
+ void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */
+ void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */
+ void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */
+ void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */
+ void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */
+ void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */
+ void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */
+ GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */
+ void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */
+ void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */
+ GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */
+ GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */
+ void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */
+ void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */
+ void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */
+ void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */
+ GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */
+ void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */
+ void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */
+ void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */
+ void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */
+ GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */
+ void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */
+ void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */
+ void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */
+ void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */
+ void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */
+ void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */
+ void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */
+ void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */
+ void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */
+ void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */
+ void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */
+ void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */
+ void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */
+ void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */
+ void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */
+ void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */
+ void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */
+ void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */
+ void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */
+ void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */
+ void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */
+ void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */
+ void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
+ void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */
+ void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */
+ void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */
+ void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
+ GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
+ void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
+ void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
+ void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
+ void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
+ void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
+ void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
+ void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
+ void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
+ void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
+ void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
+ void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
+ void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
+ void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
+ void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
+ void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
+ void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
+ void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
+ void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
+ void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
+ void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
+ void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
+ void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
+ void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
+ void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
+ void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
+ void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
+ void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
+ void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
+ void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
+ void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
+ void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
+ void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
+ void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
+ void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
+ void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
+ void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
+ void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
+ void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
+ void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
+ void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
+ void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
+ void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
+ void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
+ void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
+ void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
+ void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
+ void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
+ void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
+ void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
+ void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
+ void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
+ void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
+ void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
+ void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
+ void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
+ void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
+ void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
+ void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
+ void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
+ void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
+ void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
+ void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
+ void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
+ void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
+ void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
+ void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
+ void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
+ void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
+ void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
+ void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
+ void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
+ void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
+ void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
+ void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
+ void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
+ void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
+ void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
+ void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
+ void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
+ void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
+ void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
+ void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
+ void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
+ void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
+ void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
+ void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
+ void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
+ void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
+ void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
+ void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
+ void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
+ void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
+ GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
+ void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
+ GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
+ GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
+ void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
+ void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
+ void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
+ void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
+ void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
+ void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
+ void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
+ void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
+ void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
+ void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 667 */
+ void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
+ void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
+ void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
+ GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
+ void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
+ void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 673 */
+ void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 674 */
+ void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 675 */
+ void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 676 */
+ void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 677 */
+ void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 678 */
+ void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 679 */
+ void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 680 */
+ void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 681 */
+ void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 682 */
+ void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 683 */
+ void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 684 */
+ void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 685 */
+ void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 686 */
+ void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 687 */
+ void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 688 */
+ void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 689 */
+ void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 690 */
+ void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 691 */
+ void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 692 */
+ void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 693 */
+ void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 694 */
+ void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 695 */
+ void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 696 */
+ void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 697 */
+ void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 698 */
+ void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 699 */
+ void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 700 */
+ void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 701 */
+ void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 702 */
+ void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 703 */
+ void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 704 */
+ void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 705 */
+ void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 706 */
+ void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 707 */
+ void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
+ void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
+ void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
+ void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
+ void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
+ void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
+ void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
+ void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
+ void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
+ void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */
+ void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */
+ void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */
+ void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 720 */
+ void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 721 */
+ void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 722 */
+ void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 723 */
+ void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 724 */
+ void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 725 */
+ void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 726 */
+ void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 727 */
+ void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 728 */
+ void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 729 */
+ void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 730 */
+ GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 731 */
+ void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 732 */
+ void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 733 */
+ void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 734 */
+ void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 735 */
+ void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 736 */
+ void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 737 */
+ void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 738 */
+ void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 739 */
+ void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 740 */
+ GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 741 */
+ void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 742 */
+ void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 743 */
+ void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 744 */
+ void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 745 */
+ void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 746 */
+ void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 747 */
+ void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 748 */
+ void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 749 */
+ void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 750 */
+ void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 751 */
+ GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 752 */
+ void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 753 */
+ void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 754 */
+ void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 755 */
+ void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 756 */
+ void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 757 */
+ void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 758 */
+ void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 759 */
+ void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 760 */
+ void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 761 */
+ void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 762 */
+ void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 763 */
+ GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 764 */
+ GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */
+ void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */
+ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */
+ void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */
+ void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */
+ void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 770 */
+ void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 771 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index 6b1f237f975..340a4f6a040 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -2679,6 +2679,71 @@ KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort *
DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void)
+{
+ RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type)
+{
+ RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program)
+{
+ DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program)
+{
+ DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
+{
+ DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params)
+{
+ DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader)
+{
+ RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader));
+}
+
KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
{
DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask));
@@ -2694,6 +2759,36 @@ KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum fail, GLenum
DISPATCH(StencilOpSeparate, (face, fail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, fail, zfail, zpass));
}
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
{
DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m));
@@ -2814,11 +2909,21 @@ KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level
DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img));
}
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index));
+}
+
KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index)
{
DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index));
}
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index));
+}
+
KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index)
{
DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index));
@@ -2854,16 +2959,31 @@ KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint
DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params)
{
DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params)
{
DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
}
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params)
{
DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
@@ -2914,126 +3034,251 @@ KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsi
DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x)
{
DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x)
{
DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x)
{
DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
{
DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
{
DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
{
DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
{
DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
{
DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v)
{
DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v)
{
DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v)
{
DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v)
{
DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v)
{
DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
@@ -3044,21 +3289,41 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v)
{
DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
{
DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
@@ -3069,11 +3334,21 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
{
DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
{
DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
@@ -3094,6 +3369,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort *
DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
{
DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
@@ -3294,9 +3574,14 @@ KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleA
DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj));
}
-KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shaderObj)
+KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader)
{
- DISPATCH(CompileShaderARB, (shaderObj), (F, "glCompileShaderARB(%d);\n", shaderObj));
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader));
}
KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void)
@@ -3319,9 +3604,14 @@ KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleA
DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj));
}
-KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
{
- DISPATCH(GetActiveUniformARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
}
KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
@@ -3349,34 +3639,69 @@ KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pna
DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source)
+KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params)
{
- DISPATCH(GetShaderSourceARB, (obj, maxLength, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) source));
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params)
{
- RETURN_DISPATCH(GetUniformLocationARB, (programObj, name), (F, "glGetUniformLocationARB(%d, %p);\n", programObj, (const void *) name));
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params)
+KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params)
{
- DISPATCH(GetUniformfvARB, (programObj, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", programObj, location, (const void *) params));
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params));
}
-KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params)
+KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program)
{
- DISPATCH(GetUniformivARB, (programObj, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", programObj, location, (const void *) params));
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program));
}
-KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program)
{
- DISPATCH(LinkProgramARB, (programObj), (F, "glLinkProgramARB(%d);\n", programObj));
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program));
}
-KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length)
+KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length)
{
- DISPATCH(ShaderSourceARB, (shaderObj, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shaderObj, count, (const void *) string, (const void *) length));
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0));
}
KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
@@ -3384,119 +3709,234 @@ KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0)
{
DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
{
DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1)
{
DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
{
DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
{
DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
}
+KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
{
DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
{
DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
}
-KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program)
+{
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program)
{
- DISPATCH(UseProgramObjectARB, (programObj), (F, "glUseProgramObjectARB(%d);\n", programObj));
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program));
}
-KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB programObj)
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name)
{
- DISPATCH(ValidateProgramARB, (programObj), (F, "glValidateProgramARB(%d);\n", programObj));
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name));
}
-KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name)
{
- DISPATCH(BindAttribLocationARB, (programObj, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", programObj, index, (const void *) name));
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name));
}
-KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
{
- DISPATCH(GetActiveAttribARB, (programObj, index, maxLength, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", programObj, index, maxLength, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
}
-KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name)
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
{
- RETURN_DISPATCH(GetAttribLocationARB, (programObj, name), (F, "glGetAttribLocationARB(%d, %p);\n", programObj, (const void *) name));
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name));
}
KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
@@ -3519,58 +3959,58 @@ 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_543)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_543)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params)
{
DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum pname, GLint * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_544)(GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params)
{
DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_545)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param)
{
DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_546)(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_546)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params)
{
DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum pname, GLint param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_547)(GLenum pname, GLint param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param)
{
DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_548)(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_548)(GLenum pname, const GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params)
{
DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLclampf value, GLboolean invert);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_549)(GLclampf value, GLboolean invert)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert)
{
DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum pattern);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_550)(GLenum pattern)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern)
{
DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
}
@@ -3620,9 +4060,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLfloat param);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_557)(GLenum pname, GLfloat param)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param)
{
DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
}
@@ -3642,9 +4082,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_558)(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_558)(GLenum pname, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params)
{
DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
}
@@ -3659,16 +4099,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, GLdouble * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_561)(GLenum pname, GLdouble * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params)
{
DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params)
{
DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
}
@@ -3913,9 +4353,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_587)(GLenum mode);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_587)(GLenum mode)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode)
{
DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
}
@@ -3930,9 +4370,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_588)(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_588)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
{
DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
}
@@ -4297,65 +4737,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_629)(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_629)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_630)(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_630)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
{
DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_631)(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_631)(GLsizei n, const GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences)
{
DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_632)(GLuint fence);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_632)(GLuint fence)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence)
{
DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_633)(GLsizei n, GLuint * fences);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_633)(GLsizei n, GLuint * fences)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences)
{
DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_634)(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_634)(GLuint fence, GLenum pname, GLint * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params)
{
DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_635)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_635)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence)
{
RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_636)(GLuint fence, GLenum condition);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_636)(GLuint fence, GLenum condition)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition)
{
DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_637)(GLuint fence);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_637)(GLuint fence)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence)
{
RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
}
@@ -4795,37 +5235,37 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para
DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_718)(GLenum face);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_718)(GLenum face)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_737)(GLenum face)
{
DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_719)(GLuint array);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_719)(GLuint array)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint array)
{
DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_720)(GLsizei n, const GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_720)(GLsizei n, const GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_739)(GLsizei n, const GLuint * arrays)
{
DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_721)(GLsizei n, GLuint * arrays);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_721)(GLsizei n, GLuint * arrays)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_740)(GLsizei n, GLuint * arrays)
{
DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
}
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_722)(GLuint array);
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array);
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_722)(GLuint array)
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_741)(GLuint array)
{
RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
}
@@ -4860,9 +5300,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len,
DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_729)(GLclampd zmin, GLclampd zmax);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_729)(GLclampd zmin, GLclampd zmax)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLclampd zmin, GLclampd zmax)
{
DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
}
@@ -4872,9 +5312,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_730)(GLenum modeRGB, GLenum modeA);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_730)(GLenum modeRGB, GLenum modeA)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(GLenum modeRGB, GLenum modeA)
{
DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
}
@@ -4964,37 +5404,37 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum intern
DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_748)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
{
DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_749)(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_749)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
{
DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint id, GLenum pname, GLint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint id, GLenum pname, GLint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_770)(GLuint id, GLenum pname, GLint64EXT * params)
{
DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
}
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_752)(GLuint id, GLenum pname, GLuint64EXT * params);
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params);
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_752)(GLuint id, GLenum pname, GLuint64EXT * params)
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_771)(GLuint id, GLenum pname, GLuint64EXT * params)
{
DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
}
@@ -5421,9 +5861,28 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(MultiTexCoord4ivARB),
TABLE_ENTRY(MultiTexCoord4sARB),
TABLE_ENTRY(MultiTexCoord4svARB),
+ TABLE_ENTRY(AttachShader),
+ TABLE_ENTRY(CreateProgram),
+ TABLE_ENTRY(CreateShader),
+ TABLE_ENTRY(DeleteProgram),
+ TABLE_ENTRY(DeleteShader),
+ TABLE_ENTRY(DetachShader),
+ TABLE_ENTRY(GetAttachedShaders),
+ TABLE_ENTRY(GetProgramInfoLog),
+ TABLE_ENTRY(GetProgramiv),
+ TABLE_ENTRY(GetShaderInfoLog),
+ TABLE_ENTRY(GetShaderiv),
+ TABLE_ENTRY(IsProgram),
+ TABLE_ENTRY(IsShader),
TABLE_ENTRY(StencilFuncSeparate),
TABLE_ENTRY(StencilMaskSeparate),
TABLE_ENTRY(StencilOpSeparate),
+ TABLE_ENTRY(UniformMatrix2x3fv),
+ TABLE_ENTRY(UniformMatrix2x4fv),
+ TABLE_ENTRY(UniformMatrix3x2fv),
+ TABLE_ENTRY(UniformMatrix3x4fv),
+ TABLE_ENTRY(UniformMatrix4x2fv),
+ TABLE_ENTRY(UniformMatrix4x3fv),
TABLE_ENTRY(LoadTransposeMatrixdARB),
TABLE_ENTRY(LoadTransposeMatrixfARB),
TABLE_ENTRY(MultTransposeMatrixdARB),
@@ -5556,14 +6015,14 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(GetAttribLocationARB),
TABLE_ENTRY(DrawBuffersARB),
TABLE_ENTRY(PolygonOffsetEXT),
- TABLE_ENTRY(_dispatch_stub_543),
- TABLE_ENTRY(_dispatch_stub_544),
- TABLE_ENTRY(_dispatch_stub_545),
- TABLE_ENTRY(_dispatch_stub_546),
- TABLE_ENTRY(_dispatch_stub_547),
- TABLE_ENTRY(_dispatch_stub_548),
- TABLE_ENTRY(_dispatch_stub_549),
- TABLE_ENTRY(_dispatch_stub_550),
+ TABLE_ENTRY(_dispatch_stub_562),
+ TABLE_ENTRY(_dispatch_stub_563),
+ TABLE_ENTRY(_dispatch_stub_564),
+ TABLE_ENTRY(_dispatch_stub_565),
+ TABLE_ENTRY(_dispatch_stub_566),
+ TABLE_ENTRY(_dispatch_stub_567),
+ TABLE_ENTRY(_dispatch_stub_568),
+ TABLE_ENTRY(_dispatch_stub_569),
TABLE_ENTRY(ColorPointerEXT),
TABLE_ENTRY(EdgeFlagPointerEXT),
TABLE_ENTRY(IndexPointerEXT),
@@ -5574,8 +6033,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(PointParameterfvEXT),
TABLE_ENTRY(LockArraysEXT),
TABLE_ENTRY(UnlockArraysEXT),
- TABLE_ENTRY(_dispatch_stub_561),
- TABLE_ENTRY(_dispatch_stub_562),
+ TABLE_ENTRY(_dispatch_stub_580),
+ TABLE_ENTRY(_dispatch_stub_581),
TABLE_ENTRY(SecondaryColor3bEXT),
TABLE_ENTRY(SecondaryColor3bvEXT),
TABLE_ENTRY(SecondaryColor3dEXT),
@@ -5600,7 +6059,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(FogCoorddvEXT),
TABLE_ENTRY(FogCoordfEXT),
TABLE_ENTRY(FogCoordfvEXT),
- TABLE_ENTRY(_dispatch_stub_587),
+ TABLE_ENTRY(_dispatch_stub_606),
TABLE_ENTRY(BlendFuncSeparateEXT),
TABLE_ENTRY(FlushVertexArrayRangeNV),
TABLE_ENTRY(VertexArrayRangeNV),
@@ -5642,15 +6101,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(WindowPos4ivMESA),
TABLE_ENTRY(WindowPos4sMESA),
TABLE_ENTRY(WindowPos4svMESA),
- TABLE_ENTRY(_dispatch_stub_629),
- TABLE_ENTRY(_dispatch_stub_630),
- TABLE_ENTRY(_dispatch_stub_631),
- TABLE_ENTRY(_dispatch_stub_632),
- TABLE_ENTRY(_dispatch_stub_633),
- TABLE_ENTRY(_dispatch_stub_634),
- TABLE_ENTRY(_dispatch_stub_635),
- TABLE_ENTRY(_dispatch_stub_636),
- TABLE_ENTRY(_dispatch_stub_637),
+ TABLE_ENTRY(_dispatch_stub_648),
+ TABLE_ENTRY(_dispatch_stub_649),
+ TABLE_ENTRY(_dispatch_stub_650),
+ TABLE_ENTRY(_dispatch_stub_651),
+ TABLE_ENTRY(_dispatch_stub_652),
+ TABLE_ENTRY(_dispatch_stub_653),
+ TABLE_ENTRY(_dispatch_stub_654),
+ TABLE_ENTRY(_dispatch_stub_655),
+ TABLE_ENTRY(_dispatch_stub_656),
TABLE_ENTRY(AreProgramsResidentNV),
TABLE_ENTRY(BindProgramNV),
TABLE_ENTRY(DeleteProgramsNV),
@@ -5731,19 +6190,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(SetFragmentShaderConstantATI),
TABLE_ENTRY(PointParameteriNV),
TABLE_ENTRY(PointParameterivNV),
- TABLE_ENTRY(_dispatch_stub_718),
- TABLE_ENTRY(_dispatch_stub_719),
- TABLE_ENTRY(_dispatch_stub_720),
- TABLE_ENTRY(_dispatch_stub_721),
- TABLE_ENTRY(_dispatch_stub_722),
+ TABLE_ENTRY(_dispatch_stub_737),
+ TABLE_ENTRY(_dispatch_stub_738),
+ TABLE_ENTRY(_dispatch_stub_739),
+ TABLE_ENTRY(_dispatch_stub_740),
+ TABLE_ENTRY(_dispatch_stub_741),
TABLE_ENTRY(GetProgramNamedParameterdvNV),
TABLE_ENTRY(GetProgramNamedParameterfvNV),
TABLE_ENTRY(ProgramNamedParameter4dNV),
TABLE_ENTRY(ProgramNamedParameter4dvNV),
TABLE_ENTRY(ProgramNamedParameter4fNV),
TABLE_ENTRY(ProgramNamedParameter4fvNV),
- TABLE_ENTRY(_dispatch_stub_729),
- TABLE_ENTRY(_dispatch_stub_730),
+ TABLE_ENTRY(_dispatch_stub_748),
+ TABLE_ENTRY(_dispatch_stub_749),
TABLE_ENTRY(BindFramebufferEXT),
TABLE_ENTRY(BindRenderbufferEXT),
TABLE_ENTRY(CheckFramebufferStatusEXT),
@@ -5761,11 +6220,11 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
TABLE_ENTRY(IsFramebufferEXT),
TABLE_ENTRY(IsRenderbufferEXT),
TABLE_ENTRY(RenderbufferStorageEXT),
- TABLE_ENTRY(_dispatch_stub_748),
- TABLE_ENTRY(_dispatch_stub_749),
- TABLE_ENTRY(_dispatch_stub_750),
- TABLE_ENTRY(_dispatch_stub_751),
- TABLE_ENTRY(_dispatch_stub_752),
+ TABLE_ENTRY(_dispatch_stub_767),
+ TABLE_ENTRY(_dispatch_stub_768),
+ TABLE_ENTRY(_dispatch_stub_769),
+ TABLE_ENTRY(_dispatch_stub_770),
+ TABLE_ENTRY(_dispatch_stub_771),
/* A whole bunch of no-op functions. These might be called
* when someone tries to call a dynamically-registered
* extension function without a current rendering context.
@@ -5964,6 +6423,43 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(CompressedTexSubImage2D),
TABLE_ENTRY(CompressedTexSubImage3D),
TABLE_ENTRY(GetCompressedTexImage),
+ TABLE_ENTRY(DisableVertexAttribArray),
+ TABLE_ENTRY(EnableVertexAttribArray),
+ TABLE_ENTRY(GetVertexAttribdv),
+ TABLE_ENTRY(GetVertexAttribfv),
+ TABLE_ENTRY(GetVertexAttribiv),
+ TABLE_ENTRY(VertexAttrib1d),
+ TABLE_ENTRY(VertexAttrib1dv),
+ TABLE_ENTRY(VertexAttrib1f),
+ TABLE_ENTRY(VertexAttrib1fv),
+ TABLE_ENTRY(VertexAttrib1s),
+ TABLE_ENTRY(VertexAttrib1sv),
+ TABLE_ENTRY(VertexAttrib2d),
+ TABLE_ENTRY(VertexAttrib2dv),
+ TABLE_ENTRY(VertexAttrib2f),
+ TABLE_ENTRY(VertexAttrib2fv),
+ TABLE_ENTRY(VertexAttrib2s),
+ TABLE_ENTRY(VertexAttrib2sv),
+ TABLE_ENTRY(VertexAttrib3d),
+ TABLE_ENTRY(VertexAttrib3dv),
+ TABLE_ENTRY(VertexAttrib3f),
+ TABLE_ENTRY(VertexAttrib3fv),
+ TABLE_ENTRY(VertexAttrib3s),
+ TABLE_ENTRY(VertexAttrib3sv),
+ TABLE_ENTRY(VertexAttrib4Nbv),
+ TABLE_ENTRY(VertexAttrib4Niv),
+ TABLE_ENTRY(VertexAttrib4Nsv),
+ TABLE_ENTRY(VertexAttrib4Nub),
+ TABLE_ENTRY(VertexAttrib4Nubv),
+ TABLE_ENTRY(VertexAttrib4Nuiv),
+ TABLE_ENTRY(VertexAttrib4Nusv),
+ TABLE_ENTRY(VertexAttrib4d),
+ TABLE_ENTRY(VertexAttrib4dv),
+ TABLE_ENTRY(VertexAttrib4f),
+ TABLE_ENTRY(VertexAttrib4fv),
+ TABLE_ENTRY(VertexAttrib4s),
+ TABLE_ENTRY(VertexAttrib4sv),
+ TABLE_ENTRY(VertexAttribPointer),
TABLE_ENTRY(BindBuffer),
TABLE_ENTRY(BufferData),
TABLE_ENTRY(BufferSubData),
@@ -5983,6 +6479,38 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(GetQueryObjectuiv),
TABLE_ENTRY(GetQueryiv),
TABLE_ENTRY(IsQuery),
+ TABLE_ENTRY(CompileShader),
+ TABLE_ENTRY(GetActiveUniform),
+ TABLE_ENTRY(GetShaderSource),
+ TABLE_ENTRY(GetUniformLocation),
+ TABLE_ENTRY(GetUniformfv),
+ TABLE_ENTRY(GetUniformiv),
+ TABLE_ENTRY(LinkProgram),
+ TABLE_ENTRY(ShaderSource),
+ TABLE_ENTRY(Uniform1f),
+ TABLE_ENTRY(Uniform1fv),
+ TABLE_ENTRY(Uniform1i),
+ TABLE_ENTRY(Uniform1iv),
+ TABLE_ENTRY(Uniform2f),
+ TABLE_ENTRY(Uniform2fv),
+ TABLE_ENTRY(Uniform2i),
+ TABLE_ENTRY(Uniform2iv),
+ TABLE_ENTRY(Uniform3f),
+ TABLE_ENTRY(Uniform3fv),
+ TABLE_ENTRY(Uniform3i),
+ TABLE_ENTRY(Uniform3iv),
+ TABLE_ENTRY(Uniform4f),
+ TABLE_ENTRY(Uniform4fv),
+ TABLE_ENTRY(Uniform4i),
+ TABLE_ENTRY(Uniform4iv),
+ TABLE_ENTRY(UniformMatrix2fv),
+ TABLE_ENTRY(UniformMatrix3fv),
+ TABLE_ENTRY(UniformMatrix4fv),
+ TABLE_ENTRY(UseProgram),
+ TABLE_ENTRY(ValidateProgram),
+ TABLE_ENTRY(BindAttribLocation),
+ TABLE_ENTRY(GetActiveAttrib),
+ TABLE_ENTRY(GetAttribLocation),
TABLE_ENTRY(DrawBuffers),
TABLE_ENTRY(DrawBuffersATI),
TABLE_ENTRY(PointParameterf),
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index cc35138ae8a..905c65862d1 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -460,9 +460,28 @@ static const char gl_string_table[] =
"glMultiTexCoord4ivARB\0"
"glMultiTexCoord4sARB\0"
"glMultiTexCoord4svARB\0"
+ "glAttachShader\0"
+ "glCreateProgram\0"
+ "glCreateShader\0"
+ "glDeleteProgram\0"
+ "glDeleteShader\0"
+ "glDetachShader\0"
+ "glGetAttachedShaders\0"
+ "glGetProgramInfoLog\0"
+ "glGetProgramiv\0"
+ "glGetShaderInfoLog\0"
+ "glGetShaderiv\0"
+ "glIsProgram\0"
+ "glIsShader\0"
"glStencilFuncSeparate\0"
"glStencilMaskSeparate\0"
"glStencilOpSeparate\0"
+ "glUniformMatrix2x3fv\0"
+ "glUniformMatrix2x4fv\0"
+ "glUniformMatrix3x2fv\0"
+ "glUniformMatrix3x4fv\0"
+ "glUniformMatrix4x2fv\0"
+ "glUniformMatrix4x3fv\0"
"glLoadTransposeMatrixdARB\0"
"glLoadTransposeMatrixfARB\0"
"glMultTransposeMatrixdARB\0"
@@ -908,6 +927,43 @@ static const char gl_string_table[] =
"glCompressedTexSubImage2D\0"
"glCompressedTexSubImage3D\0"
"glGetCompressedTexImage\0"
+ "glDisableVertexAttribArray\0"
+ "glEnableVertexAttribArray\0"
+ "glGetVertexAttribdv\0"
+ "glGetVertexAttribfv\0"
+ "glGetVertexAttribiv\0"
+ "glVertexAttrib1d\0"
+ "glVertexAttrib1dv\0"
+ "glVertexAttrib1f\0"
+ "glVertexAttrib1fv\0"
+ "glVertexAttrib1s\0"
+ "glVertexAttrib1sv\0"
+ "glVertexAttrib2d\0"
+ "glVertexAttrib2dv\0"
+ "glVertexAttrib2f\0"
+ "glVertexAttrib2fv\0"
+ "glVertexAttrib2s\0"
+ "glVertexAttrib2sv\0"
+ "glVertexAttrib3d\0"
+ "glVertexAttrib3dv\0"
+ "glVertexAttrib3f\0"
+ "glVertexAttrib3fv\0"
+ "glVertexAttrib3s\0"
+ "glVertexAttrib3sv\0"
+ "glVertexAttrib4Nbv\0"
+ "glVertexAttrib4Niv\0"
+ "glVertexAttrib4Nsv\0"
+ "glVertexAttrib4Nub\0"
+ "glVertexAttrib4Nubv\0"
+ "glVertexAttrib4Nuiv\0"
+ "glVertexAttrib4Nusv\0"
+ "glVertexAttrib4d\0"
+ "glVertexAttrib4dv\0"
+ "glVertexAttrib4f\0"
+ "glVertexAttrib4fv\0"
+ "glVertexAttrib4s\0"
+ "glVertexAttrib4sv\0"
+ "glVertexAttribPointer\0"
"glBindBuffer\0"
"glBufferData\0"
"glBufferSubData\0"
@@ -927,6 +983,38 @@ static const char gl_string_table[] =
"glGetQueryObjectuiv\0"
"glGetQueryiv\0"
"glIsQuery\0"
+ "glCompileShader\0"
+ "glGetActiveUniform\0"
+ "glGetShaderSource\0"
+ "glGetUniformLocation\0"
+ "glGetUniformfv\0"
+ "glGetUniformiv\0"
+ "glLinkProgram\0"
+ "glShaderSource\0"
+ "glUniform1f\0"
+ "glUniform1fv\0"
+ "glUniform1i\0"
+ "glUniform1iv\0"
+ "glUniform2f\0"
+ "glUniform2fv\0"
+ "glUniform2i\0"
+ "glUniform2iv\0"
+ "glUniform3f\0"
+ "glUniform3fv\0"
+ "glUniform3i\0"
+ "glUniform3iv\0"
+ "glUniform4f\0"
+ "glUniform4fv\0"
+ "glUniform4i\0"
+ "glUniform4iv\0"
+ "glUniformMatrix2fv\0"
+ "glUniformMatrix3fv\0"
+ "glUniformMatrix4fv\0"
+ "glUseProgram\0"
+ "glValidateProgram\0"
+ "glBindAttribLocation\0"
+ "glGetActiveAttrib\0"
+ "glGetAttribLocation\0"
"glDrawBuffers\0"
"glDrawBuffersATI\0"
"glSampleMaskEXT\0"
@@ -1006,6 +1094,56 @@ static const char gl_string_table[] =
"glBlendEquationSeparateATI\0"
;
+
+#ifdef USE_MGL_NAMESPACE
+#define gl_dispatch_stub_343 mgl_dispatch_stub_343
+#define gl_dispatch_stub_344 mgl_dispatch_stub_344
+#define gl_dispatch_stub_345 mgl_dispatch_stub_345
+#define gl_dispatch_stub_356 mgl_dispatch_stub_356
+#define gl_dispatch_stub_357 mgl_dispatch_stub_357
+#define gl_dispatch_stub_358 mgl_dispatch_stub_358
+#define gl_dispatch_stub_359 mgl_dispatch_stub_359
+#define gl_dispatch_stub_361 mgl_dispatch_stub_361
+#define gl_dispatch_stub_362 mgl_dispatch_stub_362
+#define gl_dispatch_stub_363 mgl_dispatch_stub_363
+#define gl_dispatch_stub_364 mgl_dispatch_stub_364
+#define gl_dispatch_stub_365 mgl_dispatch_stub_365
+#define gl_dispatch_stub_366 mgl_dispatch_stub_366
+#define gl_dispatch_stub_562 mgl_dispatch_stub_562
+#define gl_dispatch_stub_563 mgl_dispatch_stub_563
+#define gl_dispatch_stub_564 mgl_dispatch_stub_564
+#define gl_dispatch_stub_565 mgl_dispatch_stub_565
+#define gl_dispatch_stub_566 mgl_dispatch_stub_566
+#define gl_dispatch_stub_567 mgl_dispatch_stub_567
+#define gl_dispatch_stub_568 mgl_dispatch_stub_568
+#define gl_dispatch_stub_569 mgl_dispatch_stub_569
+#define gl_dispatch_stub_580 mgl_dispatch_stub_580
+#define gl_dispatch_stub_581 mgl_dispatch_stub_581
+#define gl_dispatch_stub_606 mgl_dispatch_stub_606
+#define gl_dispatch_stub_648 mgl_dispatch_stub_648
+#define gl_dispatch_stub_649 mgl_dispatch_stub_649
+#define gl_dispatch_stub_650 mgl_dispatch_stub_650
+#define gl_dispatch_stub_651 mgl_dispatch_stub_651
+#define gl_dispatch_stub_652 mgl_dispatch_stub_652
+#define gl_dispatch_stub_653 mgl_dispatch_stub_653
+#define gl_dispatch_stub_654 mgl_dispatch_stub_654
+#define gl_dispatch_stub_655 mgl_dispatch_stub_655
+#define gl_dispatch_stub_656 mgl_dispatch_stub_656
+#define gl_dispatch_stub_737 mgl_dispatch_stub_737
+#define gl_dispatch_stub_738 mgl_dispatch_stub_738
+#define gl_dispatch_stub_739 mgl_dispatch_stub_739
+#define gl_dispatch_stub_740 mgl_dispatch_stub_740
+#define gl_dispatch_stub_741 mgl_dispatch_stub_741
+#define gl_dispatch_stub_748 mgl_dispatch_stub_748
+#define gl_dispatch_stub_749 mgl_dispatch_stub_749
+#define gl_dispatch_stub_767 mgl_dispatch_stub_767
+#define gl_dispatch_stub_768 mgl_dispatch_stub_768
+#define gl_dispatch_stub_769 mgl_dispatch_stub_769
+#define gl_dispatch_stub_770 mgl_dispatch_stub_770
+#define gl_dispatch_stub_771 mgl_dispatch_stub_771
+#endif /* USE_MGL_NAMESPACE */
+
+
/* FIXME: Having these (incorrect) prototypes here is ugly. */
#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
extern void gl_dispatch_stub_343(void);
@@ -1021,38 +1159,38 @@ 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_543(void);
-extern void gl_dispatch_stub_544(void);
-extern void gl_dispatch_stub_545(void);
-extern void gl_dispatch_stub_546(void);
-extern void gl_dispatch_stub_547(void);
-extern void gl_dispatch_stub_548(void);
-extern void gl_dispatch_stub_549(void);
-extern void gl_dispatch_stub_550(void);
-extern void gl_dispatch_stub_561(void);
extern void gl_dispatch_stub_562(void);
-extern void gl_dispatch_stub_587(void);
-extern void gl_dispatch_stub_629(void);
-extern void gl_dispatch_stub_630(void);
-extern void gl_dispatch_stub_631(void);
-extern void gl_dispatch_stub_632(void);
-extern void gl_dispatch_stub_633(void);
-extern void gl_dispatch_stub_634(void);
-extern void gl_dispatch_stub_635(void);
-extern void gl_dispatch_stub_636(void);
-extern void gl_dispatch_stub_637(void);
-extern void gl_dispatch_stub_718(void);
-extern void gl_dispatch_stub_719(void);
-extern void gl_dispatch_stub_720(void);
-extern void gl_dispatch_stub_721(void);
-extern void gl_dispatch_stub_722(void);
-extern void gl_dispatch_stub_729(void);
-extern void gl_dispatch_stub_730(void);
+extern void gl_dispatch_stub_563(void);
+extern void gl_dispatch_stub_564(void);
+extern void gl_dispatch_stub_565(void);
+extern void gl_dispatch_stub_566(void);
+extern void gl_dispatch_stub_567(void);
+extern void gl_dispatch_stub_568(void);
+extern void gl_dispatch_stub_569(void);
+extern void gl_dispatch_stub_580(void);
+extern void gl_dispatch_stub_581(void);
+extern void gl_dispatch_stub_606(void);
+extern void gl_dispatch_stub_648(void);
+extern void gl_dispatch_stub_649(void);
+extern void gl_dispatch_stub_650(void);
+extern void gl_dispatch_stub_651(void);
+extern void gl_dispatch_stub_652(void);
+extern void gl_dispatch_stub_653(void);
+extern void gl_dispatch_stub_654(void);
+extern void gl_dispatch_stub_655(void);
+extern void gl_dispatch_stub_656(void);
+extern void gl_dispatch_stub_737(void);
+extern void gl_dispatch_stub_738(void);
+extern void gl_dispatch_stub_739(void);
+extern void gl_dispatch_stub_740(void);
+extern void gl_dispatch_stub_741(void);
extern void gl_dispatch_stub_748(void);
extern void gl_dispatch_stub_749(void);
-extern void gl_dispatch_stub_750(void);
-extern void gl_dispatch_stub_751(void);
-extern void gl_dispatch_stub_752(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);
+extern void gl_dispatch_stub_771(void);
#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
static const glprocs_table_t static_functions[] = {
@@ -1464,550 +1602,638 @@ static const glprocs_table_t static_functions[] = {
NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
- NAME_FUNC_OFFSET( 5769, glStencilFuncSeparate, glStencilFuncSeparate, NULL, _gloffset_StencilFuncSeparate),
- NAME_FUNC_OFFSET( 5791, glStencilMaskSeparate, glStencilMaskSeparate, NULL, _gloffset_StencilMaskSeparate),
- NAME_FUNC_OFFSET( 5813, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
- NAME_FUNC_OFFSET( 5833, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
- NAME_FUNC_OFFSET( 5859, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
- NAME_FUNC_OFFSET( 5885, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
- NAME_FUNC_OFFSET( 5911, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
- NAME_FUNC_OFFSET( 5937, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
- NAME_FUNC_OFFSET( 5957, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
- NAME_FUNC_OFFSET( 5983, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
- NAME_FUNC_OFFSET( 6009, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
- NAME_FUNC_OFFSET( 6035, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
- NAME_FUNC_OFFSET( 6064, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
- NAME_FUNC_OFFSET( 6093, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
- NAME_FUNC_OFFSET( 6122, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
- NAME_FUNC_OFFSET( 6149, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
- NAME_FUNC_OFFSET( 6179, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
- NAME_FUNC_OFFSET( 6208, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, _gloffset_GetProgramEnvParameterdvARB),
- NAME_FUNC_OFFSET( 6238, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, _gloffset_GetProgramEnvParameterfvARB),
- NAME_FUNC_OFFSET( 6268, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, _gloffset_GetProgramLocalParameterdvARB),
- NAME_FUNC_OFFSET( 6300, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, _gloffset_GetProgramLocalParameterfvARB),
- NAME_FUNC_OFFSET( 6332, glGetProgramStringARB, glGetProgramStringARB, NULL, _gloffset_GetProgramStringARB),
- NAME_FUNC_OFFSET( 6354, glGetProgramivARB, glGetProgramivARB, NULL, _gloffset_GetProgramivARB),
- NAME_FUNC_OFFSET( 6372, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
- NAME_FUNC_OFFSET( 6395, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
- NAME_FUNC_OFFSET( 6418, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
- NAME_FUNC_OFFSET( 6441, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
- NAME_FUNC_OFFSET( 6468, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
- NAME_FUNC_OFFSET( 6496, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
- NAME_FUNC_OFFSET( 6523, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
- NAME_FUNC_OFFSET( 6551, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, _gloffset_ProgramLocalParameter4dARB),
- NAME_FUNC_OFFSET( 6580, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, _gloffset_ProgramLocalParameter4dvARB),
- NAME_FUNC_OFFSET( 6610, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, _gloffset_ProgramLocalParameter4fARB),
- NAME_FUNC_OFFSET( 6639, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, _gloffset_ProgramLocalParameter4fvARB),
- NAME_FUNC_OFFSET( 6669, glProgramStringARB, glProgramStringARB, NULL, _gloffset_ProgramStringARB),
- NAME_FUNC_OFFSET( 6688, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
- NAME_FUNC_OFFSET( 6708, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
- NAME_FUNC_OFFSET( 6729, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
- NAME_FUNC_OFFSET( 6749, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
- NAME_FUNC_OFFSET( 6770, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
- NAME_FUNC_OFFSET( 6790, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
- NAME_FUNC_OFFSET( 6811, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
- NAME_FUNC_OFFSET( 6831, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
- NAME_FUNC_OFFSET( 6852, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
- NAME_FUNC_OFFSET( 6872, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
- NAME_FUNC_OFFSET( 6893, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
- NAME_FUNC_OFFSET( 6913, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
- NAME_FUNC_OFFSET( 6934, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
- NAME_FUNC_OFFSET( 6954, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
- NAME_FUNC_OFFSET( 6975, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
- NAME_FUNC_OFFSET( 6995, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
- NAME_FUNC_OFFSET( 7016, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
- NAME_FUNC_OFFSET( 7036, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
- NAME_FUNC_OFFSET( 7057, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
- NAME_FUNC_OFFSET( 7079, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
- NAME_FUNC_OFFSET( 7101, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
- NAME_FUNC_OFFSET( 7123, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
- NAME_FUNC_OFFSET( 7145, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
- NAME_FUNC_OFFSET( 7168, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
- NAME_FUNC_OFFSET( 7191, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
- NAME_FUNC_OFFSET( 7214, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
- NAME_FUNC_OFFSET( 7235, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
- NAME_FUNC_OFFSET( 7255, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
- NAME_FUNC_OFFSET( 7276, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
- NAME_FUNC_OFFSET( 7296, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
- NAME_FUNC_OFFSET( 7317, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
- NAME_FUNC_OFFSET( 7338, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
- NAME_FUNC_OFFSET( 7358, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
- NAME_FUNC_OFFSET( 7379, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
- NAME_FUNC_OFFSET( 7401, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
- NAME_FUNC_OFFSET( 7423, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
- NAME_FUNC_OFFSET( 7445, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
- NAME_FUNC_OFFSET( 7470, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
- NAME_FUNC_OFFSET( 7486, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
- NAME_FUNC_OFFSET( 7502, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
- NAME_FUNC_OFFSET( 7521, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
- NAME_FUNC_OFFSET( 7540, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
- NAME_FUNC_OFFSET( 7556, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
- NAME_FUNC_OFFSET( 7582, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
- NAME_FUNC_OFFSET( 7605, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
- NAME_FUNC_OFFSET( 7627, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
- NAME_FUNC_OFFSET( 7641, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
- NAME_FUNC_OFFSET( 7656, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
- NAME_FUNC_OFFSET( 7673, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
- NAME_FUNC_OFFSET( 7689, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
- NAME_FUNC_OFFSET( 7708, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
- NAME_FUNC_OFFSET( 7722, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
- NAME_FUNC_OFFSET( 7738, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
- NAME_FUNC_OFFSET( 7760, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
- NAME_FUNC_OFFSET( 7783, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
- NAME_FUNC_OFFSET( 7799, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
- NAME_FUNC_OFFSET( 7812, glAttachObjectARB, glAttachObjectARB, NULL, _gloffset_AttachObjectARB),
- NAME_FUNC_OFFSET( 7830, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
- NAME_FUNC_OFFSET( 7849, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, _gloffset_CreateProgramObjectARB),
- NAME_FUNC_OFFSET( 7874, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, _gloffset_CreateShaderObjectARB),
- NAME_FUNC_OFFSET( 7898, glDeleteObjectARB, glDeleteObjectARB, NULL, _gloffset_DeleteObjectARB),
- NAME_FUNC_OFFSET( 7916, glDetachObjectARB, glDetachObjectARB, NULL, _gloffset_DetachObjectARB),
- NAME_FUNC_OFFSET( 7934, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
- NAME_FUNC_OFFSET( 7956, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, _gloffset_GetAttachedObjectsARB),
- NAME_FUNC_OFFSET( 7980, glGetHandleARB, glGetHandleARB, NULL, _gloffset_GetHandleARB),
- NAME_FUNC_OFFSET( 7995, glGetInfoLogARB, glGetInfoLogARB, NULL, _gloffset_GetInfoLogARB),
- NAME_FUNC_OFFSET( 8011, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, _gloffset_GetObjectParameterfvARB),
- NAME_FUNC_OFFSET( 8037, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, _gloffset_GetObjectParameterivARB),
- NAME_FUNC_OFFSET( 8063, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
- NAME_FUNC_OFFSET( 8084, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
- NAME_FUNC_OFFSET( 8108, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
- NAME_FUNC_OFFSET( 8126, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
- NAME_FUNC_OFFSET( 8144, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
- NAME_FUNC_OFFSET( 8161, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
- NAME_FUNC_OFFSET( 8179, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
- NAME_FUNC_OFFSET( 8194, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
- NAME_FUNC_OFFSET( 8210, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
- NAME_FUNC_OFFSET( 8225, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
- NAME_FUNC_OFFSET( 8241, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
- NAME_FUNC_OFFSET( 8256, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
- NAME_FUNC_OFFSET( 8272, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
- NAME_FUNC_OFFSET( 8287, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
- NAME_FUNC_OFFSET( 8303, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
- NAME_FUNC_OFFSET( 8318, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
- NAME_FUNC_OFFSET( 8334, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
- NAME_FUNC_OFFSET( 8349, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
- NAME_FUNC_OFFSET( 8365, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
- NAME_FUNC_OFFSET( 8380, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
- NAME_FUNC_OFFSET( 8396, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
- NAME_FUNC_OFFSET( 8411, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
- NAME_FUNC_OFFSET( 8427, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
- NAME_FUNC_OFFSET( 8449, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
- NAME_FUNC_OFFSET( 8471, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
- NAME_FUNC_OFFSET( 8493, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
- NAME_FUNC_OFFSET( 8515, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
- NAME_FUNC_OFFSET( 8536, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
- NAME_FUNC_OFFSET( 8560, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
- NAME_FUNC_OFFSET( 8581, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
- NAME_FUNC_OFFSET( 8604, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET( 8621, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT),
- NAME_FUNC_OFFSET( 8640, gl_dispatch_stub_543, gl_dispatch_stub_543, NULL, _gloffset_GetPixelTexGenParameterfvSGIS),
- NAME_FUNC_OFFSET( 8672, gl_dispatch_stub_544, gl_dispatch_stub_544, NULL, _gloffset_GetPixelTexGenParameterivSGIS),
- NAME_FUNC_OFFSET( 8704, gl_dispatch_stub_545, gl_dispatch_stub_545, NULL, _gloffset_PixelTexGenParameterfSGIS),
- NAME_FUNC_OFFSET( 8732, gl_dispatch_stub_546, gl_dispatch_stub_546, NULL, _gloffset_PixelTexGenParameterfvSGIS),
- NAME_FUNC_OFFSET( 8761, gl_dispatch_stub_547, gl_dispatch_stub_547, NULL, _gloffset_PixelTexGenParameteriSGIS),
- NAME_FUNC_OFFSET( 8789, gl_dispatch_stub_548, gl_dispatch_stub_548, NULL, _gloffset_PixelTexGenParameterivSGIS),
- NAME_FUNC_OFFSET( 8818, gl_dispatch_stub_549, gl_dispatch_stub_549, NULL, _gloffset_SampleMaskSGIS),
- NAME_FUNC_OFFSET( 8835, gl_dispatch_stub_550, gl_dispatch_stub_550, NULL, _gloffset_SamplePatternSGIS),
- NAME_FUNC_OFFSET( 8855, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT),
- NAME_FUNC_OFFSET( 8873, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT),
- NAME_FUNC_OFFSET( 8894, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT),
- NAME_FUNC_OFFSET( 8912, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT),
- NAME_FUNC_OFFSET( 8931, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT),
- NAME_FUNC_OFFSET( 8952, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT),
- NAME_FUNC_OFFSET( 8971, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET( 8992, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET( 9014, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT),
- NAME_FUNC_OFFSET( 9030, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT),
- NAME_FUNC_OFFSET( 9048, gl_dispatch_stub_561, gl_dispatch_stub_561, NULL, _gloffset_CullParameterdvEXT),
- NAME_FUNC_OFFSET( 9069, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_CullParameterfvEXT),
- NAME_FUNC_OFFSET( 9090, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
- NAME_FUNC_OFFSET( 9112, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
- NAME_FUNC_OFFSET( 9135, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
- NAME_FUNC_OFFSET( 9157, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
- NAME_FUNC_OFFSET( 9180, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
- NAME_FUNC_OFFSET( 9202, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
- NAME_FUNC_OFFSET( 9225, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
- NAME_FUNC_OFFSET( 9247, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
- NAME_FUNC_OFFSET( 9270, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
- NAME_FUNC_OFFSET( 9292, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
- NAME_FUNC_OFFSET( 9315, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
- NAME_FUNC_OFFSET( 9338, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
- NAME_FUNC_OFFSET( 9362, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
- NAME_FUNC_OFFSET( 9385, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
- NAME_FUNC_OFFSET( 9409, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
- NAME_FUNC_OFFSET( 9432, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
- NAME_FUNC_OFFSET( 9456, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
- NAME_FUNC_OFFSET( 9483, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
- NAME_FUNC_OFFSET( 9504, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
- NAME_FUNC_OFFSET( 9527, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
- NAME_FUNC_OFFSET( 9548, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
- NAME_FUNC_OFFSET( 9563, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
- NAME_FUNC_OFFSET( 9579, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
- NAME_FUNC_OFFSET( 9594, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
- NAME_FUNC_OFFSET( 9610, gl_dispatch_stub_587, gl_dispatch_stub_587, NULL, _gloffset_PixelTexGenSGIX),
- NAME_FUNC_OFFSET( 9628, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET( 9651, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV),
- NAME_FUNC_OFFSET( 9677, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV),
- NAME_FUNC_OFFSET( 9698, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV),
- NAME_FUNC_OFFSET( 9716, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV),
- NAME_FUNC_OFFSET( 9735, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV),
- NAME_FUNC_OFFSET( 9758, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV),
- NAME_FUNC_OFFSET( 9782, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV),
- NAME_FUNC_OFFSET( 9805, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV),
- NAME_FUNC_OFFSET( 9829, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV),
- NAME_FUNC_OFFSET( 9852, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV),
- NAME_FUNC_OFFSET( 9884, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV),
- NAME_FUNC_OFFSET( 9916, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV),
- NAME_FUNC_OFFSET( 9949, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV),
- NAME_FUNC_OFFSET( 9982, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV),
- NAME_FUNC_OFFSET(10019, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV),
- NAME_FUNC_OFFSET(10056, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA),
- NAME_FUNC_OFFSET(10076, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(10094, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(10113, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(10131, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(10150, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(10168, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(10187, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(10205, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(10224, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(10242, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(10261, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(10279, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(10298, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(10316, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(10335, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(10353, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(10372, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA),
- NAME_FUNC_OFFSET(10390, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA),
- NAME_FUNC_OFFSET(10409, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA),
- NAME_FUNC_OFFSET(10427, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA),
- NAME_FUNC_OFFSET(10446, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA),
- NAME_FUNC_OFFSET(10464, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA),
- NAME_FUNC_OFFSET(10483, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA),
- NAME_FUNC_OFFSET(10501, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA),
- NAME_FUNC_OFFSET(10520, gl_dispatch_stub_629, gl_dispatch_stub_629, NULL, _gloffset_MultiModeDrawArraysIBM),
- NAME_FUNC_OFFSET(10545, gl_dispatch_stub_630, gl_dispatch_stub_630, NULL, _gloffset_MultiModeDrawElementsIBM),
- NAME_FUNC_OFFSET(10572, gl_dispatch_stub_631, gl_dispatch_stub_631, NULL, _gloffset_DeleteFencesNV),
- NAME_FUNC_OFFSET(10589, gl_dispatch_stub_632, gl_dispatch_stub_632, NULL, _gloffset_FinishFenceNV),
- NAME_FUNC_OFFSET(10605, gl_dispatch_stub_633, gl_dispatch_stub_633, NULL, _gloffset_GenFencesNV),
- NAME_FUNC_OFFSET(10619, gl_dispatch_stub_634, gl_dispatch_stub_634, NULL, _gloffset_GetFenceivNV),
- NAME_FUNC_OFFSET(10634, gl_dispatch_stub_635, gl_dispatch_stub_635, NULL, _gloffset_IsFenceNV),
- NAME_FUNC_OFFSET(10646, gl_dispatch_stub_636, gl_dispatch_stub_636, NULL, _gloffset_SetFenceNV),
- NAME_FUNC_OFFSET(10659, gl_dispatch_stub_637, gl_dispatch_stub_637, NULL, _gloffset_TestFenceNV),
- NAME_FUNC_OFFSET(10673, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV),
- NAME_FUNC_OFFSET(10697, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
- NAME_FUNC_OFFSET(10713, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
- NAME_FUNC_OFFSET(10732, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV),
- NAME_FUNC_OFFSET(10751, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
- NAME_FUNC_OFFSET(10767, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV),
- NAME_FUNC_OFFSET(10793, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV),
- NAME_FUNC_OFFSET(10819, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV),
- NAME_FUNC_OFFSET(10840, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV),
- NAME_FUNC_OFFSET(10857, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV),
- NAME_FUNC_OFFSET(10878, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(10906, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV),
- NAME_FUNC_OFFSET(10928, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV),
- NAME_FUNC_OFFSET(10950, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
- NAME_FUNC_OFFSET(10972, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
- NAME_FUNC_OFFSET(10986, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
- NAME_FUNC_OFFSET(11002, glProgramParameter4dNV, glProgramParameter4dNV, NULL, _gloffset_ProgramParameter4dNV),
- NAME_FUNC_OFFSET(11025, glProgramParameter4dvNV, glProgramParameter4dvNV, NULL, _gloffset_ProgramParameter4dvNV),
- NAME_FUNC_OFFSET(11049, glProgramParameter4fNV, glProgramParameter4fNV, NULL, _gloffset_ProgramParameter4fNV),
- NAME_FUNC_OFFSET(11072, glProgramParameter4fvNV, glProgramParameter4fvNV, NULL, _gloffset_ProgramParameter4fvNV),
- NAME_FUNC_OFFSET(11096, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
- NAME_FUNC_OFFSET(11121, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
- NAME_FUNC_OFFSET(11146, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
- NAME_FUNC_OFFSET(11174, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
- NAME_FUNC_OFFSET(11190, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
- NAME_FUNC_OFFSET(11209, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
- NAME_FUNC_OFFSET(11229, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
- NAME_FUNC_OFFSET(11248, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
- NAME_FUNC_OFFSET(11268, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
- NAME_FUNC_OFFSET(11287, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
- NAME_FUNC_OFFSET(11307, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
- NAME_FUNC_OFFSET(11326, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
- NAME_FUNC_OFFSET(11346, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
- NAME_FUNC_OFFSET(11365, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
- NAME_FUNC_OFFSET(11385, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
- NAME_FUNC_OFFSET(11404, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
- NAME_FUNC_OFFSET(11424, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
- NAME_FUNC_OFFSET(11443, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
- NAME_FUNC_OFFSET(11463, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
- NAME_FUNC_OFFSET(11482, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
- NAME_FUNC_OFFSET(11502, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
- NAME_FUNC_OFFSET(11521, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
- NAME_FUNC_OFFSET(11541, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
- NAME_FUNC_OFFSET(11560, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
- NAME_FUNC_OFFSET(11580, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
- NAME_FUNC_OFFSET(11599, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
- NAME_FUNC_OFFSET(11619, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
- NAME_FUNC_OFFSET(11638, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
- NAME_FUNC_OFFSET(11658, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
- NAME_FUNC_OFFSET(11678, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
- NAME_FUNC_OFFSET(11699, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
- NAME_FUNC_OFFSET(11723, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
- NAME_FUNC_OFFSET(11744, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
- NAME_FUNC_OFFSET(11765, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
- NAME_FUNC_OFFSET(11786, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
- NAME_FUNC_OFFSET(11807, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
- NAME_FUNC_OFFSET(11828, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
- NAME_FUNC_OFFSET(11849, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
- NAME_FUNC_OFFSET(11870, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
- NAME_FUNC_OFFSET(11891, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
- NAME_FUNC_OFFSET(11912, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
- NAME_FUNC_OFFSET(11933, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
- NAME_FUNC_OFFSET(11954, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
- NAME_FUNC_OFFSET(11975, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
- NAME_FUNC_OFFSET(11997, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
- NAME_FUNC_OFFSET(12019, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
- NAME_FUNC_OFFSET(12041, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
- NAME_FUNC_OFFSET(12063, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
- NAME_FUNC_OFFSET(12088, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
- NAME_FUNC_OFFSET(12112, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
- NAME_FUNC_OFFSET(12134, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
- NAME_FUNC_OFFSET(12156, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
- NAME_FUNC_OFFSET(12178, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
- NAME_FUNC_OFFSET(12204, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
- NAME_FUNC_OFFSET(12227, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
- NAME_FUNC_OFFSET(12251, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
- NAME_FUNC_OFFSET(12269, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
- NAME_FUNC_OFFSET(12284, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
- NAME_FUNC_OFFSET(12315, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
- NAME_FUNC_OFFSET(12335, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
- NAME_FUNC_OFFSET(12356, gl_dispatch_stub_718, gl_dispatch_stub_718, NULL, _gloffset_ActiveStencilFaceEXT),
- NAME_FUNC_OFFSET(12379, gl_dispatch_stub_719, gl_dispatch_stub_719, NULL, _gloffset_BindVertexArrayAPPLE),
- NAME_FUNC_OFFSET(12402, gl_dispatch_stub_720, gl_dispatch_stub_720, NULL, _gloffset_DeleteVertexArraysAPPLE),
- NAME_FUNC_OFFSET(12428, gl_dispatch_stub_721, gl_dispatch_stub_721, NULL, _gloffset_GenVertexArraysAPPLE),
- NAME_FUNC_OFFSET(12451, gl_dispatch_stub_722, gl_dispatch_stub_722, NULL, _gloffset_IsVertexArrayAPPLE),
- NAME_FUNC_OFFSET(12472, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
- NAME_FUNC_OFFSET(12503, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
- NAME_FUNC_OFFSET(12534, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
- NAME_FUNC_OFFSET(12562, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
- NAME_FUNC_OFFSET(12591, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
- NAME_FUNC_OFFSET(12619, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
- NAME_FUNC_OFFSET(12648, gl_dispatch_stub_729, gl_dispatch_stub_729, NULL, _gloffset_DepthBoundsEXT),
- NAME_FUNC_OFFSET(12665, gl_dispatch_stub_730, gl_dispatch_stub_730, NULL, _gloffset_BlendEquationSeparateEXT),
- NAME_FUNC_OFFSET(12692, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
- NAME_FUNC_OFFSET(12713, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
- NAME_FUNC_OFFSET(12735, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
- NAME_FUNC_OFFSET(12763, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
- NAME_FUNC_OFFSET(12787, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
- NAME_FUNC_OFFSET(12812, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
- NAME_FUNC_OFFSET(12841, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
- NAME_FUNC_OFFSET(12867, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
- NAME_FUNC_OFFSET(12893, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
- NAME_FUNC_OFFSET(12919, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
- NAME_FUNC_OFFSET(12940, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
- NAME_FUNC_OFFSET(12962, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
- NAME_FUNC_OFFSET(12982, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
- NAME_FUNC_OFFSET(13023, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
- NAME_FUNC_OFFSET(13055, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
- NAME_FUNC_OFFSET(13074, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
- NAME_FUNC_OFFSET(13094, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
- NAME_FUNC_OFFSET(13119, gl_dispatch_stub_748, gl_dispatch_stub_748, NULL, _gloffset_BlitFramebufferEXT),
- NAME_FUNC_OFFSET(13140, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_ProgramEnvParameters4fvEXT),
- NAME_FUNC_OFFSET(13169, gl_dispatch_stub_750, gl_dispatch_stub_750, NULL, _gloffset_ProgramLocalParameters4fvEXT),
- NAME_FUNC_OFFSET(13200, gl_dispatch_stub_751, gl_dispatch_stub_751, NULL, _gloffset_GetQueryObjecti64vEXT),
- NAME_FUNC_OFFSET(13224, gl_dispatch_stub_752, gl_dispatch_stub_752, NULL, _gloffset_GetQueryObjectui64vEXT),
- NAME_FUNC_OFFSET(13249, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
- NAME_FUNC_OFFSET(13267, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
- NAME_FUNC_OFFSET(13284, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
- NAME_FUNC_OFFSET(13300, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
- NAME_FUNC_OFFSET(13325, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
- NAME_FUNC_OFFSET(13345, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
- NAME_FUNC_OFFSET(13365, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
- NAME_FUNC_OFFSET(13388, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
- NAME_FUNC_OFFSET(13411, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
- NAME_FUNC_OFFSET(13431, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
- NAME_FUNC_OFFSET(13448, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
- NAME_FUNC_OFFSET(13465, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
- NAME_FUNC_OFFSET(13480, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
- NAME_FUNC_OFFSET(13504, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
- NAME_FUNC_OFFSET(13523, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
- NAME_FUNC_OFFSET(13542, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
- NAME_FUNC_OFFSET(13558, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
- NAME_FUNC_OFFSET(13577, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
- NAME_FUNC_OFFSET(13600, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
- NAME_FUNC_OFFSET(13616, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
- NAME_FUNC_OFFSET(13632, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
- NAME_FUNC_OFFSET(13659, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
- NAME_FUNC_OFFSET(13686, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
- NAME_FUNC_OFFSET(13706, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
- NAME_FUNC_OFFSET(13725, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
- NAME_FUNC_OFFSET(13744, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
- NAME_FUNC_OFFSET(13774, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
- NAME_FUNC_OFFSET(13804, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
- NAME_FUNC_OFFSET(13834, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
- NAME_FUNC_OFFSET(13864, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
- NAME_FUNC_OFFSET(13883, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
- NAME_FUNC_OFFSET(13906, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
- NAME_FUNC_OFFSET(13931, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
- NAME_FUNC_OFFSET(13956, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
- NAME_FUNC_OFFSET(13983, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
- NAME_FUNC_OFFSET(14011, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
- NAME_FUNC_OFFSET(14038, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
- NAME_FUNC_OFFSET(14066, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
- NAME_FUNC_OFFSET(14095, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
- NAME_FUNC_OFFSET(14124, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
- NAME_FUNC_OFFSET(14150, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
- NAME_FUNC_OFFSET(14181, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
- NAME_FUNC_OFFSET(14212, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
- NAME_FUNC_OFFSET(14236, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
- NAME_FUNC_OFFSET(14259, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
- NAME_FUNC_OFFSET(14277, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
- NAME_FUNC_OFFSET(14306, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
- NAME_FUNC_OFFSET(14335, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
- NAME_FUNC_OFFSET(14350, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
- NAME_FUNC_OFFSET(14376, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
- NAME_FUNC_OFFSET(14402, glHistogram, glHistogram, NULL, _gloffset_Histogram),
- NAME_FUNC_OFFSET(14417, glMinmax, glMinmax, NULL, _gloffset_Minmax),
- NAME_FUNC_OFFSET(14429, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
- NAME_FUNC_OFFSET(14449, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
- NAME_FUNC_OFFSET(14466, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
- NAME_FUNC_OFFSET(14482, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
- NAME_FUNC_OFFSET(14501, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
- NAME_FUNC_OFFSET(14524, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
- NAME_FUNC_OFFSET(14540, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
- NAME_FUNC_OFFSET(14562, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
- NAME_FUNC_OFFSET(14580, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
- NAME_FUNC_OFFSET(14599, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
- NAME_FUNC_OFFSET(14617, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
- NAME_FUNC_OFFSET(14636, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
- NAME_FUNC_OFFSET(14654, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
- NAME_FUNC_OFFSET(14673, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
- NAME_FUNC_OFFSET(14691, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
- NAME_FUNC_OFFSET(14710, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
- NAME_FUNC_OFFSET(14728, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
- NAME_FUNC_OFFSET(14747, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
- NAME_FUNC_OFFSET(14765, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
- NAME_FUNC_OFFSET(14784, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
- NAME_FUNC_OFFSET(14802, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
- NAME_FUNC_OFFSET(14821, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
- NAME_FUNC_OFFSET(14839, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
- NAME_FUNC_OFFSET(14858, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
- NAME_FUNC_OFFSET(14876, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
- NAME_FUNC_OFFSET(14895, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
- NAME_FUNC_OFFSET(14913, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
- NAME_FUNC_OFFSET(14932, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
- NAME_FUNC_OFFSET(14950, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
- NAME_FUNC_OFFSET(14969, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
- NAME_FUNC_OFFSET(14987, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
- NAME_FUNC_OFFSET(15006, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
- NAME_FUNC_OFFSET(15024, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
- NAME_FUNC_OFFSET(15043, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
- NAME_FUNC_OFFSET(15061, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
- NAME_FUNC_OFFSET(15080, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
- NAME_FUNC_OFFSET(15098, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
- NAME_FUNC_OFFSET(15117, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
- NAME_FUNC_OFFSET(15135, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
- NAME_FUNC_OFFSET(15154, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
- NAME_FUNC_OFFSET(15177, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
- NAME_FUNC_OFFSET(15200, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
- NAME_FUNC_OFFSET(15223, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
- NAME_FUNC_OFFSET(15246, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
- NAME_FUNC_OFFSET(15263, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
- NAME_FUNC_OFFSET(15286, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
- NAME_FUNC_OFFSET(15309, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
- NAME_FUNC_OFFSET(15332, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
- NAME_FUNC_OFFSET(15358, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
- NAME_FUNC_OFFSET(15384, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
- NAME_FUNC_OFFSET(15410, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
- NAME_FUNC_OFFSET(15434, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
- NAME_FUNC_OFFSET(15447, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
- NAME_FUNC_OFFSET(15460, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
- NAME_FUNC_OFFSET(15476, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
- NAME_FUNC_OFFSET(15492, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
- NAME_FUNC_OFFSET(15505, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
- NAME_FUNC_OFFSET(15528, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
- NAME_FUNC_OFFSET(15548, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
- NAME_FUNC_OFFSET(15567, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
- NAME_FUNC_OFFSET(15578, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
- NAME_FUNC_OFFSET(15590, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
- NAME_FUNC_OFFSET(15604, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
- NAME_FUNC_OFFSET(15617, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
- NAME_FUNC_OFFSET(15633, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
- NAME_FUNC_OFFSET(15644, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
- NAME_FUNC_OFFSET(15657, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
- NAME_FUNC_OFFSET(15676, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
- NAME_FUNC_OFFSET(15696, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
- NAME_FUNC_OFFSET(15709, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
- NAME_FUNC_OFFSET(15719, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(15733, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(15750, gl_dispatch_stub_549, gl_dispatch_stub_549, NULL, _gloffset_SampleMaskSGIS),
- NAME_FUNC_OFFSET(15766, gl_dispatch_stub_550, gl_dispatch_stub_550, NULL, _gloffset_SamplePatternSGIS),
- NAME_FUNC_OFFSET(15785, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(15803, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(15824, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(15846, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(15865, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(15887, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(15910, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
- NAME_FUNC_OFFSET(15929, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
- NAME_FUNC_OFFSET(15949, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
- NAME_FUNC_OFFSET(15968, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
- NAME_FUNC_OFFSET(15988, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
- NAME_FUNC_OFFSET(16007, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
- NAME_FUNC_OFFSET(16027, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
- NAME_FUNC_OFFSET(16046, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
- NAME_FUNC_OFFSET(16066, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
- NAME_FUNC_OFFSET(16085, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
- NAME_FUNC_OFFSET(16105, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
- NAME_FUNC_OFFSET(16125, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
- NAME_FUNC_OFFSET(16146, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
- NAME_FUNC_OFFSET(16166, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
- NAME_FUNC_OFFSET(16187, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
- NAME_FUNC_OFFSET(16207, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
- NAME_FUNC_OFFSET(16228, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
- NAME_FUNC_OFFSET(16252, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
- NAME_FUNC_OFFSET(16270, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
- NAME_FUNC_OFFSET(16290, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
- NAME_FUNC_OFFSET(16308, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
- NAME_FUNC_OFFSET(16320, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
- NAME_FUNC_OFFSET(16333, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
- NAME_FUNC_OFFSET(16345, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
- NAME_FUNC_OFFSET(16358, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(16378, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(16402, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(16416, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(16433, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(16448, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(16466, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(16480, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(16497, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(16512, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(16530, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(16544, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(16561, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(16576, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(16594, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(16608, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(16625, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(16640, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(16658, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(16672, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(16689, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(16704, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(16722, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(16736, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(16753, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(16768, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(16786, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(16800, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(16817, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(16832, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(16850, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(16864, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(16881, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(16896, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(16914, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
- NAME_FUNC_OFFSET(16931, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
- NAME_FUNC_OFFSET(16951, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
- NAME_FUNC_OFFSET(16968, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(16997, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
- NAME_FUNC_OFFSET(17012, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
- NAME_FUNC_OFFSET(17030, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
- NAME_FUNC_OFFSET(17049, gl_dispatch_stub_730, gl_dispatch_stub_730, NULL, _gloffset_BlendEquationSeparateEXT),
- NAME_FUNC_OFFSET(17073, gl_dispatch_stub_730, gl_dispatch_stub_730, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, _gloffset_AttachShader),
+ NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, _gloffset_CreateProgram),
+ NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, _gloffset_CreateShader),
+ NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, _gloffset_DeleteProgram),
+ NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, _gloffset_DeleteShader),
+ NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, _gloffset_DetachShader),
+ NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, _gloffset_GetAttachedShaders),
+ NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, _gloffset_GetProgramInfoLog),
+ NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, _gloffset_GetProgramiv),
+ NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, _gloffset_GetShaderInfoLog),
+ NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, _gloffset_GetShaderiv),
+ NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, _gloffset_IsProgram),
+ NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, _gloffset_IsShader),
+ NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, _gloffset_StencilFuncSeparate),
+ NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, _gloffset_StencilMaskSeparate),
+ NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate),
+ NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, _gloffset_UniformMatrix2x3fv),
+ NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, _gloffset_UniformMatrix2x4fv),
+ NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, _gloffset_UniformMatrix3x2fv),
+ NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, _gloffset_UniformMatrix3x4fv),
+ NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, _gloffset_UniformMatrix4x2fv),
+ NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, _gloffset_UniformMatrix4x3fv),
+ NAME_FUNC_OFFSET( 6163, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+ NAME_FUNC_OFFSET( 6189, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+ NAME_FUNC_OFFSET( 6215, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+ NAME_FUNC_OFFSET( 6241, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+ NAME_FUNC_OFFSET( 6267, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+ NAME_FUNC_OFFSET( 6287, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+ NAME_FUNC_OFFSET( 6313, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+ NAME_FUNC_OFFSET( 6339, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+ NAME_FUNC_OFFSET( 6365, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+ NAME_FUNC_OFFSET( 6394, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+ NAME_FUNC_OFFSET( 6423, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+ NAME_FUNC_OFFSET( 6452, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+ NAME_FUNC_OFFSET( 6479, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET( 6509, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET( 6538, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, _gloffset_GetProgramEnvParameterdvARB),
+ NAME_FUNC_OFFSET( 6568, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, _gloffset_GetProgramEnvParameterfvARB),
+ NAME_FUNC_OFFSET( 6598, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, _gloffset_GetProgramLocalParameterdvARB),
+ NAME_FUNC_OFFSET( 6630, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, _gloffset_GetProgramLocalParameterfvARB),
+ NAME_FUNC_OFFSET( 6662, glGetProgramStringARB, glGetProgramStringARB, NULL, _gloffset_GetProgramStringARB),
+ NAME_FUNC_OFFSET( 6684, glGetProgramivARB, glGetProgramivARB, NULL, _gloffset_GetProgramivARB),
+ NAME_FUNC_OFFSET( 6702, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+ NAME_FUNC_OFFSET( 6725, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+ NAME_FUNC_OFFSET( 6748, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+ NAME_FUNC_OFFSET( 6771, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB),
+ NAME_FUNC_OFFSET( 6798, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB),
+ NAME_FUNC_OFFSET( 6826, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB),
+ NAME_FUNC_OFFSET( 6853, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB),
+ NAME_FUNC_OFFSET( 6881, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, _gloffset_ProgramLocalParameter4dARB),
+ NAME_FUNC_OFFSET( 6910, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, _gloffset_ProgramLocalParameter4dvARB),
+ NAME_FUNC_OFFSET( 6940, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, _gloffset_ProgramLocalParameter4fARB),
+ NAME_FUNC_OFFSET( 6969, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, _gloffset_ProgramLocalParameter4fvARB),
+ NAME_FUNC_OFFSET( 6999, glProgramStringARB, glProgramStringARB, NULL, _gloffset_ProgramStringARB),
+ NAME_FUNC_OFFSET( 7018, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
+ NAME_FUNC_OFFSET( 7038, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
+ NAME_FUNC_OFFSET( 7059, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
+ NAME_FUNC_OFFSET( 7079, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
+ NAME_FUNC_OFFSET( 7100, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
+ NAME_FUNC_OFFSET( 7120, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
+ NAME_FUNC_OFFSET( 7141, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
+ NAME_FUNC_OFFSET( 7161, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
+ NAME_FUNC_OFFSET( 7182, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
+ NAME_FUNC_OFFSET( 7202, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
+ NAME_FUNC_OFFSET( 7223, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
+ NAME_FUNC_OFFSET( 7243, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
+ NAME_FUNC_OFFSET( 7264, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
+ NAME_FUNC_OFFSET( 7284, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
+ NAME_FUNC_OFFSET( 7305, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
+ NAME_FUNC_OFFSET( 7325, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
+ NAME_FUNC_OFFSET( 7346, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
+ NAME_FUNC_OFFSET( 7366, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
+ NAME_FUNC_OFFSET( 7387, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
+ NAME_FUNC_OFFSET( 7409, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
+ NAME_FUNC_OFFSET( 7431, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
+ NAME_FUNC_OFFSET( 7453, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
+ NAME_FUNC_OFFSET( 7475, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
+ NAME_FUNC_OFFSET( 7498, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
+ NAME_FUNC_OFFSET( 7521, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
+ NAME_FUNC_OFFSET( 7544, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
+ NAME_FUNC_OFFSET( 7565, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET( 7585, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET( 7606, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET( 7626, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET( 7647, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
+ NAME_FUNC_OFFSET( 7668, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET( 7688, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET( 7709, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
+ NAME_FUNC_OFFSET( 7731, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
+ NAME_FUNC_OFFSET( 7753, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
+ NAME_FUNC_OFFSET( 7775, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET( 7800, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET( 7816, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET( 7832, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET( 7851, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET( 7870, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET( 7886, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET( 7912, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET( 7935, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET( 7957, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET( 7971, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET( 7986, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET( 8003, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET( 8019, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET( 8038, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET( 8052, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET( 8068, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET( 8090, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET( 8113, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET( 8129, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET( 8142, glAttachObjectARB, glAttachObjectARB, NULL, _gloffset_AttachObjectARB),
+ NAME_FUNC_OFFSET( 8160, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET( 8179, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, _gloffset_CreateProgramObjectARB),
+ NAME_FUNC_OFFSET( 8204, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, _gloffset_CreateShaderObjectARB),
+ NAME_FUNC_OFFSET( 8228, glDeleteObjectARB, glDeleteObjectARB, NULL, _gloffset_DeleteObjectARB),
+ NAME_FUNC_OFFSET( 8246, glDetachObjectARB, glDetachObjectARB, NULL, _gloffset_DetachObjectARB),
+ NAME_FUNC_OFFSET( 8264, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET( 8286, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, _gloffset_GetAttachedObjectsARB),
+ NAME_FUNC_OFFSET( 8310, glGetHandleARB, glGetHandleARB, NULL, _gloffset_GetHandleARB),
+ NAME_FUNC_OFFSET( 8325, glGetInfoLogARB, glGetInfoLogARB, NULL, _gloffset_GetInfoLogARB),
+ NAME_FUNC_OFFSET( 8341, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, _gloffset_GetObjectParameterfvARB),
+ NAME_FUNC_OFFSET( 8367, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, _gloffset_GetObjectParameterivARB),
+ NAME_FUNC_OFFSET( 8393, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET( 8414, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET( 8438, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET( 8456, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET( 8474, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET( 8491, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET( 8509, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET( 8524, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET( 8540, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET( 8555, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET( 8571, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET( 8586, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET( 8602, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET( 8617, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET( 8633, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET( 8648, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET( 8664, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET( 8679, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET( 8695, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET( 8710, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET( 8726, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET( 8741, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET( 8757, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET( 8779, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET( 8801, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET( 8823, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET( 8845, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET( 8866, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET( 8890, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET( 8911, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET( 8934, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET( 8951, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT),
+ NAME_FUNC_OFFSET( 8970, gl_dispatch_stub_562, gl_dispatch_stub_562, NULL, _gloffset_GetPixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9002, gl_dispatch_stub_563, gl_dispatch_stub_563, NULL, _gloffset_GetPixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9034, gl_dispatch_stub_564, gl_dispatch_stub_564, NULL, _gloffset_PixelTexGenParameterfSGIS),
+ NAME_FUNC_OFFSET( 9062, gl_dispatch_stub_565, gl_dispatch_stub_565, NULL, _gloffset_PixelTexGenParameterfvSGIS),
+ NAME_FUNC_OFFSET( 9091, gl_dispatch_stub_566, gl_dispatch_stub_566, NULL, _gloffset_PixelTexGenParameteriSGIS),
+ NAME_FUNC_OFFSET( 9119, gl_dispatch_stub_567, gl_dispatch_stub_567, NULL, _gloffset_PixelTexGenParameterivSGIS),
+ NAME_FUNC_OFFSET( 9148, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET( 9165, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET( 9185, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT),
+ NAME_FUNC_OFFSET( 9203, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT),
+ NAME_FUNC_OFFSET( 9224, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT),
+ NAME_FUNC_OFFSET( 9242, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT),
+ NAME_FUNC_OFFSET( 9261, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9282, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT),
+ NAME_FUNC_OFFSET( 9301, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET( 9322, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET( 9344, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT),
+ NAME_FUNC_OFFSET( 9360, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT),
+ NAME_FUNC_OFFSET( 9378, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_CullParameterdvEXT),
+ NAME_FUNC_OFFSET( 9399, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_CullParameterfvEXT),
+ NAME_FUNC_OFFSET( 9420, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET( 9442, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET( 9465, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET( 9487, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET( 9510, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET( 9532, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET( 9555, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET( 9577, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET( 9600, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET( 9622, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET( 9645, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET( 9668, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET( 9692, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET( 9715, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET( 9739, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET( 9762, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET( 9786, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET( 9813, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET( 9834, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET( 9857, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET( 9878, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET( 9893, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET( 9909, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET( 9924, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET( 9940, gl_dispatch_stub_606, gl_dispatch_stub_606, NULL, _gloffset_PixelTexGenSGIX),
+ NAME_FUNC_OFFSET( 9958, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET( 9981, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10007, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV),
+ NAME_FUNC_OFFSET(10028, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV),
+ NAME_FUNC_OFFSET(10046, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV),
+ NAME_FUNC_OFFSET(10065, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV),
+ NAME_FUNC_OFFSET(10088, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV),
+ NAME_FUNC_OFFSET(10112, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV),
+ NAME_FUNC_OFFSET(10135, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV),
+ NAME_FUNC_OFFSET(10159, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV),
+ NAME_FUNC_OFFSET(10182, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10214, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10246, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV),
+ NAME_FUNC_OFFSET(10279, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV),
+ NAME_FUNC_OFFSET(10312, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV),
+ NAME_FUNC_OFFSET(10349, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV),
+ NAME_FUNC_OFFSET(10386, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA),
+ NAME_FUNC_OFFSET(10406, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(10424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(10443, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(10461, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(10480, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(10498, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(10517, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(10535, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(10554, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(10572, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(10591, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(10609, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(10628, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(10646, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(10665, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(10683, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(10702, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA),
+ NAME_FUNC_OFFSET(10720, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA),
+ NAME_FUNC_OFFSET(10739, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA),
+ NAME_FUNC_OFFSET(10757, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA),
+ NAME_FUNC_OFFSET(10776, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA),
+ NAME_FUNC_OFFSET(10794, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA),
+ NAME_FUNC_OFFSET(10813, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA),
+ NAME_FUNC_OFFSET(10831, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA),
+ NAME_FUNC_OFFSET(10850, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, _gloffset_MultiModeDrawArraysIBM),
+ NAME_FUNC_OFFSET(10875, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, _gloffset_MultiModeDrawElementsIBM),
+ NAME_FUNC_OFFSET(10902, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, _gloffset_DeleteFencesNV),
+ NAME_FUNC_OFFSET(10919, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, _gloffset_FinishFenceNV),
+ NAME_FUNC_OFFSET(10935, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, _gloffset_GenFencesNV),
+ NAME_FUNC_OFFSET(10949, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, _gloffset_GetFenceivNV),
+ NAME_FUNC_OFFSET(10964, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, _gloffset_IsFenceNV),
+ NAME_FUNC_OFFSET(10976, gl_dispatch_stub_655, gl_dispatch_stub_655, NULL, _gloffset_SetFenceNV),
+ NAME_FUNC_OFFSET(10989, gl_dispatch_stub_656, gl_dispatch_stub_656, NULL, _gloffset_TestFenceNV),
+ NAME_FUNC_OFFSET(11003, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV),
+ NAME_FUNC_OFFSET(11027, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(11043, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(11062, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV),
+ NAME_FUNC_OFFSET(11081, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(11097, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV),
+ NAME_FUNC_OFFSET(11123, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV),
+ NAME_FUNC_OFFSET(11149, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV),
+ NAME_FUNC_OFFSET(11170, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV),
+ NAME_FUNC_OFFSET(11187, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV),
+ NAME_FUNC_OFFSET(11208, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(11236, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV),
+ NAME_FUNC_OFFSET(11258, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV),
+ NAME_FUNC_OFFSET(11280, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV),
+ NAME_FUNC_OFFSET(11302, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(11316, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV),
+ NAME_FUNC_OFFSET(11332, glProgramParameter4dNV, glProgramParameter4dNV, NULL, _gloffset_ProgramParameter4dNV),
+ NAME_FUNC_OFFSET(11355, glProgramParameter4dvNV, glProgramParameter4dvNV, NULL, _gloffset_ProgramParameter4dvNV),
+ NAME_FUNC_OFFSET(11379, glProgramParameter4fNV, glProgramParameter4fNV, NULL, _gloffset_ProgramParameter4fNV),
+ NAME_FUNC_OFFSET(11402, glProgramParameter4fvNV, glProgramParameter4fvNV, NULL, _gloffset_ProgramParameter4fvNV),
+ NAME_FUNC_OFFSET(11426, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV),
+ NAME_FUNC_OFFSET(11451, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV),
+ NAME_FUNC_OFFSET(11476, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV),
+ NAME_FUNC_OFFSET(11504, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV),
+ NAME_FUNC_OFFSET(11520, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV),
+ NAME_FUNC_OFFSET(11539, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV),
+ NAME_FUNC_OFFSET(11559, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV),
+ NAME_FUNC_OFFSET(11578, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV),
+ NAME_FUNC_OFFSET(11598, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV),
+ NAME_FUNC_OFFSET(11617, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV),
+ NAME_FUNC_OFFSET(11637, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV),
+ NAME_FUNC_OFFSET(11656, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV),
+ NAME_FUNC_OFFSET(11676, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV),
+ NAME_FUNC_OFFSET(11695, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV),
+ NAME_FUNC_OFFSET(11715, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV),
+ NAME_FUNC_OFFSET(11734, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV),
+ NAME_FUNC_OFFSET(11754, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV),
+ NAME_FUNC_OFFSET(11773, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV),
+ NAME_FUNC_OFFSET(11793, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV),
+ NAME_FUNC_OFFSET(11812, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV),
+ NAME_FUNC_OFFSET(11832, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV),
+ NAME_FUNC_OFFSET(11851, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV),
+ NAME_FUNC_OFFSET(11871, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV),
+ NAME_FUNC_OFFSET(11890, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV),
+ NAME_FUNC_OFFSET(11910, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV),
+ NAME_FUNC_OFFSET(11929, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV),
+ NAME_FUNC_OFFSET(11949, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV),
+ NAME_FUNC_OFFSET(11968, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV),
+ NAME_FUNC_OFFSET(11988, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV),
+ NAME_FUNC_OFFSET(12008, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV),
+ NAME_FUNC_OFFSET(12029, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV),
+ NAME_FUNC_OFFSET(12053, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV),
+ NAME_FUNC_OFFSET(12074, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV),
+ NAME_FUNC_OFFSET(12095, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV),
+ NAME_FUNC_OFFSET(12116, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV),
+ NAME_FUNC_OFFSET(12137, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV),
+ NAME_FUNC_OFFSET(12158, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV),
+ NAME_FUNC_OFFSET(12179, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV),
+ NAME_FUNC_OFFSET(12200, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV),
+ NAME_FUNC_OFFSET(12221, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV),
+ NAME_FUNC_OFFSET(12242, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV),
+ NAME_FUNC_OFFSET(12263, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV),
+ NAME_FUNC_OFFSET(12284, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV),
+ NAME_FUNC_OFFSET(12305, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV),
+ NAME_FUNC_OFFSET(12327, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12349, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12371, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12393, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI),
+ NAME_FUNC_OFFSET(12418, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI),
+ NAME_FUNC_OFFSET(12442, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI),
+ NAME_FUNC_OFFSET(12464, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI),
+ NAME_FUNC_OFFSET(12486, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI),
+ NAME_FUNC_OFFSET(12508, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI),
+ NAME_FUNC_OFFSET(12534, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI),
+ NAME_FUNC_OFFSET(12557, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI),
+ NAME_FUNC_OFFSET(12581, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI),
+ NAME_FUNC_OFFSET(12599, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI),
+ NAME_FUNC_OFFSET(12614, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI),
+ NAME_FUNC_OFFSET(12645, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(12665, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(12686, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, _gloffset_ActiveStencilFaceEXT),
+ NAME_FUNC_OFFSET(12709, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, _gloffset_BindVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12732, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, _gloffset_DeleteVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12758, gl_dispatch_stub_740, gl_dispatch_stub_740, NULL, _gloffset_GenVertexArraysAPPLE),
+ NAME_FUNC_OFFSET(12781, gl_dispatch_stub_741, gl_dispatch_stub_741, NULL, _gloffset_IsVertexArrayAPPLE),
+ NAME_FUNC_OFFSET(12802, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV),
+ NAME_FUNC_OFFSET(12833, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV),
+ NAME_FUNC_OFFSET(12864, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV),
+ NAME_FUNC_OFFSET(12892, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV),
+ NAME_FUNC_OFFSET(12921, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV),
+ NAME_FUNC_OFFSET(12949, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV),
+ NAME_FUNC_OFFSET(12978, gl_dispatch_stub_748, gl_dispatch_stub_748, NULL, _gloffset_DepthBoundsEXT),
+ NAME_FUNC_OFFSET(12995, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(13022, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT),
+ NAME_FUNC_OFFSET(13043, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT),
+ NAME_FUNC_OFFSET(13065, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT),
+ NAME_FUNC_OFFSET(13093, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT),
+ NAME_FUNC_OFFSET(13117, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13142, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT),
+ NAME_FUNC_OFFSET(13171, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT),
+ NAME_FUNC_OFFSET(13197, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT),
+ NAME_FUNC_OFFSET(13223, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT),
+ NAME_FUNC_OFFSET(13249, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT),
+ NAME_FUNC_OFFSET(13270, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT),
+ NAME_FUNC_OFFSET(13292, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT),
+ NAME_FUNC_OFFSET(13312, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT),
+ NAME_FUNC_OFFSET(13353, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT),
+ NAME_FUNC_OFFSET(13385, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT),
+ NAME_FUNC_OFFSET(13404, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT),
+ NAME_FUNC_OFFSET(13424, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT),
+ NAME_FUNC_OFFSET(13449, gl_dispatch_stub_767, gl_dispatch_stub_767, NULL, _gloffset_BlitFramebufferEXT),
+ NAME_FUNC_OFFSET(13470, gl_dispatch_stub_768, gl_dispatch_stub_768, NULL, _gloffset_ProgramEnvParameters4fvEXT),
+ NAME_FUNC_OFFSET(13499, gl_dispatch_stub_769, gl_dispatch_stub_769, NULL, _gloffset_ProgramLocalParameters4fvEXT),
+ NAME_FUNC_OFFSET(13530, gl_dispatch_stub_770, gl_dispatch_stub_770, NULL, _gloffset_GetQueryObjecti64vEXT),
+ NAME_FUNC_OFFSET(13554, gl_dispatch_stub_771, gl_dispatch_stub_771, NULL, _gloffset_GetQueryObjectui64vEXT),
+ NAME_FUNC_OFFSET(13579, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement),
+ NAME_FUNC_OFFSET(13597, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture),
+ NAME_FUNC_OFFSET(13614, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays),
+ NAME_FUNC_OFFSET(13630, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident),
+ NAME_FUNC_OFFSET(13655, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D),
+ NAME_FUNC_OFFSET(13675, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D),
+ NAME_FUNC_OFFSET(13695, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D),
+ NAME_FUNC_OFFSET(13718, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D),
+ NAME_FUNC_OFFSET(13741, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures),
+ NAME_FUNC_OFFSET(13761, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures),
+ NAME_FUNC_OFFSET(13778, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv),
+ NAME_FUNC_OFFSET(13795, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture),
+ NAME_FUNC_OFFSET(13810, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures),
+ NAME_FUNC_OFFSET(13834, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D),
+ NAME_FUNC_OFFSET(13853, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D),
+ NAME_FUNC_OFFSET(13872, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor),
+ NAME_FUNC_OFFSET(13888, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation),
+ NAME_FUNC_OFFSET(13907, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements),
+ NAME_FUNC_OFFSET(13930, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13946, glColorTable, glColorTable, NULL, _gloffset_ColorTable),
+ NAME_FUNC_OFFSET(13962, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv),
+ NAME_FUNC_OFFSET(13989, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv),
+ NAME_FUNC_OFFSET(14016, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable),
+ NAME_FUNC_OFFSET(14036, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14055, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable),
+ NAME_FUNC_OFFSET(14074, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14104, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv),
+ NAME_FUNC_OFFSET(14134, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14164, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv),
+ NAME_FUNC_OFFSET(14194, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable),
+ NAME_FUNC_OFFSET(14213, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable),
+ NAME_FUNC_OFFSET(14236, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14261, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14286, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf),
+ NAME_FUNC_OFFSET(14313, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14341, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri),
+ NAME_FUNC_OFFSET(14368, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14396, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D),
+ NAME_FUNC_OFFSET(14425, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D),
+ NAME_FUNC_OFFSET(14454, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter),
+ NAME_FUNC_OFFSET(14480, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv),
+ NAME_FUNC_OFFSET(14511, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv),
+ NAME_FUNC_OFFSET(14542, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter),
+ NAME_FUNC_OFFSET(14566, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D),
+ NAME_FUNC_OFFSET(14589, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram),
+ NAME_FUNC_OFFSET(14607, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv),
+ NAME_FUNC_OFFSET(14636, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv),
+ NAME_FUNC_OFFSET(14665, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax),
+ NAME_FUNC_OFFSET(14680, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv),
+ NAME_FUNC_OFFSET(14706, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv),
+ NAME_FUNC_OFFSET(14732, glHistogram, glHistogram, NULL, _gloffset_Histogram),
+ NAME_FUNC_OFFSET(14747, glMinmax, glMinmax, NULL, _gloffset_Minmax),
+ NAME_FUNC_OFFSET(14759, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram),
+ NAME_FUNC_OFFSET(14779, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax),
+ NAME_FUNC_OFFSET(14796, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D),
+ NAME_FUNC_OFFSET(14812, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D),
+ NAME_FUNC_OFFSET(14831, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D),
+ NAME_FUNC_OFFSET(14854, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB),
+ NAME_FUNC_OFFSET(14870, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB),
+ NAME_FUNC_OFFSET(14892, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB),
+ NAME_FUNC_OFFSET(14910, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB),
+ NAME_FUNC_OFFSET(14929, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB),
+ NAME_FUNC_OFFSET(14947, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB),
+ NAME_FUNC_OFFSET(14966, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB),
+ NAME_FUNC_OFFSET(14984, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB),
+ NAME_FUNC_OFFSET(15003, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB),
+ NAME_FUNC_OFFSET(15021, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB),
+ NAME_FUNC_OFFSET(15040, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB),
+ NAME_FUNC_OFFSET(15058, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB),
+ NAME_FUNC_OFFSET(15077, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB),
+ NAME_FUNC_OFFSET(15095, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB),
+ NAME_FUNC_OFFSET(15114, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB),
+ NAME_FUNC_OFFSET(15132, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB),
+ NAME_FUNC_OFFSET(15151, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB),
+ NAME_FUNC_OFFSET(15169, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB),
+ NAME_FUNC_OFFSET(15188, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB),
+ NAME_FUNC_OFFSET(15206, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB),
+ NAME_FUNC_OFFSET(15225, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB),
+ NAME_FUNC_OFFSET(15243, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB),
+ NAME_FUNC_OFFSET(15262, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB),
+ NAME_FUNC_OFFSET(15280, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB),
+ NAME_FUNC_OFFSET(15299, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB),
+ NAME_FUNC_OFFSET(15317, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB),
+ NAME_FUNC_OFFSET(15336, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB),
+ NAME_FUNC_OFFSET(15354, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB),
+ NAME_FUNC_OFFSET(15373, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB),
+ NAME_FUNC_OFFSET(15391, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB),
+ NAME_FUNC_OFFSET(15410, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB),
+ NAME_FUNC_OFFSET(15428, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB),
+ NAME_FUNC_OFFSET(15447, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB),
+ NAME_FUNC_OFFSET(15465, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB),
+ NAME_FUNC_OFFSET(15484, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15507, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15530, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB),
+ NAME_FUNC_OFFSET(15553, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB),
+ NAME_FUNC_OFFSET(15576, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB),
+ NAME_FUNC_OFFSET(15593, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB),
+ NAME_FUNC_OFFSET(15616, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB),
+ NAME_FUNC_OFFSET(15639, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB),
+ NAME_FUNC_OFFSET(15662, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB),
+ NAME_FUNC_OFFSET(15688, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB),
+ NAME_FUNC_OFFSET(15714, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB),
+ NAME_FUNC_OFFSET(15740, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB),
+ NAME_FUNC_OFFSET(15764, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15791, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB),
+ NAME_FUNC_OFFSET(15817, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB),
+ NAME_FUNC_OFFSET(15837, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB),
+ NAME_FUNC_OFFSET(15857, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB),
+ NAME_FUNC_OFFSET(15877, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB),
+ NAME_FUNC_OFFSET(15894, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB),
+ NAME_FUNC_OFFSET(15912, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB),
+ NAME_FUNC_OFFSET(15929, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB),
+ NAME_FUNC_OFFSET(15947, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB),
+ NAME_FUNC_OFFSET(15964, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB),
+ NAME_FUNC_OFFSET(15982, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB),
+ NAME_FUNC_OFFSET(15999, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB),
+ NAME_FUNC_OFFSET(16017, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB),
+ NAME_FUNC_OFFSET(16034, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB),
+ NAME_FUNC_OFFSET(16052, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB),
+ NAME_FUNC_OFFSET(16069, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB),
+ NAME_FUNC_OFFSET(16087, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB),
+ NAME_FUNC_OFFSET(16104, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB),
+ NAME_FUNC_OFFSET(16122, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB),
+ NAME_FUNC_OFFSET(16139, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB),
+ NAME_FUNC_OFFSET(16157, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB),
+ NAME_FUNC_OFFSET(16174, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB),
+ NAME_FUNC_OFFSET(16192, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB),
+ NAME_FUNC_OFFSET(16211, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB),
+ NAME_FUNC_OFFSET(16230, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB),
+ NAME_FUNC_OFFSET(16249, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB),
+ NAME_FUNC_OFFSET(16268, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
+ NAME_FUNC_OFFSET(16288, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
+ NAME_FUNC_OFFSET(16308, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
+ NAME_FUNC_OFFSET(16328, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET(16345, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET(16363, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET(16380, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET(16398, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET(16415, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET(16433, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET(16455, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET(16468, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET(16481, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET(16497, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET(16513, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET(16526, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET(16549, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET(16569, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET(16588, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET(16599, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET(16611, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET(16625, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET(16638, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET(16654, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET(16665, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET(16678, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET(16697, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET(16717, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET(16730, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET(16740, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET(16756, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET(16775, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET(16793, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET(16814, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET(16829, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET(16844, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET(16858, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET(16873, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET(16885, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET(16898, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET(16910, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET(16923, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET(16935, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET(16948, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET(16960, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET(16973, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET(16985, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET(16998, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET(17010, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET(17023, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET(17035, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET(17048, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET(17060, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET(17073, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET(17092, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET(17111, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET(17130, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET(17143, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET(17161, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET(17182, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET(17200, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET(17220, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17234, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17251, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET(17267, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET(17286, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17304, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17325, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17347, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17366, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17388, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17411, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET(17430, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET(17450, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET(17469, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET(17489, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET(17508, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET(17528, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET(17547, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET(17567, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET(17586, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET(17606, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET(17626, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET(17647, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET(17667, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET(17688, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET(17708, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET(17729, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET(17753, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET(17771, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET(17791, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET(17809, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET(17821, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET(17834, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET(17846, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET(17859, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(17879, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(17903, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(17917, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(17934, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(17949, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(17967, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(17981, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(17998, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18013, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18031, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18045, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18062, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18077, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18095, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18109, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18126, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18141, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18159, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18173, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18190, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18205, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18223, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18237, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18254, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18269, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18287, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18301, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18318, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18333, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18351, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18365, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18382, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18397, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18415, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(18432, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(18452, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(18469, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18498, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(18513, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(18531, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(18550, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(18574, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
};
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 0958cd1b32c..a61086d0dc6 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -64,6 +64,12 @@
#define GLTHREAD_H
+#if defined(USE_MGL_NAMESPACE)
+#define _glapi_Dispatch _mglapi_Dispatch
+#endif
+
+
+
#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
&& !defined(THREADS)
diff --git a/src/mesa/glapi/sources b/src/mesa/glapi/sources
index 384b0830ac2..1d5c2528211 100644
--- a/src/mesa/glapi/sources
+++ b/src/mesa/glapi/sources
@@ -1,3 +1,12 @@
MESA_GLAPI_SOURCES = \
glapi.c \
glthread.c
+
+MESA_GLAPI_HEADERS = \
+dispatch.h \
+glapi.h \
+glapioffsets.h \
+glapitable.h \
+glapitemp.h \
+glprocs.h \
+glthread.h
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index dda659bbc3f..1899975213f 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -53,6 +53,11 @@ typedef struct {
AEarray arrays[32];
AEattrib attribs[VERT_ATTRIB_MAX + 1];
GLuint NewState;
+
+ struct gl_buffer_object *vbo[VERT_ATTRIB_MAX];
+ GLuint nr_vbos;
+ GLboolean mapped_vbos;
+
} AEcontext;
#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
@@ -1046,7 +1051,7 @@ GLboolean _ae_create_context( GLcontext *ctx )
FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
- ctx->aelt_context = MALLOC( sizeof(AEcontext) );
+ ctx->aelt_context = CALLOC( sizeof(AEcontext) );
if (!ctx->aelt_context)
return GL_FALSE;
@@ -1063,6 +1068,19 @@ void _ae_destroy_context( GLcontext *ctx )
}
}
+static void check_vbo( AEcontext *actx,
+ struct gl_buffer_object *vbo )
+{
+ if (vbo->Name && !vbo->Pointer) {
+ GLuint i;
+ for (i = 0; i < actx->nr_vbos; i++)
+ if (actx->vbo[i] == vbo)
+ return;
+ assert(actx->nr_vbos < VERT_ATTRIB_MAX);
+ actx->vbo[actx->nr_vbos++] = vbo;
+ }
+}
+
/**
* Make a list of per-vertex functions to call for each glArrayElement call.
@@ -1077,35 +1095,43 @@ static void _ae_update_state( GLcontext *ctx )
AEattrib *at = actx->attribs;
GLuint i;
+ actx->nr_vbos = 0;
+
/* conventional vertex arrays */
if (ctx->Array.ArrayObj->Index.Enabled) {
aa->array = &ctx->Array.ArrayObj->Index;
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->EdgeFlag.Enabled) {
aa->array = &ctx->Array.ArrayObj->EdgeFlag;
aa->offset = _gloffset_EdgeFlagv;
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->Normal.Enabled) {
aa->array = &ctx->Array.ArrayObj->Normal;
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->Color.Enabled) {
aa->array = &ctx->Array.ArrayObj->Color;
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->SecondaryColor.Enabled) {
aa->array = &ctx->Array.ArrayObj->SecondaryColor;
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
if (ctx->Array.ArrayObj->FogCoord.Enabled) {
aa->array = &ctx->Array.ArrayObj->FogCoord;
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
@@ -1120,11 +1146,12 @@ static void _ae_update_state( GLcontext *ctx )
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
at->index = VERT_ATTRIB_TEX0 + i;
+ check_vbo(actx, at->array->BufferObj);
at++;
}
}
- /* generic vertex attribute arrays */
+ /* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */
struct gl_client_array *attribArray = &ctx->Array.ArrayObj->VertexAttrib[i];
if (attribArray->Enabled) {
@@ -1146,6 +1173,7 @@ static void _ae_update_state( GLcontext *ctx )
[TYPE_IDX(at->array->Type)];
}
at->index = i;
+ check_vbo(actx, at->array->BufferObj);
at++;
}
}
@@ -1158,14 +1186,18 @@ static void _ae_update_state( GLcontext *ctx )
aa->array = &ctx->Array.ArrayObj->VertexAttrib[0];
assert(aa->array->Size >= 2); /* XXX fix someday? */
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
else if (ctx->Array.ArrayObj->Vertex.Enabled) {
aa->array = &ctx->Array.ArrayObj->Vertex;
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
aa++;
}
+ check_vbo(actx, ctx->Array.ElementArrayBufferObj);
+
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
ASSERT(aa - actx->arrays < 32);
at->func = NULL; /* terminate the list */
@@ -1174,6 +1206,45 @@ static void _ae_update_state( GLcontext *ctx )
actx->NewState = 0;
}
+void _ae_map_vbos( GLcontext *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (actx->mapped_vbos)
+ return;
+
+ if (actx->NewState)
+ _ae_update_state(ctx);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.MapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ GL_DYNAMIC_DRAW_ARB,
+ actx->vbo[i]);
+
+ if (actx->nr_vbos)
+ actx->mapped_vbos = GL_TRUE;
+}
+
+void _ae_unmap_vbos( GLcontext *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (!actx->mapped_vbos)
+ return;
+
+ assert (!actx->NewState);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.UnmapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ actx->vbo[i]);
+
+ actx->mapped_vbos = GL_FALSE;
+}
+
/**
* Called via glArrayElement() and glDrawArrays().
@@ -1188,15 +1259,24 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
const AEarray *aa;
const AEattrib *at;
const struct _glapi_table * const disp = GET_DISPATCH();
+ GLboolean do_map;
-
- if (actx->NewState)
+ if (actx->NewState) {
+ assert(!actx->mapped_vbos);
_ae_update_state( ctx );
+ }
+
+ do_map = actx->nr_vbos && !actx->mapped_vbos;
+ /*
+ */
+ if (do_map)
+ _ae_map_vbos(ctx);
+
/* generic attributes */
for (at = actx->attribs; at->func; at++) {
const GLubyte *src
- = ADD_POINTERS(at->array->BufferObj->Data, at->array->Ptr)
+ = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr)
+ elt * at->array->StrideB;
at->func( at->index, src );
}
@@ -1204,15 +1284,34 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt )
/* conventional arrays */
for (aa = actx->arrays; aa->offset != -1 ; aa++) {
const GLubyte *src
- = ADD_POINTERS(aa->array->BufferObj->Data, aa->array->Ptr)
+ = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr)
+ elt * aa->array->StrideB;
CALL_by_offset( disp, (array_func), aa->offset,
((const void *) src) );
}
+
+ if (do_map)
+ _ae_unmap_vbos(ctx);
}
void _ae_invalidate_state( GLcontext *ctx, GLuint new_state )
{
- AE_CONTEXT(ctx)->NewState |= new_state;
+ AEcontext *actx = AE_CONTEXT(ctx);
+
+
+ /* Only interested in this subset of mesa state. Need to prune
+ * this down as both tnl/ and the drivers can raise statechanges
+ * for arcane reasons in the middle of seemingly atomic operations
+ * like DrawElements, over which we'd like to keep a known set of
+ * arrays and vbo's mapped.
+ *
+ * Luckily, neither the drivers nor tnl muck with the state that
+ * concerns us here:
+ */
+ new_state &= _NEW_ARRAY | _NEW_PROGRAM;
+ if (new_state) {
+ assert(!actx->mapped_vbos);
+ actx->NewState |= new_state;
+ }
}
diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h
index 1c0af9f3ea8..e621724fb29 100644
--- a/src/mesa/main/api_arrayelt.h
+++ b/src/mesa/main/api_arrayelt.h
@@ -34,4 +34,9 @@ extern void _ae_destroy_context( GLcontext *ctx );
extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state );
extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt );
+/* May optionally be called before a batch of element calls:
+ */
+extern void _ae_map_vbos( GLcontext *ctx );
+extern void _ae_unmap_vbos( GLcontext *ctx );
+
#endif
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c
index 51d5af6f5f0..717ef1fc8f0 100644
--- a/src/mesa/main/api_loopback.c
+++ b/src/mesa/main/api_loopback.c
@@ -510,7 +510,7 @@ loopback_TexCoord2sv( const GLshort *v )
static void GLAPIENTRY
loopback_TexCoord3dv( const GLdouble *v )
{
- TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
+ TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
}
static void GLAPIENTRY
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index e22edc1bbcf..2b1a35f3de3 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1009,9 +1009,6 @@ _mesa_PopAttrib(void)
(GLfloat) light->Model.TwoSide);
_mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
(GLfloat) light->Model.ColorControl);
- /* materials */
- MEMCPY(&ctx->Light.Material, &light->Material,
- sizeof(struct gl_material));
/* shade model */
_mesa_ShadeModel(light->ShadeModel);
/* color material */
@@ -1019,6 +1016,9 @@ _mesa_PopAttrib(void)
light->ColorMaterialMode);
_mesa_set_enable(ctx, GL_COLOR_MATERIAL,
light->ColorMaterialEnabled);
+ /* materials */
+ MEMCPY(&ctx->Light.Material, &light->Material,
+ sizeof(struct gl_material));
}
break;
case GL_LINE_BIT:
@@ -1285,6 +1285,12 @@ _mesa_PushClientAttrib(GLbitfield mask)
attr = MALLOC_STRUCT( gl_array_attrib );
obj = MALLOC_STRUCT( gl_array_object );
+#if FEATURE_ARB_vertex_buffer_object
+ /* increment ref counts since we're copying pointers to these objects */
+ ctx->Array.ArrayBufferObj->RefCount++;
+ ctx->Array.ElementArrayBufferObj->RefCount++;
+#endif
+
MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) );
@@ -1359,6 +1365,13 @@ _mesa_PopClientAttrib(void)
_mesa_BindVertexArrayAPPLE( data->ArrayObj->Name );
+#if FEATURE_ARB_vertex_buffer_object
+ _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB,
+ data->ArrayBufferObj->Name);
+ _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
+ data->ElementArrayBufferObj->Name);
+#endif
+
MEMCPY( ctx->Array.ArrayObj, data->ArrayObj,
sizeof( struct gl_array_object ) );
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index ece53463b33..0e3ed155841 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -648,7 +648,8 @@ _mesa_ResizeBuffersMESA( void )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_resizebuffers( ctx );
+ if (ctx->Extensions.MESA_resize_buffers)
+ _mesa_resizebuffers( ctx );
}
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index e2ba65ac63b..13c6281f077 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -28,8 +28,8 @@
*/
-#ifndef CONFIG_H
-#define CONFIG_H
+#ifndef MESA_CONFIG_H_INCLUDED
+#define MESA_CONFIG_H_INCLUDED
/**
* \name OpenGL implementation limits
@@ -198,6 +198,7 @@
#define MAX_PROGRAM_LOCAL_PARAMS 128 /* KW: power of two */
#define MAX_PROGRAM_MATRICES 8
#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
+#define MAX_PROGRAM_CALL_DEPTH 8
/*@}*/
/** For GL_ARB_fragment_shader */
@@ -323,4 +324,4 @@
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
-#endif /* CONFIG_H */
+#endif /* MESA_CONFIG_H_INCLUDED */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 94d0ff63079..59e8740cdc6 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -876,6 +876,16 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData)
_mesa_delete_array_object(ctx, arrayObj);
}
+/**
+ * Callback for deleting an shader object. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_shaderobj_cb(GLuint id, void *data, void *userData)
+{
+ /* XXX probably need to fix this */
+ _mesa_free(data);
+}
+
/**
* Deallocate a shared state object and all children structures.
@@ -938,6 +948,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
_mesa_DeleteHashTable(ss->ArrayObjects);
#if FEATURE_ARB_shader_objects
+ _mesa_HashDeleteAll(ss->GL2Objects, delete_shaderobj_cb, ctx);
_mesa_DeleteHashTable(ss->GL2Objects);
#endif
@@ -1074,7 +1085,7 @@ _mesa_init_constants( GLcontext *ctx )
/* If we're running in the X server, do bounds checking to prevent
* segfaults and server crashes!
*/
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86Server)
ctx->Const.CheckArrayBounds = GL_TRUE;
#else
ctx->Const.CheckArrayBounds = GL_FALSE;
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index c72fe8a56ac..e7e0fda72ea 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -317,4 +317,12 @@ do { \
)
+/**
+ * Is RGBA LogicOp enabled?
+ */
+#define RGBA_LOGICOP_ENABLED(CTX) \
+ ((CTX)->Color.ColorLogicOpEnabled || \
+ ((CTX)->Color.BlendEnabled && (CTX)->Color.BlendEquationRGB == GL_LOGIC_OP))
+
+
#endif /* CONTEXT_H */
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b5187045d69..dca6ede6cb3 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -8052,7 +8052,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(table, _mesa_IsProgram);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
SET_LoadProgramNV(table, save_LoadProgramNV);
SET_ProgramParameter4dNV(table, save_ProgramParameter4dNV);
SET_ProgramParameter4dvNV(table, save_ProgramParameter4dvNV);
@@ -8145,7 +8145,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
SET_BindProgramNV(table, save_BindProgramNV);
SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
SET_GenProgramsNV(table, _mesa_GenPrograms);
- SET_IsProgramNV(table, _mesa_IsProgram);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index bf86e6db7d2..0d54c29949b 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -49,8 +49,11 @@
}
+/**
+ * Helper to enable/disable client-side state.
+ */
static void
-client_state( GLcontext *ctx, GLenum cap, GLboolean state )
+client_state(GLcontext *ctx, GLenum cap, GLboolean state)
{
GLuint flag;
GLboolean *var;
@@ -134,17 +137,14 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Array.ArrayObj->_Enabled &= ~flag;
if (ctx->Driver.Enable) {
- (*ctx->Driver.Enable)( ctx, cap, state );
+ ctx->Driver.Enable( ctx, cap, state );
}
}
/**
* Enable GL capability.
- *
- * \param cap capability.
- *
- * \sa glEnable().
+ * \param cap state to enable/disable.
*
* Get's the current context, assures that we're outside glBegin()/glEnd() and
* calls client_state().
@@ -160,10 +160,7 @@ _mesa_EnableClientState( GLenum cap )
/**
* Disable GL capability.
- *
- * \param cap capability.
- *
- * \sa glDisable().
+ * \param cap state to enable/disable.
*
* Get's the current context, assures that we're outside glBegin()/glEnd() and
* calls client_state().
@@ -195,10 +192,10 @@ _mesa_DisableClientState( GLenum cap )
/**
- * Perform glEnable() and glDisable() calls.
+ * Helper function to enable or disable state.
*
* \param ctx GL context.
- * \param cap capability.
+ * \param cap the state to enable/disable
* \param state whether to enable or disable the specified capability.
*
* Updates the current context and flushes the vertices as needed. For
@@ -206,7 +203,8 @@ _mesa_DisableClientState( GLenum cap )
* are effectivly present before updating. Notifies the driver via
* dd_function_table::Enable.
*/
-void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
+void
+_mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
{
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "%s %s (newstate is %x)\n",
@@ -285,7 +283,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.CullFlag = state;
break;
-
case GL_CULL_VERTEX_EXT:
CHECK_EXTENSION(EXT_cull_vertex, cap);
if (ctx->Transform.CullVertexFlag == state)
@@ -293,13 +290,12 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
ctx->Transform.CullVertexFlag = state;
break;
-
case GL_DEPTH_TEST:
if (state && ctx->DrawBuffer->Visual.depthBits == 0) {
_mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
return;
}
- if (ctx->Depth.Test==state)
+ if (ctx->Depth.Test == state)
return;
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Test = state;
@@ -308,13 +304,13 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
if (ctx->NoDither) {
state = GL_FALSE; /* MESA_NO_DITHER env var */
}
- if (ctx->Color.DitherFlag==state)
+ if (ctx->Color.DitherFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.DitherFlag = state;
break;
case GL_FOG:
- if (ctx->Fog.Enabled==state)
+ if (ctx->Fog.Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Enabled = state;
@@ -351,26 +347,18 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Enabled = state;
-
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
-
break;
case GL_LINE_SMOOTH:
if (ctx->Line.SmoothFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
break;
case GL_LINE_STIPPLE:
if (ctx->Line.StippleFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_LINE);
ctx->Line.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
break;
case GL_INDEX_LOGIC_OP:
if (ctx->Color.IndexLogicOpEnabled == state)
@@ -505,41 +493,38 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Transform.Normalize = state;
break;
case GL_POINT_SMOOTH:
- if (ctx->Point.SmoothFlag==state)
+ if (ctx->Point.SmoothFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
break;
case GL_POLYGON_SMOOTH:
- if (ctx->Polygon.SmoothFlag==state)
+ if (ctx->Polygon.SmoothFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
break;
case GL_POLYGON_STIPPLE:
- if (ctx->Polygon.StippleFlag==state)
+ if (ctx->Polygon.StippleFlag == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
break;
case GL_POLYGON_OFFSET_POINT:
- if (ctx->Polygon.OffsetPoint==state)
+ if (ctx->Polygon.OffsetPoint == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetPoint = state;
break;
case GL_POLYGON_OFFSET_LINE:
- if (ctx->Polygon.OffsetLine==state)
+ if (ctx->Polygon.OffsetLine == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetLine = state;
break;
case GL_POLYGON_OFFSET_FILL:
/*case GL_POLYGON_OFFSET_EXT:*/
- if (ctx->Polygon.OffsetFill==state)
+ if (ctx->Polygon.OffsetFill == state)
return;
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetFill = state;
@@ -551,7 +536,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Transform.RescaleNormals = state;
break;
case GL_SCISSOR_TEST:
- if (ctx->Scissor.Enabled==state)
+ if (ctx->Scissor.Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_SCISSOR);
ctx->Scissor.Enabled = state;
@@ -568,7 +553,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
"glEnable(GL_STENCIL_TEST) but no stencil buffer");
return;
}
- if (ctx->Stencil.Enabled==state)
+ if (ctx->Stencil.Enabled == state)
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.Enabled = state;
@@ -916,11 +901,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.TestTwoSide = state;
- if (state) {
- ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
- } else {
- ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL;
- }
break;
#if FEATURE_ARB_fragment_program
@@ -973,20 +953,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
}
if (ctx->Driver.Enable) {
- (*ctx->Driver.Enable)( ctx, cap, state );
+ ctx->Driver.Enable( ctx, cap, state );
}
}
/**
- * Enable GL capability.
- *
- * \param cap capability.
- *
- * \sa glEnable().
- *
- * Get's the current context, assures that we're outside glBegin()/glEnd() and
- * calls _mesa_set_enable().
+ * Enable GL capability. Called by glEnable()
+ * \param cap state to enable.
*/
void GLAPIENTRY
_mesa_Enable( GLenum cap )
@@ -999,14 +973,8 @@ _mesa_Enable( GLenum cap )
/**
- * Disable GL capability.
- *
- * \param cap capability.
- *
- * \sa glDisable().
- *
- * Get's the current context, assures that we're outside glBegin()/glEnd() and
- * calls _mesa_set_enable().
+ * Disable GL capability. Called by glDisable()
+ * \param cap state to disable.
*/
void GLAPIENTRY
_mesa_Disable( GLenum cap )
@@ -1032,10 +1000,11 @@ _mesa_Disable( GLenum cap )
return GL_FALSE; \
}
+
/**
- * Test whether a capability is enabled.
+ * Return simple enable/disable state.
*
- * \param cap capability.
+ * \param cap state variable to query.
*
* Returns the state of the specified capability from the current GL context.
* For the capabilities associated with extensions verifies that those
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index b569d6ad6f6..fc56809e978 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -34,7 +34,7 @@ typedef struct {
int n;
} enum_elt;
-static const char enum_string_table[] =
+LONGSTRING static const char enum_string_table[] =
"GL_2D\0"
"GL_2_BYTES\0"
"GL_3D\0"
@@ -50,9 +50,13 @@ static const char enum_string_table[] =
"GL_ACCUM_CLEAR_VALUE\0"
"GL_ACCUM_GREEN_BITS\0"
"GL_ACCUM_RED_BITS\0"
+ "GL_ACTIVE_ATTRIBUTES\0"
+ "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0"
"GL_ACTIVE_STENCIL_FACE_EXT\0"
"GL_ACTIVE_TEXTURE\0"
"GL_ACTIVE_TEXTURE_ARB\0"
+ "GL_ACTIVE_UNIFORMS\0"
+ "GL_ACTIVE_UNIFORM_MAX_LENGTH\0"
"GL_ACTIVE_VERTEX_UNITS_ARB\0"
"GL_ADD\0"
"GL_ADD_SIGNED\0"
@@ -87,6 +91,7 @@ static const char enum_string_table[] =
"GL_ARRAY_BUFFER_ARB\0"
"GL_ARRAY_BUFFER_BINDING\0"
"GL_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_ATTACHED_SHADERS\0"
"GL_ATTRIB_ARRAY_POINTER_NV\0"
"GL_ATTRIB_ARRAY_SIZE_NV\0"
"GL_ATTRIB_ARRAY_STRIDE_NV\0"
@@ -112,6 +117,7 @@ static const char enum_string_table[] =
"GL_BLEND_DST_ALPHA\0"
"GL_BLEND_DST_RGB\0"
"GL_BLEND_EQUATION\0"
+ "GL_BLEND_EQUATION_ALPHA\0"
"GL_BLEND_EQUATION_ALPHA_EXT\0"
"GL_BLEND_EQUATION_EXT\0"
"GL_BLEND_EQUATION_RGB_EXT\0"
@@ -122,9 +128,13 @@ static const char enum_string_table[] =
"GL_BLUE_BIAS\0"
"GL_BLUE_BITS\0"
"GL_BLUE_SCALE\0"
+ "GL_BOOL\0"
"GL_BOOL_ARB\0"
+ "GL_BOOL_VEC2\0"
"GL_BOOL_VEC2_ARB\0"
+ "GL_BOOL_VEC3\0"
"GL_BOOL_VEC3_ARB\0"
+ "GL_BOOL_VEC4\0"
"GL_BOOL_VEC4_ARB\0"
"GL_BUFFER_ACCESS\0"
"GL_BUFFER_ACCESS_ARB\0"
@@ -245,6 +255,7 @@ static const char enum_string_table[] =
"GL_COMPARE_R_TO_TEXTURE_ARB\0"
"GL_COMPILE\0"
"GL_COMPILE_AND_EXECUTE\0"
+ "GL_COMPILE_STATUS\0"
"GL_COMPRESSED_ALPHA\0"
"GL_COMPRESSED_ALPHA_ARB\0"
"GL_COMPRESSED_INTENSITY\0"
@@ -289,6 +300,7 @@ static const char enum_string_table[] =
"GL_CONVOLUTION_HEIGHT_EXT\0"
"GL_CONVOLUTION_WIDTH\0"
"GL_CONVOLUTION_WIDTH_EXT\0"
+ "GL_COORD_REPLACE\0"
"GL_COORD_REPLACE_ARB\0"
"GL_COORD_REPLACE_NV\0"
"GL_COPY\0"
@@ -312,6 +324,7 @@ static const char enum_string_table[] =
"GL_CURRENT_MATRIX_STACK_DEPTH_NV\0"
"GL_CURRENT_NORMAL\0"
"GL_CURRENT_PALETTE_MATRIX_ARB\0"
+ "GL_CURRENT_PROGRAM\0"
"GL_CURRENT_QUERY\0"
"GL_CURRENT_QUERY_ARB\0"
"GL_CURRENT_RASTER_COLOR\0"
@@ -322,6 +335,7 @@ static const char enum_string_table[] =
"GL_CURRENT_RASTER_TEXTURE_COORDS\0"
"GL_CURRENT_SECONDARY_COLOR\0"
"GL_CURRENT_TEXTURE_COORDS\0"
+ "GL_CURRENT_VERTEX_ATTRIB\0"
"GL_CURRENT_VERTEX_ATTRIB_ARB\0"
"GL_CURRENT_WEIGHT_ARB\0"
"GL_CW\0"
@@ -332,6 +346,7 @@ static const char enum_string_table[] =
"GL_DECR\0"
"GL_DECR_WRAP\0"
"GL_DECR_WRAP_EXT\0"
+ "GL_DELETE_STATUS\0"
"GL_DEPTH\0"
"GL_DEPTH_ATTACHMENT_EXT\0"
"GL_DEPTH_BIAS\0"
@@ -374,36 +389,52 @@ static const char enum_string_table[] =
"GL_DOUBLE\0"
"GL_DOUBLEBUFFER\0"
"GL_DRAW_BUFFER\0"
+ "GL_DRAW_BUFFER0\0"
"GL_DRAW_BUFFER0_ARB\0"
"GL_DRAW_BUFFER0_ATI\0"
+ "GL_DRAW_BUFFER1\0"
+ "GL_DRAW_BUFFER10\0"
"GL_DRAW_BUFFER10_ARB\0"
"GL_DRAW_BUFFER10_ATI\0"
+ "GL_DRAW_BUFFER11\0"
"GL_DRAW_BUFFER11_ARB\0"
"GL_DRAW_BUFFER11_ATI\0"
+ "GL_DRAW_BUFFER12\0"
"GL_DRAW_BUFFER12_ARB\0"
"GL_DRAW_BUFFER12_ATI\0"
+ "GL_DRAW_BUFFER13\0"
"GL_DRAW_BUFFER13_ARB\0"
"GL_DRAW_BUFFER13_ATI\0"
+ "GL_DRAW_BUFFER14\0"
"GL_DRAW_BUFFER14_ARB\0"
"GL_DRAW_BUFFER14_ATI\0"
+ "GL_DRAW_BUFFER15\0"
"GL_DRAW_BUFFER15_ARB\0"
"GL_DRAW_BUFFER15_ATI\0"
"GL_DRAW_BUFFER1_ARB\0"
"GL_DRAW_BUFFER1_ATI\0"
+ "GL_DRAW_BUFFER2\0"
"GL_DRAW_BUFFER2_ARB\0"
"GL_DRAW_BUFFER2_ATI\0"
+ "GL_DRAW_BUFFER3\0"
"GL_DRAW_BUFFER3_ARB\0"
"GL_DRAW_BUFFER3_ATI\0"
+ "GL_DRAW_BUFFER4\0"
"GL_DRAW_BUFFER4_ARB\0"
"GL_DRAW_BUFFER4_ATI\0"
+ "GL_DRAW_BUFFER5\0"
"GL_DRAW_BUFFER5_ARB\0"
"GL_DRAW_BUFFER5_ATI\0"
+ "GL_DRAW_BUFFER6\0"
"GL_DRAW_BUFFER6_ARB\0"
"GL_DRAW_BUFFER6_ATI\0"
+ "GL_DRAW_BUFFER7\0"
"GL_DRAW_BUFFER7_ARB\0"
"GL_DRAW_BUFFER7_ATI\0"
+ "GL_DRAW_BUFFER8\0"
"GL_DRAW_BUFFER8_ARB\0"
"GL_DRAW_BUFFER8_ATI\0"
+ "GL_DRAW_BUFFER9\0"
"GL_DRAW_BUFFER9_ARB\0"
"GL_DRAW_BUFFER9_ATI\0"
"GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
@@ -448,11 +479,17 @@ static const char enum_string_table[] =
"GL_FILL\0"
"GL_FLAT\0"
"GL_FLOAT\0"
+ "GL_FLOAT_MAT2\0"
"GL_FLOAT_MAT2_ARB\0"
+ "GL_FLOAT_MAT3\0"
"GL_FLOAT_MAT3_ARB\0"
+ "GL_FLOAT_MAT4\0"
"GL_FLOAT_MAT4_ARB\0"
+ "GL_FLOAT_VEC2\0"
"GL_FLOAT_VEC2_ARB\0"
+ "GL_FLOAT_VEC3\0"
"GL_FLOAT_VEC3_ARB\0"
+ "GL_FLOAT_VEC4\0"
"GL_FLOAT_VEC4_ARB\0"
"GL_FOG\0"
"GL_FOG_BIT\0"
@@ -483,7 +520,9 @@ static const char enum_string_table[] =
"GL_FOG_START\0"
"GL_FRAGMENT_DEPTH\0"
"GL_FRAGMENT_PROGRAM_ARB\0"
+ "GL_FRAGMENT_SHADER\0"
"GL_FRAGMENT_SHADER_ARB\0"
+ "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0"
"GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0"
"GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0"
@@ -517,6 +556,30 @@ static const char enum_string_table[] =
"GL_GENERATE_MIPMAP_HINT_SGIS\0"
"GL_GENERATE_MIPMAP_SGIS\0"
"GL_GEQUAL\0"
+ "GL_GL_BLEND_EQUATION_RGB\0"
+ "GL_GL_COMPRESSED_SLUMINANCE\0"
+ "GL_GL_COMPRESSED_SLUMINANCE_ALPHA\0"
+ "GL_GL_COMPRESSED_SRGB\0"
+ "GL_GL_COMPRESSED_SRGB_ALPHA\0"
+ "GL_GL_CURRENT_RASTER_SECONDARY_COLOR\0"
+ "GL_GL_FLOAT_MAT2x3\0"
+ "GL_GL_FLOAT_MAT2x4\0"
+ "GL_GL_FLOAT_MAT3x2\0"
+ "GL_GL_FLOAT_MAT3x4\0"
+ "GL_GL_FLOAT_MAT4x2\0"
+ "GL_GL_FLOAT_MAT4x3\0"
+ "GL_GL_PIXEL_PACK_BUFFER\0"
+ "GL_GL_PIXEL_PACK_BUFFER_BINDING\0"
+ "GL_GL_PIXEL_UNPACK_BUFFER\0"
+ "GL_GL_PIXEL_UNPACK_BUFFER_BINDING\0"
+ "GL_GL_SLUMINANCE\0"
+ "GL_GL_SLUMINANCE8\0"
+ "GL_GL_SLUMINANCE8_ALPHA8\0"
+ "GL_GL_SLUMINANCE_ALPHA\0"
+ "GL_GL_SRGB\0"
+ "GL_GL_SRGB8\0"
+ "GL_GL_SRGB8_ALPHA8\0"
+ "GL_GL_SRGB_ALPHA\0"
"GL_GREATER\0"
"GL_GREEN\0"
"GL_GREEN_BIAS\0"
@@ -561,6 +624,7 @@ static const char enum_string_table[] =
"GL_INDEX_OFFSET\0"
"GL_INDEX_SHIFT\0"
"GL_INDEX_WRITEMASK\0"
+ "GL_INFO_LOG_LENGTH\0"
"GL_INT\0"
"GL_INTENSITY\0"
"GL_INTENSITY12\0"
@@ -575,8 +639,11 @@ static const char enum_string_table[] =
"GL_INTERPOLATE\0"
"GL_INTERPOLATE_ARB\0"
"GL_INTERPOLATE_EXT\0"
+ "GL_INT_VEC2\0"
"GL_INT_VEC2_ARB\0"
+ "GL_INT_VEC3\0"
"GL_INT_VEC3_ARB\0"
+ "GL_INT_VEC4\0"
"GL_INT_VEC4_ARB\0"
"GL_INVALID_ENUM\0"
"GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0"
@@ -625,6 +692,7 @@ static const char enum_string_table[] =
"GL_LINE_WIDTH\0"
"GL_LINE_WIDTH_GRANULARITY\0"
"GL_LINE_WIDTH_RANGE\0"
+ "GL_LINK_STATUS\0"
"GL_LIST_BASE\0"
"GL_LIST_BIT\0"
"GL_LIST_INDEX\0"
@@ -632,6 +700,7 @@ static const char enum_string_table[] =
"GL_LOAD\0"
"GL_LOGIC_OP\0"
"GL_LOGIC_OP_MODE\0"
+ "GL_LOWER_LEFT\0"
"GL_LUMINANCE\0"
"GL_LUMINANCE12\0"
"GL_LUMINANCE12_ALPHA12\0"
@@ -767,6 +836,7 @@ static const char enum_string_table[] =
"GL_MAX_COLOR_ATTACHMENTS_EXT\0"
"GL_MAX_COLOR_MATRIX_STACK_DEPTH\0"
"GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0"
+ "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0"
"GL_MAX_CONVOLUTION_HEIGHT\0"
"GL_MAX_CONVOLUTION_HEIGHT_EXT\0"
@@ -774,12 +844,14 @@ static const char enum_string_table[] =
"GL_MAX_CONVOLUTION_WIDTH_EXT\0"
"GL_MAX_CUBE_MAP_TEXTURE_SIZE\0"
"GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0"
+ "GL_MAX_DRAW_BUFFERS\0"
"GL_MAX_DRAW_BUFFERS_ARB\0"
"GL_MAX_DRAW_BUFFERS_ATI\0"
"GL_MAX_ELEMENTS_INDICES\0"
"GL_MAX_ELEMENTS_VERTICES\0"
"GL_MAX_EVAL_ORDER\0"
"GL_MAX_EXT\0"
+ "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0"
"GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0"
"GL_MAX_LIGHTS\0"
"GL_MAX_LIST_NESTING\0"
@@ -819,7 +891,9 @@ static const char enum_string_table[] =
"GL_MAX_RENDERBUFFER_SIZE_EXT\0"
"GL_MAX_SHININESS_NV\0"
"GL_MAX_SPOT_EXPONENT_NV\0"
+ "GL_MAX_TEXTURE_COORDS\0"
"GL_MAX_TEXTURE_COORDS_ARB\0"
+ "GL_MAX_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0"
"GL_MAX_TEXTURE_LOD_BIAS\0"
"GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0"
@@ -829,9 +903,13 @@ static const char enum_string_table[] =
"GL_MAX_TEXTURE_UNITS_ARB\0"
"GL_MAX_TRACK_MATRICES_NV\0"
"GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
+ "GL_MAX_VARYING_FLOATS\0"
"GL_MAX_VARYING_FLOATS_ARB\0"
+ "GL_MAX_VERTEX_ATTRIBS\0"
"GL_MAX_VERTEX_ATTRIBS_ARB\0"
+ "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
"GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0"
"GL_MAX_VERTEX_UNITS_ARB\0"
"GL_MAX_VIEWPORT_DIMS\0"
@@ -1047,6 +1125,7 @@ static const char enum_string_table[] =
"GL_POINT_SIZE_RANGE\0"
"GL_POINT_SMOOTH\0"
"GL_POINT_SMOOTH_HINT\0"
+ "GL_POINT_SPRITE\0"
"GL_POINT_SPRITE_ARB\0"
"GL_POINT_SPRITE_COORD_ORIGIN\0"
"GL_POINT_SPRITE_NV\0"
@@ -1246,6 +1325,12 @@ static const char enum_string_table[] =
"GL_RGB_SCALE_EXT\0"
"GL_RIGHT\0"
"GL_S\0"
+ "GL_SAMPLER_1D\0"
+ "GL_SAMPLER_1D_SHADOW\0"
+ "GL_SAMPLER_2D\0"
+ "GL_SAMPLER_2D_SHADOW\0"
+ "GL_SAMPLER_3D\0"
+ "GL_SAMPLER_CUBE\0"
"GL_SAMPLES\0"
"GL_SAMPLES_3DFX\0"
"GL_SAMPLES_ARB\0"
@@ -1282,7 +1367,10 @@ static const char enum_string_table[] =
"GL_SEPARATE_SPECULAR_COLOR_EXT\0"
"GL_SET\0"
"GL_SHADER_OBJECT_ARB\0"
+ "GL_SHADER_SOURCE_LENGTH\0"
+ "GL_SHADER_TYPE\0"
"GL_SHADE_MODEL\0"
+ "GL_SHADING_LANGUAGE_VERSION\0"
"GL_SHADOW_AMBIENT_SGIX\0"
"GL_SHARED_TEXTURE_PALETTE_EXT\0"
"GL_SHININESS\0"
@@ -1339,6 +1427,13 @@ static const char enum_string_table[] =
"GL_STATIC_READ_ARB\0"
"GL_STENCIL\0"
"GL_STENCIL_ATTACHMENT_EXT\0"
+ "GL_STENCIL_BACK_FAIL\0"
+ "GL_STENCIL_BACK_FUNC\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_PASS\0"
+ "GL_STENCIL_BACK_REF\0"
+ "GL_STENCIL_BACK_VALUE_MASK\0"
+ "GL_STENCIL_BACK_WRITEMASK\0"
"GL_STENCIL_BITS\0"
"GL_STENCIL_BUFFER_BIT\0"
"GL_STENCIL_CLEAR_VALUE\0"
@@ -1601,8 +1696,10 @@ static const char enum_string_table[] =
"GL_UNSIGNED_SHORT_8_8_MESA\0"
"GL_UNSIGNED_SHORT_8_8_REV_APPLE\0"
"GL_UNSIGNED_SHORT_8_8_REV_MESA\0"
+ "GL_UPPER_LEFT\0"
"GL_V2F\0"
"GL_V3F\0"
+ "GL_VALIDATE_STATUS\0"
"GL_VENDOR\0"
"GL_VERSION\0"
"GL_VERTEX_ARRAY\0"
@@ -1631,20 +1728,29 @@ static const char enum_string_table[] =
"GL_VERTEX_ATTRIB_ARRAY9_NV\0"
"GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0"
"GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0"
"GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0"
"GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_POINTER\0"
"GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_SIZE\0"
"GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0"
"GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_TYPE\0"
"GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0"
"GL_VERTEX_BLEND_ARB\0"
"GL_VERTEX_PROGRAM_ARB\0"
"GL_VERTEX_PROGRAM_BINDING_NV\0"
"GL_VERTEX_PROGRAM_NV\0"
+ "GL_VERTEX_PROGRAM_POINT_SIZE\0"
"GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0"
"GL_VERTEX_PROGRAM_POINT_SIZE_NV\0"
+ "GL_VERTEX_PROGRAM_TWO_SIDE\0"
"GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0"
"GL_VERTEX_PROGRAM_TWO_SIDE_NV\0"
+ "GL_VERTEX_SHADER\0"
"GL_VERTEX_SHADER_ARB\0"
"GL_VERTEX_STATE_PROGRAM_NV\0"
"GL_VIEWPORT\0"
@@ -1668,7 +1774,7 @@ static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[1631] =
+static const enum_elt all_enums[1737] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -1685,2866 +1791,3009 @@ static const enum_elt all_enums[1631] =
{ 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */
{ 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */
{ 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */
- { 224, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
- { 251, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
- { 269, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
- { 291, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- { 318, 0x00000104 }, /* GL_ADD */
- { 325, 0x00008574 }, /* GL_ADD_SIGNED */
- { 339, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
- { 357, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
- { 375, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
- { 403, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
- { 431, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
- { 450, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
- { 476, 0x00001906 }, /* GL_ALPHA */
- { 485, 0x0000803D }, /* GL_ALPHA12 */
- { 496, 0x0000803D }, /* GL_ALPHA12_EXT */
- { 511, 0x0000803E }, /* GL_ALPHA16 */
- { 522, 0x0000803E }, /* GL_ALPHA16_EXT */
- { 537, 0x0000803B }, /* GL_ALPHA4 */
- { 547, 0x0000803B }, /* GL_ALPHA4_EXT */
- { 561, 0x0000803C }, /* GL_ALPHA8 */
- { 571, 0x0000803C }, /* GL_ALPHA8_EXT */
- { 585, 0x00000D1D }, /* GL_ALPHA_BIAS */
- { 599, 0x00000D55 }, /* GL_ALPHA_BITS */
- { 613, 0x00000D1C }, /* GL_ALPHA_SCALE */
- { 628, 0x00000BC0 }, /* GL_ALPHA_TEST */
- { 642, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
- { 661, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
- { 679, 0x00000207 }, /* GL_ALWAYS */
- { 689, 0x00001200 }, /* GL_AMBIENT */
- { 700, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
- { 723, 0x00001501 }, /* GL_AND */
- { 730, 0x00001504 }, /* GL_AND_INVERTED */
- { 746, 0x00001502 }, /* GL_AND_REVERSE */
- { 761, 0x00008892 }, /* GL_ARRAY_BUFFER */
- { 777, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */
- { 797, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
- { 821, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
- { 849, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
- { 876, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
- { 900, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
- { 926, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
- { 950, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
- { 972, 0x00000D80 }, /* GL_AUTO_NORMAL */
- { 987, 0x00000409 }, /* GL_AUX0 */
- { 995, 0x0000040A }, /* GL_AUX1 */
- { 1003, 0x0000040B }, /* GL_AUX2 */
- { 1011, 0x0000040C }, /* GL_AUX3 */
- { 1019, 0x00000C00 }, /* GL_AUX_BUFFERS */
- { 1034, 0x00000405 }, /* GL_BACK */
- { 1042, 0x00000402 }, /* GL_BACK_LEFT */
- { 1055, 0x00000403 }, /* GL_BACK_RIGHT */
- { 1069, 0x000080E0 }, /* GL_BGR */
- { 1076, 0x000080E1 }, /* GL_BGRA */
- { 1084, 0x00001A00 }, /* GL_BITMAP */
- { 1094, 0x00000704 }, /* GL_BITMAP_TOKEN */
- { 1110, 0x00000BE2 }, /* GL_BLEND */
- { 1119, 0x00008005 }, /* GL_BLEND_COLOR */
- { 1134, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
- { 1153, 0x00000BE0 }, /* GL_BLEND_DST */
- { 1166, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
- { 1185, 0x000080C8 }, /* GL_BLEND_DST_RGB */
- { 1202, 0x00008009 }, /* GL_BLEND_EQUATION */
- { 1220, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
- { 1248, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
- { 1270, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
- { 1296, 0x00000BE1 }, /* GL_BLEND_SRC */
- { 1309, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
- { 1328, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
- { 1345, 0x00001905 }, /* GL_BLUE */
- { 1353, 0x00000D1B }, /* GL_BLUE_BIAS */
- { 1366, 0x00000D54 }, /* GL_BLUE_BITS */
- { 1379, 0x00000D1A }, /* GL_BLUE_SCALE */
- { 1393, 0x00008B56 }, /* GL_BOOL_ARB */
- { 1405, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
- { 1422, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
- { 1439, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
- { 1456, 0x000088BB }, /* GL_BUFFER_ACCESS */
- { 1473, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
- { 1494, 0x000088BC }, /* GL_BUFFER_MAPPED */
- { 1511, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
- { 1532, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
- { 1554, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
- { 1580, 0x00008764 }, /* GL_BUFFER_SIZE */
- { 1595, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
- { 1614, 0x00008765 }, /* GL_BUFFER_USAGE */
- { 1630, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
- { 1650, 0x00001400 }, /* GL_BYTE */
- { 1658, 0x00002A24 }, /* GL_C3F_V3F */
- { 1669, 0x00002A26 }, /* GL_C4F_N3F_V3F */
- { 1684, 0x00002A22 }, /* GL_C4UB_V2F */
- { 1696, 0x00002A23 }, /* GL_C4UB_V3F */
- { 1708, 0x00000901 }, /* GL_CCW */
- { 1715, 0x00002900 }, /* GL_CLAMP */
- { 1724, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
- { 1743, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
- { 1766, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
- { 1790, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
- { 1807, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
- { 1829, 0x00001500 }, /* GL_CLEAR */
- { 1838, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
- { 1863, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
- { 1892, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
- { 1918, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- { 1947, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
- { 1973, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
- { 2000, 0x00003000 }, /* GL_CLIP_PLANE0 */
- { 2015, 0x00003001 }, /* GL_CLIP_PLANE1 */
- { 2030, 0x00003002 }, /* GL_CLIP_PLANE2 */
- { 2045, 0x00003003 }, /* GL_CLIP_PLANE3 */
- { 2060, 0x00003004 }, /* GL_CLIP_PLANE4 */
- { 2075, 0x00003005 }, /* GL_CLIP_PLANE5 */
- { 2090, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- { 2123, 0x00000A00 }, /* GL_COEFF */
- { 2132, 0x00001800 }, /* GL_COLOR */
- { 2141, 0x00008076 }, /* GL_COLOR_ARRAY */
- { 2156, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- { 2186, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 2220, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
- { 2243, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
- { 2263, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
- { 2285, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
- { 2305, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
- { 2330, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
- { 2356, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
- { 2382, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
- { 2408, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
- { 2434, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
- { 2460, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
- { 2486, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
- { 2511, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
- { 2536, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
- { 2561, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
- { 2586, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
- { 2611, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
- { 2636, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
- { 2661, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
- { 2686, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
- { 2711, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
- { 2731, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
- { 2752, 0x00001900 }, /* GL_COLOR_INDEX */
- { 2767, 0x00001603 }, /* GL_COLOR_INDEXES */
- { 2784, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
- { 2802, 0x00000B57 }, /* GL_COLOR_MATERIAL */
- { 2820, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
- { 2843, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
- { 2871, 0x000080B1 }, /* GL_COLOR_MATRIX */
- { 2887, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
- { 2907, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
- { 2935, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 2967, 0x00008458 }, /* GL_COLOR_SUM */
- { 2980, 0x00008458 }, /* GL_COLOR_SUM_ARB */
- { 2997, 0x000080D0 }, /* GL_COLOR_TABLE */
- { 3012, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
- { 3038, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
- { 3068, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
- { 3098, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
- { 3118, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
- { 3142, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
- { 3167, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
- { 3196, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
- { 3225, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
- { 3247, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
- { 3273, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
- { 3299, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
- { 3325, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
- { 3355, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
- { 3385, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- { 3415, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
- { 3449, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
- { 3483, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- { 3513, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
- { 3547, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
- { 3581, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
- { 3605, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
- { 3633, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
- { 3661, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
- { 3682, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
- { 3707, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
- { 3728, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
- { 3753, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
- { 3778, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
- { 3797, 0x00008570 }, /* GL_COMBINE */
- { 3808, 0x00008503 }, /* GL_COMBINE4 */
- { 3820, 0x00008572 }, /* GL_COMBINE_ALPHA */
- { 3837, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
- { 3858, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
- { 3879, 0x00008570 }, /* GL_COMBINE_ARB */
- { 3894, 0x00008570 }, /* GL_COMBINE_EXT */
- { 3909, 0x00008571 }, /* GL_COMBINE_RGB */
- { 3924, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
- { 3943, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
- { 3962, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
- { 3986, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
- { 4014, 0x00001300 }, /* GL_COMPILE */
- { 4025, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
- { 4048, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
- { 4068, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
- { 4092, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
- { 4116, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
- { 4144, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
- { 4168, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- { 4198, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
- { 4232, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
- { 4260, 0x000084ED }, /* GL_COMPRESSED_RGB */
- { 4278, 0x000084EE }, /* GL_COMPRESSED_RGBA */
- { 4297, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
- { 4320, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- { 4349, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- { 4382, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- { 4415, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- { 4448, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
- { 4470, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- { 4498, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- { 4530, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
- { 4560, 0x00008576 }, /* GL_CONSTANT */
- { 4572, 0x00008003 }, /* GL_CONSTANT_ALPHA */
- { 4590, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
- { 4612, 0x00008576 }, /* GL_CONSTANT_ARB */
- { 4628, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
- { 4652, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
- { 4674, 0x00008001 }, /* GL_CONSTANT_COLOR */
- { 4692, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
- { 4714, 0x00008576 }, /* GL_CONSTANT_EXT */
- { 4730, 0x00008010 }, /* GL_CONVOLUTION_1D */
- { 4748, 0x00008011 }, /* GL_CONVOLUTION_2D */
- { 4766, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
- { 4794, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
- { 4825, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
- { 4852, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
- { 4883, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
- { 4910, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
- { 4941, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
- { 4969, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
- { 5001, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
- { 5023, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
- { 5049, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
- { 5071, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
- { 5097, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
- { 5118, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
- { 5143, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
- { 5164, 0x00008862 }, /* GL_COORD_REPLACE_NV */
- { 5184, 0x00001503 }, /* GL_COPY */
- { 5192, 0x0000150C }, /* GL_COPY_INVERTED */
- { 5209, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
- { 5229, 0x00000B44 }, /* GL_CULL_FACE */
- { 5242, 0x00000B45 }, /* GL_CULL_FACE_MODE */
- { 5260, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
- { 5279, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- { 5311, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- { 5346, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
- { 5367, 0x00000001 }, /* GL_CURRENT_BIT */
- { 5382, 0x00000B00 }, /* GL_CURRENT_COLOR */
- { 5399, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
- { 5420, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
- { 5446, 0x00000B01 }, /* GL_CURRENT_INDEX */
- { 5463, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
- { 5485, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
- { 5513, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
- { 5534, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- { 5568, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
- { 5601, 0x00000B02 }, /* GL_CURRENT_NORMAL */
- { 5619, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- { 5649, 0x00008865 }, /* GL_CURRENT_QUERY */
- { 5666, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
- { 5687, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
- { 5711, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
- { 5738, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
- { 5762, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
- { 5789, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
- { 5822, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- { 5855, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
- { 5882, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
- { 5908, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- { 5937, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
- { 5959, 0x00000900 }, /* GL_CW */
- { 5965, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
- { 5986, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
- { 6007, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
- { 6027, 0x00002101 }, /* GL_DECAL */
- { 6036, 0x00001E03 }, /* GL_DECR */
- { 6044, 0x00008508 }, /* GL_DECR_WRAP */
- { 6057, 0x00008508 }, /* GL_DECR_WRAP_EXT */
- { 6074, 0x00001801 }, /* GL_DEPTH */
- { 6083, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
- { 6107, 0x00000D1F }, /* GL_DEPTH_BIAS */
- { 6121, 0x00000D56 }, /* GL_DEPTH_BITS */
- { 6135, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
- { 6155, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
- { 6180, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
- { 6200, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
- { 6218, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
- { 6239, 0x00001902 }, /* GL_DEPTH_COMPONENT */
- { 6258, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
- { 6279, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
- { 6304, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
- { 6330, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
- { 6351, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
- { 6376, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
- { 6402, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
- { 6423, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
- { 6448, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
- { 6474, 0x00000B74 }, /* GL_DEPTH_FUNC */
- { 6488, 0x00000B70 }, /* GL_DEPTH_RANGE */
- { 6503, 0x00000D1E }, /* GL_DEPTH_SCALE */
- { 6518, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
- { 6538, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- { 6566, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- { 6594, 0x00000B71 }, /* GL_DEPTH_TEST */
- { 6608, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
- { 6630, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
- { 6656, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
- { 6675, 0x00001201 }, /* GL_DIFFUSE */
- { 6686, 0x00000BD0 }, /* GL_DITHER */
- { 6696, 0x00000A02 }, /* GL_DOMAIN */
- { 6706, 0x00001100 }, /* GL_DONT_CARE */
- { 6719, 0x000086AE }, /* GL_DOT3_RGB */
- { 6731, 0x000086AF }, /* GL_DOT3_RGBA */
- { 6744, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
- { 6761, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
- { 6778, 0x000086AE }, /* GL_DOT3_RGB_ARB */
- { 6794, 0x00008740 }, /* GL_DOT3_RGB_EXT */
- { 6810, 0x0000140A }, /* GL_DOUBLE */
- { 6820, 0x00000C32 }, /* GL_DOUBLEBUFFER */
- { 6836, 0x00000C01 }, /* GL_DRAW_BUFFER */
- { 6851, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
- { 6871, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
- { 6891, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
- { 6912, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
- { 6933, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
- { 6954, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
- { 6975, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
- { 6996, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
- { 7017, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
- { 7038, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
- { 7059, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
- { 7080, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
- { 7101, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
- { 7122, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
- { 7143, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
- { 7163, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
- { 7183, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
- { 7203, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
- { 7223, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
- { 7243, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
- { 7263, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
- { 7283, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
- { 7303, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
- { 7323, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
- { 7343, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
- { 7363, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
- { 7383, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
- { 7403, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
- { 7423, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
- { 7443, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
- { 7463, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
- { 7483, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
- { 7503, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- { 7535, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
- { 7559, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
- { 7579, 0x00000304 }, /* GL_DST_ALPHA */
- { 7592, 0x00000306 }, /* GL_DST_COLOR */
- { 7605, 0x000088EA }, /* GL_DYNAMIC_COPY */
- { 7621, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
- { 7641, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
- { 7657, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
- { 7677, 0x000088E9 }, /* GL_DYNAMIC_READ */
- { 7693, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
- { 7713, 0x00000B43 }, /* GL_EDGE_FLAG */
- { 7726, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
- { 7745, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- { 7779, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
- { 7817, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
- { 7844, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- { 7870, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
- { 7894, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */
- { 7922, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- { 7954, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
- { 7990, 0x00001600 }, /* GL_EMISSION */
- { 8002, 0x00002000 }, /* GL_ENABLE_BIT */
- { 8016, 0x00000202 }, /* GL_EQUAL */
- { 8025, 0x00001509 }, /* GL_EQUIV */
- { 8034, 0x00010000 }, /* GL_EVAL_BIT */
- { 8046, 0x00000800 }, /* GL_EXP */
- { 8053, 0x00000801 }, /* GL_EXP2 */
- { 8061, 0x00001F03 }, /* GL_EXTENSIONS */
- { 8075, 0x00002400 }, /* GL_EYE_LINEAR */
- { 8089, 0x00002502 }, /* GL_EYE_PLANE */
- { 8102, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
- { 8127, 0x0000855B }, /* GL_EYE_RADIAL_NV */
- { 8144, 0x00000000 }, /* GL_FALSE */
- { 8153, 0x00001101 }, /* GL_FASTEST */
- { 8164, 0x00001C01 }, /* GL_FEEDBACK */
- { 8176, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
- { 8203, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
- { 8227, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
- { 8251, 0x00001B02 }, /* GL_FILL */
- { 8259, 0x00001D00 }, /* GL_FLAT */
- { 8267, 0x00001406 }, /* GL_FLOAT */
- { 8276, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
- { 8294, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
- { 8312, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
- { 8330, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
- { 8348, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
- { 8366, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
- { 8384, 0x00000B60 }, /* GL_FOG */
- { 8391, 0x00000080 }, /* GL_FOG_BIT */
- { 8402, 0x00000B66 }, /* GL_FOG_COLOR */
- { 8415, 0x00008451 }, /* GL_FOG_COORD */
- { 8428, 0x00008451 }, /* GL_FOG_COORDINATE */
- { 8446, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
- { 8470, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- { 8509, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
- { 8552, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- { 8584, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- { 8615, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- { 8644, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
- { 8669, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
- { 8688, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
- { 8722, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
- { 8749, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
- { 8775, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
- { 8799, 0x00008450 }, /* GL_FOG_COORD_SRC */
- { 8816, 0x00000B62 }, /* GL_FOG_DENSITY */
- { 8831, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
- { 8855, 0x00000B64 }, /* GL_FOG_END */
- { 8866, 0x00000C54 }, /* GL_FOG_HINT */
- { 8878, 0x00000B61 }, /* GL_FOG_INDEX */
- { 8891, 0x00000B65 }, /* GL_FOG_MODE */
- { 8903, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
- { 8922, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
- { 8947, 0x00000B63 }, /* GL_FOG_START */
- { 8960, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
- { 8978, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
- { 9002, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
- { 9025, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- { 9067, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- { 9109, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- { 9158, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- { 9210, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- { 9254, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
- { 9281, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- { 9309, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
- { 9328, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- { 9369, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- { 9410, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- { 9452, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- { 9503, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- { 9541, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- { 9590, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- { 9632, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- { 9664, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- { 9695, 0x00000404 }, /* GL_FRONT */
- { 9704, 0x00000408 }, /* GL_FRONT_AND_BACK */
- { 9722, 0x00000B46 }, /* GL_FRONT_FACE */
- { 9736, 0x00000400 }, /* GL_FRONT_LEFT */
- { 9750, 0x00000401 }, /* GL_FRONT_RIGHT */
- { 9765, 0x00008006 }, /* GL_FUNC_ADD */
- { 9777, 0x00008006 }, /* GL_FUNC_ADD_EXT */
- { 9793, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
- { 9818, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
- { 9847, 0x0000800A }, /* GL_FUNC_SUBTRACT */
- { 9864, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
- { 9885, 0x00008191 }, /* GL_GENERATE_MIPMAP */
- { 9904, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
- { 9928, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
- { 9957, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
- { 9981, 0x00000206 }, /* GL_GEQUAL */
- { 9991, 0x00000204 }, /* GL_GREATER */
- { 10002, 0x00001904 }, /* GL_GREEN */
- { 10011, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 10025, 0x00000D53 }, /* GL_GREEN_BITS */
- { 10039, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 10054, 0x00008000 }, /* GL_HINT_BIT */
- { 10066, 0x00008024 }, /* GL_HISTOGRAM */
- { 10079, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 10103, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 10131, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 10154, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 10181, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 10198, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 10218, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 10242, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 10266, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 10294, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 10322, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 10354, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 10376, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 10402, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 10420, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 10442, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 10461, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 10484, 0x0000862A }, /* GL_IDENTITY_NV */
- { 10499, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 10519, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 10559, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 10597, 0x00001E02 }, /* GL_INCR */
- { 10605, 0x00008507 }, /* GL_INCR_WRAP */
- { 10618, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 10635, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 10650, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 10680, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 10714, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 10737, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 10759, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 10779, 0x00000D51 }, /* GL_INDEX_BITS */
- { 10793, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 10814, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 10832, 0x00000C30 }, /* GL_INDEX_MODE */
- { 10846, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 10862, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 10877, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 10896, 0x00001404 }, /* GL_INT */
- { 10903, 0x00008049 }, /* GL_INTENSITY */
- { 10916, 0x0000804C }, /* GL_INTENSITY12 */
- { 10931, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 10950, 0x0000804D }, /* GL_INTENSITY16 */
- { 10965, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 10984, 0x0000804A }, /* GL_INTENSITY4 */
- { 10998, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 11016, 0x0000804B }, /* GL_INTENSITY8 */
- { 11030, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 11048, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 11065, 0x00008575 }, /* GL_INTERPOLATE */
- { 11080, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 11099, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 11118, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 11134, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 11150, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 11166, 0x00000500 }, /* GL_INVALID_ENUM */
- { 11182, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 11219, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 11240, 0x00000501 }, /* GL_INVALID_VALUE */
- { 11257, 0x0000862B }, /* GL_INVERSE_NV */
- { 11271, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 11295, 0x0000150A }, /* GL_INVERT */
- { 11305, 0x00001E00 }, /* GL_KEEP */
- { 11313, 0x00000406 }, /* GL_LEFT */
- { 11321, 0x00000203 }, /* GL_LEQUAL */
- { 11331, 0x00000201 }, /* GL_LESS */
- { 11339, 0x00004000 }, /* GL_LIGHT0 */
- { 11349, 0x00004001 }, /* GL_LIGHT1 */
- { 11359, 0x00004002 }, /* GL_LIGHT2 */
- { 11369, 0x00004003 }, /* GL_LIGHT3 */
- { 11379, 0x00004004 }, /* GL_LIGHT4 */
- { 11389, 0x00004005 }, /* GL_LIGHT5 */
- { 11399, 0x00004006 }, /* GL_LIGHT6 */
- { 11409, 0x00004007 }, /* GL_LIGHT7 */
- { 11419, 0x00000B50 }, /* GL_LIGHTING */
- { 11431, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 11447, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 11470, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 11499, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 11532, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 11560, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 11584, 0x00001B01 }, /* GL_LINE */
- { 11592, 0x00002601 }, /* GL_LINEAR */
- { 11602, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 11624, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 11654, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 11685, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 11709, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 11734, 0x00000001 }, /* GL_LINES */
- { 11743, 0x00000004 }, /* GL_LINE_BIT */
- { 11755, 0x00000002 }, /* GL_LINE_LOOP */
- { 11768, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 11788, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 11803, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 11823, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 11839, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 11863, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 11886, 0x00000003 }, /* GL_LINE_STRIP */
- { 11900, 0x00000702 }, /* GL_LINE_TOKEN */
- { 11914, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 11928, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 11954, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 11974, 0x00000B32 }, /* GL_LIST_BASE */
- { 11987, 0x00020000 }, /* GL_LIST_BIT */
- { 11999, 0x00000B33 }, /* GL_LIST_INDEX */
- { 12013, 0x00000B30 }, /* GL_LIST_MODE */
- { 12026, 0x00000101 }, /* GL_LOAD */
- { 12034, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 12046, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 12063, 0x00001909 }, /* GL_LUMINANCE */
- { 12076, 0x00008041 }, /* GL_LUMINANCE12 */
- { 12091, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 12114, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 12141, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 12163, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 12189, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 12208, 0x00008042 }, /* GL_LUMINANCE16 */
- { 12223, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 12246, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 12273, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 12292, 0x0000803F }, /* GL_LUMINANCE4 */
- { 12306, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 12327, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 12352, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 12370, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 12391, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 12416, 0x00008040 }, /* GL_LUMINANCE8 */
- { 12430, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 12451, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 12476, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 12494, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 12513, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 12529, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 12549, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 12571, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 12585, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 12600, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 12624, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 12648, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 12672, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 12696, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 12713, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 12730, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 12758, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 12787, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 12816, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 12845, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 12874, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 12903, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 12932, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 12960, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 12988, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 13016, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 13044, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 13072, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 13100, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 13128, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 13156, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 13184, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 13200, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 13220, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 13242, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 13256, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 13271, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 13295, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 13319, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 13343, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 13367, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 13384, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 13401, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 13429, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 13458, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 13487, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 13516, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 13545, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 13574, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 13603, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 13631, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 13659, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 13687, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 13715, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 13743, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 13771, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 13799, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 13827, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 13855, 0x00000D10 }, /* GL_MAP_COLOR */
- { 13868, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 13883, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 13898, 0x00008630 }, /* GL_MATRIX0_NV */
- { 13912, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 13928, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 13944, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 13960, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 13976, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 13992, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 14008, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 14024, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 14040, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 14056, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 14072, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 14087, 0x00008631 }, /* GL_MATRIX1_NV */
- { 14101, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 14117, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 14133, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 14149, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 14165, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 14181, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 14197, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 14213, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 14229, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 14245, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 14261, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 14276, 0x00008632 }, /* GL_MATRIX2_NV */
- { 14290, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 14306, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 14322, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 14337, 0x00008633 }, /* GL_MATRIX3_NV */
- { 14351, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 14366, 0x00008634 }, /* GL_MATRIX4_NV */
- { 14380, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 14395, 0x00008635 }, /* GL_MATRIX5_NV */
- { 14409, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 14424, 0x00008636 }, /* GL_MATRIX6_NV */
- { 14438, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 14453, 0x00008637 }, /* GL_MATRIX7_NV */
- { 14467, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 14482, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 14497, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 14523, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 14557, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 14588, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 14621, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 14652, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 14667, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 14689, 0x00008008 }, /* GL_MAX */
- { 14696, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 14719, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 14745, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 14778, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 14804, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 14838, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 14857, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 14886, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 14918, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 14954, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 14994, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 15020, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 15050, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 15075, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 15104, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 15133, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 15166, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 15190, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 15214, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 15238, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 15263, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 15281, 0x00008008 }, /* GL_MAX_EXT */
- { 15292, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 15331, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 15345, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 15365, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 15403, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 15432, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 15456, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 15484, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 15507, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 15544, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 15580, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 15607, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 15636, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 15670, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 15706, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 15733, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 15765, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 15801, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 15830, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 15859, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 15887, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 15925, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 15969, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 16012, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 16046, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 16085, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 16122, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 16160, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 16203, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 16246, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 16276, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 16307, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 16343, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 16379, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 16409, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 16443, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 16476, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 16505, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 16525, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 16549, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 16575, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 16606, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 16630, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 16664, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 16684, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 16711, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 16732, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 16757, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 16782, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 16817, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 16843, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 16869, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 16907, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 16944, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 16968, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 16989, 0x00008007 }, /* GL_MIN */
- { 16996, 0x0000802E }, /* GL_MINMAX */
- { 17006, 0x0000802E }, /* GL_MINMAX_EXT */
- { 17020, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 17037, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 17058, 0x00008030 }, /* GL_MINMAX_SINK */
- { 17073, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 17092, 0x00008007 }, /* GL_MIN_EXT */
- { 17103, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 17122, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 17145, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 17168, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 17188, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 17208, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 17238, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 17266, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 17294, 0x00001700 }, /* GL_MODELVIEW */
- { 17307, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 17325, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 17344, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 17363, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 17382, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 17401, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 17420, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 17439, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 17458, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 17477, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 17496, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 17515, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 17533, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 17552, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 17571, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 17590, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 17609, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 17628, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 17647, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 17666, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 17685, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 17704, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 17723, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 17741, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 17760, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 17779, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 17797, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 17815, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 17833, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 17851, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 17869, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 17887, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 17905, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 17925, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 17952, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 17977, 0x00002100 }, /* GL_MODULATE */
- { 17989, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 18009, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 18036, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 18061, 0x00000103 }, /* GL_MULT */
- { 18069, 0x0000809D }, /* GL_MULTISAMPLE */
- { 18084, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 18104, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 18123, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 18142, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 18166, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 18189, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 18219, 0x00002A25 }, /* GL_N3F_V3F */
- { 18230, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 18250, 0x0000150E }, /* GL_NAND */
- { 18258, 0x00002600 }, /* GL_NEAREST */
- { 18269, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 18300, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 18332, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 18357, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 18383, 0x00000200 }, /* GL_NEVER */
- { 18392, 0x00001102 }, /* GL_NICEST */
- { 18402, 0x00000000 }, /* GL_NONE */
- { 18410, 0x00001505 }, /* GL_NOOP */
- { 18418, 0x00001508 }, /* GL_NOR */
- { 18425, 0x00000BA1 }, /* GL_NORMALIZE */
- { 18438, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 18454, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 18485, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 18520, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 18544, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 18567, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 18588, 0x00008511 }, /* GL_NORMAL_MAP */
- { 18602, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 18620, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 18637, 0x00000205 }, /* GL_NOTEQUAL */
- { 18649, 0x00000000 }, /* GL_NO_ERROR */
- { 18661, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 18695, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 18733, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 18765, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 18807, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 18837, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 18877, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 18908, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 18937, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 18965, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 18995, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 19012, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 19038, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 19054, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 19089, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 19111, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 19130, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 19160, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 19181, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 19209, 0x00000001 }, /* GL_ONE */
- { 19216, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 19244, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 19276, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 19304, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 19336, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 19359, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 19382, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 19405, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 19428, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 19446, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 19468, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 19490, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 19506, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 19526, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 19546, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 19564, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 19586, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 19608, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 19624, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 19644, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 19664, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 19682, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 19704, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 19726, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 19742, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 19762, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 19782, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 19803, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 19822, 0x00001507 }, /* GL_OR */
- { 19828, 0x00000A01 }, /* GL_ORDER */
- { 19837, 0x0000150D }, /* GL_OR_INVERTED */
- { 19852, 0x0000150B }, /* GL_OR_REVERSE */
- { 19866, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 19883, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 19901, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 19922, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 19942, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 19960, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 19979, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 19999, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 20019, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 20037, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 20056, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 20081, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 20105, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 20126, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 20148, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 20170, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 20195, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 20219, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 20240, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 20262, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 20284, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 20306, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 20337, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 20357, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 20382, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 20402, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 20427, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 20447, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 20472, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 20492, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 20517, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 20537, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 20562, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 20582, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 20607, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 20627, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 20652, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 20672, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 20697, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 20717, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 20742, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 20762, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 20787, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 20805, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 20838, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 20863, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 20898, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 20925, 0x00001B00 }, /* GL_POINT */
- { 20934, 0x00000000 }, /* GL_POINTS */
- { 20944, 0x00000002 }, /* GL_POINT_BIT */
- { 20957, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 20987, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 21021, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 21055, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 21090, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 21119, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 21152, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 21185, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 21219, 0x00000B11 }, /* GL_POINT_SIZE */
- { 21233, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 21259, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 21277, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 21299, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 21321, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 21344, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 21362, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 21384, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 21406, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 21429, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 21449, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 21465, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 21486, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 21506, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 21535, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 21554, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 21580, 0x00000701 }, /* GL_POINT_TOKEN */
- { 21595, 0x00000009 }, /* GL_POLYGON */
- { 21606, 0x00000008 }, /* GL_POLYGON_BIT */
- { 21621, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 21637, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 21660, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 21685, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 21708, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 21731, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 21755, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 21779, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 21797, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 21820, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 21839, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 21862, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 21879, 0x00001203 }, /* GL_POSITION */
- { 21891, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 21923, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 21959, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 21992, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 22029, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 22060, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 22095, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 22127, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 22163, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 22196, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 22228, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 22264, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 22297, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 22334, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 22364, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 22398, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 22429, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 22464, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 22495, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 22530, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 22562, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 22598, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 22628, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 22662, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 22693, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 22728, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 22760, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 22791, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 22826, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 22858, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 22894, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 22923, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 22956, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 22986, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 23020, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 23059, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 23092, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 23132, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 23166, 0x00008578 }, /* GL_PREVIOUS */
- { 23178, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 23194, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 23210, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 23227, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 23248, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 23269, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 23302, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 23334, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 23357, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 23380, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 23410, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 23439, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 23467, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 23489, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 23517, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 23545, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 23567, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 23588, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 23628, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 23667, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 23697, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 23732, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 23765, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 23799, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 23838, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 23877, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 23899, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 23925, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 23949, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 23972, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 23994, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 24015, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 24036, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 24063, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 24095, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 24127, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 24162, 0x00001701 }, /* GL_PROJECTION */
- { 24176, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 24197, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 24223, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 24244, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 24263, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 24286, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 24325, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 24363, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 24383, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 24407, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 24427, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 24451, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 24471, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 24504, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 24530, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 24560, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 24591, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 24621, 0x00002003 }, /* GL_Q */
- { 24626, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 24651, 0x00000007 }, /* GL_QUADS */
- { 24660, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 24677, 0x00000008 }, /* GL_QUAD_STRIP */
- { 24691, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 24713, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 24739, 0x00008866 }, /* GL_QUERY_RESULT */
- { 24755, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 24775, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 24801, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 24831, 0x00002002 }, /* GL_R */
- { 24836, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 24848, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 24881, 0x00000C02 }, /* GL_READ_BUFFER */
- { 24896, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 24928, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 24952, 0x000088B8 }, /* GL_READ_ONLY */
- { 24965, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 24982, 0x000088BA }, /* GL_READ_WRITE */
- { 24996, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 25014, 0x00001903 }, /* GL_RED */
- { 25021, 0x00008016 }, /* GL_REDUCE */
- { 25031, 0x00008016 }, /* GL_REDUCE_EXT */
- { 25045, 0x00000D15 }, /* GL_RED_BIAS */
- { 25057, 0x00000D52 }, /* GL_RED_BITS */
- { 25069, 0x00000D14 }, /* GL_RED_SCALE */
- { 25082, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 25100, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 25122, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 25143, 0x00001C00 }, /* GL_RENDER */
- { 25153, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 25181, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 25201, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 25228, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 25264, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 25290, 0x00001F01 }, /* GL_RENDERER */
- { 25302, 0x00000C40 }, /* GL_RENDER_MODE */
- { 25317, 0x00002901 }, /* GL_REPEAT */
- { 25327, 0x00001E01 }, /* GL_REPLACE */
- { 25338, 0x00008062 }, /* GL_REPLACE_EXT */
- { 25353, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 25376, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 25394, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 25416, 0x00000102 }, /* GL_RETURN */
- { 25426, 0x00001907 }, /* GL_RGB */
- { 25433, 0x00008052 }, /* GL_RGB10 */
- { 25442, 0x00008059 }, /* GL_RGB10_A2 */
- { 25454, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 25470, 0x00008052 }, /* GL_RGB10_EXT */
- { 25483, 0x00008053 }, /* GL_RGB12 */
- { 25492, 0x00008053 }, /* GL_RGB12_EXT */
- { 25505, 0x00008054 }, /* GL_RGB16 */
- { 25514, 0x00008054 }, /* GL_RGB16_EXT */
- { 25527, 0x0000804E }, /* GL_RGB2_EXT */
- { 25539, 0x0000804F }, /* GL_RGB4 */
- { 25547, 0x0000804F }, /* GL_RGB4_EXT */
- { 25559, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 25572, 0x00008050 }, /* GL_RGB5 */
- { 25580, 0x00008057 }, /* GL_RGB5_A1 */
- { 25591, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 25606, 0x00008050 }, /* GL_RGB5_EXT */
- { 25618, 0x00008051 }, /* GL_RGB8 */
- { 25626, 0x00008051 }, /* GL_RGB8_EXT */
- { 25638, 0x00001908 }, /* GL_RGBA */
- { 25646, 0x0000805A }, /* GL_RGBA12 */
- { 25656, 0x0000805A }, /* GL_RGBA12_EXT */
- { 25670, 0x0000805B }, /* GL_RGBA16 */
- { 25680, 0x0000805B }, /* GL_RGBA16_EXT */
- { 25694, 0x00008055 }, /* GL_RGBA2 */
- { 25703, 0x00008055 }, /* GL_RGBA2_EXT */
- { 25716, 0x00008056 }, /* GL_RGBA4 */
- { 25725, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 25744, 0x00008056 }, /* GL_RGBA4_EXT */
- { 25757, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 25771, 0x00008058 }, /* GL_RGBA8 */
- { 25780, 0x00008058 }, /* GL_RGBA8_EXT */
- { 25793, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 25811, 0x00000C31 }, /* GL_RGBA_MODE */
- { 25824, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 25837, 0x000083A0 }, /* GL_RGB_S3TC */
- { 25849, 0x00008573 }, /* GL_RGB_SCALE */
- { 25862, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 25879, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 25896, 0x00000407 }, /* GL_RIGHT */
- { 25905, 0x00002000 }, /* GL_S */
- { 25910, 0x000080A9 }, /* GL_SAMPLES */
- { 25921, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 25937, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 25952, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 25970, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 25992, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 26020, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 26052, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 26075, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 26102, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 26120, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 26143, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 26165, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 26184, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 26207, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 26233, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 26263, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 26288, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 26317, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 26332, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 26347, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 26363, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 26388, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 26428, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 26472, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 26505, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 26535, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 26567, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 26597, 0x00001C02 }, /* GL_SELECT */
- { 26607, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 26635, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 26660, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 26676, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 26703, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 26734, 0x0000150F }, /* GL_SET */
- { 26741, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 26762, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 26777, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 26800, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 26830, 0x00001601 }, /* GL_SHININESS */
- { 26843, 0x00001402 }, /* GL_SHORT */
- { 26852, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 26868, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 26888, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 26907, 0x00001D01 }, /* GL_SMOOTH */
- { 26917, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 26950, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 26977, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 27010, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 27037, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 27054, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 27075, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 27096, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 27111, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 27130, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 27149, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 27166, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 27187, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 27208, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 27223, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 27242, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 27261, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 27278, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 27299, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 27320, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 27335, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 27354, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 27373, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 27393, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 27411, 0x00001202 }, /* GL_SPECULAR */
- { 27423, 0x00002402 }, /* GL_SPHERE_MAP */
- { 27437, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 27452, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 27470, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 27487, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 27501, 0x00008580 }, /* GL_SRC0_RGB */
- { 27513, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 27527, 0x00008581 }, /* GL_SRC1_RGB */
- { 27539, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 27553, 0x00008582 }, /* GL_SRC2_RGB */
- { 27565, 0x00000302 }, /* GL_SRC_ALPHA */
- { 27578, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 27600, 0x00000300 }, /* GL_SRC_COLOR */
- { 27613, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 27631, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 27650, 0x000088E6 }, /* GL_STATIC_COPY */
- { 27665, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 27684, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 27699, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 27718, 0x000088E5 }, /* GL_STATIC_READ */
- { 27733, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 27752, 0x00001802 }, /* GL_STENCIL */
- { 27763, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 27789, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 27805, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 27827, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 27850, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 27866, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 27882, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 27899, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 27922, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 27944, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 27966, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 27988, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 28009, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 28036, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 28063, 0x00000B97 }, /* GL_STENCIL_REF */
- { 28078, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 28094, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 28123, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 28145, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 28166, 0x00000C33 }, /* GL_STEREO */
- { 28176, 0x000088E2 }, /* GL_STREAM_COPY */
- { 28191, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 28210, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 28225, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 28244, 0x000088E1 }, /* GL_STREAM_READ */
- { 28259, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 28278, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 28295, 0x000084E7 }, /* GL_SUBTRACT */
- { 28307, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 28323, 0x00002001 }, /* GL_T */
- { 28328, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 28343, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 28362, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 28378, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 28393, 0x00002A27 }, /* GL_T2F_V3F */
- { 28404, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 28423, 0x00002A28 }, /* GL_T4F_V4F */
- { 28434, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 28457, 0x00001702 }, /* GL_TEXTURE */
- { 28468, 0x000084C0 }, /* GL_TEXTURE0 */
- { 28480, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 28496, 0x000084C1 }, /* GL_TEXTURE1 */
- { 28508, 0x000084CA }, /* GL_TEXTURE10 */
- { 28521, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 28538, 0x000084CB }, /* GL_TEXTURE11 */
- { 28551, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 28568, 0x000084CC }, /* GL_TEXTURE12 */
- { 28581, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 28598, 0x000084CD }, /* GL_TEXTURE13 */
- { 28611, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 28628, 0x000084CE }, /* GL_TEXTURE14 */
- { 28641, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 28658, 0x000084CF }, /* GL_TEXTURE15 */
- { 28671, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 28688, 0x000084D0 }, /* GL_TEXTURE16 */
- { 28701, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 28718, 0x000084D1 }, /* GL_TEXTURE17 */
- { 28731, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 28748, 0x000084D2 }, /* GL_TEXTURE18 */
- { 28761, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 28778, 0x000084D3 }, /* GL_TEXTURE19 */
- { 28791, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 28808, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 28824, 0x000084C2 }, /* GL_TEXTURE2 */
- { 28836, 0x000084D4 }, /* GL_TEXTURE20 */
- { 28849, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 28866, 0x000084D5 }, /* GL_TEXTURE21 */
- { 28879, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 28896, 0x000084D6 }, /* GL_TEXTURE22 */
- { 28909, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 28926, 0x000084D7 }, /* GL_TEXTURE23 */
- { 28939, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 28956, 0x000084D8 }, /* GL_TEXTURE24 */
- { 28969, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 28986, 0x000084D9 }, /* GL_TEXTURE25 */
- { 28999, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 29016, 0x000084DA }, /* GL_TEXTURE26 */
- { 29029, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 29046, 0x000084DB }, /* GL_TEXTURE27 */
- { 29059, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 29076, 0x000084DC }, /* GL_TEXTURE28 */
- { 29089, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 29106, 0x000084DD }, /* GL_TEXTURE29 */
- { 29119, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 29136, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 29152, 0x000084C3 }, /* GL_TEXTURE3 */
- { 29164, 0x000084DE }, /* GL_TEXTURE30 */
- { 29177, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 29194, 0x000084DF }, /* GL_TEXTURE31 */
- { 29207, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 29224, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 29240, 0x000084C4 }, /* GL_TEXTURE4 */
- { 29252, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 29268, 0x000084C5 }, /* GL_TEXTURE5 */
- { 29280, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 29296, 0x000084C6 }, /* GL_TEXTURE6 */
- { 29308, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 29324, 0x000084C7 }, /* GL_TEXTURE7 */
- { 29336, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 29352, 0x000084C8 }, /* GL_TEXTURE8 */
- { 29364, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 29380, 0x000084C9 }, /* GL_TEXTURE9 */
- { 29392, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 29408, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 29422, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 29436, 0x0000806F }, /* GL_TEXTURE_3D */
- { 29450, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 29472, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 29498, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 29520, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 29542, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 29564, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 29586, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 29614, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 29646, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 29679, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 29711, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 29726, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 29747, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 29772, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 29790, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 29814, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 29845, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 29875, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 29905, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 29940, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 29971, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 30009, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 30036, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 30068, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 30102, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 30126, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 30154, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 30178, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 30206, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 30239, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 30263, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 30285, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 30307, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 30333, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 30367, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 30400, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 30437, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 30465, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 30497, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 30520, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 30558, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 30600, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 30631, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 30659, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 30689, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 30717, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 30737, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 30761, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 30792, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 30827, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 30858, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 30893, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 30924, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 30959, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 30990, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 31025, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 31056, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 31091, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 31122, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 31157, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 31174, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 31196, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 31222, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 31237, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 31258, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 31278, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 31304, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 31324, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 31341, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 31358, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 31375, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 31392, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 31417, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 31439, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 31465, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 31483, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 31509, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 31535, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 31565, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 31592, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 31617, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 31637, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 31661, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 31688, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 31715, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 31742, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 31768, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 31798, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 31820, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 31838, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 31868, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 31896, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 31924, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 31952, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 31973, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 31992, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 32014, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 32033, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 32053, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 32078, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 32102, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 32122, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 32146, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 32166, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 32189, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 32214, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 32248, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 32265, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 32283, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 32301, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 32319, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 32339, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 32358, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 32387, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 32404, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 32430, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 32460, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 32492, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 32522, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 32556, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 32572, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 32603, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 32638, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 32666, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 32698, 0x00000004 }, /* GL_TRIANGLES */
- { 32711, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 32727, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 32748, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 32766, 0x00000001 }, /* GL_TRUE */
- { 32774, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 32794, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 32817, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 32837, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 32858, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 32880, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 32902, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 32922, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 32943, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 32960, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 32987, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 33010, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 33026, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 33053, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 33077, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 33108, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 33132, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 33160, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 33178, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 33208, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 33234, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 33264, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 33290, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 33314, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 33342, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 33370, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 33397, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 33429, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 33460, 0x00002A20 }, /* GL_V2F */
- { 33467, 0x00002A21 }, /* GL_V3F */
- { 33474, 0x00001F00 }, /* GL_VENDOR */
- { 33484, 0x00001F02 }, /* GL_VERSION */
- { 33495, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 33511, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 33541, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 33572, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 33607, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 33631, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 33652, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 33675, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 33696, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 33723, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 33751, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 33779, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 33807, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 33835, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 33863, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 33891, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 33918, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 33945, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 33972, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 33999, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 34026, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 34053, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 34080, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 34107, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 34134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 34172, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 34214, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 34249, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 34287, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 34322, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 34354, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 34388, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 34420, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 34440, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 34462, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 34491, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 34512, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 34545, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 34577, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 34608, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 34638, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 34659, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 34686, 0x00000BA2 }, /* GL_VIEWPORT */
- { 34698, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 34714, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 34734, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 34765, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 34800, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 34828, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 34853, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 34880, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 34905, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 34929, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 34948, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 34962, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 34980, 0x00001506 }, /* GL_XOR */
- { 34987, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 35006, 0x00008757 }, /* GL_YCBCR_MESA */
- { 35020, 0x00000000 }, /* GL_ZERO */
- { 35028, 0x00000D16 }, /* GL_ZOOM_X */
- { 35038, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */
+ { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ { 276, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ { 303, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
+ { 321, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
+ { 343, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */
+ { 362, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ { 391, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ { 418, 0x00000104 }, /* GL_ADD */
+ { 425, 0x00008574 }, /* GL_ADD_SIGNED */
+ { 439, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
+ { 457, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
+ { 475, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ { 503, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
+ { 531, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
+ { 550, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ { 576, 0x00001906 }, /* GL_ALPHA */
+ { 585, 0x0000803D }, /* GL_ALPHA12 */
+ { 596, 0x0000803D }, /* GL_ALPHA12_EXT */
+ { 611, 0x0000803E }, /* GL_ALPHA16 */
+ { 622, 0x0000803E }, /* GL_ALPHA16_EXT */
+ { 637, 0x0000803B }, /* GL_ALPHA4 */
+ { 647, 0x0000803B }, /* GL_ALPHA4_EXT */
+ { 661, 0x0000803C }, /* GL_ALPHA8 */
+ { 671, 0x0000803C }, /* GL_ALPHA8_EXT */
+ { 685, 0x00000D1D }, /* GL_ALPHA_BIAS */
+ { 699, 0x00000D55 }, /* GL_ALPHA_BITS */
+ { 713, 0x00000D1C }, /* GL_ALPHA_SCALE */
+ { 728, 0x00000BC0 }, /* GL_ALPHA_TEST */
+ { 742, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
+ { 761, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
+ { 779, 0x00000207 }, /* GL_ALWAYS */
+ { 789, 0x00001200 }, /* GL_AMBIENT */
+ { 800, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
+ { 823, 0x00001501 }, /* GL_AND */
+ { 830, 0x00001504 }, /* GL_AND_INVERTED */
+ { 846, 0x00001502 }, /* GL_AND_REVERSE */
+ { 861, 0x00008892 }, /* GL_ARRAY_BUFFER */
+ { 877, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */
+ { 897, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
+ { 921, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
+ { 949, 0x00008B85 }, /* GL_ATTACHED_SHADERS */
+ { 969, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
+ { 996, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
+ { 1020, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
+ { 1046, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
+ { 1070, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
+ { 1092, 0x00000D80 }, /* GL_AUTO_NORMAL */
+ { 1107, 0x00000409 }, /* GL_AUX0 */
+ { 1115, 0x0000040A }, /* GL_AUX1 */
+ { 1123, 0x0000040B }, /* GL_AUX2 */
+ { 1131, 0x0000040C }, /* GL_AUX3 */
+ { 1139, 0x00000C00 }, /* GL_AUX_BUFFERS */
+ { 1154, 0x00000405 }, /* GL_BACK */
+ { 1162, 0x00000402 }, /* GL_BACK_LEFT */
+ { 1175, 0x00000403 }, /* GL_BACK_RIGHT */
+ { 1189, 0x000080E0 }, /* GL_BGR */
+ { 1196, 0x000080E1 }, /* GL_BGRA */
+ { 1204, 0x00001A00 }, /* GL_BITMAP */
+ { 1214, 0x00000704 }, /* GL_BITMAP_TOKEN */
+ { 1230, 0x00000BE2 }, /* GL_BLEND */
+ { 1239, 0x00008005 }, /* GL_BLEND_COLOR */
+ { 1254, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
+ { 1273, 0x00000BE0 }, /* GL_BLEND_DST */
+ { 1286, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
+ { 1305, 0x000080C8 }, /* GL_BLEND_DST_RGB */
+ { 1322, 0x00008009 }, /* GL_BLEND_EQUATION */
+ { 1340, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */
+ { 1364, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
+ { 1392, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
+ { 1414, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
+ { 1440, 0x00000BE1 }, /* GL_BLEND_SRC */
+ { 1453, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
+ { 1472, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
+ { 1489, 0x00001905 }, /* GL_BLUE */
+ { 1497, 0x00000D1B }, /* GL_BLUE_BIAS */
+ { 1510, 0x00000D54 }, /* GL_BLUE_BITS */
+ { 1523, 0x00000D1A }, /* GL_BLUE_SCALE */
+ { 1537, 0x00008B56 }, /* GL_BOOL */
+ { 1545, 0x00008B56 }, /* GL_BOOL_ARB */
+ { 1557, 0x00008B57 }, /* GL_BOOL_VEC2 */
+ { 1570, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
+ { 1587, 0x00008B58 }, /* GL_BOOL_VEC3 */
+ { 1600, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
+ { 1617, 0x00008B59 }, /* GL_BOOL_VEC4 */
+ { 1630, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
+ { 1647, 0x000088BB }, /* GL_BUFFER_ACCESS */
+ { 1664, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
+ { 1685, 0x000088BC }, /* GL_BUFFER_MAPPED */
+ { 1702, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
+ { 1723, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
+ { 1745, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
+ { 1771, 0x00008764 }, /* GL_BUFFER_SIZE */
+ { 1786, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
+ { 1805, 0x00008765 }, /* GL_BUFFER_USAGE */
+ { 1821, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
+ { 1841, 0x00001400 }, /* GL_BYTE */
+ { 1849, 0x00002A24 }, /* GL_C3F_V3F */
+ { 1860, 0x00002A26 }, /* GL_C4F_N3F_V3F */
+ { 1875, 0x00002A22 }, /* GL_C4UB_V2F */
+ { 1887, 0x00002A23 }, /* GL_C4UB_V3F */
+ { 1899, 0x00000901 }, /* GL_CCW */
+ { 1906, 0x00002900 }, /* GL_CLAMP */
+ { 1915, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
+ { 1934, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
+ { 1957, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
+ { 1981, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
+ { 1998, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
+ { 2020, 0x00001500 }, /* GL_CLEAR */
+ { 2029, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
+ { 2054, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
+ { 2083, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
+ { 2109, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ { 2138, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
+ { 2164, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
+ { 2191, 0x00003000 }, /* GL_CLIP_PLANE0 */
+ { 2206, 0x00003001 }, /* GL_CLIP_PLANE1 */
+ { 2221, 0x00003002 }, /* GL_CLIP_PLANE2 */
+ { 2236, 0x00003003 }, /* GL_CLIP_PLANE3 */
+ { 2251, 0x00003004 }, /* GL_CLIP_PLANE4 */
+ { 2266, 0x00003005 }, /* GL_CLIP_PLANE5 */
+ { 2281, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ { 2314, 0x00000A00 }, /* GL_COEFF */
+ { 2323, 0x00001800 }, /* GL_COLOR */
+ { 2332, 0x00008076 }, /* GL_COLOR_ARRAY */
+ { 2347, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ { 2377, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 2411, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
+ { 2434, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
+ { 2454, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
+ { 2476, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
+ { 2496, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
+ { 2521, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
+ { 2547, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
+ { 2573, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
+ { 2599, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
+ { 2625, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
+ { 2651, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
+ { 2677, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
+ { 2702, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
+ { 2727, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
+ { 2752, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
+ { 2777, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
+ { 2802, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
+ { 2827, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
+ { 2852, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
+ { 2877, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
+ { 2902, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
+ { 2922, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
+ { 2943, 0x00001900 }, /* GL_COLOR_INDEX */
+ { 2958, 0x00001603 }, /* GL_COLOR_INDEXES */
+ { 2975, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
+ { 2993, 0x00000B57 }, /* GL_COLOR_MATERIAL */
+ { 3011, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
+ { 3034, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
+ { 3062, 0x000080B1 }, /* GL_COLOR_MATRIX */
+ { 3078, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
+ { 3098, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ { 3126, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 3158, 0x00008458 }, /* GL_COLOR_SUM */
+ { 3171, 0x00008458 }, /* GL_COLOR_SUM_ARB */
+ { 3188, 0x000080D0 }, /* GL_COLOR_TABLE */
+ { 3203, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ { 3229, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
+ { 3259, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
+ { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
+ { 3309, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
+ { 3333, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
+ { 3358, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
+ { 3387, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
+ { 3416, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
+ { 3438, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
+ { 3464, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
+ { 3490, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
+ { 3516, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
+ { 3546, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
+ { 3576, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ { 3606, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
+ { 3640, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
+ { 3674, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ { 3704, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
+ { 3738, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
+ { 3772, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
+ { 3796, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
+ { 3824, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
+ { 3852, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
+ { 3873, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
+ { 3898, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
+ { 3919, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
+ { 3944, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
+ { 3969, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
+ { 3988, 0x00008570 }, /* GL_COMBINE */
+ { 3999, 0x00008503 }, /* GL_COMBINE4 */
+ { 4011, 0x00008572 }, /* GL_COMBINE_ALPHA */
+ { 4028, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
+ { 4049, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
+ { 4070, 0x00008570 }, /* GL_COMBINE_ARB */
+ { 4085, 0x00008570 }, /* GL_COMBINE_EXT */
+ { 4100, 0x00008571 }, /* GL_COMBINE_RGB */
+ { 4115, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
+ { 4134, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
+ { 4153, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
+ { 4177, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
+ { 4205, 0x00001300 }, /* GL_COMPILE */
+ { 4216, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
+ { 4239, 0x00008B81 }, /* GL_COMPILE_STATUS */
+ { 4257, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
+ { 4277, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
+ { 4301, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
+ { 4325, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
+ { 4353, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
+ { 4377, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ { 4407, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
+ { 4441, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
+ { 4469, 0x000084ED }, /* GL_COMPRESSED_RGB */
+ { 4487, 0x000084EE }, /* GL_COMPRESSED_RGBA */
+ { 4506, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
+ { 4529, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ { 4558, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ { 4591, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ { 4624, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ { 4657, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
+ { 4679, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ { 4707, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ { 4739, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ { 4769, 0x00008576 }, /* GL_CONSTANT */
+ { 4781, 0x00008003 }, /* GL_CONSTANT_ALPHA */
+ { 4799, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
+ { 4821, 0x00008576 }, /* GL_CONSTANT_ARB */
+ { 4837, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
+ { 4861, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
+ { 4883, 0x00008001 }, /* GL_CONSTANT_COLOR */
+ { 4901, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
+ { 4923, 0x00008576 }, /* GL_CONSTANT_EXT */
+ { 4939, 0x00008010 }, /* GL_CONVOLUTION_1D */
+ { 4957, 0x00008011 }, /* GL_CONVOLUTION_2D */
+ { 4975, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
+ { 5003, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
+ { 5034, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
+ { 5061, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
+ { 5092, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
+ { 5119, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
+ { 5150, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
+ { 5178, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
+ { 5210, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
+ { 5232, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
+ { 5258, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
+ { 5280, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
+ { 5306, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
+ { 5327, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
+ { 5352, 0x00008862 }, /* GL_COORD_REPLACE */
+ { 5369, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
+ { 5390, 0x00008862 }, /* GL_COORD_REPLACE_NV */
+ { 5410, 0x00001503 }, /* GL_COPY */
+ { 5418, 0x0000150C }, /* GL_COPY_INVERTED */
+ { 5435, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
+ { 5455, 0x00000B44 }, /* GL_CULL_FACE */
+ { 5468, 0x00000B45 }, /* GL_CULL_FACE_MODE */
+ { 5486, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
+ { 5505, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ { 5537, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ { 5572, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
+ { 5593, 0x00000001 }, /* GL_CURRENT_BIT */
+ { 5608, 0x00000B00 }, /* GL_CURRENT_COLOR */
+ { 5625, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
+ { 5646, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
+ { 5672, 0x00000B01 }, /* GL_CURRENT_INDEX */
+ { 5689, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
+ { 5711, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ { 5739, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
+ { 5760, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ { 5794, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
+ { 5827, 0x00000B02 }, /* GL_CURRENT_NORMAL */
+ { 5845, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ { 5875, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
+ { 5894, 0x00008865 }, /* GL_CURRENT_QUERY */
+ { 5911, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
+ { 5932, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
+ { 5956, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
+ { 5983, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
+ { 6007, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
+ { 6034, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
+ { 6067, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ { 6100, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
+ { 6127, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
+ { 6153, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
+ { 6178, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
+ { 6207, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
+ { 6229, 0x00000900 }, /* GL_CW */
+ { 6235, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
+ { 6256, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
+ { 6277, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
+ { 6297, 0x00002101 }, /* GL_DECAL */
+ { 6306, 0x00001E03 }, /* GL_DECR */
+ { 6314, 0x00008508 }, /* GL_DECR_WRAP */
+ { 6327, 0x00008508 }, /* GL_DECR_WRAP_EXT */
+ { 6344, 0x00008B80 }, /* GL_DELETE_STATUS */
+ { 6361, 0x00001801 }, /* GL_DEPTH */
+ { 6370, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
+ { 6394, 0x00000D1F }, /* GL_DEPTH_BIAS */
+ { 6408, 0x00000D56 }, /* GL_DEPTH_BITS */
+ { 6422, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
+ { 6442, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ { 6467, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
+ { 6487, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
+ { 6505, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
+ { 6526, 0x00001902 }, /* GL_DEPTH_COMPONENT */
+ { 6545, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
+ { 6566, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
+ { 6591, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
+ { 6617, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
+ { 6638, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
+ { 6663, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
+ { 6689, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
+ { 6710, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
+ { 6735, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
+ { 6761, 0x00000B74 }, /* GL_DEPTH_FUNC */
+ { 6775, 0x00000B70 }, /* GL_DEPTH_RANGE */
+ { 6790, 0x00000D1E }, /* GL_DEPTH_SCALE */
+ { 6805, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
+ { 6825, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ { 6853, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ { 6881, 0x00000B71 }, /* GL_DEPTH_TEST */
+ { 6895, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
+ { 6917, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
+ { 6943, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
+ { 6962, 0x00001201 }, /* GL_DIFFUSE */
+ { 6973, 0x00000BD0 }, /* GL_DITHER */
+ { 6983, 0x00000A02 }, /* GL_DOMAIN */
+ { 6993, 0x00001100 }, /* GL_DONT_CARE */
+ { 7006, 0x000086AE }, /* GL_DOT3_RGB */
+ { 7018, 0x000086AF }, /* GL_DOT3_RGBA */
+ { 7031, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
+ { 7048, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
+ { 7065, 0x000086AE }, /* GL_DOT3_RGB_ARB */
+ { 7081, 0x00008740 }, /* GL_DOT3_RGB_EXT */
+ { 7097, 0x0000140A }, /* GL_DOUBLE */
+ { 7107, 0x00000C32 }, /* GL_DOUBLEBUFFER */
+ { 7123, 0x00000C01 }, /* GL_DRAW_BUFFER */
+ { 7138, 0x00008825 }, /* GL_DRAW_BUFFER0 */
+ { 7154, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
+ { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
+ { 7194, 0x00008826 }, /* GL_DRAW_BUFFER1 */
+ { 7210, 0x0000882F }, /* GL_DRAW_BUFFER10 */
+ { 7227, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
+ { 7248, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
+ { 7269, 0x00008830 }, /* GL_DRAW_BUFFER11 */
+ { 7286, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
+ { 7307, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
+ { 7328, 0x00008831 }, /* GL_DRAW_BUFFER12 */
+ { 7345, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
+ { 7366, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
+ { 7387, 0x00008832 }, /* GL_DRAW_BUFFER13 */
+ { 7404, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
+ { 7425, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
+ { 7446, 0x00008833 }, /* GL_DRAW_BUFFER14 */
+ { 7463, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
+ { 7484, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
+ { 7505, 0x00008834 }, /* GL_DRAW_BUFFER15 */
+ { 7522, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
+ { 7543, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
+ { 7564, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
+ { 7584, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
+ { 7604, 0x00008827 }, /* GL_DRAW_BUFFER2 */
+ { 7620, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
+ { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
+ { 7660, 0x00008828 }, /* GL_DRAW_BUFFER3 */
+ { 7676, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
+ { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
+ { 7716, 0x00008829 }, /* GL_DRAW_BUFFER4 */
+ { 7732, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
+ { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
+ { 7772, 0x0000882A }, /* GL_DRAW_BUFFER5 */
+ { 7788, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
+ { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
+ { 7828, 0x0000882B }, /* GL_DRAW_BUFFER6 */
+ { 7844, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
+ { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
+ { 7884, 0x0000882C }, /* GL_DRAW_BUFFER7 */
+ { 7900, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
+ { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
+ { 7940, 0x0000882D }, /* GL_DRAW_BUFFER8 */
+ { 7956, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
+ { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
+ { 7996, 0x0000882E }, /* GL_DRAW_BUFFER9 */
+ { 8012, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
+ { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
+ { 8052, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 8084, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
+ { 8108, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
+ { 8128, 0x00000304 }, /* GL_DST_ALPHA */
+ { 8141, 0x00000306 }, /* GL_DST_COLOR */
+ { 8154, 0x000088EA }, /* GL_DYNAMIC_COPY */
+ { 8170, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
+ { 8190, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
+ { 8206, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
+ { 8226, 0x000088E9 }, /* GL_DYNAMIC_READ */
+ { 8242, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
+ { 8262, 0x00000B43 }, /* GL_EDGE_FLAG */
+ { 8275, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
+ { 8294, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ { 8328, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
+ { 8366, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ { 8393, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ { 8419, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
+ { 8443, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */
+ { 8471, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ { 8503, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
+ { 8539, 0x00001600 }, /* GL_EMISSION */
+ { 8551, 0x00002000 }, /* GL_ENABLE_BIT */
+ { 8565, 0x00000202 }, /* GL_EQUAL */
+ { 8574, 0x00001509 }, /* GL_EQUIV */
+ { 8583, 0x00010000 }, /* GL_EVAL_BIT */
+ { 8595, 0x00000800 }, /* GL_EXP */
+ { 8602, 0x00000801 }, /* GL_EXP2 */
+ { 8610, 0x00001F03 }, /* GL_EXTENSIONS */
+ { 8624, 0x00002400 }, /* GL_EYE_LINEAR */
+ { 8638, 0x00002502 }, /* GL_EYE_PLANE */
+ { 8651, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ { 8676, 0x0000855B }, /* GL_EYE_RADIAL_NV */
+ { 8693, 0x00000000 }, /* GL_FALSE */
+ { 8702, 0x00001101 }, /* GL_FASTEST */
+ { 8713, 0x00001C01 }, /* GL_FEEDBACK */
+ { 8725, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
+ { 8752, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
+ { 8776, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
+ { 8800, 0x00001B02 }, /* GL_FILL */
+ { 8808, 0x00001D00 }, /* GL_FLAT */
+ { 8816, 0x00001406 }, /* GL_FLOAT */
+ { 8825, 0x00008B5A }, /* GL_FLOAT_MAT2 */
+ { 8839, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
+ { 8857, 0x00008B5B }, /* GL_FLOAT_MAT3 */
+ { 8871, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
+ { 8889, 0x00008B5C }, /* GL_FLOAT_MAT4 */
+ { 8903, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
+ { 8921, 0x00008B50 }, /* GL_FLOAT_VEC2 */
+ { 8935, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
+ { 8953, 0x00008B51 }, /* GL_FLOAT_VEC3 */
+ { 8967, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
+ { 8985, 0x00008B52 }, /* GL_FLOAT_VEC4 */
+ { 8999, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
+ { 9017, 0x00000B60 }, /* GL_FOG */
+ { 9024, 0x00000080 }, /* GL_FOG_BIT */
+ { 9035, 0x00000B66 }, /* GL_FOG_COLOR */
+ { 9048, 0x00008451 }, /* GL_FOG_COORD */
+ { 9061, 0x00008451 }, /* GL_FOG_COORDINATE */
+ { 9079, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
+ { 9103, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ { 9142, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
+ { 9185, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ { 9217, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ { 9248, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ { 9277, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
+ { 9302, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
+ { 9321, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
+ { 9355, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
+ { 9382, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
+ { 9408, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
+ { 9432, 0x00008450 }, /* GL_FOG_COORD_SRC */
+ { 9449, 0x00000B62 }, /* GL_FOG_DENSITY */
+ { 9464, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
+ { 9488, 0x00000B64 }, /* GL_FOG_END */
+ { 9499, 0x00000C54 }, /* GL_FOG_HINT */
+ { 9511, 0x00000B61 }, /* GL_FOG_INDEX */
+ { 9524, 0x00000B65 }, /* GL_FOG_MODE */
+ { 9536, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
+ { 9555, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
+ { 9580, 0x00000B63 }, /* GL_FOG_START */
+ { 9593, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
+ { 9611, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
+ { 9635, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
+ { 9654, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
+ { 9677, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ { 9712, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ { 9754, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ { 9796, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ { 9845, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ { 9897, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ { 9941, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
+ { 9968, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ { 9996, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
+ { 10015, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ { 10056, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ { 10097, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ { 10139, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ { 10190, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ { 10228, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ { 10277, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ { 10319, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ { 10351, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ { 10382, 0x00000404 }, /* GL_FRONT */
+ { 10391, 0x00000408 }, /* GL_FRONT_AND_BACK */
+ { 10409, 0x00000B46 }, /* GL_FRONT_FACE */
+ { 10423, 0x00000400 }, /* GL_FRONT_LEFT */
+ { 10437, 0x00000401 }, /* GL_FRONT_RIGHT */
+ { 10452, 0x00008006 }, /* GL_FUNC_ADD */
+ { 10464, 0x00008006 }, /* GL_FUNC_ADD_EXT */
+ { 10480, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
+ { 10505, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
+ { 10534, 0x0000800A }, /* GL_FUNC_SUBTRACT */
+ { 10551, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
+ { 10572, 0x00008191 }, /* GL_GENERATE_MIPMAP */
+ { 10591, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
+ { 10615, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
+ { 10644, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
+ { 10668, 0x00000206 }, /* GL_GEQUAL */
+ { 10678, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */
+ { 10703, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */
+ { 10731, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ { 10765, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */
+ { 10787, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ { 10815, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ { 10852, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */
+ { 10871, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */
+ { 10890, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */
+ { 10909, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */
+ { 10928, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */
+ { 10947, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */
+ { 10966, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */
+ { 10990, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ { 11022, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ { 11048, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 11082, 0x00008C46 }, /* GL_GL_SLUMINANCE */
+ { 11099, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */
+ { 11117, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ { 11142, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */
+ { 11165, 0x00008C40 }, /* GL_GL_SRGB */
+ { 11176, 0x00008C41 }, /* GL_GL_SRGB8 */
+ { 11188, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */
+ { 11207, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */
+ { 11224, 0x00000204 }, /* GL_GREATER */
+ { 11235, 0x00001904 }, /* GL_GREEN */
+ { 11244, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 11258, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 11272, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 11287, 0x00008000 }, /* GL_HINT_BIT */
+ { 11299, 0x00008024 }, /* GL_HISTOGRAM */
+ { 11312, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 11336, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 11364, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 11387, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 11414, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 11431, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 11451, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 11475, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 11499, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 11527, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 11555, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 11587, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 11609, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 11635, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 11653, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 11675, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 11694, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 11717, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 11732, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 11752, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 11792, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 11830, 0x00001E02 }, /* GL_INCR */
+ { 11838, 0x00008507 }, /* GL_INCR_WRAP */
+ { 11851, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 11868, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 11883, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 11913, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 11947, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 11970, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 11992, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 12012, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 12026, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 12047, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 12065, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 12079, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 12095, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 12110, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 12129, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
+ { 12148, 0x00001404 }, /* GL_INT */
+ { 12155, 0x00008049 }, /* GL_INTENSITY */
+ { 12168, 0x0000804C }, /* GL_INTENSITY12 */
+ { 12183, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 12202, 0x0000804D }, /* GL_INTENSITY16 */
+ { 12217, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 12236, 0x0000804A }, /* GL_INTENSITY4 */
+ { 12250, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 12268, 0x0000804B }, /* GL_INTENSITY8 */
+ { 12282, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 12300, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 12317, 0x00008575 }, /* GL_INTERPOLATE */
+ { 12332, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 12351, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 12370, 0x00008B53 }, /* GL_INT_VEC2 */
+ { 12382, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 12398, 0x00008B54 }, /* GL_INT_VEC3 */
+ { 12410, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 12426, 0x00008B55 }, /* GL_INT_VEC4 */
+ { 12438, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 12454, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 12470, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 12507, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 12528, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 12545, 0x0000862B }, /* GL_INVERSE_NV */
+ { 12559, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 12583, 0x0000150A }, /* GL_INVERT */
+ { 12593, 0x00001E00 }, /* GL_KEEP */
+ { 12601, 0x00000406 }, /* GL_LEFT */
+ { 12609, 0x00000203 }, /* GL_LEQUAL */
+ { 12619, 0x00000201 }, /* GL_LESS */
+ { 12627, 0x00004000 }, /* GL_LIGHT0 */
+ { 12637, 0x00004001 }, /* GL_LIGHT1 */
+ { 12647, 0x00004002 }, /* GL_LIGHT2 */
+ { 12657, 0x00004003 }, /* GL_LIGHT3 */
+ { 12667, 0x00004004 }, /* GL_LIGHT4 */
+ { 12677, 0x00004005 }, /* GL_LIGHT5 */
+ { 12687, 0x00004006 }, /* GL_LIGHT6 */
+ { 12697, 0x00004007 }, /* GL_LIGHT7 */
+ { 12707, 0x00000B50 }, /* GL_LIGHTING */
+ { 12719, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 12735, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 12758, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 12787, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 12820, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 12848, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 12872, 0x00001B01 }, /* GL_LINE */
+ { 12880, 0x00002601 }, /* GL_LINEAR */
+ { 12890, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 12912, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 12942, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 12973, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 12997, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 13022, 0x00000001 }, /* GL_LINES */
+ { 13031, 0x00000004 }, /* GL_LINE_BIT */
+ { 13043, 0x00000002 }, /* GL_LINE_LOOP */
+ { 13056, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 13076, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 13091, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 13111, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 13127, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 13151, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 13174, 0x00000003 }, /* GL_LINE_STRIP */
+ { 13188, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 13202, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 13216, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 13242, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 13262, 0x00008B82 }, /* GL_LINK_STATUS */
+ { 13277, 0x00000B32 }, /* GL_LIST_BASE */
+ { 13290, 0x00020000 }, /* GL_LIST_BIT */
+ { 13302, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 13316, 0x00000B30 }, /* GL_LIST_MODE */
+ { 13329, 0x00000101 }, /* GL_LOAD */
+ { 13337, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 13349, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 13366, 0x00008CA1 }, /* GL_LOWER_LEFT */
+ { 13380, 0x00001909 }, /* GL_LUMINANCE */
+ { 13393, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 13408, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 13431, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 13458, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 13480, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 13506, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 13525, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 13540, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 13563, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 13590, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 13609, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 13623, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 13644, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 13669, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 13687, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 13708, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 13733, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 13747, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 13768, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 13793, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 13811, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 13830, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 13846, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 13866, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 13888, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 13902, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 13917, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 13941, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 13965, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 13989, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 14013, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 14030, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 14047, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 14075, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 14104, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 14133, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 14162, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 14191, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 14220, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 14249, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 14277, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 14305, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 14333, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 14361, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 14389, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 14417, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 14445, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 14473, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 14501, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 14517, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 14537, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 14559, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 14573, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 14588, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 14612, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 14636, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 14660, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 14684, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 14701, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 14718, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 14746, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 14775, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 14804, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 14833, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 14862, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 14891, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 14920, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 14948, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 14976, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 15004, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 15032, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 15060, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 15088, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 15116, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 15144, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 15172, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 15185, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 15200, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 15215, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 15229, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 15245, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 15261, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 15277, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 15293, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 15309, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 15325, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 15341, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 15357, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 15373, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 15389, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 15404, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 15418, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 15434, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 15450, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 15466, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 15482, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 15498, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 15514, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 15530, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 15546, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 15562, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 15578, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 15593, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 15607, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 15623, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 15639, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 15654, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 15668, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 15683, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 15697, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 15712, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 15726, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 15741, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 15755, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 15770, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 15784, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 15799, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 15814, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 15840, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 15874, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 15905, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 15938, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 15969, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 15984, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 16006, 0x00008008 }, /* GL_MAX */
+ { 16013, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 16036, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 16062, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 16095, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 16121, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 16155, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 16174, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 16203, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 16235, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 16271, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ { 16307, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 16347, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 16373, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 16403, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 16428, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 16457, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 16486, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 16519, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
+ { 16539, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 16563, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 16587, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 16611, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 16636, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 16654, 0x00008008 }, /* GL_MAX_EXT */
+ { 16665, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ { 16700, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 16739, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 16753, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 16773, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 16811, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 16840, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 16864, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 16892, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 16915, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 16952, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 16988, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 17015, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 17044, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 17078, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 17114, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 17141, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 17173, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 17209, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 17238, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 17267, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 17295, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 17333, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 17377, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 17420, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 17454, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 17493, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 17530, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 17568, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 17611, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 17654, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 17684, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 17715, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 17751, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 17787, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 17817, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 17851, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 17884, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 17913, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 17933, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 17957, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
+ { 17979, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 18005, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ { 18032, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 18063, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 18087, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 18121, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 18141, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 18168, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 18189, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 18214, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 18239, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 18274, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
+ { 18296, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 18322, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
+ { 18344, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 18370, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ { 18404, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 18442, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ { 18475, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 18512, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 18536, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 18557, 0x00008007 }, /* GL_MIN */
+ { 18564, 0x0000802E }, /* GL_MINMAX */
+ { 18574, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 18588, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 18605, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 18626, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 18641, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 18660, 0x00008007 }, /* GL_MIN_EXT */
+ { 18671, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 18690, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 18713, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 18736, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 18756, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 18776, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 18806, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 18834, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 18862, 0x00001700 }, /* GL_MODELVIEW */
+ { 18875, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 18893, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 18912, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 18931, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 18950, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 18969, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 18988, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 19007, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 19026, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 19045, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 19064, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 19083, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 19101, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 19120, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 19139, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 19158, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 19177, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 19196, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 19215, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 19234, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 19253, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 19272, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 19291, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 19309, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 19328, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 19347, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 19365, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 19383, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 19401, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 19419, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 19437, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 19455, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 19473, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 19493, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 19520, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 19545, 0x00002100 }, /* GL_MODULATE */
+ { 19557, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 19577, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 19604, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 19629, 0x00000103 }, /* GL_MULT */
+ { 19637, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 19652, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 19672, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 19691, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 19710, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 19734, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 19757, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 19787, 0x00002A25 }, /* GL_N3F_V3F */
+ { 19798, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 19818, 0x0000150E }, /* GL_NAND */
+ { 19826, 0x00002600 }, /* GL_NEAREST */
+ { 19837, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 19868, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 19900, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 19925, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 19951, 0x00000200 }, /* GL_NEVER */
+ { 19960, 0x00001102 }, /* GL_NICEST */
+ { 19970, 0x00000000 }, /* GL_NONE */
+ { 19978, 0x00001505 }, /* GL_NOOP */
+ { 19986, 0x00001508 }, /* GL_NOR */
+ { 19993, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 20006, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 20022, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 20053, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 20088, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 20112, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 20135, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 20156, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 20170, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 20188, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 20205, 0x00000205 }, /* GL_NOTEQUAL */
+ { 20217, 0x00000000 }, /* GL_NO_ERROR */
+ { 20229, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 20263, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 20301, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 20333, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 20375, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 20405, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 20445, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 20476, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 20505, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 20533, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 20563, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 20580, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 20606, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 20622, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 20657, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 20679, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 20698, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 20728, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 20749, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 20777, 0x00000001 }, /* GL_ONE */
+ { 20784, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 20812, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 20844, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 20872, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 20904, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 20927, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 20950, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 20973, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 20996, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 21014, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 21036, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 21058, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 21074, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 21094, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 21114, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 21132, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 21154, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 21176, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 21192, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 21212, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 21232, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 21250, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 21272, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 21294, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 21310, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 21330, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 21350, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 21371, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 21390, 0x00001507 }, /* GL_OR */
+ { 21396, 0x00000A01 }, /* GL_ORDER */
+ { 21405, 0x0000150D }, /* GL_OR_INVERTED */
+ { 21420, 0x0000150B }, /* GL_OR_REVERSE */
+ { 21434, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 21451, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 21469, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 21490, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 21510, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 21528, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 21547, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 21567, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 21587, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 21605, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 21624, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 21649, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 21673, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 21694, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 21716, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 21738, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 21763, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 21787, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 21808, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 21830, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 21852, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 21874, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 21905, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 21925, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 21950, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 21970, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 21995, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 22015, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 22040, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 22060, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 22085, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 22105, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 22130, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 22150, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 22175, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 22195, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 22220, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 22240, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 22265, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 22285, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 22310, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 22330, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 22355, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 22373, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 22406, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 22431, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 22466, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 22493, 0x00001B00 }, /* GL_POINT */
+ { 22502, 0x00000000 }, /* GL_POINTS */
+ { 22512, 0x00000002 }, /* GL_POINT_BIT */
+ { 22525, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 22555, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 22589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 22623, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 22658, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 22687, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 22720, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 22753, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 22787, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 22801, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 22827, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 22845, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 22867, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 22889, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 22912, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 22930, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 22952, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 22974, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 22997, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 23017, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 23033, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 23054, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 23070, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 23090, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 23119, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 23138, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 23164, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 23179, 0x00000009 }, /* GL_POLYGON */
+ { 23190, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 23205, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 23221, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 23244, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 23269, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 23292, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 23315, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 23339, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 23363, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 23381, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 23404, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 23423, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 23446, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 23463, 0x00001203 }, /* GL_POSITION */
+ { 23475, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 23507, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 23543, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 23576, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 23613, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 23644, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 23679, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 23711, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 23747, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 23780, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 23812, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 23848, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 23881, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 23918, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 23948, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 23982, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 24013, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 24048, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 24079, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 24114, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 24146, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 24182, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 24212, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 24246, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 24277, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 24312, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 24344, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 24375, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 24410, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 24442, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 24478, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 24507, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 24540, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 24570, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 24604, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 24643, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 24676, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 24716, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 24750, 0x00008578 }, /* GL_PREVIOUS */
+ { 24762, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 24778, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 24794, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 24811, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 24832, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 24853, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 24886, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 24918, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 24941, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 24964, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 24994, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 25023, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 25051, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 25073, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 25101, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 25129, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 25151, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 25172, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 25212, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 25251, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 25281, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 25316, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 25349, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 25383, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 25422, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 25461, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 25483, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 25509, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 25533, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 25556, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 25578, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 25599, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 25620, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 25647, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 25679, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 25711, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 25746, 0x00001701 }, /* GL_PROJECTION */
+ { 25760, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 25781, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 25807, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 25828, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 25847, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 25870, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 25909, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 25947, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 25967, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 25991, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 26011, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 26035, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 26055, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 26088, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 26114, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 26144, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 26175, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 26205, 0x00002003 }, /* GL_Q */
+ { 26210, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 26235, 0x00000007 }, /* GL_QUADS */
+ { 26244, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 26261, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 26275, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 26297, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 26323, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 26339, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 26359, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 26385, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 26415, 0x00002002 }, /* GL_R */
+ { 26420, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 26432, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 26465, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 26480, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 26512, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 26536, 0x000088B8 }, /* GL_READ_ONLY */
+ { 26549, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 26566, 0x000088BA }, /* GL_READ_WRITE */
+ { 26580, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 26598, 0x00001903 }, /* GL_RED */
+ { 26605, 0x00008016 }, /* GL_REDUCE */
+ { 26615, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 26629, 0x00000D15 }, /* GL_RED_BIAS */
+ { 26641, 0x00000D52 }, /* GL_RED_BITS */
+ { 26653, 0x00000D14 }, /* GL_RED_SCALE */
+ { 26666, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 26684, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 26706, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 26727, 0x00001C00 }, /* GL_RENDER */
+ { 26737, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 26765, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 26785, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 26812, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 26848, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 26874, 0x00001F01 }, /* GL_RENDERER */
+ { 26886, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 26901, 0x00002901 }, /* GL_REPEAT */
+ { 26911, 0x00001E01 }, /* GL_REPLACE */
+ { 26922, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 26937, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 26960, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 26978, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 27000, 0x00000102 }, /* GL_RETURN */
+ { 27010, 0x00001907 }, /* GL_RGB */
+ { 27017, 0x00008052 }, /* GL_RGB10 */
+ { 27026, 0x00008059 }, /* GL_RGB10_A2 */
+ { 27038, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 27054, 0x00008052 }, /* GL_RGB10_EXT */
+ { 27067, 0x00008053 }, /* GL_RGB12 */
+ { 27076, 0x00008053 }, /* GL_RGB12_EXT */
+ { 27089, 0x00008054 }, /* GL_RGB16 */
+ { 27098, 0x00008054 }, /* GL_RGB16_EXT */
+ { 27111, 0x0000804E }, /* GL_RGB2_EXT */
+ { 27123, 0x0000804F }, /* GL_RGB4 */
+ { 27131, 0x0000804F }, /* GL_RGB4_EXT */
+ { 27143, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 27156, 0x00008050 }, /* GL_RGB5 */
+ { 27164, 0x00008057 }, /* GL_RGB5_A1 */
+ { 27175, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 27190, 0x00008050 }, /* GL_RGB5_EXT */
+ { 27202, 0x00008051 }, /* GL_RGB8 */
+ { 27210, 0x00008051 }, /* GL_RGB8_EXT */
+ { 27222, 0x00001908 }, /* GL_RGBA */
+ { 27230, 0x0000805A }, /* GL_RGBA12 */
+ { 27240, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 27254, 0x0000805B }, /* GL_RGBA16 */
+ { 27264, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 27278, 0x00008055 }, /* GL_RGBA2 */
+ { 27287, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 27300, 0x00008056 }, /* GL_RGBA4 */
+ { 27309, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 27328, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 27341, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 27355, 0x00008058 }, /* GL_RGBA8 */
+ { 27364, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 27377, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 27395, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 27408, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 27421, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 27433, 0x00008573 }, /* GL_RGB_SCALE */
+ { 27446, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 27463, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 27480, 0x00000407 }, /* GL_RIGHT */
+ { 27489, 0x00002000 }, /* GL_S */
+ { 27494, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 27508, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 27529, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 27543, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 27564, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 27578, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 27594, 0x000080A9 }, /* GL_SAMPLES */
+ { 27605, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 27621, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 27636, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 27654, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 27676, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 27704, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 27736, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 27759, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 27786, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 27804, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 27827, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 27849, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 27868, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 27891, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 27917, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 27947, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 27972, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 28001, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 28016, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 28031, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 28047, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 28072, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 28112, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 28156, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 28189, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 28219, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 28251, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 28281, 0x00001C02 }, /* GL_SELECT */
+ { 28291, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 28319, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 28344, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 28360, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 28387, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 28418, 0x0000150F }, /* GL_SET */
+ { 28425, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 28446, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 28470, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 28485, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 28500, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 28528, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 28551, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 28581, 0x00001601 }, /* GL_SHININESS */
+ { 28594, 0x00001402 }, /* GL_SHORT */
+ { 28603, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 28619, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 28639, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 28658, 0x00001D01 }, /* GL_SMOOTH */
+ { 28668, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 28701, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 28728, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 28761, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 28788, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 28805, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 28826, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 28847, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 28862, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 28881, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 28900, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 28917, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 28938, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 28959, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 28974, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 28993, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 29012, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 29029, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 29050, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 29071, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 29086, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 29105, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 29124, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 29144, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 29162, 0x00001202 }, /* GL_SPECULAR */
+ { 29174, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 29188, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 29203, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 29221, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 29238, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 29252, 0x00008580 }, /* GL_SRC0_RGB */
+ { 29264, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 29278, 0x00008581 }, /* GL_SRC1_RGB */
+ { 29290, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 29304, 0x00008582 }, /* GL_SRC2_RGB */
+ { 29316, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 29329, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 29351, 0x00000300 }, /* GL_SRC_COLOR */
+ { 29364, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 29382, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 29401, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 29416, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 29435, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 29450, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 29469, 0x000088E5 }, /* GL_STATIC_READ */
+ { 29484, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 29503, 0x00001802 }, /* GL_STENCIL */
+ { 29514, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 29540, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 29561, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 29582, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 29614, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 29646, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 29666, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 29693, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 29719, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 29735, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 29757, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 29780, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 29796, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 29812, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 29829, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 29852, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 29874, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 29896, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 29918, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 29939, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 29966, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 29993, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 30008, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 30024, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 30053, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 30075, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 30096, 0x00000C33 }, /* GL_STEREO */
+ { 30106, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 30121, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 30140, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 30155, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 30174, 0x000088E1 }, /* GL_STREAM_READ */
+ { 30189, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 30208, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 30225, 0x000084E7 }, /* GL_SUBTRACT */
+ { 30237, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 30253, 0x00002001 }, /* GL_T */
+ { 30258, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 30273, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 30292, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 30308, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 30323, 0x00002A27 }, /* GL_T2F_V3F */
+ { 30334, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 30353, 0x00002A28 }, /* GL_T4F_V4F */
+ { 30364, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 30387, 0x00001702 }, /* GL_TEXTURE */
+ { 30398, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 30410, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 30426, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 30438, 0x000084CA }, /* GL_TEXTURE10 */
+ { 30451, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 30468, 0x000084CB }, /* GL_TEXTURE11 */
+ { 30481, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 30498, 0x000084CC }, /* GL_TEXTURE12 */
+ { 30511, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 30528, 0x000084CD }, /* GL_TEXTURE13 */
+ { 30541, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 30558, 0x000084CE }, /* GL_TEXTURE14 */
+ { 30571, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 30588, 0x000084CF }, /* GL_TEXTURE15 */
+ { 30601, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 30618, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 30631, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 30648, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 30661, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 30678, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 30691, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 30708, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 30721, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 30738, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 30754, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 30766, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 30779, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 30796, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 30809, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 30826, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 30839, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 30856, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 30869, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 30886, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 30899, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 30916, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 30929, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 30946, 0x000084DA }, /* GL_TEXTURE26 */
+ { 30959, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 30976, 0x000084DB }, /* GL_TEXTURE27 */
+ { 30989, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 31006, 0x000084DC }, /* GL_TEXTURE28 */
+ { 31019, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 31036, 0x000084DD }, /* GL_TEXTURE29 */
+ { 31049, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 31066, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 31082, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 31094, 0x000084DE }, /* GL_TEXTURE30 */
+ { 31107, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 31124, 0x000084DF }, /* GL_TEXTURE31 */
+ { 31137, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 31154, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 31170, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 31182, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 31198, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 31210, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 31226, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 31238, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 31254, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 31266, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 31282, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 31294, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 31310, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 31322, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 31338, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 31352, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 31366, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 31380, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 31402, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 31428, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 31450, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 31472, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 31494, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 31516, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 31544, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 31576, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 31609, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 31641, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 31656, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 31677, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 31702, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 31720, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 31744, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 31775, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 31805, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 31835, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 31870, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 31901, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 31939, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 31966, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 31998, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 32032, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 32056, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 32084, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 32108, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 32136, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 32169, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 32193, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 32215, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 32237, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 32263, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 32297, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 32330, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 32367, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 32395, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 32427, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 32450, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 32488, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 32530, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 32561, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 32589, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 32619, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 32647, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 32667, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 32691, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 32722, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 32757, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 32788, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 32823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 32854, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 32889, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 32920, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 32955, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 32986, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 33021, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 33052, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 33087, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 33104, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 33126, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 33152, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 33167, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 33188, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 33208, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 33234, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 33254, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 33271, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 33288, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 33305, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 33322, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 33347, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 33369, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 33395, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 33413, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 33439, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 33465, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 33495, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 33522, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 33547, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 33567, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 33591, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 33618, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 33645, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 33672, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 33698, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 33728, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 33750, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 33768, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 33798, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 33826, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 33854, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 33882, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 33903, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 33922, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 33944, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 33963, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 33983, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 34008, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 34032, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 34052, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 34076, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 34096, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 34119, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 34144, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 34178, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 34195, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 34213, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 34231, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 34249, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 34269, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 34288, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 34317, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 34334, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 34360, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 34390, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 34422, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 34452, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 34486, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 34502, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 34533, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 34568, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 34596, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 34628, 0x00000004 }, /* GL_TRIANGLES */
+ { 34641, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 34657, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 34678, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 34696, 0x00000001 }, /* GL_TRUE */
+ { 34704, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 34724, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 34747, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 34767, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 34788, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 34810, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 34832, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 34852, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 34873, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 34890, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 34917, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 34940, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 34956, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 34983, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 35007, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 35038, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 35062, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 35090, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 35108, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 35138, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 35164, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 35194, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 35220, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 35244, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 35272, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 35300, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 35327, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 35359, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 35390, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 35404, 0x00002A20 }, /* GL_V2F */
+ { 35411, 0x00002A21 }, /* GL_V3F */
+ { 35418, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 35437, 0x00001F00 }, /* GL_VENDOR */
+ { 35447, 0x00001F02 }, /* GL_VERSION */
+ { 35458, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 35474, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 35504, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 35535, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 35570, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 35594, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 35615, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 35638, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 35659, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 35686, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 35714, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 35742, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 35770, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 35798, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 35826, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 35854, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 35881, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 35908, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 35935, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 35962, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 35989, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 36016, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 36043, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 36070, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 36097, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 36135, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 36177, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 36208, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 36243, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 36277, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 36315, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 36346, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 36381, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 36409, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 36441, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 36471, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 36505, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 36533, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 36565, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 36585, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 36607, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 36636, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 36657, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 36686, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 36719, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 36751, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 36778, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 36809, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 36839, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 36856, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 36877, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 36904, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 36916, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 36932, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 36952, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 36983, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 37018, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 37046, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 37071, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 37098, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 37123, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 37147, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 37166, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 37180, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 37198, 0x00001506 }, /* GL_XOR */
+ { 37205, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 37224, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 37238, 0x00000000 }, /* GL_ZERO */
+ { 37246, 0x00000D16 }, /* GL_ZOOM_X */
+ { 37256, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1240] =
+static const unsigned reduced_enums[1277] =
{
- 404, /* GL_FALSE */
- 576, /* GL_LINES */
- 578, /* GL_LINE_LOOP */
- 585, /* GL_LINE_STRIP */
- 1533, /* GL_TRIANGLES */
- 1536, /* GL_TRIANGLE_STRIP */
- 1534, /* GL_TRIANGLE_FAN */
- 1127, /* GL_QUADS */
- 1129, /* GL_QUAD_STRIP */
- 1017, /* GL_POLYGON */
- 1029, /* GL_POLYGON_STIPPLE_BIT */
- 983, /* GL_PIXEL_MODE_BIT */
- 563, /* GL_LIGHTING_BIT */
- 420, /* GL_FOG_BIT */
+ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ 435, /* GL_FALSE */
+ 643, /* GL_LINES */
+ 645, /* GL_LINE_LOOP */
+ 652, /* GL_LINE_STRIP */
+ 1628, /* GL_TRIANGLES */
+ 1631, /* GL_TRIANGLE_STRIP */
+ 1629, /* GL_TRIANGLE_FAN */
+ 1206, /* GL_QUADS */
+ 1208, /* GL_QUAD_STRIP */
+ 1096, /* GL_POLYGON */
+ 1108, /* GL_POLYGON_STIPPLE_BIT */
+ 1061, /* GL_PIXEL_MODE_BIT */
+ 630, /* GL_LIGHTING_BIT */
+ 457, /* GL_FOG_BIT */
8, /* GL_ACCUM */
- 594, /* GL_LOAD */
- 1169, /* GL_RETURN */
- 856, /* GL_MULT */
- 19, /* GL_ADD */
- 872, /* GL_NEVER */
- 553, /* GL_LESS */
- 394, /* GL_EQUAL */
- 552, /* GL_LEQUAL */
- 482, /* GL_GREATER */
- 887, /* GL_NOTEQUAL */
- 481, /* GL_GEQUAL */
- 42, /* GL_ALWAYS */
- 1293, /* GL_SRC_COLOR */
- 916, /* GL_ONE_MINUS_SRC_COLOR */
- 1291, /* GL_SRC_ALPHA */
- 915, /* GL_ONE_MINUS_SRC_ALPHA */
- 374, /* GL_DST_ALPHA */
- 913, /* GL_ONE_MINUS_DST_ALPHA */
- 375, /* GL_DST_COLOR */
- 914, /* GL_ONE_MINUS_DST_COLOR */
- 1292, /* GL_SRC_ALPHA_SATURATE */
- 469, /* GL_FRONT_LEFT */
- 470, /* GL_FRONT_RIGHT */
- 64, /* GL_BACK_LEFT */
- 65, /* GL_BACK_RIGHT */
- 466, /* GL_FRONT */
- 63, /* GL_BACK */
- 551, /* GL_LEFT */
- 1209, /* GL_RIGHT */
- 467, /* GL_FRONT_AND_BACK */
- 58, /* GL_AUX0 */
- 59, /* GL_AUX1 */
- 60, /* GL_AUX2 */
- 61, /* GL_AUX3 */
- 543, /* GL_INVALID_ENUM */
- 546, /* GL_INVALID_VALUE */
- 545, /* GL_INVALID_OPERATION */
- 1294, /* GL_STACK_OVERFLOW */
- 1295, /* GL_STACK_UNDERFLOW */
- 941, /* GL_OUT_OF_MEMORY */
- 544, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ 662, /* GL_LOAD */
+ 1248, /* GL_RETURN */
+ 934, /* GL_MULT */
+ 23, /* GL_ADD */
+ 950, /* GL_NEVER */
+ 620, /* GL_LESS */
+ 425, /* GL_EQUAL */
+ 619, /* GL_LEQUAL */
+ 545, /* GL_GREATER */
+ 965, /* GL_NOTEQUAL */
+ 520, /* GL_GEQUAL */
+ 46, /* GL_ALWAYS */
+ 1381, /* GL_SRC_COLOR */
+ 994, /* GL_ONE_MINUS_SRC_COLOR */
+ 1379, /* GL_SRC_ALPHA */
+ 993, /* GL_ONE_MINUS_SRC_ALPHA */
+ 405, /* GL_DST_ALPHA */
+ 991, /* GL_ONE_MINUS_DST_ALPHA */
+ 406, /* GL_DST_COLOR */
+ 992, /* GL_ONE_MINUS_DST_COLOR */
+ 1380, /* GL_SRC_ALPHA_SATURATE */
+ 508, /* GL_FRONT_LEFT */
+ 509, /* GL_FRONT_RIGHT */
+ 69, /* GL_BACK_LEFT */
+ 70, /* GL_BACK_RIGHT */
+ 505, /* GL_FRONT */
+ 68, /* GL_BACK */
+ 618, /* GL_LEFT */
+ 1288, /* GL_RIGHT */
+ 506, /* GL_FRONT_AND_BACK */
+ 63, /* GL_AUX0 */
+ 64, /* GL_AUX1 */
+ 65, /* GL_AUX2 */
+ 66, /* GL_AUX3 */
+ 610, /* GL_INVALID_ENUM */
+ 613, /* GL_INVALID_VALUE */
+ 612, /* GL_INVALID_OPERATION */
+ 1382, /* GL_STACK_OVERFLOW */
+ 1383, /* GL_STACK_UNDERFLOW */
+ 1019, /* GL_OUT_OF_MEMORY */
+ 611, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 961, /* GL_PASS_THROUGH_TOKEN */
- 1016, /* GL_POINT_TOKEN */
- 586, /* GL_LINE_TOKEN */
- 1030, /* GL_POLYGON_TOKEN */
- 69, /* GL_BITMAP_TOKEN */
- 373, /* GL_DRAW_PIXEL_TOKEN */
- 258, /* GL_COPY_PIXEL_TOKEN */
- 579, /* GL_LINE_RESET_TOKEN */
- 397, /* GL_EXP */
- 398, /* GL_EXP2 */
- 289, /* GL_CW */
- 106, /* GL_CCW */
- 127, /* GL_COEFF */
- 938, /* GL_ORDER */
- 328, /* GL_DOMAIN */
- 266, /* GL_CURRENT_COLOR */
- 269, /* GL_CURRENT_INDEX */
- 275, /* GL_CURRENT_NORMAL */
- 286, /* GL_CURRENT_TEXTURE_COORDS */
- 279, /* GL_CURRENT_RASTER_COLOR */
- 281, /* GL_CURRENT_RASTER_INDEX */
- 284, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- 282, /* GL_CURRENT_RASTER_POSITION */
- 283, /* GL_CURRENT_RASTER_POSITION_VALID */
- 280, /* GL_CURRENT_RASTER_DISTANCE */
- 1010, /* GL_POINT_SMOOTH */
- 999, /* GL_POINT_SIZE */
- 1009, /* GL_POINT_SIZE_RANGE */
- 1000, /* GL_POINT_SIZE_GRANULARITY */
- 580, /* GL_LINE_SMOOTH */
- 587, /* GL_LINE_WIDTH */
- 589, /* GL_LINE_WIDTH_RANGE */
- 588, /* GL_LINE_WIDTH_GRANULARITY */
- 582, /* GL_LINE_STIPPLE */
- 583, /* GL_LINE_STIPPLE_PATTERN */
- 584, /* GL_LINE_STIPPLE_REPEAT */
- 593, /* GL_LIST_MODE */
- 747, /* GL_MAX_LIST_NESTING */
- 590, /* GL_LIST_BASE */
- 592, /* GL_LIST_INDEX */
- 1019, /* GL_POLYGON_MODE */
- 1026, /* GL_POLYGON_SMOOTH */
- 1028, /* GL_POLYGON_STIPPLE */
- 382, /* GL_EDGE_FLAG */
- 259, /* GL_CULL_FACE */
- 260, /* GL_CULL_FACE_MODE */
- 468, /* GL_FRONT_FACE */
- 562, /* GL_LIGHTING */
- 567, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 568, /* GL_LIGHT_MODEL_TWO_SIDE */
- 564, /* GL_LIGHT_MODEL_AMBIENT */
- 1247, /* GL_SHADE_MODEL */
- 158, /* GL_COLOR_MATERIAL_FACE */
- 159, /* GL_COLOR_MATERIAL_PARAMETER */
- 157, /* GL_COLOR_MATERIAL */
- 419, /* GL_FOG */
- 441, /* GL_FOG_INDEX */
- 437, /* GL_FOG_DENSITY */
- 445, /* GL_FOG_START */
- 439, /* GL_FOG_END */
- 442, /* GL_FOG_MODE */
- 421, /* GL_FOG_COLOR */
- 317, /* GL_DEPTH_RANGE */
- 322, /* GL_DEPTH_TEST */
- 325, /* GL_DEPTH_WRITEMASK */
- 305, /* GL_DEPTH_CLEAR_VALUE */
- 316, /* GL_DEPTH_FUNC */
+ 1039, /* GL_PASS_THROUGH_TOKEN */
+ 1095, /* GL_POINT_TOKEN */
+ 653, /* GL_LINE_TOKEN */
+ 1109, /* GL_POLYGON_TOKEN */
+ 74, /* GL_BITMAP_TOKEN */
+ 404, /* GL_DRAW_PIXEL_TOKEN */
+ 270, /* GL_COPY_PIXEL_TOKEN */
+ 646, /* GL_LINE_RESET_TOKEN */
+ 428, /* GL_EXP */
+ 429, /* GL_EXP2 */
+ 303, /* GL_CW */
+ 116, /* GL_CCW */
+ 137, /* GL_COEFF */
+ 1016, /* GL_ORDER */
+ 343, /* GL_DOMAIN */
+ 278, /* GL_CURRENT_COLOR */
+ 281, /* GL_CURRENT_INDEX */
+ 287, /* GL_CURRENT_NORMAL */
+ 299, /* GL_CURRENT_TEXTURE_COORDS */
+ 292, /* GL_CURRENT_RASTER_COLOR */
+ 294, /* GL_CURRENT_RASTER_INDEX */
+ 297, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ 295, /* GL_CURRENT_RASTER_POSITION */
+ 296, /* GL_CURRENT_RASTER_POSITION_VALID */
+ 293, /* GL_CURRENT_RASTER_DISTANCE */
+ 1088, /* GL_POINT_SMOOTH */
+ 1077, /* GL_POINT_SIZE */
+ 1087, /* GL_POINT_SIZE_RANGE */
+ 1078, /* GL_POINT_SIZE_GRANULARITY */
+ 647, /* GL_LINE_SMOOTH */
+ 654, /* GL_LINE_WIDTH */
+ 656, /* GL_LINE_WIDTH_RANGE */
+ 655, /* GL_LINE_WIDTH_GRANULARITY */
+ 649, /* GL_LINE_STIPPLE */
+ 650, /* GL_LINE_STIPPLE_PATTERN */
+ 651, /* GL_LINE_STIPPLE_REPEAT */
+ 661, /* GL_LIST_MODE */
+ 819, /* GL_MAX_LIST_NESTING */
+ 658, /* GL_LIST_BASE */
+ 660, /* GL_LIST_INDEX */
+ 1098, /* GL_POLYGON_MODE */
+ 1105, /* GL_POLYGON_SMOOTH */
+ 1107, /* GL_POLYGON_STIPPLE */
+ 413, /* GL_EDGE_FLAG */
+ 271, /* GL_CULL_FACE */
+ 272, /* GL_CULL_FACE_MODE */
+ 507, /* GL_FRONT_FACE */
+ 629, /* GL_LIGHTING */
+ 634, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 635, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 631, /* GL_LIGHT_MODEL_AMBIENT */
+ 1334, /* GL_SHADE_MODEL */
+ 168, /* GL_COLOR_MATERIAL_FACE */
+ 169, /* GL_COLOR_MATERIAL_PARAMETER */
+ 167, /* GL_COLOR_MATERIAL */
+ 456, /* GL_FOG */
+ 478, /* GL_FOG_INDEX */
+ 474, /* GL_FOG_DENSITY */
+ 482, /* GL_FOG_START */
+ 476, /* GL_FOG_END */
+ 479, /* GL_FOG_MODE */
+ 458, /* GL_FOG_COLOR */
+ 332, /* GL_DEPTH_RANGE */
+ 337, /* GL_DEPTH_TEST */
+ 340, /* GL_DEPTH_WRITEMASK */
+ 320, /* GL_DEPTH_CLEAR_VALUE */
+ 331, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1318, /* GL_STENCIL_TEST */
- 1306, /* GL_STENCIL_CLEAR_VALUE */
- 1308, /* GL_STENCIL_FUNC */
- 1320, /* GL_STENCIL_VALUE_MASK */
- 1307, /* GL_STENCIL_FAIL */
- 1315, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1316, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1317, /* GL_STENCIL_REF */
- 1321, /* GL_STENCIL_WRITEMASK */
- 720, /* GL_MATRIX_MODE */
- 877, /* GL_NORMALIZE */
- 1612, /* GL_VIEWPORT */
- 851, /* GL_MODELVIEW_STACK_DEPTH */
- 1109, /* GL_PROJECTION_STACK_DEPTH */
- 1512, /* GL_TEXTURE_STACK_DEPTH */
- 849, /* GL_MODELVIEW_MATRIX */
- 1108, /* GL_PROJECTION_MATRIX */
- 1497, /* GL_TEXTURE_MATRIX */
- 56, /* GL_ATTRIB_STACK_DEPTH */
- 117, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- 39, /* GL_ALPHA_TEST */
- 40, /* GL_ALPHA_TEST_FUNC */
- 41, /* GL_ALPHA_TEST_REF */
- 327, /* GL_DITHER */
- 73, /* GL_BLEND_DST */
- 80, /* GL_BLEND_SRC */
- 70, /* GL_BLEND */
- 596, /* GL_LOGIC_OP_MODE */
- 521, /* GL_INDEX_LOGIC_OP */
- 156, /* GL_COLOR_LOGIC_OP */
- 62, /* GL_AUX_BUFFERS */
- 338, /* GL_DRAW_BUFFER */
- 1139, /* GL_READ_BUFFER */
- 1230, /* GL_SCISSOR_BOX */
- 1231, /* GL_SCISSOR_TEST */
- 520, /* GL_INDEX_CLEAR_VALUE */
- 525, /* GL_INDEX_WRITEMASK */
- 153, /* GL_COLOR_CLEAR_VALUE */
- 195, /* GL_COLOR_WRITEMASK */
- 522, /* GL_INDEX_MODE */
- 1203, /* GL_RGBA_MODE */
- 337, /* GL_DOUBLEBUFFER */
- 1322, /* GL_STEREO */
- 1162, /* GL_RENDER_MODE */
- 962, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1011, /* GL_POINT_SMOOTH_HINT */
- 581, /* GL_LINE_SMOOTH_HINT */
- 1027, /* GL_POLYGON_SMOOTH_HINT */
- 440, /* GL_FOG_HINT */
- 1478, /* GL_TEXTURE_GEN_S */
- 1479, /* GL_TEXTURE_GEN_T */
- 1477, /* GL_TEXTURE_GEN_R */
- 1476, /* GL_TEXTURE_GEN_Q */
- 975, /* GL_PIXEL_MAP_I_TO_I */
- 981, /* GL_PIXEL_MAP_S_TO_S */
- 977, /* GL_PIXEL_MAP_I_TO_R */
- 973, /* GL_PIXEL_MAP_I_TO_G */
- 971, /* GL_PIXEL_MAP_I_TO_B */
- 969, /* GL_PIXEL_MAP_I_TO_A */
- 979, /* GL_PIXEL_MAP_R_TO_R */
- 967, /* GL_PIXEL_MAP_G_TO_G */
- 965, /* GL_PIXEL_MAP_B_TO_B */
- 963, /* GL_PIXEL_MAP_A_TO_A */
- 976, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 982, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 978, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 974, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 972, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 970, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 980, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 968, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 966, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 964, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 1545, /* GL_UNPACK_SWAP_BYTES */
- 1540, /* GL_UNPACK_LSB_FIRST */
- 1541, /* GL_UNPACK_ROW_LENGTH */
- 1544, /* GL_UNPACK_SKIP_ROWS */
- 1543, /* GL_UNPACK_SKIP_PIXELS */
- 1538, /* GL_UNPACK_ALIGNMENT */
- 950, /* GL_PACK_SWAP_BYTES */
- 945, /* GL_PACK_LSB_FIRST */
- 946, /* GL_PACK_ROW_LENGTH */
- 949, /* GL_PACK_SKIP_ROWS */
- 948, /* GL_PACK_SKIP_PIXELS */
- 942, /* GL_PACK_ALIGNMENT */
- 673, /* GL_MAP_COLOR */
- 674, /* GL_MAP_STENCIL */
- 524, /* GL_INDEX_SHIFT */
- 523, /* GL_INDEX_OFFSET */
- 1151, /* GL_RED_SCALE */
- 1149, /* GL_RED_BIAS */
- 1629, /* GL_ZOOM_X */
- 1630, /* GL_ZOOM_Y */
- 486, /* GL_GREEN_SCALE */
- 484, /* GL_GREEN_BIAS */
- 86, /* GL_BLUE_SCALE */
- 84, /* GL_BLUE_BIAS */
- 38, /* GL_ALPHA_SCALE */
- 36, /* GL_ALPHA_BIAS */
- 318, /* GL_DEPTH_SCALE */
- 299, /* GL_DEPTH_BIAS */
- 743, /* GL_MAX_EVAL_ORDER */
- 746, /* GL_MAX_LIGHTS */
- 728, /* GL_MAX_CLIP_PLANES */
- 788, /* GL_MAX_TEXTURE_SIZE */
- 752, /* GL_MAX_PIXEL_MAP_TABLE */
- 724, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 749, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 750, /* GL_MAX_NAME_STACK_DEPTH */
- 778, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 789, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 799, /* GL_MAX_VIEWPORT_DIMS */
- 725, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1329, /* GL_SUBPIXEL_BITS */
- 519, /* GL_INDEX_BITS */
- 1150, /* GL_RED_BITS */
- 485, /* GL_GREEN_BITS */
- 85, /* GL_BLUE_BITS */
- 37, /* GL_ALPHA_BITS */
- 300, /* GL_DEPTH_BITS */
- 1304, /* GL_STENCIL_BITS */
+ 1413, /* GL_STENCIL_TEST */
+ 1401, /* GL_STENCIL_CLEAR_VALUE */
+ 1403, /* GL_STENCIL_FUNC */
+ 1415, /* GL_STENCIL_VALUE_MASK */
+ 1402, /* GL_STENCIL_FAIL */
+ 1410, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1411, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1412, /* GL_STENCIL_REF */
+ 1416, /* GL_STENCIL_WRITEMASK */
+ 789, /* GL_MATRIX_MODE */
+ 955, /* GL_NORMALIZE */
+ 1718, /* GL_VIEWPORT */
+ 929, /* GL_MODELVIEW_STACK_DEPTH */
+ 1188, /* GL_PROJECTION_STACK_DEPTH */
+ 1607, /* GL_TEXTURE_STACK_DEPTH */
+ 927, /* GL_MODELVIEW_MATRIX */
+ 1187, /* GL_PROJECTION_MATRIX */
+ 1592, /* GL_TEXTURE_MATRIX */
+ 61, /* GL_ATTRIB_STACK_DEPTH */
+ 127, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ 43, /* GL_ALPHA_TEST */
+ 44, /* GL_ALPHA_TEST_FUNC */
+ 45, /* GL_ALPHA_TEST_REF */
+ 342, /* GL_DITHER */
+ 78, /* GL_BLEND_DST */
+ 86, /* GL_BLEND_SRC */
+ 75, /* GL_BLEND */
+ 664, /* GL_LOGIC_OP_MODE */
+ 584, /* GL_INDEX_LOGIC_OP */
+ 166, /* GL_COLOR_LOGIC_OP */
+ 67, /* GL_AUX_BUFFERS */
+ 353, /* GL_DRAW_BUFFER */
+ 1218, /* GL_READ_BUFFER */
+ 1315, /* GL_SCISSOR_BOX */
+ 1316, /* GL_SCISSOR_TEST */
+ 583, /* GL_INDEX_CLEAR_VALUE */
+ 588, /* GL_INDEX_WRITEMASK */
+ 163, /* GL_COLOR_CLEAR_VALUE */
+ 205, /* GL_COLOR_WRITEMASK */
+ 585, /* GL_INDEX_MODE */
+ 1282, /* GL_RGBA_MODE */
+ 352, /* GL_DOUBLEBUFFER */
+ 1417, /* GL_STEREO */
+ 1241, /* GL_RENDER_MODE */
+ 1040, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1089, /* GL_POINT_SMOOTH_HINT */
+ 648, /* GL_LINE_SMOOTH_HINT */
+ 1106, /* GL_POLYGON_SMOOTH_HINT */
+ 477, /* GL_FOG_HINT */
+ 1573, /* GL_TEXTURE_GEN_S */
+ 1574, /* GL_TEXTURE_GEN_T */
+ 1572, /* GL_TEXTURE_GEN_R */
+ 1571, /* GL_TEXTURE_GEN_Q */
+ 1053, /* GL_PIXEL_MAP_I_TO_I */
+ 1059, /* GL_PIXEL_MAP_S_TO_S */
+ 1055, /* GL_PIXEL_MAP_I_TO_R */
+ 1051, /* GL_PIXEL_MAP_I_TO_G */
+ 1049, /* GL_PIXEL_MAP_I_TO_B */
+ 1047, /* GL_PIXEL_MAP_I_TO_A */
+ 1057, /* GL_PIXEL_MAP_R_TO_R */
+ 1045, /* GL_PIXEL_MAP_G_TO_G */
+ 1043, /* GL_PIXEL_MAP_B_TO_B */
+ 1041, /* GL_PIXEL_MAP_A_TO_A */
+ 1054, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1060, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1056, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1052, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1050, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1048, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1058, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1046, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1044, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1042, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 1640, /* GL_UNPACK_SWAP_BYTES */
+ 1635, /* GL_UNPACK_LSB_FIRST */
+ 1636, /* GL_UNPACK_ROW_LENGTH */
+ 1639, /* GL_UNPACK_SKIP_ROWS */
+ 1638, /* GL_UNPACK_SKIP_PIXELS */
+ 1633, /* GL_UNPACK_ALIGNMENT */
+ 1028, /* GL_PACK_SWAP_BYTES */
+ 1023, /* GL_PACK_LSB_FIRST */
+ 1024, /* GL_PACK_ROW_LENGTH */
+ 1027, /* GL_PACK_SKIP_ROWS */
+ 1026, /* GL_PACK_SKIP_PIXELS */
+ 1020, /* GL_PACK_ALIGNMENT */
+ 742, /* GL_MAP_COLOR */
+ 743, /* GL_MAP_STENCIL */
+ 587, /* GL_INDEX_SHIFT */
+ 586, /* GL_INDEX_OFFSET */
+ 1230, /* GL_RED_SCALE */
+ 1228, /* GL_RED_BIAS */
+ 1735, /* GL_ZOOM_X */
+ 1736, /* GL_ZOOM_Y */
+ 549, /* GL_GREEN_SCALE */
+ 547, /* GL_GREEN_BIAS */
+ 92, /* GL_BLUE_SCALE */
+ 90, /* GL_BLUE_BIAS */
+ 42, /* GL_ALPHA_SCALE */
+ 40, /* GL_ALPHA_BIAS */
+ 333, /* GL_DEPTH_SCALE */
+ 314, /* GL_DEPTH_BIAS */
+ 814, /* GL_MAX_EVAL_ORDER */
+ 818, /* GL_MAX_LIGHTS */
+ 797, /* GL_MAX_CLIP_PLANES */
+ 862, /* GL_MAX_TEXTURE_SIZE */
+ 824, /* GL_MAX_PIXEL_MAP_TABLE */
+ 793, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 821, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 822, /* GL_MAX_NAME_STACK_DEPTH */
+ 850, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 863, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 877, /* GL_MAX_VIEWPORT_DIMS */
+ 794, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1424, /* GL_SUBPIXEL_BITS */
+ 582, /* GL_INDEX_BITS */
+ 1229, /* GL_RED_BITS */
+ 548, /* GL_GREEN_BITS */
+ 91, /* GL_BLUE_BITS */
+ 41, /* GL_ALPHA_BITS */
+ 315, /* GL_DEPTH_BITS */
+ 1399, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
9, /* GL_ACCUM_ALPHA_BITS */
- 865, /* GL_NAME_STACK_DEPTH */
- 57, /* GL_AUTO_NORMAL */
- 619, /* GL_MAP1_COLOR_4 */
- 622, /* GL_MAP1_INDEX */
- 623, /* GL_MAP1_NORMAL */
- 624, /* GL_MAP1_TEXTURE_COORD_1 */
- 625, /* GL_MAP1_TEXTURE_COORD_2 */
- 626, /* GL_MAP1_TEXTURE_COORD_3 */
- 627, /* GL_MAP1_TEXTURE_COORD_4 */
- 628, /* GL_MAP1_VERTEX_3 */
- 629, /* GL_MAP1_VERTEX_4 */
- 646, /* GL_MAP2_COLOR_4 */
- 649, /* GL_MAP2_INDEX */
- 650, /* GL_MAP2_NORMAL */
- 651, /* GL_MAP2_TEXTURE_COORD_1 */
- 652, /* GL_MAP2_TEXTURE_COORD_2 */
- 653, /* GL_MAP2_TEXTURE_COORD_3 */
- 654, /* GL_MAP2_TEXTURE_COORD_4 */
- 655, /* GL_MAP2_VERTEX_3 */
- 656, /* GL_MAP2_VERTEX_4 */
- 620, /* GL_MAP1_GRID_DOMAIN */
- 621, /* GL_MAP1_GRID_SEGMENTS */
- 647, /* GL_MAP2_GRID_DOMAIN */
- 648, /* GL_MAP2_GRID_SEGMENTS */
- 1406, /* GL_TEXTURE_1D */
- 1407, /* GL_TEXTURE_2D */
- 407, /* GL_FEEDBACK_BUFFER_POINTER */
- 408, /* GL_FEEDBACK_BUFFER_SIZE */
- 409, /* GL_FEEDBACK_BUFFER_TYPE */
- 1240, /* GL_SELECTION_BUFFER_POINTER */
- 1241, /* GL_SELECTION_BUFFER_SIZE */
- 1515, /* GL_TEXTURE_WIDTH */
- 1483, /* GL_TEXTURE_HEIGHT */
- 1439, /* GL_TEXTURE_COMPONENTS */
- 1423, /* GL_TEXTURE_BORDER_COLOR */
- 1422, /* GL_TEXTURE_BORDER */
- 329, /* GL_DONT_CARE */
- 405, /* GL_FASTEST */
- 873, /* GL_NICEST */
- 43, /* GL_AMBIENT */
- 326, /* GL_DIFFUSE */
- 1280, /* GL_SPECULAR */
- 1031, /* GL_POSITION */
- 1283, /* GL_SPOT_DIRECTION */
- 1284, /* GL_SPOT_EXPONENT */
- 1282, /* GL_SPOT_CUTOFF */
- 233, /* GL_CONSTANT_ATTENUATION */
- 571, /* GL_LINEAR_ATTENUATION */
- 1126, /* GL_QUADRATIC_ATTENUATION */
- 208, /* GL_COMPILE */
- 209, /* GL_COMPILE_AND_EXECUTE */
- 101, /* GL_BYTE */
- 1546, /* GL_UNSIGNED_BYTE */
- 1251, /* GL_SHORT */
- 1555, /* GL_UNSIGNED_SHORT */
- 526, /* GL_INT */
- 1549, /* GL_UNSIGNED_INT */
- 412, /* GL_FLOAT */
+ 943, /* GL_NAME_STACK_DEPTH */
+ 62, /* GL_AUTO_NORMAL */
+ 688, /* GL_MAP1_COLOR_4 */
+ 691, /* GL_MAP1_INDEX */
+ 692, /* GL_MAP1_NORMAL */
+ 693, /* GL_MAP1_TEXTURE_COORD_1 */
+ 694, /* GL_MAP1_TEXTURE_COORD_2 */
+ 695, /* GL_MAP1_TEXTURE_COORD_3 */
+ 696, /* GL_MAP1_TEXTURE_COORD_4 */
+ 697, /* GL_MAP1_VERTEX_3 */
+ 698, /* GL_MAP1_VERTEX_4 */
+ 715, /* GL_MAP2_COLOR_4 */
+ 718, /* GL_MAP2_INDEX */
+ 719, /* GL_MAP2_NORMAL */
+ 720, /* GL_MAP2_TEXTURE_COORD_1 */
+ 721, /* GL_MAP2_TEXTURE_COORD_2 */
+ 722, /* GL_MAP2_TEXTURE_COORD_3 */
+ 723, /* GL_MAP2_TEXTURE_COORD_4 */
+ 724, /* GL_MAP2_VERTEX_3 */
+ 725, /* GL_MAP2_VERTEX_4 */
+ 689, /* GL_MAP1_GRID_DOMAIN */
+ 690, /* GL_MAP1_GRID_SEGMENTS */
+ 716, /* GL_MAP2_GRID_DOMAIN */
+ 717, /* GL_MAP2_GRID_SEGMENTS */
+ 1501, /* GL_TEXTURE_1D */
+ 1502, /* GL_TEXTURE_2D */
+ 438, /* GL_FEEDBACK_BUFFER_POINTER */
+ 439, /* GL_FEEDBACK_BUFFER_SIZE */
+ 440, /* GL_FEEDBACK_BUFFER_TYPE */
+ 1325, /* GL_SELECTION_BUFFER_POINTER */
+ 1326, /* GL_SELECTION_BUFFER_SIZE */
+ 1610, /* GL_TEXTURE_WIDTH */
+ 1578, /* GL_TEXTURE_HEIGHT */
+ 1534, /* GL_TEXTURE_COMPONENTS */
+ 1518, /* GL_TEXTURE_BORDER_COLOR */
+ 1517, /* GL_TEXTURE_BORDER */
+ 344, /* GL_DONT_CARE */
+ 436, /* GL_FASTEST */
+ 951, /* GL_NICEST */
+ 47, /* GL_AMBIENT */
+ 341, /* GL_DIFFUSE */
+ 1368, /* GL_SPECULAR */
+ 1110, /* GL_POSITION */
+ 1371, /* GL_SPOT_DIRECTION */
+ 1372, /* GL_SPOT_EXPONENT */
+ 1370, /* GL_SPOT_CUTOFF */
+ 244, /* GL_CONSTANT_ATTENUATION */
+ 638, /* GL_LINEAR_ATTENUATION */
+ 1205, /* GL_QUADRATIC_ATTENUATION */
+ 218, /* GL_COMPILE */
+ 219, /* GL_COMPILE_AND_EXECUTE */
+ 111, /* GL_BYTE */
+ 1641, /* GL_UNSIGNED_BYTE */
+ 1339, /* GL_SHORT */
+ 1650, /* GL_UNSIGNED_SHORT */
+ 590, /* GL_INT */
+ 1644, /* GL_UNSIGNED_INT */
+ 443, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
7, /* GL_4_BYTES */
- 336, /* GL_DOUBLE */
- 113, /* GL_CLEAR */
- 45, /* GL_AND */
- 47, /* GL_AND_REVERSE */
- 256, /* GL_COPY */
- 46, /* GL_AND_INVERTED */
- 875, /* GL_NOOP */
- 1625, /* GL_XOR */
- 937, /* GL_OR */
- 876, /* GL_NOR */
- 395, /* GL_EQUIV */
- 549, /* GL_INVERT */
- 940, /* GL_OR_REVERSE */
- 257, /* GL_COPY_INVERTED */
- 939, /* GL_OR_INVERTED */
- 866, /* GL_NAND */
- 1245, /* GL_SET */
- 392, /* GL_EMISSION */
- 1250, /* GL_SHININESS */
- 44, /* GL_AMBIENT_AND_DIFFUSE */
- 155, /* GL_COLOR_INDEXES */
- 816, /* GL_MODELVIEW */
- 1107, /* GL_PROJECTION */
- 1341, /* GL_TEXTURE */
- 128, /* GL_COLOR */
- 297, /* GL_DEPTH */
- 1302, /* GL_STENCIL */
- 154, /* GL_COLOR_INDEX */
- 1309, /* GL_STENCIL_INDEX */
- 306, /* GL_DEPTH_COMPONENT */
- 1146, /* GL_RED */
- 483, /* GL_GREEN */
- 83, /* GL_BLUE */
- 27, /* GL_ALPHA */
- 1170, /* GL_RGB */
- 1189, /* GL_RGBA */
- 597, /* GL_LUMINANCE */
- 618, /* GL_LUMINANCE_ALPHA */
- 68, /* GL_BITMAP */
- 988, /* GL_POINT */
- 569, /* GL_LINE */
- 410, /* GL_FILL */
- 1155, /* GL_RENDER */
- 406, /* GL_FEEDBACK */
- 1239, /* GL_SELECT */
- 411, /* GL_FLAT */
- 1255, /* GL_SMOOTH */
- 550, /* GL_KEEP */
- 1164, /* GL_REPLACE */
- 510, /* GL_INCR */
- 294, /* GL_DECR */
- 1568, /* GL_VENDOR */
- 1161, /* GL_RENDERER */
- 1569, /* GL_VERSION */
- 399, /* GL_EXTENSIONS */
- 1210, /* GL_S */
- 1332, /* GL_T */
- 1136, /* GL_R */
- 1125, /* GL_Q */
- 852, /* GL_MODULATE */
- 293, /* GL_DECAL */
- 1473, /* GL_TEXTURE_ENV_MODE */
- 1472, /* GL_TEXTURE_ENV_COLOR */
- 1471, /* GL_TEXTURE_ENV */
- 400, /* GL_EYE_LINEAR */
- 899, /* GL_OBJECT_LINEAR */
- 1281, /* GL_SPHERE_MAP */
- 1475, /* GL_TEXTURE_GEN_MODE */
- 901, /* GL_OBJECT_PLANE */
- 401, /* GL_EYE_PLANE */
- 867, /* GL_NEAREST */
- 570, /* GL_LINEAR */
- 871, /* GL_NEAREST_MIPMAP_NEAREST */
- 575, /* GL_LINEAR_MIPMAP_NEAREST */
- 870, /* GL_NEAREST_MIPMAP_LINEAR */
- 574, /* GL_LINEAR_MIPMAP_LINEAR */
- 1496, /* GL_TEXTURE_MAG_FILTER */
- 1504, /* GL_TEXTURE_MIN_FILTER */
- 1517, /* GL_TEXTURE_WRAP_S */
- 1518, /* GL_TEXTURE_WRAP_T */
- 107, /* GL_CLAMP */
- 1163, /* GL_REPEAT */
- 1025, /* GL_POLYGON_OFFSET_UNITS */
- 1024, /* GL_POLYGON_OFFSET_POINT */
- 1023, /* GL_POLYGON_OFFSET_LINE */
- 1137, /* GL_R3_G3_B2 */
- 1566, /* GL_V2F */
- 1567, /* GL_V3F */
- 104, /* GL_C4UB_V2F */
- 105, /* GL_C4UB_V3F */
- 102, /* GL_C3F_V3F */
- 864, /* GL_N3F_V3F */
- 103, /* GL_C4F_N3F_V3F */
- 1337, /* GL_T2F_V3F */
- 1339, /* GL_T4F_V4F */
- 1335, /* GL_T2F_C4UB_V3F */
- 1333, /* GL_T2F_C3F_V3F */
- 1336, /* GL_T2F_N3F_V3F */
- 1334, /* GL_T2F_C4F_N3F_V3F */
- 1338, /* GL_T4F_C4F_N3F_V4F */
- 120, /* GL_CLIP_PLANE0 */
- 121, /* GL_CLIP_PLANE1 */
- 122, /* GL_CLIP_PLANE2 */
- 123, /* GL_CLIP_PLANE3 */
- 124, /* GL_CLIP_PLANE4 */
- 125, /* GL_CLIP_PLANE5 */
- 554, /* GL_LIGHT0 */
- 555, /* GL_LIGHT1 */
- 556, /* GL_LIGHT2 */
- 557, /* GL_LIGHT3 */
- 558, /* GL_LIGHT4 */
- 559, /* GL_LIGHT5 */
- 560, /* GL_LIGHT6 */
- 561, /* GL_LIGHT7 */
- 487, /* GL_HINT_BIT */
- 235, /* GL_CONSTANT_COLOR */
- 911, /* GL_ONE_MINUS_CONSTANT_COLOR */
- 230, /* GL_CONSTANT_ALPHA */
- 909, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- 71, /* GL_BLEND_COLOR */
- 471, /* GL_FUNC_ADD */
- 800, /* GL_MIN */
- 722, /* GL_MAX */
- 76, /* GL_BLEND_EQUATION */
- 475, /* GL_FUNC_SUBTRACT */
- 473, /* GL_FUNC_REVERSE_SUBTRACT */
- 238, /* GL_CONVOLUTION_1D */
- 239, /* GL_CONVOLUTION_2D */
- 1242, /* GL_SEPARABLE_2D */
- 242, /* GL_CONVOLUTION_BORDER_MODE */
- 246, /* GL_CONVOLUTION_FILTER_SCALE */
- 244, /* GL_CONVOLUTION_FILTER_BIAS */
- 1147, /* GL_REDUCE */
- 248, /* GL_CONVOLUTION_FORMAT */
- 252, /* GL_CONVOLUTION_WIDTH */
- 250, /* GL_CONVOLUTION_HEIGHT */
- 735, /* GL_MAX_CONVOLUTION_WIDTH */
- 733, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1064, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1060, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1055, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1051, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1062, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1058, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1053, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1049, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 488, /* GL_HISTOGRAM */
- 1111, /* GL_PROXY_HISTOGRAM */
- 504, /* GL_HISTOGRAM_WIDTH */
- 494, /* GL_HISTOGRAM_FORMAT */
- 500, /* GL_HISTOGRAM_RED_SIZE */
- 496, /* GL_HISTOGRAM_GREEN_SIZE */
- 491, /* GL_HISTOGRAM_BLUE_SIZE */
- 489, /* GL_HISTOGRAM_ALPHA_SIZE */
- 498, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 502, /* GL_HISTOGRAM_SINK */
- 801, /* GL_MINMAX */
- 803, /* GL_MINMAX_FORMAT */
- 805, /* GL_MINMAX_SINK */
- 1340, /* GL_TABLE_TOO_LARGE_EXT */
- 1548, /* GL_UNSIGNED_BYTE_3_3_2 */
- 1557, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 1559, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 1553, /* GL_UNSIGNED_INT_8_8_8_8 */
- 1550, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1022, /* GL_POLYGON_OFFSET_FILL */
- 1021, /* GL_POLYGON_OFFSET_FACTOR */
- 1020, /* GL_POLYGON_OFFSET_BIAS */
- 1167, /* GL_RESCALE_NORMAL */
- 32, /* GL_ALPHA4 */
- 34, /* GL_ALPHA8 */
- 28, /* GL_ALPHA12 */
- 30, /* GL_ALPHA16 */
- 608, /* GL_LUMINANCE4 */
- 614, /* GL_LUMINANCE8 */
- 598, /* GL_LUMINANCE12 */
- 604, /* GL_LUMINANCE16 */
- 609, /* GL_LUMINANCE4_ALPHA4 */
- 612, /* GL_LUMINANCE6_ALPHA2 */
- 615, /* GL_LUMINANCE8_ALPHA8 */
- 601, /* GL_LUMINANCE12_ALPHA4 */
- 599, /* GL_LUMINANCE12_ALPHA12 */
- 605, /* GL_LUMINANCE16_ALPHA16 */
- 527, /* GL_INTENSITY */
- 532, /* GL_INTENSITY4 */
- 534, /* GL_INTENSITY8 */
- 528, /* GL_INTENSITY12 */
- 530, /* GL_INTENSITY16 */
- 1179, /* GL_RGB2_EXT */
- 1180, /* GL_RGB4 */
- 1183, /* GL_RGB5 */
- 1187, /* GL_RGB8 */
- 1171, /* GL_RGB10 */
- 1175, /* GL_RGB12 */
- 1177, /* GL_RGB16 */
- 1194, /* GL_RGBA2 */
- 1196, /* GL_RGBA4 */
- 1184, /* GL_RGB5_A1 */
- 1200, /* GL_RGBA8 */
- 1172, /* GL_RGB10_A2 */
- 1190, /* GL_RGBA12 */
- 1192, /* GL_RGBA16 */
- 1509, /* GL_TEXTURE_RED_SIZE */
- 1481, /* GL_TEXTURE_GREEN_SIZE */
- 1420, /* GL_TEXTURE_BLUE_SIZE */
- 1409, /* GL_TEXTURE_ALPHA_SIZE */
- 1494, /* GL_TEXTURE_LUMINANCE_SIZE */
- 1485, /* GL_TEXTURE_INTENSITY_SIZE */
- 1165, /* GL_REPLACE_EXT */
- 1115, /* GL_PROXY_TEXTURE_1D */
- 1117, /* GL_PROXY_TEXTURE_2D */
- 1513, /* GL_TEXTURE_TOO_LARGE_EXT */
- 1506, /* GL_TEXTURE_PRIORITY */
- 1511, /* GL_TEXTURE_RESIDENT */
- 1412, /* GL_TEXTURE_BINDING_1D */
- 1413, /* GL_TEXTURE_BINDING_2D */
- 1414, /* GL_TEXTURE_BINDING_3D */
- 947, /* GL_PACK_SKIP_IMAGES */
- 943, /* GL_PACK_IMAGE_HEIGHT */
- 1542, /* GL_UNPACK_SKIP_IMAGES */
- 1539, /* GL_UNPACK_IMAGE_HEIGHT */
- 1408, /* GL_TEXTURE_3D */
- 1119, /* GL_PROXY_TEXTURE_3D */
- 1468, /* GL_TEXTURE_DEPTH */
- 1516, /* GL_TEXTURE_WRAP_R */
- 723, /* GL_MAX_3D_TEXTURE_SIZE */
- 1570, /* GL_VERTEX_ARRAY */
- 878, /* GL_NORMAL_ARRAY */
- 129, /* GL_COLOR_ARRAY */
- 513, /* GL_INDEX_ARRAY */
- 1447, /* GL_TEXTURE_COORD_ARRAY */
- 383, /* GL_EDGE_FLAG_ARRAY */
- 1575, /* GL_VERTEX_ARRAY_SIZE */
- 1577, /* GL_VERTEX_ARRAY_TYPE */
- 1576, /* GL_VERTEX_ARRAY_STRIDE */
- 883, /* GL_NORMAL_ARRAY_TYPE */
- 882, /* GL_NORMAL_ARRAY_STRIDE */
- 133, /* GL_COLOR_ARRAY_SIZE */
- 135, /* GL_COLOR_ARRAY_TYPE */
- 134, /* GL_COLOR_ARRAY_STRIDE */
- 518, /* GL_INDEX_ARRAY_TYPE */
- 517, /* GL_INDEX_ARRAY_STRIDE */
- 1451, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 1453, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 1452, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- 387, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 1574, /* GL_VERTEX_ARRAY_POINTER */
- 881, /* GL_NORMAL_ARRAY_POINTER */
- 132, /* GL_COLOR_ARRAY_POINTER */
- 516, /* GL_INDEX_ARRAY_POINTER */
- 1450, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- 386, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 857, /* GL_MULTISAMPLE */
- 1216, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1218, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1223, /* GL_SAMPLE_COVERAGE */
- 1220, /* GL_SAMPLE_BUFFERS */
- 1211, /* GL_SAMPLES */
- 1227, /* GL_SAMPLE_COVERAGE_VALUE */
- 1225, /* GL_SAMPLE_COVERAGE_INVERT */
- 160, /* GL_COLOR_MATRIX */
- 162, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 730, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1047, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1043, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1038, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1034, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1045, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1041, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1036, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1032, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 1430, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1120, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 1432, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- 75, /* GL_BLEND_DST_RGB */
- 82, /* GL_BLEND_SRC_RGB */
- 74, /* GL_BLEND_DST_ALPHA */
- 81, /* GL_BLEND_SRC_ALPHA */
- 166, /* GL_COLOR_TABLE */
- 1057, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1040, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1110, /* GL_PROXY_COLOR_TABLE */
- 1114, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1113, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- 190, /* GL_COLOR_TABLE_SCALE */
- 170, /* GL_COLOR_TABLE_BIAS */
- 175, /* GL_COLOR_TABLE_FORMAT */
- 192, /* GL_COLOR_TABLE_WIDTH */
- 187, /* GL_COLOR_TABLE_RED_SIZE */
- 178, /* GL_COLOR_TABLE_GREEN_SIZE */
- 172, /* GL_COLOR_TABLE_BLUE_SIZE */
- 167, /* GL_COLOR_TABLE_ALPHA_SIZE */
- 184, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- 181, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- 66, /* GL_BGR */
- 67, /* GL_BGRA */
- 742, /* GL_MAX_ELEMENTS_VERTICES */
- 741, /* GL_MAX_ELEMENTS_INDICES */
- 1484, /* GL_TEXTURE_INDEX_SIZE_EXT */
- 126, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1005, /* GL_POINT_SIZE_MIN */
- 1001, /* GL_POINT_SIZE_MAX */
- 995, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 991, /* GL_POINT_DISTANCE_ATTENUATION */
- 108, /* GL_CLAMP_TO_BORDER */
- 111, /* GL_CLAMP_TO_EDGE */
- 1505, /* GL_TEXTURE_MIN_LOD */
- 1503, /* GL_TEXTURE_MAX_LOD */
- 1411, /* GL_TEXTURE_BASE_LEVEL */
- 1502, /* GL_TEXTURE_MAX_LEVEL */
- 507, /* GL_IGNORE_BORDER_HP */
- 234, /* GL_CONSTANT_BORDER_HP */
- 1166, /* GL_REPLICATE_BORDER_HP */
- 240, /* GL_CONVOLUTION_BORDER_COLOR */
- 906, /* GL_OCCLUSION_TEST_HP */
- 907, /* GL_OCCLUSION_TEST_RESULT_HP */
- 572, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 1424, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 1426, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 1428, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 1429, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1427, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 1425, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 726, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 727, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1067, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1069, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1066, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1068, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 1492, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 1493, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 1491, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- 477, /* GL_GENERATE_MIPMAP */
- 478, /* GL_GENERATE_MIPMAP_HINT */
- 443, /* GL_FOG_OFFSET_SGIX */
- 444, /* GL_FOG_OFFSET_VALUE_SGIX */
- 1438, /* GL_TEXTURE_COMPARE_SGIX */
- 1437, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 1488, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 1480, /* GL_TEXTURE_GEQUAL_R_SGIX */
- 307, /* GL_DEPTH_COMPONENT16 */
- 310, /* GL_DEPTH_COMPONENT24 */
- 313, /* GL_DEPTH_COMPONENT32 */
- 261, /* GL_CULL_VERTEX_EXT */
- 263, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- 262, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 1622, /* GL_WRAP_BORDER_SUN */
- 1431, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 565, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1252, /* GL_SINGLE_COLOR */
- 1243, /* GL_SEPARATE_SPECULAR_COLOR */
- 1249, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 1547, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 1560, /* GL_UNSIGNED_SHORT_5_6_5 */
- 1561, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 1558, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 1556, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 1554, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 1552, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 1500, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 1501, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 1499, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 808, /* GL_MIRRORED_REPEAT */
- 1205, /* GL_RGB_S3TC */
- 1182, /* GL_RGB4_S3TC */
- 1204, /* GL_RGBA_S3TC */
- 1199, /* GL_RGBA4_S3TC */
- 1202, /* GL_RGBA_DXT5_S3TC */
- 1197, /* GL_RGBA4_DXT5_S3TC */
- 227, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- 222, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- 223, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- 224, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 869, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 868, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 573, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- 430, /* GL_FOG_COORDINATE_SOURCE */
- 422, /* GL_FOG_COORD */
- 446, /* GL_FRAGMENT_DEPTH */
- 267, /* GL_CURRENT_FOG_COORD */
- 429, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- 428, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- 427, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- 424, /* GL_FOG_COORDINATE_ARRAY */
- 164, /* GL_COLOR_SUM */
- 285, /* GL_CURRENT_SECONDARY_COLOR */
- 1236, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1238, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1237, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1235, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1232, /* GL_SECONDARY_COLOR_ARRAY */
- 24, /* GL_ALIASED_POINT_SIZE_RANGE */
- 23, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1342, /* GL_TEXTURE0 */
- 1344, /* GL_TEXTURE1 */
- 1366, /* GL_TEXTURE2 */
- 1388, /* GL_TEXTURE3 */
- 1394, /* GL_TEXTURE4 */
- 1396, /* GL_TEXTURE5 */
- 1398, /* GL_TEXTURE6 */
- 1400, /* GL_TEXTURE7 */
- 1402, /* GL_TEXTURE8 */
- 1404, /* GL_TEXTURE9 */
- 1345, /* GL_TEXTURE10 */
- 1347, /* GL_TEXTURE11 */
- 1349, /* GL_TEXTURE12 */
- 1351, /* GL_TEXTURE13 */
- 1353, /* GL_TEXTURE14 */
- 1355, /* GL_TEXTURE15 */
- 1357, /* GL_TEXTURE16 */
- 1359, /* GL_TEXTURE17 */
- 1361, /* GL_TEXTURE18 */
- 1363, /* GL_TEXTURE19 */
- 1367, /* GL_TEXTURE20 */
- 1369, /* GL_TEXTURE21 */
- 1371, /* GL_TEXTURE22 */
- 1373, /* GL_TEXTURE23 */
- 1375, /* GL_TEXTURE24 */
- 1377, /* GL_TEXTURE25 */
- 1379, /* GL_TEXTURE26 */
- 1381, /* GL_TEXTURE27 */
- 1383, /* GL_TEXTURE28 */
- 1385, /* GL_TEXTURE29 */
- 1389, /* GL_TEXTURE30 */
- 1391, /* GL_TEXTURE31 */
- 16, /* GL_ACTIVE_TEXTURE */
- 114, /* GL_CLIENT_ACTIVE_TEXTURE */
- 790, /* GL_MAX_TEXTURE_UNITS */
- 1526, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 1529, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 1531, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 1523, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1330, /* GL_SUBTRACT */
- 781, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- 210, /* GL_COMPRESSED_ALPHA */
- 214, /* GL_COMPRESSED_LUMINANCE */
- 215, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- 212, /* GL_COMPRESSED_INTENSITY */
- 218, /* GL_COMPRESSED_RGB */
- 219, /* GL_COMPRESSED_RGBA */
- 1445, /* GL_TEXTURE_COMPRESSION_HINT */
- 1507, /* GL_TEXTURE_RECTANGLE_ARB */
- 1417, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- 1123, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- 779, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- 319, /* GL_DEPTH_STENCIL_NV */
- 1551, /* GL_UNSIGNED_INT_24_8_NV */
- 786, /* GL_MAX_TEXTURE_LOD_BIAS */
- 1498, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 787, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 1474, /* GL_TEXTURE_FILTER_CONTROL */
- 1489, /* GL_TEXTURE_LOD_BIAS */
- 197, /* GL_COMBINE4 */
- 782, /* GL_MAX_SHININESS_NV */
- 783, /* GL_MAX_SPOT_EXPONENT_NV */
- 511, /* GL_INCR_WRAP */
- 295, /* GL_DECR_WRAP */
- 828, /* GL_MODELVIEW1_ARB */
- 884, /* GL_NORMAL_MAP */
- 1152, /* GL_REFLECTION_MAP */
- 1454, /* GL_TEXTURE_CUBE_MAP */
- 1415, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 1462, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 1456, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 1464, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 1458, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 1466, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 1460, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1121, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 737, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 863, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 438, /* GL_FOG_DISTANCE_MODE_NV */
- 403, /* GL_EYE_RADIAL_NV */
- 402, /* GL_EYE_PLANE_ABSOLUTE_NV */
- 196, /* GL_COMBINE */
- 203, /* GL_COMBINE_RGB */
- 198, /* GL_COMBINE_ALPHA */
- 1206, /* GL_RGB_SCALE */
- 20, /* GL_ADD_SIGNED */
- 537, /* GL_INTERPOLATE */
- 229, /* GL_CONSTANT */
- 1073, /* GL_PRIMARY_COLOR */
- 1070, /* GL_PREVIOUS */
- 1263, /* GL_SOURCE0_RGB */
- 1269, /* GL_SOURCE1_RGB */
- 1275, /* GL_SOURCE2_RGB */
- 1279, /* GL_SOURCE3_RGB_NV */
- 1260, /* GL_SOURCE0_ALPHA */
- 1266, /* GL_SOURCE1_ALPHA */
- 1272, /* GL_SOURCE2_ALPHA */
- 1278, /* GL_SOURCE3_ALPHA_NV */
- 920, /* GL_OPERAND0_RGB */
- 926, /* GL_OPERAND1_RGB */
- 932, /* GL_OPERAND2_RGB */
- 936, /* GL_OPERAND3_RGB_NV */
- 917, /* GL_OPERAND0_ALPHA */
- 923, /* GL_OPERAND1_ALPHA */
- 929, /* GL_OPERAND2_ALPHA */
- 935, /* GL_OPERAND3_ALPHA_NV */
- 1571, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- 1626, /* GL_YCBCR_422_APPLE */
- 1562, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 1564, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 1254, /* GL_SLICE_ACCUM_SUN */
- 1128, /* GL_QUAD_MESH_SUN */
- 1535, /* GL_TRIANGLE_MESH_SUN */
- 1603, /* GL_VERTEX_PROGRAM_ARB */
- 1611, /* GL_VERTEX_STATE_PROGRAM_NV */
- 1596, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- 1599, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- 1600, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- 1601, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- 287, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- 1086, /* GL_PROGRAM_LENGTH_ARB */
- 1100, /* GL_PROGRAM_STRING_ARB */
- 850, /* GL_MODELVIEW_PROJECTION_NV */
- 506, /* GL_IDENTITY_NV */
- 547, /* GL_INVERSE_NV */
- 1528, /* GL_TRANSPOSE_NV */
- 548, /* GL_INVERSE_TRANSPOSE_NV */
- 765, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 764, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 676, /* GL_MATRIX0_NV */
- 688, /* GL_MATRIX1_NV */
- 700, /* GL_MATRIX2_NV */
- 704, /* GL_MATRIX3_NV */
- 706, /* GL_MATRIX4_NV */
- 708, /* GL_MATRIX5_NV */
- 710, /* GL_MATRIX6_NV */
- 712, /* GL_MATRIX7_NV */
- 273, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- 270, /* GL_CURRENT_MATRIX_ARB */
- 1606, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- 1608, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- 1098, /* GL_PROGRAM_PARAMETER_NV */
- 1598, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- 1102, /* GL_PROGRAM_TARGET_NV */
- 1099, /* GL_PROGRAM_RESIDENT_NV */
- 1520, /* GL_TRACK_MATRIX_NV */
- 1521, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 1604, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1080, /* GL_PROGRAM_ERROR_POSITION_ARB */
- 304, /* GL_DEPTH_CLAMP_NV */
- 1578, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 1585, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 1586, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 1587, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 1588, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 1589, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 1590, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 1591, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 1592, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 1593, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 1579, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 1580, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 1581, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 1582, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 1583, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 1584, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 630, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 637, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 638, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 639, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 640, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 641, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 642, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 643, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 644, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 645, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 631, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 632, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 633, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 634, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 635, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 636, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 657, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 664, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 665, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 666, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 667, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 668, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 669, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1079, /* GL_PROGRAM_BINDING_ARB */
- 671, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 672, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 658, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 659, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 660, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 661, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 662, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 663, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 1443, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 1440, /* GL_TEXTURE_COMPRESSED */
- 889, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- 228, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 798, /* GL_MAX_VERTEX_UNITS_ARB */
- 18, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 1621, /* GL_WEIGHT_SUM_UNITY_ARB */
- 1602, /* GL_VERTEX_BLEND_ARB */
- 288, /* GL_CURRENT_WEIGHT_ARB */
- 1620, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 1619, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 1618, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 1617, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 1614, /* GL_WEIGHT_ARRAY_ARB */
- 330, /* GL_DOT3_RGB */
- 331, /* GL_DOT3_RGBA */
- 226, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- 221, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 858, /* GL_MULTISAMPLE_3DFX */
- 1221, /* GL_SAMPLE_BUFFERS_3DFX */
- 1212, /* GL_SAMPLES_3DFX */
- 839, /* GL_MODELVIEW2_ARB */
- 842, /* GL_MODELVIEW3_ARB */
- 843, /* GL_MODELVIEW4_ARB */
- 844, /* GL_MODELVIEW5_ARB */
- 845, /* GL_MODELVIEW6_ARB */
- 846, /* GL_MODELVIEW7_ARB */
- 847, /* GL_MODELVIEW8_ARB */
- 848, /* GL_MODELVIEW9_ARB */
- 818, /* GL_MODELVIEW10_ARB */
- 819, /* GL_MODELVIEW11_ARB */
- 820, /* GL_MODELVIEW12_ARB */
- 821, /* GL_MODELVIEW13_ARB */
- 822, /* GL_MODELVIEW14_ARB */
- 823, /* GL_MODELVIEW15_ARB */
- 824, /* GL_MODELVIEW16_ARB */
- 825, /* GL_MODELVIEW17_ARB */
- 826, /* GL_MODELVIEW18_ARB */
- 827, /* GL_MODELVIEW19_ARB */
- 829, /* GL_MODELVIEW20_ARB */
- 830, /* GL_MODELVIEW21_ARB */
- 831, /* GL_MODELVIEW22_ARB */
- 832, /* GL_MODELVIEW23_ARB */
- 833, /* GL_MODELVIEW24_ARB */
- 834, /* GL_MODELVIEW25_ARB */
- 835, /* GL_MODELVIEW26_ARB */
- 836, /* GL_MODELVIEW27_ARB */
- 837, /* GL_MODELVIEW28_ARB */
- 838, /* GL_MODELVIEW29_ARB */
- 840, /* GL_MODELVIEW30_ARB */
- 841, /* GL_MODELVIEW31_ARB */
- 335, /* GL_DOT3_RGB_EXT */
- 333, /* GL_DOT3_RGBA_EXT */
- 812, /* GL_MIRROR_CLAMP_EXT */
- 815, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 853, /* GL_MODULATE_ADD_ATI */
- 854, /* GL_MODULATE_SIGNED_ADD_ATI */
- 855, /* GL_MODULATE_SUBTRACT_ATI */
- 1627, /* GL_YCBCR_MESA */
- 944, /* GL_PACK_INVERT_MESA */
- 291, /* GL_DEBUG_OBJECT_MESA */
- 292, /* GL_DEBUG_PRINT_MESA */
- 290, /* GL_DEBUG_ASSERT_MESA */
- 97, /* GL_BUFFER_SIZE */
- 99, /* GL_BUFFER_USAGE */
- 447, /* GL_FRAGMENT_PROGRAM_ARB */
- 1077, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1105, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1104, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1089, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1095, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1094, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 754, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 777, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 776, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 767, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 773, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 772, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 739, /* GL_MAX_DRAW_BUFFERS_ARB */
- 339, /* GL_DRAW_BUFFER0_ARB */
- 353, /* GL_DRAW_BUFFER1_ARB */
- 355, /* GL_DRAW_BUFFER2_ARB */
- 357, /* GL_DRAW_BUFFER3_ARB */
- 359, /* GL_DRAW_BUFFER4_ARB */
- 361, /* GL_DRAW_BUFFER5_ARB */
- 363, /* GL_DRAW_BUFFER6_ARB */
- 365, /* GL_DRAW_BUFFER7_ARB */
- 367, /* GL_DRAW_BUFFER8_ARB */
- 369, /* GL_DRAW_BUFFER9_ARB */
- 341, /* GL_DRAW_BUFFER10_ARB */
- 343, /* GL_DRAW_BUFFER11_ARB */
- 345, /* GL_DRAW_BUFFER12_ARB */
- 347, /* GL_DRAW_BUFFER13_ARB */
- 349, /* GL_DRAW_BUFFER14_ARB */
- 351, /* GL_DRAW_BUFFER15_ARB */
- 77, /* GL_BLEND_EQUATION_ALPHA_EXT */
- 721, /* GL_MATRIX_PALETTE_ARB */
- 748, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 751, /* GL_MAX_PALETTE_MATRICES_ARB */
- 276, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 715, /* GL_MATRIX_INDEX_ARRAY_ARB */
- 271, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 717, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 719, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 718, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 716, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 1469, /* GL_TEXTURE_DEPTH_SIZE */
- 323, /* GL_DEPTH_TEXTURE_MODE */
- 1435, /* GL_TEXTURE_COMPARE_MODE */
- 1433, /* GL_TEXTURE_COMPARE_FUNC */
- 206, /* GL_COMPARE_R_TO_TEXTURE */
- 1012, /* GL_POINT_SPRITE_ARB */
- 254, /* GL_COORD_REPLACE_ARB */
- 1015, /* GL_POINT_SPRITE_R_MODE_NV */
- 1130, /* GL_QUERY_COUNTER_BITS */
- 277, /* GL_CURRENT_QUERY */
- 1132, /* GL_QUERY_RESULT */
- 1134, /* GL_QUERY_RESULT_AVAILABLE */
- 795, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- 1597, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- 321, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- 320, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 784, /* GL_MAX_TEXTURE_COORDS_ARB */
- 785, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- 1082, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1084, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1083, /* GL_PROGRAM_FORMAT_ARB */
- 1514, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- 302, /* GL_DEPTH_BOUNDS_TEST_EXT */
- 301, /* GL_DEPTH_BOUNDS_EXT */
- 48, /* GL_ARRAY_BUFFER */
- 388, /* GL_ELEMENT_ARRAY_BUFFER */
- 50, /* GL_ARRAY_BUFFER_BINDING */
- 390, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 1572, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 879, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- 130, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 514, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 1448, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- 384, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1233, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- 425, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 1615, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 1594, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1085, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 760, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1091, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 769, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1103, /* GL_PROGRAM_TEMPORARIES_ARB */
- 775, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1093, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 771, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1097, /* GL_PROGRAM_PARAMETERS_ARB */
- 774, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1092, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 770, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1078, /* GL_PROGRAM_ATTRIBS_ARB */
- 755, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1090, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 768, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1076, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 753, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1088, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 766, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 761, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 757, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1106, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 1525, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1142, /* GL_READ_ONLY */
- 1623, /* GL_WRITE_ONLY */
- 1144, /* GL_READ_WRITE */
- 91, /* GL_BUFFER_ACCESS */
- 93, /* GL_BUFFER_MAPPED */
- 95, /* GL_BUFFER_MAP_POINTER */
- 1519, /* GL_TIME_ELAPSED_EXT */
- 675, /* GL_MATRIX0_ARB */
- 687, /* GL_MATRIX1_ARB */
- 699, /* GL_MATRIX2_ARB */
- 703, /* GL_MATRIX3_ARB */
- 705, /* GL_MATRIX4_ARB */
- 707, /* GL_MATRIX5_ARB */
- 709, /* GL_MATRIX6_ARB */
- 711, /* GL_MATRIX7_ARB */
- 713, /* GL_MATRIX8_ARB */
- 714, /* GL_MATRIX9_ARB */
- 677, /* GL_MATRIX10_ARB */
- 678, /* GL_MATRIX11_ARB */
- 679, /* GL_MATRIX12_ARB */
- 680, /* GL_MATRIX13_ARB */
- 681, /* GL_MATRIX14_ARB */
- 682, /* GL_MATRIX15_ARB */
- 683, /* GL_MATRIX16_ARB */
- 684, /* GL_MATRIX17_ARB */
- 685, /* GL_MATRIX18_ARB */
- 686, /* GL_MATRIX19_ARB */
- 689, /* GL_MATRIX20_ARB */
- 690, /* GL_MATRIX21_ARB */
- 691, /* GL_MATRIX22_ARB */
- 692, /* GL_MATRIX23_ARB */
- 693, /* GL_MATRIX24_ARB */
- 694, /* GL_MATRIX25_ARB */
- 695, /* GL_MATRIX26_ARB */
- 696, /* GL_MATRIX27_ARB */
- 697, /* GL_MATRIX28_ARB */
- 698, /* GL_MATRIX29_ARB */
- 701, /* GL_MATRIX30_ARB */
- 702, /* GL_MATRIX31_ARB */
- 1325, /* GL_STREAM_DRAW */
- 1327, /* GL_STREAM_READ */
- 1323, /* GL_STREAM_COPY */
- 1298, /* GL_STATIC_DRAW */
- 1300, /* GL_STATIC_READ */
- 1296, /* GL_STATIC_COPY */
- 378, /* GL_DYNAMIC_DRAW */
- 380, /* GL_DYNAMIC_READ */
- 376, /* GL_DYNAMIC_COPY */
- 985, /* GL_PIXEL_PACK_BUFFER_EXT */
- 987, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- 984, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- 986, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- 758, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- 756, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 759, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 763, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 762, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 1319, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- 15, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 813, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1214, /* GL_SAMPLES_PASSED */
- 448, /* GL_FRAGMENT_SHADER_ARB */
- 1610, /* GL_VERTEX_SHADER_ARB */
- 1096, /* GL_PROGRAM_OBJECT_ARB */
- 1246, /* GL_SHADER_OBJECT_ARB */
- 745, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- 797, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- 794, /* GL_MAX_VARYING_FLOATS_ARB */
- 796, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- 732, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- 904, /* GL_OBJECT_TYPE_ARB */
- 903, /* GL_OBJECT_SUBTYPE_ARB */
- 416, /* GL_FLOAT_VEC2_ARB */
- 417, /* GL_FLOAT_VEC3_ARB */
- 418, /* GL_FLOAT_VEC4_ARB */
- 540, /* GL_INT_VEC2_ARB */
- 541, /* GL_INT_VEC3_ARB */
- 542, /* GL_INT_VEC4_ARB */
- 87, /* GL_BOOL_ARB */
- 88, /* GL_BOOL_VEC2_ARB */
- 89, /* GL_BOOL_VEC3_ARB */
- 90, /* GL_BOOL_VEC4_ARB */
- 413, /* GL_FLOAT_MAT2_ARB */
- 414, /* GL_FLOAT_MAT3_ARB */
- 415, /* GL_FLOAT_MAT4_ARB */
- 897, /* GL_OBJECT_DELETE_STATUS_ARB */
- 896, /* GL_OBJECT_COMPILE_STATUS_ARB */
- 900, /* GL_OBJECT_LINK_STATUS_ARB */
- 905, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- 898, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- 895, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- 893, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- 894, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- 902, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- 891, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- 892, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- 953, /* GL_PALETTE4_RGB8_OES */
- 955, /* GL_PALETTE4_RGBA8_OES */
- 951, /* GL_PALETTE4_R5_G6_B5_OES */
- 954, /* GL_PALETTE4_RGBA4_OES */
- 952, /* GL_PALETTE4_RGB5_A1_OES */
- 958, /* GL_PALETTE8_RGB8_OES */
- 960, /* GL_PALETTE8_RGBA8_OES */
- 956, /* GL_PALETTE8_R5_G6_B5_OES */
- 959, /* GL_PALETTE8_RGBA4_OES */
- 957, /* GL_PALETTE8_RGB5_A1_OES */
- 509, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- 508, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- 1013, /* GL_POINT_SPRITE_COORD_ORIGIN */
- 371, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- 1156, /* GL_RENDERBUFFER_BINDING_EXT */
- 1141, /* GL_READ_FRAMEBUFFER_EXT */
- 372, /* GL_DRAW_FRAMEBUFFER_EXT */
- 1140, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- 450, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- 449, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- 453, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- 452, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- 451, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- 455, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- 457, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- 462, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- 460, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- 458, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- 461, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- 459, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- 463, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- 465, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- 464, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 729, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- 136, /* GL_COLOR_ATTACHMENT0_EXT */
- 143, /* GL_COLOR_ATTACHMENT1_EXT */
- 144, /* GL_COLOR_ATTACHMENT2_EXT */
- 145, /* GL_COLOR_ATTACHMENT3_EXT */
- 146, /* GL_COLOR_ATTACHMENT4_EXT */
- 147, /* GL_COLOR_ATTACHMENT5_EXT */
- 148, /* GL_COLOR_ATTACHMENT6_EXT */
- 149, /* GL_COLOR_ATTACHMENT7_EXT */
- 150, /* GL_COLOR_ATTACHMENT8_EXT */
- 151, /* GL_COLOR_ATTACHMENT9_EXT */
- 137, /* GL_COLOR_ATTACHMENT10_EXT */
- 138, /* GL_COLOR_ATTACHMENT11_EXT */
- 139, /* GL_COLOR_ATTACHMENT12_EXT */
- 140, /* GL_COLOR_ATTACHMENT13_EXT */
- 141, /* GL_COLOR_ATTACHMENT14_EXT */
- 142, /* GL_COLOR_ATTACHMENT15_EXT */
- 298, /* GL_DEPTH_ATTACHMENT_EXT */
- 1303, /* GL_STENCIL_ATTACHMENT_EXT */
- 456, /* GL_FRAMEBUFFER_EXT */
- 1157, /* GL_RENDERBUFFER_EXT */
- 1160, /* GL_RENDERBUFFER_WIDTH_EXT */
- 1158, /* GL_RENDERBUFFER_HEIGHT_EXT */
- 1159, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- 1314, /* GL_STENCIL_INDEX_EXT */
- 1311, /* GL_STENCIL_INDEX1_EXT */
- 1312, /* GL_STENCIL_INDEX4_EXT */
- 1313, /* GL_STENCIL_INDEX8_EXT */
- 1310, /* GL_STENCIL_INDEX16_EXT */
- 396, /* GL_EVAL_BIT */
- 1138, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 591, /* GL_LIST_BIT */
- 1419, /* GL_TEXTURE_BIT */
- 1229, /* GL_SCISSOR_BIT */
- 25, /* GL_ALL_ATTRIB_BITS */
- 860, /* GL_MULTISAMPLE_BIT */
- 26, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ 351, /* GL_DOUBLE */
+ 123, /* GL_CLEAR */
+ 49, /* GL_AND */
+ 51, /* GL_AND_REVERSE */
+ 268, /* GL_COPY */
+ 50, /* GL_AND_INVERTED */
+ 953, /* GL_NOOP */
+ 1731, /* GL_XOR */
+ 1015, /* GL_OR */
+ 954, /* GL_NOR */
+ 426, /* GL_EQUIV */
+ 616, /* GL_INVERT */
+ 1018, /* GL_OR_REVERSE */
+ 269, /* GL_COPY_INVERTED */
+ 1017, /* GL_OR_INVERTED */
+ 944, /* GL_NAND */
+ 1330, /* GL_SET */
+ 423, /* GL_EMISSION */
+ 1338, /* GL_SHININESS */
+ 48, /* GL_AMBIENT_AND_DIFFUSE */
+ 165, /* GL_COLOR_INDEXES */
+ 894, /* GL_MODELVIEW */
+ 1186, /* GL_PROJECTION */
+ 1436, /* GL_TEXTURE */
+ 138, /* GL_COLOR */
+ 312, /* GL_DEPTH */
+ 1390, /* GL_STENCIL */
+ 164, /* GL_COLOR_INDEX */
+ 1404, /* GL_STENCIL_INDEX */
+ 321, /* GL_DEPTH_COMPONENT */
+ 1225, /* GL_RED */
+ 546, /* GL_GREEN */
+ 89, /* GL_BLUE */
+ 31, /* GL_ALPHA */
+ 1249, /* GL_RGB */
+ 1268, /* GL_RGBA */
+ 666, /* GL_LUMINANCE */
+ 687, /* GL_LUMINANCE_ALPHA */
+ 73, /* GL_BITMAP */
+ 1066, /* GL_POINT */
+ 636, /* GL_LINE */
+ 441, /* GL_FILL */
+ 1234, /* GL_RENDER */
+ 437, /* GL_FEEDBACK */
+ 1324, /* GL_SELECT */
+ 442, /* GL_FLAT */
+ 1343, /* GL_SMOOTH */
+ 617, /* GL_KEEP */
+ 1243, /* GL_REPLACE */
+ 573, /* GL_INCR */
+ 308, /* GL_DECR */
+ 1665, /* GL_VENDOR */
+ 1240, /* GL_RENDERER */
+ 1666, /* GL_VERSION */
+ 430, /* GL_EXTENSIONS */
+ 1289, /* GL_S */
+ 1427, /* GL_T */
+ 1215, /* GL_R */
+ 1204, /* GL_Q */
+ 930, /* GL_MODULATE */
+ 307, /* GL_DECAL */
+ 1568, /* GL_TEXTURE_ENV_MODE */
+ 1567, /* GL_TEXTURE_ENV_COLOR */
+ 1566, /* GL_TEXTURE_ENV */
+ 431, /* GL_EYE_LINEAR */
+ 977, /* GL_OBJECT_LINEAR */
+ 1369, /* GL_SPHERE_MAP */
+ 1570, /* GL_TEXTURE_GEN_MODE */
+ 979, /* GL_OBJECT_PLANE */
+ 432, /* GL_EYE_PLANE */
+ 945, /* GL_NEAREST */
+ 637, /* GL_LINEAR */
+ 949, /* GL_NEAREST_MIPMAP_NEAREST */
+ 642, /* GL_LINEAR_MIPMAP_NEAREST */
+ 948, /* GL_NEAREST_MIPMAP_LINEAR */
+ 641, /* GL_LINEAR_MIPMAP_LINEAR */
+ 1591, /* GL_TEXTURE_MAG_FILTER */
+ 1599, /* GL_TEXTURE_MIN_FILTER */
+ 1612, /* GL_TEXTURE_WRAP_S */
+ 1613, /* GL_TEXTURE_WRAP_T */
+ 117, /* GL_CLAMP */
+ 1242, /* GL_REPEAT */
+ 1104, /* GL_POLYGON_OFFSET_UNITS */
+ 1103, /* GL_POLYGON_OFFSET_POINT */
+ 1102, /* GL_POLYGON_OFFSET_LINE */
+ 1216, /* GL_R3_G3_B2 */
+ 1662, /* GL_V2F */
+ 1663, /* GL_V3F */
+ 114, /* GL_C4UB_V2F */
+ 115, /* GL_C4UB_V3F */
+ 112, /* GL_C3F_V3F */
+ 942, /* GL_N3F_V3F */
+ 113, /* GL_C4F_N3F_V3F */
+ 1432, /* GL_T2F_V3F */
+ 1434, /* GL_T4F_V4F */
+ 1430, /* GL_T2F_C4UB_V3F */
+ 1428, /* GL_T2F_C3F_V3F */
+ 1431, /* GL_T2F_N3F_V3F */
+ 1429, /* GL_T2F_C4F_N3F_V3F */
+ 1433, /* GL_T4F_C4F_N3F_V4F */
+ 130, /* GL_CLIP_PLANE0 */
+ 131, /* GL_CLIP_PLANE1 */
+ 132, /* GL_CLIP_PLANE2 */
+ 133, /* GL_CLIP_PLANE3 */
+ 134, /* GL_CLIP_PLANE4 */
+ 135, /* GL_CLIP_PLANE5 */
+ 621, /* GL_LIGHT0 */
+ 622, /* GL_LIGHT1 */
+ 623, /* GL_LIGHT2 */
+ 624, /* GL_LIGHT3 */
+ 625, /* GL_LIGHT4 */
+ 626, /* GL_LIGHT5 */
+ 627, /* GL_LIGHT6 */
+ 628, /* GL_LIGHT7 */
+ 550, /* GL_HINT_BIT */
+ 246, /* GL_CONSTANT_COLOR */
+ 989, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 241, /* GL_CONSTANT_ALPHA */
+ 987, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 76, /* GL_BLEND_COLOR */
+ 510, /* GL_FUNC_ADD */
+ 878, /* GL_MIN */
+ 791, /* GL_MAX */
+ 81, /* GL_BLEND_EQUATION */
+ 514, /* GL_FUNC_SUBTRACT */
+ 512, /* GL_FUNC_REVERSE_SUBTRACT */
+ 249, /* GL_CONVOLUTION_1D */
+ 250, /* GL_CONVOLUTION_2D */
+ 1327, /* GL_SEPARABLE_2D */
+ 253, /* GL_CONVOLUTION_BORDER_MODE */
+ 257, /* GL_CONVOLUTION_FILTER_SCALE */
+ 255, /* GL_CONVOLUTION_FILTER_BIAS */
+ 1226, /* GL_REDUCE */
+ 259, /* GL_CONVOLUTION_FORMAT */
+ 263, /* GL_CONVOLUTION_WIDTH */
+ 261, /* GL_CONVOLUTION_HEIGHT */
+ 805, /* GL_MAX_CONVOLUTION_WIDTH */
+ 803, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1143, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1139, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1134, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1130, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1141, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1137, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1132, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1128, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 551, /* GL_HISTOGRAM */
+ 1190, /* GL_PROXY_HISTOGRAM */
+ 567, /* GL_HISTOGRAM_WIDTH */
+ 557, /* GL_HISTOGRAM_FORMAT */
+ 563, /* GL_HISTOGRAM_RED_SIZE */
+ 559, /* GL_HISTOGRAM_GREEN_SIZE */
+ 554, /* GL_HISTOGRAM_BLUE_SIZE */
+ 552, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 561, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 565, /* GL_HISTOGRAM_SINK */
+ 879, /* GL_MINMAX */
+ 881, /* GL_MINMAX_FORMAT */
+ 883, /* GL_MINMAX_SINK */
+ 1435, /* GL_TABLE_TOO_LARGE_EXT */
+ 1643, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 1652, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 1654, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 1648, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 1645, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1101, /* GL_POLYGON_OFFSET_FILL */
+ 1100, /* GL_POLYGON_OFFSET_FACTOR */
+ 1099, /* GL_POLYGON_OFFSET_BIAS */
+ 1246, /* GL_RESCALE_NORMAL */
+ 36, /* GL_ALPHA4 */
+ 38, /* GL_ALPHA8 */
+ 32, /* GL_ALPHA12 */
+ 34, /* GL_ALPHA16 */
+ 677, /* GL_LUMINANCE4 */
+ 683, /* GL_LUMINANCE8 */
+ 667, /* GL_LUMINANCE12 */
+ 673, /* GL_LUMINANCE16 */
+ 678, /* GL_LUMINANCE4_ALPHA4 */
+ 681, /* GL_LUMINANCE6_ALPHA2 */
+ 684, /* GL_LUMINANCE8_ALPHA8 */
+ 670, /* GL_LUMINANCE12_ALPHA4 */
+ 668, /* GL_LUMINANCE12_ALPHA12 */
+ 674, /* GL_LUMINANCE16_ALPHA16 */
+ 591, /* GL_INTENSITY */
+ 596, /* GL_INTENSITY4 */
+ 598, /* GL_INTENSITY8 */
+ 592, /* GL_INTENSITY12 */
+ 594, /* GL_INTENSITY16 */
+ 1258, /* GL_RGB2_EXT */
+ 1259, /* GL_RGB4 */
+ 1262, /* GL_RGB5 */
+ 1266, /* GL_RGB8 */
+ 1250, /* GL_RGB10 */
+ 1254, /* GL_RGB12 */
+ 1256, /* GL_RGB16 */
+ 1273, /* GL_RGBA2 */
+ 1275, /* GL_RGBA4 */
+ 1263, /* GL_RGB5_A1 */
+ 1279, /* GL_RGBA8 */
+ 1251, /* GL_RGB10_A2 */
+ 1269, /* GL_RGBA12 */
+ 1271, /* GL_RGBA16 */
+ 1604, /* GL_TEXTURE_RED_SIZE */
+ 1576, /* GL_TEXTURE_GREEN_SIZE */
+ 1515, /* GL_TEXTURE_BLUE_SIZE */
+ 1504, /* GL_TEXTURE_ALPHA_SIZE */
+ 1589, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 1580, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1244, /* GL_REPLACE_EXT */
+ 1194, /* GL_PROXY_TEXTURE_1D */
+ 1196, /* GL_PROXY_TEXTURE_2D */
+ 1608, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 1601, /* GL_TEXTURE_PRIORITY */
+ 1606, /* GL_TEXTURE_RESIDENT */
+ 1507, /* GL_TEXTURE_BINDING_1D */
+ 1508, /* GL_TEXTURE_BINDING_2D */
+ 1509, /* GL_TEXTURE_BINDING_3D */
+ 1025, /* GL_PACK_SKIP_IMAGES */
+ 1021, /* GL_PACK_IMAGE_HEIGHT */
+ 1637, /* GL_UNPACK_SKIP_IMAGES */
+ 1634, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1503, /* GL_TEXTURE_3D */
+ 1198, /* GL_PROXY_TEXTURE_3D */
+ 1563, /* GL_TEXTURE_DEPTH */
+ 1611, /* GL_TEXTURE_WRAP_R */
+ 792, /* GL_MAX_3D_TEXTURE_SIZE */
+ 1667, /* GL_VERTEX_ARRAY */
+ 956, /* GL_NORMAL_ARRAY */
+ 139, /* GL_COLOR_ARRAY */
+ 576, /* GL_INDEX_ARRAY */
+ 1542, /* GL_TEXTURE_COORD_ARRAY */
+ 414, /* GL_EDGE_FLAG_ARRAY */
+ 1672, /* GL_VERTEX_ARRAY_SIZE */
+ 1674, /* GL_VERTEX_ARRAY_TYPE */
+ 1673, /* GL_VERTEX_ARRAY_STRIDE */
+ 961, /* GL_NORMAL_ARRAY_TYPE */
+ 960, /* GL_NORMAL_ARRAY_STRIDE */
+ 143, /* GL_COLOR_ARRAY_SIZE */
+ 145, /* GL_COLOR_ARRAY_TYPE */
+ 144, /* GL_COLOR_ARRAY_STRIDE */
+ 581, /* GL_INDEX_ARRAY_TYPE */
+ 580, /* GL_INDEX_ARRAY_STRIDE */
+ 1546, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 1548, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 1547, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 418, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ 1671, /* GL_VERTEX_ARRAY_POINTER */
+ 959, /* GL_NORMAL_ARRAY_POINTER */
+ 142, /* GL_COLOR_ARRAY_POINTER */
+ 579, /* GL_INDEX_ARRAY_POINTER */
+ 1545, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 417, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ 935, /* GL_MULTISAMPLE */
+ 1301, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1303, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1308, /* GL_SAMPLE_COVERAGE */
+ 1305, /* GL_SAMPLE_BUFFERS */
+ 1296, /* GL_SAMPLES */
+ 1312, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1310, /* GL_SAMPLE_COVERAGE_INVERT */
+ 170, /* GL_COLOR_MATRIX */
+ 172, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ 799, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1126, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1122, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1117, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1113, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1124, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1120, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1115, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1111, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 1525, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1199, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 1527, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 80, /* GL_BLEND_DST_RGB */
+ 88, /* GL_BLEND_SRC_RGB */
+ 79, /* GL_BLEND_DST_ALPHA */
+ 87, /* GL_BLEND_SRC_ALPHA */
+ 176, /* GL_COLOR_TABLE */
+ 1136, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1119, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1189, /* GL_PROXY_COLOR_TABLE */
+ 1193, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1192, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 200, /* GL_COLOR_TABLE_SCALE */
+ 180, /* GL_COLOR_TABLE_BIAS */
+ 185, /* GL_COLOR_TABLE_FORMAT */
+ 202, /* GL_COLOR_TABLE_WIDTH */
+ 197, /* GL_COLOR_TABLE_RED_SIZE */
+ 188, /* GL_COLOR_TABLE_GREEN_SIZE */
+ 182, /* GL_COLOR_TABLE_BLUE_SIZE */
+ 177, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ 194, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ 191, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ 71, /* GL_BGR */
+ 72, /* GL_BGRA */
+ 813, /* GL_MAX_ELEMENTS_VERTICES */
+ 812, /* GL_MAX_ELEMENTS_INDICES */
+ 1579, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 136, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ 1083, /* GL_POINT_SIZE_MIN */
+ 1079, /* GL_POINT_SIZE_MAX */
+ 1073, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1069, /* GL_POINT_DISTANCE_ATTENUATION */
+ 118, /* GL_CLAMP_TO_BORDER */
+ 121, /* GL_CLAMP_TO_EDGE */
+ 1600, /* GL_TEXTURE_MIN_LOD */
+ 1598, /* GL_TEXTURE_MAX_LOD */
+ 1506, /* GL_TEXTURE_BASE_LEVEL */
+ 1597, /* GL_TEXTURE_MAX_LEVEL */
+ 570, /* GL_IGNORE_BORDER_HP */
+ 245, /* GL_CONSTANT_BORDER_HP */
+ 1245, /* GL_REPLICATE_BORDER_HP */
+ 251, /* GL_CONVOLUTION_BORDER_COLOR */
+ 984, /* GL_OCCLUSION_TEST_HP */
+ 985, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 639, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 1519, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 1521, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 1523, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 1524, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1522, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 1520, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 795, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 796, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1146, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1148, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1145, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1147, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 1587, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 1588, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 1586, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 516, /* GL_GENERATE_MIPMAP */
+ 517, /* GL_GENERATE_MIPMAP_HINT */
+ 480, /* GL_FOG_OFFSET_SGIX */
+ 481, /* GL_FOG_OFFSET_VALUE_SGIX */
+ 1533, /* GL_TEXTURE_COMPARE_SGIX */
+ 1532, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 1583, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 1575, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 322, /* GL_DEPTH_COMPONENT16 */
+ 325, /* GL_DEPTH_COMPONENT24 */
+ 328, /* GL_DEPTH_COMPONENT32 */
+ 273, /* GL_CULL_VERTEX_EXT */
+ 275, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ 274, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ 1728, /* GL_WRAP_BORDER_SUN */
+ 1526, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 632, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1340, /* GL_SINGLE_COLOR */
+ 1328, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1337, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 1642, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 1655, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 1656, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 1653, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 1651, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 1649, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 1647, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 1595, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 1596, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 1594, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 886, /* GL_MIRRORED_REPEAT */
+ 1284, /* GL_RGB_S3TC */
+ 1261, /* GL_RGB4_S3TC */
+ 1283, /* GL_RGBA_S3TC */
+ 1278, /* GL_RGBA4_S3TC */
+ 1281, /* GL_RGBA_DXT5_S3TC */
+ 1276, /* GL_RGBA4_DXT5_S3TC */
+ 238, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ 233, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ 234, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ 235, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ 947, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 946, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 640, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 467, /* GL_FOG_COORDINATE_SOURCE */
+ 459, /* GL_FOG_COORD */
+ 483, /* GL_FRAGMENT_DEPTH */
+ 279, /* GL_CURRENT_FOG_COORD */
+ 466, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ 465, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ 464, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ 461, /* GL_FOG_COORDINATE_ARRAY */
+ 174, /* GL_COLOR_SUM */
+ 298, /* GL_CURRENT_SECONDARY_COLOR */
+ 1321, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1323, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1322, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1320, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1317, /* GL_SECONDARY_COLOR_ARRAY */
+ 526, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */
+ 28, /* GL_ALIASED_POINT_SIZE_RANGE */
+ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ 1437, /* GL_TEXTURE0 */
+ 1439, /* GL_TEXTURE1 */
+ 1461, /* GL_TEXTURE2 */
+ 1483, /* GL_TEXTURE3 */
+ 1489, /* GL_TEXTURE4 */
+ 1491, /* GL_TEXTURE5 */
+ 1493, /* GL_TEXTURE6 */
+ 1495, /* GL_TEXTURE7 */
+ 1497, /* GL_TEXTURE8 */
+ 1499, /* GL_TEXTURE9 */
+ 1440, /* GL_TEXTURE10 */
+ 1442, /* GL_TEXTURE11 */
+ 1444, /* GL_TEXTURE12 */
+ 1446, /* GL_TEXTURE13 */
+ 1448, /* GL_TEXTURE14 */
+ 1450, /* GL_TEXTURE15 */
+ 1452, /* GL_TEXTURE16 */
+ 1454, /* GL_TEXTURE17 */
+ 1456, /* GL_TEXTURE18 */
+ 1458, /* GL_TEXTURE19 */
+ 1462, /* GL_TEXTURE20 */
+ 1464, /* GL_TEXTURE21 */
+ 1466, /* GL_TEXTURE22 */
+ 1468, /* GL_TEXTURE23 */
+ 1470, /* GL_TEXTURE24 */
+ 1472, /* GL_TEXTURE25 */
+ 1474, /* GL_TEXTURE26 */
+ 1476, /* GL_TEXTURE27 */
+ 1478, /* GL_TEXTURE28 */
+ 1480, /* GL_TEXTURE29 */
+ 1484, /* GL_TEXTURE30 */
+ 1486, /* GL_TEXTURE31 */
+ 18, /* GL_ACTIVE_TEXTURE */
+ 124, /* GL_CLIENT_ACTIVE_TEXTURE */
+ 864, /* GL_MAX_TEXTURE_UNITS */
+ 1621, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 1624, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 1626, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 1618, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1425, /* GL_SUBTRACT */
+ 853, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ 221, /* GL_COMPRESSED_ALPHA */
+ 225, /* GL_COMPRESSED_LUMINANCE */
+ 226, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ 223, /* GL_COMPRESSED_INTENSITY */
+ 229, /* GL_COMPRESSED_RGB */
+ 230, /* GL_COMPRESSED_RGBA */
+ 1540, /* GL_TEXTURE_COMPRESSION_HINT */
+ 1602, /* GL_TEXTURE_RECTANGLE_ARB */
+ 1512, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ 1202, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ 851, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ 334, /* GL_DEPTH_STENCIL_NV */
+ 1646, /* GL_UNSIGNED_INT_24_8_NV */
+ 860, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 1593, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 861, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1569, /* GL_TEXTURE_FILTER_CONTROL */
+ 1584, /* GL_TEXTURE_LOD_BIAS */
+ 207, /* GL_COMBINE4 */
+ 854, /* GL_MAX_SHININESS_NV */
+ 855, /* GL_MAX_SPOT_EXPONENT_NV */
+ 574, /* GL_INCR_WRAP */
+ 309, /* GL_DECR_WRAP */
+ 906, /* GL_MODELVIEW1_ARB */
+ 962, /* GL_NORMAL_MAP */
+ 1231, /* GL_REFLECTION_MAP */
+ 1549, /* GL_TEXTURE_CUBE_MAP */
+ 1510, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 1557, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 1551, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 1559, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 1553, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 1561, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 1555, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1200, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 807, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 941, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 475, /* GL_FOG_DISTANCE_MODE_NV */
+ 434, /* GL_EYE_RADIAL_NV */
+ 433, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ 206, /* GL_COMBINE */
+ 213, /* GL_COMBINE_RGB */
+ 208, /* GL_COMBINE_ALPHA */
+ 1285, /* GL_RGB_SCALE */
+ 24, /* GL_ADD_SIGNED */
+ 601, /* GL_INTERPOLATE */
+ 240, /* GL_CONSTANT */
+ 1152, /* GL_PRIMARY_COLOR */
+ 1149, /* GL_PREVIOUS */
+ 1351, /* GL_SOURCE0_RGB */
+ 1357, /* GL_SOURCE1_RGB */
+ 1363, /* GL_SOURCE2_RGB */
+ 1367, /* GL_SOURCE3_RGB_NV */
+ 1348, /* GL_SOURCE0_ALPHA */
+ 1354, /* GL_SOURCE1_ALPHA */
+ 1360, /* GL_SOURCE2_ALPHA */
+ 1366, /* GL_SOURCE3_ALPHA_NV */
+ 998, /* GL_OPERAND0_RGB */
+ 1004, /* GL_OPERAND1_RGB */
+ 1010, /* GL_OPERAND2_RGB */
+ 1014, /* GL_OPERAND3_RGB_NV */
+ 995, /* GL_OPERAND0_ALPHA */
+ 1001, /* GL_OPERAND1_ALPHA */
+ 1007, /* GL_OPERAND2_ALPHA */
+ 1013, /* GL_OPERAND3_ALPHA_NV */
+ 1668, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ 1732, /* GL_YCBCR_422_APPLE */
+ 1657, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 1659, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 1342, /* GL_SLICE_ACCUM_SUN */
+ 1207, /* GL_QUAD_MESH_SUN */
+ 1630, /* GL_TRIANGLE_MESH_SUN */
+ 1706, /* GL_VERTEX_PROGRAM_ARB */
+ 1717, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 1693, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 1699, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 1701, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 1703, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 300, /* GL_CURRENT_VERTEX_ATTRIB */
+ 1165, /* GL_PROGRAM_LENGTH_ARB */
+ 1179, /* GL_PROGRAM_STRING_ARB */
+ 928, /* GL_MODELVIEW_PROJECTION_NV */
+ 569, /* GL_IDENTITY_NV */
+ 614, /* GL_INVERSE_NV */
+ 1623, /* GL_TRANSPOSE_NV */
+ 615, /* GL_INVERSE_TRANSPOSE_NV */
+ 837, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 836, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 745, /* GL_MATRIX0_NV */
+ 757, /* GL_MATRIX1_NV */
+ 769, /* GL_MATRIX2_NV */
+ 773, /* GL_MATRIX3_NV */
+ 775, /* GL_MATRIX4_NV */
+ 777, /* GL_MATRIX5_NV */
+ 779, /* GL_MATRIX6_NV */
+ 781, /* GL_MATRIX7_NV */
+ 285, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ 282, /* GL_CURRENT_MATRIX_ARB */
+ 1709, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ 1712, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1177, /* GL_PROGRAM_PARAMETER_NV */
+ 1697, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1181, /* GL_PROGRAM_TARGET_NV */
+ 1178, /* GL_PROGRAM_RESIDENT_NV */
+ 1615, /* GL_TRACK_MATRIX_NV */
+ 1616, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 1707, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1159, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 319, /* GL_DEPTH_CLAMP_NV */
+ 1675, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 1682, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 1683, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 1684, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 1685, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 1686, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 1687, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 1688, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 1689, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 1690, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 1676, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 1677, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 1678, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 1679, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 1680, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 1681, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 699, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 706, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 707, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 708, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 709, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 710, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 711, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 712, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 713, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 714, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 700, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 701, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 702, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 703, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 704, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 705, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 726, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 733, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 734, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 735, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 736, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 737, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 738, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1158, /* GL_PROGRAM_BINDING_ARB */
+ 740, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 741, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 727, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 728, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 729, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 730, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 731, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 732, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 1538, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 1535, /* GL_TEXTURE_COMPRESSED */
+ 967, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 239, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ 876, /* GL_MAX_VERTEX_UNITS_ARB */
+ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ 1727, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 1705, /* GL_VERTEX_BLEND_ARB */
+ 302, /* GL_CURRENT_WEIGHT_ARB */
+ 1726, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 1725, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 1724, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 1723, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 1720, /* GL_WEIGHT_ARRAY_ARB */
+ 345, /* GL_DOT3_RGB */
+ 346, /* GL_DOT3_RGBA */
+ 237, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ 232, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ 936, /* GL_MULTISAMPLE_3DFX */
+ 1306, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1297, /* GL_SAMPLES_3DFX */
+ 917, /* GL_MODELVIEW2_ARB */
+ 920, /* GL_MODELVIEW3_ARB */
+ 921, /* GL_MODELVIEW4_ARB */
+ 922, /* GL_MODELVIEW5_ARB */
+ 923, /* GL_MODELVIEW6_ARB */
+ 924, /* GL_MODELVIEW7_ARB */
+ 925, /* GL_MODELVIEW8_ARB */
+ 926, /* GL_MODELVIEW9_ARB */
+ 896, /* GL_MODELVIEW10_ARB */
+ 897, /* GL_MODELVIEW11_ARB */
+ 898, /* GL_MODELVIEW12_ARB */
+ 899, /* GL_MODELVIEW13_ARB */
+ 900, /* GL_MODELVIEW14_ARB */
+ 901, /* GL_MODELVIEW15_ARB */
+ 902, /* GL_MODELVIEW16_ARB */
+ 903, /* GL_MODELVIEW17_ARB */
+ 904, /* GL_MODELVIEW18_ARB */
+ 905, /* GL_MODELVIEW19_ARB */
+ 907, /* GL_MODELVIEW20_ARB */
+ 908, /* GL_MODELVIEW21_ARB */
+ 909, /* GL_MODELVIEW22_ARB */
+ 910, /* GL_MODELVIEW23_ARB */
+ 911, /* GL_MODELVIEW24_ARB */
+ 912, /* GL_MODELVIEW25_ARB */
+ 913, /* GL_MODELVIEW26_ARB */
+ 914, /* GL_MODELVIEW27_ARB */
+ 915, /* GL_MODELVIEW28_ARB */
+ 916, /* GL_MODELVIEW29_ARB */
+ 918, /* GL_MODELVIEW30_ARB */
+ 919, /* GL_MODELVIEW31_ARB */
+ 350, /* GL_DOT3_RGB_EXT */
+ 348, /* GL_DOT3_RGBA_EXT */
+ 890, /* GL_MIRROR_CLAMP_EXT */
+ 893, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 931, /* GL_MODULATE_ADD_ATI */
+ 932, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 933, /* GL_MODULATE_SUBTRACT_ATI */
+ 1733, /* GL_YCBCR_MESA */
+ 1022, /* GL_PACK_INVERT_MESA */
+ 305, /* GL_DEBUG_OBJECT_MESA */
+ 306, /* GL_DEBUG_PRINT_MESA */
+ 304, /* GL_DEBUG_ASSERT_MESA */
+ 107, /* GL_BUFFER_SIZE */
+ 109, /* GL_BUFFER_USAGE */
+ 1393, /* GL_STENCIL_BACK_FUNC */
+ 1392, /* GL_STENCIL_BACK_FAIL */
+ 1394, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1395, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 484, /* GL_FRAGMENT_PROGRAM_ARB */
+ 1156, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1184, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1183, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1168, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1174, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1173, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 826, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 849, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 848, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 839, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 845, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 844, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 809, /* GL_MAX_DRAW_BUFFERS */
+ 354, /* GL_DRAW_BUFFER0 */
+ 357, /* GL_DRAW_BUFFER1 */
+ 378, /* GL_DRAW_BUFFER2 */
+ 381, /* GL_DRAW_BUFFER3 */
+ 384, /* GL_DRAW_BUFFER4 */
+ 387, /* GL_DRAW_BUFFER5 */
+ 390, /* GL_DRAW_BUFFER6 */
+ 393, /* GL_DRAW_BUFFER7 */
+ 396, /* GL_DRAW_BUFFER8 */
+ 399, /* GL_DRAW_BUFFER9 */
+ 358, /* GL_DRAW_BUFFER10 */
+ 361, /* GL_DRAW_BUFFER11 */
+ 364, /* GL_DRAW_BUFFER12 */
+ 367, /* GL_DRAW_BUFFER13 */
+ 370, /* GL_DRAW_BUFFER14 */
+ 373, /* GL_DRAW_BUFFER15 */
+ 82, /* GL_BLEND_EQUATION_ALPHA */
+ 790, /* GL_MATRIX_PALETTE_ARB */
+ 820, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 823, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 288, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ 784, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 283, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ 786, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 788, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 787, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 785, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 1564, /* GL_TEXTURE_DEPTH_SIZE */
+ 338, /* GL_DEPTH_TEXTURE_MODE */
+ 1530, /* GL_TEXTURE_COMPARE_MODE */
+ 1528, /* GL_TEXTURE_COMPARE_FUNC */
+ 216, /* GL_COMPARE_R_TO_TEXTURE */
+ 1090, /* GL_POINT_SPRITE */
+ 265, /* GL_COORD_REPLACE */
+ 1094, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1209, /* GL_QUERY_COUNTER_BITS */
+ 290, /* GL_CURRENT_QUERY */
+ 1211, /* GL_QUERY_RESULT */
+ 1213, /* GL_QUERY_RESULT_AVAILABLE */
+ 870, /* GL_MAX_VERTEX_ATTRIBS */
+ 1695, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 336, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ 335, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ 856, /* GL_MAX_TEXTURE_COORDS */
+ 858, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ 1161, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1163, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1162, /* GL_PROGRAM_FORMAT_ARB */
+ 1609, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 317, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ 316, /* GL_DEPTH_BOUNDS_EXT */
+ 52, /* GL_ARRAY_BUFFER */
+ 419, /* GL_ELEMENT_ARRAY_BUFFER */
+ 54, /* GL_ARRAY_BUFFER_BINDING */
+ 421, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ 1669, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 957, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 140, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ 577, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 1543, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 415, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ 1318, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 462, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ 1721, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 1691, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1164, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 832, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1170, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 841, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1182, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 847, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1172, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 843, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1176, /* GL_PROGRAM_PARAMETERS_ARB */
+ 846, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1171, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 842, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1157, /* GL_PROGRAM_ATTRIBS_ARB */
+ 827, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1169, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 840, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1155, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 825, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1167, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 838, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 833, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 829, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1185, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 1620, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1221, /* GL_READ_ONLY */
+ 1729, /* GL_WRITE_ONLY */
+ 1223, /* GL_READ_WRITE */
+ 101, /* GL_BUFFER_ACCESS */
+ 103, /* GL_BUFFER_MAPPED */
+ 105, /* GL_BUFFER_MAP_POINTER */
+ 1614, /* GL_TIME_ELAPSED_EXT */
+ 744, /* GL_MATRIX0_ARB */
+ 756, /* GL_MATRIX1_ARB */
+ 768, /* GL_MATRIX2_ARB */
+ 772, /* GL_MATRIX3_ARB */
+ 774, /* GL_MATRIX4_ARB */
+ 776, /* GL_MATRIX5_ARB */
+ 778, /* GL_MATRIX6_ARB */
+ 780, /* GL_MATRIX7_ARB */
+ 782, /* GL_MATRIX8_ARB */
+ 783, /* GL_MATRIX9_ARB */
+ 746, /* GL_MATRIX10_ARB */
+ 747, /* GL_MATRIX11_ARB */
+ 748, /* GL_MATRIX12_ARB */
+ 749, /* GL_MATRIX13_ARB */
+ 750, /* GL_MATRIX14_ARB */
+ 751, /* GL_MATRIX15_ARB */
+ 752, /* GL_MATRIX16_ARB */
+ 753, /* GL_MATRIX17_ARB */
+ 754, /* GL_MATRIX18_ARB */
+ 755, /* GL_MATRIX19_ARB */
+ 758, /* GL_MATRIX20_ARB */
+ 759, /* GL_MATRIX21_ARB */
+ 760, /* GL_MATRIX22_ARB */
+ 761, /* GL_MATRIX23_ARB */
+ 762, /* GL_MATRIX24_ARB */
+ 763, /* GL_MATRIX25_ARB */
+ 764, /* GL_MATRIX26_ARB */
+ 765, /* GL_MATRIX27_ARB */
+ 766, /* GL_MATRIX28_ARB */
+ 767, /* GL_MATRIX29_ARB */
+ 770, /* GL_MATRIX30_ARB */
+ 771, /* GL_MATRIX31_ARB */
+ 1420, /* GL_STREAM_DRAW */
+ 1422, /* GL_STREAM_READ */
+ 1418, /* GL_STREAM_COPY */
+ 1386, /* GL_STATIC_DRAW */
+ 1388, /* GL_STATIC_READ */
+ 1384, /* GL_STATIC_COPY */
+ 409, /* GL_DYNAMIC_DRAW */
+ 411, /* GL_DYNAMIC_READ */
+ 407, /* GL_DYNAMIC_COPY */
+ 533, /* GL_GL_PIXEL_PACK_BUFFER */
+ 535, /* GL_GL_PIXEL_UNPACK_BUFFER */
+ 534, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */
+ 536, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 830, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ 828, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 831, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 835, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 834, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 1414, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ 891, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1299, /* GL_SAMPLES_PASSED */
+ 485, /* GL_FRAGMENT_SHADER */
+ 1715, /* GL_VERTEX_SHADER */
+ 1175, /* GL_PROGRAM_OBJECT_ARB */
+ 1331, /* GL_SHADER_OBJECT_ARB */
+ 816, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ 874, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ 868, /* GL_MAX_VARYING_FLOATS */
+ 872, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ 801, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ 982, /* GL_OBJECT_TYPE_ARB */
+ 1333, /* GL_SHADER_TYPE */
+ 450, /* GL_FLOAT_VEC2 */
+ 452, /* GL_FLOAT_VEC3 */
+ 454, /* GL_FLOAT_VEC4 */
+ 604, /* GL_INT_VEC2 */
+ 606, /* GL_INT_VEC3 */
+ 608, /* GL_INT_VEC4 */
+ 93, /* GL_BOOL */
+ 95, /* GL_BOOL_VEC2 */
+ 97, /* GL_BOOL_VEC3 */
+ 99, /* GL_BOOL_VEC4 */
+ 444, /* GL_FLOAT_MAT2 */
+ 446, /* GL_FLOAT_MAT3 */
+ 448, /* GL_FLOAT_MAT4 */
+ 1290, /* GL_SAMPLER_1D */
+ 1292, /* GL_SAMPLER_2D */
+ 1294, /* GL_SAMPLER_3D */
+ 1295, /* GL_SAMPLER_CUBE */
+ 1291, /* GL_SAMPLER_1D_SHADOW */
+ 1293, /* GL_SAMPLER_2D_SHADOW */
+ 527, /* GL_GL_FLOAT_MAT2x3 */
+ 528, /* GL_GL_FLOAT_MAT2x4 */
+ 529, /* GL_GL_FLOAT_MAT3x2 */
+ 530, /* GL_GL_FLOAT_MAT3x4 */
+ 531, /* GL_GL_FLOAT_MAT4x2 */
+ 532, /* GL_GL_FLOAT_MAT4x3 */
+ 311, /* GL_DELETE_STATUS */
+ 220, /* GL_COMPILE_STATUS */
+ 657, /* GL_LINK_STATUS */
+ 1664, /* GL_VALIDATE_STATUS */
+ 589, /* GL_INFO_LOG_LENGTH */
+ 56, /* GL_ATTACHED_SHADERS */
+ 20, /* GL_ACTIVE_UNIFORMS */
+ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ 1332, /* GL_SHADER_SOURCE_LENGTH */
+ 15, /* GL_ACTIVE_ATTRIBUTES */
+ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ 487, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ 1335, /* GL_SHADING_LANGUAGE_VERSION */
+ 289, /* GL_CURRENT_PROGRAM */
+ 1031, /* GL_PALETTE4_RGB8_OES */
+ 1033, /* GL_PALETTE4_RGBA8_OES */
+ 1029, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1032, /* GL_PALETTE4_RGBA4_OES */
+ 1030, /* GL_PALETTE4_RGB5_A1_OES */
+ 1036, /* GL_PALETTE8_RGB8_OES */
+ 1038, /* GL_PALETTE8_RGBA8_OES */
+ 1034, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1037, /* GL_PALETTE8_RGBA4_OES */
+ 1035, /* GL_PALETTE8_RGB5_A1_OES */
+ 572, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ 571, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ 541, /* GL_GL_SRGB */
+ 542, /* GL_GL_SRGB8 */
+ 544, /* GL_GL_SRGB_ALPHA */
+ 543, /* GL_GL_SRGB8_ALPHA8 */
+ 540, /* GL_GL_SLUMINANCE_ALPHA */
+ 539, /* GL_GL_SLUMINANCE8_ALPHA8 */
+ 537, /* GL_GL_SLUMINANCE */
+ 538, /* GL_GL_SLUMINANCE8 */
+ 524, /* GL_GL_COMPRESSED_SRGB */
+ 525, /* GL_GL_COMPRESSED_SRGB_ALPHA */
+ 522, /* GL_GL_COMPRESSED_SLUMINANCE */
+ 523, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */
+ 1092, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 665, /* GL_LOWER_LEFT */
+ 1661, /* GL_UPPER_LEFT */
+ 1396, /* GL_STENCIL_BACK_REF */
+ 1397, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1398, /* GL_STENCIL_BACK_WRITEMASK */
+ 402, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ 1235, /* GL_RENDERBUFFER_BINDING_EXT */
+ 1220, /* GL_READ_FRAMEBUFFER_EXT */
+ 403, /* GL_DRAW_FRAMEBUFFER_EXT */
+ 1219, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ 488, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ 490, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ 494, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ 496, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ 501, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ 499, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ 497, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ 500, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ 498, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ 502, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ 504, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ 503, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ 798, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ 146, /* GL_COLOR_ATTACHMENT0_EXT */
+ 153, /* GL_COLOR_ATTACHMENT1_EXT */
+ 154, /* GL_COLOR_ATTACHMENT2_EXT */
+ 155, /* GL_COLOR_ATTACHMENT3_EXT */
+ 156, /* GL_COLOR_ATTACHMENT4_EXT */
+ 157, /* GL_COLOR_ATTACHMENT5_EXT */
+ 158, /* GL_COLOR_ATTACHMENT6_EXT */
+ 159, /* GL_COLOR_ATTACHMENT7_EXT */
+ 160, /* GL_COLOR_ATTACHMENT8_EXT */
+ 161, /* GL_COLOR_ATTACHMENT9_EXT */
+ 147, /* GL_COLOR_ATTACHMENT10_EXT */
+ 148, /* GL_COLOR_ATTACHMENT11_EXT */
+ 149, /* GL_COLOR_ATTACHMENT12_EXT */
+ 150, /* GL_COLOR_ATTACHMENT13_EXT */
+ 151, /* GL_COLOR_ATTACHMENT14_EXT */
+ 152, /* GL_COLOR_ATTACHMENT15_EXT */
+ 313, /* GL_DEPTH_ATTACHMENT_EXT */
+ 1391, /* GL_STENCIL_ATTACHMENT_EXT */
+ 495, /* GL_FRAMEBUFFER_EXT */
+ 1236, /* GL_RENDERBUFFER_EXT */
+ 1239, /* GL_RENDERBUFFER_WIDTH_EXT */
+ 1237, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ 1238, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ 1409, /* GL_STENCIL_INDEX_EXT */
+ 1406, /* GL_STENCIL_INDEX1_EXT */
+ 1407, /* GL_STENCIL_INDEX4_EXT */
+ 1408, /* GL_STENCIL_INDEX8_EXT */
+ 1405, /* GL_STENCIL_INDEX16_EXT */
+ 427, /* GL_EVAL_BIT */
+ 1217, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 659, /* GL_LIST_BIT */
+ 1514, /* GL_TEXTURE_BIT */
+ 1314, /* GL_SCISSOR_BIT */
+ 29, /* GL_ALL_ATTRIB_BITS */
+ 938, /* GL_MULTISAMPLE_BIT */
};
#define Elements(x) sizeof(x)/sizeof(*x)
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 39f8e26f577..b61cb821f7d 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -58,6 +58,7 @@ static const struct {
{ OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) },
{ OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) },
{ OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) },
+ { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) },
{ OFF, "GL_ARB_shadow", F(ARB_shadow) },
{ OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) },
{ OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) },
@@ -390,7 +391,6 @@ _mesa_enable_2_0_extensions(GLcontext *ctx)
#if FEATURE_ARB_shading_language_100
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
#endif
- ctx->Extensions.ATI_separate_stencil = GL_TRUE;
ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */
#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
@@ -411,7 +411,9 @@ _mesa_enable_2_1_extensions(GLcontext *ctx)
#if FEATURE_EXT_texture_sRGB
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
#endif
- /* plus: shading language extensions, non-square uniform matrices */
+#ifdef FEATURE_ARB_shading_language_120
+ ctx->Extensions.ARB_shading_language_120 = GL_TRUE;
+#endif
}
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 9f3a8d12cfc..9b2a42f7c1a 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1833,6 +1833,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]);
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[1]);
+ break;
case GL_STENCIL_BACK_REF:
params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]);
break;
@@ -3657,6 +3660,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]);
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = (GLfloat)(ctx->Stencil.WriteMask[1]);
+ break;
case GL_STENCIL_BACK_REF:
params[0] = (GLfloat)(ctx->Stencil.Ref[1]);
break;
@@ -5481,6 +5487,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
case GL_STENCIL_BACK_VALUE_MASK:
params[0] = ctx->Stencil.ValueMask[1];
break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ params[0] = ctx->Stencil.WriteMask[1];
+ break;
case GL_STENCIL_BACK_REF:
params[0] = ctx->Stencil.Ref[1];
break;
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 50ff13d2f9f..c18216d4a8f 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -958,6 +958,7 @@ StateVars = [
# OpenGL 2.0
( "GL_STENCIL_BACK_FUNC", GLenum, ["ctx->Stencil.Function[1]"], "", None ),
( "GL_STENCIL_BACK_VALUE_MASK", GLint, ["ctx->Stencil.ValueMask[1]"], "", None ),
+ ( "GL_STENCIL_BACK_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[1]"], "", None ),
( "GL_STENCIL_BACK_REF", GLint, ["ctx->Stencil.Ref[1]"], "", None ),
( "GL_STENCIL_BACK_FAIL", GLenum, ["ctx->Stencil.FailFunc[1]"], "", None ),
( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum, ["ctx->Stencil.ZFailFunc[1]"], "", None ),
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index f2989aaefa4..f033ddc8954 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -55,6 +55,7 @@ _mesa_GetString( GLenum name )
static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING;
static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING;
static const char *version_2_0 = "1.5 Mesa " MESA_VERSION_STRING;
+ static const char *version_2_1 = "1.5 Mesa " MESA_VERSION_STRING;
#if FEATURE_ARB_shading_language_100
static const char *sl_version_110 = "1.10 Mesa " MESA_VERSION_STRING;
@@ -110,9 +111,18 @@ _mesa_GetString( GLenum name )
ctx->Extensions.EXT_shadow_funcs) {
if (ctx->Extensions.ARB_draw_buffers &&
ctx->Extensions.ARB_point_sprite &&
- ctx->Extensions.ARB_texture_non_power_of_two &&
- ctx->Extensions.ATI_separate_stencil) {
- return (const GLubyte *) version_2_0;
+ ctx->Extensions.ARB_shader_objects &&
+ ctx->Extensions.ARB_vertex_shader &&
+ ctx->Extensions.ARB_fragment_shader &&
+ ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (ctx->Extensions.ARB_shading_language_120 &&
+ ctx->Extensions.EXT_pixel_buffer_object &&
+ ctx->Extensions.EXT_texture_sRGB) {
+ return (const GLubyte *) version_2_1;
+ }
+ else {
+ return (const GLubyte *) version_2_0;
+ }
}
else {
return (const GLubyte *) version_1_5;
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index e37499e4be7..5abea137d74 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -5,8 +5,8 @@
* This is the top-most include file of the Mesa sources.
* It includes gl.h and all system headers which are needed.
* Other Mesa source files should \e not directly include any system
- * headers. This allows Mesa to be integrated into XFree86 and
- * allows system-dependent hacks/workarounds to be collected in one place.
+ * headers. This allows system-dependent hacks/workarounds to be
+ * collected in one place.
*
* \note Actually, a lot of system-dependent stuff is now in imports.[ch].
*
@@ -46,18 +46,15 @@
#ifndef GLHEADER_H
#define GLHEADER_H
+/* This allows Mesa to be integrated into XFree86 */
#ifdef HAVE_DIX_CONFIG_H
#include "dix-config.h"
#endif
-#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
-#include "xf86_ansic.h"
-#else
#include <assert.h>
#include <ctype.h>
-/* If we can use Compaq's Fast Math Library on Alpha */
#if defined(__alpha__) && defined(CCPML)
-#include <cpml.h>
+#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */
#else
#include <math.h>
#endif
@@ -68,7 +65,6 @@
#if defined(__linux__) && defined(__i386__)
#include <fpu_control.h>
#endif
-#endif
#include <float.h>
#include <stdarg.h>
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 695aab5227f..6ff4089f0ea 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1168,7 +1168,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
const GLint comps = _mesa_components_in_format(dstFormat);
GLuint i;
- if (dstType != GL_FLOAT) {
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
/* need to clamp to [0, 1] */
transferOps |= IMAGE_CLAMP_BIT;
}
@@ -1182,7 +1182,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
- if (ctx->Color.ClampReadColor == GL_TRUE || dstType != GL_FLOAT) {
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
for (i = 0; i < n; i++) {
GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
luminance[i] = CLAMP(sum, 0.0F, 1.0F);
@@ -4173,7 +4173,7 @@ _mesa_unpack_image( GLuint dimensions,
if (width <= 0 || height <= 0 || depth <= 0)
return NULL; /* generate error later */
- if (format == GL_BITMAP) {
+ if (type == GL_BITMAP) {
bytesPerRow = (width + 7) >> 3;
flipBytes = !unpack->LsbFirst;
swap2 = swap4 = GL_FALSE;
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index a09c497795e..ed809acbe2a 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -24,9 +24,6 @@
* - scanf
* - qsort
* - rand and RAND_MAX
- *
- * \note When compiled into a XFree86 module these functions wrap around
- * XFree86 own wrappers.
*/
/*
@@ -71,50 +68,29 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
#endif
#endif
-/* If we don't actually want to use the libcwrapper junk (even though we're
- * building an Xorg server module), then just undef IN_MODULE to signal that to
- * the following code. It's left around for now to allow compiling of newish
- * Mesa with older servers, but this whole mess should go away at some point.
- */
-#ifdef NO_LIBCWRAPPER
-#undef IN_MODULE
-#endif
-
/**********************************************************************/
/** \name Memory */
/*@{*/
-/** Wrapper around either malloc() or xf86malloc() */
+/** Wrapper around malloc() */
void *
_mesa_malloc(size_t bytes)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86malloc(bytes);
-#else
return malloc(bytes);
-#endif
}
-/** Wrapper around either calloc() or xf86calloc() */
+/** Wrapper around calloc() */
void *
_mesa_calloc(size_t bytes)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86calloc(1, bytes);
-#else
return calloc(1, bytes);
-#endif
}
-/** Wrapper around either free() or xf86free() */
+/** Wrapper around free() */
void
_mesa_free(void *ptr)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86free(ptr);
-#else
free(ptr);
-#endif
}
/**
@@ -131,7 +107,7 @@ _mesa_free(void *ptr)
void *
_mesa_align_malloc(size_t bytes, unsigned long alignment)
{
-#if defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE))
+#if defined(HAVE_POSIX_MEMALIGN)
void *mem;
(void) posix_memalign(& mem, alignment, bytes);
@@ -157,7 +133,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
#endif
return (void *) buf;
-#endif /* defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
}
/**
@@ -167,7 +143,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
void *
_mesa_align_calloc(size_t bytes, unsigned long alignment)
{
-#if defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE))
+#if defined(HAVE_POSIX_MEMALIGN)
void *mem;
mem = _mesa_align_malloc(bytes, alignment);
@@ -197,7 +173,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
#endif
return (void *)buf;
-#endif /* defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
}
/**
@@ -210,13 +186,13 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
void
_mesa_align_free(void *ptr)
{
-#if defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE))
+#if defined(HAVE_POSIX_MEMALIGN)
free(ptr);
#else
void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
void *realAddr = *cubbyHole;
_mesa_free(realAddr);
-#endif /* defined(HAVE_POSIX_MEMALIGN) && !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
}
/**
@@ -255,22 +231,18 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
void *
_mesa_memcpy(void *dest, const void *src, size_t n)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86memcpy(dest, src, n);
-#elif defined(SUNOS4)
+#if defined(SUNOS4)
return memcpy((char *) dest, (char *) src, (int) n);
#else
return memcpy(dest, src, n);
#endif
}
-/** Wrapper around either memset() or xf86memset() */
+/** Wrapper around memset() */
void
_mesa_memset( void *dst, int val, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86memset( dst, val, n );
-#elif defined(SUNOS4)
+#if defined(SUNOS4)
memset( (char *) dst, (int) val, (int) n );
#else
memset(dst, val, n);
@@ -290,26 +262,22 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n )
*dst++ = val;
}
-/** Wrapper around either memcpy() or xf86memcpy() or bzero() */
+/** Wrapper around either memcpy() or bzero() */
void
_mesa_bzero( void *dst, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86memset( dst, 0, n );
-#elif defined(__FreeBSD__)
+#if defined(__FreeBSD__)
bzero( dst, n );
#else
memset( dst, 0, n );
#endif
}
-/** Wrapper around either memcmp() or xf86memcmp() */
+/** Wrapper around memcmp() */
int
_mesa_memcmp( const void *s1, const void *s2, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86memcmp( s1, s2, n );
-#elif defined(SUNOS4)
+#if defined(SUNOS4)
return memcmp( (char *) s1, (char *) s2, (int) n );
#else
return memcmp(s1, s2, n);
@@ -323,70 +291,46 @@ _mesa_memcmp( const void *s1, const void *s2, size_t n )
/** \name Math */
/*@{*/
-/** Wrapper around either sin() or xf86sin() */
+/** Wrapper around sin() */
double
_mesa_sin(double a)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86sin(a);
-#else
return sin(a);
-#endif
}
-/** Single precision wrapper around either sin() or xf86sin() */
+/** Single precision wrapper around sin() */
float
_mesa_sinf(float a)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return (float) xf86sin((double) a);
-#else
return (float) sin((double) a);
-#endif
}
-/** Wrapper around either cos() or xf86cos() */
+/** Wrapper around cos() */
double
_mesa_cos(double a)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86cos(a);
-#else
return cos(a);
-#endif
}
-/** Single precision wrapper around either asin() or xf86asin() */
+/** Single precision wrapper around asin() */
float
_mesa_asinf(float x)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return (float) xf86asin((double) x);
-#else
return (float) asin((double) x);
-#endif
}
-/** Single precision wrapper around either atan() or xf86atan() */
+/** Single precision wrapper around atan() */
float
_mesa_atanf(float x)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return (float) xf86atan((double) x);
-#else
return (float) atan((double) x);
-#endif
}
-/** Wrapper around either sqrt() or xf86sqrt() */
+/** Wrapper around sqrt() */
double
_mesa_sqrtd(double x)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86sqrt(x);
-#else
return sqrt(x);
-#endif
}
@@ -584,25 +528,17 @@ _mesa_inv_sqrtf(float n)
return x3 * r3;
#endif
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
- return 1.0F / xf86sqrt(n);
#else
return (float) (1.0 / sqrt(n));
#endif
}
-/**
- * Wrapper around either pow() or xf86pow().
- */
+/** Wrapper around pow() */
double
_mesa_pow(double x, double y)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86pow(x, y);
-#else
return pow(x, y);
-#endif
}
@@ -633,8 +569,6 @@ _mesa_ffs(int i)
}
}
return bit;
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86ffs(i);
#else
return ffs(i);
#endif
@@ -807,11 +741,7 @@ void *
_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *) )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86bsearch(key, base, nmemb, size, compar);
-#else
return bsearch(key, base, nmemb, size, compar);
-#endif
}
/*@}*/
@@ -827,9 +757,7 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
char *
_mesa_getenv( const char *var )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86getenv(var);
-#elif defined(_XBOX)
+#if defined(_XBOX)
return NULL;
#else
return getenv(var);
@@ -843,81 +771,53 @@ _mesa_getenv( const char *var )
/** \name String */
/*@{*/
-/** Wrapper around either strstr() or xf86strstr() */
+/** Wrapper around strstr() */
char *
_mesa_strstr( const char *haystack, const char *needle )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strstr(haystack, needle);
-#else
return strstr(haystack, needle);
-#endif
}
-/** Wrapper around either strncat() or xf86strncat() */
+/** Wrapper around strncat() */
char *
_mesa_strncat( char *dest, const char *src, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strncat(dest, src, n);
-#else
return strncat(dest, src, n);
-#endif
}
-/** Wrapper around either strcpy() or xf86strcpy() */
+/** Wrapper around strcpy() */
char *
_mesa_strcpy( char *dest, const char *src )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strcpy(dest, src);
-#else
return strcpy(dest, src);
-#endif
}
-/** Wrapper around either strncpy() or xf86strncpy() */
+/** Wrapper around strncpy() */
char *
_mesa_strncpy( char *dest, const char *src, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strncpy(dest, src, n);
-#else
return strncpy(dest, src, n);
-#endif
}
-/** Wrapper around either strlen() or xf86strlen() */
+/** Wrapper around strlen() */
size_t
_mesa_strlen( const char *s )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strlen(s);
-#else
return strlen(s);
-#endif
}
-/** Wrapper around either strcmp() or xf86strcmp() */
+/** Wrapper around strcmp() */
int
_mesa_strcmp( const char *s1, const char *s2 )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strcmp(s1, s2);
-#else
return strcmp(s1, s2);
-#endif
}
-/** Wrapper around either strncmp() or xf86strncmp() */
+/** Wrapper around strncmp() */
int
_mesa_strncmp( const char *s1, const char *s2, size_t n )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strncmp(s1, s2, n);
-#else
return strncmp(s1, s2, n);
-#endif
}
/** Implemented using _mesa_malloc() and _mesa_strcpy */
@@ -931,26 +831,18 @@ _mesa_strdup( const char *s )
return s2;
}
-/** Wrapper around either atoi() or xf86atoi() */
+/** Wrapper around atoi() */
int
_mesa_atoi(const char *s)
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86atoi(s);
-#else
return atoi(s);
-#endif
}
-/** Wrapper around either strtod() or xf86strtod() */
+/** Wrapper around strtod() */
double
_mesa_strtod( const char *s, char **end )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86strtod(s, end);
-#else
return strtod(s, end);
-#endif
}
/*@}*/
@@ -960,24 +852,19 @@ _mesa_strtod( const char *s, char **end )
/** \name I/O */
/*@{*/
-/** Wrapper around either vsprintf() or xf86vsprintf() */
+/** Wrapper around vsprintf() */
int
_mesa_sprintf( char *str, const char *fmt, ... )
{
int r;
va_list args;
va_start( args, fmt );
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- r = xf86vsprintf( str, fmt, args );
-#else
r = vsprintf( str, fmt, args );
-#endif
va_end( args );
return r;
}
-/** Wrapper around either printf() or xf86printf(), using vsprintf() for
- * the formatting. */
+/** Wrapper around printf(), using vsprintf() for the formatting. */
void
_mesa_printf( const char *fmtString, ... )
{
@@ -986,22 +873,14 @@ _mesa_printf( const char *fmtString, ... )
va_start( args, fmtString );
vsnprintf(s, MAXSTRING, fmtString, args);
va_end( args );
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86printf("%s", s);
-#else
fprintf(stderr,"%s", s);
-#endif
}
-/** Wrapper around either vsprintf() or xf86vsprintf() */
+/** Wrapper around vsprintf() */
int
_mesa_vsprintf( char *str, const char *fmt, va_list args )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86vsprintf( str, fmt, args );
-#else
return vsprintf( str, fmt, args );
-#endif
}
/*@}*/
@@ -1019,7 +898,7 @@ _mesa_vsprintf( char *str, const char *fmt, va_list args )
*
* If debugging is enabled (either at compile-time via the DEBUG macro, or
* run-time via the MESA_DEBUG environment variable), prints the warning to
- * stderr, either via fprintf() or xf86printf().
+ * stderr via fprintf().
*/
void
_mesa_warning( GLcontext *ctx, const char *fmtString, ... )
@@ -1037,11 +916,7 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... )
debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE;
#endif
if (debug) {
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86fprintf(stderr, "Mesa warning: %s\n", str);
-#else
fprintf(stderr, "Mesa warning: %s\n", str);
-#endif
}
}
@@ -1052,7 +927,7 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... )
* \param ctx GL context.
* \param s problem description string.
*
- * Prints the message to stderr, either via fprintf() or xf86fprintf().
+ * Prints the message to stderr via fprintf().
*/
void
_mesa_problem( const GLcontext *ctx, const char *fmtString, ... )
@@ -1065,13 +940,8 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... )
vsnprintf( str, MAXSTRING, fmtString, args );
va_end( args );
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str);
- xf86fprintf(stderr, "Please report at bugzilla.freedesktop.org\n");
-#else
fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str);
fprintf(stderr, "Please report at bugzilla.freedesktop.org\n");
-#endif
}
/**
@@ -1161,7 +1031,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... )
* \param ctx GL context.
* \param fmtString printf() alike format string.
*
- * Prints the message to stderr, either via fprintf() or xf86printf().
+ * Prints the message to stderr via fprintf().
*/
void
_mesa_debug( const GLcontext *ctx, const char *fmtString, ... )
@@ -1172,11 +1042,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... )
va_start(args, fmtString);
vsnprintf(s, MAXSTRING, fmtString, args);
va_end(args);
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86fprintf(stderr, "Mesa: %s", s);
-#else
fprintf(stderr, "Mesa: %s", s);
-#endif
#endif /* DEBUG */
(void) ctx;
(void) fmtString;
@@ -1195,11 +1061,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... )
void
_mesa_exit( int status )
{
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- xf86exit(status);
-#else
exit(status);
-#endif
}
/*@}*/
@@ -1225,16 +1087,12 @@ default_calloc(__GLcontext *gc, size_t numElem, size_t elemSize)
return _mesa_calloc(numElem * elemSize);
}
-/** Wrapper around either realloc() or xf86realloc() */
+/** Wrapper around realloc() */
static void *
default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
{
(void) gc;
-#if defined(XFree86LOADER) && defined(IN_MODULE)
- return xf86realloc(oldAddr, newSize);
-#else
return realloc(oldAddr, newSize);
-#endif
}
/** Wrapper around _mesa_free() */
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 9fb02a7e9cd..19a9478f76a 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -55,6 +55,15 @@ extern "C" {
#define NULL 0
#endif
+
+/** gcc -pedantic warns about long string literals, LONGSTRING silences that */
+#if !defined(__GNUC__) || (__GNUC__ < 2) || \
+ ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
+# define LONGSTRING
+#else
+# define LONGSTRING __extension__
+#endif
+
/*@}*/
@@ -133,11 +142,6 @@ typedef union { GLfloat f; GLint i; } fi_type;
#define FLT_MAX_EXP 128
#endif
-/* XXX this is a bit of a hack needed for compilation within XFree86 */
-#ifndef FLT_MIN
-#define FLT_MIN (1.0e-37)
-#endif
-
/* Degrees to radians conversion: */
#define DEG2RAD (M_PI/180.0)
@@ -164,8 +168,6 @@ typedef union { GLfloat f; GLint i; } fi_type;
***/
#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
# define SQRTF(X) _mesa_sqrtf(X)
-#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
-# define SQRTF(X) (float) xf86sqrt((float) (X))
#else
# define SQRTF(X) (float) sqrt((float) (X))
#endif
@@ -212,8 +214,6 @@ static INLINE GLfloat LOG2(GLfloat val)
num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
return num.f + log_2;
}
-#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
-#define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695))
#else
/*
* NOTE: log_base_2(x) = log(x) / log(2)
@@ -284,15 +284,7 @@ static INLINE int GET_FLOAT_BITS( float x )
*** LDEXPF: multiply value by an integral power of two
*** FREXPF: extract mantissa and exponent from value
***/
-#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
-#define CEILF(x) ((GLfloat) xf86ceil(x))
-#define FLOORF(x) ((GLfloat) xf86floor(x))
-#define FABSF(x) ((GLfloat) xf86fabs(x))
-#define LOGF(x) ((GLfloat) xf86log(x))
-#define EXPF(x) ((GLfloat) xf86exp(x))
-#define LDEXPF(x,y) ((GLfloat) xf86ldexp(x,y))
-#define FREXPF(x,y) ((GLfloat) xf86frexp(x,y))
-#elif defined(__gnu_linux__)
+#if defined(__gnu_linux__)
/* C99 functions */
#define CEILF(x) ceilf(x)
#define FLOORF(x) floorf(x)
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 984f7b2abc4..92d8a0ae0d4 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.3
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
@@ -44,7 +44,7 @@ _mesa_ShadeModel( GLenum mode )
_mesa_debug(ctx, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode));
if (mode != GL_FLAT && mode != GL_SMOOTH) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glShadeModel" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel");
return;
}
@@ -53,9 +53,8 @@ _mesa_ShadeModel( GLenum mode )
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ShadeModel = mode;
- ctx->_TriangleCaps ^= DD_FLATSHADE;
if (ctx->Driver.ShadeModel)
- (*ctx->Driver.ShadeModel)( ctx, mode );
+ ctx->Driver.ShadeModel( ctx, mode );
}
@@ -442,11 +441,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.TwoSide = newbool;
-
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (params[0] == (GLfloat) GL_SINGLE_COLOR)
@@ -728,7 +722,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
}
if (ctx->Driver.ColorMaterial)
- (*ctx->Driver.ColorMaterial)( ctx, face, mode );
+ ctx->Driver.ColorMaterial( ctx, face, mode );
}
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index c30d9ac109e..dc7195d4ebf 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,13 +1,8 @@
-/**
- * \file lines.c
- * Line operations.
- */
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -43,12 +38,6 @@
* \param width line width in pixels.
*
* \sa glLineWidth().
- *
- * Verifies the parameter and updates gl_line_attrib::Width. On a change,
- * flushes the vertices, updates the clamped line width and marks the
- * DD_LINE_WIDTH flag in __GLcontextRec::_TriangleCaps for the drivers if the
- * width is different from one. Notifies the driver via the
- * dd_function_table::LineWidth callback.
*/
void GLAPIENTRY
_mesa_LineWidth( GLfloat width )
@@ -70,14 +59,8 @@ _mesa_LineWidth( GLfloat width )
ctx->Const.MinLineWidth,
ctx->Const.MaxLineWidth);
-
- if (width != 1.0)
- ctx->_TriangleCaps |= DD_LINE_WIDTH;
- else
- ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
-
if (ctx->Driver.LineWidth)
- (*ctx->Driver.LineWidth)(ctx, width);
+ ctx->Driver.LineWidth(ctx, width);
}
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 7339b0ce409..b2aa83e1890 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -427,7 +427,7 @@ _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
/**
- * Multiply the current matrix with a general scaling matrix.
+ * Multiply the current matrix with a translation matrix.
*
* \param x translation vector x coordinate.
* \param y translation vector y coordinate.
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1d5eb61e065..2ad37d3a8d7 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2402,6 +2402,7 @@ struct gl_extensions
GLboolean ARB_point_sprite;
GLboolean ARB_shader_objects;
GLboolean ARB_shading_language_100;
+ GLboolean ARB_shading_language_120;
GLboolean ARB_shadow;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index aa36fb62877..c6b032460e8 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -244,19 +244,9 @@ _mesa_update_point(GLcontext *ctx)
ctx->Point.MinSize,
ctx->Point.MaxSize);
- if (ctx->Point._Size == 1.0F)
- ctx->_TriangleCaps &= ~DD_POINT_SIZE;
- else
- ctx->_TriangleCaps |= DD_POINT_SIZE;
-
ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
ctx->Point.Params[1] != 0.0 ||
ctx->Point.Params[2] != 0.0);
-
- if (ctx->Point._Attenuated)
- ctx->_TriangleCaps |= DD_POINT_ATTEN;
- else
- ctx->_TriangleCaps &= ~DD_POINT_ATTEN;
}
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index b771408cf36..fd02e5a652d 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -167,13 +167,8 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
return;
}
- ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
- if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
- ctx->_TriangleCaps |= DD_TRI_UNFILLED;
-
- if (ctx->Driver.PolygonMode) {
- (*ctx->Driver.PolygonMode)( ctx, face, mode );
- }
+ if (ctx->Driver.PolygonMode)
+ ctx->Driver.PolygonMode(ctx, face, mode);
}
#if _HAVE_FULL_GL
@@ -321,32 +316,6 @@ _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
/**********************************************************************/
-/** \name State Management */
-/*@{*/
-
-/*
- * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
- * in ctx->_TriangleCaps if needed.
- */
-void _mesa_update_polygon( GLcontext *ctx )
-{
- ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
-
- if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
-
- /* Any Polygon offsets enabled? */
- if (ctx->Polygon.OffsetPoint ||
- ctx->Polygon.OffsetLine ||
- ctx->Polygon.OffsetFill) {
- ctx->_TriangleCaps |= DD_TRI_OFFSET;
- }
-}
-
-/*@}*/
-
-
-/**********************************************************************/
/** \name Initialization */
/*@{*/
diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h
index 2550ed16877..78e8394d053 100644
--- a/src/mesa/main/polygon.h
+++ b/src/mesa/main/polygon.h
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -60,9 +60,6 @@ _mesa_PolygonStipple( const GLubyte *mask );
extern void GLAPIENTRY
_mesa_GetPolygonStipple( GLubyte *mask );
-extern void
-_mesa_update_polygon( GLcontext *ctx );
-
extern void
_mesa_init_polygon( GLcontext * ctx );
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 4f490db724f..ddf2ac51d3b 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -994,6 +994,7 @@ void _mesa_init_rastpos( GLcontext * ctx )
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterIndex = 1.0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
diff --git a/src/mesa/main/sources b/src/mesa/main/sources
index 8820461f913..dfcff89e4b6 100644
--- a/src/mesa/main/sources
+++ b/src/mesa/main/sources
@@ -1,4 +1,4 @@
-# List of ource files in this directory used for X.org xserver build
+# List of source files in this directory used for X.org xserver build
MESA_MAIN_SOURCES = \
accum.c \
api_arrayelt.c \
@@ -62,3 +62,77 @@ texstore.c \
varray.c \
$(VSNPRINTF_SOURCES) \
vtxfmt.c
+
+MESA_VSNPRINTF_SOURCES = \
+vsnprintf.c
+
+MESA_MAIN_HEADERS = \
+accum.h \
+api_arrayelt.h \
+api_eval.h \
+api_loopback.h \
+api_noop.h \
+api_validate.h \
+arrayobj.h \
+attrib.h \
+bitset.h \
+blend.h \
+bufferobj.h \
+buffers.h \
+clip.h \
+colormac.h \
+colortab.h \
+config.h \
+context.h \
+convolve.h \
+dd.h \
+debug.h \
+depth.h \
+depthstencil.h \
+dlist.h \
+drawpix.h \
+enable.h \
+enums.h \
+eval.h \
+extensions.h \
+fbobject.h \
+feedback.h \
+fog.h \
+framebuffer.h \
+get.h \
+glheader.h \
+hash.h \
+hint.h \
+histogram.h \
+image.h \
+imports.h \
+light.h \
+lines.h \
+macros.h \
+matrix.h \
+mipmap.h \
+mm.h \
+mtypes.h \
+occlude.h \
+pixel.h \
+points.h \
+polygon.h \
+rastpos.h \
+rbadaptors.h \
+renderbuffer.h \
+simple_list.h \
+state.h \
+stencil.h \
+texcompress.h \
+texenvprogram.h \
+texformat.h \
+texformat_tmp.h \
+teximage.h \
+texobj.h \
+texrender.h \
+texstate.h \
+texstore.h \
+varray.h \
+version.h \
+vtxfmt.h \
+vtxfmt_tmp.h
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 06cf5f8698d..55fb4552d2b 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -376,6 +376,32 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
+#if FEATURE_ARB_shader_objects
+ SET_AttachShader(exec, _mesa_AttachShader);
+ SET_CreateProgram(exec, _mesa_CreateProgram);
+ SET_CreateShader(exec, _mesa_CreateShader);
+ SET_DeleteProgram(exec, _mesa_DeleteProgram);
+ SET_DeleteShader(exec, _mesa_DeleteShader);
+ SET_DetachShader(exec, _mesa_DetachShader);
+ SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
+ SET_GetProgramiv(exec, _mesa_GetProgramiv);
+ SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
+ SET_GetShaderiv(exec, _mesa_GetShaderiv);
+ SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
+ SET_IsProgram(exec, _mesa_IsProgram);
+ SET_IsShader(exec, _mesa_IsShader);
+#endif
+
+ /* OpenGL 2.1 */
+#if FEATURE_ARB_shader_objects
+ SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv);
+ SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv);
+ SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv);
+ SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv);
+ SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv);
+ SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv);
+#endif
+
/* 2. GL_EXT_blend_color */
#if 0
@@ -507,7 +533,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV);
SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV);
SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(exec, _mesa_IsProgram);
+ SET_IsProgramNV(exec, _mesa_IsProgramARB);
SET_LoadProgramNV(exec, _mesa_LoadProgramNV);
SET_ProgramParameter4dNV(exec, _mesa_ProgramParameter4dNV);
SET_ProgramParameter4dvNV(exec, _mesa_ProgramParameter4dvNV);
@@ -795,16 +821,6 @@ _mesa_init_exec_table(struct _glapi_table *exec)
/*@{*/
-static void
-update_separate_specular( GLcontext *ctx )
-{
- if (NEED_SECONDARY_COLOR(ctx))
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
- else
- ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
-}
-
-
/**
* Update state dependent on vertex arrays.
*/
@@ -983,23 +999,93 @@ update_color(GLcontext *ctx)
/* This is needed to support 1.1's RGB logic ops AND
* 1.0's blending logicops.
*/
- ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
- (ctx->Color.BlendEnabled &&
- ctx->Color.BlendEquationRGB == GL_LOGIC_OP));
+ ctx->Color._LogicOpEnabled = RGBA_LOGICOP_ENABLED(ctx);
}
/**
- * If __GLcontextRec::NewState is non-zero then this function \b must be called
- * before rendering any primitive. Basically, function pointers and
- * miscellaneous flags are updated to reflect the current state of the state
- * machine.
+ * Update the ctx->_TriangleCaps bitfield.
+ * XXX that bitfield should really go away someday!
+ * This function must be called after other update_*() functions since
+ * there are dependencies on some other derived values.
+ */
+static void
+update_tricaps(GLcontext *ctx, GLbitfield new_state)
+{
+ ctx->_TriangleCaps = 0;
+
+ /*
+ * Points
+ */
+ if (new_state & _NEW_POINT) {
+ if (ctx->Point.SmoothFlag)
+ ctx->_TriangleCaps |= DD_POINT_SMOOTH;
+ if (ctx->Point._Size != 1.0F)
+ ctx->_TriangleCaps |= DD_POINT_SIZE;
+ if (ctx->Point._Attenuated)
+ ctx->_TriangleCaps |= DD_POINT_ATTEN;
+ }
+
+ /*
+ * Lines
+ */
+ if (new_state & _NEW_LINE) {
+ if (ctx->Line.SmoothFlag)
+ ctx->_TriangleCaps |= DD_LINE_SMOOTH;
+ if (ctx->Line.StippleFlag)
+ ctx->_TriangleCaps |= DD_LINE_STIPPLE;
+ if (ctx->Line._Width != 1.0)
+ ctx->_TriangleCaps |= DD_LINE_WIDTH;
+ }
+
+ /*
+ * Polygons
+ */
+ if (new_state & _NEW_POLYGON) {
+ if (ctx->Polygon.SmoothFlag)
+ ctx->_TriangleCaps |= DD_TRI_SMOOTH;
+ if (ctx->Polygon.StippleFlag)
+ ctx->_TriangleCaps |= DD_TRI_STIPPLE;
+ if (ctx->Polygon.FrontMode != GL_FILL
+ || ctx->Polygon.BackMode != GL_FILL)
+ ctx->_TriangleCaps |= DD_TRI_UNFILLED;
+ if (ctx->Polygon.CullFlag
+ && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
+ ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+ if (ctx->Polygon.OffsetPoint ||
+ ctx->Polygon.OffsetLine ||
+ ctx->Polygon.OffsetFill)
+ ctx->_TriangleCaps |= DD_TRI_OFFSET;
+ }
+
+ /*
+ * Lighting and shading
+ */
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ if (ctx->Light.ShadeModel == GL_FLAT)
+ ctx->_TriangleCaps |= DD_FLATSHADE;
+ if (NEED_SECONDARY_COLOR(ctx))
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+
+ /*
+ * Stencil
+ */
+ if (ctx->Stencil._TestTwoSide)
+ ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
+}
+
+
+/**
+ * Compute derived GL state.
+ * If __GLcontextRec::NewState is non-zero then this function \b must
+ * be called before rendering anything.
*
* Calls dd_function_table::UpdateState to perform any internal state
* management necessary.
*
* \sa _mesa_update_modelview_project(), _mesa_update_texture(),
- * _mesa_update_buffer_bounds(), _mesa_update_polygon(),
+ * _mesa_update_buffer_bounds(),
* _mesa_update_lighting() and _mesa_update_tnl_spaces().
*/
void
@@ -1028,9 +1114,6 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & _NEW_POINT)
_mesa_update_point( ctx );
- if (new_state & _NEW_POLYGON)
- _mesa_update_polygon( ctx );
-
if (new_state & _NEW_LIGHT)
_mesa_update_lighting( ctx );
@@ -1040,9 +1123,6 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & _IMAGE_NEW_TRANSFER_STATE)
_mesa_update_pixel( ctx, new_state );
- if (new_state & _DD_NEW_SEPARATE_SPECULAR)
- update_separate_specular( ctx );
-
if (new_state & (_NEW_ARRAY | _NEW_PROGRAM))
update_arrays( ctx );
@@ -1052,6 +1132,10 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & _NEW_COLOR)
update_color( ctx );
+ if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
+ | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))
+ update_tricaps( ctx, new_state );
+
if (ctx->_MaintainTexEnvProgram) {
if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR | _NEW_FOG))
_mesa_UpdateTexEnvProgram(ctx);
@@ -1098,3 +1182,5 @@ _mesa_update_state( GLcontext *ctx )
/*@}*/
+
+
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index d6be410e76c..e61eb0030c0 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,10 @@
*
* So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL
* 2.0, but not both.
+ *
+ * Also, note that GL_ATI_separate_stencil is different as well:
+ * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs.
+ * glStencilFuncSeparate(GLenum face, GLenum func, ...).
*/
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 2ac2c80a082..d3011cedce4 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -105,7 +105,7 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS)
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- GL_COMPRESSED_RGB_FXT1_3DFX,
+ dstFormat->MesaFormat,
texWidth, (GLubyte *) dstAddr);
fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride,
@@ -162,7 +162,7 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS)
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- GL_COMPRESSED_RGBA_FXT1_3DFX,
+ dstFormat->MesaFormat,
texWidth, (GLubyte *) dstAddr);
fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride,
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index c99ff5cdc46..5329719cbbb 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -575,7 +575,7 @@ static struct ureg register_const4f( struct texenv_fragment_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 662f697147d..543d6efc984 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -73,11 +73,11 @@ _mesa_free_texmemory(void *m)
#if 0
static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img)
{
-#if CHAN_TYPE == GL_FLOAT
- _mesa_problem(NULL, "PrintTexture doesn't support float channels");
+#if CHAN_TYPE != GL_UNSIGNED_BYTE
+ _mesa_problem(NULL, "PrintTexture not supported");
#else
GLuint i, j, c;
- const GLchan *data = (const GLchan *) img->Data;
+ const GLubyte *data = (const GLubyte *) img->Data;
if (!data) {
_mesa_printf("No texture data\n");
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2a34cfba5a3..87f8fa7a0d4 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -699,6 +699,7 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
}
break;
case 1:
+ /* XXX investigate valgrind invalid read when running demos/texenv.c */
for (i = 0; i < count; i++) {
COPY_4UBV(tmp, src);
src += srcComponents;
@@ -807,7 +808,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx,
/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */
- if (srcRowStride == srcWidth * srcComponents &&
+ if (srcRowStride == dstRowStride &&
+ srcRowStride == srcWidth * srcComponents &&
dimensions < 3) {
/* 1 and 2D images only */
GLubyte *dstImage = (GLubyte *) dstAddr
diff --git a/src/mesa/math/sources b/src/mesa/math/sources
index 2374be80eba..7c7dcccedfd 100644
--- a/src/mesa/math/sources
+++ b/src/mesa/math/sources
@@ -7,3 +7,19 @@ m_matrix.c \
m_translate.c \
m_vector.c \
m_xform.c
+
+MESA_MATH_HEADERS = \
+m_clip_tmp.h \
+m_copy_tmp.h \
+m_debug.h \
+m_debug_util.h \
+m_dotprod_tmp.h \
+m_eval.h \
+m_matrix.h \
+m_norm_tmp.h \
+m_trans_tmp.h \
+m_translate.h \
+m_vector.h \
+m_xform.h \
+m_xform_tmp.h \
+mathmod.h
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 43e3bc183d4..72d49093721 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -77,12 +77,6 @@ struct arb_program
};
-#ifndef __extension__
-#if !defined(__GNUC__) || (__GNUC__ < 2) || \
- ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7))
-# define __extension__
-#endif
-#endif
/* TODO:
* Fragment Program Stuff:
@@ -168,10 +162,11 @@ struct arb_program
typedef GLubyte *production;
+
/**
* This is the text describing the rules to parse the grammar
*/
-__extension__ static char arb_grammar_text[] =
+LONGSTRING static char arb_grammar_text[] =
#include "arbprogram_syn.h"
;
@@ -1815,7 +1810,7 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
parse_constant (inst, const_values, Program, use);
idx = _mesa_add_named_constant(Program->Base.Parameters,
(char *) param_var->name,
- const_values);
+ const_values, 4);
if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
@@ -3708,7 +3703,7 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst,
/* XXX temporary */
-__extension__ static char core_grammar_text[] =
+LONGSTRING static char core_grammar_text[] =
#include "grammar_syn.h"
;
@@ -4053,7 +4048,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
program->Base.Parameters = ap.Base.Parameters;
#if DEBUG_FP
- _mesa_print_program(&program.Base);
+ _mesa_printf("____________Fragment program %u ________\n", program->Base.ID);
+ _mesa_print_program(&program->Base);
#endif
}
@@ -4105,6 +4101,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
program->Base.Parameters = ap.Base.Parameters;
#if DEBUG_VP
+ _mesa_printf("____________Vertex program %u __________\n", program->Base.ID);
_mesa_print_program(&program->Base);
#endif
}
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 89f2d20cc9a..bff80d7ee3a 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -36,6 +36,7 @@
#include "imports.h"
#include "macros.h"
#include "mtypes.h"
+#include "program.h"
void GLAPIENTRY
@@ -101,7 +102,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_VERTEX_PROGRAM_ATTRIBS) {
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)");
return;
}
@@ -123,6 +124,11 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Normalized;
break;
case GL_CURRENT_VERTEX_ATTRIB_ARB:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribfvARB(index==0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index]);
break;
@@ -179,6 +185,31 @@ _mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer)
}
+/**
+ * Determine if id names a vertex or fragment program.
+ * \note Not compiled into display lists.
+ * \note Called from both glIsProgramNV and glIsProgramARB.
+ * \param id is the program identifier
+ * \return GL_TRUE if id is a program, else GL_FALSE.
+ */
+GLboolean GLAPIENTRY
+_mesa_IsProgramARB(GLuint id)
+{
+ struct gl_program *prog = NULL;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (id == 0)
+ return GL_FALSE;
+
+ prog = _mesa_lookup_program(ctx, id);
+ if (prog && (prog != &_mesa_DummyProgram))
+ return GL_TRUE;
+ else
+ return GL_FALSE;
+}
+
+
void GLAPIENTRY
_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
const GLvoid *string)
@@ -736,6 +767,7 @@ void GLAPIENTRY
_mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
{
const struct gl_program *prog;
+ char *dst = (char *) string;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
@@ -759,5 +791,8 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
return;
}
- _mesa_memcpy(string, prog->String, _mesa_strlen((char *) prog->String));
+ if (prog->String)
+ _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String));
+ else
+ *dst = '\0';
}
diff --git a/src/mesa/shader/arbprogram.h b/src/mesa/shader/arbprogram.h
index 54a14bbb9f8..233f6629650 100644
--- a/src/mesa/shader/arbprogram.h
+++ b/src/mesa/shader/arbprogram.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -51,6 +51,10 @@ extern void GLAPIENTRY
_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer);
+extern GLboolean GLAPIENTRY
+_mesa_IsProgramARB(GLuint id);
+
+
extern void GLAPIENTRY
_mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
const GLvoid *string);
diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c
index d349a496dc7..4727c1a4365 100644
--- a/src/mesa/shader/atifragshader.c
+++ b/src/mesa/shader/atifragshader.c
@@ -400,6 +400,8 @@ _mesa_EndFragmentShaderATI(void)
}
}
#endif
+ if (ctx->Driver.ProgramStringNotify)
+ ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_SHADER_ATI, NULL );
}
void GLAPIENTRY
diff --git a/src/mesa/shader/descrip.mms b/src/mesa/shader/descrip.mms
index 95569a6f25c..d70cec38300 100644
--- a/src/mesa/shader/descrip.mms
+++ b/src/mesa/shader/descrip.mms
@@ -1,7 +1,6 @@
# Makefile for core library for VMS
-# contributed by Jouk Jansen [email protected]
-# Last revision : 1 June 2005
-
+# contributed by Jouk Jansen [email protected]
+# Last revision : 20 November 2006
.first
define gl [---.include.gl]
define math [-.math]
@@ -16,7 +15,7 @@ VPATH = RCS
INCDIR = [---.include],[.grammar],[-.main],[-.glapi],[.slang]
LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
+CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1,"__extension__=")/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = \
atifragshader.c \
diff --git a/src/mesa/shader/grammar/sources b/src/mesa/shader/grammar/sources
index b1f8530ee5d..a6bbfd3ffd3 100644
--- a/src/mesa/shader/grammar/sources
+++ b/src/mesa/shader/grammar/sources
@@ -1,2 +1,8 @@
MESA_SHADER_GRAMMAR_SOURCES = \
grammar_mesa.c
+
+MESA_SHADER_GRAMMAR_HEADERS = \
+grammar.c \
+grammar.h \
+grammar_mesa.h \
+grammar_syn.h
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 5f3a30b7416..79e6dbd87b7 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -1041,7 +1041,7 @@ Parse_VectorSrc(struct parse_state *parseState,
GLuint paramIndex;
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1052,7 +1052,7 @@ Parse_VectorSrc(struct parse_state *parseState,
(void) Parse_String(parseState, "{");
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1142,7 +1142,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
(void) Parse_String(parseState, "{");
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1166,7 +1166,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
GLuint paramIndex;
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
- paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values);
+ paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4);
srcReg->Index = paramIndex;
srcReg->File = PROGRAM_NAMED_PARAM;
needSuffix = GL_FALSE;
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 0e9a01dcab8..4f160b14312 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -360,7 +360,7 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -376,6 +376,11 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribdvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -396,7 +401,7 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -412,6 +417,11 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribfvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -432,7 +442,7 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -448,6 +458,11 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribivNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
params[0] = (GLint) ctx->Current.Attrib[index][0];
params[1] = (GLint) ctx->Current.Attrib[index][1];
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 681584941e7..8442ba3248c 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -207,6 +207,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
prog->Target = target;
prog->Resident = GL_TRUE;
prog->RefCount = 1;
+ prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
}
return prog;
@@ -284,6 +285,9 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
(void) ctx;
ASSERT(prog);
+ if (prog == &_mesa_DummyProgram)
+ return;
+
if (prog->String)
_mesa_free(prog->String);
@@ -430,14 +434,24 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* PARAM myVals = { 0, 1, 2, 3 };
*
- * \param paramList - the parameter list
- * \param values - four float values
- * \return index of the new parameter.
+ * \param paramList the parameter list
+ * \param name the name for the constant
+ * \param values four float values
+ * \return index/position of the new parameter in the parameter list
*/
GLint
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
- const char *name, const GLfloat values[4])
+ const char *name, const GLfloat values[4],
+ GLuint size)
{
+#if 0 /* disable this for now -- we need to save the name! */
+ GLuint pos, swizzle;
+ ASSERT(size == 4); /* XXX future feature */
+ /* check if we already have this constant */
+ if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
+ return pos;
+ }
+#endif
return add_parameter(paramList, name, values, PROGRAM_CONSTANT);
}
@@ -447,14 +461,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* MOV r, { 0, 1, 2, 3 };
*
- * \param paramList - the parameter list
- * \param values - four float values
- * \return index of the new parameter.
+ * \param paramList the parameter list
+ * \param values four float values
+ * \return index/position of the new parameter in the parameter list.
*/
GLint
_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
- const GLfloat values[4])
+ const GLfloat values[4], GLuint size)
{
+ GLuint pos, swizzle;
+ ASSERT(size == 4); /* XXX future feature */
+ /* check if we already have this constant */
+ if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
+ return pos;
+ }
return add_parameter(paramList, NULL, values, PROGRAM_CONSTANT);
}
@@ -464,8 +484,8 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
* This will be used when the program contains something like this:
* PARAM ambient = state.material.front.ambient;
*
- * \param paramList - the parameter list
- * \param state - an array of 6 state tokens
+ * \param paramList the parameter list
+ * \param state an array of 6 state tokens
* \return index of the new parameter.
*/
GLint
@@ -500,7 +520,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
* \return pointer to the float[4] values.
*/
GLfloat *
-_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLuint i;
@@ -530,11 +550,15 @@ _mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
/**
- * Lookup a parameter index by name in the given parameter list.
+ * Given a program parameter name, find its position in the list of parameters.
+ * \param paramList the parameter list to search
+ * \param nameLen length of name (in chars).
+ * If length is negative, assume that name is null-terminated.
+ * \param name the name to search for
* \return index of parameter in the list.
*/
GLint
-_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLint i;
@@ -564,6 +588,61 @@ _mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
/**
+ * Look for a float vector in the given parameter list. The float vector
+ * may be of length 1, 2, 3 or 4.
+ * \param paramList the parameter list to search
+ * \param v the float vector to search for
+ * \param size number of element in v
+ * \param posOut returns the position of the constant, if found
+ * \param swizzleOut returns a swizzle mask describing location of the
+ * vector elements if found
+ * \return GL_TRUE if found, GL_FALSE if not found
+ */
+GLboolean
+_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList,
+ const GLfloat v[], GLsizei vSize,
+ GLuint *posOut, GLuint *swizzleOut)
+{
+ GLuint i;
+
+ assert(vSize >= 1);
+ assert(vSize <= 4);
+
+ if (!paramList)
+ return -1;
+
+ for (i = 0; i < paramList->NumParameters; i++) {
+ if (paramList->Parameters[i].Type == PROGRAM_CONSTANT) {
+ const GLint maxShift = 4 - vSize;
+ GLint shift, j;
+ for (shift = 0; shift <= maxShift; shift++) {
+ GLint matched = 0;
+ GLuint swizzle[4];
+ swizzle[0] = swizzle[1] = swizzle[2] = swizzle[3] = 0;
+ /* XXX we could do out-of-order swizzle matches too, someday */
+ for (j = 0; j < vSize; j++) {
+ assert(shift + j < 4);
+ if (paramList->ParameterValues[i][shift + j] == v[j]) {
+ matched++;
+ swizzle[j] = shift + j;
+ }
+ }
+ if (matched == vSize) {
+ /* found! */
+ *posOut = i;
+ *swizzleOut = MAKE_SWIZZLE4(swizzle[0], swizzle[1],
+ swizzle[2], swizzle[3]);
+ return GL_TRUE;
+ }
+ }
+ }
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
* Use the list of tokens in the state[] array to find global GL state
* and return it in <value>. Usually, four values are returned in <value>
* but matrix queries may return as many as 16 values.
@@ -918,7 +997,9 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[],
break;
}
default:
- _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
+ /* unknown state indexes are silently ignored
+ * should be handled by the driver.
+ */
return;
}
}
@@ -995,7 +1076,9 @@ make_state_flags(const GLint state[])
case STATE_TEXRECT_SCALE:
return _NEW_TEXTURE;
default:
- _mesa_problem(NULL, "unexpected int. state in make_state_flags()");
+ /* unknown state indexes are silently ignored and
+ * no flag set, since it is handled by the driver.
+ */
return 0;
}
@@ -1267,7 +1350,7 @@ make_state_string(const GLint state[6])
case STATE_INTERNAL:
break;
default:
- _mesa_problem(NULL, "Invalid state in maka_state_string");
+ _mesa_problem(NULL, "Invalid state in make_state_string");
break;
}
@@ -1864,10 +1947,14 @@ _mesa_BindProgram(GLenum target, GLuint id)
/* bind newProg */
if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */
+ if (ctx->VertexProgram._Current == ctx->VertexProgram.Current)
+ ctx->VertexProgram._Current = (struct gl_vertex_program *) newProg;
ctx->VertexProgram.Current = (struct gl_vertex_program *) newProg;
}
else if (target == GL_FRAGMENT_PROGRAM_NV ||
target == GL_FRAGMENT_PROGRAM_ARB) {
+ if (ctx->FragmentProgram._Current == ctx->FragmentProgram.Current)
+ ctx->FragmentProgram._Current = (struct gl_fragment_program *) newProg;
ctx->FragmentProgram.Current = (struct gl_fragment_program *) newProg;
}
newProg->RefCount++;
@@ -1886,7 +1973,7 @@ _mesa_BindProgram(GLenum target, GLuint id)
* \note Not compiled into display lists.
* \note Called by both glDeleteProgramsNV and glDeleteProgramsARB.
*/
-void GLAPIENTRY
+void GLAPIENTRY
_mesa_DeletePrograms(GLsizei n, const GLuint *ids)
{
GLint i;
@@ -1973,30 +2060,6 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids)
}
-/**
- * Determine if id names a vertex or fragment program.
- * \note Not compiled into display lists.
- * \note Called from both glIsProgramNV and glIsProgramARB.
- * \param id is the program identifier
- * \return GL_TRUE if id is a program, else GL_FALSE.
- */
-GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint id)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (id == 0)
- return GL_FALSE;
-
- if (_mesa_lookup_program(ctx, id))
- return GL_TRUE;
- else
- return GL_FALSE;
-}
-
-
-
/**********************************************************************/
/* GL_MESA_program_debug extension */
/**********************************************************************/
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index cf3b1cc0990..af06c03598f 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -189,7 +189,8 @@ enum state_index {
STATE_INTERNAL, /* Mesa additions */
STATE_NORMAL_SCALE,
STATE_TEXRECT_SCALE,
- STATE_POSITION_NORMALIZED /* normalized light position */
+ STATE_POSITION_NORMALIZED, /* normalized light position */
+ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
};
@@ -238,30 +239,34 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
extern GLint
_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
- const char *name, const GLfloat values[4]);
+ const char *name, const GLfloat values[4],
+ GLuint size);
extern GLint
_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
- const GLfloat values[4]);
+ const GLfloat values[4], GLuint size);
extern GLint
_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
const GLint *stateTokens);
extern GLfloat *
-_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
extern GLint
-_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
+_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
+extern GLboolean
+_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList,
+ const GLfloat v[], GLsizei vSize,
+ GLuint *posOut, GLuint *swizzleOut);
+
extern void
_mesa_load_state_parameters(GLcontext *ctx,
struct gl_program_parameter_list *paramList);
-
-
extern void
_mesa_print_instruction(const struct prog_instruction *inst);
@@ -290,9 +295,6 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids);
extern void GLAPIENTRY
_mesa_GenPrograms(GLsizei n, GLuint *ids);
-extern GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint id);
-
/*
diff --git a/src/mesa/shader/program_instruction.h b/src/mesa/shader/program_instruction.h
index cdec0ceb2a5..ad3a6d4dd4e 100644
--- a/src/mesa/shader/program_instruction.h
+++ b/src/mesa/shader/program_instruction.h
@@ -286,7 +286,7 @@ struct prog_instruction
GLuint CondUpdate:1;
/**
- * If prog_instruction::cc_update is \c GL_TRUE, this value selects the
+ * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the
* condition code register that is to be updated.
*
* In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition
@@ -339,6 +339,11 @@ struct prog_instruction
*/
GLuint TexSrcTarget:3;
/*@}*/
+
+ /**
+ * For BRA and CAL instructions, the location to jump to.
+ */
+ GLuint BranchTarget;
};
diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c
index 172d373b578..783177739d1 100644
--- a/src/mesa/shader/programopt.c
+++ b/src/mesa/shader/programopt.c
@@ -172,7 +172,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
fogVals[1] = 1.0 / SQRTF(log(2.0));
fogVals[2] = 0.0;
fogVals[3] = 0.0;
- fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals);
+ fogConsts = _mesa_add_unnamed_constant(fprog->Base.Parameters, fogVals, 4);
/* Scan program to find where result.color is written */
inst = newInst;
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index f26ff12adf1..da4d5c84721 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -50,28 +50,34 @@
#define RELEASE_SHADER(x)\
(**x)._generic._unknown.Release ((struct gl2_unknown_intf **) (x))
+
+
static struct gl2_unknown_intf **
-lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const char *function)
+lookup_handle(GLcontext * ctx, GLhandleARB handle, enum gl2_uiid uiid,
+ const char *function)
{
struct gl2_unknown_intf **unk;
/*
- * Note: _mesa_HashLookup() requires non-zero input values, so the passed-in handle value
- * must be checked beforehand.
+ * Note: _mesa_HashLookup() requires non-zero input values, so the
+ * passed-in handle value must be checked beforehand.
*/
if (handle == 0) {
- _mesa_error (ctx, GL_INVALID_VALUE, function);
+ _mesa_error(ctx, GL_INVALID_VALUE, function);
return NULL;
}
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- unk = (struct gl2_unknown_intf **) (_mesa_HashLookup (ctx->Shared->GL2Objects, handle));
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
- if (unk == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, function);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ unk = (struct gl2_unknown_intf **) _mesa_HashLookup(ctx->Shared->GL2Objects,
+ handle);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
+ if (unk == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, function);
+ }
else {
- unk = (**unk).QueryInterface (unk, uiid);
+ unk = (**unk).QueryInterface(unk, uiid);
if (unk == NULL)
- _mesa_error (ctx, GL_INVALID_OPERATION, function);
+ _mesa_error(ctx, GL_INVALID_OPERATION, function);
}
return unk;
}
@@ -92,895 +98,635 @@ lookup_handle (GLcontext *ctx, GLhandleARB handle, enum gl2_uiid uiid, const cha
struct gl2_shader_intf **x = (struct gl2_shader_intf **)\
lookup_handle (ctx, handle, UIID_SHADER, function);
-#define GET_LINKED_PROGRAM(x, handle, function)\
- GET_PROGRAM(x, handle, function);\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- RELEASE_PROGRAM(x);\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+
+#define GET_LINKED_PROGRAM(x, handle, function) \
+ GET_PROGRAM(x, handle, function); \
+ if (x && (**x).GetLinkStatus(x) == GL_FALSE) { \
+ RELEASE_PROGRAM(x); \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ x = NULL; \
}
-#define GET_CURRENT_LINKED_PROGRAM(x, function)\
- struct gl2_program_intf **x = NULL;\
- if (ctx->ShaderObjects.CurrentProgram == NULL)\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- else {\
- x = ctx->ShaderObjects.CurrentProgram;\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- }\
+#define GET_CURRENT_LINKED_PROGRAM(x, function) \
+ struct gl2_program_intf **x = ctx->ShaderObjects.CurrentProgram; \
+ if (!x || (**x).GetLinkStatus(x) == GL_FALSE) { \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ return; \
}
+
+
#define IS_NAME_WITH_GL_PREFIX(x) ((x)[0] == 'g' && (x)[1] == 'l' && (x)[2] == '_')
GLvoid GLAPIENTRY
-_mesa_DeleteObjectARB (GLhandleARB obj)
+_mesa_DeleteObjectARB(GLhandleARB obj)
{
- if (obj != 0)
- {
+ if (obj != 0) {
GET_CURRENT_CONTEXT(ctx);
GET_GENERIC(gen, obj, "glDeleteObjectARB");
- if (gen != NULL)
- {
- (**gen).Delete (gen);
+ if (gen != NULL) {
+ (**gen).Delete(gen);
RELEASE_GENERIC(gen);
}
}
}
GLhandleARB GLAPIENTRY
-_mesa_GetHandleARB (GLenum pname)
+_mesa_GetHandleARB(GLenum pname)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
- switch (pname)
- {
+ switch (pname) {
case GL_PROGRAM_OBJECT_ARB:
{
struct gl2_program_intf **pro = ctx->ShaderObjects.CurrentProgram;
if (pro != NULL)
- return (**pro)._container._generic.GetName ((struct gl2_generic_intf **) (pro));
+ return (**pro)._container._generic.
+ GetName((struct gl2_generic_intf **) (pro));
}
break;
- default:
- _mesa_error (ctx, GL_INVALID_ENUM, "glGetHandleARB");
- }
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB");
+ }
- return 0;
+ return 0;
}
GLvoid GLAPIENTRY
-_mesa_DetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj)
+_mesa_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glDetachObjectARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glDetachObjectARB");
- if (con != NULL)
- {
- GET_GENERIC(att, attachedObj, "glDetachObjectARB");
+ if (con != NULL) {
+ GET_GENERIC(att, attachedObj, "glDetachObjectARB");
- if (att != NULL)
- {
- (**con).Detach (con, att);
- RELEASE_GENERIC(att);
- }
- RELEASE_CONTAINER(con);
- }
+ if (att != NULL) {
+ (**con).Detach(con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
+ }
}
GLhandleARB GLAPIENTRY
-_mesa_CreateShaderObjectARB (GLenum shaderType)
+_mesa_CreateShaderObjectARB(GLenum shaderType)
+{
+ return _mesa_3dlabs_create_shader_object(shaderType);
+}
+
+GLvoid GLAPIENTRY
+_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
+ const GLcharARB ** string, const GLint * length)
{
- return _mesa_3dlabs_create_shader_object (shaderType);
+ GET_CURRENT_CONTEXT(ctx);
+ GLint *offsets;
+ GLsizei i;
+ GLcharARB *source;
+ GET_SHADER(sha, shaderObj, "glShaderSourceARB");
+
+ if (sha == NULL)
+ return;
+
+ if (string == NULL) {
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+
+ /*
+ * This array holds offsets of where the appropriate string ends, thus the last
+ * element will be set to the total length of the source code.
+ */
+ offsets = (GLint *) _mesa_malloc(count * sizeof(GLint));
+ if (offsets == NULL) {
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (string[i] == NULL) {
+ _mesa_free((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+ if (length == NULL || length[i] < 0)
+ offsets[i] = _mesa_strlen(string[i]);
+ else
+ offsets[i] = length[i];
+ /* accumulate string lengths */
+ if (i > 0)
+ offsets[i] += offsets[i - 1];
+ }
+
+ source =
+ (GLcharARB *) _mesa_malloc((offsets[count - 1] + 1) *
+ sizeof(GLcharARB));
+ if (source == NULL) {
+ _mesa_free((GLvoid *) offsets);
+ RELEASE_SHADER(sha);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ GLint start = (i > 0) ? offsets[i - 1] : 0;
+ _mesa_memcpy(source + start, string[i],
+ (offsets[i] - start) * sizeof(GLcharARB));
+ }
+ source[offsets[count - 1]] = '\0';
+
+ (**sha).SetSource(sha, source, offsets, count);
+ RELEASE_SHADER(sha);
}
GLvoid GLAPIENTRY
-_mesa_ShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string,
- const GLint *length)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint *offsets;
- GLsizei i;
- GLcharARB *source;
- GET_SHADER(sha, shaderObj, "glShaderSourceARB");
-
- if (sha == NULL)
- return;
-
- if (string == NULL)
- {
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
-
- /*
- * This array holds offsets of where the appropriate string ends, thus the last
- * element will be set to the total length of the source code.
- */
- offsets = (GLint *) _mesa_malloc (count * sizeof (GLint));
- if (offsets == NULL)
- {
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++)
- {
- if (string[i] == NULL)
- {
- _mesa_free ((GLvoid *) offsets);
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
- if (length == NULL || length[i] < 0)
- offsets[i] = _mesa_strlen (string[i]);
- else
- offsets[i] = length[i];
- /* accumulate string lengths */
- if (i > 0)
- offsets[i] += offsets[i - 1];
- }
-
- source = (GLcharARB *) _mesa_malloc ((offsets[count - 1] + 1) * sizeof (GLcharARB));
- if (source == NULL)
- {
- _mesa_free ((GLvoid *) offsets);
- RELEASE_SHADER(sha);
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++)
- {
- GLint start = (i > 0) ? offsets[i - 1] : 0;
- _mesa_memcpy (source + start, string[i], (offsets[i] - start) * sizeof (GLcharARB));
- }
- source[offsets[count - 1]] = '\0';
-
- (**sha).SetSource (sha, source, offsets, count);
- RELEASE_SHADER(sha);
-}
-
-GLvoid GLAPIENTRY
-_mesa_CompileShaderARB (GLhandleARB shaderObj)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_SHADER(sha, shaderObj, "glCompileShaderARB");
-
- if (sha != NULL)
- {
- (**sha).Compile (sha);
- RELEASE_SHADER(sha);
- }
+_mesa_CompileShaderARB(GLhandleARB shaderObj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sha, shaderObj, "glCompileShaderARB");
+
+ if (sha != NULL) {
+ (**sha).Compile(sha);
+ RELEASE_SHADER(sha);
+ }
}
GLhandleARB GLAPIENTRY
-_mesa_CreateProgramObjectARB (GLvoid)
+_mesa_CreateProgramObjectARB(GLvoid)
{
- return _mesa_3dlabs_create_program_object ();
+ return _mesa_3dlabs_create_program_object();
}
GLvoid GLAPIENTRY
-_mesa_AttachObjectARB (GLhandleARB containerObj, GLhandleARB obj)
+_mesa_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glAttachObjectARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glAttachObjectARB");
- if (con != NULL)
- {
- GET_GENERIC(att, obj, "glAttachObjectARB");
+ if (con != NULL) {
+ GET_GENERIC(att, obj, "glAttachObjectARB");
- if (att != NULL)
- {
- (**con).Attach (con, att);
- RELEASE_GENERIC(att);
- }
- RELEASE_CONTAINER(con);
- }
+ if (att != NULL) {
+ (**con).Attach(con, att);
+ RELEASE_GENERIC(att);
+ }
+ RELEASE_CONTAINER(con);
+ }
}
GLvoid GLAPIENTRY
-_mesa_LinkProgramARB (GLhandleARB programObj)
+_mesa_LinkProgramARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glLinkProgramARB");
-
- if (pro != NULL)
- {
- (**pro).Link (pro);
- if (pro == ctx->ShaderObjects.CurrentProgram)
- {
- if ((**pro).GetLinkStatus (pro))
- _mesa_UseProgramObjectARB (programObj);
- else
- _mesa_UseProgramObjectARB (0);
- }
- RELEASE_PROGRAM(pro);
- }
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glLinkProgramARB");
+
+ if (pro != NULL) {
+ (**pro).Link(pro);
+ if (pro == ctx->ShaderObjects.CurrentProgram) {
+ if ((**pro).GetLinkStatus(pro))
+ _mesa_UseProgramObjectARB(programObj);
+ else
+ _mesa_UseProgramObjectARB(0);
+ }
+ RELEASE_PROGRAM(pro);
+ }
}
GLvoid GLAPIENTRY
-_mesa_UseProgramObjectARB (GLhandleARB programObj)
+_mesa_UseProgramObjectARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
struct gl2_program_intf **program = NULL;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (programObj != 0)
- {
- GET_PROGRAM(pro, programObj, "glUseProgramObjectARB");
+ if (programObj != 0) {
+ GET_PROGRAM(pro, programObj, "glUseProgramObjectARB(program)");
- if (pro == NULL)
- return;
+ if (pro == NULL)
+ return;
- if ((**pro).GetLinkStatus (pro) == GL_FALSE)
- {
- RELEASE_PROGRAM(pro);
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB");
- return;
- }
+ if ((**pro).GetLinkStatus(pro) == GL_FALSE) {
+ RELEASE_PROGRAM(pro);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramObjectARB(not linked)");
+ return;
+ }
- program = pro;
+ program = pro;
- ctx->ShaderObjects._VertexShaderPresent = (**pro).IsShaderPresent (pro, GL_VERTEX_SHADER_ARB);
- ctx->ShaderObjects._FragmentShaderPresent = (**pro).IsShaderPresent (pro,
- GL_FRAGMENT_SHADER_ARB);
- }
- else
- {
- ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
- ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
- }
+ ctx->ShaderObjects._VertexShaderPresent =
+ (**pro).IsShaderPresent(pro, GL_VERTEX_SHADER_ARB);
+ ctx->ShaderObjects._FragmentShaderPresent =
+ (**pro).IsShaderPresent(pro, GL_FRAGMENT_SHADER_ARB);
+ }
+ else {
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ }
- if (ctx->ShaderObjects.CurrentProgram != NULL)
- RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram);
- ctx->ShaderObjects.CurrentProgram = program;
+ if (ctx->ShaderObjects.CurrentProgram != NULL)
+ RELEASE_PROGRAM(ctx->ShaderObjects.CurrentProgram);
+ ctx->ShaderObjects.CurrentProgram = program;
}
GLvoid GLAPIENTRY
-_mesa_ValidateProgramARB (GLhandleARB programObj)
+_mesa_ValidateProgramARB(GLhandleARB programObj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glValidateProgramARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glValidateProgramARB");
- if (pro != NULL)
- {
- (**pro).Validate (pro);
- RELEASE_PROGRAM(pro);
- }
+ if (pro != NULL) {
+ (**pro).Validate(pro);
+ RELEASE_PROGRAM(pro);
+ }
}
-GLvoid GLAPIENTRY
-_mesa_Uniform1fARB (GLint location, GLfloat v0)
+
+/**
+ * Helper function for all the _mesa_Uniform*() functions below.
+ */
+static INLINE void
+uniform(GLint location, GLsizei count, const GLvoid *values, GLenum type,
+ const char *caller)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, caller);
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_FLOAT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fARB");
- }
+ if (!(**pro).WriteUniform(pro, location, count, values, type))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
}
+
GLvoid GLAPIENTRY
-_mesa_Uniform2fARB (GLint location, GLfloat v0, GLfloat v1)
+_mesa_Uniform1fARB(GLint location, GLfloat v0)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[2];
- v[0] = v0;
- v[1] = v1;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fARB");
- }
+ uniform(location, 1, &v0, GL_FLOAT, "glUniform1fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fARB");
- }
+ GLfloat v[2];
+ v[0] = v0;
+ v[1] = v1;
+ uniform(location, 1, v, GL_FLOAT_VEC2, "glUniform2fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLfloat v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_FLOAT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fARB");
- }
+ GLfloat v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ uniform(location, 1, v, GL_FLOAT_VEC3, "glUniform3fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1iARB (GLint location, GLint v0)
+_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
+ GLfloat v3)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, 1, &v0, GL_INT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1iARB");
- }
+ GLfloat v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ uniform(location, 1, v, GL_FLOAT_VEC4, "glUniform4fARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2iARB (GLint location, GLint v0, GLint v1)
+_mesa_Uniform1iARB(GLint location, GLint v0)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[2];
- v[0] = v0;
- v[1] = v1;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2iARB");
- }
+ uniform(location, 1, &v0, GL_INT, "glUniform1iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3iARB (GLint location, GLint v0, GLint v1, GLint v2)
+_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3iARB");
- }
+ GLint v[2];
+ v[0] = v0;
+ v[1] = v1;
+ uniform(location, 1, v, GL_INT_VEC2, "glUniform2iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB");
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- GLint v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
-
- if (!(**pro).WriteUniform (pro, location, 1, v, GL_INT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4iARB");
- }
+ GLint v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ uniform(location, 1, v, GL_INT_VEC3, "glUniform3iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1fvARB");
- }
+ GLint v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ uniform(location, 1, v, GL_INT_VEC4, "glUniform4iARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2fvARB");
- }
+ uniform(location, count, value, GL_FLOAT, "glUniform1fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3fvARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC2, "glUniform2fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform4fvARB (GLint location, GLsizei count, const GLfloat *value)
+_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4fvARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC3, "glUniform3fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform1ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform1ivARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform1ivARB");
- }
+ uniform(location, count, value, GL_FLOAT_VEC4, "glUniform4fvARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform2ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform2ivARB");
- return;
- }
+ uniform(location, count, value, GL_INT, "glUniform1ivARB");
+}
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+GLvoid GLAPIENTRY
+_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ uniform(location, count, value, GL_INT_VEC2, "glUniform2ivARB");
+}
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform2ivARB");
- }
+GLvoid GLAPIENTRY
+_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ uniform(location, count, value, GL_INT_VEC3, "glUniform3ivARB");
}
GLvoid GLAPIENTRY
-_mesa_Uniform3ivARB (GLint location, GLsizei count, const GLint *value)
+_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB");
+ uniform(location, count, value, GL_INT_VEC4, "glUniform4ivARB");
+}
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform3ivARB");
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+/**
+ * Helper function used by UniformMatrix**vARB() functions below.
+ */
+static void
+uniform_matrix(GLint cols, GLint rows, const char *caller,
+ GLenum matrixType,
+ GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *values)
+{
+ const GLint matElements = rows * cols;
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_LINKED_PROGRAM(pro, caller);
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform3ivARB");
- }
-}
+ if (values == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, caller);
+ return;
+ }
-GLvoid GLAPIENTRY
-_mesa_Uniform4ivARB (GLint location, GLsizei count, const GLint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB");
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniform4ivARB");
- return;
- }
+ if (transpose) {
+ GLfloat *trans, *pt;
+ const GLfloat *pv;
+ GLint i, j, k;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ trans = (GLfloat *) _mesa_malloc(count * matElements * sizeof(GLfloat));
+ if (!trans) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, caller);
+ return;
+ }
+
+ pt = trans;
+ pv = values;
+ for (i = 0; i < count; i++) {
+ /* transpose from pv matrix into pt matrix */
+ for (j = 0; j < cols; j++) {
+ for (k = 0; k < rows; k++) {
+ /* XXX verify this */
+ pt[j * rows + k] = pv[k * cols + j];
+ }
+ }
+ pt += matElements;
+ pv += matElements;
+ }
- if (pro != NULL)
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_INT_VEC4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniform4ivARB");
- }
+ if (!(**pro).WriteUniform(pro, location, count, trans, matrixType))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
+ _mesa_free(trans);
+ }
+ else {
+ if (!(**pro).WriteUniform(pro, location, count, values, matrixType))
+ _mesa_error(ctx, GL_INVALID_OPERATION, caller);
+ }
}
+
GLvoid GLAPIENTRY
-_mesa_UniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix2fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 4 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix2fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 4; pt += 4, pv += 4)
- {
- pt[0] = pv[0];
- pt[1] = pv[2];
- pt[2] = pv[1];
- pt[3] = pv[3];
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT2))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix2fvARB");
- }
- }
+_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(2, 2, "glUniformMatrix2fvARB", GL_FLOAT_MAT2,
+ location, count, transpose, value);
}
GLvoid GLAPIENTRY
-_mesa_UniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix3fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 9 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix3fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 9; pt += 9, pv += 9)
- {
- pt[0] = pv[0];
- pt[1] = pv[3];
- pt[2] = pv[6];
- pt[3] = pv[1];
- pt[4] = pv[4];
- pt[5] = pv[7];
- pt[6] = pv[2];
- pt[7] = pv[5];
- pt[8] = pv[8];
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT3))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix3fvARB");
- }
- }
+_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(3, 3, "glUniformMatrix3fvARB", GL_FLOAT_MAT3,
+ location, count, transpose, value);
}
GLvoid GLAPIENTRY
-_mesa_UniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB");
-
- if (value == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glUniformMatrix4fvARB");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- if (pro != NULL)
- {
- if (transpose)
- {
- GLfloat *trans, *pt;
- const GLfloat *pv;
-
- trans = (GLfloat *) _mesa_malloc (count * 16 * sizeof (GLfloat));
- if (trans == NULL)
- {
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "glUniformMatrix4fvARB");
- return;
- }
- for (pt = trans, pv = value; pt != trans + count * 16; pt += 16, pv += 16)
- {
- _math_transposef (pt, pv);
- }
- if (!(**pro).WriteUniform (pro, location, count, trans, GL_FLOAT_MAT4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
- _mesa_free (trans);
- }
- else
- {
- if (!(**pro).WriteUniform (pro, location, count, value, GL_FLOAT_MAT4))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glUniformMatrix4fvARB");
- }
- }
+_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ uniform_matrix(4, 4, "glUniformMatrix4fvARB", GL_FLOAT_MAT4,
+ location, count, transpose, value);
}
static GLboolean
-_mesa_get_object_parameter (GLhandleARB obj, GLenum pname, GLvoid *params, GLboolean *integral,
- GLint *size)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint *ipar = (GLint *) params;
-
- /* set default values */
- *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */
- *size = 1; /* param array size */
-
- switch (pname)
- {
- case GL_OBJECT_TYPE_ARB:
- case GL_OBJECT_DELETE_STATUS_ARB:
- case GL_OBJECT_INFO_LOG_LENGTH_ARB:
- {
- GET_GENERIC(gen, obj, "glGetObjectParameterivARB");
-
- if (gen == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_TYPE_ARB:
- *ipar = (**gen).GetType (gen);
- break;
- case GL_OBJECT_DELETE_STATUS_ARB:
- *ipar = (**gen).GetDeleteStatus (gen);
- break;
+_mesa_get_object_parameter(GLhandleARB obj, GLenum pname, GLvoid * params,
+ GLboolean * integral, GLint * size)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint *ipar = (GLint *) params;
+
+ /* set default values */
+ *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */
+ *size = 1; /* param array size */
+
+ switch (pname) {
+ case GL_OBJECT_TYPE_ARB:
+ case GL_OBJECT_DELETE_STATUS_ARB:
+ case GL_OBJECT_INFO_LOG_LENGTH_ARB:
+ {
+ GET_GENERIC(gen, obj, "glGetObjectParameterivARB");
+
+ if (gen == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_TYPE_ARB:
+ *ipar = (**gen).GetType(gen);
+ break;
+ case GL_OBJECT_DELETE_STATUS_ARB:
+ *ipar = (**gen).GetDeleteStatus(gen);
+ break;
case GL_OBJECT_INFO_LOG_LENGTH_ARB:
- *ipar = (**gen).GetInfoLogLength (gen);
+ *ipar = (**gen).GetInfoLogLength(gen);
+ break;
+ }
+
+ RELEASE_GENERIC(gen);
+ }
+ break;
+ case GL_OBJECT_SUBTYPE_ARB:
+ case GL_OBJECT_COMPILE_STATUS_ARB:
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ GET_SHADER(sha, obj, "glGetObjectParameterivARB");
+
+ if (sha == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_SUBTYPE_ARB:
+ *ipar = (**sha).GetSubType(sha);
+ break;
+ case GL_OBJECT_COMPILE_STATUS_ARB:
+ *ipar = (**sha).GetCompileStatus(sha);
+ break;
+ case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
+ {
+ const GLcharARB *src = (**sha).GetSource(sha);
+ if (src == NULL)
+ *ipar = 0;
+ else
+ *ipar = _mesa_strlen(src) + 1;
+ }
+ break;
+ }
+
+ RELEASE_SHADER(sha);
+ }
+ break;
+ case GL_OBJECT_LINK_STATUS_ARB:
+ case GL_OBJECT_VALIDATE_STATUS_ARB:
+ case GL_OBJECT_ATTACHED_OBJECTS_ARB:
+ case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
+ case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
+ {
+ GET_PROGRAM(pro, obj, "glGetObjectParameterivARB");
+
+ if (pro == NULL)
+ return GL_FALSE;
+
+ switch (pname) {
+ case GL_OBJECT_LINK_STATUS_ARB:
+ *ipar = (**pro).GetLinkStatus(pro);
+ break;
+ case GL_OBJECT_VALIDATE_STATUS_ARB:
+ *ipar = (**pro).GetValidateStatus(pro);
break;
- }
-
- RELEASE_GENERIC(gen);
- }
- break;
- case GL_OBJECT_SUBTYPE_ARB:
- case GL_OBJECT_COMPILE_STATUS_ARB:
- case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
- {
- GET_SHADER(sha, obj, "glGetObjectParameterivARB");
-
- if (sha == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_SUBTYPE_ARB:
- *ipar = (**sha).GetSubType (sha);
- break;
- case GL_OBJECT_COMPILE_STATUS_ARB:
- *ipar = (**sha).GetCompileStatus (sha);
- break;
- case GL_OBJECT_SHADER_SOURCE_LENGTH_ARB:
- {
- const GLcharARB *src = (**sha).GetSource (sha);
-
- if (src == NULL)
- *ipar = 0;
- else
- *ipar = _mesa_strlen (src) + 1;
- }
- break;
- }
-
- RELEASE_SHADER(sha);
- }
- break;
- case GL_OBJECT_LINK_STATUS_ARB:
- case GL_OBJECT_VALIDATE_STATUS_ARB:
- case GL_OBJECT_ATTACHED_OBJECTS_ARB:
- case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
- case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
- {
- GET_PROGRAM(pro, obj, "glGetObjectParameterivARB");
-
- if (pro == NULL)
- return GL_FALSE;
-
- switch (pname)
- {
- case GL_OBJECT_LINK_STATUS_ARB:
- *ipar = (**pro).GetLinkStatus (pro);
- break;
- case GL_OBJECT_VALIDATE_STATUS_ARB:
- *ipar = (**pro).GetValidateStatus (pro);
- break;
case GL_OBJECT_ATTACHED_OBJECTS_ARB:
- *ipar = (**pro)._container.GetAttachedCount ((struct gl2_container_intf **) (pro));
+ *ipar =
+ (**pro)._container.
+ GetAttachedCount((struct gl2_container_intf **) (pro));
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
+ *ipar = (**pro).GetActiveUniformCount(pro);
+ break;
+ case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
+ *ipar = (**pro).GetActiveUniformMaxLength(pro);
+ break;
+ case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB:
+ *ipar = (**pro).GetActiveAttribCount(pro);
break;
- case GL_OBJECT_ACTIVE_UNIFORMS_ARB:
- *ipar = (**pro).GetActiveUniformCount (pro);
- break;
- case GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB:
- *ipar = (**pro).GetActiveUniformMaxLength (pro);
- break;
- case GL_OBJECT_ACTIVE_ATTRIBUTES_ARB:
- *ipar = (**pro).GetActiveAttribCount (pro);
- break;
- case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB:
- *ipar = (**pro).GetActiveAttribMaxLength (pro);
- break;
- }
-
- RELEASE_PROGRAM(pro);
- }
- break;
- default:
- _mesa_error (ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB");
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ case GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB:
+ *ipar = (**pro).GetActiveAttribMaxLength(pro);
+ break;
+ }
+
+ RELEASE_PROGRAM(pro);
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetObjectParameterivARB");
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
GLvoid GLAPIENTRY
-_mesa_GetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params)
+_mesa_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GLboolean integral;
- GLint size;
+ GET_CURRENT_CONTEXT(ctx);
+ GLboolean integral;
+ GLint size;
- if (params == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB");
- return;
- }
-
- assert (sizeof (GLfloat) == sizeof (GLint));
+ if (params == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterfvARB");
+ return;
+ }
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
- if (integral)
- {
- GLint i;
+ assert(sizeof(GLfloat) == sizeof(GLint));
- for (i = 0; i < size; i++)
- params[i] = (GLfloat) ((GLint *) params)[i];
- }
+ if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params,
+ &integral, &size)) {
+ if (integral) {
+ GLint i;
+ for (i = 0; i < size; i++)
+ params[i] = (GLfloat) ((GLint *) params)[i];
+ }
+ }
}
GLvoid GLAPIENTRY
-_mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
+_mesa_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GLboolean integral;
- GLint size;
+ GET_CURRENT_CONTEXT(ctx);
+ GLboolean integral;
+ GLint size;
- if (params == NULL)
- {
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
- return;
- }
-
- assert (sizeof (GLfloat) == sizeof (GLint));
+ if (params == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
+ return;
+ }
- if (_mesa_get_object_parameter (obj, pname, (GLvoid *) params, &integral, &size))
- if (!integral)
- {
- GLint i;
+ assert(sizeof(GLfloat) == sizeof(GLint));
- for (i = 0; i < size; i++)
- params[i] = (GLint) ((GLfloat *) params)[i];
- }
+ if (_mesa_get_object_parameter(obj, pname, (GLvoid *) params,
+ &integral, &size)) {
+ if (!integral) {
+ GLint i;
+ for (i = 0; i < size; i++)
+ params[i] = (GLint) ((GLfloat *) params)[i];
+ }
+ }
}
@@ -993,222 +739,453 @@ _mesa_GetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params)
* \param dst the string destination
*/
static GLvoid
-copy_string(const GLcharARB *src, GLsizei maxLength, GLsizei *length,
- GLcharARB *dst)
+copy_string(const GLcharARB * src, GLsizei maxLength, GLsizei * length,
+ GLcharARB * dst)
{
- GLsizei len;
- for (len = 0; len < maxLength - 1 && src && src[len]; len++)
- dst[len] = src[len];
- if (maxLength > 0)
- dst[len] = 0;
- if (length)
- *length = len;
+ GLsizei len;
+ for (len = 0; len < maxLength - 1 && src && src[len]; len++)
+ dst[len] = src[len];
+ if (maxLength > 0)
+ dst[len] = 0;
+ if (length)
+ *length = len;
}
GLvoid GLAPIENTRY
-_mesa_GetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
+_mesa_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length,
+ GLcharARB * infoLog)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_GENERIC(gen, obj, "glGetInfoLogARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_GENERIC(gen, obj, "glGetInfoLogARB");
- if (gen == NULL)
- return;
+ if (gen == NULL)
+ return;
- if (infoLog == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetInfoLogARB");
+ if (infoLog == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetInfoLogARB");
else {
- GLsizei actualsize = (**gen).GetInfoLogLength (gen);
+ GLsizei actualsize = (**gen).GetInfoLogLength(gen);
if (actualsize > maxLength)
actualsize = maxLength;
- (**gen).GetInfoLog (gen, actualsize, infoLog);
+ (**gen).GetInfoLog(gen, actualsize, infoLog);
if (length != NULL)
*length = (actualsize > 0) ? actualsize - 1 : 0;
}
- RELEASE_GENERIC(gen);
+ RELEASE_GENERIC(gen);
}
GLvoid GLAPIENTRY
-_mesa_GetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count,
- GLhandleARB *obj)
+_mesa_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxCount,
+ GLsizei * count, GLhandleARB * obj)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB");
-
- if (con == NULL)
- return;
-
- if (obj == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB");
- else
- {
- GLsizei cnt, i;
+ GET_CURRENT_CONTEXT(ctx);
+ GET_CONTAINER(con, containerObj, "glGetAttachedObjectsARB");
- cnt = (**con).GetAttachedCount (con);
- if (cnt > maxCount)
- cnt = maxCount;
- if (count != NULL)
- *count = cnt;
+ if (con == NULL)
+ return;
- for (i = 0; i < cnt; i++)
- {
- struct gl2_generic_intf **x = (**con).GetAttached (con, i);
- obj[i] = (**x).GetName (x);
- RELEASE_GENERIC(x);
- }
- }
- RELEASE_CONTAINER(con);
+ if (obj == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttachedObjectsARB");
+ else {
+ GLsizei cnt, i;
+
+ cnt = (**con).GetAttachedCount(con);
+ if (cnt > maxCount)
+ cnt = maxCount;
+ if (count != NULL)
+ *count = cnt;
+
+ for (i = 0; i < cnt; i++) {
+ struct gl2_generic_intf **x = (**con).GetAttached(con, i);
+ obj[i] = (**x).GetName(x);
+ RELEASE_GENERIC(x);
+ }
+ }
+ RELEASE_CONTAINER(con);
}
GLint GLAPIENTRY
-_mesa_GetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name)
+_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GLint loc = -1;
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GLint loc = -1;
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
- if (pro == NULL)
- return -1;
+ if (!pro)
+ return -1;
- if (name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetUniformLocationARB");
- else
- {
- if (!IS_NAME_WITH_GL_PREFIX(name))
- loc = (**pro).GetUniformLocation (pro, name);
- }
- RELEASE_PROGRAM(pro);
- return loc;
+ if (name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformLocationARB");
+ else {
+ if (!IS_NAME_WITH_GL_PREFIX(name))
+ loc = (**pro).GetUniformLocation(pro, name);
+ }
+ RELEASE_PROGRAM(pro);
+ return loc;
}
GLvoid GLAPIENTRY
-_mesa_GetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
- GLint *size, GLenum *type, GLcharARB *name)
+_mesa_GetActiveUniformARB(GLhandleARB programObj, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glGetActiveUniformARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glGetActiveUniformARB");
- if (pro == NULL)
- return;
+ if (pro == NULL)
+ return;
- if (size == NULL || type == NULL || name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- else
- {
- if (index < (**pro).GetActiveUniformCount (pro))
- (**pro).GetActiveUniform (pro, index, maxLength, length, size, type, name);
- else
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
- }
- RELEASE_PROGRAM(pro);
+ if (size == NULL || type == NULL || name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
+ else {
+ if (index < (**pro).GetActiveUniformCount(pro))
+ (**pro).GetActiveUniform(pro, index, maxLength, length, size, type,
+ name);
+ else
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniformARB");
+ }
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params)
+_mesa_GetUniformfvARB(GLhandleARB programObj, GLint location, GLfloat * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
+
+ if (!pro)
+ return;
- if (pro != NULL)
- {
- /* TODO */
- RELEASE_PROGRAM(pro);
- }
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_FLOAT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
+
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetUniformivARB (GLhandleARB programObj, GLint location, GLint *params)
+_mesa_GetUniformivARB(GLhandleARB programObj, GLint location, GLint * params)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
+
+ if (!pro)
+ return;
- if (pro != NULL)
- {
- /* TODO */
- RELEASE_PROGRAM(pro);
- }
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_INT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
-_mesa_GetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source)
+_mesa_GetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length,
+ GLcharARB * source)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_SHADER(sha, obj, "glGetShaderSourceARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sha, obj, "glGetShaderSourceARB");
- if (sha == NULL)
- return;
+ if (sha == NULL)
+ return;
- if (source == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetShaderSourceARB");
- else
- copy_string ((**sha).GetSource (sha), maxLength, length, source);
- RELEASE_SHADER(sha);
+ if (source == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderSourceARB");
+ else
+ copy_string((**sha).GetSource(sha), maxLength, length, source);
+ RELEASE_SHADER(sha);
}
/* GL_ARB_vertex_shader */
GLvoid GLAPIENTRY
-_mesa_BindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name)
+_mesa_BindAttribLocationARB(GLhandleARB programObj, GLuint index,
+ const GLcharARB * name)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glBindAttribLocationARB");
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glBindAttribLocationARB");
+
+ if (pro == NULL)
+ return;
+
+ if (name == NULL || index >= MAX_VERTEX_ATTRIBS)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
+ else if (IS_NAME_WITH_GL_PREFIX(name))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB");
+ else
+ (**pro).OverrideAttribBinding(pro, index, name);
+ RELEASE_PROGRAM(pro);
+}
- if (pro == NULL)
- return;
+GLvoid GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB programObj, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, programObj, "glGetActiveAttribARB");
+
+ if (pro == NULL)
+ return;
+
+ if (name == NULL || index >= (**pro).GetActiveAttribCount(pro))
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
+ else
+ (**pro).GetActiveAttrib(pro, index, maxLength, length, size, type,
+ name);
+ RELEASE_PROGRAM(pro);
+}
- if (name == NULL || index >= MAX_VERTEX_ATTRIBS)
- _mesa_error (ctx, GL_INVALID_VALUE, "glBindAttribLocationARB");
- else if (IS_NAME_WITH_GL_PREFIX(name))
- _mesa_error (ctx, GL_INVALID_OPERATION, "glBindAttribLocationARB");
- else
- (**pro).OverrideAttribBinding (pro, index, name);
- RELEASE_PROGRAM(pro);
+GLint GLAPIENTRY
+_mesa_GetAttribLocationARB(GLhandleARB programObj, const GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint loc = -1;
+ GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB");
+
+ if (!pro)
+ return -1;
+
+ if (name == NULL)
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
+ else if (!IS_NAME_WITH_GL_PREFIX(name))
+ loc = (**pro).GetAttribLocation(pro, name);
+ RELEASE_PROGRAM(pro);
+ return loc;
}
-GLvoid GLAPIENTRY
-_mesa_GetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length,
- GLint *size, GLenum *type, GLcharARB *name)
+
+/**
+ ** OpenGL 2.0 functions which basically wrap the ARB_shader functions
+ **/
+
+void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader)
{
- GET_CURRENT_CONTEXT(ctx);
- GET_PROGRAM(pro, programObj, "glGetActiveAttribARB");
+ _mesa_AttachObjectARB(program, shader);
+}
- if (pro == NULL)
- return;
- if (name == NULL || index >= (**pro).GetActiveAttribCount (pro))
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetActiveAttribARB");
- else
- (**pro).GetActiveAttrib (pro, index, maxLength, length, size, type, name);
- RELEASE_PROGRAM(pro);
+GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum type)
+{
+ return (GLuint) _mesa_CreateShaderObjectARB(type);
}
-GLint GLAPIENTRY
-_mesa_GetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name)
+GLuint GLAPIENTRY
+_mesa_CreateProgram(void)
+{
+ return (GLuint) _mesa_CreateProgramObjectARB();
+}
+
+void GLAPIENTRY
+_mesa_DeleteProgram(GLuint program)
+{
+ _mesa_DeleteObjectARB(program);
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteShader(GLuint shader)
{
- GET_CURRENT_CONTEXT(ctx);
- GLint loc = -1;
- GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB");
+ _mesa_DeleteObjectARB(shader);
+}
- if (pro == NULL)
- return -1;
+void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader)
+{
+ _mesa_DetachObjectARB(program, shader);
+}
- if (name == NULL)
- _mesa_error (ctx, GL_INVALID_VALUE, "glGetAttribLocationARB");
- else if (!IS_NAME_WITH_GL_PREFIX(name))
- loc = (**pro).GetAttribLocation (pro, name);
- RELEASE_PROGRAM(pro);
- return loc;
+void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj)
+{
+ _mesa_GetAttachedObjectsARB(program, maxCount, count, obj);
}
+void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, program, "glGetProgramiv");
+
+ if (!pro)
+ return;
+
+ switch (pname) {
+ case GL_DELETE_STATUS:
+ *params = (**pro)._container._generic.GetDeleteStatus((struct gl2_generic_intf **) pro);
+ break;
+ case GL_LINK_STATUS:
+ *params = (**pro).GetLinkStatus(pro);
+ break;
+ case GL_VALIDATE_STATUS:
+ *params = (**pro).GetValidateStatus(pro);
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = (**pro)._container._generic.GetInfoLogLength( (struct gl2_generic_intf **) pro );
+ break;
+ case GL_ATTACHED_SHADERS:
+ *params = (**pro)._container.GetAttachedCount( (struct gl2_container_intf **) pro );
+ break;
+ case GL_ACTIVE_ATTRIBUTES:
+ *params = (**pro).GetActiveAttribCount(pro);
+ break;
+ case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+ *params = (**pro).GetActiveAttribMaxLength(pro);
+ break;
+ case GL_ACTIVE_UNIFORMS:
+ *params = (**pro).GetActiveUniformCount(pro);
+ break;
+ case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+ *params = (**pro).GetActiveUniformMaxLength(pro);
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
+ return;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ _mesa_GetInfoLogARB(program, bufSize, length, infoLog);
+}
+
+void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sh, shader, "glGetShaderiv");
+
+ if (!sh)
+ return;
+
+ switch (pname) {
+ case GL_SHADER_TYPE:
+ *params = (**sh).GetSubType(sh);
+ break;
+ case GL_DELETE_STATUS:
+ *params = (**sh)._generic.GetDeleteStatus((struct gl2_generic_intf **) sh);
+ break;
+ case GL_COMPILE_STATUS:
+ *params = (**sh).GetCompileStatus(sh);
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = (**sh)._generic.GetInfoLogLength((struct gl2_generic_intf **)sh);
+ break;
+ case GL_SHADER_SOURCE_LENGTH:
+ {
+ const GLchar *src = (**sh).GetSource(sh);
+ *params = src ? (_mesa_strlen(src) + 1) : 0;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)");
+ return;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ _mesa_GetInfoLogARB(shader, bufSize, length, infoLog);
+}
+
+GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_PROGRAM(pro, program, "glIsProgram");
+ if (pro) {
+ RELEASE_PROGRAM(pro);
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GET_SHADER(sh, shader, "glIsProgram");
+ if (sh) {
+ RELEASE_SHADER(sh);
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ ** 2.1 functions
+ **/
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(2, 3, "glUniformMatrix2x3fv", GL_FLOAT_MAT2x3,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(3, 2, "glUniformMatrix3x2fv", GL_FLOAT_MAT3x2,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(2, 4, "glUniformMatrix2x4fv", GL_FLOAT_MAT2x4,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(4, 2, "glUniformMatrix4x2fv", GL_FLOAT_MAT4x2,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(3, 4, "glUniformMatrix3x4fv", GL_FLOAT_MAT3x4,
+ location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ uniform_matrix(4, 3, "glUniformMatrix4x3fv", GL_FLOAT_MAT4x3,
+ location, count, transpose, value);
+}
+
+
+
+
+
#endif
GLvoid
-_mesa_init_shaderobjects (GLcontext *ctx)
+_mesa_init_shaderobjects(GLcontext * ctx)
{
- ctx->ShaderObjects.CurrentProgram = NULL;
- ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
- ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
+ ctx->ShaderObjects.CurrentProgram = NULL;
+ ctx->ShaderObjects._FragmentShaderPresent = GL_FALSE;
+ ctx->ShaderObjects._VertexShaderPresent = GL_FALSE;
- _mesa_init_shaderobjects_3dlabs (ctx);
+ _mesa_init_shaderobjects_3dlabs(ctx);
}
-
diff --git a/src/mesa/shader/shaderobjects.h b/src/mesa/shader/shaderobjects.h
index cc670216292..09ba807255e 100644
--- a/src/mesa/shader/shaderobjects.h
+++ b/src/mesa/shader/shaderobjects.h
@@ -104,6 +104,8 @@ struct gl2_program_intf
GLint (* GetUniformLocation) (struct gl2_program_intf **, const GLchar *name);
GLboolean (* WriteUniform) (struct gl2_program_intf **, GLint loc, GLsizei count,
const GLvoid *data, GLenum type);
+ GLboolean (* ReadUniform) (struct gl2_program_intf **, GLint loc, GLsizei count,
+ GLvoid *data, GLenum type);
GLvoid (* GetActiveAttrib) (struct gl2_program_intf **, GLuint index, GLsizei maxLength,
GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GLuint (* GetActiveAttribMaxLength) (struct gl2_program_intf **);
@@ -270,6 +272,79 @@ _mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *);
#endif /* FEATURE_ARB_vertex_shader */
+
+/* 2.0 */
+extern void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateProgram(void);
+
+extern void GLAPIENTRY
+_mesa_DeleteProgram(GLuint program);
+
+extern void GLAPIENTRY
+_mesa_DeleteShader(GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj);
+
+extern void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+extern void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint program);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint shader);
+
+
+
+/* 2.1 */
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+
+
#endif /* FEATURE_ARB_shader_objects */
extern void
diff --git a/src/mesa/shader/shaderobjects_3dlabs.c b/src/mesa/shader/shaderobjects_3dlabs.c
index 96680f21405..3ead1a17841 100755
--- a/src/mesa/shader/shaderobjects_3dlabs.c
+++ b/src/mesa/shader/shaderobjects_3dlabs.c
@@ -48,217 +48,214 @@
struct gl2_unknown_obj
{
- GLuint reference_count;
- void (* _destructor) (struct gl2_unknown_intf **);
+ GLuint reference_count;
+ void (*_destructor) (struct gl2_unknown_intf **);
};
struct gl2_unknown_impl
{
- struct gl2_unknown_intf *_vftbl;
- struct gl2_unknown_obj _obj;
+ struct gl2_unknown_intf *_vftbl;
+ struct gl2_unknown_obj _obj;
};
static void
-_unknown_destructor (struct gl2_unknown_intf **intf)
+_unknown_destructor(struct gl2_unknown_intf **intf)
{
}
static void
-_unknown_AddRef (struct gl2_unknown_intf **intf)
+_unknown_AddRef(struct gl2_unknown_intf **intf)
{
- struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
+ struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
- impl->_obj.reference_count++;
+ impl->_obj.reference_count++;
}
static void
-_unknown_Release (struct gl2_unknown_intf **intf)
+_unknown_Release(struct gl2_unknown_intf **intf)
{
- struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
+ struct gl2_unknown_impl *impl = (struct gl2_unknown_impl *) intf;
- impl->_obj.reference_count--;
- if (impl->_obj.reference_count == 0)
- {
- impl->_obj._destructor (intf);
- _mesa_free ((void *) intf);
- }
+ impl->_obj.reference_count--;
+ if (impl->_obj.reference_count == 0) {
+ impl->_obj._destructor(intf);
+ _mesa_free((void *) intf);
+ }
}
static struct gl2_unknown_intf **
-_unknown_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_unknown_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_UNKNOWN)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return NULL;
+ if (uiid == UIID_UNKNOWN) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return NULL;
}
static struct gl2_unknown_intf _unknown_vftbl = {
- _unknown_AddRef,
- _unknown_Release,
- _unknown_QueryInterface
+ _unknown_AddRef,
+ _unknown_Release,
+ _unknown_QueryInterface
};
static void
-_unknown_constructor (struct gl2_unknown_impl *impl)
+_unknown_constructor(struct gl2_unknown_impl *impl)
{
- impl->_vftbl = &_unknown_vftbl;
- impl->_obj.reference_count = 1;
- impl->_obj._destructor = _unknown_destructor;
+ impl->_vftbl = &_unknown_vftbl;
+ impl->_obj.reference_count = 1;
+ impl->_obj._destructor = _unknown_destructor;
}
struct gl2_unkinner_obj
{
- struct gl2_unknown_intf **unkouter;
+ struct gl2_unknown_intf **unkouter;
};
struct gl2_unkinner_impl
{
- struct gl2_unknown_intf *_vftbl;
- struct gl2_unkinner_obj _obj;
+ struct gl2_unknown_intf *_vftbl;
+ struct gl2_unkinner_obj _obj;
};
static void
-_unkinner_destructor (struct gl2_unknown_intf **intf)
+_unkinner_destructor(struct gl2_unknown_intf **intf)
{
}
static void
-_unkinner_AddRef (struct gl2_unknown_intf **intf)
+_unkinner_AddRef(struct gl2_unknown_intf **intf)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- (**impl->_obj.unkouter).AddRef (impl->_obj.unkouter);
+ (**impl->_obj.unkouter).AddRef(impl->_obj.unkouter);
}
static void
-_unkinner_Release (struct gl2_unknown_intf **intf)
+_unkinner_Release(struct gl2_unknown_intf **intf)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- (**impl->_obj.unkouter).Release (impl->_obj.unkouter);
+ (**impl->_obj.unkouter).Release(impl->_obj.unkouter);
}
static struct gl2_unknown_intf **
-_unkinner_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_unkinner_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
+ struct gl2_unkinner_impl *impl = (struct gl2_unkinner_impl *) intf;
- return (**impl->_obj.unkouter).QueryInterface (impl->_obj.unkouter, uiid);
+ return (**impl->_obj.unkouter).QueryInterface(impl->_obj.unkouter, uiid);
}
static struct gl2_unknown_intf _unkinner_vftbl = {
- _unkinner_AddRef,
- _unkinner_Release,
- _unkinner_QueryInterface
+ _unkinner_AddRef,
+ _unkinner_Release,
+ _unkinner_QueryInterface
};
static void
-_unkinner_constructor (struct gl2_unkinner_impl *impl, struct gl2_unknown_intf **outer)
+_unkinner_constructor(struct gl2_unkinner_impl *impl,
+ struct gl2_unknown_intf **outer)
{
- impl->_vftbl = &_unkinner_vftbl;
- impl->_obj.unkouter = outer;
+ impl->_vftbl = &_unkinner_vftbl;
+ impl->_obj.unkouter = outer;
}
struct gl2_generic_obj
{
- struct gl2_unknown_obj _unknown;
- GLhandleARB name;
- GLboolean delete_status;
- GLcharARB *info_log;
+ struct gl2_unknown_obj _unknown;
+ GLhandleARB name;
+ GLboolean delete_status;
+ GLcharARB *info_log;
};
struct gl2_generic_impl
{
- struct gl2_generic_intf *_vftbl;
- struct gl2_generic_obj _obj;
+ struct gl2_generic_intf *_vftbl;
+ struct gl2_generic_obj _obj;
};
static void
-_generic_destructor (struct gl2_unknown_intf **intf)
+_generic_destructor(struct gl2_unknown_intf **intf)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- _mesa_free ((void *) impl->_obj.info_log);
+ _mesa_free((void *) impl->_obj.info_log);
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- _mesa_HashRemove (ctx->Shared->GL2Objects, impl->_obj.name);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashRemove(ctx->Shared->GL2Objects, impl->_obj.name);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- _unknown_destructor (intf);
+ _unknown_destructor(intf);
}
static struct gl2_unknown_intf **
-_generic_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_generic_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_GENERIC)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _unknown_QueryInterface (intf, uiid);
+ if (uiid == UIID_GENERIC) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _unknown_QueryInterface(intf, uiid);
}
static void
-_generic_Delete (struct gl2_generic_intf **intf)
+_generic_Delete(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- if (impl->_obj.delete_status == GL_FALSE)
- {
- impl->_obj.delete_status = GL_TRUE;
- (**intf)._unknown.Release ((struct gl2_unknown_intf **) intf);
- }
+ if (impl->_obj.delete_status == GL_FALSE) {
+ impl->_obj.delete_status = GL_TRUE;
+ (**intf)._unknown.Release((struct gl2_unknown_intf **) intf);
+ }
}
static GLhandleARB
-_generic_GetName (struct gl2_generic_intf **intf)
+_generic_GetName(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- return impl->_obj.name;
+ return impl->_obj.name;
}
static GLboolean
-_generic_GetDeleteStatus (struct gl2_generic_intf **intf)
+_generic_GetDeleteStatus(struct gl2_generic_intf **intf)
{
- struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
+ struct gl2_generic_impl *impl = (struct gl2_generic_impl *) intf;
- return impl->_obj.delete_status;
+ return impl->_obj.delete_status;
}
static GLvoid
-_generic_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog)
+_generic_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen,
+ GLcharARB * infolog)
{
struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf);
if (maxlen > 0) {
- _mesa_strncpy (infolog, impl->_obj.info_log, maxlen - 1);
+ _mesa_strncpy(infolog, impl->_obj.info_log, maxlen - 1);
infolog[maxlen - 1] = '\0';
}
}
static GLsizei
-_generic_GetInfoLogLength (struct gl2_generic_intf **intf)
+_generic_GetInfoLogLength(struct gl2_generic_intf **intf)
{
struct gl2_generic_impl *impl = (struct gl2_generic_impl *) (intf);
if (impl->_obj.info_log == NULL)
return 1;
- return _mesa_strlen (impl->_obj.info_log) + 1;
+ return _mesa_strlen(impl->_obj.info_log) + 1;
}
static struct gl2_generic_intf _generic_vftbl = {
{
- _unknown_AddRef,
- _unknown_Release,
- _generic_QueryInterface
- },
+ _unknown_AddRef,
+ _unknown_Release,
+ _generic_QueryInterface},
_generic_Delete,
- NULL, /* abstract GetType */
+ NULL, /* abstract GetType */
_generic_GetName,
_generic_GetDeleteStatus,
_generic_GetInfoLog,
@@ -266,922 +263,950 @@ static struct gl2_generic_intf _generic_vftbl = {
};
static void
-_generic_constructor (struct gl2_generic_impl *impl)
+_generic_constructor(struct gl2_generic_impl *impl)
{
- GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
- _unknown_constructor ((struct gl2_unknown_impl *) impl);
- impl->_vftbl = &_generic_vftbl;
- impl->_obj._unknown._destructor = _generic_destructor;
- impl->_obj.delete_status = GL_FALSE;
- impl->_obj.info_log = NULL;
+ _unknown_constructor((struct gl2_unknown_impl *) impl);
+ impl->_vftbl = &_generic_vftbl;
+ impl->_obj._unknown._destructor = _generic_destructor;
+ impl->_obj.delete_status = GL_FALSE;
+ impl->_obj.info_log = NULL;
- _glthread_LOCK_MUTEX (ctx->Shared->Mutex);
- impl->_obj.name = _mesa_HashFindFreeKeyBlock (ctx->Shared->GL2Objects, 1);
- _mesa_HashInsert (ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl);
- _glthread_UNLOCK_MUTEX (ctx->Shared->Mutex);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ impl->_obj.name = _mesa_HashFindFreeKeyBlock(ctx->Shared->GL2Objects, 1);
+ _mesa_HashInsert(ctx->Shared->GL2Objects, impl->_obj.name, (void *) impl);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
}
struct gl2_container_obj
{
- struct gl2_generic_obj _generic;
- struct gl2_generic_intf ***attached;
- GLuint attached_count;
+ struct gl2_generic_obj _generic;
+ struct gl2_generic_intf ***attached;
+ GLuint attached_count;
};
struct gl2_container_impl
{
- struct gl2_container_intf *_vftbl;
- struct gl2_container_obj _obj;
+ struct gl2_container_intf *_vftbl;
+ struct gl2_container_obj _obj;
};
static void
-_container_destructor (struct gl2_unknown_intf **intf)
+_container_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i;
- for (i = 0; i < impl->_obj.attached_count; i++)
- {
- struct gl2_generic_intf **x = impl->_obj.attached[i];
- (**x)._unknown.Release ((struct gl2_unknown_intf **) x);
- }
+ for (i = 0; i < impl->_obj.attached_count; i++) {
+ struct gl2_generic_intf **x = impl->_obj.attached[i];
+ (**x)._unknown.Release((struct gl2_unknown_intf **) x);
+ }
- _generic_destructor (intf);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_container_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_container_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_CONTAINER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _generic_QueryInterface (intf, uiid);
+ if (uiid == UIID_CONTAINER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _generic_QueryInterface(intf, uiid);
}
static GLboolean
-_container_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
+_container_Attach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i;
- for (i = 0; i < impl->_obj.attached_count; i++)
- if (impl->_obj.attached[i] == att)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Attach");
- return GL_FALSE;
- }
+ for (i = 0; i < impl->_obj.attached_count; i++)
+ if (impl->_obj.attached[i] == att) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Attach");
+ return GL_FALSE;
+ }
- impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached,
- impl->_obj.attached_count * sizeof (*impl->_obj.attached), (impl->_obj.attached_count + 1) *
- sizeof (*impl->_obj.attached));
- if (impl->_obj.attached == NULL)
- return GL_FALSE;
+ impl->_obj.attached = (struct gl2_generic_intf ***)
+ _mesa_realloc(impl->_obj.attached,
+ impl->_obj.attached_count * sizeof(*impl->_obj.attached),
+ (impl->_obj.attached_count + 1) * sizeof(*impl->_obj.attached));
+ if (impl->_obj.attached == NULL)
+ return GL_FALSE;
- impl->_obj.attached[impl->_obj.attached_count] = att;
- impl->_obj.attached_count++;
- (**att)._unknown.AddRef ((struct gl2_unknown_intf **) att);
- return GL_TRUE;
+ impl->_obj.attached[impl->_obj.attached_count] = att;
+ impl->_obj.attached_count++;
+ (**att)._unknown.AddRef((struct gl2_unknown_intf **) att);
+ return GL_TRUE;
}
static GLboolean
-_container_Detach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- GLuint i, j;
-
- for (i = 0; i < impl->_obj.attached_count; i++)
- if (impl->_obj.attached[i] == att)
- {
- for (j = i; j < impl->_obj.attached_count - 1; j++)
- impl->_obj.attached[j] = impl->_obj.attached[j + 1];
- impl->_obj.attached = (struct gl2_generic_intf ***) _mesa_realloc (impl->_obj.attached,
- impl->_obj.attached_count * sizeof (*impl->_obj.attached),
- (impl->_obj.attached_count - 1) * sizeof (*impl->_obj.attached));
- impl->_obj.attached_count--;
- (**att)._unknown.Release ((struct gl2_unknown_intf **) att);
- return GL_TRUE;
- }
+_container_Detach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ GLuint i, j;
+
+ for (i = 0; i < impl->_obj.attached_count; i++)
+ if (impl->_obj.attached[i] == att) {
+ for (j = i; j < impl->_obj.attached_count - 1; j++)
+ impl->_obj.attached[j] = impl->_obj.attached[j + 1];
+ impl->_obj.attached = (struct gl2_generic_intf ***)
+ _mesa_realloc(impl->_obj.attached,
+ impl->_obj.attached_count * sizeof(*impl->_obj.attached),
+ (impl->_obj.attached_count - 1) * sizeof(*impl->_obj.attached));
+ impl->_obj.attached_count--;
+ (**att)._unknown.Release((struct gl2_unknown_intf **) att);
+ return GL_TRUE;
+ }
- _mesa_error (ctx, GL_INVALID_OPERATION, "_container_Detach");
- return GL_FALSE;
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_container_Detach");
+ return GL_FALSE;
}
static GLsizei
-_container_GetAttachedCount (struct gl2_container_intf **intf)
+_container_GetAttachedCount(struct gl2_container_intf **intf)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- return impl->_obj.attached_count;
+ return impl->_obj.attached_count;
}
static struct gl2_generic_intf **
-_container_GetAttached (struct gl2_container_intf **intf, GLuint index)
+_container_GetAttached(struct gl2_container_intf **intf, GLuint index)
{
- struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
+ struct gl2_container_impl *impl = (struct gl2_container_impl *) intf;
- (**impl->_obj.attached[index])._unknown.AddRef (
- (struct gl2_unknown_intf **)impl->_obj.attached[index]);
- return impl->_obj.attached[index];
+ (**impl->_obj.attached[index])._unknown.AddRef((struct gl2_unknown_intf **)
+ impl->_obj.attached[index]);
+ return impl->_obj.attached[index];
}
static struct gl2_container_intf _container_vftbl = {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _container_QueryInterface
- },
- _generic_Delete,
- NULL, /* abstract GetType */
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _container_QueryInterface
+ },
+ _generic_Delete,
+ NULL, /* abstract GetType */
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_generic_GetInfoLog,
_generic_GetInfoLogLength
- },
- _container_Attach,
- _container_Detach,
- _container_GetAttachedCount,
- _container_GetAttached
+ },
+ _container_Attach,
+ _container_Detach,
+ _container_GetAttachedCount,
+ _container_GetAttached
};
static void
-_container_constructor (struct gl2_container_impl *impl)
+_container_constructor(struct gl2_container_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) impl);
- impl->_vftbl = &_container_vftbl;
- impl->_obj._generic._unknown._destructor = _container_destructor;
- impl->_obj.attached = NULL;
- impl->_obj.attached_count = 0;
+ _generic_constructor((struct gl2_generic_impl *) impl);
+ impl->_vftbl = &_container_vftbl;
+ impl->_obj._generic._unknown._destructor = _container_destructor;
+ impl->_obj.attached = NULL;
+ impl->_obj.attached_count = 0;
}
struct gl2_3dlabs_shhandle_obj
{
- struct gl2_unkinner_obj _unknown;
+ struct gl2_unkinner_obj _unknown;
#if USE_3DLABS_FRONTEND
- ShHandle handle;
+ ShHandle handle;
#endif
};
struct gl2_3dlabs_shhandle_impl
{
- struct gl2_3dlabs_shhandle_intf *_vftbl;
- struct gl2_3dlabs_shhandle_obj _obj;
+ struct gl2_3dlabs_shhandle_intf *_vftbl;
+ struct gl2_3dlabs_shhandle_obj _obj;
};
static void
-_3dlabs_shhandle_destructor (struct gl2_unknown_intf **intf)
+_3dlabs_shhandle_destructor(struct gl2_unknown_intf **intf)
{
#if USE_3DLABS_FRONTEND
- struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf;
- ShDestruct (impl->_obj.handle);
+ struct gl2_3dlabs_shhandle_impl *impl =
+ (struct gl2_3dlabs_shhandle_impl *) intf;
+ ShDestruct(impl->_obj.handle);
#endif
- _unkinner_destructor (intf);
+ _unkinner_destructor(intf);
}
static GLvoid *
-_3dlabs_shhandle_GetShHandle (struct gl2_3dlabs_shhandle_intf **intf)
+_3dlabs_shhandle_GetShHandle(struct gl2_3dlabs_shhandle_intf **intf)
{
#if USE_3DLABS_FRONTEND
- struct gl2_3dlabs_shhandle_impl *impl = (struct gl2_3dlabs_shhandle_impl *) intf;
- return impl->_obj.handle;
+ struct gl2_3dlabs_shhandle_impl *impl =
+ (struct gl2_3dlabs_shhandle_impl *) intf;
+ return impl->_obj.handle;
#else
- return NULL;
+ return NULL;
#endif
}
static struct gl2_3dlabs_shhandle_intf _3dlabs_shhandle_vftbl = {
- {
- _unkinner_AddRef,
- _unkinner_Release,
- _unkinner_QueryInterface
- },
- _3dlabs_shhandle_GetShHandle
+ {
+ _unkinner_AddRef,
+ _unkinner_Release,
+ _unkinner_QueryInterface},
+ _3dlabs_shhandle_GetShHandle
};
static void
-_3dlabs_shhandle_constructor (struct gl2_3dlabs_shhandle_impl *impl, struct gl2_unknown_intf **outer)
+_3dlabs_shhandle_constructor(struct gl2_3dlabs_shhandle_impl *impl,
+ struct gl2_unknown_intf **outer)
{
- _unkinner_constructor ((struct gl2_unkinner_impl *) impl, outer);
- impl->_vftbl = &_3dlabs_shhandle_vftbl;
+ _unkinner_constructor((struct gl2_unkinner_impl *) impl, outer);
+ impl->_vftbl = &_3dlabs_shhandle_vftbl;
#if USE_3DLABS_FRONTEND
- impl->_obj.handle = NULL;
+ impl->_obj.handle = NULL;
#endif
}
struct gl2_shader_obj
{
- struct gl2_generic_obj _generic;
- struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle;
- GLboolean compile_status;
- GLcharARB *source;
- GLint *offsets;
- GLsizei offset_count;
+ struct gl2_generic_obj _generic;
+ struct gl2_3dlabs_shhandle_impl _3dlabs_shhandle;
+ GLboolean compile_status;
+ GLcharARB *source;
+ GLint *offsets;
+ GLsizei offset_count;
slang_code_object code;
};
struct gl2_shader_impl
{
- struct gl2_shader_intf *_vftbl;
- struct gl2_shader_obj _obj;
+ struct gl2_shader_intf *_vftbl;
+ struct gl2_shader_obj _obj;
};
static void
-_shader_destructor (struct gl2_unknown_intf **intf)
+_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- _mesa_free ((void *) impl->_obj.source);
- _mesa_free ((void *) impl->_obj.offsets);
- _slang_code_object_dtr (&impl->_obj.code);
- _3dlabs_shhandle_destructor ((struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl);
- _generic_destructor (intf);
+ _mesa_free((void *) impl->_obj.source);
+ _mesa_free((void *) impl->_obj.offsets);
+ _slang_code_object_dtr(&impl->_obj.code);
+ _3dlabs_shhandle_destructor((struct gl2_unknown_intf **) &impl->_obj.
+ _3dlabs_shhandle._vftbl);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_shader_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
#if USE_3DLABS_FRONTEND
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
#endif
- if (uiid == UIID_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
+ if (uiid == UIID_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
#if USE_3DLABS_FRONTEND
- if (uiid == UIID_3DLABS_SHHANDLE)
- {
- (**intf).AddRef (intf);
- return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl;
- }
+ if (uiid == UIID_3DLABS_SHHANDLE) {
+ (**intf).AddRef(intf);
+ return (struct gl2_unknown_intf **) &impl->_obj._3dlabs_shhandle._vftbl;
+ }
#endif
- return _generic_QueryInterface (intf, uiid);
+ return _generic_QueryInterface(intf, uiid);
}
static GLenum
-_shader_GetType (struct gl2_generic_intf **intf)
+_shader_GetType(struct gl2_generic_intf **intf)
{
- return GL_SHADER_OBJECT_ARB;
+ return GL_SHADER_OBJECT_ARB;
}
static GLvoid
-_shader_GetInfoLog (struct gl2_generic_intf **intf, GLsizei maxlen, GLcharARB *infolog)
+_shader_GetInfoLog(struct gl2_generic_intf **intf, GLsizei maxlen,
+ GLcharARB * infolog)
{
struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf);
if (maxlen > 0) {
if (impl->_obj._generic.info_log != NULL) {
- GLsizei len = _mesa_strlen (impl->_obj._generic.info_log);
+ GLsizei len = _mesa_strlen(impl->_obj._generic.info_log);
if (len > maxlen - 1)
len = maxlen - 1;
- _mesa_memcpy (infolog, impl->_obj._generic.info_log, len);
+ _mesa_memcpy(infolog, impl->_obj._generic.info_log, len);
infolog += len;
maxlen -= len;
}
if (impl->_obj.code.machine.infolog != NULL &&
impl->_obj.code.machine.infolog->text != NULL) {
- GLsizei len = _mesa_strlen (impl->_obj.code.machine.infolog->text);
+ GLsizei len = _mesa_strlen(impl->_obj.code.machine.infolog->text);
if (len > maxlen - 1)
len = maxlen - 1;
- _mesa_memcpy (infolog, impl->_obj.code.machine.infolog->text, len);
+ _mesa_memcpy(infolog, impl->_obj.code.machine.infolog->text, len);
}
infolog[maxlen - 1] = '\0';
}
}
static GLsizei
-_shader_GetInfoLogLength (struct gl2_generic_intf **intf)
+_shader_GetInfoLogLength(struct gl2_generic_intf **intf)
{
struct gl2_shader_impl *impl = (struct gl2_shader_impl *) (intf);
GLsizei length = 1;
if (impl->_obj._generic.info_log != NULL)
- length += _mesa_strlen (impl->_obj._generic.info_log);
+ length += _mesa_strlen(impl->_obj._generic.info_log);
if (impl->_obj.code.machine.infolog != NULL &&
impl->_obj.code.machine.infolog->text != NULL)
- length += _mesa_strlen (impl->_obj.code.machine.infolog->text);
+ length += _mesa_strlen(impl->_obj.code.machine.infolog->text);
return length;
}
static GLboolean
-_shader_GetCompileStatus (struct gl2_shader_intf **intf)
+_shader_GetCompileStatus(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- return impl->_obj.compile_status;
+ return impl->_obj.compile_status;
}
static GLvoid
-_shader_SetSource (struct gl2_shader_intf **intf, GLcharARB *src, GLint *off, GLsizei cnt)
+_shader_SetSource(struct gl2_shader_intf **intf, GLcharARB * src, GLint * off,
+ GLsizei cnt)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- _mesa_free ((void *) impl->_obj.source);
- impl->_obj.source = src;
- _mesa_free ((void *) impl->_obj.offsets);
- impl->_obj.offsets = off;
- impl->_obj.offset_count = cnt;
+ _mesa_free((void *) impl->_obj.source);
+ impl->_obj.source = src;
+ _mesa_free((void *) impl->_obj.offsets);
+ impl->_obj.offsets = off;
+ impl->_obj.offset_count = cnt;
}
static const GLcharARB *
-_shader_GetSource (struct gl2_shader_intf **intf)
+_shader_GetSource(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
- return impl->_obj.source;
+ return impl->_obj.source;
}
static GLvoid
-_shader_Compile (struct gl2_shader_intf **intf)
+_shader_Compile(struct gl2_shader_intf **intf)
{
- struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
+ struct gl2_shader_impl *impl = (struct gl2_shader_impl *) intf;
#if USE_3DLABS_FRONTEND
- char **strings;
- TBuiltInResource res;
+ char **strings;
+ TBuiltInResource res;
#else
- slang_unit_type type;
- slang_info_log info_log;
+ slang_unit_type type;
+ slang_info_log info_log;
#endif
- impl->_obj.compile_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._generic.info_log);
- impl->_obj._generic.info_log = NULL;
+ impl->_obj.compile_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._generic.info_log);
+ impl->_obj._generic.info_log = NULL;
#if USE_3DLABS_FRONTEND
- /* 3dlabs compiler expects us to feed it with null-terminated string array,
- we've got only one big string with offsets, so we must split it; but when
- there's only one string to deal with, we pass its address directly */
-
- if (impl->_obj.offset_count <= 1)
- strings = &impl->_obj.source;
- else
- {
- GLsizei i, offset = 0;
-
- strings = (char **) _mesa_malloc (impl->_obj.offset_count * sizeof (char *));
- if (strings == NULL)
- return;
-
- for (i = 0; i < impl->_obj.offset_count; i++)
- {
- GLsizei size = impl->_obj.offsets[i] - offset;
-
- strings[i] = (char *) _mesa_malloc ((size + 1) * sizeof (char));
- if (strings[i] == NULL)
- {
- GLsizei j;
-
- for (j = 0; j < i; j++)
- _mesa_free (strings[j]);
- _mesa_free (strings);
- return;
- }
-
- _mesa_memcpy (strings[i], impl->_obj.source + offset, size * sizeof (char));
- strings[i][size] = '\0';
- offset = impl->_obj.offsets[i];
- }
- }
-
- /* TODO set these fields to some REAL numbers */
- res.maxLights = 8;
- res.maxClipPlanes = 6;
- res.maxTextureUnits = 2;
- res.maxTextureCoords = 2;
- res.maxVertexAttribs = 8;
- res.maxVertexUniformComponents = 64;
- res.maxVaryingFloats = 8;
- res.maxVertexTextureImageUnits = 2;
- res.maxCombinedTextureImageUnits = 2;
- res.maxTextureImageUnits = 2;
- res.maxFragmentUniformComponents = 64;
- res.maxDrawBuffers = 1;
-
- if (ShCompile (impl->_obj._3dlabs_shhandle._obj.handle, strings, impl->_obj.offset_count,
- EShOptFull, &res, 0))
- impl->_obj.compile_status = GL_TRUE;
- if (impl->_obj.offset_count > 1)
- {
- GLsizei i;
-
- for (i = 0; i < impl->_obj.offset_count; i++)
- _mesa_free (strings[i]);
- _mesa_free (strings);
- }
-
- impl->_obj._generic.info_log = _mesa_strdup (ShGetInfoLog (
- impl->_obj._3dlabs_shhandle._obj.handle));
+ /* 3dlabs compiler expects us to feed it with null-terminated string array,
+ we've got only one big string with offsets, so we must split it; but when
+ there's only one string to deal with, we pass its address directly */
+
+ if (impl->_obj.offset_count <= 1)
+ strings = &impl->_obj.source;
+ else {
+ GLsizei i, offset = 0;
+
+ strings =
+ (char **) _mesa_malloc(impl->_obj.offset_count * sizeof(char *));
+ if (strings == NULL)
+ return;
+
+ for (i = 0; i < impl->_obj.offset_count; i++) {
+ GLsizei size = impl->_obj.offsets[i] - offset;
+
+ strings[i] = (char *) _mesa_malloc((size + 1) * sizeof(char));
+ if (strings[i] == NULL) {
+ GLsizei j;
+
+ for (j = 0; j < i; j++)
+ _mesa_free(strings[j]);
+ _mesa_free(strings);
+ return;
+ }
+
+ _mesa_memcpy(strings[i], impl->_obj.source + offset,
+ size * sizeof(char));
+ strings[i][size] = '\0';
+ offset = impl->_obj.offsets[i];
+ }
+ }
+
+ /* TODO set these fields to some REAL numbers */
+ res.maxLights = 8;
+ res.maxClipPlanes = 6;
+ res.maxTextureUnits = 2;
+ res.maxTextureCoords = 2;
+ res.maxVertexAttribs = 8;
+ res.maxVertexUniformComponents = 64;
+ res.maxVaryingFloats = 8;
+ res.maxVertexTextureImageUnits = 2;
+ res.maxCombinedTextureImageUnits = 2;
+ res.maxTextureImageUnits = 2;
+ res.maxFragmentUniformComponents = 64;
+ res.maxDrawBuffers = 1;
+
+ if (ShCompile
+ (impl->_obj._3dlabs_shhandle._obj.handle, strings,
+ impl->_obj.offset_count, EShOptFull, &res, 0))
+ impl->_obj.compile_status = GL_TRUE;
+ if (impl->_obj.offset_count > 1) {
+ GLsizei i;
+
+ for (i = 0; i < impl->_obj.offset_count; i++)
+ _mesa_free(strings[i]);
+ _mesa_free(strings);
+ }
+
+ impl->_obj._generic.info_log =
+ _mesa_strdup(ShGetInfoLog(impl->_obj._3dlabs_shhandle._obj.handle));
#else
- if (impl->_vftbl->GetSubType (intf) == GL_FRAGMENT_SHADER)
- type = slang_unit_fragment_shader;
- else
- type = slang_unit_vertex_shader;
- slang_info_log_construct (&info_log);
- if (_slang_compile (impl->_obj.source, &impl->_obj.code, type, &info_log))
+ if (impl->_vftbl->GetSubType(intf) == GL_FRAGMENT_SHADER)
+ type = slang_unit_fragment_shader;
+ else
+ type = slang_unit_vertex_shader;
+ slang_info_log_construct(&info_log);
+ if (_slang_compile(impl->_obj.source, &impl->_obj.code, type, &info_log))
impl->_obj.compile_status = GL_TRUE;
- if (info_log.text != NULL)
- impl->_obj._generic.info_log = _mesa_strdup (info_log.text);
- else if (impl->_obj.compile_status)
- impl->_obj._generic.info_log = _mesa_strdup ("Compile OK.\n");
+ if (info_log.text != NULL)
+ impl->_obj._generic.info_log = _mesa_strdup(info_log.text);
+ else if (impl->_obj.compile_status)
+ impl->_obj._generic.info_log = _mesa_strdup("Compile OK.\n");
else
- impl->_obj._generic.info_log = _mesa_strdup ("Compile failed.\n");
- slang_info_log_destruct (&info_log);
+ impl->_obj._generic.info_log = _mesa_strdup("Compile failed.\n");
+ slang_info_log_destruct(&info_log);
#endif
}
static struct gl2_shader_intf _shader_vftbl = {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- NULL, /* abstract GetSubType */
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
+ },
+ NULL, /* abstract GetSubType */
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
};
static void
-_shader_constructor (struct gl2_shader_impl *impl)
+_shader_constructor(struct gl2_shader_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) impl);
- _3dlabs_shhandle_constructor (&impl->_obj._3dlabs_shhandle, (struct gl2_unknown_intf **)
- &impl->_vftbl);
- impl->_vftbl = &_shader_vftbl;
- impl->_obj._generic._unknown._destructor = _shader_destructor;
- impl->_obj.compile_status = GL_FALSE;
- impl->_obj.source = NULL;
- impl->_obj.offsets = NULL;
- impl->_obj.offset_count = 0;
- _slang_code_object_ctr (&impl->_obj.code);
+ _generic_constructor((struct gl2_generic_impl *) impl);
+ _3dlabs_shhandle_constructor(&impl->_obj._3dlabs_shhandle,
+ (struct gl2_unknown_intf **)
+ &impl->_vftbl);
+ impl->_vftbl = &_shader_vftbl;
+ impl->_obj._generic._unknown._destructor = _shader_destructor;
+ impl->_obj.compile_status = GL_FALSE;
+ impl->_obj.source = NULL;
+ impl->_obj.offsets = NULL;
+ impl->_obj.offset_count = 0;
+ _slang_code_object_ctr(&impl->_obj.code);
}
struct gl2_program_obj
{
- struct gl2_container_obj _container;
- GLboolean link_status;
- GLboolean validate_status;
+ struct gl2_container_obj _container;
+ GLboolean link_status;
+ GLboolean validate_status;
#if USE_3DLABS_FRONTEND
- ShHandle linker;
- ShHandle uniforms;
+ ShHandle linker;
+ ShHandle uniforms;
#endif
- slang_program prog;
+ slang_program prog;
};
struct gl2_program_impl
{
- struct gl2_program_intf *_vftbl;
- struct gl2_program_obj _obj;
+ struct gl2_program_intf *_vftbl;
+ struct gl2_program_obj _obj;
};
static void
-_program_destructor (struct gl2_unknown_intf **intf)
+_program_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
#if USE_3DLABS_FRONTEND
- ShDestruct (impl->_obj.linker);
- ShDestruct (impl->_obj.uniforms);
+ ShDestruct(impl->_obj.linker);
+ ShDestruct(impl->_obj.uniforms);
#endif
- _container_destructor (intf);
- _slang_program_dtr (&impl->_obj.prog);
+ _container_destructor(intf);
+ _slang_program_dtr(&impl->_obj.prog);
}
static struct gl2_unknown_intf **
-_program_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_program_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
- if (uiid == UIID_PROGRAM)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _container_QueryInterface (intf, uiid);
+ if (uiid == UIID_PROGRAM) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _container_QueryInterface(intf, uiid);
}
static GLenum
-_program_GetType (struct gl2_generic_intf **intf)
+_program_GetType(struct gl2_generic_intf **intf)
{
- return GL_PROGRAM_OBJECT_ARB;
+ return GL_PROGRAM_OBJECT_ARB;
}
static GLboolean
-_program_Attach (struct gl2_container_intf **intf, struct gl2_generic_intf **att)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_unknown_intf **sha;
-
- sha = (**att)._unknown.QueryInterface ((struct gl2_unknown_intf **) att, UIID_SHADER);
- if (sha == NULL)
- {
- _mesa_error (ctx, GL_INVALID_OPERATION, "_program_Attach");
- return GL_FALSE;
- }
+_program_Attach(struct gl2_container_intf **intf,
+ struct gl2_generic_intf **att)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_unknown_intf **sha;
+
+ sha =
+ (**att)._unknown.QueryInterface((struct gl2_unknown_intf **) att,
+ UIID_SHADER);
+ if (sha == NULL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "_program_Attach");
+ return GL_FALSE;
+ }
- (**sha).Release (sha);
- return _container_Attach (intf, att);
+ (**sha).Release(sha);
+ return _container_Attach(intf, att);
}
static GLboolean
-_program_GetLinkStatus (struct gl2_program_intf **intf)
+_program_GetLinkStatus(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- return impl->_obj.link_status;
+ return impl->_obj.link_status;
}
static GLboolean
-_program_GetValidateStatus (struct gl2_program_intf **intf)
+_program_GetValidateStatus(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- return impl->_obj.validate_status;
+ return impl->_obj.validate_status;
}
static GLvoid
-_program_Link (struct gl2_program_intf **intf)
+_program_Link(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
#if USE_3DLABS_FRONTEND
- ShHandle *handles;
+ ShHandle *handles;
#endif
- GLuint i, count;
+ GLuint i, count;
slang_code_object *code[2];
GLboolean all_compiled = GL_TRUE;
- impl->_obj.link_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._container._generic.info_log);
- impl->_obj._container._generic.info_log = NULL;
- _slang_program_rst (&impl->_obj.prog);
+ impl->_obj.link_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._container._generic.info_log);
+ impl->_obj._container._generic.info_log = NULL;
+ _slang_program_rst(&impl->_obj.prog);
#if USE_3DLABS_FRONTEND
- handles = (ShHandle *) _mesa_malloc (impl->_obj._container.attached_count * sizeof (ShHandle));
- if (handles == NULL)
- return;
-
- for (i = 0; i < impl->_obj._container.attached_count; i++)
- {
- struct gl2_generic_intf **gen = impl->_obj._container.attached[i];
- struct gl2_3dlabs_shhandle_intf **sh;
-
- sh = (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown.QueryInterface (
- (struct gl2_unknown_intf **) gen, UIID_3DLABS_SHHANDLE);
- if (sh != NULL)
- {
- handles[i] = (**sh).GetShHandle (sh);
- (**sh)._unknown.Release ((struct gl2_unknown_intf **) sh);
- }
- else
- {
- _mesa_free (handles);
- return;
- }
- }
-
- if (ShLink (impl->_obj.linker, handles, impl->_obj._container.attached_count,
- impl->_obj.uniforms, NULL, NULL))
- impl->_obj.link_status = GL_TRUE;
-
- impl->_obj._container._generic.info_log = _mesa_strdup (ShGetInfoLog (impl->_obj.linker));
+ handles =
+ (ShHandle *) _mesa_malloc(impl->_obj._container.attached_count *
+ sizeof(ShHandle));
+ if (handles == NULL)
+ return;
+
+ for (i = 0; i < impl->_obj._container.attached_count; i++) {
+ struct gl2_generic_intf **gen = impl->_obj._container.attached[i];
+ struct gl2_3dlabs_shhandle_intf **sh;
+
+ sh =
+ (struct gl2_3dlabs_shhandle_intf **) (**gen)._unknown.
+ QueryInterface((struct gl2_unknown_intf **) gen,
+ UIID_3DLABS_SHHANDLE);
+ if (sh != NULL) {
+ handles[i] = (**sh).GetShHandle(sh);
+ (**sh)._unknown.Release((struct gl2_unknown_intf **) sh);
+ }
+ else {
+ _mesa_free(handles);
+ return;
+ }
+ }
+
+ if (ShLink(impl->_obj.linker, handles, impl->_obj._container.attached_count,
+ impl->_obj.uniforms, NULL, NULL))
+ impl->_obj.link_status = GL_TRUE;
+
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup(ShGetInfoLog(impl->_obj.linker));
#else
count = impl->_obj._container.attached_count;
if (count > 2)
return;
- for (i = 0; i < count; i++)
- {
- struct gl2_generic_intf **obj;
- struct gl2_unknown_intf **unk;
- struct gl2_shader_impl *sha;
-
- obj = impl->_obj._container.attached[i];
- unk = (**obj)._unknown.QueryInterface ((struct gl2_unknown_intf **) obj, UIID_SHADER);
- if (unk == NULL)
- return;
- sha = (struct gl2_shader_impl *) unk;
+
+ for (i = 0; i < count; i++) {
+ struct gl2_generic_intf **obj;
+ struct gl2_unknown_intf **unk;
+ struct gl2_shader_impl *sha;
+
+ obj = impl->_obj._container.attached[i];
+ unk =
+ (**obj)._unknown.QueryInterface((struct gl2_unknown_intf **) obj,
+ UIID_SHADER);
+ if (unk == NULL)
+ return;
+ sha = (struct gl2_shader_impl *) unk;
code[i] = &sha->_obj.code;
all_compiled = all_compiled && sha->_obj.compile_status;
- (**unk).Release (unk);
+ (**unk).Release(unk);
}
impl->_obj.link_status = all_compiled;
- if (!impl->_obj.link_status)
- {
- impl->_obj._container._generic.info_log = _mesa_strdup (
- "Error: One or more shaders has not successfully compiled.\n");
+ if (!impl->_obj.link_status) {
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup
+ ("Error: One or more shaders has not successfully compiled.\n");
return;
}
- impl->_obj.link_status = _slang_link (&impl->_obj.prog, code, count);
- if (!impl->_obj.link_status)
- {
- impl->_obj._container._generic.info_log = _mesa_strdup ("Link failed.\n");
+ impl->_obj.link_status = _slang_link(&impl->_obj.prog, code, count);
+ if (!impl->_obj.link_status) {
+ impl->_obj._container._generic.info_log =
+ _mesa_strdup("Link failed.\n");
return;
}
- impl->_obj._container._generic.info_log = _mesa_strdup ("Link OK.\n");
+ impl->_obj._container._generic.info_log = _mesa_strdup("Link OK.\n");
#endif
}
static GLvoid
-_program_Validate (struct gl2_program_intf **intf)
+_program_Validate(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- impl->_obj.validate_status = GL_FALSE;
- _mesa_free ((void *) impl->_obj._container._generic.info_log);
- impl->_obj._container._generic.info_log = NULL;
+ impl->_obj.validate_status = GL_FALSE;
+ _mesa_free((void *) impl->_obj._container._generic.info_log);
+ impl->_obj._container._generic.info_log = NULL;
- /* TODO validate */
+ /* TODO validate */
}
static GLvoid
-write_common_fixed (slang_program *pro, GLuint index, const GLvoid *src, GLuint off, GLuint size)
+write_common_fixed(slang_program * pro, GLuint index, const GLvoid * src,
+ GLuint off, GLuint size)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- {
- GLuint addr;
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ GLuint addr;
- addr = pro->common_fixed_entries[i][index];
- if (addr != ~0)
- {
- GLubyte *dst;
+ addr = pro->common_fixed_entries[i][index];
+ if (addr != ~0) {
+ GLubyte *dst;
- dst = (GLubyte *) pro->machines[i]->mem + addr + off * size;
- _mesa_memcpy (dst, src, size);
- }
- }
+ dst = (GLubyte *) pro->machines[i]->mem + addr + off * size;
+ _mesa_memcpy(dst, src, size);
+ }
+ }
}
static GLvoid
-write_common_fixed_mat4 (slang_program *pro, GLmatrix *matrix, GLuint off, GLuint i, GLuint ii,
- GLuint it, GLuint iit)
+write_common_fixed_mat4(slang_program * pro, GLmatrix * matrix, GLuint off,
+ GLuint i, GLuint ii, GLuint it, GLuint iit)
{
- GLfloat mat[16];
+ GLfloat mat[16];
- /* we want inverse matrix */
- if (!matrix->inv)
- {
- /* allocate inverse matrix and make it dirty */
- _math_matrix_alloc_inv (matrix);
- _math_matrix_loadf (matrix, matrix->m);
- }
- _math_matrix_analyse (matrix);
+ /* we want inverse matrix */
+ if (!matrix->inv) {
+ /* allocate inverse matrix and make it dirty */
+ _math_matrix_alloc_inv(matrix);
+ _math_matrix_loadf(matrix, matrix->m);
+ }
+ _math_matrix_analyse(matrix);
- write_common_fixed (pro, i, matrix->m, off, 16 * sizeof (GLfloat));
+ write_common_fixed(pro, i, matrix->m, off, 16 * sizeof(GLfloat));
- /* inverse */
- write_common_fixed (pro, ii, matrix->inv, off, 16 * sizeof (GLfloat));
+ /* inverse */
+ write_common_fixed(pro, ii, matrix->inv, off, 16 * sizeof(GLfloat));
- /* transpose */
- _math_transposef (mat, matrix->m);
- write_common_fixed (pro, it, mat, off, 16 * sizeof (GLfloat));
+ /* transpose */
+ _math_transposef(mat, matrix->m);
+ write_common_fixed(pro, it, mat, off, 16 * sizeof(GLfloat));
- /* inverse transpose */
- _math_transposef (mat, matrix->inv);
- write_common_fixed (pro, iit, mat, off, 16 * sizeof (GLfloat));
+ /* inverse transpose */
+ _math_transposef(mat, matrix->inv);
+ write_common_fixed(pro, iit, mat, off, 16 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_material (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e, GLuint a,
- GLuint d, GLuint sp, GLuint sh)
+write_common_fixed_material(GLcontext * ctx, slang_program * pro, GLuint i,
+ GLuint e, GLuint a, GLuint d, GLuint sp,
+ GLuint sh)
{
- GLfloat v[17];
+ GLfloat v[17];
- COPY_4FV(v, ctx->Light.Material.Attrib[e]);
- COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]);
- COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]);
- COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]);
- v[16] = ctx->Light.Material.Attrib[sh][0];
- write_common_fixed (pro, i, v, 0, 17 * sizeof (GLfloat));
+ COPY_4FV(v, ctx->Light.Material.Attrib[e]);
+ COPY_4FV((v + 4), ctx->Light.Material.Attrib[a]);
+ COPY_4FV((v + 8), ctx->Light.Material.Attrib[d]);
+ COPY_4FV((v + 12), ctx->Light.Material.Attrib[sp]);
+ v[16] = ctx->Light.Material.Attrib[sh][0];
+ write_common_fixed(pro, i, v, 0, 17 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_light_model_product (GLcontext *ctx, slang_program *pro, GLuint i, GLuint e,
- GLuint a)
+write_common_fixed_light_model_product(GLcontext * ctx, slang_program * pro,
+ GLuint i, GLuint e, GLuint a)
{
- GLfloat v[4];
+ GLfloat v[4];
- SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient);
- ACC_4V(v, ctx->Light.Material.Attrib[e]);
- write_common_fixed (pro, i, v, 0, 4 * sizeof (GLfloat));
+ SCALE_4V(v, ctx->Light.Material.Attrib[a], ctx->Light.Model.Ambient);
+ ACC_4V(v, ctx->Light.Material.Attrib[e]);
+ write_common_fixed(pro, i, v, 0, 4 * sizeof(GLfloat));
}
static GLvoid
-write_common_fixed_light_product (GLcontext *ctx, slang_program *pro, GLuint off, GLuint i, GLuint a,
- GLuint d, GLuint s)
+write_common_fixed_light_product(GLcontext * ctx, slang_program * pro,
+ GLuint off, GLuint i, GLuint a, GLuint d,
+ GLuint s)
{
- GLfloat v[12];
+ GLfloat v[12];
- SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]);
- SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse, ctx->Light.Material.Attrib[d]);
- SCALE_4V((v + 8), ctx->Light.Light[off].Specular, ctx->Light.Material.Attrib[s]);
- write_common_fixed (pro, i, v, off, 12 * sizeof (GLfloat));
+ SCALE_4V(v, ctx->Light.Light[off].Ambient, ctx->Light.Material.Attrib[a]);
+ SCALE_4V((v + 4), ctx->Light.Light[off].Diffuse,
+ ctx->Light.Material.Attrib[d]);
+ SCALE_4V((v + 8), ctx->Light.Light[off].Specular,
+ ctx->Light.Material.Attrib[s]);
+ write_common_fixed(pro, i, v, off, 12 * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateFixedUniforms (struct gl2_program_intf **intf)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint i;
- GLfloat v[29];
- GLfloat *p;
-
- /* MODELVIEW matrix */
- write_common_fixed_mat4 (pro, ctx->ModelviewMatrixStack.Top, 0,
- SLANG_COMMON_FIXED_MODELVIEWMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE);
-
- /* PROJECTION matrix */
- write_common_fixed_mat4 (pro, ctx->ProjectionMatrixStack.Top, 0,
- SLANG_COMMON_FIXED_PROJECTIONMATRIX,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE);
-
- /* MVP matrix */
- write_common_fixed_mat4 (pro, &ctx->_ModelProjectMatrix, 0,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE);
-
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
- {
- /* TEXTURE matrix */
- write_common_fixed_mat4 (pro, ctx->TextureMatrixStack[i].Top, i,
- SLANG_COMMON_FIXED_TEXTUREMATRIX,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
- SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE);
-
- /* EYE_PLANE texture-coordinate generation */
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANES, ctx->Texture.Unit[i].EyePlaneS,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANET, ctx->Texture.Unit[i].EyePlaneT,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANER, ctx->Texture.Unit[i].EyePlaneR,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_EYEPLANEQ, ctx->Texture.Unit[i].EyePlaneQ,
- i, 4 * sizeof (GLfloat));
-
- /* OBJECT_PLANE texture-coordinate generation */
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANES, ctx->Texture.Unit[i].ObjectPlaneS,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANET, ctx->Texture.Unit[i].ObjectPlaneT,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANER, ctx->Texture.Unit[i].ObjectPlaneR,
- i, 4 * sizeof (GLfloat));
- write_common_fixed (pro, SLANG_COMMON_FIXED_OBJECTPLANEQ, ctx->Texture.Unit[i].ObjectPlaneQ,
- i, 4 * sizeof (GLfloat));
- }
-
- /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */
- p = ctx->ModelviewMatrixStack.Top->inv;
- v[0] = p[0];
- v[1] = p[4];
- v[2] = p[8];
- v[3] = p[1];
- v[4] = p[5];
- v[5] = p[9];
- v[6] = p[2];
- v[7] = p[6];
- v[8] = p[10];
- write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0, 9 * sizeof (GLfloat));
-
- /* normal scale */
- write_common_fixed (pro, SLANG_COMMON_FIXED_NORMALSCALE, &ctx->_ModelViewInvScale, 0, sizeof (GLfloat));
-
- /* depth range parameters */
- v[0] = ctx->Viewport.Near;
- v[1] = ctx->Viewport.Far;
- v[2] = ctx->Viewport.Far - ctx->Viewport.Near;
- write_common_fixed (pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0, 3 * sizeof (GLfloat));
-
- /* CLIP_PLANEi */
- for (i = 0; i < ctx->Const.MaxClipPlanes; i++)
- {
- write_common_fixed (pro, SLANG_COMMON_FIXED_CLIPPLANE, ctx->Transform.EyeUserPlane[i], i,
- 4 * sizeof (GLfloat));
- }
-
- /* point parameters */
- v[0] = ctx->Point.Size;
- v[1] = ctx->Point.MinSize;
- v[2] = ctx->Point.MaxSize;
- v[3] = ctx->Point.Threshold;
- COPY_3FV((v + 4), ctx->Point.Params);
- write_common_fixed (pro, SLANG_COMMON_FIXED_POINT, v, 0, 7 * sizeof (GLfloat));
-
- /* material parameters */
- write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL,
- MAT_ATTRIB_FRONT_EMISSION,
- MAT_ATTRIB_FRONT_AMBIENT,
- MAT_ATTRIB_FRONT_DIFFUSE,
- MAT_ATTRIB_FRONT_SPECULAR,
- MAT_ATTRIB_FRONT_SHININESS);
- write_common_fixed_material (ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL,
- MAT_ATTRIB_BACK_EMISSION,
- MAT_ATTRIB_BACK_AMBIENT,
- MAT_ATTRIB_BACK_DIFFUSE,
- MAT_ATTRIB_BACK_SPECULAR,
- MAT_ATTRIB_BACK_SHININESS);
-
- for (i = 0; i < ctx->Const.MaxLights; i++)
- {
- /* light source parameters */
- COPY_4FV(v, ctx->Light.Light[i].Ambient);
- COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse);
- COPY_4FV((v + 8), ctx->Light.Light[i].Specular);
- COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition);
- COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition);
- v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f;
- NORMALIZE_3FV((v + 16));
- v[19] = 0.0f;
- COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection);
- v[23] = ctx->Light.Light[i].SpotExponent;
- v[24] = ctx->Light.Light[i].SpotCutoff;
- v[25] = ctx->Light.Light[i]._CosCutoffNeg;
- v[26] = ctx->Light.Light[i].ConstantAttenuation;
- v[27] = ctx->Light.Light[i].LinearAttenuation;
- v[28] = ctx->Light.Light[i].QuadraticAttenuation;
- write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i, 29 * sizeof (GLfloat));
-
- /* light product */
- write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
- MAT_ATTRIB_FRONT_AMBIENT,
- MAT_ATTRIB_FRONT_DIFFUSE,
- MAT_ATTRIB_FRONT_SPECULAR);
- write_common_fixed_light_product (ctx, pro, i, SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
- MAT_ATTRIB_BACK_AMBIENT,
- MAT_ATTRIB_BACK_DIFFUSE,
- MAT_ATTRIB_BACK_SPECULAR);
- }
-
- /* light model parameters */
- write_common_fixed (pro, SLANG_COMMON_FIXED_LIGHTMODEL, ctx->Light.Model.Ambient, 0, 4 * sizeof (GLfloat));
-
- /* light model product */
- write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
- MAT_ATTRIB_FRONT_EMISSION,
- MAT_ATTRIB_FRONT_AMBIENT);
- write_common_fixed_light_model_product (ctx, pro, SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
- MAT_ATTRIB_BACK_EMISSION,
- MAT_ATTRIB_BACK_AMBIENT);
-
- /* TEXTURE_ENV_COLOR */
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
- {
- write_common_fixed (pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR, ctx->Texture.Unit[i].EnvColor,
- i, 4 * sizeof (GLfloat));
- }
-
- /* fog parameters */
- COPY_4FV(v, ctx->Fog.Color);
- v[4] = ctx->Fog.Density;
- v[5] = ctx->Fog.Start;
- v[6] = ctx->Fog.End;
- v[7] = ctx->Fog._Scale;
- write_common_fixed (pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof (GLfloat));
+_program_UpdateFixedUniforms(struct gl2_program_intf **intf)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+ GLfloat v[29];
+ GLfloat *p;
+
+ /* MODELVIEW matrix */
+ write_common_fixed_mat4(pro, ctx->ModelviewMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE);
+
+ /* PROJECTION matrix */
+ write_common_fixed_mat4(pro, ctx->ProjectionMatrixStack.Top, 0,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE);
+
+ /* MVP matrix */
+ write_common_fixed_mat4(pro, &ctx->_ModelProjectMatrix, 0,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE);
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ /* TEXTURE matrix */
+ write_common_fixed_mat4(pro, ctx->TextureMatrixStack[i].Top, i,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE);
+
+ /* EYE_PLANE texture-coordinate generation */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANES,
+ ctx->Texture.Unit[i].EyePlaneS, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANET,
+ ctx->Texture.Unit[i].EyePlaneT, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANER,
+ ctx->Texture.Unit[i].EyePlaneR, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_EYEPLANEQ,
+ ctx->Texture.Unit[i].EyePlaneQ, i,
+ 4 * sizeof(GLfloat));
+
+ /* OBJECT_PLANE texture-coordinate generation */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANES,
+ ctx->Texture.Unit[i].ObjectPlaneS, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANET,
+ ctx->Texture.Unit[i].ObjectPlaneT, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANER,
+ ctx->Texture.Unit[i].ObjectPlaneR, i,
+ 4 * sizeof(GLfloat));
+ write_common_fixed(pro, SLANG_COMMON_FIXED_OBJECTPLANEQ,
+ ctx->Texture.Unit[i].ObjectPlaneQ, i,
+ 4 * sizeof(GLfloat));
+ }
+
+ /* NORMAL matrix - upper 3x3 inverse transpose of MODELVIEW matrix */
+ p = ctx->ModelviewMatrixStack.Top->inv;
+ v[0] = p[0];
+ v[1] = p[4];
+ v[2] = p[8];
+ v[3] = p[1];
+ v[4] = p[5];
+ v[5] = p[9];
+ v[6] = p[2];
+ v[7] = p[6];
+ v[8] = p[10];
+ write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALMATRIX, v, 0,
+ 9 * sizeof(GLfloat));
+
+ /* normal scale */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_NORMALSCALE,
+ &ctx->_ModelViewInvScale, 0, sizeof(GLfloat));
+
+ /* depth range parameters */
+ v[0] = ctx->Viewport.Near;
+ v[1] = ctx->Viewport.Far;
+ v[2] = ctx->Viewport.Far - ctx->Viewport.Near;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_DEPTHRANGE, v, 0,
+ 3 * sizeof(GLfloat));
+
+ /* CLIP_PLANEi */
+ for (i = 0; i < ctx->Const.MaxClipPlanes; i++) {
+ write_common_fixed(pro, SLANG_COMMON_FIXED_CLIPPLANE,
+ ctx->Transform.EyeUserPlane[i], i,
+ 4 * sizeof(GLfloat));
+ }
+
+ /* point parameters */
+ v[0] = ctx->Point.Size;
+ v[1] = ctx->Point.MinSize;
+ v[2] = ctx->Point.MaxSize;
+ v[3] = ctx->Point.Threshold;
+ COPY_3FV((v + 4), ctx->Point.Params);
+ write_common_fixed(pro, SLANG_COMMON_FIXED_POINT, v, 0,
+ 7 * sizeof(GLfloat));
+
+ /* material parameters */
+ write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_FRONTMATERIAL,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR,
+ MAT_ATTRIB_FRONT_SHININESS);
+ write_common_fixed_material(ctx, pro, SLANG_COMMON_FIXED_BACKMATERIAL,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR,
+ MAT_ATTRIB_BACK_SHININESS);
+
+ for (i = 0; i < ctx->Const.MaxLights; i++) {
+ /* light source parameters */
+ COPY_4FV(v, ctx->Light.Light[i].Ambient);
+ COPY_4FV((v + 4), ctx->Light.Light[i].Diffuse);
+ COPY_4FV((v + 8), ctx->Light.Light[i].Specular);
+ COPY_4FV((v + 12), ctx->Light.Light[i].EyePosition);
+ COPY_2FV((v + 16), ctx->Light.Light[i].EyePosition);
+ v[18] = ctx->Light.Light[i].EyePosition[2] + 1.0f;
+ NORMALIZE_3FV((v + 16));
+ v[19] = 0.0f;
+ COPY_3V((v + 20), ctx->Light.Light[i].EyeDirection);
+ v[23] = ctx->Light.Light[i].SpotExponent;
+ v[24] = ctx->Light.Light[i].SpotCutoff;
+ v[25] = ctx->Light.Light[i]._CosCutoffNeg;
+ v[26] = ctx->Light.Light[i].ConstantAttenuation;
+ v[27] = ctx->Light.Light[i].LinearAttenuation;
+ v[28] = ctx->Light.Light[i].QuadraticAttenuation;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTSOURCE, v, i,
+ 29 * sizeof(GLfloat));
+
+ /* light product */
+ write_common_fixed_light_product(ctx, pro, i,
+ SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ MAT_ATTRIB_FRONT_AMBIENT,
+ MAT_ATTRIB_FRONT_DIFFUSE,
+ MAT_ATTRIB_FRONT_SPECULAR);
+ write_common_fixed_light_product(ctx, pro, i,
+ SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ MAT_ATTRIB_BACK_AMBIENT,
+ MAT_ATTRIB_BACK_DIFFUSE,
+ MAT_ATTRIB_BACK_SPECULAR);
+ }
+
+ /* light model parameters */
+ write_common_fixed(pro, SLANG_COMMON_FIXED_LIGHTMODEL,
+ ctx->Light.Model.Ambient, 0, 4 * sizeof(GLfloat));
+
+ /* light model product */
+ write_common_fixed_light_model_product(ctx, pro,
+ SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ MAT_ATTRIB_FRONT_EMISSION,
+ MAT_ATTRIB_FRONT_AMBIENT);
+ write_common_fixed_light_model_product(ctx, pro,
+ SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ MAT_ATTRIB_BACK_EMISSION,
+ MAT_ATTRIB_BACK_AMBIENT);
+
+ /* TEXTURE_ENV_COLOR */
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ write_common_fixed(pro, SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
+ ctx->Texture.Unit[i].EnvColor, i,
+ 4 * sizeof(GLfloat));
+ }
+
+ /* fog parameters */
+ COPY_4FV(v, ctx->Fog.Color);
+ v[4] = ctx->Fog.Density;
+ v[5] = ctx->Fog.Start;
+ v[6] = ctx->Fog.End;
+ v[7] = ctx->Fog._Scale;
+ write_common_fixed(pro, SLANG_COMMON_FIXED_FOG, v, 0, 8 * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateFixedAttrib (struct gl2_program_intf **intf, GLuint index, GLvoid *data,
- GLuint offset, GLuint size, GLboolean write)
+_program_UpdateFixedAttrib(struct gl2_program_intf **intf, GLuint index,
+ GLvoid * data, GLuint offset, GLuint size,
+ GLboolean write)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
-
- addr = pro->vertex_fixed_entries[index];
- if (addr != ~0)
- {
- GLubyte *mem;
-
- mem = (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + offset * size;
- if (write)
- _mesa_memcpy (mem, data, size);
- else
- _mesa_memcpy (data, mem, size);
- }
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->vertex_fixed_entries[index];
+ if (addr != ~0) {
+ GLubyte *mem;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr +
+ offset * size;
+ if (write)
+ _mesa_memcpy(mem, data, size);
+ else
+ _mesa_memcpy(data, mem, size);
+ }
}
@@ -1199,594 +1224,711 @@ _program_UpdateFixedAttrib (struct gl2_program_intf **intf, GLuint index, GLvoid
*/
static GLvoid
_program_UpdateFixedVarying(struct gl2_program_intf **intf, GLuint index,
- GLvoid *data,
+ GLvoid * data,
GLuint offset, GLuint size, GLboolean write)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
-
- addr = pro->fragment_fixed_entries[index];
- if (addr != ~0)
- {
- GLubyte *mem;
-
- mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + offset * size;
- if (write)
- _mesa_memcpy (mem, data, size);
- else
- _mesa_memcpy (data, mem, size);
- }
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ addr = pro->fragment_fixed_entries[index];
+ if (addr != ~0) {
+ GLubyte *mem;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr +
+ offset * size;
+ if (write)
+ _mesa_memcpy(mem, data, size);
+ else
+ _mesa_memcpy(data, mem, size);
+ }
}
static GLvoid
-_program_GetTextureImageUsage (struct gl2_program_intf **intf, GLbitfield *teximageusage)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint i;
-
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
- teximageusage[i] = 0;
-
- for (i = 0; i < pro->texture_usage.count; i++)
- {
- GLuint n, addr, j;
-
- n = slang_export_data_quant_elements (pro->texture_usage.table[i].quant);
- addr = pro->texture_usage.table[i].frag_address;
- for (j = 0; j < n; j++)
- {
- GLubyte *mem;
- GLuint image;
-
- mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + j * 4;
- image = (GLuint) *((GLfloat *) mem);
- if (image >= 0 && image < ctx->Const.MaxTextureImageUnits)
- {
- switch (slang_export_data_quant_type (pro->texture_usage.table[i].quant))
- {
- case GL_SAMPLER_1D_ARB:
- case GL_SAMPLER_1D_SHADOW_ARB:
- teximageusage[image] |= TEXTURE_1D_BIT;
- break;
- case GL_SAMPLER_2D_ARB:
- case GL_SAMPLER_2D_SHADOW_ARB:
- teximageusage[image] |= TEXTURE_2D_BIT;
- break;
- case GL_SAMPLER_3D_ARB:
- teximageusage[image] |= TEXTURE_3D_BIT;
- break;
- case GL_SAMPLER_CUBE_ARB:
- teximageusage[image] |= TEXTURE_CUBE_BIT;
- break;
- }
- }
- }
- }
-
- /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */
+_program_GetTextureImageUsage(struct gl2_program_intf **intf,
+ GLbitfield * teximageusage)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint i;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
+ teximageusage[i] = 0;
+
+ for (i = 0; i < pro->texture_usage.count; i++) {
+ GLuint n, addr, j;
+
+ n = slang_export_data_quant_elements(pro->texture_usage.table[i].quant);
+ addr = pro->texture_usage.table[i].frag_address;
+ for (j = 0; j < n; j++) {
+ GLubyte *mem;
+ GLuint image;
+
+ mem =
+ (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr +
+ j * 4;
+ image = (GLuint) * ((GLfloat *) mem);
+ if (image >= 0 && image < ctx->Const.MaxTextureImageUnits) {
+ switch (slang_export_data_quant_type
+ (pro->texture_usage.table[i].quant)) {
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_1D_BIT;
+ break;
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ teximageusage[image] |= TEXTURE_2D_BIT;
+ break;
+ case GL_SAMPLER_3D_ARB:
+ teximageusage[image] |= TEXTURE_3D_BIT;
+ break;
+ case GL_SAMPLER_CUBE_ARB:
+ teximageusage[image] |= TEXTURE_CUBE_BIT;
+ break;
+ }
+ }
+ }
+ }
+
+ /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */
}
static GLboolean
-_program_IsShaderPresent (struct gl2_program_intf **intf, GLenum subtype)
+_program_IsShaderPresent(struct gl2_program_intf **intf, GLenum subtype)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
- switch (subtype)
- {
- case GL_VERTEX_SHADER_ARB:
- return pro->machines[SLANG_SHADER_VERTEX] != NULL;
- case GL_FRAGMENT_SHADER_ARB:
- return pro->machines[SLANG_SHADER_FRAGMENT] != NULL;
- default:
- return GL_FALSE;
- }
+ switch (subtype) {
+ case GL_VERTEX_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_VERTEX] != NULL;
+ case GL_FRAGMENT_SHADER_ARB:
+ return pro->machines[SLANG_SHADER_FRAGMENT] != NULL;
+ default:
+ return GL_FALSE;
+ }
}
static GLvoid
-get_active_variable (slang_active_variable *var, GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLchar *name)
+get_active_variable(slang_active_variable * var, GLsizei maxLength,
+ GLsizei * length, GLint * size, GLenum * type,
+ GLchar * name)
{
- GLsizei len;
+ GLsizei len;
- len = _mesa_strlen (var->name);
- if (len >= maxLength)
- len = maxLength - 1;
- if (length != NULL)
- *length = len;
- *size = slang_export_data_quant_elements (var->quant);
- *type = slang_export_data_quant_type (var->quant);
- _mesa_memcpy (name, var->name, len);
- name[len] = '\0';
+ len = _mesa_strlen(var->name);
+ if (len >= maxLength)
+ len = maxLength - 1;
+ if (length != NULL)
+ *length = len;
+ *size = slang_export_data_quant_elements(var->quant);
+ *type = slang_export_data_quant_type(var->quant);
+ _mesa_memcpy(name, var->name, len);
+ name[len] = '\0';
}
static GLuint
-get_active_variable_max_length (slang_active_variables *vars)
+get_active_variable_max_length(slang_active_variables * vars)
{
- GLuint i, len = 0;
+ GLuint i, len = 0;
- for (i = 0; i < vars->count; i++)
- {
- GLuint n = _mesa_strlen (vars->table[i].name);
- if (n > len)
- len = n;
- }
- return len;
+ for (i = 0; i < vars->count; i++) {
+ GLuint n = _mesa_strlen(vars->table[i].name);
+ if (n > len)
+ len = n;
+ }
+ return len;
}
static GLvoid
-_program_GetActiveUniform (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength,
- GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+_program_GetActiveUniform(struct gl2_program_intf **intf, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index];
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_active_variable *u = &impl->_obj.prog.active_uniforms.table[index];
- get_active_variable (u, maxLength, length, size, type, name);
+ get_active_variable(u, maxLength, length, size, type, name);
}
static GLuint
-_program_GetActiveUniformMaxLength (struct gl2_program_intf **intf)
+_program_GetActiveUniformMaxLength(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return get_active_variable_max_length (&impl->_obj.prog.active_uniforms);
+ return get_active_variable_max_length(&impl->_obj.prog.active_uniforms);
}
static GLuint
-_program_GetActiveUniformCount (struct gl2_program_intf **intf)
+_program_GetActiveUniformCount(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return impl->_obj.prog.active_uniforms.count;
+ return impl->_obj.prog.active_uniforms.count;
}
static GLint
-_program_GetUniformLocation (struct gl2_program_intf **intf, const GLchar *name)
+_program_GetUniformLocation(struct gl2_program_intf **intf,
+ const GLchar * name)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_uniform_bindings *bind = &impl->_obj.prog.uniforms;
+ GLuint i;
+
+ for (i = 0; i < bind->count; i++)
+ if (_mesa_strcmp(bind->table[i].name, name) == 0)
+ return i;
+ return -1;
+}
+
+/**
+ * Write a uniform variable into program's memory.
+ * \return GL_TRUE for success, GL_FALSE if error
+ */
+static GLboolean
+_program_WriteUniform(struct gl2_program_intf **intf, GLint loc,
+ GLsizei count, const GLvoid * data, GLenum type)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_uniform_bindings *bind = &impl->_obj.prog.uniforms;
- GLuint i;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
+ slang_uniform_binding *uniform;
+ GLuint i;
+ GLboolean convert_float_to_bool = GL_FALSE;
+ GLboolean convert_int_to_bool = GL_FALSE;
+ GLboolean convert_int_to_float = GL_FALSE;
+ GLboolean types_match = GL_FALSE;
+
+ if (loc < 0 || loc >= uniforms->count)
+ return GL_FALSE;
+
+ uniform = &uniforms->table[loc];
+ /* TODO: check sizes */
+ if (slang_export_data_quant_struct(uniform->quant))
+ return GL_FALSE;
+
+ switch (slang_export_data_quant_type(uniform->quant)) {
+ case GL_BOOL_ARB:
+ types_match = (type == GL_FLOAT) || (type == GL_INT);
+ if (type == GL_FLOAT)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC2_ARB:
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
+ if (type == GL_FLOAT_VEC2_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC3_ARB:
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
+ if (type == GL_FLOAT_VEC3_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_BOOL_VEC4_ARB:
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
+ if (type == GL_FLOAT_VEC4_ARB)
+ convert_float_to_bool = GL_TRUE;
+ else
+ convert_int_to_bool = GL_TRUE;
+ break;
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ types_match = (type == GL_INT);
+ break;
+ default:
+ types_match = (type == slang_export_data_quant_type(uniform->quant));
+ break;
+ }
+
+ if (!types_match)
+ return GL_FALSE;
- for (i = 0; i < bind->count; i++)
- if (_mesa_strcmp (bind->table[i].name, name) == 0)
- return i;
- return -1;
+ switch (type) {
+ case GL_INT:
+ case GL_INT_VEC2_ARB:
+ case GL_INT_VEC3_ARB:
+ case GL_INT_VEC4_ARB:
+ convert_int_to_float = GL_TRUE;
+ break;
+ }
+
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ if (uniform->address[i] != ~0) {
+ void *dest
+ = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4];
+ /* total number of values to copy */
+ GLuint total
+ = count * slang_export_data_quant_components(uniform->quant);
+ GLuint j;
+ if (convert_float_to_bool) {
+ const GLfloat *src = (GLfloat *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;
+ break;
+ }
+ else if (convert_int_to_bool) {
+ const GLint *src = (GLint *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] ? 1.0f : 0.0f;
+ break;
+ }
+ else if (convert_int_to_float) {
+ const GLint *src = (GLint *) (data);
+ GLfloat *dst = (GLfloat *) dest;
+ for (j = 0; j < total; j++)
+ dst[j] = (GLfloat) src[j];
+ break;
+ }
+ else {
+ _mesa_memcpy(dest, data, total * sizeof(GLfloat));
+ break;
+ }
+ break;
+ }
+ }
+ return GL_TRUE;
}
+/**
+ * Read a uniform variable from program's memory.
+ * \return GL_TRUE for success, GL_FALSE if error
+ */
static GLboolean
-_program_WriteUniform (struct gl2_program_intf **intf, GLint loc, GLsizei count, const GLvoid *data,
- GLenum type)
-{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
- slang_uniform_binding *uniform;
- GLuint i;
- GLboolean convert_float_to_bool = GL_FALSE;
- GLboolean convert_int_to_bool = GL_FALSE;
- GLboolean convert_int_to_float = GL_FALSE;
- GLboolean types_match = GL_FALSE;
-
- if (loc == -1)
- return GL_TRUE;
- if (loc >= uniforms->count)
- return GL_FALSE;
-
- uniform = &uniforms->table[loc];
- /* TODO: check sizes */
- if (slang_export_data_quant_struct (uniform->quant))
- return GL_FALSE;
-
- switch (slang_export_data_quant_type (uniform->quant))
- {
- case GL_BOOL_ARB:
- types_match = (type == GL_FLOAT) || (type == GL_INT);
- if (type == GL_FLOAT)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC2_ARB:
- types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
- if (type == GL_FLOAT_VEC2_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC3_ARB:
- types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
- if (type == GL_FLOAT_VEC3_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_BOOL_VEC4_ARB:
- types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
- if (type == GL_FLOAT_VEC4_ARB)
- convert_float_to_bool = GL_TRUE;
- else
- convert_int_to_bool = GL_TRUE;
- break;
- case GL_SAMPLER_1D_ARB:
- case GL_SAMPLER_2D_ARB:
- case GL_SAMPLER_3D_ARB:
- case GL_SAMPLER_CUBE_ARB:
- case GL_SAMPLER_1D_SHADOW_ARB:
- case GL_SAMPLER_2D_SHADOW_ARB:
- types_match = (type == GL_INT);
- break;
- default:
- types_match = (type == slang_export_data_quant_type (uniform->quant));
- break;
- }
-
- if (!types_match)
- return GL_FALSE;
-
- switch (type)
- {
- case GL_INT:
- case GL_INT_VEC2_ARB:
- case GL_INT_VEC3_ARB:
- case GL_INT_VEC4_ARB:
- convert_int_to_float = GL_TRUE;
- break;
- }
-
- if (convert_float_to_bool)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLfloat *src = (GLfloat *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;
- }
- }
- else if (convert_int_to_bool)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLuint *src = (GLuint *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = src[j] ? 1.0f : 0.0f;
- }
- }
- else if (convert_int_to_float)
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- const GLuint *src = (GLuint *) (data);
- GLfloat *dst = (GLfloat *)
- (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4]);
- GLuint j;
- GLuint total = count * slang_export_data_quant_components (uniform->quant);
-
- for (j = 0; j < total; j++)
- dst[j] = (GLfloat) src[j];
- }
- }
- else
- {
- for (i = 0; i < SLANG_SHADER_MAX; i++)
- if (uniform->address[i] != ~0)
- {
- _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4], data,
- count * slang_export_data_quant_size (uniform->quant));
- }
- }
- return GL_TRUE;
+_program_ReadUniform(struct gl2_program_intf **intf, GLint loc,
+ GLsizei count, GLvoid *data, GLenum type)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ const slang_uniform_bindings *uniforms = &impl->_obj.prog.uniforms;
+ const slang_uniform_binding *uniform;
+ GLuint i;
+ GLboolean convert_bool_to_float = GL_FALSE;
+ GLboolean convert_bool_to_int = GL_FALSE;
+ GLboolean convert_float_to_int = GL_FALSE;
+ GLboolean types_match = GL_FALSE;
+
+ if (loc < 0 || loc >= uniforms->count)
+ return GL_FALSE;
+
+ uniform = &uniforms->table[loc];
+
+ if (slang_export_data_quant_struct(uniform->quant))
+ return GL_FALSE;
+
+ switch (slang_export_data_quant_type(uniform->quant)) {
+ case GL_BOOL_ARB:
+ types_match = (type == GL_FLOAT) || (type == GL_INT);
+ if (type == GL_FLOAT)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC2_ARB:
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);
+ if (type == GL_FLOAT_VEC2_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC3_ARB:
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);
+ if (type == GL_FLOAT_VEC3_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_BOOL_VEC4_ARB:
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);
+ if (type == GL_FLOAT_VEC4_ARB)
+ convert_bool_to_float = GL_TRUE;
+ else
+ convert_bool_to_int = GL_TRUE;
+ break;
+ case GL_SAMPLER_1D_ARB:
+ case GL_SAMPLER_2D_ARB:
+ case GL_SAMPLER_3D_ARB:
+ case GL_SAMPLER_CUBE_ARB:
+ case GL_SAMPLER_1D_SHADOW_ARB:
+ case GL_SAMPLER_2D_SHADOW_ARB:
+ types_match = (type == GL_INT);
+ break;
+ default:
+ /* uniform is a float type */
+ types_match = (type == GL_FLOAT);
+ break;
+ }
+
+ if (!types_match)
+ return GL_FALSE;
+
+ switch (type) {
+ case GL_INT:
+ case GL_INT_VEC2_ARB:
+ case GL_INT_VEC3_ARB:
+ case GL_INT_VEC4_ARB:
+ convert_float_to_int = GL_TRUE;
+ break;
+ }
+
+ for (i = 0; i < SLANG_SHADER_MAX; i++) {
+ if (uniform->address[i] != ~0) {
+ /* XXX if bools are really implemented as floats, some of this
+ * could probably be culled out.
+ */
+ const void *source
+ = &impl->_obj.prog.machines[i]->mem[uniform->address[i] / 4];
+ /* total number of values to copy */
+ const GLuint total
+ = count * slang_export_data_quant_components(uniform->quant);
+ GLuint j;
+ if (convert_bool_to_float) {
+ GLfloat *dst = (GLfloat *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] == 0.0 ? 0.0 : 1.0;
+ }
+ else if (convert_bool_to_int) {
+ GLint *dst = (GLint *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = src[j] == 0.0 ? 0 : 1;
+ }
+ else if (convert_float_to_int) {
+ GLint *dst = (GLint *) (data);
+ const GLfloat *src = (GLfloat *) source;
+ for (j = 0; j < total; j++)
+ dst[j] = (GLint) src[j];
+ }
+ else {
+ /* no type conversion needed */
+ _mesa_memcpy(data, source, total * sizeof(GLfloat));
+ }
+ break;
+ } /* if */
+ } /* for */
+
+ return GL_TRUE;
}
+
static GLvoid
-_program_GetActiveAttrib (struct gl2_program_intf **intf, GLuint index, GLsizei maxLength,
- GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+_program_GetActiveAttrib(struct gl2_program_intf **intf, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index];
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_active_variable *a = &impl->_obj.prog.active_attribs.table[index];
- get_active_variable (a, maxLength, length, size, type, name);
+ get_active_variable(a, maxLength, length, size, type, name);
}
static GLuint
-_program_GetActiveAttribMaxLength (struct gl2_program_intf **intf)
+_program_GetActiveAttribMaxLength(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return get_active_variable_max_length (&impl->_obj.prog.active_attribs);
+ return get_active_variable_max_length(&impl->_obj.prog.active_attribs);
}
static GLuint
-_program_GetActiveAttribCount (struct gl2_program_intf **intf)
+_program_GetActiveAttribCount(struct gl2_program_intf **intf)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- return impl->_obj.prog.active_attribs.count;
+ return impl->_obj.prog.active_attribs.count;
}
static GLint
-_program_GetAttribLocation (struct gl2_program_intf **intf, const GLchar *name)
+_program_GetAttribLocation(struct gl2_program_intf **intf,
+ const GLchar * name)
{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_attrib_bindings *attribs = &impl->_obj.prog.attribs;
- GLuint i;
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_attrib_bindings *attribs = &impl->_obj.prog.attribs;
+ GLuint i;
- for (i = 0; i < attribs->binding_count; i++)
- if (_mesa_strcmp (attribs->bindings[i].name, name) == 0)
- return attribs->bindings[i].first_slot_index;
- return -1;
+ for (i = 0; i < attribs->binding_count; i++)
+ if (_mesa_strcmp(attribs->bindings[i].name, name) == 0)
+ return attribs->bindings[i].first_slot_index;
+ return -1;
}
static GLvoid
-_program_OverrideAttribBinding (struct gl2_program_intf **intf, GLuint index, const GLchar *name)
+_program_OverrideAttribBinding(struct gl2_program_intf **intf, GLuint index,
+ const GLchar * name)
{
- GET_CURRENT_CONTEXT(ctx);
- struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
- slang_program *pro = &impl->_obj.prog;
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
+ slang_program *pro = &impl->_obj.prog;
- if (!_slang_attrib_overrides_add (&pro->attrib_overrides, index, name))
- _mesa_error (ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding");
+ if (!_slang_attrib_overrides_add(&pro->attrib_overrides, index, name))
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "_program_OverrideAttribBinding");
}
static GLvoid
-_program_WriteAttrib (struct gl2_program_intf **intf, GLuint index, const GLfloat *value)
+_program_WriteAttrib(struct gl2_program_intf **intf, GLuint index,
+ const GLfloat * value)
{
struct gl2_program_impl *impl = (struct gl2_program_impl *) (intf);
slang_program *pro = &impl->_obj.prog;
slang_attrib_slot *slot = &pro->attribs.slots[index];
/*
- * Generic attributes can be allocated in a shader with scalar, vec or mat type.
- * For scalar and vec types (specifically float, vec2 and vec3) this is simple - just
- * ignore the extra components. For mat type this is more complicated - the vertex_shader
- * spec requires to store every column of a matrix in a separate attrib slot.
- * To prvent from overwriting data from neighbouring matrix columns, the "fill" information
- * is kept to know how many components to copy.
+ * Generic attributes can be allocated in a shader with scalar, vec
+ * or mat type. For scalar and vec types (specifically float, vec2
+ * and vec3) this is simple - just ignore the extra components. For
+ * mat type this is more complicated - the vertex_shader spec
+ * requires to store every column of a matrix in a separate attrib
+ * slot. To prvent from overwriting data from neighbouring matrix
+ * columns, the "fill" information is kept to know how many
+ * components to copy.
*/
if (slot->addr != ~0)
- _mesa_memcpy (&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4]._float, value,
- slot->fill * sizeof (GLfloat));
+ _mesa_memcpy(&pro->machines[SLANG_SHADER_VERTEX]->mem[slot->addr / 4].
+ _float, value, slot->fill * sizeof(GLfloat));
}
static GLvoid
-_program_UpdateVarying (struct gl2_program_intf **intf, GLuint index, GLfloat *value,
- GLboolean vert)
-{
- struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
- slang_program *pro = &impl->_obj.prog;
- GLuint addr;
-
- if (index >= pro->varyings.slot_count)
- return;
- if (vert)
- addr = pro->varyings.slots[index].vert_addr / 4;
- else
- addr = pro->varyings.slots[index].frag_addr / 4;
- if (addr != ~0)
- {
- if (vert)
- *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float;
- else
- pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value;
- }
+_program_UpdateVarying(struct gl2_program_intf **intf, GLuint index,
+ GLfloat * value, GLboolean vert)
+{
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;
+ slang_program *pro = &impl->_obj.prog;
+ GLuint addr;
+
+ if (index >= pro->varyings.slot_count)
+ return;
+ if (vert)
+ addr = pro->varyings.slots[index].vert_addr / 4;
+ else
+ addr = pro->varyings.slots[index].frag_addr / 4;
+ if (addr != ~0) {
+ if (vert)
+ *value = pro->machines[SLANG_SHADER_VERTEX]->mem[addr]._float;
+ else
+ pro->machines[SLANG_SHADER_FRAGMENT]->mem[addr]._float = *value;
+ }
}
static struct gl2_program_intf _program_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _program_QueryInterface
- },
- _generic_Delete,
- _program_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _program_QueryInterface
+ },
+ _generic_Delete,
+ _program_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_generic_GetInfoLog,
_generic_GetInfoLogLength
- },
- _program_Attach,
- _container_Detach,
- _container_GetAttachedCount,
- _container_GetAttached
- },
- _program_GetLinkStatus,
- _program_GetValidateStatus,
- _program_Link,
- _program_Validate,
- _program_UpdateFixedUniforms,
- _program_UpdateFixedAttrib,
- _program_UpdateFixedVarying,
- _program_GetTextureImageUsage,
- _program_IsShaderPresent,
- _program_GetActiveUniform,
- _program_GetActiveUniformMaxLength,
- _program_GetActiveUniformCount,
- _program_GetUniformLocation,
- _program_WriteUniform,
- _program_GetActiveAttrib,
- _program_GetActiveAttribMaxLength,
- _program_GetActiveAttribCount,
- _program_GetAttribLocation,
- _program_OverrideAttribBinding,
+ },
+ _program_Attach,
+ _container_Detach,
+ _container_GetAttachedCount,
+ _container_GetAttached
+ },
+ _program_GetLinkStatus,
+ _program_GetValidateStatus,
+ _program_Link,
+ _program_Validate,
+ _program_UpdateFixedUniforms,
+ _program_UpdateFixedAttrib,
+ _program_UpdateFixedVarying,
+ _program_GetTextureImageUsage,
+ _program_IsShaderPresent,
+ _program_GetActiveUniform,
+ _program_GetActiveUniformMaxLength,
+ _program_GetActiveUniformCount,
+ _program_GetUniformLocation,
+ _program_WriteUniform,
+ _program_ReadUniform,
+ _program_GetActiveAttrib,
+ _program_GetActiveAttribMaxLength,
+ _program_GetActiveAttribCount,
+ _program_GetAttribLocation,
+ _program_OverrideAttribBinding,
_program_WriteAttrib,
- _program_UpdateVarying
+ _program_UpdateVarying
};
static void
-_program_constructor (struct gl2_program_impl *impl)
+_program_constructor(struct gl2_program_impl *impl)
{
- _container_constructor ((struct gl2_container_impl *) impl);
- impl->_vftbl = &_program_vftbl;
- impl->_obj._container._generic._unknown._destructor = _program_destructor;
- impl->_obj.link_status = GL_FALSE;
- impl->_obj.validate_status = GL_FALSE;
+ _container_constructor((struct gl2_container_impl *) impl);
+ impl->_vftbl = &_program_vftbl;
+ impl->_obj._container._generic._unknown._destructor = _program_destructor;
+ impl->_obj.link_status = GL_FALSE;
+ impl->_obj.validate_status = GL_FALSE;
#if USE_3DLABS_FRONTEND
- impl->_obj.linker = ShConstructLinker (EShExVertexFragment, 0);
- impl->_obj.uniforms = ShConstructUniformMap ();
+ impl->_obj.linker = ShConstructLinker(EShExVertexFragment, 0);
+ impl->_obj.uniforms = ShConstructUniformMap();
#endif
- _slang_program_ctr (&impl->_obj.prog);
+ _slang_program_ctr(&impl->_obj.prog);
}
struct gl2_fragment_shader_obj
{
- struct gl2_shader_obj _shader;
+ struct gl2_shader_obj _shader;
};
struct gl2_fragment_shader_impl
{
- struct gl2_fragment_shader_intf *_vftbl;
- struct gl2_fragment_shader_obj _obj;
+ struct gl2_fragment_shader_intf *_vftbl;
+ struct gl2_fragment_shader_obj _obj;
};
static void
-_fragment_shader_destructor (struct gl2_unknown_intf **intf)
+_fragment_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_fragment_shader_impl *impl = (struct gl2_fragment_shader_impl *) intf;
+ struct gl2_fragment_shader_impl *impl =
+ (struct gl2_fragment_shader_impl *) intf;
- (void) impl;
- /* TODO free fragment shader data */
+ (void) impl;
+ /* TODO free fragment shader data */
- _shader_destructor (intf);
+ _shader_destructor(intf);
}
static struct gl2_unknown_intf **
-_fragment_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_fragment_shader_QueryInterface(struct gl2_unknown_intf **intf,
+ enum gl2_uiid uiid)
{
- if (uiid == UIID_FRAGMENT_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _shader_QueryInterface (intf, uiid);
+ if (uiid == UIID_FRAGMENT_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _shader_QueryInterface(intf, uiid);
}
static GLenum
-_fragment_shader_GetSubType (struct gl2_shader_intf **intf)
+_fragment_shader_GetSubType(struct gl2_shader_intf **intf)
{
- return GL_FRAGMENT_SHADER_ARB;
+ return GL_FRAGMENT_SHADER_ARB;
}
static struct gl2_fragment_shader_intf _fragment_shader_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _fragment_shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _fragment_shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- _fragment_shader_GetSubType,
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
- }
+ },
+ _fragment_shader_GetSubType,
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
+ }
};
static void
-_fragment_shader_constructor (struct gl2_fragment_shader_impl *impl)
+_fragment_shader_constructor(struct gl2_fragment_shader_impl *impl)
{
- _shader_constructor ((struct gl2_shader_impl *) impl);
- impl->_vftbl = &_fragment_shader_vftbl;
- impl->_obj._shader._generic._unknown._destructor = _fragment_shader_destructor;
+ _shader_constructor((struct gl2_shader_impl *) impl);
+ impl->_vftbl = &_fragment_shader_vftbl;
+ impl->_obj._shader._generic._unknown._destructor =
+ _fragment_shader_destructor;
#if USE_3DLABS_FRONTEND
- impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangFragment, 0);
+ impl->_obj._shader._3dlabs_shhandle._obj.handle =
+ ShConstructCompiler(EShLangFragment, 0);
#endif
}
struct gl2_vertex_shader_obj
{
- struct gl2_shader_obj _shader;
+ struct gl2_shader_obj _shader;
};
struct gl2_vertex_shader_impl
{
- struct gl2_vertex_shader_intf *_vftbl;
- struct gl2_vertex_shader_obj _obj;
+ struct gl2_vertex_shader_intf *_vftbl;
+ struct gl2_vertex_shader_obj _obj;
};
static void
-_vertex_shader_destructor (struct gl2_unknown_intf **intf)
+_vertex_shader_destructor(struct gl2_unknown_intf **intf)
{
- struct gl2_vertex_shader_impl *impl = (struct gl2_vertex_shader_impl *) intf;
+ struct gl2_vertex_shader_impl *impl =
+ (struct gl2_vertex_shader_impl *) intf;
- (void) impl;
- /* TODO free vertex shader data */
+ (void) impl;
+ /* TODO free vertex shader data */
- _shader_destructor (intf);
+ _shader_destructor(intf);
}
static struct gl2_unknown_intf **
-_vertex_shader_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_vertex_shader_QueryInterface(struct gl2_unknown_intf **intf,
+ enum gl2_uiid uiid)
{
- if (uiid == UIID_VERTEX_SHADER)
- {
- (**intf).AddRef (intf);
- return intf;
- }
- return _shader_QueryInterface (intf, uiid);
+ if (uiid == UIID_VERTEX_SHADER) {
+ (**intf).AddRef(intf);
+ return intf;
+ }
+ return _shader_QueryInterface(intf, uiid);
}
static GLenum
-_vertex_shader_GetSubType (struct gl2_shader_intf **intf)
+_vertex_shader_GetSubType(struct gl2_shader_intf **intf)
{
- return GL_VERTEX_SHADER_ARB;
+ return GL_VERTEX_SHADER_ARB;
}
static struct gl2_vertex_shader_intf _vertex_shader_vftbl = {
- {
- {
- {
- _unknown_AddRef,
- _unknown_Release,
- _vertex_shader_QueryInterface
- },
- _generic_Delete,
- _shader_GetType,
- _generic_GetName,
- _generic_GetDeleteStatus,
+ {
+ {
+ {
+ _unknown_AddRef,
+ _unknown_Release,
+ _vertex_shader_QueryInterface
+ },
+ _generic_Delete,
+ _shader_GetType,
+ _generic_GetName,
+ _generic_GetDeleteStatus,
_shader_GetInfoLog,
_shader_GetInfoLogLength
- },
- _vertex_shader_GetSubType,
- _shader_GetCompileStatus,
- _shader_SetSource,
- _shader_GetSource,
- _shader_Compile
- }
+ },
+ _vertex_shader_GetSubType,
+ _shader_GetCompileStatus,
+ _shader_SetSource,
+ _shader_GetSource,
+ _shader_Compile
+ }
};
static void
-_vertex_shader_constructor (struct gl2_vertex_shader_impl *impl)
+_vertex_shader_constructor(struct gl2_vertex_shader_impl *impl)
{
- _shader_constructor ((struct gl2_shader_impl *) impl);
- impl->_vftbl = &_vertex_shader_vftbl;
- impl->_obj._shader._generic._unknown._destructor = _vertex_shader_destructor;
+ _shader_constructor((struct gl2_shader_impl *) impl);
+ impl->_vftbl = &_vertex_shader_vftbl;
+ impl->_obj._shader._generic._unknown._destructor =
+ _vertex_shader_destructor;
#if USE_3DLABS_FRONTEND
- impl->_obj._shader._3dlabs_shhandle._obj.handle = ShConstructCompiler (EShLangVertex, 0);
+ impl->_obj._shader._3dlabs_shhandle._obj.handle =
+ ShConstructCompiler(EShLangVertex, 0);
#endif
}
@@ -1802,34 +1944,35 @@ struct gl2_debug_impl
};
static GLvoid
-_debug_destructor (struct gl2_unknown_intf **intf)
+_debug_destructor(struct gl2_unknown_intf **intf)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
(void) (impl);
/* TODO */
- _generic_destructor (intf);
+ _generic_destructor(intf);
}
static struct gl2_unknown_intf **
-_debug_QueryInterface (struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
+_debug_QueryInterface(struct gl2_unknown_intf **intf, enum gl2_uiid uiid)
{
if (uiid == UIID_DEBUG) {
- (**intf).AddRef (intf);
+ (**intf).AddRef(intf);
return intf;
}
- return _generic_QueryInterface (intf, uiid);
+ return _generic_QueryInterface(intf, uiid);
}
static GLenum
-_debug_GetType (struct gl2_generic_intf **intf)
+_debug_GetType(struct gl2_generic_intf **intf)
{
- return /*GL_DEBUG_OBJECT_MESA*/0;
+ return /*GL_DEBUG_OBJECT_MESA */ 0;
}
static GLvoid
-_debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType)
+_debug_ClearDebugLog(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1838,8 +1981,9 @@ _debug_ClearDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shade
}
static GLvoid
-_debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType,
- GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
+_debug_GetDebugLog(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType, GLsizei maxLength, GLsizei * length,
+ GLcharARB * infoLog)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1848,7 +1992,8 @@ _debug_GetDebugLog (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderT
}
static GLsizei
-_debug_GetDebugLogLength (struct gl2_debug_intf **intf, GLenum logType, GLenum shaderType)
+_debug_GetDebugLogLength(struct gl2_debug_intf **intf, GLenum logType,
+ GLenum shaderType)
{
struct gl2_debug_impl *impl = (struct gl2_debug_impl *) (intf);
@@ -1878,70 +2023,68 @@ static struct gl2_debug_intf _debug_vftbl = {
};
static GLvoid
-_debug_constructor (struct gl2_debug_impl *impl)
+_debug_constructor(struct gl2_debug_impl *impl)
{
- _generic_constructor ((struct gl2_generic_impl *) (impl));
+ _generic_constructor((struct gl2_generic_impl *) (impl));
impl->_vftbl = &_debug_vftbl;
impl->_obj._generic._unknown._destructor = _debug_destructor;
}
GLhandleARB
-_mesa_3dlabs_create_shader_object (GLenum shaderType)
-{
- switch (shaderType)
- {
- case GL_FRAGMENT_SHADER_ARB:
- {
- struct gl2_fragment_shader_impl *x = (struct gl2_fragment_shader_impl *)
- _mesa_malloc (sizeof (struct gl2_fragment_shader_impl));
-
- if (x != NULL)
- {
- _fragment_shader_constructor (x);
- return x->_obj._shader._generic.name;
- }
- }
- break;
- case GL_VERTEX_SHADER_ARB:
- {
- struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *)
- _mesa_malloc (sizeof (struct gl2_vertex_shader_impl));
-
- if (x != NULL)
- {
- _vertex_shader_constructor (x);
- return x->_obj._shader._generic.name;
- }
- }
- break;
- }
-
- return 0;
+_mesa_3dlabs_create_shader_object(GLenum shaderType)
+{
+ switch (shaderType) {
+ case GL_FRAGMENT_SHADER_ARB:
+ {
+ struct gl2_fragment_shader_impl *x =
+ (struct gl2_fragment_shader_impl *)
+ _mesa_malloc(sizeof(struct gl2_fragment_shader_impl));
+
+ if (x != NULL) {
+ _fragment_shader_constructor(x);
+ return x->_obj._shader._generic.name;
+ }
+ }
+ break;
+ case GL_VERTEX_SHADER_ARB:
+ {
+ struct gl2_vertex_shader_impl *x = (struct gl2_vertex_shader_impl *)
+ _mesa_malloc(sizeof(struct gl2_vertex_shader_impl));
+
+ if (x != NULL) {
+ _vertex_shader_constructor(x);
+ return x->_obj._shader._generic.name;
+ }
+ }
+ break;
+ }
+
+ return 0;
}
GLhandleARB
-_mesa_3dlabs_create_program_object (void)
+_mesa_3dlabs_create_program_object(void)
{
- struct gl2_program_impl *x = (struct gl2_program_impl *)
- _mesa_malloc (sizeof (struct gl2_program_impl));
+ struct gl2_program_impl *x = (struct gl2_program_impl *)
+ _mesa_malloc(sizeof(struct gl2_program_impl));
- if (x != NULL)
- {
- _program_constructor (x);
- return x->_obj._container._generic.name;
- }
+ if (x != NULL) {
+ _program_constructor(x);
+ return x->_obj._container._generic.name;
+ }
- return 0;
+ return 0;
}
GLhandleARB
-_mesa_3dlabs_create_debug_object (GLvoid)
+_mesa_3dlabs_create_debug_object(GLvoid)
{
struct gl2_debug_impl *obj;
- obj = (struct gl2_debug_impl *) (_mesa_malloc (sizeof (struct gl2_debug_impl)));
+ obj =
+ (struct gl2_debug_impl *) (_mesa_malloc(sizeof(struct gl2_debug_impl)));
if (obj != NULL) {
- _debug_constructor (obj);
+ _debug_constructor(obj);
return obj->_obj._generic.name;
}
return 0;
@@ -1950,47 +2093,52 @@ _mesa_3dlabs_create_debug_object (GLvoid)
#include "slang_assemble.h"
#include "slang_execute.h"
-int _slang_fetch_discard (struct gl2_program_intf **pro, GLboolean *val)
+int
+_slang_fetch_discard(struct gl2_program_intf **pro, GLboolean * val)
{
- struct gl2_program_impl *impl;
+ struct gl2_program_impl *impl;
- impl = (struct gl2_program_impl *) pro;
- *val = impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->kill ? GL_TRUE : GL_FALSE;
- return 1;
+ impl = (struct gl2_program_impl *) pro;
+ *val =
+ impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->
+ kill ? GL_TRUE : GL_FALSE;
+ return 1;
}
-static GLvoid exec_shader (struct gl2_program_intf **pro, GLuint i)
+static GLvoid
+exec_shader(struct gl2_program_intf **pro, GLuint i)
{
- struct gl2_program_impl *impl;
- slang_program *p;
+ struct gl2_program_impl *impl;
+ slang_program *p;
- impl = (struct gl2_program_impl *) pro;
- p = &impl->_obj.prog;
+ impl = (struct gl2_program_impl *) pro;
+ p = &impl->_obj.prog;
- slang_machine_init (p->machines[i]);
- p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];
+ slang_machine_init(p->machines[i]);
+ p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];
- _slang_execute2 (p->assemblies[i], p->machines[i]);
+ _slang_execute2(p->assemblies[i], p->machines[i]);
}
-GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro)
+GLvoid
+_slang_exec_fragment_shader(struct gl2_program_intf **pro)
{
- exec_shader (pro, SLANG_SHADER_FRAGMENT);
+ exec_shader(pro, SLANG_SHADER_FRAGMENT);
}
-GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro)
+GLvoid
+_slang_exec_vertex_shader(struct gl2_program_intf **pro)
{
- exec_shader (pro, SLANG_SHADER_VERTEX);
+ exec_shader(pro, SLANG_SHADER_VERTEX);
}
#endif
void
-_mesa_init_shaderobjects_3dlabs (GLcontext *ctx)
+_mesa_init_shaderobjects_3dlabs(GLcontext * ctx)
{
#if USE_3DLABS_FRONTEND
- _glslang_3dlabs_InitProcess ();
- _glslang_3dlabs_ShInitialize ();
+ _glslang_3dlabs_InitProcess();
+ _glslang_3dlabs_ShInitialize();
#endif
}
-
diff --git a/src/mesa/shader/slang/slang_assemble.c b/src/mesa/shader/slang/slang_assemble.c
index 36fb2305f68..0cba5d5d007 100644
--- a/src/mesa/shader/slang/slang_assemble.c
+++ b/src/mesa/shader/slang/slang_assemble.c
@@ -35,13 +35,15 @@
/* slang_assembly */
-static GLboolean slang_assembly_construct (slang_assembly *assem)
+static GLboolean
+slang_assembly_construct(slang_assembly * assem)
{
- assem->type = slang_asm_none;
- return GL_TRUE;
+ assem->type = slang_asm_none;
+ return GL_TRUE;
}
-static GLvoid slang_assembly_destruct (slang_assembly *assem)
+static GLvoid
+slang_assembly_destruct(slang_assembly * assem)
{
}
@@ -50,80 +52,89 @@ static GLvoid slang_assembly_destruct (slang_assembly *assem)
*/
GLvoid
-_slang_assembly_file_ctr (slang_assembly_file *self)
+_slang_assembly_file_ctr(slang_assembly_file * self)
{
self->code = NULL;
self->count = 0;
self->capacity = 0;
}
-GLvoid slang_assembly_file_destruct (slang_assembly_file *file)
+GLvoid
+slang_assembly_file_destruct(slang_assembly_file * file)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < file->count; i++)
- slang_assembly_destruct (&file->code[i]);
- slang_alloc_free (file->code);
+ for (i = 0; i < file->count; i++)
+ slang_assembly_destruct(&file->code[i]);
+ slang_alloc_free(file->code);
}
-static GLboolean push_new (slang_assembly_file *file)
+static GLboolean
+push_new(slang_assembly_file * file)
{
- if (file->count == file->capacity)
- {
- GLuint n;
-
- if (file->capacity == 0)
- n = 256;
- else
- n = file->capacity * 2;
- file->code = (slang_assembly *) slang_alloc_realloc (file->code,
- file->capacity * sizeof (slang_assembly), n * sizeof (slang_assembly));
- if (file->code == NULL)
- return GL_FALSE;
- file->capacity = n;
- }
- if (!slang_assembly_construct (&file->code[file->count]))
- return GL_FALSE;
- file->count++;
- return GL_TRUE;
+ if (file->count == file->capacity) {
+ GLuint n;
+
+ if (file->capacity == 0)
+ n = 256;
+ else
+ n = file->capacity * 2;
+ file->code = (slang_assembly *)
+ slang_alloc_realloc(file->code,
+ file->capacity * sizeof(slang_assembly),
+ n * sizeof(slang_assembly));
+ if (file->code == NULL)
+ return GL_FALSE;
+ file->capacity = n;
+ }
+ if (!slang_assembly_construct(&file->code[file->count]))
+ return GL_FALSE;
+ file->count++;
+ return GL_TRUE;
}
-static GLboolean push_gen (slang_assembly_file *file, slang_assembly_type type, GLfloat literal,
- GLuint label, GLuint size)
+static GLboolean
+push_gen(slang_assembly_file * file, slang_assembly_type type,
+ GLfloat literal, GLuint label, GLuint size)
{
- slang_assembly *assem;
-
- if (!push_new (file))
- return GL_FALSE;
- assem = &file->code[file->count - 1];
- assem->type = type;
- assem->literal = literal;
- assem->param[0] = label;
- assem->param[1] = size;
- return GL_TRUE;
+ slang_assembly *assem;
+
+ if (!push_new(file))
+ return GL_FALSE;
+ assem = &file->code[file->count - 1];
+ assem->type = type;
+ assem->literal = literal;
+ assem->param[0] = label;
+ assem->param[1] = size;
+ return GL_TRUE;
}
-GLboolean slang_assembly_file_push (slang_assembly_file *file, slang_assembly_type type)
+GLboolean
+slang_assembly_file_push(slang_assembly_file * file, slang_assembly_type type)
{
- return push_gen (file, type, (GLfloat) 0, 0, 0);
+ return push_gen(file, type, (GLfloat) 0, 0, 0);
}
-GLboolean slang_assembly_file_push_label (slang_assembly_file *file, slang_assembly_type type,
- GLuint label)
+GLboolean
+slang_assembly_file_push_label(slang_assembly_file * file,
+ slang_assembly_type type, GLuint label)
{
- return push_gen (file, type, (GLfloat) 0, label, 0);
+ return push_gen(file, type, (GLfloat) 0, label, 0);
}
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *file, slang_assembly_type type,
- GLuint label1, GLuint label2)
+GLboolean
+slang_assembly_file_push_label2(slang_assembly_file * file,
+ slang_assembly_type type, GLuint label1,
+ GLuint label2)
{
- return push_gen (file, type, (GLfloat) 0, label1, label2);
+ return push_gen(file, type, (GLfloat) 0, label1, label2);
}
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_assembly_type type,
- GLfloat literal)
+GLboolean
+slang_assembly_file_push_literal(slang_assembly_file * file,
+ slang_assembly_type type, GLfloat literal)
{
- return push_gen (file, type, literal, 0, 0);
+ return push_gen(file, type, literal, 0, 0);
}
#define PUSH slang_assembly_file_push
@@ -133,284 +144,296 @@ GLboolean slang_assembly_file_push_literal (slang_assembly_file *file, slang_ass
/* slang_assembly_file_restore_point */
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *file,
- slang_assembly_file_restore_point *point)
+GLboolean
+slang_assembly_file_restore_point_save(slang_assembly_file * file,
+ slang_assembly_file_restore_point *
+ point)
{
- point->count = file->count;
- return GL_TRUE;
+ point->count = file->count;
+ return GL_TRUE;
}
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *file,
- slang_assembly_file_restore_point *point)
+GLboolean
+slang_assembly_file_restore_point_load(slang_assembly_file * file,
+ slang_assembly_file_restore_point *
+ point)
{
- GLuint i;
+ GLuint i;
- for (i = point->count; i < file->count; i++)
- slang_assembly_destruct (&file->code[i]);
- file->count = point->count;
- return GL_TRUE;
+ for (i = point->count; i < file->count; i++)
+ slang_assembly_destruct(&file->code[i]);
+ file->count = point->count;
+ return GL_TRUE;
}
/* utility functions */
-static GLboolean sizeof_variable (slang_assemble_ctx *A, slang_type_specifier *spec,
- slang_type_qualifier qual, GLuint array_len, GLuint *size)
+static GLboolean
+sizeof_variable(slang_assemble_ctx * A, slang_type_specifier * spec,
+ slang_type_qualifier qual, GLuint array_len, GLuint * size)
{
- slang_storage_aggregate agg;
-
- /* calculate the size of the variable's aggregate */
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, spec, array_len, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- *size += _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
-
- /* for reference variables consider the additional address overhead */
- if (qual == slang_qual_out || qual == slang_qual_inout)
- *size += 4;
-
- return GL_TRUE;
+ slang_storage_aggregate agg;
+
+ /* calculate the size of the variable's aggregate */
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable
+ (&agg, spec, array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ *size += _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
+
+ /* for reference variables consider the additional address overhead */
+ if (qual == slang_qual_out || qual == slang_qual_inout)
+ *size += 4;
+
+ return GL_TRUE;
}
-static GLboolean sizeof_variable2 (slang_assemble_ctx *A, slang_variable *var, GLuint *size)
+static GLboolean
+sizeof_variable2(slang_assemble_ctx * A, slang_variable * var, GLuint * size)
{
- var->address = *size;
- if (var->type.qualifier == slang_qual_out || var->type.qualifier == slang_qual_inout)
- var->address += 4;
- return sizeof_variable (A, &var->type.specifier, var->type.qualifier, var->array_len, size);
+ var->address = *size;
+ if (var->type.qualifier == slang_qual_out
+ || var->type.qualifier == slang_qual_inout)
+ var->address += 4;
+ return sizeof_variable(A, &var->type.specifier, var->type.qualifier,
+ var->array_len, size);
}
-static GLboolean sizeof_variables (slang_assemble_ctx *A, slang_variable_scope *vars, GLuint start,
- GLuint stop, GLuint *size)
+static GLboolean
+sizeof_variables(slang_assemble_ctx * A, slang_variable_scope * vars,
+ GLuint start, GLuint stop, GLuint * size)
{
- GLuint i;
+ GLuint i;
- for (i = start; i < stop; i++)
- if (!sizeof_variable2 (A, &vars->variables[i], size))
- return GL_FALSE;
- return GL_TRUE;
+ for (i = start; i < stop; i++)
+ if (!sizeof_variable2(A, &vars->variables[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
-static GLboolean collect_locals (slang_assemble_ctx *A, slang_operation *op, GLuint *size)
+static GLboolean
+collect_locals(slang_assemble_ctx * A, slang_operation * op, GLuint * size)
{
- GLuint i;
-
- if (!sizeof_variables (A, op->locals, 0, op->locals->num_variables, size))
- return GL_FALSE;
- for (i = 0; i < op->num_children; i++)
- if (!collect_locals (A, &op->children[i], size))
- return GL_FALSE;
- return GL_TRUE;
+ GLuint i;
+
+ if (!sizeof_variables(A, op->locals, 0, op->locals->num_variables, size))
+ return GL_FALSE;
+ for (i = 0; i < op->num_children; i++)
+ if (!collect_locals(A, &op->children[i], size))
+ return GL_FALSE;
+ return GL_TRUE;
}
/* _slang_locate_function() */
-slang_function *_slang_locate_function (slang_function_scope *funcs, slang_atom a_name,
- slang_operation *params, GLuint num_params, slang_assembly_name_space *space,
- slang_atom_pool *atoms)
+slang_function *
+_slang_locate_function(const slang_function_scope * funcs, slang_atom a_name,
+ const slang_operation * params, GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_atom_pool * atoms)
{
- GLuint i;
-
- for (i = 0; i < funcs->num_functions; i++)
- {
- GLuint j;
- slang_function *f = &funcs->functions[i];
-
- if (a_name != f->header.a_name)
- continue;
- if (f->param_count != num_params)
- continue;
- for (j = 0; j < num_params; j++)
- {
- slang_assembly_typeinfo ti;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return NULL;
- if (!_slang_typeof_operation_ (&params[j], space, &ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return NULL;
- }
- if (!slang_type_specifier_equal (&ti.spec, &f->parameters->variables[j].type.specifier))
- {
- slang_assembly_typeinfo_destruct (&ti);
- break;
- }
- slang_assembly_typeinfo_destruct (&ti);
-
- /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
- if (!ti.can_be_referenced &&
- (f->parameters->variables[j].type.qualifier == slang_qual_out ||
- f->parameters->variables[j].type.qualifier == slang_qual_inout))
- break;
- }
- if (j == num_params)
- return f;
- }
- if (funcs->outer_scope != NULL)
- return _slang_locate_function (funcs->outer_scope, a_name, params, num_params, space, atoms);
- return NULL;
+ GLuint i;
+
+ for (i = 0; i < funcs->num_functions; i++) {
+ GLuint j;
+ slang_function *f = &funcs->functions[i];
+
+ if (a_name != f->header.a_name)
+ continue;
+ if (f->param_count != num_params)
+ continue;
+ for (j = 0; j < num_params; j++) {
+ slang_assembly_typeinfo ti;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return NULL;
+ if (!_slang_typeof_operation_(&params[j], space, &ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return NULL;
+ }
+ if (!slang_type_specifier_equal
+ (&ti.spec, &f->parameters->variables[j].type.specifier)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ break;
+ }
+ slang_assembly_typeinfo_destruct(&ti);
+
+ /* "out" and "inout" formal parameter requires the actual parameter to be l-value */
+ if (!ti.can_be_referenced &&
+ (f->parameters->variables[j].type.qualifier == slang_qual_out ||
+ f->parameters->variables[j].type.qualifier == slang_qual_inout))
+ break;
+ }
+ if (j == num_params)
+ return f;
+ }
+ if (funcs->outer_scope != NULL)
+ return _slang_locate_function(funcs->outer_scope, a_name, params,
+ num_params, space, atoms);
+ return NULL;
}
/* _slang_assemble_function() */
-GLboolean _slang_assemble_function (slang_assemble_ctx *A, slang_function *fun)
+GLboolean
+_slang_assemble_function(slang_assemble_ctx * A, slang_function * fun)
{
- GLuint param_size, local_size;
- GLuint skip, cleanup;
-
- fun->address = A->file->count;
-
- if (fun->body == NULL)
- {
- /* jump to the actual function body - we do not know it, so add the instruction
- * to fixup table */
- fun->fixups.table = (GLuint *) slang_alloc_realloc (fun->fixups.table,
- fun->fixups.count * sizeof (GLuint), (fun->fixups.count + 1) * sizeof (GLuint));
- if (fun->fixups.table == NULL)
- return GL_FALSE;
- fun->fixups.table[fun->fixups.count] = fun->address;
- fun->fixups.count++;
- if (!PUSH (A->file, slang_asm_jump))
- return GL_FALSE;
- return GL_TRUE;
- }
- else
- {
- GLuint i;
-
- /* resolve all fixup table entries and delete it */
- for (i = 0; i < fun->fixups.count; i++)
- A->file->code[fun->fixups.table[i]].param[0] = fun->address;
- slang_fixup_table_free (&fun->fixups);
- }
-
- /* At this point traverse function formal parameters and code to calculate
- * total memory size to be allocated on the stack.
- * During this process the variables will be assigned local addresses to
- * reference them in the code.
- * No storage optimizations are performed so exclusive scopes are not detected and shared. */
-
- /* calculate return value size */
- param_size = 0;
- if (fun->header.type.specifier.type != slang_spec_void)
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &param_size))
- return GL_FALSE;
- A->local.ret_size = param_size;
-
- /* calculate formal parameter list size */
- if (!sizeof_variables (A, fun->parameters, 0, fun->param_count, &param_size))
- return GL_FALSE;
-
- /* calculate local variables size - take into account the four-byte return address and
- * temporaries for various tasks (4 for addr and 16 for swizzle temporaries).
- * these include variables from the formal parameter scope and from the code */
- A->local.addr_tmp = param_size + 4;
- A->local.swizzle_tmp = param_size + 4 + 4;
- local_size = param_size + 4 + 4 + 16;
- if (!sizeof_variables (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
- &local_size))
- return GL_FALSE;
- if (!collect_locals (A, fun->body, &local_size))
- return GL_FALSE;
-
- /* allocate local variable storage */
- if (!PLAB (A->file, slang_asm_local_alloc, local_size - param_size - 4))
- return GL_FALSE;
-
- /* mark a new frame for function variable storage */
- if (!PLAB (A->file, slang_asm_enter, local_size))
- return GL_FALSE;
-
- /* jump directly to the actual code */
- skip = A->file->count;
- if (!push_new (A->file))
- return GL_FALSE;
- A->file->code[skip].type = slang_asm_jump;
-
- /* all "return" statements will be directed here */
- A->flow.function_end = A->file->count;
- cleanup = A->file->count;
- if (!push_new (A->file))
- return GL_FALSE;
- A->file->code[cleanup].type = slang_asm_jump;
-
- /* execute the function body */
- A->file->code[skip].param[0] = A->file->count;
- if (!_slang_assemble_operation (A, fun->body, /*slang_ref_freelance*/slang_ref_forbid))
- return GL_FALSE;
-
- /* this is the end of the function - restore the old function frame */
- A->file->code[cleanup].param[0] = A->file->count;
- if (!PUSH (A->file, slang_asm_leave))
- return GL_FALSE;
-
- /* free local variable storage */
- if (!PLAB (A->file, slang_asm_local_free, local_size - param_size - 4))
- return GL_FALSE;
-
- /* return from the function */
- if (!PUSH (A->file, slang_asm_return))
- return GL_FALSE;
-
- return GL_TRUE;
+ GLuint param_size, local_size;
+ GLuint skip, cleanup;
+
+ fun->address = A->file->count;
+
+ if (fun->body == NULL) {
+ /* jump to the actual function body - we do not know it, so add
+ * the instruction to fixup table
+ */
+ if (!slang_fixup_save(&fun->fixups, fun->address))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_jump))
+ return GL_FALSE;
+ return GL_TRUE;
+ }
+ else {
+ /* resolve all fixup table entries and delete it */
+ GLuint i;
+ for (i = 0; i < fun->fixups.count; i++)
+ A->file->code[fun->fixups.table[i]].param[0] = fun->address;
+ slang_fixup_table_free(&fun->fixups);
+ }
+
+ /* At this point traverse function formal parameters and code to calculate
+ * total memory size to be allocated on the stack.
+ * During this process the variables will be assigned local addresses to
+ * reference them in the code.
+ * No storage optimizations are performed so exclusive scopes are not
+ * detected and shared.
+ */
+
+ /* calculate return value size */
+ param_size = 0;
+ if (fun->header.type.specifier.type != slang_spec_void)
+ if (!sizeof_variable
+ (A, &fun->header.type.specifier, slang_qual_none, 0, &param_size))
+ return GL_FALSE;
+ A->local.ret_size = param_size;
+
+ /* calculate formal parameter list size */
+ if (!sizeof_variables
+ (A, fun->parameters, 0, fun->param_count, &param_size))
+ return GL_FALSE;
+
+ /* calculate local variables size - take into account the four-byte
+ * return address and temporaries for various tasks (4 for addr and
+ * 16 for swizzle temporaries). these include variables from the
+ * formal parameter scope and from the code
+ */
+ A->local.addr_tmp = param_size + 4;
+ A->local.swizzle_tmp = param_size + 4 + 4;
+ local_size = param_size + 4 + 4 + 16;
+ if (!sizeof_variables
+ (A, fun->parameters, fun->param_count, fun->parameters->num_variables,
+ &local_size))
+ return GL_FALSE;
+ if (!collect_locals(A, fun->body, &local_size))
+ return GL_FALSE;
+
+ /* allocate local variable storage */
+ if (!PLAB(A->file, slang_asm_local_alloc, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* mark a new frame for function variable storage */
+ if (!PLAB(A->file, slang_asm_enter, local_size))
+ return GL_FALSE;
+
+ /* jump directly to the actual code */
+ skip = A->file->count;
+ if (!push_new(A->file))
+ return GL_FALSE;
+ A->file->code[skip].type = slang_asm_jump;
+
+ /* all "return" statements will be directed here */
+ A->flow.function_end = A->file->count;
+ cleanup = A->file->count;
+ if (!push_new(A->file))
+ return GL_FALSE;
+ A->file->code[cleanup].type = slang_asm_jump;
+
+ /* execute the function body */
+ A->file->code[skip].param[0] = A->file->count;
+ if (!_slang_assemble_operation
+ (A, fun->body, /*slang_ref_freelance */ slang_ref_forbid))
+ return GL_FALSE;
+
+ /* this is the end of the function - restore the old function frame */
+ A->file->code[cleanup].param[0] = A->file->count;
+ if (!PUSH(A->file, slang_asm_leave))
+ return GL_FALSE;
+
+ /* free local variable storage */
+ if (!PLAB(A->file, slang_asm_local_free, local_size - param_size - 4))
+ return GL_FALSE;
+
+ /* return from the function */
+ if (!PUSH(A->file, slang_asm_return))
+ return GL_FALSE;
+
+ return GL_TRUE;
}
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *A, slang_operation *op)
+GLboolean
+_slang_cleanup_stack(slang_assemble_ctx * A, slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLuint size = 0;
-
- /* get type info of the operation and calculate its size */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return GL_FALSE;
- }
- if (ti.spec.type != slang_spec_void) {
- if (A->ref == slang_ref_force) {
- size = 4;
- }
- else if (!sizeof_variable (A, &ti.spec, slang_qual_none, 0, &size))
- {
- slang_assembly_typeinfo_destruct (&ti);
- return GL_FALSE;
- }
- }
- slang_assembly_typeinfo_destruct (&ti);
-
- /* if nonzero, free it from the stack */
- if (size != 0)
- {
- if (!PLAB (A->file, slang_asm_local_free, size))
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ slang_assembly_typeinfo ti;
+ GLuint size = 0;
+
+ /* get type info of the operation and calculate its size */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return GL_FALSE;
+ }
+ if (ti.spec.type != slang_spec_void) {
+ if (A->ref == slang_ref_force) {
+ size = 4;
+ }
+ else if (!sizeof_variable(A, &ti.spec, slang_qual_none, 0, &size)) {
+ slang_assembly_typeinfo_destruct(&ti);
+ return GL_FALSE;
+ }
+ }
+ slang_assembly_typeinfo_destruct(&ti);
+
+ /* if nonzero, free it from the stack */
+ if (size != 0) {
+ if (!PLAB(A->file, slang_asm_local_free, size))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
/* _slang_assemble_operation() */
static GLboolean
-dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size, slang_swizzle *swz,
- GLboolean is_swizzled)
+dereference_basic(slang_assemble_ctx * A, slang_storage_type type,
+ GLuint * size, slang_swizzle * swz, GLboolean is_swizzled)
{
GLuint src_offset;
slang_assembly_type ty;
- *size -= _slang_sizeof_type (type);
+ *size -= _slang_sizeof_type(type);
- /* If swizzling is taking place, we are forced to use scalar operations, even if we have
- * vec4 instructions enabled (this should be actually done with special vec4 shuffle
- * instructions).
- * Adjust the size and calculate the offset within source variable to read.
+ /* If swizzling is taking place, we are forced to use scalar
+ * operations, even if we have vec4 instructions enabled (this
+ * should be actually done with special vec4 shuffle instructions).
+ * Adjust the size and calculate the offset within source variable
+ * to read.
*/
if (is_swizzled)
src_offset = swz->swizzle[*size / 4] * 4;
@@ -418,14 +441,14 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size,
src_offset = *size;
/* dereference data slot of a basic type */
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
+ if (!PUSH(A->file, slang_asm_addr_deref))
return GL_FALSE;
if (src_offset != 0) {
- if (!PLAB (A->file, slang_asm_addr_push, src_offset))
+ if (!PLAB(A->file, slang_asm_addr_push, src_offset))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
+ if (!PUSH(A->file, slang_asm_addr_add))
return GL_FALSE;
}
@@ -449,12 +472,13 @@ dereference_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *size,
ty = slang_asm_none;
}
- return PUSH (A->file, ty);
+ return PUSH(A->file, ty);
}
static GLboolean
-dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *size,
- slang_swizzle *swz, GLboolean is_swizzled)
+dereference_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * agg, GLuint * size,
+ slang_swizzle * swz, GLboolean is_swizzled)
{
GLuint i;
@@ -464,22 +488,27 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg
for (j = arr->length; j > 0; j--) {
if (arr->type == slang_stor_aggregate) {
- if (!dereference_aggregate (A, arr->aggregate, size, swz, is_swizzled))
+ if (!dereference_aggregate
+ (A, arr->aggregate, size, swz, is_swizzled))
return GL_FALSE;
}
else {
if (is_swizzled && arr->type == slang_stor_vec4) {
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
- if (!dereference_basic (A, slang_stor_float, size, swz, is_swizzled))
+ if (!dereference_basic
+ (A, slang_stor_float, size, swz, is_swizzled))
return GL_FALSE;
}
else {
- if (!dereference_basic (A, arr->type, size, swz, is_swizzled))
+ if (!dereference_basic(A, arr->type, size, swz, is_swizzled))
return GL_FALSE;
}
}
@@ -489,235 +518,240 @@ dereference_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg
return GL_TRUE;
}
-GLboolean _slang_dereference (slang_assemble_ctx *A, slang_operation *op)
+GLboolean
+_slang_dereference(slang_assemble_ctx * A, slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint size;
-
- /* get type information of the given operation */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* construct aggregate from the type info */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- /* dereference the resulting aggregate */
- size = _slang_sizeof_aggregate (&agg);
- result = dereference_aggregate (A, &agg, &size, &ti.swz, ti.is_swizzled);
-
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ /* get type information of the given operation */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* construct aggregate from the type info */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable
+ (&agg, &ti.spec, ti.array_len, A->space.funcs, A->space.structs,
+ A->space.vars, A->mach, A->file, A->atoms))
+ goto end;
+
+ /* dereference the resulting aggregate */
+ size = _slang_sizeof_aggregate(&agg);
+ result = dereference_aggregate(A, &agg, &size, &ti.swz, ti.is_swizzled);
+
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *A, slang_function *fun,
- slang_operation *params, GLuint param_count, GLboolean assignment)
+GLboolean
+_slang_assemble_function_call(slang_assemble_ctx * A, slang_function * fun,
+ slang_operation * params, GLuint param_count,
+ GLboolean assignment)
{
- GLuint i;
- slang_swizzle p_swz[64];
- slang_ref_type p_ref[64];
-
- /* TODO: fix this, allocate dynamically */
- if (param_count > 64)
- return GL_FALSE;
-
- /* make room for the return value, if any */
- if (fun->header.type.specifier.type != slang_spec_void)
- {
- GLuint ret_size = 0;
-
- if (!sizeof_variable (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_alloc, ret_size))
- return GL_FALSE;
- }
-
- /* push the actual parameters on the stack */
- for (i = 0; i < param_count; i++)
- {
- if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
- fun->parameters->variables[i].type.qualifier == slang_qual_out)
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- /* TODO: optimize the "out" parameter case */
- if (!_slang_assemble_operation (A, &params[i], slang_ref_force))
- return GL_FALSE;
- p_swz[i] = A->swz;
- p_ref[i] = A->ref;
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- if (i == 0 && assignment)
- {
- /* duplicate the resulting address */
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- }
- if (!_slang_dereference (A, &params[i]))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_operation (A, &params[i], slang_ref_forbid))
- return GL_FALSE;
- p_swz[i] = A->swz;
- p_ref[i] = A->ref;
- }
- }
-
- /* call the function */
- if (!PLAB (A->file, slang_asm_call, fun->address))
- return GL_FALSE;
-
- /* pop the parameters from the stack */
- for (i = param_count; i > 0; i--)
- {
- GLuint j = i - 1;
-
- A->swz = p_swz[j];
- A->ref = p_ref[j];
- if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
- fun->parameters->variables[j].type.qualifier == slang_qual_out)
- {
- /* for output parameter copy the contents of the formal parameter
- * back to the original actual parameter */
- if (!_slang_assemble_assignment (A, &params[j]))
- return GL_FALSE;
- /* pop the actual parameter's address */
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
- else
- {
- /* pop the value of the parameter */
- if (!_slang_cleanup_stack (A, &params[j]))
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
+ GLuint i;
+ slang_swizzle p_swz[64];
+ slang_ref_type p_ref[64];
+
+ /* TODO: fix this, allocate dynamically */
+ if (param_count > 64)
+ return GL_FALSE;
+
+ /* make room for the return value, if any */
+ if (fun->header.type.specifier.type != slang_spec_void) {
+ GLuint ret_size = 0;
+
+ if (!sizeof_variable
+ (A, &fun->header.type.specifier, slang_qual_none, 0, &ret_size))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_alloc, ret_size))
+ return GL_FALSE;
+ }
+
+ /* push the actual parameters on the stack */
+ for (i = 0; i < param_count; i++) {
+ if (fun->parameters->variables[i].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[i].type.qualifier == slang_qual_out) {
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ /* TODO: optimize the "out" parameter case */
+ if (!_slang_assemble_operation(A, &params[i], slang_ref_force))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ if (i == 0 && assignment) {
+ /* duplicate the resulting address */
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ if (!_slang_dereference(A, &params[i]))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_operation(A, &params[i], slang_ref_forbid))
+ return GL_FALSE;
+ p_swz[i] = A->swz;
+ p_ref[i] = A->ref;
+ }
+ }
+
+ /* call the function */
+ if (!PLAB(A->file, slang_asm_call, fun->address))
+ return GL_FALSE;
+
+ /* pop the parameters from the stack */
+ for (i = param_count; i > 0; i--) {
+ GLuint j = i - 1;
+
+ A->swz = p_swz[j];
+ A->ref = p_ref[j];
+ if (fun->parameters->variables[j].type.qualifier == slang_qual_inout ||
+ fun->parameters->variables[j].type.qualifier == slang_qual_out) {
+ /* for output parameter copy the contents of the formal parameter
+ * back to the original actual parameter
+ */
+ if (!_slang_assemble_assignment(A, &params[j]))
+ return GL_FALSE;
+ /* pop the actual parameter's address */
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ else {
+ /* pop the value of the parameter */
+ if (!_slang_cleanup_stack(A, &params[j]))
+ return GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
}
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *A, const char *name,
- slang_operation *params, GLuint param_count, GLboolean assignment)
+GLboolean
+_slang_assemble_function_call_name(slang_assemble_ctx * A, const char *name,
+ slang_operation * params,
+ GLuint param_count, GLboolean assignment)
{
- slang_atom atom;
- slang_function *fun;
-
- atom = slang_atom_pool_atom (A->atoms, name);
- if (atom == SLANG_ATOM_NULL)
- return GL_FALSE;
- fun = _slang_locate_function (A->space.funcs, atom, params, param_count, &A->space, A->atoms);
- if (fun == NULL)
- return GL_FALSE;
- return _slang_assemble_function_call (A, fun, params, param_count, assignment);
+ slang_atom atom;
+ slang_function *fun;
+
+ atom = slang_atom_pool_atom(A->atoms, name);
+ if (atom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+ fun =
+ _slang_locate_function(A->space.funcs, atom, params, param_count,
+ &A->space, A->atoms);
+ if (fun == NULL)
+ return GL_FALSE;
+ return _slang_assemble_function_call(A, fun, params, param_count,
+ assignment);
}
-static GLboolean assemble_function_call_name_dummyint (slang_assemble_ctx *A, const char *name,
- slang_operation *params)
+static GLboolean
+assemble_function_call_name_dummyint(slang_assemble_ctx * A, const char *name,
+ slang_operation * params)
{
- slang_operation p[2];
- GLboolean result;
-
- p[0] = params[0];
- if (!slang_operation_construct (&p[1]))
- return GL_FALSE;
- p[1].type = slang_oper_literal_int;
- result = _slang_assemble_function_call_name (A, name, p, 2, GL_FALSE);
- slang_operation_destruct (&p[1]);
- return result;
+ slang_operation p[2];
+ GLboolean result;
+
+ p[0] = params[0];
+ if (!slang_operation_construct(&p[1]))
+ return GL_FALSE;
+ p[1].type = slang_oper_literal_int;
+ result = _slang_assemble_function_call_name(A, name, p, 2, GL_FALSE);
+ slang_operation_destruct(&p[1]);
+ return result;
}
static const struct
{
- const char *name;
- slang_assembly_type code1, code2;
+ const char *name;
+ slang_assembly_type code1, code2;
} inst[] = {
- /* core */
- { "float_add", slang_asm_float_add, slang_asm_float_copy },
- { "float_multiply", slang_asm_float_multiply, slang_asm_float_copy },
- { "float_divide", slang_asm_float_divide, slang_asm_float_copy },
- { "float_negate", slang_asm_float_negate, slang_asm_float_copy },
- { "float_less", slang_asm_float_less, slang_asm_bool_copy },
- { "float_equal", slang_asm_float_equal_exp,slang_asm_bool_copy },
- { "float_to_int", slang_asm_float_to_int, slang_asm_int_copy },
- { "float_sine", slang_asm_float_sine, slang_asm_float_copy },
- { "float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy },
- { "float_arctan", slang_asm_float_arctan, slang_asm_float_copy },
- { "float_power", slang_asm_float_power, slang_asm_float_copy },
- { "float_log2", slang_asm_float_log2, slang_asm_float_copy },
- { "float_floor", slang_asm_float_floor, slang_asm_float_copy },
- { "float_ceil", slang_asm_float_ceil, slang_asm_float_copy },
- { "float_noise1", slang_asm_float_noise1, slang_asm_float_copy },
- { "float_noise2", slang_asm_float_noise2, slang_asm_float_copy },
- { "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },
- { "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },
- { "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },
- { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },
- { "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },
- { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },
- { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },
- { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },
- { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },
- /* GL_MESA_shader_debug */
- { "float_print", slang_asm_float_deref, slang_asm_float_print },
- { "int_print", slang_asm_int_deref, slang_asm_int_print },
- { "bool_print", slang_asm_bool_deref, slang_asm_bool_print },
+ /* core */
+ {"float_add", slang_asm_float_add, slang_asm_float_copy},
+ {"float_multiply", slang_asm_float_multiply, slang_asm_float_copy},
+ {"float_divide", slang_asm_float_divide, slang_asm_float_copy},
+ {"float_negate", slang_asm_float_negate, slang_asm_float_copy},
+ {"float_less", slang_asm_float_less, slang_asm_bool_copy},
+ {"float_equal", slang_asm_float_equal_exp, slang_asm_bool_copy},
+ {"float_to_int", slang_asm_float_to_int, slang_asm_int_copy},
+ {"float_sine", slang_asm_float_sine, slang_asm_float_copy},
+ {"float_arcsine", slang_asm_float_arcsine, slang_asm_float_copy},
+ {"float_arctan", slang_asm_float_arctan, slang_asm_float_copy},
+ {"float_power", slang_asm_float_power, slang_asm_float_copy},
+ {"float_log2", slang_asm_float_log2, slang_asm_float_copy},
+ {"float_floor", slang_asm_float_floor, slang_asm_float_copy},
+ {"float_ceil", slang_asm_float_ceil, slang_asm_float_copy},
+ {"float_noise1", slang_asm_float_noise1, slang_asm_float_copy},
+ {"float_noise2", slang_asm_float_noise2, slang_asm_float_copy},
+ {"float_noise3", slang_asm_float_noise3, slang_asm_float_copy},
+ {"float_noise4", slang_asm_float_noise4, slang_asm_float_copy},
+ {"int_to_float", slang_asm_int_to_float, slang_asm_float_copy},
+ {"vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none},
+ {"vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none},
+ {"vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none},
+ {"vec4_texcube", slang_asm_vec4_texcube, slang_asm_none},
+ {"vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none},
+ {"vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none},
+ /* GL_MESA_shader_debug */
+ {"float_print", slang_asm_float_deref, slang_asm_float_print},
+ {"int_print", slang_asm_int_deref, slang_asm_int_print},
+ {"bool_print", slang_asm_bool_deref, slang_asm_bool_print},
/* vec4 */
- { "float_to_vec4", slang_asm_float_to_vec4, slang_asm_none },
- { "vec4_add", slang_asm_vec4_add, slang_asm_none },
- { "vec4_subtract", slang_asm_vec4_subtract, slang_asm_none },
- { "vec4_multiply", slang_asm_vec4_multiply, slang_asm_none },
- { "vec4_divide", slang_asm_vec4_divide, slang_asm_none },
- { "vec4_negate", slang_asm_vec4_negate, slang_asm_none },
- { "vec4_dot", slang_asm_vec4_dot, slang_asm_none },
-
- { NULL, slang_asm_none, slang_asm_none }
+ {"float_to_vec4", slang_asm_float_to_vec4, slang_asm_none},
+ {"vec4_add", slang_asm_vec4_add, slang_asm_none},
+ {"vec4_subtract", slang_asm_vec4_subtract, slang_asm_none},
+ {"vec4_multiply", slang_asm_vec4_multiply, slang_asm_none},
+ {"vec4_divide", slang_asm_vec4_divide, slang_asm_none},
+ {"vec4_negate", slang_asm_vec4_negate, slang_asm_none},
+ {"vec4_dot", slang_asm_vec4_dot, slang_asm_none},
+ {NULL, slang_asm_none, slang_asm_none}
};
-static GLboolean call_asm_instruction (slang_assemble_ctx *A, slang_atom a_name)
+static GLboolean
+call_asm_instruction(slang_assemble_ctx * A, slang_atom a_name)
{
- const char *id;
- GLuint i;
+ const char *id;
+ GLuint i;
- id = slang_atom_pool_id (A->atoms, a_name);
+ id = slang_atom_pool_id(A->atoms, a_name);
- for (i = 0; inst[i].name != NULL; i++)
- if (slang_string_compare (id, inst[i].name) == 0)
- break;
- if (inst[i].name == NULL)
- return GL_FALSE;
+ for (i = 0; inst[i].name != NULL; i++)
+ if (slang_string_compare(id, inst[i].name) == 0)
+ break;
+ if (inst[i].name == NULL)
+ return GL_FALSE;
- if (!PLAB2 (A->file, inst[i].code1, 4, 0))
- return GL_FALSE;
- if (inst[i].code2 != slang_asm_none)
- if (!PLAB2 (A->file, inst[i].code2, 4, 0))
- return GL_FALSE;
+ if (!PLAB2(A->file, inst[i].code1, 4, 0))
+ return GL_FALSE;
+ if (inst[i].code2 != slang_asm_none)
+ if (!PLAB2(A->file, inst[i].code2, 4, 0))
+ return GL_FALSE;
- /* clean-up the stack from the remaining dst address */
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
+ /* clean-up the stack from the remaining dst address */
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
- return GL_TRUE;
+ return GL_TRUE;
}
static GLboolean
-equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index,
- GLuint size, GLuint z_label)
+equality_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * agg, GLuint * index,
+ GLuint size, GLuint z_label)
{
GLuint i;
@@ -727,22 +761,25 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G
for (j = 0; j < arr->length; j++) {
if (arr->type == slang_stor_aggregate) {
- if (!equality_aggregate (A, arr->aggregate, index, size, z_label))
+ if (!equality_aggregate(A, arr->aggregate, index, size, z_label))
return GL_FALSE;
}
else {
#if defined(USE_X86_ASM) || defined(SLANG_X86)
if (arr->type == slang_stor_vec4) {
- if (!PLAB2 (A->file, slang_asm_vec4_equal_int, size + *index, *index))
+ if (!PLAB2
+ (A->file, slang_asm_vec4_equal_int, size + *index, *index))
return GL_FALSE;
}
else
#endif
- if (!PLAB2 (A->file, slang_asm_float_equal_int, size + *index, *index))
- return GL_FALSE;
+ if (!PLAB2
+ (A->file, slang_asm_float_equal_int, size + *index,
+ *index))
+ return GL_FALSE;
- *index += _slang_sizeof_type (arr->type);
- if (!PLAB (A->file, slang_asm_jump_if_zero, z_label))
+ *index += _slang_sizeof_type(arr->type);
+ if (!PLAB(A->file, slang_asm_jump_if_zero, z_label))
return GL_FALSE;
}
}
@@ -751,753 +788,755 @@ equality_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, G
return GL_TRUE;
}
-static GLboolean equality (slang_assemble_ctx *A, slang_operation *op, GLboolean equal)
+static GLboolean
+equality(slang_assemble_ctx * A, slang_operation * op, GLboolean equal)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint index, size;
- GLuint skip_jump, true_label, true_jump, false_label, false_jump;
-
- /* get type of operation */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* convert it to an aggregate */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- /* compute the size of the agregate - there are two such aggregates on the stack */
- size = _slang_sizeof_aggregate (&agg);
-
- /* jump to the actual data-comparison code */
- skip_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- /* pop off the stack the compared data and push 1 */
- true_label = A->file->count;
- if (!PLAB (A->file, slang_asm_local_free, size * 2))
- goto end;
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 1))
- goto end;
- true_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- false_label = A->file->count;
- if (!PLAB (A->file, slang_asm_local_free, size * 2))
- goto end;
- if (!PLIT (A->file, slang_asm_bool_push, (GLfloat) 0))
- goto end;
- false_jump = A->file->count;
- if (!PUSH (A->file, slang_asm_jump))
- goto end;
-
- A->file->code[skip_jump].param[0] = A->file->count;
-
- /* compare the data on stack, it will eventually jump either to true or false label */
- index = 0;
- if (!equality_aggregate (A, &agg, &index, size, equal ? false_label : true_label))
- goto end;
- if (!PLAB (A->file, slang_asm_jump, equal ? true_label : false_label))
- goto end;
-
- A->file->code[true_jump].param[0] = A->file->count;
- A->file->code[false_jump].param[0] = A->file->count;
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+ GLuint skip_jump, true_label, true_jump, false_label, false_jump;
+
+ /* get type of operation */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* convert it to an aggregate */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable
+ (&agg, &ti.spec, 0, A->space.funcs, A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end;
+
+ /* compute the size of the agregate - there are two such aggregates on the stack */
+ size = _slang_sizeof_aggregate(&agg);
+
+ /* jump to the actual data-comparison code */
+ skip_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ /* pop off the stack the compared data and push 1 */
+ true_label = A->file->count;
+ if (!PLAB(A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 1))
+ goto end;
+ true_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ false_label = A->file->count;
+ if (!PLAB(A->file, slang_asm_local_free, size * 2))
+ goto end;
+ if (!PLIT(A->file, slang_asm_bool_push, (GLfloat) 0))
+ goto end;
+ false_jump = A->file->count;
+ if (!PUSH(A->file, slang_asm_jump))
+ goto end;
+
+ A->file->code[skip_jump].param[0] = A->file->count;
+
+ /* compare the data on stack, it will eventually jump either to true or false label */
+ index = 0;
+ if (!equality_aggregate
+ (A, &agg, &index, size, equal ? false_label : true_label))
+ goto end;
+ if (!PLAB(A->file, slang_asm_jump, equal ? true_label : false_label))
+ goto end;
+
+ A->file->code[true_jump].param[0] = A->file->count;
+ A->file->code[false_jump].param[0] = A->file->count;
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-static GLboolean handle_subscript (slang_assemble_ctx *A, slang_assembly_typeinfo *tie,
- slang_assembly_typeinfo *tia, slang_operation *op, slang_ref_type ref)
+static GLboolean
+handle_subscript(slang_assemble_ctx * A, slang_assembly_typeinfo * tie,
+ slang_assembly_typeinfo * tia, slang_operation * op,
+ slang_ref_type ref)
{
- GLuint asize = 0, esize = 0;
-
- /* get type info of the master expression (matrix, vector or an array */
- if (!_slang_typeof_operation (A, &op->children[0], tia))
- return GL_FALSE;
- if (!sizeof_variable (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
- return GL_FALSE;
-
- /* get type info of the result (matrix column, vector row or array element) */
- if (!_slang_typeof_operation (A, op, tie))
- return GL_FALSE;
- if (!sizeof_variable (A, &tie->spec, slang_qual_none, 0, &esize))
- return GL_FALSE;
-
- /* assemble the master expression */
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
-
- /* when indexing an l-value swizzle, push the swizzle_tmp */
- if (ref == slang_ref_force && tia->is_swizzled)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
-
- /* assemble the subscript expression */
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
-
- if (ref == slang_ref_force && tia->is_swizzled)
- {
- GLuint i;
-
- /* copy the swizzle indexes to the swizzle_tmp */
- for (i = 0; i < tia->swz.num_components; i++)
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, i * 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
-
- /* offset the pushed swizzle_tmp address and dereference it */
- if (!PUSH (A->file, slang_asm_int_to_addr))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_addr_push, 4))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_multiply))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_deref))
- return GL_FALSE;
- }
- else
- {
- /* convert the integer subscript to a relative address */
- if (!PUSH (A->file, slang_asm_int_to_addr))
- return GL_FALSE;
- }
-
- if (!PLAB (A->file, slang_asm_addr_push, esize))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_multiply))
- return GL_FALSE;
-
- if (ref == slang_ref_force)
- {
- /* offset the base address with the relative address */
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- }
- else
- {
- GLuint i;
-
- /* move the selected element to the beginning of the master expression */
- for (i = 0; i < esize; i += 4)
- if (!PLAB2 (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
-
- /* free the rest of the master expression */
- if (!PLAB (A->file, slang_asm_local_free, asize - esize))
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ GLuint asize = 0, esize = 0;
+
+ /* get type info of the master expression (matrix, vector or an array */
+ if (!_slang_typeof_operation(A, &op->children[0], tia))
+ return GL_FALSE;
+ if (!sizeof_variable
+ (A, &tia->spec, slang_qual_none, tia->array_len, &asize))
+ return GL_FALSE;
+
+ /* get type info of the result (matrix column, vector row or array element) */
+ if (!_slang_typeof_operation(A, op, tie))
+ return GL_FALSE;
+ if (!sizeof_variable(A, &tie->spec, slang_qual_none, 0, &esize))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* when indexing an l-value swizzle, push the swizzle_tmp */
+ if (ref == slang_ref_force && tia->is_swizzled)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the subscript expression */
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force && tia->is_swizzled) {
+ GLuint i;
+
+ /* copy the swizzle indexes to the swizzle_tmp */
+ for (i = 0; i < tia->swz.num_components; i++) {
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, i * 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, tia->swz.swizzle[i]))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+
+ /* offset the pushed swizzle_tmp address and dereference it */
+ if (!PUSH(A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_addr_push, 4))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_deref))
+ return GL_FALSE;
+ }
+ else {
+ /* convert the integer subscript to a relative address */
+ if (!PUSH(A->file, slang_asm_int_to_addr))
+ return GL_FALSE;
+ }
+
+ if (!PLAB(A->file, slang_asm_addr_push, esize))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_multiply))
+ return GL_FALSE;
+
+ if (ref == slang_ref_force) {
+ /* offset the base address with the relative address */
+ if (!PUSH(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+ }
+ else {
+ GLuint i;
+
+ /* move the selected element to the beginning of the master expression */
+ for (i = 0; i < esize; i += 4)
+ if (!PLAB2
+ (A->file, slang_asm_float_move, asize - esize + i + 4, i + 4))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+
+ /* free the rest of the master expression */
+ if (!PLAB(A->file, slang_asm_local_free, asize - esize))
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
-static GLboolean handle_field (slang_assemble_ctx *A, slang_assembly_typeinfo *tia,
- slang_assembly_typeinfo *tib, slang_operation *op, slang_ref_type ref)
+static GLboolean
+handle_field(slang_assemble_ctx * A, slang_assembly_typeinfo * tia,
+ slang_assembly_typeinfo * tib, slang_operation * op,
+ slang_ref_type ref)
{
- /* get type info of the result (field or swizzle) */
- if (!_slang_typeof_operation (A, op, tia))
- return GL_FALSE;
-
- /* get type info of the master expression being accessed (struct or vector) */
- if (!_slang_typeof_operation (A, &op->children[0], tib))
- return GL_FALSE;
-
- /* if swizzling a vector in-place, the swizzle temporary is needed */
- if (ref == slang_ref_forbid && tia->is_swizzled)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
-
- /* assemble the master expression */
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
-
- /* assemble the field expression */
- if (tia->is_swizzled)
- {
- if (ref == slang_ref_force)
- {
+ /* get type info of the result (field or swizzle) */
+ if (!_slang_typeof_operation(A, op, tia))
+ return GL_FALSE;
+
+ /* get type info of the master expression being accessed (struct or vector) */
+ if (!_slang_typeof_operation(A, &op->children[0], tib))
+ return GL_FALSE;
+
+ /* if swizzling a vector in-place, the swizzle temporary is needed */
+ if (ref == slang_ref_forbid && tia->is_swizzled)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+
+ /* assemble the master expression */
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+
+ /* assemble the field expression */
+ if (tia->is_swizzled) {
+ if (ref == slang_ref_force) {
#if 0
- if (tia->swz.num_components == 1)
- {
- /* simple case - adjust the vector's address to point to the selected component */
- if (!PLAB (file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
- return 0;
- if (!PUSH (file, slang_asm_addr_add))
- return 0;
- }
- else
+ if (tia->swz.num_components == 1) {
+ /* simple case - adjust the vector's address to point to
+ * the selected component
+ */
+ if (!PLAB(file, slang_asm_addr_push, tia->swz.swizzle[0] * 4))
+ return 0;
+ if (!PUSH(file, slang_asm_addr_add))
+ return 0;
+ }
+ else
#endif
- {
- /* two or more vector components are being referenced - the so-called write mask
- * must be passed to the upper operations and applied when assigning value
- * to this swizzle */
- A->swz = tia->swz;
- }
- }
- else
- {
- /* swizzle the vector in-place using the swizzle temporary */
- if (!_slang_assemble_constructor_from_swizzle (A, &tia->swz, &tia->spec, &tib->spec))
- return GL_FALSE;
- }
- }
- else
- {
- GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
+ {
+ /* two or more vector components are being referenced -
+ * the so-called write mask must be passed to the upper
+ * operations and applied when assigning value to this swizzle
+ */
+ A->swz = tia->swz;
+ }
+ }
+ else {
+ /* swizzle the vector in-place using the swizzle temporary */
+ if (!_slang_assemble_constructor_from_swizzle
+ (A, &tia->swz, &tia->spec, &tib->spec))
+ return GL_FALSE;
+ }
+ }
+ else {
+ GLuint i, struct_size = 0, field_offset = 0, field_size = 0;
/*
* Calculate struct size, field offset and field size.
*/
- for (i = 0; i < tib->spec._struct->fields->num_variables; i++)
- {
- slang_variable *field;
- slang_storage_aggregate agg;
- GLuint size;
-
- field = &tib->spec._struct->fields->variables[i];
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, &field->type.specifier, field->array_len,
- A->space.funcs, A->space.structs, A->space.vars, A->mach, A->file, A->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- size = _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
+ for (i = 0; i < tib->spec._struct->fields->num_variables; i++) {
+ slang_variable *field;
+ slang_storage_aggregate agg;
+ GLuint size;
+
+ field = &tib->spec._struct->fields->variables[i];
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable
+ (&agg, &field->type.specifier, field->array_len, A->space.funcs,
+ A->space.structs, A->space.vars, A->mach, A->file, A->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ size = _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
if (op->a_id == field->a_name) {
field_size = size;
field_offset = struct_size;
}
struct_size += size;
- }
+ }
- if (ref == slang_ref_force)
- {
+ if (ref == slang_ref_force) {
GLboolean shift;
/*
- * OPTIMIZATION: If selecting first field, no address shifting is needed.
- */
+ * OPTIMIZATION: If selecting first field, no address shifting
+ * is needed.
+ */
shift = (field_offset != 0);
if (shift) {
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ if (!PLAB(A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_addr_add))
return GL_FALSE;
- if (!PUSH (A->file, slang_asm_addr_add))
- return GL_FALSE;
- }
- }
- else
- {
+ }
+ }
+ else {
GLboolean relocate, shrink;
- GLuint free_b = 0;
+ GLuint free_b = 0;
/*
- * OPTIMIZATION: If selecting last field, no relocation is needed.
- */
+ * OPTIMIZATION: If selecting last field, no relocation is needed.
+ */
relocate = (field_offset != (struct_size - field_size));
/*
- * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.
- */
+ * OPTIMIZATION: If field and struct sizes are equal, no partial
+ * free is needed.
+ */
shrink = (field_size != struct_size);
- if (relocate)
- {
- GLuint i;
+ if (relocate) {
+ GLuint i;
+
+ /*
+ * Move the selected element to the end of the master expression.
+ * Do it in reverse order to avoid overwriting itself.
+ */
+ if (!PLAB(A->file, slang_asm_addr_push, field_offset))
+ return GL_FALSE;
+ for (i = field_size; i > 0; i -= 4)
+ if (!PLAB2
+ (A->file, slang_asm_float_move,
+ struct_size - field_size + i, i))
+ return GL_FALSE;
+ free_b += 4;
+ }
+
+ if (shrink) {
+ /* free the rest of the master expression */
+ free_b += struct_size - field_size;
+ }
- /*
- * Move the selected element to the end of the master expression.
- * Do it in reverse order to avoid overwriting itself.
- */
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))
+ if (free_b) {
+ if (!PLAB(A->file, slang_asm_local_free, free_b))
return GL_FALSE;
- for (i = field_size; i > 0; i -= 4)
- if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i, i))
- return GL_FALSE;
- free_b += 4;
- }
-
- if (shrink)
- {
- /* free the rest of the master expression */
- free_b += struct_size - field_size;
- }
-
- if (free_b)
- {
- if (!PLAB (A->file, slang_asm_local_free, free_b))
- return GL_FALSE;
- }
- }
- }
-
- return GL_TRUE;
+ }
+ }
+ }
+
+ return GL_TRUE;
}
-GLboolean _slang_assemble_operation (slang_assemble_ctx *A, slang_operation *op, slang_ref_type ref)
+GLboolean
+_slang_assemble_operation(slang_assemble_ctx * A, slang_operation * op,
+ slang_ref_type ref)
{
- /* set default results */
- A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ref;
- A->swz.num_components = 0;
-
- switch (op->type)
- {
- case slang_oper_block_no_new_scope:
- case slang_oper_block_new_scope:
- {
- GLuint i;
-
- for (i = 0; i < op->num_children; i++)
- {
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid/*slang_ref_freelance*/))
- return GL_FALSE;
- if (!_slang_cleanup_stack (A, &op->children[i]))
- return GL_FALSE;
- }
- }
- break;
- case slang_oper_variable_decl:
- {
- GLuint i;
- slang_operation assign;
- GLboolean result;
-
- /* Construct assignment expression placeholder. */
- if (!slang_operation_construct (&assign))
- return GL_FALSE;
- assign.type = slang_oper_assign;
- assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
- if (assign.children == NULL)
- {
- slang_operation_destruct (&assign);
- return GL_FALSE;
- }
- for (assign.num_children = 0; assign.num_children < 2; assign.num_children++)
- if (!slang_operation_construct (&assign.children[assign.num_children]))
- {
- slang_operation_destruct (&assign);
- return GL_FALSE;
- }
-
- result = GL_TRUE;
- for (i = 0; i < op->num_children; i++)
- {
- slang_variable *var;
-
- var = _slang_locate_variable (op->children[i].locals, op->children[i].a_id, GL_TRUE);
- if (var == NULL)
- {
- result = GL_FALSE;
- break;
- }
- if (var->initializer == NULL)
- continue;
-
- if (!slang_operation_copy (&assign.children[0], &op->children[i]) ||
- !slang_operation_copy (&assign.children[1], var->initializer) ||
- !_slang_assemble_assign (A, &assign, "=", slang_ref_forbid) ||
- !_slang_cleanup_stack (A, &assign))
- {
- result = GL_FALSE;
- break;
- }
- }
- slang_operation_destruct (&assign);
- if (!result)
- return GL_FALSE;
- }
- break;
- case slang_oper_asm:
- {
- GLuint i;
-
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
- return GL_FALSE;
- for (i = 1; i < op->num_children; i++)
- if (!_slang_assemble_operation (A, &op->children[i], slang_ref_forbid))
- return GL_FALSE;
- if (!call_asm_instruction (A, op->a_id))
- return GL_FALSE;
- }
- break;
- case slang_oper_break:
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_end))
- return GL_FALSE;
- break;
- case slang_oper_continue:
- if (!PLAB (A->file, slang_asm_jump, A->flow.loop_start))
- return GL_FALSE;
- break;
- case slang_oper_discard:
- if (!PUSH (A->file, slang_asm_discard))
- return GL_FALSE;
- if (!PUSH (A->file, slang_asm_exit))
- return GL_FALSE;
- break;
- case slang_oper_return:
- if (A->local.ret_size != 0)
- {
- /* push the result's address */
- if (!PLAB2 (A->file, slang_asm_local_addr, 0, A->local.ret_size))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
-
- A->swz.num_components = 0;
- /* assign the operation to the function result (it was reserved on the stack) */
- if (!_slang_assemble_assignment (A, op->children))
- return GL_FALSE;
-
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- }
- if (!PLAB (A->file, slang_asm_jump, A->flow.function_end))
- return GL_FALSE;
- break;
- case slang_oper_expression:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], ref))
- return GL_FALSE;
- break;
- case slang_oper_if:
- if (!_slang_assemble_if (A, op))
- return GL_FALSE;
- break;
- case slang_oper_while:
- if (!_slang_assemble_while (A, op))
- return GL_FALSE;
- break;
- case slang_oper_do:
- if (!_slang_assemble_do (A, op))
- return GL_FALSE;
- break;
- case slang_oper_for:
- if (!_slang_assemble_for (A, op))
- return GL_FALSE;
- break;
- case slang_oper_void:
- break;
- case slang_oper_literal_bool:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_bool_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_literal_int:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_int_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_literal_float:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!PLIT (A->file, slang_asm_float_push, op->literal))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_identifier:
- {
- slang_variable *var;
- GLuint size;
-
- /* find the variable and calculate its size */
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
- if (var == NULL)
- return GL_FALSE;
- size = 0;
- if (!sizeof_variable (A, &var->type.specifier, slang_qual_none, var->array_len, &size))
- return GL_FALSE;
-
- /* prepare stack for dereferencing */
- if (ref == slang_ref_forbid)
- if (!PLAB2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
-
- /* push the variable's address */
- if (var->global)
- {
- if (!PLAB (A->file, slang_asm_global_addr, var->address))
- return GL_FALSE;
- }
- else
- {
- if (!PLAB2 (A->file, slang_asm_local_addr, var->address, size))
- return GL_FALSE;
- }
-
- /* perform the dereference */
- if (ref == slang_ref_forbid)
- {
- if (!PUSH (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!PLAB (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- if (!_slang_dereference (A, op))
- return GL_FALSE;
- }
- }
- break;
- case slang_oper_sequence:
- if (ref == slang_ref_force)
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid/*slang_ref_freelance*/))
- return GL_FALSE;
- if (!_slang_cleanup_stack (A, &op->children[0]))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_assign:
- if (!_slang_assemble_assign (A, op, "=", ref))
- return GL_FALSE;
- break;
- case slang_oper_addassign:
- if (!_slang_assemble_assign (A, op, "+=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_subassign:
- if (!_slang_assemble_assign (A, op, "-=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_mulassign:
- if (!_slang_assemble_assign (A, op, "*=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- /*case slang_oper_modassign:*/
- /*case slang_oper_lshassign:*/
- /*case slang_oper_rshassign:*/
- /*case slang_oper_orassign:*/
- /*case slang_oper_xorassign:*/
- /*case slang_oper_andassign:*/
- case slang_oper_divassign:
- if (!_slang_assemble_assign (A, op, "/=", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_select:
- if (!_slang_assemble_select (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicalor:
- if (!_slang_assemble_logicalor (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicaland:
- if (!_slang_assemble_logicaland (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_logicalxor:
- if (!_slang_assemble_function_call_name (A, "^^", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_bitor:*/
- /*case slang_oper_bitxor:*/
- /*case slang_oper_bitand:*/
- case slang_oper_less:
- if (!_slang_assemble_function_call_name (A, "<", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_greater:
- if (!_slang_assemble_function_call_name (A, ">", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_lessequal:
- if (!_slang_assemble_function_call_name (A, "<=", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_greaterequal:
- if (!_slang_assemble_function_call_name (A, ">=", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_lshift:*/
- /*case slang_oper_rshift:*/
- case slang_oper_add:
- if (!_slang_assemble_function_call_name (A, "+", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_subtract:
- if (!_slang_assemble_function_call_name (A, "-", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_multiply:
- if (!_slang_assemble_function_call_name (A, "*", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_modulus:*/
- case slang_oper_divide:
- if (!_slang_assemble_function_call_name (A, "/", op->children, 2, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_equal:
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- if (!equality (A, op->children, GL_TRUE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_notequal:
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_forbid))
- return GL_FALSE;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- if (!equality (A, op->children, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_preincrement:
- if (!_slang_assemble_assign (A, op, "++", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_predecrement:
- if (!_slang_assemble_assign (A, op, "--", ref))
- return GL_FALSE;
- A->ref = ref;
- break;
- case slang_oper_plus:
- if (!_slang_dereference (A, op))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_minus:
- if (!_slang_assemble_function_call_name (A, "-", op->children, 1, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- /*case slang_oper_complement:*/
- case slang_oper_not:
- if (!_slang_assemble_function_call_name (A, "!", op->children, 1, GL_FALSE))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_subscript:
- {
- slang_assembly_typeinfo ti_arr, ti_elem;
-
- if (!slang_assembly_typeinfo_construct (&ti_arr))
- return GL_FALSE;
- if (!slang_assembly_typeinfo_construct (&ti_elem))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- return GL_FALSE;
- }
- if (!handle_subscript (A, &ti_elem, &ti_arr, op, ref))
- {
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- return GL_FALSE;
- }
- slang_assembly_typeinfo_destruct (&ti_arr);
- slang_assembly_typeinfo_destruct (&ti_elem);
- }
- break;
- case slang_oper_call:
- {
- slang_function *fun;
-
- fun = _slang_locate_function (A->space.funcs, op->a_id, op->children, op->num_children,
- &A->space, A->atoms);
- if (fun == NULL)
- {
- if (!_slang_assemble_constructor (A, op))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_function_call (A, fun, op->children, op->num_children, GL_FALSE))
- return GL_FALSE;
- }
- A->ref = slang_ref_forbid;
- }
- break;
- case slang_oper_field:
- {
- slang_assembly_typeinfo ti_after, ti_before;
-
- if (!slang_assembly_typeinfo_construct (&ti_after))
- return GL_FALSE;
- if (!slang_assembly_typeinfo_construct (&ti_before))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- return GL_FALSE;
- }
- if (!handle_field (A, &ti_after, &ti_before, op, ref))
- {
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- return GL_FALSE;
- }
- slang_assembly_typeinfo_destruct (&ti_after);
- slang_assembly_typeinfo_destruct (&ti_before);
- }
- break;
- case slang_oper_postincrement:
- if (!assemble_function_call_name_dummyint (A, "++", op->children))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- case slang_oper_postdecrement:
- if (!assemble_function_call_name_dummyint (A, "--", op->children))
- return GL_FALSE;
- A->ref = slang_ref_forbid;
- break;
- default:
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
+ /* set default results */
+ A->ref = /*(ref == slang_ref_freelance) ? slang_ref_force : */ ref;
+ A->swz.num_components = 0;
+
+ switch (op->type) {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ {
+ GLuint i;
+
+ for (i = 0; i < op->num_children; i++) {
+ if (!_slang_assemble_operation
+ (A, &op->children[i],
+ slang_ref_forbid /*slang_ref_freelance */ ))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack(A, &op->children[i]))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_variable_decl:
+ {
+ GLuint i;
+ slang_operation assign;
+ GLboolean result;
+
+ /* Construct assignment expression placeholder. */
+ if (!slang_operation_construct(&assign))
+ return GL_FALSE;
+ assign.type = slang_oper_assign;
+ assign.children =
+ (slang_operation *) slang_alloc_malloc(2 *
+ sizeof(slang_operation));
+ if (assign.children == NULL) {
+ slang_operation_destruct(&assign);
+ return GL_FALSE;
+ }
+ for (assign.num_children = 0; assign.num_children < 2;
+ assign.num_children++)
+ if (!slang_operation_construct
+ (&assign.children[assign.num_children])) {
+ slang_operation_destruct(&assign);
+ return GL_FALSE;
+ }
+
+ result = GL_TRUE;
+ for (i = 0; i < op->num_children; i++) {
+ slang_variable *var;
+
+ var =
+ _slang_locate_variable(op->children[i].locals,
+ op->children[i].a_id, GL_TRUE);
+ if (var == NULL) {
+ result = GL_FALSE;
+ break;
+ }
+ if (var->initializer == NULL)
+ continue;
+
+ if (!slang_operation_copy(&assign.children[0], &op->children[i])
+ || !slang_operation_copy(&assign.children[1],
+ var->initializer)
+ || !_slang_assemble_assign(A, &assign, "=", slang_ref_forbid)
+ || !_slang_cleanup_stack(A, &assign)) {
+ result = GL_FALSE;
+ break;
+ }
+ }
+ slang_operation_destruct(&assign);
+ if (!result)
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_asm:
+ {
+ GLuint i;
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ for (i = 1; i < op->num_children; i++)
+ if (!_slang_assemble_operation
+ (A, &op->children[i], slang_ref_forbid))
+ return GL_FALSE;
+ if (!call_asm_instruction(A, op->a_id))
+ return GL_FALSE;
+ }
+ break;
+ case slang_oper_break:
+ if (!PLAB(A->file, slang_asm_jump, A->flow.loop_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_continue:
+ if (!PLAB(A->file, slang_asm_jump, A->flow.loop_start))
+ return GL_FALSE;
+ break;
+ case slang_oper_discard:
+ if (!PUSH(A->file, slang_asm_discard))
+ return GL_FALSE;
+ if (!PUSH(A->file, slang_asm_exit))
+ return GL_FALSE;
+ break;
+ case slang_oper_return:
+ if (A->local.ret_size != 0) {
+ /* push the result's address */
+ if (!PLAB2(A->file, slang_asm_local_addr, 0, A->local.ret_size))
+ return GL_FALSE;
+ if (!_slang_assemble_operation
+ (A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+
+ A->swz.num_components = 0;
+ /* assign the operation to the function result (it was reserved on the stack) */
+ if (!_slang_assemble_assignment(A, op->children))
+ return GL_FALSE;
+
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ }
+ if (!PLAB(A->file, slang_asm_jump, A->flow.function_end))
+ return GL_FALSE;
+ break;
+ case slang_oper_expression:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[0], ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_if:
+ if (!_slang_assemble_if(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_while:
+ if (!_slang_assemble_while(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_do:
+ if (!_slang_assemble_do(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_for:
+ if (!_slang_assemble_for(A, op))
+ return GL_FALSE;
+ break;
+ case slang_oper_void:
+ break;
+ case slang_oper_literal_bool:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_bool_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_int:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_int_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_literal_float:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!PLIT(A->file, slang_asm_float_push, op->literal))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+ GLuint size;
+
+ /* find the variable and calculate its size */
+ var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ size = 0;
+ if (!sizeof_variable
+ (A, &var->type.specifier, slang_qual_none, var->array_len,
+ &size))
+ return GL_FALSE;
+
+ /* prepare stack for dereferencing */
+ if (ref == slang_ref_forbid)
+ if (!PLAB2(A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+
+ /* push the variable's address */
+ if (var->global) {
+ if (!PLAB(A->file, slang_asm_global_addr, var->address))
+ return GL_FALSE;
+ }
+ else {
+ if (!PLAB2(A->file, slang_asm_local_addr, var->address, size))
+ return GL_FALSE;
+ }
+
+ /* perform the dereference */
+ if (ref == slang_ref_forbid) {
+ if (!PUSH(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!PLAB(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference(A, op))
+ return GL_FALSE;
+ }
+ }
+ break;
+ case slang_oper_sequence:
+ if (ref == slang_ref_force)
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[0],
+ slang_ref_forbid /*slang_ref_freelance */ ))
+ return GL_FALSE;
+ if (!_slang_cleanup_stack(A, &op->children[0]))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_assign:
+ if (!_slang_assemble_assign(A, op, "=", ref))
+ return GL_FALSE;
+ break;
+ case slang_oper_addassign:
+ if (!_slang_assemble_assign(A, op, "+=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_subassign:
+ if (!_slang_assemble_assign(A, op, "-=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_mulassign:
+ if (!_slang_assemble_assign(A, op, "*=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ /*case slang_oper_modassign: */
+ /*case slang_oper_lshassign: */
+ /*case slang_oper_rshassign: */
+ /*case slang_oper_orassign: */
+ /*case slang_oper_xorassign: */
+ /*case slang_oper_andassign: */
+ case slang_oper_divassign:
+ if (!_slang_assemble_assign(A, op, "/=", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_select:
+ if (!_slang_assemble_select(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalor:
+ if (!_slang_assemble_logicalor(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicaland:
+ if (!_slang_assemble_logicaland(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_logicalxor:
+ if (!_slang_assemble_function_call_name(A, "^^", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_bitor: */
+ /*case slang_oper_bitxor: */
+ /*case slang_oper_bitand: */
+ case slang_oper_less:
+ if (!_slang_assemble_function_call_name(A, "<", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greater:
+ if (!_slang_assemble_function_call_name(A, ">", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_lessequal:
+ if (!_slang_assemble_function_call_name(A, "<=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_greaterequal:
+ if (!_slang_assemble_function_call_name(A, ">=", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_lshift: */
+ /*case slang_oper_rshift: */
+ case slang_oper_add:
+ if (!_slang_assemble_function_call_name(A, "+", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subtract:
+ if (!_slang_assemble_function_call_name(A, "-", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_multiply:
+ if (!_slang_assemble_function_call_name(A, "*", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_modulus: */
+ case slang_oper_divide:
+ if (!_slang_assemble_function_call_name(A, "/", op->children, 2, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_equal:
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality(A, op->children, GL_TRUE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_notequal:
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_forbid))
+ return GL_FALSE;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ if (!equality(A, op->children, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_preincrement:
+ if (!_slang_assemble_assign(A, op, "++", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_predecrement:
+ if (!_slang_assemble_assign(A, op, "--", ref))
+ return GL_FALSE;
+ A->ref = ref;
+ break;
+ case slang_oper_plus:
+ if (!_slang_dereference(A, op))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_minus:
+ if (!_slang_assemble_function_call_name
+ (A, "-", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ /*case slang_oper_complement: */
+ case slang_oper_not:
+ if (!_slang_assemble_function_call_name
+ (A, "!", op->children, 1, GL_FALSE))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo ti_arr, ti_elem;
+
+ if (!slang_assembly_typeinfo_construct(&ti_arr))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct(&ti_elem)) {
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ return GL_FALSE;
+ }
+ if (!handle_subscript(A, &ti_elem, &ti_arr, op, ref)) {
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ slang_assembly_typeinfo_destruct(&ti_elem);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct(&ti_arr);
+ slang_assembly_typeinfo_destruct(&ti_elem);
+ }
+ break;
+ case slang_oper_call:
+ {
+ slang_function *fun;
+
+ fun =
+ _slang_locate_function(A->space.funcs, op->a_id, op->children,
+ op->num_children, &A->space, A->atoms);
+ if (fun == NULL) {
+ if (!_slang_assemble_constructor(A, op))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_function_call
+ (A, fun, op->children, op->num_children, GL_FALSE))
+ return GL_FALSE;
+ }
+ A->ref = slang_ref_forbid;
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo ti_after, ti_before;
+
+ if (!slang_assembly_typeinfo_construct(&ti_after))
+ return GL_FALSE;
+ if (!slang_assembly_typeinfo_construct(&ti_before)) {
+ slang_assembly_typeinfo_destruct(&ti_after);
+ return GL_FALSE;
+ }
+ if (!handle_field(A, &ti_after, &ti_before, op, ref)) {
+ slang_assembly_typeinfo_destruct(&ti_after);
+ slang_assembly_typeinfo_destruct(&ti_before);
+ return GL_FALSE;
+ }
+ slang_assembly_typeinfo_destruct(&ti_after);
+ slang_assembly_typeinfo_destruct(&ti_before);
+ }
+ break;
+ case slang_oper_postincrement:
+ if (!assemble_function_call_name_dummyint(A, "++", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ case slang_oper_postdecrement:
+ if (!assemble_function_call_name_dummyint(A, "--", op->children))
+ return GL_FALSE;
+ A->ref = slang_ref_forbid;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble.h b/src/mesa/shader/slang/slang_assemble.h
index 95e4fa263a3..d004e665003 100644
--- a/src/mesa/shader/slang/slang_assemble.h
+++ b/src/mesa/shader/slang/slang_assemble.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_H
+#ifndef SLANG_ASSEMBLE_H
#define SLANG_ASSEMBLE_H
#include "slang_utility.h"
@@ -31,72 +31,82 @@
extern "C" {
#endif
+
struct slang_operation_;
typedef enum slang_assembly_type_
{
- /* core */
- slang_asm_none,
- slang_asm_float_copy,
- slang_asm_float_move,
- slang_asm_float_push,
- slang_asm_float_deref,
- slang_asm_float_add,
- slang_asm_float_multiply,
- slang_asm_float_divide,
- slang_asm_float_negate,
- slang_asm_float_less,
- slang_asm_float_equal_exp,
- slang_asm_float_equal_int,
- slang_asm_float_to_int,
- slang_asm_float_sine,
- slang_asm_float_arcsine,
- slang_asm_float_arctan,
- slang_asm_float_power,
- slang_asm_float_log2,
- slang_asm_float_floor,
- slang_asm_float_ceil,
- slang_asm_float_noise1,
- slang_asm_float_noise2,
- slang_asm_float_noise3,
- slang_asm_float_noise4,
- slang_asm_int_copy,
- slang_asm_int_move,
- slang_asm_int_push,
- slang_asm_int_deref,
- slang_asm_int_to_float,
- slang_asm_int_to_addr,
- slang_asm_bool_copy,
- slang_asm_bool_move,
- slang_asm_bool_push,
- slang_asm_bool_deref,
- slang_asm_addr_copy,
- slang_asm_addr_push,
- slang_asm_addr_deref,
- slang_asm_addr_add,
- slang_asm_addr_multiply,
- slang_asm_vec4_tex1d,
- slang_asm_vec4_tex2d,
- slang_asm_vec4_tex3d,
- slang_asm_vec4_texcube,
- slang_asm_vec4_shad1d,
- slang_asm_vec4_shad2d,
- slang_asm_jump,
- slang_asm_jump_if_zero,
- slang_asm_enter,
- slang_asm_leave,
- slang_asm_local_alloc,
- slang_asm_local_free,
- slang_asm_local_addr,
- slang_asm_global_addr,
- slang_asm_call,
- slang_asm_return,
- slang_asm_discard,
- slang_asm_exit,
+ /* core */
+ slang_asm_none,
+ slang_asm_float_copy,
+ slang_asm_float_move,
+ slang_asm_float_push,
+ slang_asm_float_deref,
+ slang_asm_float_add, /* a = pop(); b = pop(); push(a + b); */
+ slang_asm_float_multiply,
+ slang_asm_float_divide,
+ slang_asm_float_negate, /* push(-pop()) */
+ slang_asm_float_less, /* a = pop(); b = pop(); push(a < b); */
+ slang_asm_float_equal_exp,
+ slang_asm_float_equal_int,
+ slang_asm_float_to_int, /* push(floatToInt(pop())) */
+ slang_asm_float_sine, /* push(sin(pop()) */
+ slang_asm_float_arcsine,
+ slang_asm_float_arctan,
+ slang_asm_float_power, /* push(pow(pop(), pop())) */
+ slang_asm_float_log2,
+ slang_asm_float_floor,
+ slang_asm_float_ceil,
+ slang_asm_float_noise1, /* push(noise1(pop()) */
+ slang_asm_float_noise2, /* push(noise2(pop(), pop())) */
+ slang_asm_float_noise3,
+ slang_asm_float_noise4,
+
+ slang_asm_int_copy,
+ slang_asm_int_move,
+ slang_asm_int_push,
+ slang_asm_int_deref,
+ slang_asm_int_to_float,
+ slang_asm_int_to_addr,
+
+ slang_asm_bool_copy,
+ slang_asm_bool_move,
+ slang_asm_bool_push,
+ slang_asm_bool_deref,
+
+ slang_asm_addr_copy,
+ slang_asm_addr_push,
+ slang_asm_addr_deref,
+ slang_asm_addr_add,
+ slang_asm_addr_multiply,
+
+ slang_asm_vec4_tex1d,
+ slang_asm_vec4_tex2d,
+ slang_asm_vec4_tex3d,
+ slang_asm_vec4_texcube,
+ slang_asm_vec4_shad1d,
+ slang_asm_vec4_shad2d,
+
+ slang_asm_jump,
+ slang_asm_jump_if_zero,
+
+ slang_asm_enter,
+ slang_asm_leave,
+
+ slang_asm_local_alloc,
+ slang_asm_local_free,
+ slang_asm_local_addr,
+ slang_asm_global_addr,
+
+ slang_asm_call, /* push(ip); jump(inst->param[0]); */
+ slang_asm_return,
+
+ slang_asm_discard,
+ slang_asm_exit,
/* GL_MESA_shader_debug */
- slang_asm_float_print,
- slang_asm_int_print,
- slang_asm_bool_print,
+ slang_asm_float_print,
+ slang_asm_int_print,
+ slang_asm_bool_print,
/* vec4 */
slang_asm_float_to_vec4,
slang_asm_vec4_add,
@@ -109,111 +119,152 @@ typedef enum slang_assembly_type_
slang_asm_vec4_deref,
slang_asm_vec4_equal_int,
/* not a real assembly instruction */
- slang_asm__last
+ slang_asm__last
} slang_assembly_type;
+
+/**
+ * An assembly-level shader instruction.
+ */
typedef struct slang_assembly_
{
- slang_assembly_type type;
- GLfloat literal;
- GLuint param[2];
+ slang_assembly_type type; /**< The instruction opcode */
+ GLfloat literal; /**< float literal */
+ GLuint param[2]; /**< Two integer/address parameters */
} slang_assembly;
+
+/**
+ * A list of slang_assembly instructions
+ */
typedef struct slang_assembly_file_
{
- slang_assembly *code;
- GLuint count;
- GLuint capacity;
+ slang_assembly *code;
+ GLuint count;
+ GLuint capacity;
} slang_assembly_file;
+
+extern GLvoid
+_slang_assembly_file_ctr(slang_assembly_file *);
+
extern GLvoid
-_slang_assembly_file_ctr (slang_assembly_file *);
+slang_assembly_file_destruct(slang_assembly_file *);
+
+extern GLboolean
+slang_assembly_file_push(slang_assembly_file *, slang_assembly_type);
+
+extern GLboolean
+slang_assembly_file_push_label(slang_assembly_file *,
+ slang_assembly_type, GLuint);
+
+extern GLboolean
+slang_assembly_file_push_label2(slang_assembly_file *, slang_assembly_type,
+ GLuint, GLuint);
+
+extern GLboolean
+slang_assembly_file_push_literal(slang_assembly_file *,
+ slang_assembly_type, GLfloat);
-GLvoid slang_assembly_file_destruct (slang_assembly_file *);
-GLboolean slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
-GLboolean slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
-GLboolean slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
-GLboolean slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
typedef struct slang_assembly_file_restore_point_
{
- GLuint count;
+ GLuint count;
} slang_assembly_file_restore_point;
-GLboolean slang_assembly_file_restore_point_save (slang_assembly_file *,
- slang_assembly_file_restore_point *);
-GLboolean slang_assembly_file_restore_point_load (slang_assembly_file *,
- slang_assembly_file_restore_point *);
+
+extern GLboolean
+slang_assembly_file_restore_point_save(slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+
+extern GLboolean
+slang_assembly_file_restore_point_load(slang_assembly_file *,
+ slang_assembly_file_restore_point *);
+
typedef struct slang_assembly_flow_control_
{
- GLuint loop_start; /* for "continue" statement */
- GLuint loop_end; /* for "break" statement */
- GLuint function_end; /* for "return" statement */
+ GLuint loop_start; /**< for "continue" statement */
+ GLuint loop_end; /**< for "break" statement */
+ GLuint function_end; /**< for "return" statement */
} slang_assembly_flow_control;
typedef struct slang_assembly_local_info_
{
- GLuint ret_size;
- GLuint addr_tmp;
- GLuint swizzle_tmp;
+ GLuint ret_size;
+ GLuint addr_tmp;
+ GLuint swizzle_tmp;
} slang_assembly_local_info;
typedef enum
{
- slang_ref_force,
- slang_ref_forbid/*,
- slang_ref_freelance*/
+ slang_ref_force,
+ slang_ref_forbid /**< slang_ref_freelance */
} slang_ref_type;
-/*
- * Holds a complete information about vector swizzle - the <swizzle> array contains
- * vector component source indices, where 0 is "x", 1 is "y", 2 is "z" and 3 is "w".
+/**
+ * Holds complete information about vector swizzle - the <swizzle>
+ * array contains vector component source indices, where 0 is "x", 1
+ * is "y", 2 is "z" and 3 is "w".
* Example: "xwz" --> { 3, { 0, 3, 2, not used } }.
*/
typedef struct slang_swizzle_
{
- GLuint num_components;
- GLuint swizzle[4];
+ GLuint num_components;
+ GLuint swizzle[4];
} slang_swizzle;
typedef struct slang_assembly_name_space_
{
- struct slang_function_scope_ *funcs;
- struct slang_struct_scope_ *structs;
- struct slang_variable_scope_ *vars;
+ struct slang_function_scope_ *funcs;
+ struct slang_struct_scope_ *structs;
+ struct slang_variable_scope_ *vars;
} slang_assembly_name_space;
typedef struct slang_assemble_ctx_
{
- slang_assembly_file *file;
- struct slang_machine_ *mach;
- slang_atom_pool *atoms;
- slang_assembly_name_space space;
- slang_assembly_flow_control flow;
- slang_assembly_local_info local;
- slang_ref_type ref;
- slang_swizzle swz;
+ slang_assembly_file *file;
+ struct slang_machine_ *mach;
+ slang_atom_pool *atoms;
+ slang_assembly_name_space space;
+ slang_assembly_flow_control flow;
+ slang_assembly_local_info local;
+ slang_ref_type ref;
+ slang_swizzle swz;
} slang_assemble_ctx;
-struct slang_function_ *_slang_locate_function (struct slang_function_scope_ *funcs, slang_atom name,
- struct slang_operation_ *params, GLuint num_params, slang_assembly_name_space *space,
- slang_atom_pool *);
+extern struct slang_function_ *
+_slang_locate_function(const struct slang_function_scope_ *funcs,
+ slang_atom name, const struct slang_operation_ *params,
+ GLuint num_params,
+ const slang_assembly_name_space *space,
+ slang_atom_pool *);
-GLboolean _slang_assemble_function (slang_assemble_ctx *, struct slang_function_ *);
+extern GLboolean
+_slang_assemble_function(slang_assemble_ctx *, struct slang_function_ *);
-GLboolean _slang_cleanup_stack (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_assemble_function2(slang_assemble_ctx * , struct slang_function_ *);
-GLboolean _slang_dereference (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_cleanup_stack(slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_function_call (slang_assemble_ctx *, struct slang_function_ *,
- struct slang_operation_ *, GLuint, GLboolean);
+extern GLboolean
+_slang_dereference(slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_function_call_name (slang_assemble_ctx *, const char *,
- struct slang_operation_ *, GLuint, GLboolean);
+extern GLboolean
+_slang_assemble_function_call(slang_assemble_ctx *, struct slang_function_ *,
+ struct slang_operation_ *, GLuint, GLboolean);
+
+extern GLboolean
+_slang_assemble_function_call_name(slang_assemble_ctx *, const char *,
+ struct slang_operation_ *, GLuint,
+ GLboolean);
+
+extern GLboolean
+_slang_assemble_operation(slang_assemble_ctx *, struct slang_operation_ *,
+ slang_ref_type);
-GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operation_ *,
- slang_ref_type);
#ifdef __cplusplus
}
@@ -225,4 +276,3 @@ GLboolean _slang_assemble_operation (slang_assemble_ctx *, struct slang_operatio
#include "slang_assemble_conditional.h"
#endif
-
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.c b/src/mesa/shader/slang/slang_assemble_assignment.c
index d894a8db18c..a1038671c41 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.c
+++ b/src/mesa/shader/slang/slang_assemble_assignment.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -53,8 +53,11 @@
* +------------------+
*/
+
+
static GLboolean
-assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLuint size)
+assign_basic(slang_assemble_ctx * A, slang_storage_type type, GLuint * index,
+ GLuint size)
{
GLuint dst_offset, dst_addr_loc;
slang_assembly_type ty;
@@ -85,22 +88,25 @@ assign_basic (slang_assemble_ctx *A, slang_storage_type type, GLuint *index, GLu
ty = slang_asm_none;
}
- /* Calculate the distance from top of the stack to the destination address. As the
- * copy operation progresses, components of the source are being successively popped
- * off the stack by the amount of *index increase step.
- */
+ /* Calculate the distance from top of the stack to the destination
+ * address. As the copy operation progresses, components of the
+ * source are being successively popped off the stack by the amount
+ * of *index increase step.
+ */
dst_addr_loc = size - *index;
- if (!slang_assembly_file_push_label2 (A->file, ty, dst_addr_loc, dst_offset))
+ if (!slang_assembly_file_push_label2
+ (A->file, ty, dst_addr_loc, dst_offset))
return GL_FALSE;
- *index += _slang_sizeof_type (type);
+ *index += _slang_sizeof_type(type);
return GL_TRUE;
}
+
static GLboolean
-assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLuint *index,
- GLuint size)
+assign_aggregate(slang_assemble_ctx * A, const slang_storage_aggregate * agg,
+ GLuint * index, GLuint size)
{
GLuint i;
@@ -110,25 +116,26 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu
for (j = 0; j < arr->length; j++) {
if (arr->type == slang_stor_aggregate) {
- if (!assign_aggregate (A, arr->aggregate, index, size))
+ if (!assign_aggregate(A, arr->aggregate, index, size))
return GL_FALSE;
}
else {
- /* When the destination is swizzled, we are forced to do float_copy, even if
- * vec4 extension is enabled with vec4_copy operation.
+ /* When the destination is swizzled, we are forced to do
+ * float_copy, even if vec4 extension is enabled with
+ * vec4_copy operation.
*/
if (A->swz.num_components != 0 && arr->type == slang_stor_vec4) {
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
- if (!assign_basic (A, slang_stor_float, index, size))
+ if (!assign_basic(A, slang_stor_float, index, size))
return GL_FALSE;
}
else {
- if (!assign_basic (A, arr->type, index, size))
+ if (!assign_basic(A, arr->type, index, size))
return GL_FALSE;
}
}
@@ -138,80 +145,79 @@ assign_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *agg, GLu
return GL_TRUE;
}
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *A, slang_operation *op)
+
+GLboolean
+_slang_assemble_assignment(slang_assemble_ctx * A, const slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg;
- GLuint index, size;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end;
-
- index = 0;
- size = _slang_sizeof_aggregate (&agg);
- result = assign_aggregate (A, &agg, &index, size);
-
-end1:
- slang_storage_aggregate_destruct (&agg);
-end:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg;
+ GLuint index, size;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end;
+
+ index = 0;
+ size = _slang_sizeof_aggregate(&agg);
+ result = assign_aggregate(A, &agg, &index, size);
+
+ end1:
+ slang_storage_aggregate_destruct(&agg);
+ end:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-/*
- * _slang_assemble_assign()
- *
- * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=) assignment on the operation's
- * children.
- */
-GLboolean _slang_assemble_assign (slang_assemble_ctx *A, slang_operation *op, const char *oper,
- slang_ref_type ref)
+/**
+ * Performs unary (pre ++ and --) or binary (=, +=, -=, *=, /=)
+ * assignment on the operation's children.
+ */
+GLboolean
+_slang_assemble_assign(slang_assemble_ctx * A, slang_operation * op,
+ const char *oper, slang_ref_type ref)
{
- slang_swizzle swz;
-
- if (ref == slang_ref_forbid)
- {
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
- return GL_FALSE;
- }
-
- if (slang_string_compare ("=", oper) == 0)
- {
- if (!_slang_assemble_operation (A, &op->children[0], slang_ref_force))
- return GL_FALSE;
- swz = A->swz;
- if (!_slang_assemble_operation (A, &op->children[1], slang_ref_forbid))
- return GL_FALSE;
- A->swz = swz;
- if (!_slang_assemble_assignment (A, op->children))
- return GL_FALSE;
- }
- else
- {
- if (!_slang_assemble_function_call_name (A, oper, op->children, op->num_children, GL_TRUE))
- return GL_FALSE;
- }
-
- if (ref == slang_ref_forbid)
- {
- if (!slang_assembly_file_push (A->file, slang_asm_addr_copy))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- if (!_slang_dereference (A, op->children))
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
+ slang_swizzle swz;
+
+ if (ref == slang_ref_forbid) {
+ if (!slang_assembly_file_push_label2
+ (A->file, slang_asm_local_addr, A->local.addr_tmp, 4))
+ return GL_FALSE;
+ }
+
+ if (slang_string_compare("=", oper) == 0) {
+ if (!_slang_assemble_operation(A, &op->children[0], slang_ref_force))
+ return GL_FALSE;
+ swz = A->swz;
+ if (!_slang_assemble_operation(A, &op->children[1], slang_ref_forbid))
+ return GL_FALSE;
+ A->swz = swz;
+ if (!_slang_assemble_assignment(A, op->children))
+ return GL_FALSE;
+ }
+ else {
+ if (!_slang_assemble_function_call_name
+ (A, oper, op->children, op->num_children, GL_TRUE))
+ return GL_FALSE;
+ }
+
+ if (ref == slang_ref_forbid) {
+ if (!slang_assembly_file_push(A->file, slang_asm_addr_copy))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ if (!_slang_dereference(A, op->children))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble_assignment.h b/src/mesa/shader/slang/slang_assemble_assignment.h
index 7b993b543b1..3c1ecdedab8 100644
--- a/src/mesa/shader/slang/slang_assemble_assignment.h
+++ b/src/mesa/shader/slang/slang_assemble_assignment.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,21 +22,24 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
+#ifndef SLANG_ASSEMBLE_ASSIGNMENT_H
#define SLANG_ASSEMBLE_ASSIGNMENT_H
#if defined __cplusplus
extern "C" {
#endif
-GLboolean _slang_assemble_assignment (slang_assemble_ctx *, struct slang_operation_ *);
-GLboolean _slang_assemble_assign (slang_assemble_ctx *, struct slang_operation_ *, const char *,
- slang_ref_type);
+extern GLboolean
+_slang_assemble_assignment(slang_assemble_ctx *, const struct slang_operation_ *);
+
+extern GLboolean
+_slang_assemble_assign(slang_assemble_ctx *, struct slang_operation_ *,
+ const char *, slang_ref_type);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_ASSEMBLE_ASSIGNMENT_H */
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c
index 9d1aa707182..6cd320d4466 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.c
+++ b/src/mesa/shader/slang/slang_assemble_constructor.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -32,348 +32,370 @@
#include "slang_assemble.h"
#include "slang_storage.h"
-/* _slang_is_swizzle() */
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz)
+
+/**
+ * Checks if a field selector is a general swizzle (an r-value swizzle
+ * with replicated components or an l-value swizzle mask) for a
+ * vector. Returns GL_TRUE if this is the case, <swz> is filled with
+ * swizzle information. Returns GL_FALSE otherwise.
+ */
+GLboolean
+_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz)
{
- GLuint i;
- GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
-
- /* the swizzle can be at most 4-component long */
- swz->num_components = slang_string_length (field);
- if (swz->num_components > 4)
- return GL_FALSE;
-
- for (i = 0; i < swz->num_components; i++)
- {
- /* mark which swizzle group is used */
- switch (field[i])
- {
- case 'x':
- case 'y':
- case 'z':
- case 'w':
- xyzw = GL_TRUE;
- break;
- case 'r':
- case 'g':
- case 'b':
- case 'a':
- rgba = GL_TRUE;
- break;
- case 's':
- case 't':
- case 'p':
- case 'q':
- stpq = GL_TRUE;
- break;
- default:
- return GL_FALSE;
- }
-
- /* collect swizzle component */
- switch (field[i])
- {
- case 'x':
- case 'r':
- case 's':
- swz->swizzle[i] = 0;
- break;
- case 'y':
- case 'g':
- case 't':
- swz->swizzle[i] = 1;
- break;
- case 'z':
- case 'b':
- case 'p':
- swz->swizzle[i] = 2;
- break;
- case 'w':
- case 'a':
- case 'q':
- swz->swizzle[i] = 3;
- break;
- }
-
- /* check if the component is valid for given vector's row count */
- if (rows <= swz->swizzle[i])
- return GL_FALSE;
- }
-
- /* only one swizzle group can be used */
- if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
- return GL_FALSE;
-
- return GL_TRUE;
+ GLuint i;
+ GLboolean xyzw = GL_FALSE, rgba = GL_FALSE, stpq = GL_FALSE;
+
+ /* the swizzle can be at most 4-component long */
+ swz->num_components = slang_string_length(field);
+ if (swz->num_components > 4)
+ return GL_FALSE;
+
+ for (i = 0; i < swz->num_components; i++) {
+ /* mark which swizzle group is used */
+ switch (field[i]) {
+ case 'x':
+ case 'y':
+ case 'z':
+ case 'w':
+ xyzw = GL_TRUE;
+ break;
+ case 'r':
+ case 'g':
+ case 'b':
+ case 'a':
+ rgba = GL_TRUE;
+ break;
+ case 's':
+ case 't':
+ case 'p':
+ case 'q':
+ stpq = GL_TRUE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ /* collect swizzle component */
+ switch (field[i]) {
+ case 'x':
+ case 'r':
+ case 's':
+ swz->swizzle[i] = 0;
+ break;
+ case 'y':
+ case 'g':
+ case 't':
+ swz->swizzle[i] = 1;
+ break;
+ case 'z':
+ case 'b':
+ case 'p':
+ swz->swizzle[i] = 2;
+ break;
+ case 'w':
+ case 'a':
+ case 'q':
+ swz->swizzle[i] = 3;
+ break;
+ }
+
+ /* check if the component is valid for given vector's row count */
+ if (rows <= swz->swizzle[i])
+ return GL_FALSE;
+ }
+
+ /* only one swizzle group can be used */
+ if ((xyzw && rgba) || (xyzw && stpq) || (rgba && stpq))
+ return GL_FALSE;
+
+ return GL_TRUE;
}
-/* _slang_is_swizzle_mask() */
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows)
+
+/**
+ * Checks if a general swizzle is an l-value swizzle - these swizzles
+ * do not have duplicated fields. Returns GL_TRUE if this is a
+ * swizzle mask. Returns GL_FALSE otherwise
+ */
+GLboolean
+_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
{
- GLuint i, c = 0;
+ GLuint i, c = 0;
- /* the swizzle may not be longer than the vector dim */
- if (swz->num_components > rows)
- return GL_FALSE;
+ /* the swizzle may not be longer than the vector dim */
+ if (swz->num_components > rows)
+ return GL_FALSE;
- /* the swizzle components cannot be duplicated */
- for (i = 0; i < swz->num_components; i++)
- {
- if ((c & (1 << swz->swizzle[i])) != 0)
- return GL_FALSE;
- c |= 1 << swz->swizzle[i];
- }
+ /* the swizzle components cannot be duplicated */
+ for (i = 0; i < swz->num_components; i++) {
+ if ((c & (1 << swz->swizzle[i])) != 0)
+ return GL_FALSE;
+ c |= 1 << swz->swizzle[i];
+ }
- return GL_TRUE;
+ return GL_TRUE;
}
-/* _slang_multiply_swizzles() */
-GLvoid _slang_multiply_swizzles (slang_swizzle *dst, const slang_swizzle *left,
- const slang_swizzle *right)
+
+/**
+ * Combines (multiplies) two swizzles to form single swizzle.
+ * Example: "vec.wzyx.yx" --> "vec.zw".
+ */
+GLvoid
+_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left,
+ const slang_swizzle * right)
{
- GLuint i;
+ GLuint i;
- dst->num_components = right->num_components;
- for (i = 0; i < right->num_components; i++)
- dst->swizzle[i] = left->swizzle[right->swizzle[i]];
+ dst->num_components = right->num_components;
+ for (i = 0; i < right->num_components; i++)
+ dst->swizzle[i] = left->swizzle[right->swizzle[i]];
}
-/* _slang_assemble_constructor() */
+
static GLboolean
-sizeof_argument (slang_assemble_ctx *A, GLuint *size, slang_operation *op)
+sizeof_argument(slang_assemble_ctx * A, GLuint * size, slang_operation * op)
{
slang_assembly_typeinfo ti;
GLboolean result = GL_FALSE;
slang_storage_aggregate agg;
- if (!slang_assembly_typeinfo_construct (&ti))
+ if (!slang_assembly_typeinfo_construct(&ti))
return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
+ if (!_slang_typeof_operation(A, op, &ti))
goto end1;
- if (!slang_storage_aggregate_construct (&agg))
+ if (!slang_storage_aggregate_construct(&agg))
goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
goto end;
- *size = _slang_sizeof_aggregate (&agg);
+ *size = _slang_sizeof_aggregate(&agg);
result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
+ end:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
return result;
}
-static GLboolean constructor_aggregate (slang_assemble_ctx *A, const slang_storage_aggregate *flat,
- slang_operation *op, GLuint garbage_size)
+
+static GLboolean
+constructor_aggregate(slang_assemble_ctx * A,
+ const slang_storage_aggregate * flat,
+ slang_operation * op, GLuint garbage_size)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg, flat_agg;
-
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end2;
-
- if (!slang_storage_aggregate_construct (&flat_agg))
- goto end2;
- if (!_slang_flatten_aggregate (&flat_agg, &agg))
- goto end;
-
- if (!_slang_assemble_operation (A, op, slang_ref_forbid))
- goto end;
-
- /* TODO: convert (generic) elements */
-
- /* free the garbage */
- if (garbage_size != 0)
- {
- GLuint i;
-
- /* move the non-garbage part to the end of the argument */
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, 0))
- goto end;
- for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4)
- {
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_move,
- garbage_size + i, i))
- {
- goto end;
- }
- }
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, garbage_size + 4))
- goto end;
- }
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&flat_agg);
-end2:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat_agg;
+
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end2;
+
+ if (!slang_storage_aggregate_construct(&flat_agg))
+ goto end2;
+ if (!_slang_flatten_aggregate(&flat_agg, &agg))
+ goto end;
+
+ if (!_slang_assemble_operation(A, op, slang_ref_forbid))
+ goto end;
+
+ /* TODO: convert (generic) elements */
+
+ /* free the garbage */
+ if (garbage_size != 0) {
+ GLuint i;
+
+ /* move the non-garbage part to the end of the argument */
+ if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push, 0))
+ goto end;
+ for (i = flat_agg.count * 4 - garbage_size; i > 0; i -= 4) {
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_float_move,
+ garbage_size + i, i)) {
+ goto end;
+ }
+ }
+ if (!slang_assembly_file_push_label
+ (A->file, slang_asm_local_free, garbage_size + 4))
+ goto end;
+ }
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&flat_agg);
+ end2:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *A, slang_operation *op)
+
+GLboolean
+_slang_assemble_constructor(slang_assemble_ctx * A, const slang_operation * op)
{
- slang_assembly_typeinfo ti;
- GLboolean result = GL_FALSE;
- slang_storage_aggregate agg, flat;
- GLuint size, i;
- GLuint arg_sums[2];
-
- /* get typeinfo of the constructor (the result of constructor expression) */
- if (!slang_assembly_typeinfo_construct (&ti))
- return GL_FALSE;
- if (!_slang_typeof_operation (A, op, &ti))
- goto end1;
-
- /* create an aggregate of the constructor */
- if (!slang_storage_aggregate_construct (&agg))
- goto end1;
- if (!_slang_aggregate_variable (&agg, &ti.spec, 0, A->space.funcs, A->space.structs,
- A->space.vars, A->mach, A->file, A->atoms))
- goto end2;
-
- /* calculate size of the constructor */
- size = _slang_sizeof_aggregate (&agg);
-
- /* flatten the constructor */
- if (!slang_storage_aggregate_construct (&flat))
- goto end2;
- if (!_slang_flatten_aggregate (&flat, &agg))
- goto end;
-
- /* collect the last two constructor's argument size sums */
- arg_sums[0] = 0; /* will hold all but the last argument's size sum */
- arg_sums[1] = 0; /* will hold all argument's size sum */
- for (i = 0; i < op->num_children; i++)
- {
- GLuint arg_size = 0;
-
- if (!sizeof_argument (A, &arg_size, &op->children[i]))
- goto end;
- if (i > 0)
- arg_sums[0] = arg_sums[1];
- arg_sums[1] += arg_size;
- }
-
- /* check if there are too many arguments */
- if (arg_sums[0] >= size)
- {
- /* TODO: info log: too many arguments in constructor list */
- goto end;
- }
-
- /* check if there are too few arguments */
- if (arg_sums[1] < size)
- {
- /* TODO: info log: too few arguments in constructor list */
- goto end;
- }
-
- /* traverse the children that form the constructor expression */
- for (i = op->num_children; i > 0; i--)
- {
- GLuint garbage_size;
-
- /* the last argument may be too big - calculate the unnecessary data size */
- if (i == op->num_children)
- garbage_size = arg_sums[1] - size;
- else
- garbage_size = 0;
-
- if (!constructor_aggregate (A, &flat, &op->children[i - 1], garbage_size))
- goto end;
- }
-
- result = GL_TRUE;
-end:
- slang_storage_aggregate_destruct (&flat);
-end2:
- slang_storage_aggregate_destruct (&agg);
-end1:
- slang_assembly_typeinfo_destruct (&ti);
- return result;
+ slang_assembly_typeinfo ti;
+ GLboolean result = GL_FALSE;
+ slang_storage_aggregate agg, flat;
+ GLuint size, i;
+ GLuint arg_sums[2];
+
+ /* get typeinfo of the constructor (the result of constructor expression) */
+ if (!slang_assembly_typeinfo_construct(&ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation(A, op, &ti))
+ goto end1;
+
+ /* create an aggregate of the constructor */
+ if (!slang_storage_aggregate_construct(&agg))
+ goto end1;
+ if (!_slang_aggregate_variable(&agg, &ti.spec, 0, A->space.funcs,
+ A->space.structs, A->space.vars,
+ A->mach, A->file, A->atoms))
+ goto end2;
+
+ /* calculate size of the constructor */
+ size = _slang_sizeof_aggregate(&agg);
+
+ /* flatten the constructor */
+ if (!slang_storage_aggregate_construct(&flat))
+ goto end2;
+ if (!_slang_flatten_aggregate(&flat, &agg))
+ goto end;
+
+ /* collect the last two constructor's argument size sums */
+ arg_sums[0] = 0; /* will hold all but the last argument's size sum */
+ arg_sums[1] = 0; /* will hold all argument's size sum */
+ for (i = 0; i < op->num_children; i++) {
+ GLuint arg_size = 0;
+
+ if (!sizeof_argument(A, &arg_size, &op->children[i]))
+ goto end;
+ if (i > 0)
+ arg_sums[0] = arg_sums[1];
+ arg_sums[1] += arg_size;
+ }
+
+ /* check if there are too many arguments */
+ if (arg_sums[0] >= size) {
+ /* TODO: info log: too many arguments in constructor list */
+ goto end;
+ }
+
+ /* check if there are too few arguments */
+ if (arg_sums[1] < size) {
+ /* TODO: info log: too few arguments in constructor list */
+ goto end;
+ }
+
+ /* traverse the children that form the constructor expression */
+ for (i = op->num_children; i > 0; i--) {
+ GLuint garbage_size;
+
+ /* the last argument may be too big - calculate the unnecessary
+ * data size
+ */
+ if (i == op->num_children)
+ garbage_size = arg_sums[1] - size;
+ else
+ garbage_size = 0;
+
+ if (!constructor_aggregate
+ (A, &flat, &op->children[i - 1], garbage_size))
+ goto end;
+ }
+
+ result = GL_TRUE;
+ end:
+ slang_storage_aggregate_destruct(&flat);
+ end2:
+ slang_storage_aggregate_destruct(&agg);
+ end1:
+ slang_assembly_typeinfo_destruct(&ti);
+ return result;
}
-/* _slang_assemble_constructor_from_swizzle() */
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *A, const slang_swizzle *swz,
- slang_type_specifier *spec, slang_type_specifier *master_spec)
+
+GLboolean
+_slang_assemble_constructor_from_swizzle(slang_assemble_ctx * A,
+ const slang_swizzle * swz,
+ const slang_type_specifier * spec,
+ const slang_type_specifier * master_spec)
{
- GLuint master_rows, i;
-
- master_rows = _slang_type_dim (master_spec->type);
- for (i = 0; i < master_rows; i++)
- {
- switch (_slang_type_base (master_spec->type))
- {
- case slang_spec_bool:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_bool_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- case slang_spec_int:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_int_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- case slang_spec_float:
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_float_copy,
- (master_rows - i) * 4, i * 4))
- return GL_FALSE;
- break;
- default:
- break;
- }
- }
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_free, 4))
- return GL_FALSE;
- for (i = swz->num_components; i > 0; i--)
- {
- GLuint n = i - 1;
-
- if (!slang_assembly_file_push_label2 (A->file, slang_asm_local_addr, A->local.swizzle_tmp, 16))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_addr_push, swz->swizzle[n] * 4))
- return GL_FALSE;
- if (!slang_assembly_file_push (A->file, slang_asm_addr_add))
- return GL_FALSE;
- switch (_slang_type_base (master_spec->type))
- {
- case slang_spec_bool:
- if (!slang_assembly_file_push (A->file, slang_asm_bool_deref))
- return GL_FALSE;
- break;
- case slang_spec_int:
- if (!slang_assembly_file_push (A->file, slang_asm_int_deref))
- return GL_FALSE;
- break;
- case slang_spec_float:
- if (!slang_assembly_file_push (A->file, slang_asm_float_deref))
- return GL_FALSE;
- break;
- default:
- break;
- }
- }
-
- return GL_TRUE;
-}
+ const GLuint master_rows = _slang_type_dim(master_spec->type);
+ GLuint i;
+
+ for (i = 0; i < master_rows; i++) {
+ switch (_slang_type_base(master_spec->type)) {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_bool_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_int_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_float_copy,
+ (master_rows - i) * 4, i * 4))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_free, 4))
+ return GL_FALSE;
+ for (i = swz->num_components; i > 0; i--) {
+ const GLuint n = i - 1;
+
+ if (!slang_assembly_file_push_label2(A->file, slang_asm_local_addr,
+ A->local.swizzle_tmp, 16))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_addr_push,
+ swz->swizzle[n] * 4))
+ return GL_FALSE;
+ if (!slang_assembly_file_push(A->file, slang_asm_addr_add))
+ return GL_FALSE;
+
+ switch (_slang_type_base(master_spec->type)) {
+ case slang_spec_bool:
+ if (!slang_assembly_file_push(A->file, slang_asm_bool_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_int:
+ if (!slang_assembly_file_push(A->file, slang_asm_int_deref))
+ return GL_FALSE;
+ break;
+ case slang_spec_float:
+ if (!slang_assembly_file_push(A->file, slang_asm_float_deref))
+ return GL_FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return GL_TRUE;
+}
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.h b/src/mesa/shader/slang/slang_assemble_constructor.h
index 41a03943cf5..c0deb913448 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.h
+++ b/src/mesa/shader/slang/slang_assemble_constructor.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,43 +22,36 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
+#ifndef SLANG_ASSEMBLE_CONSTRUCTOR_H
#define SLANG_ASSEMBLE_CONSTRUCTOR_H
#if defined __cplusplus
extern "C" {
#endif
-/*
- * Checks if a field selector is a general swizzle (an r-value swizzle with replicated
- * components or an l-value swizzle mask) for a vector.
- * Returns GL_TRUE if this is the case, <swz> is filled with swizzle information.
- * Returns GL_FALSE otherwise.
- */
-GLboolean _slang_is_swizzle (const char *field, GLuint rows, slang_swizzle *swz);
-/*
- * Checks if a general swizzle is an l-value swizzle - these swizzles do not have
- * duplicated fields.
- * Returns GL_TRUE if this is a swizzle mask.
- * Returns GL_FALSE otherwise
- */
-GLboolean _slang_is_swizzle_mask (const slang_swizzle *swz, GLuint rows);
+extern GLboolean
+_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz);
-/*
- * Combines (multiplies) two swizzles to form single swizzle.
- * Example: "vec.wzyx.yx" --> "vec.zw".
- */
-GLvoid _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
+extern GLboolean
+_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows);
+
+extern GLvoid
+_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *,
+ const slang_swizzle *);
-GLboolean _slang_assemble_constructor (slang_assemble_ctx *, struct slang_operation_ *);
+extern GLboolean
+_slang_assemble_constructor(slang_assemble_ctx *,
+ const struct slang_operation_ *);
-GLboolean _slang_assemble_constructor_from_swizzle (slang_assemble_ctx *, const slang_swizzle *,
- slang_type_specifier *, slang_type_specifier *);
+extern GLboolean
+_slang_assemble_constructor_from_swizzle(slang_assemble_ctx *,
+ const slang_swizzle *,
+ const slang_type_specifier *,
+ const slang_type_specifier *);
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_ASSEMBLE_CONSTRUCTOR_H */
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c
index 58f4e24f256..265e417dadd 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.c
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c
@@ -36,552 +36,590 @@
* slang_type_specifier
*/
-GLvoid slang_type_specifier_ctr (slang_type_specifier *self)
+GLvoid
+slang_type_specifier_ctr(slang_type_specifier * self)
{
- self->type = slang_spec_void;
- self->_struct = NULL;
- self->_array = NULL;
+ self->type = slang_spec_void;
+ self->_struct = NULL;
+ self->_array = NULL;
}
-GLvoid slang_type_specifier_dtr (slang_type_specifier *self)
+GLvoid
+slang_type_specifier_dtr(slang_type_specifier * self)
{
- if (self->_struct != NULL)
- {
- slang_struct_destruct (self->_struct);
- slang_alloc_free (self->_struct);
- }
- if (self->_array != NULL)
- {
- slang_type_specifier_dtr (self->_array);
- slang_alloc_free (self->_array);
- }
+ if (self->_struct != NULL) {
+ slang_struct_destruct(self->_struct);
+ slang_alloc_free(self->_struct);
+ }
+ if (self->_array != NULL) {
+ slang_type_specifier_dtr(self->_array);
+ slang_alloc_free(self->_array);
+ }
}
-GLboolean slang_type_specifier_copy (slang_type_specifier *x, const slang_type_specifier *y)
+GLboolean
+slang_type_specifier_copy(slang_type_specifier * x,
+ const slang_type_specifier * y)
{
- slang_type_specifier z;
-
- slang_type_specifier_ctr (&z);
- z.type = y->type;
- if (z.type == slang_spec_struct)
- {
- z._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (z._struct == NULL)
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- if (!slang_struct_construct (z._struct))
- {
- slang_alloc_free (z._struct);
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- if (!slang_struct_copy (z._struct, y->_struct))
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- }
- else if (z.type == slang_spec_array)
- {
- z._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (slang_type_specifier));
- if (z._array == NULL)
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- slang_type_specifier_ctr (z._array);
- if (!slang_type_specifier_copy (z._array, y->_array))
- {
- slang_type_specifier_dtr (&z);
- return GL_FALSE;
- }
- }
- slang_type_specifier_dtr (x);
- *x = z;
- return GL_TRUE;
+ slang_type_specifier z;
+
+ slang_type_specifier_ctr(&z);
+ z.type = y->type;
+ if (z.type == slang_spec_struct) {
+ z._struct = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (z._struct == NULL) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_construct(z._struct)) {
+ slang_alloc_free(z._struct);
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy(z._struct, y->_struct)) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ }
+ else if (z.type == slang_spec_array) {
+ z._array =
+ (slang_type_specifier *)
+ slang_alloc_malloc(sizeof(slang_type_specifier));
+ if (z._array == NULL) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr(z._array);
+ if (!slang_type_specifier_copy(z._array, y->_array)) {
+ slang_type_specifier_dtr(&z);
+ return GL_FALSE;
+ }
+ }
+ slang_type_specifier_dtr(x);
+ *x = z;
+ return GL_TRUE;
}
-GLboolean slang_type_specifier_equal (const slang_type_specifier *x, const slang_type_specifier *y)
+GLboolean
+slang_type_specifier_equal(const slang_type_specifier * x,
+ const slang_type_specifier * y)
{
- if (x->type != y->type)
- return 0;
- if (x->type == slang_spec_struct)
- return slang_struct_equal (x->_struct, y->_struct);
- if (x->type == slang_spec_array)
- return slang_type_specifier_equal (x->_array, y->_array);
- return 1;
+ if (x->type != y->type)
+ return 0;
+ if (x->type == slang_spec_struct)
+ return slang_struct_equal(x->_struct, y->_struct);
+ if (x->type == slang_spec_array)
+ return slang_type_specifier_equal(x->_array, y->_array);
+ return 1;
}
/* slang_assembly_typeinfo */
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *ti)
+GLboolean
+slang_assembly_typeinfo_construct(slang_assembly_typeinfo * ti)
{
- slang_type_specifier_ctr (&ti->spec);
- ti->array_len = 0;
- return GL_TRUE;
+ slang_type_specifier_ctr(&ti->spec);
+ ti->array_len = 0;
+ return GL_TRUE;
}
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *ti)
+GLvoid
+slang_assembly_typeinfo_destruct(slang_assembly_typeinfo * ti)
{
- slang_type_specifier_dtr (&ti->spec);
+ slang_type_specifier_dtr(&ti->spec);
}
/* _slang_typeof_operation() */
-static GLboolean typeof_existing_function (const char *name, slang_operation *params,
- GLuint num_params, slang_assembly_name_space *space, slang_type_specifier *spec,
- slang_atom_pool *atoms)
+/**
+ * Determine the return type of a function.
+ * \param name name of the function
+ * \param params array of function parameters
+ * \param num_params number of parameters
+ * \param space namespace to use
+ * \param spec returns the function's type
+ * \param atoms atom pool
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+static GLboolean
+typeof_existing_function(const char *name, const slang_operation * params,
+ GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_type_specifier * spec,
+ slang_atom_pool * atoms)
{
- slang_atom atom;
- GLboolean exists;
-
- atom = slang_atom_pool_atom (atoms, name);
- if (!_slang_typeof_function (atom, params, num_params, space, spec, &exists, atoms))
- return GL_FALSE;
- return exists;
+ slang_atom atom;
+ GLboolean exists;
+
+ atom = slang_atom_pool_atom(atoms, name);
+ if (!_slang_typeof_function(atom, params, num_params, space, spec,
+ &exists, atoms))
+ return GL_FALSE;
+ return exists;
}
-GLboolean _slang_typeof_operation (slang_assemble_ctx *A, slang_operation *op,
- slang_assembly_typeinfo *ti)
+GLboolean
+_slang_typeof_operation(const slang_assemble_ctx * A,
+ const slang_operation * op,
+ slang_assembly_typeinfo * ti)
{
- return _slang_typeof_operation_ (op, &A->space, ti, A->atoms);
+ return _slang_typeof_operation_(op, &A->space, ti, A->atoms);
}
-GLboolean _slang_typeof_operation_ (slang_operation *op, slang_assembly_name_space *space,
- slang_assembly_typeinfo *ti, slang_atom_pool *atoms)
+
+/**
+ * Determine the return type of an operation.
+ * \param op the operation node
+ * \param space the namespace to use
+ * \param ti the returned type
+ * \param atoms atom pool
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+GLboolean
+_slang_typeof_operation_(const slang_operation * op,
+ const slang_assembly_name_space * space,
+ slang_assembly_typeinfo * ti,
+ slang_atom_pool * atoms)
{
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
-
- switch (op->type)
- {
- case slang_oper_block_no_new_scope:
- case slang_oper_block_new_scope:
- case slang_oper_variable_decl:
- case slang_oper_asm:
- case slang_oper_break:
- case slang_oper_continue:
- case slang_oper_discard:
- case slang_oper_return:
- case slang_oper_if:
- case slang_oper_while:
- case slang_oper_do:
- case slang_oper_for:
- case slang_oper_void:
- ti->spec.type = slang_spec_void;
- break;
- case slang_oper_expression:
- case slang_oper_assign:
- case slang_oper_addassign:
- case slang_oper_subassign:
- case slang_oper_mulassign:
- case slang_oper_divassign:
- case slang_oper_preincrement:
- case slang_oper_predecrement:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return 0;
- break;
- case slang_oper_literal_bool:
- case slang_oper_logicalor:
- case slang_oper_logicalxor:
- case slang_oper_logicaland:
- case slang_oper_equal:
- case slang_oper_notequal:
- case slang_oper_less:
- case slang_oper_greater:
- case slang_oper_lessequal:
- case slang_oper_greaterequal:
- case slang_oper_not:
- ti->spec.type = slang_spec_bool;
- break;
- case slang_oper_literal_int:
- ti->spec.type = slang_spec_int;
- break;
- case slang_oper_literal_float:
- ti->spec.type = slang_spec_float;
- break;
- case slang_oper_identifier:
- {
- slang_variable *var;
-
- var = _slang_locate_variable (op->locals, op->a_id, GL_TRUE);
- if (var == NULL)
- return GL_FALSE;
- if (!slang_type_specifier_copy (&ti->spec, &var->type.specifier))
- return GL_FALSE;
- ti->can_be_referenced = GL_TRUE;
- ti->array_len = var->array_len;
- }
- break;
- case slang_oper_sequence:
- /* TODO: check [0] and [1] if they match */
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- /*case slang_oper_modassign:*/
- /*case slang_oper_lshassign:*/
- /*case slang_oper_rshassign:*/
- /*case slang_oper_orassign:*/
- /*case slang_oper_xorassign:*/
- /*case slang_oper_andassign:*/
- case slang_oper_select:
- /* TODO: check [1] and [2] if they match */
- if (!_slang_typeof_operation_ (&op->children[1], space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- /*case slang_oper_bitor:*/
- /*case slang_oper_bitxor:*/
- /*case slang_oper_bitand:*/
- /*case slang_oper_lshift:*/
- /*case slang_oper_rshift:*/
- case slang_oper_add:
- if (!typeof_existing_function ("+", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_subtract:
- if (!typeof_existing_function ("-", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_multiply:
- if (!typeof_existing_function ("*", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- case slang_oper_divide:
- if (!typeof_existing_function ("/", op->children, 2, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- /*case slang_oper_modulus:*/
- case slang_oper_plus:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- case slang_oper_minus:
- if (!typeof_existing_function ("-", op->children, 1, space, &ti->spec, atoms))
- return GL_FALSE;
- break;
- /*case slang_oper_complement:*/
- case slang_oper_subscript:
- {
- slang_assembly_typeinfo _ti;
-
- if (!slang_assembly_typeinfo_construct (&_ti))
- return GL_FALSE;
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->can_be_referenced = _ti.can_be_referenced;
- if (_ti.spec.type == slang_spec_array)
- {
- if (!slang_type_specifier_copy (&ti->spec, _ti.spec._array))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- }
- else
- {
- if (!_slang_type_is_vector (_ti.spec.type) && !_slang_type_is_matrix (_ti.spec.type))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->spec.type = _slang_type_base (_ti.spec.type);
- }
- slang_assembly_typeinfo_destruct (&_ti);
- }
- break;
- case slang_oper_call:
- {
- GLboolean exists;
-
- if (!_slang_typeof_function (op->a_id, op->children, op->num_children, space, &ti->spec,
- &exists, atoms))
- return GL_FALSE;
- if (!exists)
- {
- slang_struct *s = slang_struct_scope_find (space->structs, op->a_id, GL_TRUE);
- if (s != NULL)
- {
- ti->spec.type = slang_spec_struct;
- ti->spec._struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (ti->spec._struct == NULL)
- return GL_FALSE;
- if (!slang_struct_construct (ti->spec._struct))
- {
- slang_alloc_free (ti->spec._struct);
- ti->spec._struct = NULL;
- return GL_FALSE;
- }
- if (!slang_struct_copy (ti->spec._struct, s))
- return GL_FALSE;
- }
- else
- {
- const char *name;
- slang_type_specifier_type type;
-
- name = slang_atom_pool_id (atoms, op->a_id);
- type = slang_type_specifier_type_from_string (name);
- if (type == slang_spec_void)
- return GL_FALSE;
- ti->spec.type = type;
- }
- }
- }
- break;
- case slang_oper_field:
- {
- slang_assembly_typeinfo _ti;
-
- if (!slang_assembly_typeinfo_construct (&_ti))
- return GL_FALSE;
- if (!_slang_typeof_operation_ (op->children, space, &_ti, atoms))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- if (_ti.spec.type == slang_spec_struct)
- {
- slang_variable *field;
-
- field = _slang_locate_variable (_ti.spec._struct->fields, op->a_id, GL_FALSE);
- if (field == NULL)
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- if (!slang_type_specifier_copy (&ti->spec, &field->type.specifier))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->can_be_referenced = _ti.can_be_referenced;
- }
- else
- {
- GLuint rows;
- const char *swizzle;
- slang_type_specifier_type base;
-
- /* determine the swizzle of the field expression */
- if (!_slang_type_is_vector (_ti.spec.type))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- rows = _slang_type_dim (_ti.spec.type);
- swizzle = slang_atom_pool_id (atoms, op->a_id);
- if (!_slang_is_swizzle (swizzle, rows, &ti->swz))
- {
- slang_assembly_typeinfo_destruct (&_ti);
- return GL_FALSE;
- }
- ti->is_swizzled = GL_TRUE;
- ti->can_be_referenced = _ti.can_be_referenced && _slang_is_swizzle_mask (&ti->swz,
- rows);
- if (_ti.is_swizzled)
- {
- slang_swizzle swz;
-
- /* swizzle the swizzle */
- _slang_multiply_swizzles (&swz, &_ti.swz, &ti->swz);
- ti->swz = swz;
- }
- base = _slang_type_base (_ti.spec.type);
- switch (ti->swz.num_components)
- {
- case 1:
- ti->spec.type = base;
- break;
- case 2:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec2;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec2;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec2;
- break;
- default:
- break;
- }
- break;
- case 3:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec3;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec3;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec3;
- break;
- default:
- break;
- }
- break;
- case 4:
- switch (base)
- {
- case slang_spec_float:
- ti->spec.type = slang_spec_vec4;
- break;
- case slang_spec_int:
- ti->spec.type = slang_spec_ivec4;
- break;
- case slang_spec_bool:
- ti->spec.type = slang_spec_bvec4;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- slang_assembly_typeinfo_destruct (&_ti);
- }
- break;
- case slang_oper_postincrement:
- case slang_oper_postdecrement:
- if (!_slang_typeof_operation_ (op->children, space, ti, atoms))
- return GL_FALSE;
- ti->can_be_referenced = GL_FALSE;
- ti->is_swizzled = GL_FALSE;
- break;
- default:
- return GL_FALSE;
- }
-
- return GL_TRUE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+
+ switch (op->type) {
+ case slang_oper_block_no_new_scope:
+ case slang_oper_block_new_scope:
+ case slang_oper_variable_decl:
+ case slang_oper_asm:
+ case slang_oper_break:
+ case slang_oper_continue:
+ case slang_oper_discard:
+ case slang_oper_return:
+ case slang_oper_if:
+ case slang_oper_while:
+ case slang_oper_do:
+ case slang_oper_for:
+ case slang_oper_void:
+ ti->spec.type = slang_spec_void;
+ break;
+ case slang_oper_expression:
+ case slang_oper_assign:
+ case slang_oper_addassign:
+ case slang_oper_subassign:
+ case slang_oper_mulassign:
+ case slang_oper_divassign:
+ case slang_oper_preincrement:
+ case slang_oper_predecrement:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return 0;
+ break;
+ case slang_oper_literal_bool:
+ case slang_oper_logicalor:
+ case slang_oper_logicalxor:
+ case slang_oper_logicaland:
+ case slang_oper_equal:
+ case slang_oper_notequal:
+ case slang_oper_less:
+ case slang_oper_greater:
+ case slang_oper_lessequal:
+ case slang_oper_greaterequal:
+ case slang_oper_not:
+ ti->spec.type = slang_spec_bool;
+ break;
+ case slang_oper_literal_int:
+ ti->spec.type = slang_spec_int;
+ break;
+ case slang_oper_literal_float:
+ ti->spec.type = slang_spec_float;
+ break;
+ case slang_oper_identifier:
+ {
+ slang_variable *var;
+
+ var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE);
+ if (var == NULL)
+ return GL_FALSE;
+ if (!slang_type_specifier_copy(&ti->spec, &var->type.specifier))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_TRUE;
+ ti->array_len = var->array_len;
+ }
+ break;
+ case slang_oper_sequence:
+ /* TODO: check [0] and [1] if they match */
+ if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_modassign: */
+ /*case slang_oper_lshassign: */
+ /*case slang_oper_rshassign: */
+ /*case slang_oper_orassign: */
+ /*case slang_oper_xorassign: */
+ /*case slang_oper_andassign: */
+ case slang_oper_select:
+ /* TODO: check [1] and [2] if they match */
+ if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ /*case slang_oper_bitor: */
+ /*case slang_oper_bitxor: */
+ /*case slang_oper_bitand: */
+ /*case slang_oper_lshift: */
+ /*case slang_oper_rshift: */
+ case slang_oper_add:
+ if (!typeof_existing_function("+", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_subtract:
+ if (!typeof_existing_function("-", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_multiply:
+ if (!typeof_existing_function("*", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ case slang_oper_divide:
+ if (!typeof_existing_function("/", op->children, 2, space,
+ &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_modulus: */
+ case slang_oper_plus:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ case slang_oper_minus:
+ if (!typeof_existing_function
+ ("-", op->children, 1, space, &ti->spec, atoms))
+ return GL_FALSE;
+ break;
+ /*case slang_oper_complement: */
+ case slang_oper_subscript:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct(&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ if (_ti.spec.type == slang_spec_array) {
+ if (!slang_type_specifier_copy(&ti->spec, _ti.spec._array)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ }
+ else {
+ if (!_slang_type_is_vector(_ti.spec.type)
+ && !_slang_type_is_matrix(_ti.spec.type)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->spec.type = _slang_type_base(_ti.spec.type);
+ }
+ slang_assembly_typeinfo_destruct(&_ti);
+ }
+ break;
+ case slang_oper_call:
+ {
+ GLboolean exists;
+
+ if (!_slang_typeof_function(op->a_id, op->children, op->num_children,
+ space, &ti->spec, &exists, atoms))
+ return GL_FALSE;
+ if (!exists) {
+ slang_struct *s =
+ slang_struct_scope_find(space->structs, op->a_id, GL_TRUE);
+ if (s != NULL) {
+ ti->spec.type = slang_spec_struct;
+ ti->spec._struct =
+ (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (ti->spec._struct == NULL)
+ return GL_FALSE;
+ if (!slang_struct_construct(ti->spec._struct)) {
+ slang_alloc_free(ti->spec._struct);
+ ti->spec._struct = NULL;
+ return GL_FALSE;
+ }
+ if (!slang_struct_copy(ti->spec._struct, s))
+ return GL_FALSE;
+ }
+ else {
+ const char *name;
+ slang_type_specifier_type type;
+
+ name = slang_atom_pool_id(atoms, op->a_id);
+ type = slang_type_specifier_type_from_string(name);
+ if (type == slang_spec_void)
+ return GL_FALSE;
+ ti->spec.type = type;
+ }
+ }
+ }
+ break;
+ case slang_oper_field:
+ {
+ slang_assembly_typeinfo _ti;
+
+ if (!slang_assembly_typeinfo_construct(&_ti))
+ return GL_FALSE;
+ if (!_slang_typeof_operation_(op->children, space, &_ti, atoms)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ if (_ti.spec.type == slang_spec_struct) {
+ slang_variable *field;
+
+ field =
+ _slang_locate_variable(_ti.spec._struct->fields, op->a_id,
+ GL_FALSE);
+ if (field == NULL) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ if (!slang_type_specifier_copy(&ti->spec, &field->type.specifier)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->can_be_referenced = _ti.can_be_referenced;
+ }
+ else {
+ GLuint rows;
+ const char *swizzle;
+ slang_type_specifier_type base;
+
+ /* determine the swizzle of the field expression */
+ if (!_slang_type_is_vector(_ti.spec.type)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ rows = _slang_type_dim(_ti.spec.type);
+ swizzle = slang_atom_pool_id(atoms, op->a_id);
+ if (!_slang_is_swizzle(swizzle, rows, &ti->swz)) {
+ slang_assembly_typeinfo_destruct(&_ti);
+ return GL_FALSE;
+ }
+ ti->is_swizzled = GL_TRUE;
+ ti->can_be_referenced = _ti.can_be_referenced
+ && _slang_is_swizzle_mask(&ti->swz, rows);
+ if (_ti.is_swizzled) {
+ slang_swizzle swz;
+
+ /* swizzle the swizzle */
+ _slang_multiply_swizzles(&swz, &_ti.swz, &ti->swz);
+ ti->swz = swz;
+ }
+ base = _slang_type_base(_ti.spec.type);
+ switch (ti->swz.num_components) {
+ case 1:
+ ti->spec.type = base;
+ break;
+ case 2:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec2;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec2;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec2;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 3:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec3;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec3;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec3;
+ break;
+ default:
+ break;
+ }
+ break;
+ case 4:
+ switch (base) {
+ case slang_spec_float:
+ ti->spec.type = slang_spec_vec4;
+ break;
+ case slang_spec_int:
+ ti->spec.type = slang_spec_ivec4;
+ break;
+ case slang_spec_bool:
+ ti->spec.type = slang_spec_bvec4;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ slang_assembly_typeinfo_destruct(&_ti);
+ }
+ break;
+ case slang_oper_postincrement:
+ case slang_oper_postdecrement:
+ if (!_slang_typeof_operation_(op->children, space, ti, atoms))
+ return GL_FALSE;
+ ti->can_be_referenced = GL_FALSE;
+ ti->is_swizzled = GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
}
-/* _slang_typeof_function() */
-GLboolean _slang_typeof_function (slang_atom a_name, slang_operation *params, GLuint num_params,
- slang_assembly_name_space *space, slang_type_specifier *spec, GLboolean *exists,
- slang_atom_pool *atoms)
+
+/**
+ * Determine the return type of a function.
+ * \param a_name the function name
+ * \param param function parameters (overloading)
+ * \param num_params number of parameters to function
+ * \param space namespace to search
+ * \param exists returns GL_TRUE or GL_FALSE to indicate existance of function
+ * \return GL_TRUE for success, GL_FALSE if failure (bad function name)
+ */
+GLboolean
+_slang_typeof_function(slang_atom a_name, const slang_operation * params,
+ GLuint num_params,
+ const slang_assembly_name_space * space,
+ slang_type_specifier * spec, GLboolean * exists,
+ slang_atom_pool * atoms)
{
- slang_function *fun;
-
- fun = _slang_locate_function (space->funcs, a_name, params, num_params, space, atoms);
- *exists = fun != NULL;
- if (fun == NULL)
- return GL_TRUE;
- return slang_type_specifier_copy (spec, &fun->header.type.specifier);
+ slang_function *fun = _slang_locate_function(space->funcs, a_name, params,
+ num_params, space, atoms);
+ *exists = fun != NULL;
+ if (!fun)
+ return GL_TRUE; /* yes, not false */
+ return slang_type_specifier_copy(spec, &fun->header.type.specifier);
}
-/* _slang_type_is_matrix() */
-GLboolean _slang_type_is_matrix (slang_type_specifier_type ty)
+
+/**
+ * Determine if a type is a matrix.
+ * \return GL_TRUE if is a matrix, GL_FALSE otherwise.
+ */
+GLboolean
+_slang_type_is_matrix(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_mat2:
- case slang_spec_mat3:
- case slang_spec_mat4:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
+ switch (ty) {
+ case slang_spec_mat2:
+ case slang_spec_mat3:
+ case slang_spec_mat4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
}
-/* _slang_type_is_vector() */
-GLboolean _slang_type_is_vector (slang_type_specifier_type ty)
+/**
+ * Determine if a type is a vector.
+ * \return GL_TRUE if is a vector, GL_FALSE otherwise.
+ */
+GLboolean
+_slang_type_is_vector(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
+ switch (ty) {
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
}
-/* _slang_type_base_of_vector() */
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type ty)
+/**
+ * Given a vector type, return the type of the vector's elements
+ */
+slang_type_specifier_type
+_slang_type_base(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_float:
- case slang_spec_vec2:
- case slang_spec_vec3:
- case slang_spec_vec4:
- return slang_spec_float;
- case slang_spec_int:
- case slang_spec_ivec2:
- case slang_spec_ivec3:
- case slang_spec_ivec4:
- return slang_spec_int;
- case slang_spec_bool:
- case slang_spec_bvec2:
- case slang_spec_bvec3:
- case slang_spec_bvec4:
- return slang_spec_bool;
- case slang_spec_mat2:
- return slang_spec_vec2;
- case slang_spec_mat3:
- return slang_spec_vec3;
- case slang_spec_mat4:
- return slang_spec_vec4;
- default:
- return slang_spec_void;
- }
+ switch (ty) {
+ case slang_spec_float:
+ case slang_spec_vec2:
+ case slang_spec_vec3:
+ case slang_spec_vec4:
+ return slang_spec_float;
+ case slang_spec_int:
+ case slang_spec_ivec2:
+ case slang_spec_ivec3:
+ case slang_spec_ivec4:
+ return slang_spec_int;
+ case slang_spec_bool:
+ case slang_spec_bvec2:
+ case slang_spec_bvec3:
+ case slang_spec_bvec4:
+ return slang_spec_bool;
+ case slang_spec_mat2:
+ return slang_spec_vec2;
+ case slang_spec_mat3:
+ return slang_spec_vec3;
+ case slang_spec_mat4:
+ return slang_spec_vec4;
+ default:
+ return slang_spec_void;
+ }
}
-/* _slang_type_dim */
-GLuint _slang_type_dim (slang_type_specifier_type ty)
+/**
+ * Return the dimensionality of a vector or matrix type.
+ */
+GLuint
+_slang_type_dim(slang_type_specifier_type ty)
{
- switch (ty)
- {
- case slang_spec_float:
- case slang_spec_int:
- case slang_spec_bool:
- return 1;
- case slang_spec_vec2:
- case slang_spec_ivec2:
- case slang_spec_bvec2:
- case slang_spec_mat2:
- return 2;
- case slang_spec_vec3:
- case slang_spec_ivec3:
- case slang_spec_bvec3:
- case slang_spec_mat3:
- return 3;
- case slang_spec_vec4:
- case slang_spec_ivec4:
- case slang_spec_bvec4:
- case slang_spec_mat4:
- return 4;
- default:
- return 0;
- }
+ switch (ty) {
+ case slang_spec_float:
+ case slang_spec_int:
+ case slang_spec_bool:
+ return 1;
+ case slang_spec_vec2:
+ case slang_spec_ivec2:
+ case slang_spec_bvec2:
+ case slang_spec_mat2:
+ return 2;
+ case slang_spec_vec3:
+ case slang_spec_ivec3:
+ case slang_spec_bvec3:
+ case slang_spec_mat3:
+ return 3;
+ case slang_spec_vec4:
+ case slang_spec_ivec4:
+ case slang_spec_bvec4:
+ case slang_spec_mat4:
+ return 4;
+ default:
+ return 0;
+ }
}
-
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h
index 7e8af96915b..777dc21f3a7 100644
--- a/src/mesa/shader/slang/slang_assemble_typeinfo.h
+++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h
@@ -29,84 +29,120 @@
extern "C" {
#endif
+
+/**
+ * The basic shading language types (float, vec4, mat3, etc)
+ */
typedef enum slang_type_specifier_type_
{
- slang_spec_void,
- slang_spec_bool,
- slang_spec_bvec2,
- slang_spec_bvec3,
- slang_spec_bvec4,
- slang_spec_int,
- slang_spec_ivec2,
- slang_spec_ivec3,
- slang_spec_ivec4,
- slang_spec_float,
- slang_spec_vec2,
- slang_spec_vec3,
- slang_spec_vec4,
- slang_spec_mat2,
- slang_spec_mat3,
- slang_spec_mat4,
- slang_spec_sampler1D,
- slang_spec_sampler2D,
- slang_spec_sampler3D,
- slang_spec_samplerCube,
- slang_spec_sampler1DShadow,
- slang_spec_sampler2DShadow,
- slang_spec_struct,
- slang_spec_array
+ slang_spec_void,
+ slang_spec_bool,
+ slang_spec_bvec2,
+ slang_spec_bvec3,
+ slang_spec_bvec4,
+ slang_spec_int,
+ slang_spec_ivec2,
+ slang_spec_ivec3,
+ slang_spec_ivec4,
+ slang_spec_float,
+ slang_spec_vec2,
+ slang_spec_vec3,
+ slang_spec_vec4,
+ slang_spec_mat2,
+ slang_spec_mat3,
+ slang_spec_mat4,
+ slang_spec_sampler1D,
+ slang_spec_sampler2D,
+ slang_spec_sampler3D,
+ slang_spec_samplerCube,
+ slang_spec_sampler1DShadow,
+ slang_spec_sampler2DShadow,
+ slang_spec_struct,
+ slang_spec_array
} slang_type_specifier_type;
+
+/**
+ * Describes more sophisticated types, like structs and arrays.
+ */
typedef struct slang_type_specifier_
{
- slang_type_specifier_type type;
- struct slang_struct_ *_struct; /* type: spec_struct */
- struct slang_type_specifier_ *_array; /* type: spec_array */
+ slang_type_specifier_type type;
+ struct slang_struct_ *_struct; /**< used if type == spec_struct */
+ struct slang_type_specifier_ *_array; /**< used if type == spec_array */
} slang_type_specifier;
-GLvoid slang_type_specifier_ctr (slang_type_specifier *);
-GLvoid slang_type_specifier_dtr (slang_type_specifier *);
-GLboolean slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
-GLboolean slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
+
+extern GLvoid
+slang_type_specifier_ctr(slang_type_specifier *);
+
+extern GLvoid
+slang_type_specifier_dtr(slang_type_specifier *);
+
+extern GLboolean
+slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *);
+
+extern GLboolean
+slang_type_specifier_equal(const slang_type_specifier *,
+ const slang_type_specifier *);
+
typedef struct slang_assembly_typeinfo_
{
- GLboolean can_be_referenced;
- GLboolean is_swizzled;
- slang_swizzle swz;
- slang_type_specifier spec;
- GLuint array_len;
+ GLboolean can_be_referenced;
+ GLboolean is_swizzled;
+ slang_swizzle swz;
+ slang_type_specifier spec;
+ GLuint array_len;
} slang_assembly_typeinfo;
-GLboolean slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
-GLvoid slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
+extern GLboolean
+slang_assembly_typeinfo_construct(slang_assembly_typeinfo *);
-/*
+extern GLvoid
+slang_assembly_typeinfo_destruct(slang_assembly_typeinfo *);
+
+
+/**
* Retrieves type information about an operation.
* Returns GL_TRUE on success.
* Returns GL_FALSE otherwise.
*/
-GLboolean _slang_typeof_operation (slang_assemble_ctx *, struct slang_operation_ *,
- slang_assembly_typeinfo *);
-GLboolean _slang_typeof_operation_ (struct slang_operation_ *, slang_assembly_name_space *,
- slang_assembly_typeinfo *, slang_atom_pool *);
+extern GLboolean
+_slang_typeof_operation(const slang_assemble_ctx *,
+ const struct slang_operation_ *,
+ slang_assembly_typeinfo *);
-/*
+extern GLboolean
+_slang_typeof_operation_(const struct slang_operation_ *,
+ const slang_assembly_name_space *,
+ slang_assembly_typeinfo *, slang_atom_pool *);
+
+/**
* Retrieves type of a function prototype, if one exists.
* Returns GL_TRUE on success, even if the function was not found.
* Returns GL_FALSE otherwise.
*/
-GLboolean _slang_typeof_function (slang_atom a_name, struct slang_operation_ *params,
- GLuint num_params, slang_assembly_name_space *, slang_type_specifier *spec, GLboolean *exists,
- slang_atom_pool *);
+extern GLboolean
+_slang_typeof_function(slang_atom a_name,
+ const struct slang_operation_ *params,
+ GLuint num_params, const slang_assembly_name_space *,
+ slang_type_specifier *spec, GLboolean *exists,
+ slang_atom_pool *);
+
+extern GLboolean
+_slang_type_is_matrix(slang_type_specifier_type);
+
+extern GLboolean
+_slang_type_is_vector(slang_type_specifier_type);
-GLboolean _slang_type_is_matrix (slang_type_specifier_type);
+extern slang_type_specifier_type
+_slang_type_base(slang_type_specifier_type);
-GLboolean _slang_type_is_vector (slang_type_specifier_type);
+extern GLuint
+_slang_type_dim(slang_type_specifier_type);
-slang_type_specifier_type _slang_type_base (slang_type_specifier_type);
-GLuint _slang_type_dim (slang_type_specifier_type);
#ifdef __cplusplus
}
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 357d61b246a..c49ab4a68dc 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.6
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -35,21 +35,25 @@
#include "slang_storage.h"
/*
- * This is a straightforward implementation of the slang front-end compiler.
- * Lots of error-checking functionality is missing but every well-formed shader source should
- * compile successfully and execute as expected. However, some semantically ill-formed shaders
+ * This is a straightforward implementation of the slang front-end
+ * compiler. Lots of error-checking functionality is missing but
+ * every well-formed shader source should compile successfully and
+ * execute as expected. However, some semantically ill-formed shaders
* may be accepted resulting in undefined behaviour.
*/
-/* slang_var_pool */
-static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size)
-{
- GLuint addr;
- addr = pool->next_addr;
- pool->next_addr += size;
- return addr;
+/**
+ * Allocate storage for a variable of 'size' bytes from given pool.
+ * Return the allocated address for the variable.
+ */
+static GLuint
+slang_var_pool_alloc(slang_var_pool * pool, unsigned int size)
+{
+ const GLuint addr = pool->next_addr;
+ pool->next_addr += size;
+ return addr;
}
/*
@@ -57,20 +61,21 @@ static GLuint slang_var_pool_alloc (slang_var_pool *pool, unsigned int size)
*/
GLvoid
-_slang_code_unit_ctr (slang_code_unit *self, struct slang_code_object_ *object)
+_slang_code_unit_ctr(slang_code_unit * self,
+ struct slang_code_object_ * object)
{
- _slang_variable_scope_ctr (&self->vars);
- _slang_function_scope_ctr (&self->funs);
- _slang_struct_scope_ctr (&self->structs);
+ _slang_variable_scope_ctr(&self->vars);
+ _slang_function_scope_ctr(&self->funs);
+ _slang_struct_scope_ctr(&self->structs);
self->object = object;
}
GLvoid
-_slang_code_unit_dtr (slang_code_unit *self)
+_slang_code_unit_dtr(slang_code_unit * self)
{
- slang_variable_scope_destruct (&self->vars);
- slang_function_scope_destruct (&self->funs);
- slang_struct_scope_destruct (&self->structs);
+ slang_variable_scope_destruct(&self->vars);
+ slang_function_scope_destruct(&self->funs);
+ slang_struct_scope_destruct(&self->structs);
}
/*
@@ -78,296 +83,313 @@ _slang_code_unit_dtr (slang_code_unit *self)
*/
GLvoid
-_slang_code_object_ctr (slang_code_object *self)
+_slang_code_object_ctr(slang_code_object * self)
{
GLuint i;
for (i = 0; i < SLANG_BUILTIN_TOTAL; i++)
- _slang_code_unit_ctr (&self->builtin[i], self);
- _slang_code_unit_ctr (&self->unit, self);
- _slang_assembly_file_ctr (&self->assembly);
- slang_machine_ctr (&self->machine);
+ _slang_code_unit_ctr(&self->builtin[i], self);
+ _slang_code_unit_ctr(&self->unit, self);
+ _slang_assembly_file_ctr(&self->assembly);
+ slang_machine_ctr(&self->machine);
self->varpool.next_addr = 0;
- slang_atom_pool_construct (&self->atompool);
- slang_export_data_table_ctr (&self->expdata);
+ slang_atom_pool_construct(&self->atompool);
+ slang_export_data_table_ctr(&self->expdata);
self->expdata.atoms = &self->atompool;
- slang_export_code_table_ctr (&self->expcode);
+ slang_export_code_table_ctr(&self->expcode);
self->expcode.atoms = &self->atompool;
}
GLvoid
-_slang_code_object_dtr (slang_code_object *self)
+_slang_code_object_dtr(slang_code_object * self)
{
GLuint i;
for (i = 0; i < SLANG_BUILTIN_TOTAL; i++)
- _slang_code_unit_dtr (&self->builtin[i]);
- _slang_code_unit_dtr (&self->unit);
- slang_assembly_file_destruct (&self->assembly);
- slang_machine_dtr (&self->machine);
- slang_atom_pool_destruct (&self->atompool);
- slang_export_data_table_dtr (&self->expdata);
- slang_export_code_table_ctr (&self->expcode);
+ _slang_code_unit_dtr(&self->builtin[i]);
+ _slang_code_unit_dtr(&self->unit);
+ slang_assembly_file_destruct(&self->assembly);
+ slang_machine_dtr(&self->machine);
+ slang_atom_pool_destruct(&self->atompool);
+ slang_export_data_table_dtr(&self->expdata);
+ slang_export_code_table_ctr(&self->expcode);
}
/* slang_info_log */
static char *out_of_memory = "Error: Out of memory.\n";
-void slang_info_log_construct (slang_info_log *log)
+void
+slang_info_log_construct(slang_info_log * log)
{
- log->text = NULL;
- log->dont_free_text = 0;
+ log->text = NULL;
+ log->dont_free_text = 0;
}
-void slang_info_log_destruct (slang_info_log *log)
+void
+slang_info_log_destruct(slang_info_log * log)
{
- if (!log->dont_free_text)
- slang_alloc_free (log->text);
+ if (!log->dont_free_text)
+ slang_alloc_free(log->text);
}
-static int slang_info_log_message (slang_info_log *log, const char *prefix, const char *msg)
+static int
+slang_info_log_message(slang_info_log * log, const char *prefix,
+ const char *msg)
{
GLuint size;
- if (log->dont_free_text)
- return 0;
- size = slang_string_length (msg) + 2;
+ if (log->dont_free_text)
+ return 0;
+ size = slang_string_length(msg) + 2;
if (prefix != NULL)
- size += slang_string_length (prefix) + 2;
+ size += slang_string_length(prefix) + 2;
if (log->text != NULL) {
- GLuint old_len = slang_string_length (log->text);
- log->text = (char *) (slang_alloc_realloc (log->text, old_len + 1, old_len + size));
+ GLuint old_len = slang_string_length(log->text);
+ log->text = (char *)
+ slang_alloc_realloc(log->text, old_len + 1, old_len + size);
}
else {
- log->text = (char *) (slang_alloc_malloc (size));
+ log->text = (char *) (slang_alloc_malloc(size));
if (log->text != NULL)
log->text[0] = '\0';
}
- if (log->text == NULL)
- return 0;
+ if (log->text == NULL)
+ return 0;
if (prefix != NULL) {
- slang_string_concat (log->text, prefix);
- slang_string_concat (log->text, ": ");
+ slang_string_concat(log->text, prefix);
+ slang_string_concat(log->text, ": ");
}
- slang_string_concat (log->text, msg);
- slang_string_concat (log->text, "\n");
- return 1;
+ slang_string_concat(log->text, msg);
+ slang_string_concat(log->text, "\n");
+ return 1;
}
-int slang_info_log_print (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_print(slang_info_log * log, const char *msg, ...)
{
va_list va;
char buf[1024];
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- return slang_info_log_message (log, NULL, buf);
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ return slang_info_log_message(log, NULL, buf);
}
-int slang_info_log_error (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_error(slang_info_log * log, const char *msg, ...)
{
- va_list va;
- char buf[1024];
-
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- if (slang_info_log_message (log, "Error", buf))
- return 1;
- slang_info_log_memory (log);
- return 0;
+ va_list va;
+ char buf[1024];
+
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ if (slang_info_log_message(log, "Error", buf))
+ return 1;
+ slang_info_log_memory(log);
+ return 0;
}
-int slang_info_log_warning (slang_info_log *log, const char *msg, ...)
+int
+slang_info_log_warning(slang_info_log * log, const char *msg, ...)
{
- va_list va;
- char buf[1024];
-
- va_start (va, msg);
- _mesa_vsprintf (buf, msg, va);
- va_end (va);
- if (slang_info_log_message (log, "Warning", buf))
- return 1;
- slang_info_log_memory (log);
- return 0;
+ va_list va;
+ char buf[1024];
+
+ va_start(va, msg);
+ _mesa_vsprintf(buf, msg, va);
+ va_end(va);
+ if (slang_info_log_message(log, "Warning", buf))
+ return 1;
+ slang_info_log_memory(log);
+ return 0;
}
-void slang_info_log_memory (slang_info_log *log)
+void
+slang_info_log_memory(slang_info_log * log)
{
- if (!slang_info_log_message (log, "Error", "Out of memory."))
- {
- log->dont_free_text = 1;
- log->text = out_of_memory;
- }
+ if (!slang_info_log_message(log, "Error", "Out of memory.")) {
+ log->dont_free_text = 1;
+ log->text = out_of_memory;
+ }
}
/* slang_parse_ctx */
typedef struct slang_parse_ctx_
{
- const byte *I;
- slang_info_log *L;
- int parsing_builtin;
- int global_scope;
- slang_atom_pool *atoms;
+ const byte *I;
+ slang_info_log *L;
+ int parsing_builtin;
+ GLboolean global_scope; /**< Is object being declared a global? */
+ slang_atom_pool *atoms;
} slang_parse_ctx;
/* slang_output_ctx */
typedef struct slang_output_ctx_
{
- slang_variable_scope *vars;
- slang_function_scope *funs;
- slang_struct_scope *structs;
- slang_assembly_file *assembly;
- slang_var_pool *global_pool;
- slang_machine *machine;
+ slang_variable_scope *vars;
+ slang_function_scope *funs;
+ slang_struct_scope *structs;
+ slang_assembly_file *assembly;
+ slang_var_pool *global_pool;
+ slang_machine *machine;
} slang_output_ctx;
/* _slang_compile() */
-static void parse_identifier_str (slang_parse_ctx *C, char **id)
+static void
+parse_identifier_str(slang_parse_ctx * C, char **id)
{
- *id = (char *) C->I;
- C->I += _mesa_strlen (*id) + 1;
+ *id = (char *) C->I;
+ C->I += _mesa_strlen(*id) + 1;
}
-static slang_atom parse_identifier (slang_parse_ctx *C)
+static slang_atom
+parse_identifier(slang_parse_ctx * C)
{
- const char *id;
-
- id = (const char *) C->I;
- C->I += _mesa_strlen (id) + 1;
- return slang_atom_pool_atom (C->atoms, id);
+ const char *id;
+
+ id = (const char *) C->I;
+ C->I += _mesa_strlen(id) + 1;
+ return slang_atom_pool_atom(C->atoms, id);
}
-static int parse_number (slang_parse_ctx *C, int *number)
+static int
+parse_number(slang_parse_ctx * C, int *number)
{
- const int radix = (int) (*C->I++);
- *number = 0;
- while (*C->I != '\0')
- {
- int digit;
- if (*C->I >= '0' && *C->I <= '9')
- digit = (int) (*C->I - '0');
- else if (*C->I >= 'A' && *C->I <= 'Z')
- digit = (int) (*C->I - 'A') + 10;
- else
- digit = (int) (*C->I - 'a') + 10;
- *number = *number * radix + digit;
- C->I++;
- }
- C->I++;
- if (*number > 65535)
- slang_info_log_warning (C->L, "%d: literal integer overflow.", *number);
- return 1;
+ const int radix = (int) (*C->I++);
+ *number = 0;
+ while (*C->I != '\0') {
+ int digit;
+ if (*C->I >= '0' && *C->I <= '9')
+ digit = (int) (*C->I - '0');
+ else if (*C->I >= 'A' && *C->I <= 'Z')
+ digit = (int) (*C->I - 'A') + 10;
+ else
+ digit = (int) (*C->I - 'a') + 10;
+ *number = *number * radix + digit;
+ C->I++;
+ }
+ C->I++;
+ if (*number > 65535)
+ slang_info_log_warning(C->L, "%d: literal integer overflow.", *number);
+ return 1;
}
-static int parse_float (slang_parse_ctx *C, float *number)
+static int
+parse_float(slang_parse_ctx * C, float *number)
{
- char *integral = NULL;
- char *fractional = NULL;
- char *exponent = NULL;
- char *whole = NULL;
-
- parse_identifier_str (C, &integral);
- parse_identifier_str (C, &fractional);
- parse_identifier_str (C, &exponent);
-
- whole = (char *) (slang_alloc_malloc ((_mesa_strlen (integral) + _mesa_strlen (fractional) +
- _mesa_strlen (exponent) + 3) * sizeof (char)));
- if (whole == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
-
- slang_string_copy (whole, integral);
- slang_string_concat (whole, ".");
- slang_string_concat (whole, fractional);
- slang_string_concat (whole, "E");
- slang_string_concat (whole, exponent);
-
- *number = (float) (_mesa_strtod(whole, (char **)NULL));
-
- slang_alloc_free (whole);
- return 1;
+ char *integral = NULL;
+ char *fractional = NULL;
+ char *exponent = NULL;
+ char *whole = NULL;
+
+ parse_identifier_str(C, &integral);
+ parse_identifier_str(C, &fractional);
+ parse_identifier_str(C, &exponent);
+
+ whole = (char *) (slang_alloc_malloc((_mesa_strlen(integral) +
+ _mesa_strlen(fractional) +
+ _mesa_strlen(exponent) + 3) * sizeof(char)));
+ if (whole == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ slang_string_copy(whole, integral);
+ slang_string_concat(whole, ".");
+ slang_string_concat(whole, fractional);
+ slang_string_concat(whole, "E");
+ slang_string_concat(whole, exponent);
+
+ *number = (float) (_mesa_strtod(whole, (char **) NULL));
+
+ slang_alloc_free(whole);
+ return 1;
}
/* revision number - increment after each change affecting emitted output */
#define REVISION 3
-static int check_revision (slang_parse_ctx *C)
+static int
+check_revision(slang_parse_ctx * C)
{
- if (*C->I != REVISION)
- {
- slang_info_log_error (C->L, "Internal compiler error.");
- return 0;
- }
- C->I++;
- return 1;
+ if (*C->I != REVISION) {
+ slang_info_log_error(C->L, "Internal compiler error.");
+ return 0;
+ }
+ C->I++;
+ return 1;
}
-static int parse_statement (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
-static int parse_expression (slang_parse_ctx *, slang_output_ctx *, slang_operation *);
-static int parse_type_specifier (slang_parse_ctx *, slang_output_ctx *, slang_type_specifier *);
+static int parse_statement(slang_parse_ctx *, slang_output_ctx *,
+ slang_operation *);
+static int parse_expression(slang_parse_ctx *, slang_output_ctx *,
+ slang_operation *);
+static int parse_type_specifier(slang_parse_ctx *, slang_output_ctx *,
+ slang_type_specifier *);
-static GLboolean parse_array_len (slang_parse_ctx *C, slang_output_ctx *O, GLuint *len)
+static GLboolean
+parse_array_len(slang_parse_ctx * C, slang_output_ctx * O, GLuint * len)
{
- slang_operation array_size;
- slang_assembly_name_space space;
- GLboolean result;
-
- if (!slang_operation_construct (&array_size))
- return GL_FALSE;
- if (!parse_expression (C, O, &array_size))
- {
- slang_operation_destruct (&array_size);
- return GL_FALSE;
- }
-
- space.funcs = O->funs;
- space.structs = O->structs;
- space.vars = O->vars;
- result = _slang_evaluate_int (O->assembly, O->machine, &space, &array_size, len, C->atoms);
- slang_operation_destruct (&array_size);
- return result;
+ slang_operation array_size;
+ slang_assembly_name_space space;
+ GLboolean result;
+
+ if (!slang_operation_construct(&array_size))
+ return GL_FALSE;
+ if (!parse_expression(C, O, &array_size)) {
+ slang_operation_destruct(&array_size);
+ return GL_FALSE;
+ }
+
+ space.funcs = O->funs;
+ space.structs = O->structs;
+ space.vars = O->vars;
+ result = _slang_evaluate_int(O->assembly, O->machine, &space,
+ &array_size, len, C->atoms);
+ slang_operation_destruct(&array_size);
+ return result;
}
-static GLboolean calculate_var_size (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var)
+static GLboolean
+calculate_var_size(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * var)
{
- slang_storage_aggregate agg;
-
- if (!slang_storage_aggregate_construct (&agg))
- return GL_FALSE;
- if (!_slang_aggregate_variable (&agg, &var->type.specifier, var->array_len, O->funs, O->structs,
- O->vars, O->machine, O->assembly, C->atoms))
- {
- slang_storage_aggregate_destruct (&agg);
- return GL_FALSE;
- }
- var->size = _slang_sizeof_aggregate (&agg);
- slang_storage_aggregate_destruct (&agg);
- return GL_TRUE;
+ slang_storage_aggregate agg;
+
+ if (!slang_storage_aggregate_construct(&agg))
+ return GL_FALSE;
+ if (!_slang_aggregate_variable(&agg, &var->type.specifier, var->array_len,
+ O->funs, O->structs, O->vars, O->machine,
+ O->assembly, C->atoms)) {
+ slang_storage_aggregate_destruct(&agg);
+ return GL_FALSE;
+ }
+ var->size = _slang_sizeof_aggregate(&agg);
+ slang_storage_aggregate_destruct(&agg);
+ return GL_TRUE;
}
-static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var,
- const slang_type_specifier *sp)
+static GLboolean
+convert_to_array(slang_parse_ctx * C, slang_variable * var,
+ const slang_type_specifier * sp)
{
- /* sized array - mark it as array, copy the specifier to the array element and
- * parse the expression */
- var->type.specifier.type = slang_spec_array;
- var->type.specifier._array = (slang_type_specifier *) slang_alloc_malloc (sizeof (
- slang_type_specifier));
- if (var->type.specifier._array == NULL)
- {
- slang_info_log_memory (C->L);
- return GL_FALSE;
- }
- slang_type_specifier_ctr (var->type.specifier._array);
- return slang_type_specifier_copy (var->type.specifier._array, sp);
+ /* sized array - mark it as array, copy the specifier to the array element and
+ * parse the expression */
+ var->type.specifier.type = slang_spec_array;
+ var->type.specifier._array = (slang_type_specifier *)
+ slang_alloc_malloc(sizeof(slang_type_specifier));
+ if (var->type.specifier._array == NULL) {
+ slang_info_log_memory(C->L);
+ return GL_FALSE;
+ }
+ slang_type_specifier_ctr(var->type.specifier._array);
+ return slang_type_specifier_copy(var->type.specifier._array, sp);
}
/* structure field */
@@ -375,136 +397,128 @@ static GLboolean convert_to_array (slang_parse_ctx *C, slang_variable *var,
#define FIELD_NEXT 1
#define FIELD_ARRAY 2
-static GLboolean parse_struct_field_var (slang_parse_ctx *C, slang_output_ctx *O, slang_variable *var,
- const slang_type_specifier *sp)
+static GLboolean
+parse_struct_field_var(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * var, const slang_type_specifier * sp)
{
- var->a_name = parse_identifier (C);
- if (var->a_name == SLANG_ATOM_NULL)
- return GL_FALSE;
-
- switch (*C->I++)
- {
- case FIELD_NONE:
- if (!slang_type_specifier_copy (&var->type.specifier, sp))
- return GL_FALSE;
- break;
- case FIELD_ARRAY:
- if (!convert_to_array (C, var, sp))
- return GL_FALSE;
- if (!parse_array_len (C, O, &var->array_len))
- return GL_FALSE;
- break;
- default:
- return GL_FALSE;
- }
-
- return calculate_var_size (C, O, var);
+ var->a_name = parse_identifier(C);
+ if (var->a_name == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ switch (*C->I++) {
+ case FIELD_NONE:
+ if (!slang_type_specifier_copy(&var->type.specifier, sp))
+ return GL_FALSE;
+ break;
+ case FIELD_ARRAY:
+ if (!convert_to_array(C, var, sp))
+ return GL_FALSE;
+ if (!parse_array_len(C, O, &var->array_len))
+ return GL_FALSE;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ return calculate_var_size(C, O, var);
}
-static int parse_struct_field (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *st,
- slang_type_specifier *sp)
+static int
+parse_struct_field(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_struct * st, slang_type_specifier * sp)
{
- slang_output_ctx o = *O;
-
- o.structs = st->structs;
- if (!parse_type_specifier (C, &o, sp))
- return 0;
- do
- {
- slang_variable *var;
-
- st->fields->variables = (slang_variable *) slang_alloc_realloc (st->fields->variables,
- st->fields->num_variables * sizeof (slang_variable),
- (st->fields->num_variables + 1) * sizeof (slang_variable));
- if (st->fields->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- var = &st->fields->variables[st->fields->num_variables];
- if (!slang_variable_construct (var))
- return 0;
- st->fields->num_variables++;
- if (!parse_struct_field_var (C, &o, var, sp))
- return 0;
- }
- while (*C->I++ != FIELD_NONE);
-
- return 1;
+ slang_output_ctx o = *O;
+
+ o.structs = st->structs;
+ if (!parse_type_specifier(C, &o, sp))
+ return 0;
+
+ do {
+ slang_variable *var = slang_variable_scope_grow(st->fields);
+ if (!var) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_struct_field_var(C, &o, var, sp))
+ return 0;
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ return 1;
}
-static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct **st)
+static int
+parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st)
{
- slang_atom a_name;
- const char *name;
-
- /* parse struct name (if any) and make sure it is unique in current scope */
- a_name = parse_identifier (C);
- if (a_name == SLANG_ATOM_NULL)
- return 0;
- name = slang_atom_pool_id (C->atoms, a_name);
- if (name[0] != '\0' && slang_struct_scope_find (O->structs, a_name, 0) != NULL)
- {
- slang_info_log_error (C->L, "%s: duplicate type name.", name);
- return 0;
- }
-
- /* set-up a new struct */
- *st = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (*st == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_struct_construct (*st))
- {
- slang_alloc_free (*st);
- *st = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
- (**st).a_name = a_name;
- (**st).structs->outer_scope = O->structs;
-
- /* parse individual struct fields */
- do
- {
- slang_type_specifier sp;
-
- slang_type_specifier_ctr (&sp);
- if (!parse_struct_field (C, O, *st, &sp))
- {
- slang_type_specifier_dtr (&sp);
- return 0;
- }
- slang_type_specifier_dtr (&sp);
- }
- while (*C->I++ != FIELD_NONE);
-
- /* if named struct, copy it to current scope */
- if (name[0] != '\0')
- {
- slang_struct *s;
-
- O->structs->structs = (slang_struct *) slang_alloc_realloc (O->structs->structs,
- O->structs->num_structs * sizeof (slang_struct),
- (O->structs->num_structs + 1) * sizeof (slang_struct));
- if (O->structs->structs == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- s = &O->structs->structs[O->structs->num_structs];
- if (!slang_struct_construct (s))
- return 0;
- O->structs->num_structs++;
- if (!slang_struct_copy (s, *st))
- return 0;
- }
-
- return 1;
+ slang_atom a_name;
+ const char *name;
+
+ /* parse struct name (if any) and make sure it is unique in current scope */
+ a_name = parse_identifier(C);
+ if (a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ name = slang_atom_pool_id(C->atoms, a_name);
+ if (name[0] != '\0'
+ && slang_struct_scope_find(O->structs, a_name, 0) != NULL) {
+ slang_info_log_error(C->L, "%s: duplicate type name.", name);
+ return 0;
+ }
+
+ /* set-up a new struct */
+ *st = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (*st == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_struct_construct(*st)) {
+ slang_alloc_free(*st);
+ *st = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ (**st).a_name = a_name;
+ (**st).structs->outer_scope = O->structs;
+
+ /* parse individual struct fields */
+ do {
+ slang_type_specifier sp;
+
+ slang_type_specifier_ctr(&sp);
+ if (!parse_struct_field(C, O, *st, &sp)) {
+ slang_type_specifier_dtr(&sp);
+ return 0;
+ }
+ slang_type_specifier_dtr(&sp);
+ }
+ while (*C->I++ != FIELD_NONE);
+
+ /* if named struct, copy it to current scope */
+ if (name[0] != '\0') {
+ slang_struct *s;
+
+ O->structs->structs =
+ (slang_struct *) slang_alloc_realloc(O->structs->structs,
+ O->structs->num_structs *
+ sizeof(slang_struct),
+ (O->structs->num_structs +
+ 1) * sizeof(slang_struct));
+ if (O->structs->structs == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ s = &O->structs->structs[O->structs->num_structs];
+ if (!slang_struct_construct(s))
+ return 0;
+ O->structs->num_structs++;
+ if (!slang_struct_copy(s, *st))
+ return 0;
+ }
+
+ return 1;
}
+
/* type qualifier */
#define TYPE_QUALIFIER_NONE 0
#define TYPE_QUALIFIER_CONST 1
@@ -514,35 +528,35 @@ static int parse_struct (slang_parse_ctx *C, slang_output_ctx *O, slang_struct *
#define TYPE_QUALIFIER_FIXEDOUTPUT 5
#define TYPE_QUALIFIER_FIXEDINPUT 6
-static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual)
+static int
+parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual)
{
- switch (*C->I++)
- {
- case TYPE_QUALIFIER_NONE:
- *qual = slang_qual_none;
- break;
- case TYPE_QUALIFIER_CONST:
- *qual = slang_qual_const;
- break;
- case TYPE_QUALIFIER_ATTRIBUTE:
- *qual = slang_qual_attribute;
- break;
- case TYPE_QUALIFIER_VARYING:
- *qual = slang_qual_varying;
- break;
- case TYPE_QUALIFIER_UNIFORM:
- *qual = slang_qual_uniform;
- break;
- case TYPE_QUALIFIER_FIXEDOUTPUT:
- *qual = slang_qual_fixedoutput;
- break;
- case TYPE_QUALIFIER_FIXEDINPUT:
- *qual = slang_qual_fixedinput;
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case TYPE_QUALIFIER_NONE:
+ *qual = slang_qual_none;
+ break;
+ case TYPE_QUALIFIER_CONST:
+ *qual = slang_qual_const;
+ break;
+ case TYPE_QUALIFIER_ATTRIBUTE:
+ *qual = slang_qual_attribute;
+ break;
+ case TYPE_QUALIFIER_VARYING:
+ *qual = slang_qual_varying;
+ break;
+ case TYPE_QUALIFIER_UNIFORM:
+ *qual = slang_qual_uniform;
+ break;
+ case TYPE_QUALIFIER_FIXEDOUTPUT:
+ *qual = slang_qual_fixedoutput;
+ break;
+ case TYPE_QUALIFIER_FIXEDINPUT:
+ *qual = slang_qual_fixedinput;
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
/* type specifier */
@@ -571,127 +585,127 @@ static int parse_type_qualifier (slang_parse_ctx *C, slang_type_qualifier *qual)
#define TYPE_SPECIFIER_STRUCT 22
#define TYPE_SPECIFIER_TYPENAME 23
-static int parse_type_specifier (slang_parse_ctx *C, slang_output_ctx *O, slang_type_specifier *spec)
+static int
+parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_type_specifier * spec)
{
- switch (*C->I++)
- {
- case TYPE_SPECIFIER_VOID:
- spec->type = slang_spec_void;
- break;
- case TYPE_SPECIFIER_BOOL:
- spec->type = slang_spec_bool;
- break;
- case TYPE_SPECIFIER_BVEC2:
- spec->type = slang_spec_bvec2;
- break;
- case TYPE_SPECIFIER_BVEC3:
- spec->type = slang_spec_bvec3;
- break;
- case TYPE_SPECIFIER_BVEC4:
- spec->type = slang_spec_bvec4;
- break;
- case TYPE_SPECIFIER_INT:
- spec->type = slang_spec_int;
- break;
- case TYPE_SPECIFIER_IVEC2:
- spec->type = slang_spec_ivec2;
- break;
- case TYPE_SPECIFIER_IVEC3:
- spec->type = slang_spec_ivec3;
- break;
- case TYPE_SPECIFIER_IVEC4:
- spec->type = slang_spec_ivec4;
- break;
- case TYPE_SPECIFIER_FLOAT:
- spec->type = slang_spec_float;
- break;
- case TYPE_SPECIFIER_VEC2:
- spec->type = slang_spec_vec2;
- break;
- case TYPE_SPECIFIER_VEC3:
- spec->type = slang_spec_vec3;
- break;
- case TYPE_SPECIFIER_VEC4:
- spec->type = slang_spec_vec4;
- break;
- case TYPE_SPECIFIER_MAT2:
- spec->type = slang_spec_mat2;
- break;
- case TYPE_SPECIFIER_MAT3:
- spec->type = slang_spec_mat3;
- break;
- case TYPE_SPECIFIER_MAT4:
- spec->type = slang_spec_mat4;
- break;
- case TYPE_SPECIFIER_SAMPLER1D:
- spec->type = slang_spec_sampler1D;
- break;
- case TYPE_SPECIFIER_SAMPLER2D:
- spec->type = slang_spec_sampler2D;
- break;
- case TYPE_SPECIFIER_SAMPLER3D:
- spec->type = slang_spec_sampler3D;
- break;
- case TYPE_SPECIFIER_SAMPLERCUBE:
- spec->type = slang_spec_samplerCube;
- break;
- case TYPE_SPECIFIER_SAMPLER1DSHADOW:
- spec->type = slang_spec_sampler1DShadow;
- break;
- case TYPE_SPECIFIER_SAMPLER2DSHADOW:
- spec->type = slang_spec_sampler2DShadow;
- break;
- case TYPE_SPECIFIER_STRUCT:
- spec->type = slang_spec_struct;
- if (!parse_struct (C, O, &spec->_struct))
- return 0;
- break;
- case TYPE_SPECIFIER_TYPENAME:
- spec->type = slang_spec_struct;
- {
- slang_atom a_name;
- slang_struct *stru;
-
- a_name = parse_identifier (C);
- if (a_name == NULL)
- return 0;
-
- stru = slang_struct_scope_find (O->structs, a_name, 1);
- if (stru == NULL)
- {
- slang_info_log_error (C->L, "%s: undeclared type name.",
- slang_atom_pool_id (C->atoms, a_name));
- return 0;
- }
-
- spec->_struct = (slang_struct *) slang_alloc_malloc (sizeof (slang_struct));
- if (spec->_struct == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_struct_construct (spec->_struct))
- {
- slang_alloc_free (spec->_struct);
- spec->_struct = NULL;
- return 0;
- }
- if (!slang_struct_copy (spec->_struct, stru))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case TYPE_SPECIFIER_VOID:
+ spec->type = slang_spec_void;
+ break;
+ case TYPE_SPECIFIER_BOOL:
+ spec->type = slang_spec_bool;
+ break;
+ case TYPE_SPECIFIER_BVEC2:
+ spec->type = slang_spec_bvec2;
+ break;
+ case TYPE_SPECIFIER_BVEC3:
+ spec->type = slang_spec_bvec3;
+ break;
+ case TYPE_SPECIFIER_BVEC4:
+ spec->type = slang_spec_bvec4;
+ break;
+ case TYPE_SPECIFIER_INT:
+ spec->type = slang_spec_int;
+ break;
+ case TYPE_SPECIFIER_IVEC2:
+ spec->type = slang_spec_ivec2;
+ break;
+ case TYPE_SPECIFIER_IVEC3:
+ spec->type = slang_spec_ivec3;
+ break;
+ case TYPE_SPECIFIER_IVEC4:
+ spec->type = slang_spec_ivec4;
+ break;
+ case TYPE_SPECIFIER_FLOAT:
+ spec->type = slang_spec_float;
+ break;
+ case TYPE_SPECIFIER_VEC2:
+ spec->type = slang_spec_vec2;
+ break;
+ case TYPE_SPECIFIER_VEC3:
+ spec->type = slang_spec_vec3;
+ break;
+ case TYPE_SPECIFIER_VEC4:
+ spec->type = slang_spec_vec4;
+ break;
+ case TYPE_SPECIFIER_MAT2:
+ spec->type = slang_spec_mat2;
+ break;
+ case TYPE_SPECIFIER_MAT3:
+ spec->type = slang_spec_mat3;
+ break;
+ case TYPE_SPECIFIER_MAT4:
+ spec->type = slang_spec_mat4;
+ break;
+ case TYPE_SPECIFIER_SAMPLER1D:
+ spec->type = slang_spec_sampler1D;
+ break;
+ case TYPE_SPECIFIER_SAMPLER2D:
+ spec->type = slang_spec_sampler2D;
+ break;
+ case TYPE_SPECIFIER_SAMPLER3D:
+ spec->type = slang_spec_sampler3D;
+ break;
+ case TYPE_SPECIFIER_SAMPLERCUBE:
+ spec->type = slang_spec_samplerCube;
+ break;
+ case TYPE_SPECIFIER_SAMPLER1DSHADOW:
+ spec->type = slang_spec_sampler1DShadow;
+ break;
+ case TYPE_SPECIFIER_SAMPLER2DSHADOW:
+ spec->type = slang_spec_sampler2DShadow;
+ break;
+ case TYPE_SPECIFIER_STRUCT:
+ spec->type = slang_spec_struct;
+ if (!parse_struct(C, O, &spec->_struct))
+ return 0;
+ break;
+ case TYPE_SPECIFIER_TYPENAME:
+ spec->type = slang_spec_struct;
+ {
+ slang_atom a_name;
+ slang_struct *stru;
+
+ a_name = parse_identifier(C);
+ if (a_name == NULL)
+ return 0;
+
+ stru = slang_struct_scope_find(O->structs, a_name, 1);
+ if (stru == NULL) {
+ slang_info_log_error(C->L, "%s: undeclared type name.",
+ slang_atom_pool_id(C->atoms, a_name));
+ return 0;
+ }
+
+ spec->_struct =
+ (slang_struct *) slang_alloc_malloc(sizeof(slang_struct));
+ if (spec->_struct == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_struct_construct(spec->_struct)) {
+ slang_alloc_free(spec->_struct);
+ spec->_struct = NULL;
+ return 0;
+ }
+ if (!slang_struct_copy(spec->_struct, stru))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
-static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O,
- slang_fully_specified_type *type)
+static int
+parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_fully_specified_type * type)
{
- if (!parse_type_qualifier (C, &type->qualifier))
- return 0;
- return parse_type_specifier (C, O, &type->specifier);
+ if (!parse_type_qualifier(C, &type->qualifier))
+ return 0;
+ return parse_type_specifier(C, O, &type->specifier);
}
/* operation */
@@ -758,459 +772,487 @@ static int parse_fully_specified_type (slang_parse_ctx *C, slang_output_ctx *O,
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
-static int parse_child_operation (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper,
- int statement)
+
+/**
+ * When parsing a compound production, this function is used to parse the
+ * children.
+ * For example, a a while-loop compound will have two children, the
+ * while condition expression and the loop body. So, this function will
+ * be called twice to parse those two sub-expressions.
+ * \param C the parsing context
+ * \param O the output context
+ * \param oper the operation we're parsing
+ * \param statment which child of the operation is being parsed
+ * \return 1 if success, 0 if error
+ */
+static int
+parse_child_operation(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper, unsigned int statement)
{
- slang_operation *ch;
-
- oper->children = (slang_operation *) slang_alloc_realloc (oper->children,
- oper->num_children * sizeof (slang_operation),
- (oper->num_children + 1) * sizeof (slang_operation));
- if (oper->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- ch = &oper->children[oper->num_children];
- if (!slang_operation_construct (ch))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- oper->num_children++;
- if (statement)
- return parse_statement (C, O, ch);
- return parse_expression (C, O, ch);
+ slang_operation *ch;
+
+ /* grow child array */
+ oper->children = (slang_operation *)
+ slang_alloc_realloc(oper->children,
+ oper->num_children * sizeof(slang_operation),
+ (oper->num_children + 1) * sizeof(slang_operation));
+ if (oper->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ ch = &oper->children[oper->num_children];
+ if (!slang_operation_construct(ch)) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ oper->num_children++;
+ /* XXX I guess the 0th "statement" is not really a statement? */
+ if (statement)
+ return parse_statement(C, O, ch);
+ return parse_expression(C, O, ch);
}
-static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O);
+static int parse_declaration(slang_parse_ctx * C, slang_output_ctx * O);
-static int parse_statement (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
+static int
+parse_statement(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper)
{
- oper->locals->outer_scope = O->vars;
- switch (*C->I++)
- {
- case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
- /* parse child statements, do not create new variable scope */
- oper->type = slang_oper_block_no_new_scope;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- C->I++;
- break;
- case OP_BLOCK_BEGIN_NEW_SCOPE:
- /* parse child statements, create new variable scope */
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_block_new_scope;
- o.vars = oper->locals;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- C->I++;
- }
- break;
- case OP_DECLARE:
- /* local variable declaration, individual declarators are stored as children identifiers */
- oper->type = slang_oper_variable_decl;
- {
- const unsigned int first_var = O->vars->num_variables;
-
- /* parse the declaration, note that there can be zero or more than one declarators */
- if (!parse_declaration (C, O))
- return 0;
- if (first_var < O->vars->num_variables)
- {
- const unsigned int num_vars = O->vars->num_variables - first_var;
- unsigned int i;
-
- oper->children = (slang_operation *) slang_alloc_malloc (num_vars * sizeof (
- slang_operation));
- if (oper->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- for (oper->num_children = 0; oper->num_children < num_vars; oper->num_children++)
- if (!slang_operation_construct (&oper->children[oper->num_children]))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- for (i = first_var; i < O->vars->num_variables; i++)
- {
- slang_operation *o = &oper->children[i - first_var];
-
- o->type = slang_oper_identifier;
- o->locals->outer_scope = O->vars;
- o->a_id = O->vars->variables[i].a_name;
- }
- }
- }
- break;
- case OP_ASM:
- /* the __asm statement, parse the mnemonic and all its arguments as expressions */
- oper->type = slang_oper_asm;
- oper->a_id = parse_identifier (C);
- if (oper->a_id == SLANG_ATOM_NULL)
- return 0;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- C->I++;
- break;
- case OP_BREAK:
- oper->type = slang_oper_break;
- break;
- case OP_CONTINUE:
- oper->type = slang_oper_continue;
- break;
- case OP_DISCARD:
- oper->type = slang_oper_discard;
- break;
- case OP_RETURN:
- oper->type = slang_oper_return;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_EXPRESSION:
- oper->type = slang_oper_expression;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_IF:
- oper->type = slang_oper_if;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- break;
- case OP_WHILE:
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_while;
- o.vars = oper->locals;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- }
- break;
- case OP_DO:
- oper->type = slang_oper_do;
- if (!parse_child_operation (C, O, oper, 1))
- return 0;
- if (!parse_child_operation (C, O, oper, 0))
- return 0;
- break;
- case OP_FOR:
- {
- slang_output_ctx o = *O;
-
- oper->type = slang_oper_for;
- o.vars = oper->locals;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- if (!parse_child_operation (C, &o, oper, 0))
- return 0;
- if (!parse_child_operation (C, &o, oper, 1))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ oper->locals->outer_scope = O->vars;
+ switch (*C->I++) {
+ case OP_BLOCK_BEGIN_NO_NEW_SCOPE:
+ /* parse child statements, do not create new variable scope */
+ oper->type = slang_oper_block_no_new_scope;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ C->I++;
+ break;
+ case OP_BLOCK_BEGIN_NEW_SCOPE:
+ /* parse child statements, create new variable scope */
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_block_new_scope;
+ o.vars = oper->locals;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ C->I++;
+ }
+ break;
+ case OP_DECLARE:
+ /* local variable declaration, individual declarators are stored as
+ * children identifiers
+ */
+ oper->type = slang_oper_variable_decl;
+ {
+ const unsigned int first_var = O->vars->num_variables;
+
+ /* parse the declaration, note that there can be zero or more
+ * than one declarators
+ */
+ if (!parse_declaration(C, O))
+ return 0;
+ if (first_var < O->vars->num_variables) {
+ const unsigned int num_vars = O->vars->num_variables - first_var;
+ unsigned int i;
+
+ oper->children = (slang_operation *)
+ slang_alloc_malloc(num_vars * sizeof(slang_operation));
+ if (oper->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ for (oper->num_children = 0; oper->num_children < num_vars;
+ oper->num_children++) {
+ if (!slang_operation_construct
+ (&oper->children[oper->num_children])) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ }
+ for (i = first_var; i < O->vars->num_variables; i++) {
+ slang_operation *o = &oper->children[i - first_var];
+ o->type = slang_oper_identifier;
+ o->locals->outer_scope = O->vars;
+ o->a_id = O->vars->variables[i].a_name;
+ }
+ }
+ }
+ break;
+ case OP_ASM:
+ /* the __asm statement, parse the mnemonic and all its arguments
+ * as expressions
+ */
+ oper->type = slang_oper_asm;
+ oper->a_id = parse_identifier(C);
+ if (oper->a_id == SLANG_ATOM_NULL)
+ return 0;
+ while (*C->I != OP_END) {
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ }
+ C->I++;
+ break;
+ case OP_BREAK:
+ oper->type = slang_oper_break;
+ break;
+ case OP_CONTINUE:
+ oper->type = slang_oper_continue;
+ break;
+ case OP_DISCARD:
+ oper->type = slang_oper_discard;
+ break;
+ case OP_RETURN:
+ oper->type = slang_oper_return;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_EXPRESSION:
+ oper->type = slang_oper_expression;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_IF:
+ oper->type = slang_oper_if;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ break;
+ case OP_WHILE:
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_while;
+ o.vars = oper->locals;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ }
+ break;
+ case OP_DO:
+ oper->type = slang_oper_do;
+ if (!parse_child_operation(C, O, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, O, oper, 0))
+ return 0;
+ break;
+ case OP_FOR:
+ {
+ slang_output_ctx o = *O;
+
+ oper->type = slang_oper_for;
+ o.vars = oper->locals;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 0))
+ return 0;
+ if (!parse_child_operation(C, &o, oper, 1))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
-static int handle_nary_expression (slang_parse_ctx *C, slang_operation *op, slang_operation **ops,
- unsigned int *total_ops, unsigned int n)
+static int
+handle_nary_expression(slang_parse_ctx * C, slang_operation * op,
+ slang_operation ** ops, unsigned int *total_ops,
+ unsigned int n)
{
- unsigned int i;
-
- op->children = (slang_operation *) slang_alloc_malloc (n * sizeof (slang_operation));
- if (op->children == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op->num_children = n;
-
- for (i = 0; i < n; i++)
- op->children[i] = (*ops)[*total_ops - (n + 1 - i)];
- (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1];
- *total_ops -= n;
-
- *ops = (slang_operation *) slang_alloc_realloc (*ops, (*total_ops + n) * sizeof (slang_operation),
- *total_ops * sizeof (slang_operation));
- if (*ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- return 1;
+ unsigned int i;
+
+ op->children =
+ (slang_operation *) slang_alloc_malloc(n * sizeof(slang_operation));
+ if (op->children == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ op->num_children = n;
+
+ for (i = 0; i < n; i++)
+ op->children[i] = (*ops)[*total_ops - (n + 1 - i)];
+ (*ops)[*total_ops - (n + 1)] = (*ops)[*total_ops - 1];
+ *total_ops -= n;
+
+ *ops = (slang_operation *)
+ slang_alloc_realloc(*ops,
+ (*total_ops + n) * sizeof(slang_operation),
+ *total_ops * sizeof(slang_operation));
+ if (*ops == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ return 1;
}
-static int is_constructor_name (const char *name, slang_atom a_name, slang_struct_scope *structs)
+static int
+is_constructor_name(const char *name, slang_atom a_name,
+ slang_struct_scope * structs)
{
- if (slang_type_specifier_type_from_string (name) != slang_spec_void)
- return 1;
- return slang_struct_scope_find (structs, a_name, 1) != NULL;
+ if (slang_type_specifier_type_from_string(name) != slang_spec_void)
+ return 1;
+ return slang_struct_scope_find(structs, a_name, 1) != NULL;
}
-static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_operation *oper)
+static int
+parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_operation * oper)
{
- slang_operation *ops = NULL;
- unsigned int num_ops = 0;
- int number;
-
- while (*C->I != OP_END)
- {
- slang_operation *op;
- const unsigned int op_code = *C->I++;
-
- /* allocate default operation, becomes a no-op if not used */
- ops = (slang_operation *) slang_alloc_realloc (ops,
- num_ops * sizeof (slang_operation), (num_ops + 1) * sizeof (slang_operation));
- if (ops == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- op = &ops[num_ops];
- if (!slang_operation_construct (op))
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- num_ops++;
- op->locals->outer_scope = O->vars;
-
- switch (op_code)
- {
- case OP_PUSH_VOID:
- op->type = slang_oper_void;
- break;
- case OP_PUSH_BOOL:
- op->type = slang_oper_literal_bool;
- if (!parse_number (C, &number))
- return 0;
- op->literal = (GLfloat) number;
- break;
- case OP_PUSH_INT:
- op->type = slang_oper_literal_int;
- if (!parse_number (C, &number))
- return 0;
- op->literal = (GLfloat) number;
- break;
- case OP_PUSH_FLOAT:
- op->type = slang_oper_literal_float;
- if (!parse_float (C, &op->literal))
- return 0;
- break;
- case OP_PUSH_IDENTIFIER:
- op->type = slang_oper_identifier;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- break;
- case OP_SEQUENCE:
- op->type = slang_oper_sequence;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_ASSIGN:
- op->type = slang_oper_assign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_ADDASSIGN:
- op->type = slang_oper_addassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_SUBASSIGN:
- op->type = slang_oper_subassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_MULASSIGN:
- op->type = slang_oper_mulassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_DIVASSIGN:
- op->type = slang_oper_divassign;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_MODASSIGN:*/
- /*case OP_LSHASSIGN:*/
- /*case OP_RSHASSIGN:*/
- /*case OP_ORASSIGN:*/
- /*case OP_XORASSIGN:*/
- /*case OP_ANDASSIGN:*/
- case OP_SELECT:
- op->type = slang_oper_select;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 3))
- return 0;
- break;
- case OP_LOGICALOR:
- op->type = slang_oper_logicalor;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LOGICALXOR:
- op->type = slang_oper_logicalxor;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LOGICALAND:
- op->type = slang_oper_logicaland;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_BITOR:*/
- /*case OP_BITXOR:*/
- /*case OP_BITAND:*/
- case OP_EQUAL:
- op->type = slang_oper_equal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_NOTEQUAL:
- op->type = slang_oper_notequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LESS:
- op->type = slang_oper_less;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_GREATER:
- op->type = slang_oper_greater;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_LESSEQUAL:
- op->type = slang_oper_lessequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_GREATEREQUAL:
- op->type = slang_oper_greaterequal;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_LSHIFT:*/
- /*case OP_RSHIFT:*/
- case OP_ADD:
- op->type = slang_oper_add;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_SUBTRACT:
- op->type = slang_oper_subtract;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_MULTIPLY:
- op->type = slang_oper_multiply;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_DIVIDE:
- op->type = slang_oper_divide;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- /*case OP_MODULUS:*/
- case OP_PREINCREMENT:
- op->type = slang_oper_preincrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_PREDECREMENT:
- op->type = slang_oper_predecrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_PLUS:
- op->type = slang_oper_plus;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_MINUS:
- op->type = slang_oper_minus;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_NOT:
- op->type = slang_oper_not;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- /*case OP_COMPLEMENT:*/
- case OP_SUBSCRIPT:
- op->type = slang_oper_subscript;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 2))
- return 0;
- break;
- case OP_CALL:
- op->type = slang_oper_call;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- while (*C->I != OP_END)
- if (!parse_child_operation (C, O, op, 0))
- return 0;
- C->I++;
- if (!C->parsing_builtin && !slang_function_scope_find_by_name (O->funs, op->a_id, 1))
- {
- const char *id;
-
- id = slang_atom_pool_id (C->atoms, op->a_id);
- if (!is_constructor_name (id, op->a_id, O->structs))
- {
- slang_info_log_error (C->L, "%s: undeclared function name.", id);
- return 0;
- }
- }
- break;
- case OP_FIELD:
- op->type = slang_oper_field;
- op->a_id = parse_identifier (C);
- if (op->a_id == SLANG_ATOM_NULL)
- return 0;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_POSTINCREMENT:
- op->type = slang_oper_postincrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- case OP_POSTDECREMENT:
- op->type = slang_oper_postdecrement;
- if (!handle_nary_expression (C, op, &ops, &num_ops, 1))
- return 0;
- break;
- default:
- return 0;
- }
- }
- C->I++;
-
- *oper = *ops;
- slang_alloc_free (ops);
- return 1;
+ slang_operation *ops = NULL;
+ unsigned int num_ops = 0;
+ int number;
+
+ while (*C->I != OP_END) {
+ slang_operation *op;
+ const unsigned int op_code = *C->I++;
+
+ /* allocate default operation, becomes a no-op if not used */
+ ops = (slang_operation *)
+ slang_alloc_realloc(ops,
+ num_ops * sizeof(slang_operation),
+ (num_ops + 1) * sizeof(slang_operation));
+ if (ops == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ op = &ops[num_ops];
+ if (!slang_operation_construct(op)) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ num_ops++;
+ op->locals->outer_scope = O->vars;
+
+ switch (op_code) {
+ case OP_PUSH_VOID:
+ op->type = slang_oper_void;
+ break;
+ case OP_PUSH_BOOL:
+ op->type = slang_oper_literal_bool;
+ if (!parse_number(C, &number))
+ return 0;
+ op->literal = (GLfloat) number;
+ break;
+ case OP_PUSH_INT:
+ op->type = slang_oper_literal_int;
+ if (!parse_number(C, &number))
+ return 0;
+ op->literal = (GLfloat) number;
+ break;
+ case OP_PUSH_FLOAT:
+ op->type = slang_oper_literal_float;
+ if (!parse_float(C, &op->literal))
+ return 0;
+ break;
+ case OP_PUSH_IDENTIFIER:
+ op->type = slang_oper_identifier;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ case OP_SEQUENCE:
+ op->type = slang_oper_sequence;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_ASSIGN:
+ op->type = slang_oper_assign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_ADDASSIGN:
+ op->type = slang_oper_addassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_SUBASSIGN:
+ op->type = slang_oper_subassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_MULASSIGN:
+ op->type = slang_oper_mulassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_DIVASSIGN:
+ op->type = slang_oper_divassign;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_MODASSIGN: */
+ /*case OP_LSHASSIGN: */
+ /*case OP_RSHASSIGN: */
+ /*case OP_ORASSIGN: */
+ /*case OP_XORASSIGN: */
+ /*case OP_ANDASSIGN: */
+ case OP_SELECT:
+ op->type = slang_oper_select;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 3))
+ return 0;
+ break;
+ case OP_LOGICALOR:
+ op->type = slang_oper_logicalor;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LOGICALXOR:
+ op->type = slang_oper_logicalxor;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LOGICALAND:
+ op->type = slang_oper_logicaland;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_BITOR: */
+ /*case OP_BITXOR: */
+ /*case OP_BITAND: */
+ case OP_EQUAL:
+ op->type = slang_oper_equal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_NOTEQUAL:
+ op->type = slang_oper_notequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LESS:
+ op->type = slang_oper_less;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_GREATER:
+ op->type = slang_oper_greater;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_LESSEQUAL:
+ op->type = slang_oper_lessequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_GREATEREQUAL:
+ op->type = slang_oper_greaterequal;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_LSHIFT: */
+ /*case OP_RSHIFT: */
+ case OP_ADD:
+ op->type = slang_oper_add;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_SUBTRACT:
+ op->type = slang_oper_subtract;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_MULTIPLY:
+ op->type = slang_oper_multiply;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_DIVIDE:
+ op->type = slang_oper_divide;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ /*case OP_MODULUS: */
+ case OP_PREINCREMENT:
+ op->type = slang_oper_preincrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_PREDECREMENT:
+ op->type = slang_oper_predecrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_PLUS:
+ op->type = slang_oper_plus;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_MINUS:
+ op->type = slang_oper_minus;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_NOT:
+ op->type = slang_oper_not;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ /*case OP_COMPLEMENT: */
+ case OP_SUBSCRIPT:
+ op->type = slang_oper_subscript;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
+ return 0;
+ break;
+ case OP_CALL:
+ op->type = slang_oper_call;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, O, op, 0))
+ return 0;
+ C->I++;
+
+ if (!C->parsing_builtin
+ && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) {
+ const char *id;
+
+ id = slang_atom_pool_id(C->atoms, op->a_id);
+ if (!is_constructor_name(id, op->a_id, O->structs)) {
+ slang_info_log_error(C->L, "%s: undeclared function name.", id);
+ return 0;
+ }
+ }
+ break;
+ case OP_FIELD:
+ op->type = slang_oper_field;
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ return 0;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_POSTINCREMENT:
+ op->type = slang_oper_postincrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ case OP_POSTDECREMENT:
+ op->type = slang_oper_postdecrement;
+ if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ }
+ C->I++;
+
+ *oper = *ops;
+ slang_alloc_free(ops);
+
+ return 1;
}
/* parameter qualifier */
@@ -1222,78 +1264,76 @@ static int parse_expression (slang_parse_ctx *C, slang_output_ctx *O, slang_oper
#define PARAMETER_ARRAY_NOT_PRESENT 0
#define PARAMETER_ARRAY_PRESENT 1
-static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O,
- slang_variable *param)
+static int
+parse_parameter_declaration(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_variable * param)
{
- /* parse and validate the parameter's type qualifiers (there can be two at most) because
- * not all combinations are valid */
- if (!parse_type_qualifier (C, &param->type.qualifier))
- return 0;
- switch (*C->I++)
- {
- case PARAM_QUALIFIER_IN:
- if (param->type.qualifier != slang_qual_const && param->type.qualifier != slang_qual_none)
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- case PARAM_QUALIFIER_OUT:
- if (param->type.qualifier == slang_qual_none)
- param->type.qualifier = slang_qual_out;
- else
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- case PARAM_QUALIFIER_INOUT:
- if (param->type.qualifier == slang_qual_none)
- param->type.qualifier = slang_qual_inout;
- else
- {
- slang_info_log_error (C->L, "Invalid type qualifier.");
- return 0;
- }
- break;
- default:
- return 0;
- }
-
- /* parse parameter's type specifier and name */
- if (!parse_type_specifier (C, O, &param->type.specifier))
- return 0;
- param->a_name = parse_identifier (C);
- if (param->a_name == SLANG_ATOM_NULL)
- return 0;
-
- /* if the parameter is an array, parse its size (the size must be explicitly defined */
- if (*C->I++ == PARAMETER_ARRAY_PRESENT)
- {
- slang_type_specifier p;
-
- slang_type_specifier_ctr (&p);
- if (!slang_type_specifier_copy (&p, &param->type.specifier))
- {
- slang_type_specifier_dtr (&p);
- return GL_FALSE;
- }
- if (!convert_to_array (C, param, &p))
- {
- slang_type_specifier_dtr (&p);
- return GL_FALSE;
- }
- slang_type_specifier_dtr (&p);
- if (!parse_array_len (C, O, &param->array_len))
- return GL_FALSE;
- }
-
- /* calculate the parameter size */
- if (!calculate_var_size (C, O, param))
- return GL_FALSE;
-
- /* TODO: allocate the local address here? */
- return 1;
+ /* parse and validate the parameter's type qualifiers (there can be
+ * two at most) because not all combinations are valid
+ */
+ if (!parse_type_qualifier(C, &param->type.qualifier))
+ return 0;
+ switch (*C->I++) {
+ case PARAM_QUALIFIER_IN:
+ if (param->type.qualifier != slang_qual_const
+ && param->type.qualifier != slang_qual_none) {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ case PARAM_QUALIFIER_OUT:
+ if (param->type.qualifier == slang_qual_none)
+ param->type.qualifier = slang_qual_out;
+ else {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ case PARAM_QUALIFIER_INOUT:
+ if (param->type.qualifier == slang_qual_none)
+ param->type.qualifier = slang_qual_inout;
+ else {
+ slang_info_log_error(C->L, "Invalid type qualifier.");
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+
+ /* parse parameter's type specifier and name */
+ if (!parse_type_specifier(C, O, &param->type.specifier))
+ return 0;
+ param->a_name = parse_identifier(C);
+ if (param->a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ /* if the parameter is an array, parse its size (the size must be
+ * explicitly defined
+ */
+ if (*C->I++ == PARAMETER_ARRAY_PRESENT) {
+ slang_type_specifier p;
+
+ slang_type_specifier_ctr(&p);
+ if (!slang_type_specifier_copy(&p, &param->type.specifier)) {
+ slang_type_specifier_dtr(&p);
+ return GL_FALSE;
+ }
+ if (!convert_to_array(C, param, &p)) {
+ slang_type_specifier_dtr(&p);
+ return GL_FALSE;
+ }
+ slang_type_specifier_dtr(&p);
+ if (!parse_array_len(C, O, &param->array_len))
+ return GL_FALSE;
+ }
+
+ /* calculate the parameter size */
+ if (!calculate_var_size(C, O, param))
+ return GL_FALSE;
+
+ /* TODO: allocate the local address here? */
+ return 1;
}
/* function type */
@@ -1336,251 +1376,247 @@ static int parse_parameter_declaration (slang_parse_ctx *C, slang_output_ctx *O,
/*#define OPERATOR_COMPLEMENT 28*/
#define OPERATOR_NOT 29
-static const struct {
- unsigned int o_code;
- const char *o_name;
+static const struct
+{
+ unsigned int o_code;
+ const char *o_name;
} operator_names[] = {
- { OPERATOR_INCREMENT, "++" },
- { OPERATOR_ADDASSIGN, "+=" },
- { OPERATOR_PLUS, "+" },
- { OPERATOR_DECREMENT, "--" },
- { OPERATOR_SUBASSIGN, "-=" },
- { OPERATOR_MINUS, "-" },
- { OPERATOR_NOT, "!" },
- { OPERATOR_MULASSIGN, "*=" },
- { OPERATOR_MULTIPLY, "*" },
- { OPERATOR_DIVASSIGN, "/=" },
- { OPERATOR_DIVIDE, "/" },
- { OPERATOR_LESSEQUAL, "<=" },
- /*{ OPERATOR_LSHASSIGN, "<<=" },*/
- /*{ OPERATOR_LSHIFT, "<<" },*/
- { OPERATOR_LESS, "<" },
- { OPERATOR_GREATEREQUAL, ">=" },
- /*{ OPERATOR_RSHASSIGN, ">>=" },*/
- /*{ OPERATOR_RSHIFT, ">>" },*/
- { OPERATOR_GREATER, ">" },
- /*{ OPERATOR_MODASSIGN, "%=" },*/
- /*{ OPERATOR_MODULUS, "%" },*/
- /*{ OPERATOR_ANDASSIGN, "&=" },*/
- /*{ OPERATOR_BITAND, "&" },*/
- /*{ OPERATOR_ORASSIGN, "|=" },*/
- /*{ OPERATOR_BITOR, "|" },*/
- /*{ OPERATOR_COMPLEMENT, "~" },*/
- /*{ OPERATOR_XORASSIGN, "^=" },*/
- { OPERATOR_LOGICALXOR, "^^" },
- /*{ OPERATOR_BITXOR, "^" }*/
+ {OPERATOR_INCREMENT, "++"},
+ {OPERATOR_ADDASSIGN, "+="},
+ {OPERATOR_PLUS, "+"},
+ {OPERATOR_DECREMENT, "--"},
+ {OPERATOR_SUBASSIGN, "-="},
+ {OPERATOR_MINUS, "-"},
+ {OPERATOR_NOT, "!"},
+ {OPERATOR_MULASSIGN, "*="},
+ {OPERATOR_MULTIPLY, "*"},
+ {OPERATOR_DIVASSIGN, "/="},
+ {OPERATOR_DIVIDE, "/"},
+ {OPERATOR_LESSEQUAL, "<="},
+ /*{ OPERATOR_LSHASSIGN, "<<=" }, */
+ /*{ OPERATOR_LSHIFT, "<<" }, */
+ {OPERATOR_LESS, "<"},
+ {OPERATOR_GREATEREQUAL, ">="},
+ /*{ OPERATOR_RSHASSIGN, ">>=" }, */
+ /*{ OPERATOR_RSHIFT, ">>" }, */
+ {OPERATOR_GREATER, ">"},
+ /*{ OPERATOR_MODASSIGN, "%=" }, */
+ /*{ OPERATOR_MODULUS, "%" }, */
+ /*{ OPERATOR_ANDASSIGN, "&=" }, */
+ /*{ OPERATOR_BITAND, "&" }, */
+ /*{ OPERATOR_ORASSIGN, "|=" }, */
+ /*{ OPERATOR_BITOR, "|" }, */
+ /*{ OPERATOR_COMPLEMENT, "~" }, */
+ /*{ OPERATOR_XORASSIGN, "^=" }, */
+ {OPERATOR_LOGICALXOR, "^^"},
+ /*{ OPERATOR_BITXOR, "^" } */
};
-static slang_atom parse_operator_name (slang_parse_ctx *C)
+static slang_atom
+parse_operator_name(slang_parse_ctx * C)
{
- unsigned int i;
-
- for (i = 0; i < sizeof (operator_names) / sizeof (*operator_names); i++)
- {
- if (operator_names[i].o_code == (unsigned int) (*C->I))
- {
- slang_atom atom = slang_atom_pool_atom (C->atoms, operator_names[i].o_name);
- if (atom == SLANG_ATOM_NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- C->I++;
- return atom;
- }
- }
- return 0;
+ unsigned int i;
+
+ for (i = 0; i < sizeof(operator_names) / sizeof(*operator_names); i++) {
+ if (operator_names[i].o_code == (unsigned int) (*C->I)) {
+ slang_atom atom =
+ slang_atom_pool_atom(C->atoms, operator_names[i].o_name);
+ if (atom == SLANG_ATOM_NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ C->I++;
+ return atom;
+ }
+ }
+ return 0;
}
-static int parse_function_prototype (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
+static int
+parse_function_prototype(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_function * func)
{
- /* parse function type and name */
- if (!parse_fully_specified_type (C, O, &func->header.type))
- return 0;
- switch (*C->I++)
- {
- case FUNCTION_ORDINARY:
- func->kind = slang_func_ordinary;
- func->header.a_name = parse_identifier (C);
- if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
- break;
- case FUNCTION_CONSTRUCTOR:
- func->kind = slang_func_constructor;
- if (func->header.type.specifier.type == slang_spec_struct)
- return 0;
- func->header.a_name = slang_atom_pool_atom (C->atoms,
- slang_type_specifier_type_to_string (func->header.type.specifier.type));
- if (func->header.a_name == SLANG_ATOM_NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- break;
- case FUNCTION_OPERATOR:
- func->kind = slang_func_operator;
- func->header.a_name = parse_operator_name (C);
- if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
- break;
- default:
- return 0;
- }
-
- /* parse function parameters */
- while (*C->I++ == PARAMETER_NEXT)
- {
- slang_variable *p;
-
- func->parameters->variables = (slang_variable *) slang_alloc_realloc (
- func->parameters->variables,
- func->parameters->num_variables * sizeof (slang_variable),
- (func->parameters->num_variables + 1) * sizeof (slang_variable));
- if (func->parameters->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- p = &func->parameters->variables[func->parameters->num_variables];
- if (!slang_variable_construct (p))
- return 0;
- func->parameters->num_variables++;
- if (!parse_parameter_declaration (C, O, p))
- return 0;
- }
-
- /* function formal parameters and local variables share the same scope, so save
- * the information about param count in a seperate place
- * also link the scope to the global variable scope so when a given identifier is not
- * found here, the search process continues in the global space */
- func->param_count = func->parameters->num_variables;
- func->parameters->outer_scope = O->vars;
- return 1;
+ /* parse function type and name */
+ if (!parse_fully_specified_type(C, O, &func->header.type))
+ return 0;
+ switch (*C->I++) {
+ case FUNCTION_ORDINARY:
+ func->kind = slang_func_ordinary;
+ func->header.a_name = parse_identifier(C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ case FUNCTION_CONSTRUCTOR:
+ func->kind = slang_func_constructor;
+ if (func->header.type.specifier.type == slang_spec_struct)
+ return 0;
+ func->header.a_name =
+ slang_atom_pool_atom(C->atoms,
+ slang_type_specifier_type_to_string
+ (func->header.type.specifier.type));
+ if (func->header.a_name == SLANG_ATOM_NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ break;
+ case FUNCTION_OPERATOR:
+ func->kind = slang_func_operator;
+ func->header.a_name = parse_operator_name(C);
+ if (func->header.a_name == SLANG_ATOM_NULL)
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+
+ /* parse function parameters */
+ while (*C->I++ == PARAMETER_NEXT) {
+ slang_variable *p = slang_variable_scope_grow(func->parameters);
+ if (!p) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_parameter_declaration(C, O, p))
+ return 0;
+ }
+
+ /* function formal parameters and local variables share the same
+ * scope, so save the information about param count in a seperate
+ * place also link the scope to the global variable scope so when a
+ * given identifier is not found here, the search process continues
+ * in the global space
+ */
+ func->param_count = func->parameters->num_variables;
+ func->parameters->outer_scope = O->vars;
+ return 1;
}
-static int parse_function_definition (slang_parse_ctx *C, slang_output_ctx *O, slang_function *func)
+static int
+parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O,
+ slang_function * func)
{
- slang_output_ctx o = *O;
-
- if (!parse_function_prototype (C, O, func))
- return 0;
-
- /* create function's body operation */
- func->body = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (func->body == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct (func->body))
- {
- slang_alloc_free (func->body);
- func->body = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
-
- /* to parse the body the parse context is modified in order to capture parsed variables
- * into function's local variable scope */
- C->global_scope = 0;
- o.vars = func->parameters;
- if (!parse_statement (C, &o, func->body))
- return 0;
- C->global_scope = 1;
- return 1;
+ slang_output_ctx o = *O;
+
+ if (!parse_function_prototype(C, O, func))
+ return 0;
+
+ /* create function's body operation */
+ func->body =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (func->body == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_operation_construct(func->body)) {
+ slang_alloc_free(func->body);
+ func->body = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ /* to parse the body the parse context is modified in order to
+ * capture parsed variables into function's local variable scope
+ */
+ C->global_scope = GL_FALSE;
+ o.vars = func->parameters;
+ if (!parse_statement(C, &o, func->body))
+ return 0;
+
+ C->global_scope = GL_TRUE;
+ return 1;
}
-static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var)
+static GLboolean
+initialize_global(slang_assemble_ctx * A, slang_variable * var)
{
- slang_assembly_file_restore_point point;
- slang_machine mach;
- slang_assembly_local_info save_local = A->local;
- slang_operation op_id, op_assign;
- GLboolean result;
-
- /* save the current assembly */
- if (!slang_assembly_file_restore_point_save (A->file, &point))
- return GL_FALSE;
-
- /* setup the machine */
- mach = *A->mach;
- mach.ip = A->file->count;
-
- /* allocate local storage for expression */
- A->local.ret_size = 0;
- A->local.addr_tmp = 0;
- A->local.swizzle_tmp = 4;
- if (!slang_assembly_file_push_label (A->file, slang_asm_local_alloc, 20))
- return GL_FALSE;
- if (!slang_assembly_file_push_label (A->file, slang_asm_enter, 20))
- return GL_FALSE;
-
- /* construct the left side of assignment */
- if (!slang_operation_construct (&op_id))
- return GL_FALSE;
- op_id.type = slang_oper_identifier;
- op_id.a_id = var->a_name;
-
- /* put the variable into operation's scope */
- op_id.locals->variables = (slang_variable *) slang_alloc_malloc (sizeof (slang_variable));
- if (op_id.locals->variables == NULL)
- {
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_id.locals->num_variables = 1;
- op_id.locals->variables[0] = *var;
-
- /* construct the assignment expression */
- if (!slang_operation_construct (&op_assign))
- {
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_assign.type = slang_oper_assign;
- op_assign.children = (slang_operation *) slang_alloc_malloc (2 * sizeof (slang_operation));
- if (op_assign.children == NULL)
- {
- slang_operation_destruct (&op_assign);
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
- return GL_FALSE;
- }
- op_assign.num_children = 2;
- op_assign.children[0] = op_id;
- op_assign.children[1] = *var->initializer;
-
- /* insert the actual expression */
- result = _slang_assemble_operation (A, &op_assign, slang_ref_forbid);
-
- /* carefully destroy the operations */
- op_assign.num_children = 0;
- slang_alloc_free (op_assign.children);
- op_assign.children = NULL;
- slang_operation_destruct (&op_assign);
- op_id.locals->num_variables = 0;
- slang_operation_destruct (&op_id);
-
- if (!result)
- return GL_FALSE;
- if (!slang_assembly_file_push (A->file, slang_asm_exit))
- return GL_FALSE;
-
- /* execute the expression */
- if (!_slang_execute2 (A->file, &mach))
- return GL_FALSE;
-
- /* restore the old assembly */
- if (!slang_assembly_file_restore_point_load (A->file, &point))
- return GL_FALSE;
- A->local = save_local;
-
- /* now we copy the contents of the initialized variable back to the original machine */
- _mesa_memcpy ((GLubyte *) A->mach->mem + var->address, (GLubyte *) mach.mem + var->address,
- var->size);
-
- return GL_TRUE;
+ slang_assembly_file_restore_point point;
+ slang_machine mach;
+ slang_assembly_local_info save_local = A->local;
+ slang_operation op_id, op_assign;
+ GLboolean result;
+
+ /* save the current assembly */
+ if (!slang_assembly_file_restore_point_save(A->file, &point))
+ return GL_FALSE;
+
+ /* setup the machine */
+ mach = *A->mach;
+ mach.ip = A->file->count;
+
+ /* allocate local storage for expression */
+ A->local.ret_size = 0;
+ A->local.addr_tmp = 0;
+ A->local.swizzle_tmp = 4;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_local_alloc, 20))
+ return GL_FALSE;
+ if (!slang_assembly_file_push_label(A->file, slang_asm_enter, 20))
+ return GL_FALSE;
+
+ /* construct the left side of assignment */
+ if (!slang_operation_construct(&op_id))
+ return GL_FALSE;
+ op_id.type = slang_oper_identifier;
+ op_id.a_id = var->a_name;
+
+ /* put the variable into operation's scope */
+ op_id.locals->variables =
+ (slang_variable *) slang_alloc_malloc(sizeof(slang_variable));
+ if (op_id.locals->variables == NULL) {
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_id.locals->num_variables = 1;
+ op_id.locals->variables[0] = *var;
+
+ /* construct the assignment expression */
+ if (!slang_operation_construct(&op_assign)) {
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_assign.type = slang_oper_assign;
+ op_assign.children =
+ (slang_operation *) slang_alloc_malloc(2 * sizeof(slang_operation));
+ if (op_assign.children == NULL) {
+ slang_operation_destruct(&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+ return GL_FALSE;
+ }
+ op_assign.num_children = 2;
+ op_assign.children[0] = op_id;
+ op_assign.children[1] = *var->initializer;
+
+ /* insert the actual expression */
+ result = _slang_assemble_operation(A, &op_assign, slang_ref_forbid);
+
+ /* carefully destroy the operations */
+ op_assign.num_children = 0;
+ slang_alloc_free(op_assign.children);
+ op_assign.children = NULL;
+ slang_operation_destruct(&op_assign);
+ op_id.locals->num_variables = 0;
+ slang_operation_destruct(&op_id);
+
+ if (!result)
+ return GL_FALSE;
+ if (!slang_assembly_file_push(A->file, slang_asm_exit))
+ return GL_FALSE;
+
+ /* execute the expression */
+ if (!_slang_execute2(A->file, &mach))
+ return GL_FALSE;
+
+ /* restore the old assembly */
+ if (!slang_assembly_file_restore_point_load(A->file, &point))
+ return GL_FALSE;
+ A->local = save_local;
+
+ /* now we copy the contents of the initialized variable back to the original machine */
+ _mesa_memcpy((GLubyte *) A->mach->mem + var->address,
+ (GLubyte *) mach.mem + var->address, var->size);
+
+ return GL_TRUE;
}
/* init declarator list */
@@ -1594,89 +1630,88 @@ static GLboolean initialize_global (slang_assemble_ctx *A, slang_variable *var)
#define VARIABLE_ARRAY_EXPLICIT 3
#define VARIABLE_ARRAY_UNKNOWN 4
-static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O,
- const slang_fully_specified_type *type)
+
+/**
+ * Parse the initializer for a variable declaration.
+ */
+static int
+parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
+ const slang_fully_specified_type * type)
{
- slang_variable *var;
-
- /* empty init declatator (without name, e.g. "float ;") */
- if (*C->I++ == VARIABLE_NONE)
- return 1;
-
- /* make room for the new variable and initialize it */
- O->vars->variables = (slang_variable *) slang_alloc_realloc (O->vars->variables,
- O->vars->num_variables * sizeof (slang_variable),
- (O->vars->num_variables + 1) * sizeof (slang_variable));
- if (O->vars->variables == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- var = &O->vars->variables[O->vars->num_variables];
- if (!slang_variable_construct (var))
- return 0;
- O->vars->num_variables++;
-
- /* copy the declarator qualifier type, parse the identifier */
- var->global = C->global_scope;
- var->type.qualifier = type->qualifier;
- var->a_name = parse_identifier (C);
- if (var->a_name == SLANG_ATOM_NULL)
- return 0;
-
- switch (*C->I++)
- {
- case VARIABLE_NONE:
- /* simple variable declarator - just copy the specifier */
- if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
- return 0;
- break;
- case VARIABLE_INITIALIZER:
- /* initialized variable - copy the specifier and parse the expression */
- if (!slang_type_specifier_copy (&var->type.specifier, &type->specifier))
- return 0;
- var->initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (var->initializer == NULL)
- {
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!slang_operation_construct (var->initializer))
- {
- slang_alloc_free (var->initializer);
- var->initializer = NULL;
- slang_info_log_memory (C->L);
- return 0;
- }
- if (!parse_expression (C, O, var->initializer))
- return 0;
- break;
+ slang_variable *var;
+
+ /* empty init declatator (without name, e.g. "float ;") */
+ if (*C->I++ == VARIABLE_NONE)
+ return 1;
+
+ /* make room for the new variable and initialize it */
+ var = slang_variable_scope_grow(O->vars);
+ if (!var) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+
+ /* copy the declarator qualifier type, parse the identifier */
+ var->global = C->global_scope;
+ var->type.qualifier = type->qualifier;
+ var->a_name = parse_identifier(C);
+ if (var->a_name == SLANG_ATOM_NULL)
+ return 0;
+
+ switch (*C->I++) {
+ case VARIABLE_NONE:
+ /* simple variable declarator - just copy the specifier */
+ if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
+ return 0;
+ break;
+ case VARIABLE_INITIALIZER:
+ /* initialized variable - copy the specifier and parse the expression */
+ if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
+ return 0;
+ var->initializer =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (var->initializer == NULL) {
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!slang_operation_construct(var->initializer)) {
+ slang_alloc_free(var->initializer);
+ var->initializer = NULL;
+ slang_info_log_memory(C->L);
+ return 0;
+ }
+ if (!parse_expression(C, O, var->initializer))
+ return 0;
+ break;
#if 0
- case VARIABLE_ARRAY_UNKNOWN:
- /* unsized array - mark it as array and copy the specifier to the array element */
- if (!convert_to_array (C, var, &type->specifier))
- return GL_FALSE;
- break;
+ case VARIABLE_ARRAY_UNKNOWN:
+ /* unsized array - mark it as array and copy the specifier to
+ the array element
+ */
+ if (!convert_to_array(C, var, &type->specifier))
+ return GL_FALSE;
+ break;
#endif
- case VARIABLE_ARRAY_EXPLICIT:
- if (!convert_to_array (C, var, &type->specifier))
- return GL_FALSE;
- if (!parse_array_len (C, O, &var->array_len))
- return GL_FALSE;
- break;
- default:
- return 0;
- }
-
- /* allocate global address space for a variable with a known size */
- if (C->global_scope && !(var->type.specifier.type == slang_spec_array && var->array_len == 0))
- {
- if (!calculate_var_size (C, O, var))
- return GL_FALSE;
- var->address = slang_var_pool_alloc (O->global_pool, var->size);
- }
-
- /* initialize global variable */
+ case VARIABLE_ARRAY_EXPLICIT:
+ if (!convert_to_array(C, var, &type->specifier))
+ return GL_FALSE;
+ if (!parse_array_len(C, O, &var->array_len))
+ return GL_FALSE;
+ break;
+ default:
+ return 0;
+ }
+
+ /* allocate global address space for a variable with a known size */
+ if (C->global_scope
+ && !(var->type.specifier.type == slang_spec_array
+ && var->array_len == 0)) {
+ if (!calculate_var_size(C, O, var))
+ return GL_FALSE;
+ var->address = slang_var_pool_alloc(O->global_pool, var->size);
+ }
+
+ /* initialize global variable */
if (C->global_scope) {
if (var->initializer != NULL) {
slang_assemble_ctx A;
@@ -1687,160 +1722,171 @@ static int parse_init_declarator (slang_parse_ctx *C, slang_output_ctx *O,
A.space.funcs = O->funs;
A.space.structs = O->structs;
A.space.vars = O->vars;
- if (!initialize_global (&A, var))
+ if (!initialize_global(&A, var))
return 0;
}
else {
- _mesa_memset ((GLubyte *) (O->machine->mem) + var->address, 0, var->size);
+ _mesa_memset((GLubyte *) (O->machine->mem) + var->address, 0,
+ var->size);
}
- }
- return 1;
+ }
+ return 1;
}
-static int parse_init_declarator_list (slang_parse_ctx *C, slang_output_ctx *O)
+/**
+ * Parse a list of variable declarations. Each variable may have an
+ * initializer.
+ */
+static int
+parse_init_declarator_list(slang_parse_ctx * C, slang_output_ctx * O)
{
- slang_fully_specified_type type;
-
- /* parse the fully specified type, common to all declarators */
- if (!slang_fully_specified_type_construct (&type))
- return 0;
- if (!parse_fully_specified_type (C, O, &type))
- {
- slang_fully_specified_type_destruct (&type);
- return 0;
- }
-
- /* parse declarators, pass-in the parsed type */
- do
- {
- if (!parse_init_declarator (C, O, &type))
- {
- slang_fully_specified_type_destruct (&type);
- return 0;
- }
- }
- while (*C->I++ == DECLARATOR_NEXT);
-
- slang_fully_specified_type_destruct (&type);
- return 1;
+ slang_fully_specified_type type;
+
+ /* parse the fully specified type, common to all declarators */
+ if (!slang_fully_specified_type_construct(&type))
+ return 0;
+ if (!parse_fully_specified_type(C, O, &type)) {
+ slang_fully_specified_type_destruct(&type);
+ return 0;
+ }
+
+ /* parse declarators, pass-in the parsed type */
+ do {
+ if (!parse_init_declarator(C, O, &type)) {
+ slang_fully_specified_type_destruct(&type);
+ return 0;
+ }
+ }
+ while (*C->I++ == DECLARATOR_NEXT);
+
+ slang_fully_specified_type_destruct(&type);
+ return 1;
}
-static int parse_function (slang_parse_ctx *C, slang_output_ctx *O, int definition,
- slang_function **parsed_func_ret)
+
+/**
+ * Parse a function definition or declaration.
+ * \param C parsing context
+ * \param O output context
+ * \param definition if non-zero expect a definition, else a declaration
+ * \param parsed_func_ret returns the parsed function
+ * \return 1 if success, 0 if failure
+ */
+static int
+parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition,
+ slang_function ** parsed_func_ret)
{
- slang_function parsed_func, *found_func;
-
- /* parse function definition/declaration */
- if (!slang_function_construct (&parsed_func))
- return 0;
- if (definition)
- {
- if (!parse_function_definition (C, O, &parsed_func))
- {
- slang_function_destruct (&parsed_func);
- return 0;
- }
- }
- else
- {
- if (!parse_function_prototype (C, O, &parsed_func))
- {
- slang_function_destruct (&parsed_func);
- return 0;
- }
- }
-
- /* find a function with a prototype matching the parsed one - only the current scope
- * is being searched to allow built-in function overriding */
- found_func = slang_function_scope_find (O->funs, &parsed_func, 0);
- if (found_func == NULL)
- {
- /* add the parsed function to the function list */
- O->funs->functions = (slang_function *) slang_alloc_realloc (O->funs->functions,
- O->funs->num_functions * sizeof (slang_function),
- (O->funs->num_functions + 1) * sizeof (slang_function));
- if (O->funs->functions == NULL)
- {
- slang_info_log_memory (C->L);
- slang_function_destruct (&parsed_func);
- return 0;
- }
- O->funs->functions[O->funs->num_functions] = parsed_func;
- O->funs->num_functions++;
-
- /* return the newly parsed function */
- *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1];
- }
- else
- {
- /* TODO: check function return type qualifiers and specifiers */
- if (definition)
- {
- if (found_func->body != NULL)
- {
- slang_info_log_error (C->L, "%s: function already has a body.",
- slang_atom_pool_id (C->atoms, parsed_func.header.a_name));
- slang_function_destruct (&parsed_func);
- return 0;
- }
-
- /* destroy the existing function declaration and replace it with the new one,
- * remember to save the fixup table */
- parsed_func.fixups = found_func->fixups;
- slang_fixup_table_init (&found_func->fixups);
- slang_function_destruct (found_func);
- *found_func = parsed_func;
- }
- else
- {
- /* another declaration of the same function prototype - ignore it */
- slang_function_destruct (&parsed_func);
- }
-
- /* return the found function */
- *parsed_func_ret = found_func;
- }
-
- /* assemble the parsed function */
- {
- slang_assemble_ctx A;
-
- A.file = O->assembly;
- A.mach = O->machine;
- A.atoms = C->atoms;
- A.space.funcs = O->funs;
- A.space.structs = O->structs;
- A.space.vars = O->vars;
- if (!_slang_assemble_function (&A, *parsed_func_ret))
- return 0;
- }
- return 1;
+ slang_function parsed_func, *found_func;
+
+ /* parse function definition/declaration */
+ if (!slang_function_construct(&parsed_func))
+ return 0;
+ if (definition) {
+ if (!parse_function_definition(C, O, &parsed_func)) {
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ }
+ else {
+ if (!parse_function_prototype(C, O, &parsed_func)) {
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ }
+
+ /* find a function with a prototype matching the parsed one - only
+ * the current scope is being searched to allow built-in function
+ * overriding
+ */
+ found_func = slang_function_scope_find(O->funs, &parsed_func, 0);
+ if (found_func == NULL) {
+ /* add the parsed function to the function list */
+ O->funs->functions =
+ (slang_function *) slang_alloc_realloc(O->funs->functions,
+ O->funs->num_functions *
+ sizeof(slang_function),
+ (O->funs->num_functions +
+ 1) * sizeof(slang_function));
+ if (O->funs->functions == NULL) {
+ slang_info_log_memory(C->L);
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+ O->funs->functions[O->funs->num_functions] = parsed_func;
+ O->funs->num_functions++;
+
+ /* return the newly parsed function */
+ *parsed_func_ret = &O->funs->functions[O->funs->num_functions - 1];
+ }
+ else {
+ /* TODO: check function return type qualifiers and specifiers */
+ if (definition) {
+ if (found_func->body != NULL) {
+ slang_info_log_error(C->L, "%s: function already has a body.",
+ slang_atom_pool_id(C->atoms,
+ parsed_func.header.
+ a_name));
+ slang_function_destruct(&parsed_func);
+ return 0;
+ }
+
+ /* destroy the existing function declaration and replace it
+ * with the new one, remember to save the fixup table
+ */
+ parsed_func.fixups = found_func->fixups;
+ slang_fixup_table_init(&found_func->fixups);
+ slang_function_destruct(found_func);
+ *found_func = parsed_func;
+ }
+ else {
+ /* another declaration of the same function prototype - ignore it */
+ slang_function_destruct(&parsed_func);
+ }
+
+ /* return the found function */
+ *parsed_func_ret = found_func;
+ }
+
+ /* assemble the parsed function */
+ {
+ slang_assemble_ctx A;
+
+ A.file = O->assembly;
+ A.mach = O->machine;
+ A.atoms = C->atoms;
+ A.space.funcs = O->funs;
+ A.space.structs = O->structs;
+ A.space.vars = O->vars;
+ if (!_slang_assemble_function(&A, *parsed_func_ret))
+ return 0;
+ }
+ return 1;
}
/* declaration */
#define DECLARATION_FUNCTION_PROTOTYPE 1
#define DECLARATION_INIT_DECLARATOR_LIST 2
-static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O)
+static int
+parse_declaration(slang_parse_ctx * C, slang_output_ctx * O)
{
- switch (*C->I++)
- {
- case DECLARATION_INIT_DECLARATOR_LIST:
- if (!parse_init_declarator_list (C, O))
- return 0;
- break;
- case DECLARATION_FUNCTION_PROTOTYPE:
- {
- slang_function *dummy_func;
-
- if (!parse_function (C, O, 0, &dummy_func))
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
+ switch (*C->I++) {
+ case DECLARATION_INIT_DECLARATOR_LIST:
+ if (!parse_init_declarator_list(C, O))
+ return 0;
+ break;
+ case DECLARATION_FUNCTION_PROTOTYPE:
+ {
+ slang_function *dummy_func;
+
+ if (!parse_function(C, O, 0, &dummy_func))
+ return 0;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return 1;
}
/* external declaration */
@@ -1849,9 +1895,9 @@ static int parse_declaration (slang_parse_ctx *C, slang_output_ctx *O)
#define EXTERNAL_DECLARATION 2
static GLboolean
-parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit)
+parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit)
{
- slang_output_ctx o;
+ slang_output_ctx o;
/* setup output context */
o.funs = &unit->funs;
@@ -1861,34 +1907,33 @@ parse_code_unit (slang_parse_ctx *C, slang_code_unit *unit)
o.global_pool = &unit->object->varpool;
o.machine = &unit->object->machine;
- /* parse individual functions and declarations */
- while (*C->I != EXTERNAL_NULL)
- {
- switch (*C->I++)
- {
- case EXTERNAL_FUNCTION_DEFINITION:
- {
- slang_function *func;
-
- if (!parse_function (C, &o, 1, &func))
- return 0;
- }
- break;
- case EXTERNAL_DECLARATION:
- if (!parse_declaration (C, &o))
- return 0;
- break;
- default:
- return 0;
- }
- }
- C->I++;
- return 1;
+ /* parse individual functions and declarations */
+ while (*C->I != EXTERNAL_NULL) {
+ switch (*C->I++) {
+ case EXTERNAL_FUNCTION_DEFINITION:
+ {
+ slang_function *func;
+
+ if (!parse_function(C, &o, 1, &func))
+ return 0;
+ }
+ break;
+ case EXTERNAL_DECLARATION:
+ if (!parse_declaration(C, &o))
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ }
+ C->I++;
+ return 1;
}
static GLboolean
-compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
- slang_info_log *infolog, slang_code_unit *builtin, slang_code_unit *downlink)
+compile_binary(const byte * prod, slang_code_unit * unit,
+ slang_unit_type type, slang_info_log * infolog,
+ slang_code_unit * builtin, slang_code_unit * downlink)
{
slang_parse_ctx C;
@@ -1901,7 +1946,7 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
C.global_scope = GL_TRUE;
C.atoms = &unit->object->atompool;
- if (!check_revision (&C))
+ if (!check_revision(&C))
return GL_FALSE;
if (downlink != NULL) {
@@ -1911,58 +1956,64 @@ compile_binary (const byte *prod, slang_code_unit *unit, slang_unit_type type,
}
/* parse translation unit */
- return parse_code_unit (&C, unit);
+ return parse_code_unit(&C, unit);
}
static GLboolean
-compile_with_grammar (grammar id, const char *source, slang_code_unit *unit, slang_unit_type type,
- slang_info_log *infolog, slang_code_unit *builtin)
+compile_with_grammar(grammar id, const char *source, slang_code_unit * unit,
+ slang_unit_type type, slang_info_log * infolog,
+ slang_code_unit * builtin)
{
byte *prod;
GLuint size, start, version;
slang_string preprocessed;
/* First retrieve the version number. */
- if (!_slang_preprocess_version (source, &version, &start, infolog))
+ if (!_slang_preprocess_version(source, &version, &start, infolog))
return GL_FALSE;
if (version > 110) {
- slang_info_log_error (infolog, "language version specified is not supported.");
+ slang_info_log_error(infolog,
+ "language version specified is not supported.");
return GL_FALSE;
}
/* Now preprocess the source string. */
- slang_string_init (&preprocessed);
- if (!_slang_preprocess_directives (&preprocessed, &source[start], infolog)) {
- slang_string_free (&preprocessed);
- slang_info_log_error (infolog, "failed to preprocess the source.");
+ slang_string_init(&preprocessed);
+ if (!_slang_preprocess_directives(&preprocessed, &source[start], infolog)) {
+ slang_string_free(&preprocessed);
+ slang_info_log_error(infolog, "failed to preprocess the source.");
return GL_FALSE;
}
/* Finally check the syntax and generate its binary representation. */
- if (!grammar_fast_check (id, (const byte *) (slang_string_cstr (&preprocessed)), &prod, &size, 65536)) {
+ if (!grammar_fast_check
+ (id, (const byte *) (slang_string_cstr(&preprocessed)), &prod, &size,
+ 65536)) {
char buf[1024];
GLint pos;
- slang_string_free (&preprocessed);
- grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos);
- slang_info_log_error (infolog, buf);
+ slang_string_free(&preprocessed);
+ grammar_get_last_error((byte *) (buf), sizeof(buf), &pos);
+ slang_info_log_error(infolog, buf);
return GL_FALSE;
}
- slang_string_free (&preprocessed);
+ slang_string_free(&preprocessed);
/* Syntax is okay - translate it to internal representation. */
- if (!compile_binary (prod, unit, type, infolog, builtin, &builtin[SLANG_BUILTIN_TOTAL - 1])) {
- grammar_alloc_free (prod);
+ if (!compile_binary
+ (prod, unit, type, infolog, builtin,
+ &builtin[SLANG_BUILTIN_TOTAL - 1])) {
+ grammar_alloc_free(prod);
return GL_FALSE;
}
- grammar_alloc_free (prod);
+ grammar_alloc_free(prod);
return GL_TRUE;
}
-static const char *slang_shader_syn =
+LONGSTRING static const char *slang_shader_syn =
#include "library/slang_shader_syn.h"
-;
+ ;
static const byte slang_core_gc[] = {
#include "library/slang_core_gc.h"
@@ -1987,106 +2038,111 @@ static const byte slang_builtin_vec4_gc[] = {
#endif
static GLboolean
-compile_object (grammar *id, const char *source, slang_code_object *object, slang_unit_type type,
- slang_info_log *infolog)
+compile_object(grammar * id, const char *source, slang_code_object * object,
+ slang_unit_type type, slang_info_log * infolog)
{
slang_code_unit *builtins = NULL;
/* load GLSL grammar */
- *id = grammar_load_from_text ((const byte *) (slang_shader_syn));
- if (*id == 0)
- {
- byte buf[1024];
- int pos;
-
- grammar_get_last_error (buf, 1024, &pos);
- slang_info_log_error (infolog, (const char *) (buf));
+ *id = grammar_load_from_text((const byte *) (slang_shader_syn));
+ if (*id == 0) {
+ byte buf[1024];
+ int pos;
+
+ grammar_get_last_error(buf, 1024, &pos);
+ slang_info_log_error(infolog, (const char *) (buf));
return GL_FALSE;
- }
-
- /* set shader type - the syntax is slightly different for different shaders */
- if (type == slang_unit_fragment_shader || type == slang_unit_fragment_builtin)
- grammar_set_reg8 (*id, (const byte *) "shader_type", 1);
- else
- grammar_set_reg8 (*id, (const byte *) "shader_type", 2);
-
- /* enable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 1);
-
- /* if parsing user-specified shader, load built-in library */
- if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader)
- {
- /* compile core functionality first */
- if (!compile_binary (slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE],
- slang_unit_fragment_builtin, infolog, NULL, NULL))
+ }
+
+ /* set shader type - the syntax is slightly different for different shaders */
+ if (type == slang_unit_fragment_shader
+ || type == slang_unit_fragment_builtin)
+ grammar_set_reg8(*id, (const byte *) "shader_type", 1);
+ else
+ grammar_set_reg8(*id, (const byte *) "shader_type", 2);
+
+ /* enable language extensions */
+ grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1);
+
+ /* if parsing user-specified shader, load built-in library */
+ if (type == slang_unit_fragment_shader || type == slang_unit_vertex_shader) {
+ /* compile core functionality first */
+ if (!compile_binary(slang_core_gc, &object->builtin[SLANG_BUILTIN_CORE],
+ slang_unit_fragment_builtin, infolog, NULL, NULL))
return GL_FALSE;
- /* compile common functions and variables, link to core */
- if (!compile_binary (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_CORE]))
+ /* compile common functions and variables, link to core */
+ if (!compile_binary
+ (slang_common_builtin_gc, &object->builtin[SLANG_BUILTIN_COMMON],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_CORE]))
return GL_FALSE;
- /* compile target-specific functions and variables, link to common */
- if (type == slang_unit_fragment_shader)
- {
- if (!compile_binary (slang_fragment_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_COMMON]))
+ /* compile target-specific functions and variables, link to common */
+ if (type == slang_unit_fragment_shader) {
+ if (!compile_binary
+ (slang_fragment_builtin_gc,
+ &object->builtin[SLANG_BUILTIN_TARGET],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_COMMON]))
return GL_FALSE;
- }
- else if (type == slang_unit_vertex_shader)
- {
- if (!compile_binary (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
- slang_unit_vertex_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_COMMON]))
+ }
+ else if (type == slang_unit_vertex_shader) {
+ if (!compile_binary
+ (slang_vertex_builtin_gc, &object->builtin[SLANG_BUILTIN_TARGET],
+ slang_unit_vertex_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_COMMON]))
return GL_FALSE;
- }
+ }
#if defined(USE_X86_ASM) || defined(SLANG_X86)
/* compile x86 4-component vector overrides, link to target */
- if (!compile_binary (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4],
- slang_unit_fragment_builtin, infolog, NULL,
- &object->builtin[SLANG_BUILTIN_TARGET]))
+ if (!compile_binary
+ (slang_builtin_vec4_gc, &object->builtin[SLANG_BUILTIN_VEC4],
+ slang_unit_fragment_builtin, infolog, NULL,
+ &object->builtin[SLANG_BUILTIN_TARGET]))
return GL_FALSE;
#endif
- /* disable language extensions */
- grammar_set_reg8 (*id, (const byte *) "parsing_builtin", 0);
+ /* disable language extensions */
+ grammar_set_reg8(*id, (const byte *) "parsing_builtin", 0);
builtins = object->builtin;
- }
+ }
- /* compile the actual shader - pass-in built-in library for external shader */
- return compile_with_grammar (*id, source, &object->unit, type, infolog, builtins);
+ /* compile the actual shader - pass-in built-in library for external shader */
+ return compile_with_grammar(*id, source, &object->unit, type, infolog,
+ builtins);
}
GLboolean
-_slang_compile (const char *source, slang_code_object *object, slang_unit_type type,
- slang_info_log *infolog)
+_slang_compile(const char *source, slang_code_object * object,
+ slang_unit_type type, slang_info_log * infolog)
{
GLboolean success;
grammar id = 0;
- _slang_code_object_dtr (object);
- _slang_code_object_ctr (object);
+ _slang_code_object_dtr(object);
+ _slang_code_object_ctr(object);
- success = compile_object (&id, source, object, type, infolog);
+ success = compile_object(&id, source, object, type, infolog);
if (id != 0)
- grammar_destroy (id);
+ grammar_destroy(id);
if (!success)
return GL_FALSE;
- if (!_slang_build_export_data_table (&object->expdata, &object->unit.vars))
+ if (!_slang_build_export_data_table(&object->expdata, &object->unit.vars))
return GL_FALSE;
- if (!_slang_build_export_code_table (&object->expcode, &object->unit.funs, &object->unit))
+ if (!_slang_build_export_code_table
+ (&object->expcode, &object->unit.funs, &object->unit))
return GL_FALSE;
#if defined(USE_X86_ASM) || defined(SLANG_X86)
/* XXX: lookup the @main label */
- if (!_slang_x86_codegen (&object->machine, &object->assembly, object->expcode.entries[0].address))
+ if (!_slang_x86_codegen
+ (&object->machine, &object->assembly,
+ object->expcode.entries[0].address))
return GL_FALSE;
#endif
return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c
index eb8fd1bd40f..e6e0d89ddb6 100644
--- a/src/mesa/shader/slang/slang_compile_function.c
+++ b/src/mesa/shader/slang/slang_compile_function.c
@@ -33,50 +33,74 @@
/* slang_fixup_table */
-void slang_fixup_table_init (slang_fixup_table *fix)
+void
+slang_fixup_table_init(slang_fixup_table * fix)
{
- fix->table = NULL;
- fix->count = 0;
+ fix->table = NULL;
+ fix->count = 0;
}
-void slang_fixup_table_free (slang_fixup_table *fix)
+void
+slang_fixup_table_free(slang_fixup_table * fix)
{
- slang_alloc_free (fix->table);
- slang_fixup_table_init (fix);
+ slang_alloc_free(fix->table);
+ slang_fixup_table_init(fix);
}
+/**
+ * Add a new fixup address to the table.
+ */
+GLboolean
+slang_fixup_save(slang_fixup_table *fixups, GLuint address)
+{
+ fixups->table = (GLuint *)
+ slang_alloc_realloc(fixups->table,
+ fixups->count * sizeof(GLuint),
+ (fixups->count + 1) * sizeof(GLuint));
+ if (fixups->table == NULL)
+ return GL_FALSE;
+ fixups->table[fixups->count] = address;
+ fixups->count++;
+ return GL_TRUE;
+}
+
+
+
/* slang_function */
-int slang_function_construct (slang_function *func)
+int
+slang_function_construct(slang_function * func)
{
- func->kind = slang_func_ordinary;
- if (!slang_variable_construct (&func->header))
- return 0;
- func->parameters = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (func->parameters == NULL)
- {
- slang_variable_destruct (&func->header);
- return 0;
- }
- _slang_variable_scope_ctr (func->parameters);
- func->param_count = 0;
- func->body = NULL;
- func->address = ~0;
- slang_fixup_table_init (&func->fixups);
- return 1;
+ func->kind = slang_func_ordinary;
+ if (!slang_variable_construct(&func->header))
+ return 0;
+
+ func->parameters = (slang_variable_scope *)
+ slang_alloc_malloc(sizeof(slang_variable_scope));
+ if (func->parameters == NULL) {
+ slang_variable_destruct(&func->header);
+ return 0;
+ }
+
+ _slang_variable_scope_ctr(func->parameters);
+ func->param_count = 0;
+ func->body = NULL;
+ func->address = ~0;
+ slang_fixup_table_init(&func->fixups);
+ return 1;
}
-void slang_function_destruct (slang_function *func)
+void
+slang_function_destruct(slang_function * func)
{
- slang_variable_destruct (&func->header);
- slang_variable_scope_destruct (func->parameters);
- slang_alloc_free (func->parameters);
- if (func->body != NULL)
- {
- slang_operation_destruct (func->body);
- slang_alloc_free (func->body);
- }
- slang_fixup_table_free (&func->fixups);
+ slang_variable_destruct(&func->header);
+ slang_variable_scope_destruct(func->parameters);
+ slang_alloc_free(func->parameters);
+ if (func->body != NULL) {
+ slang_operation_destruct(func->body);
+ slang_alloc_free(func->body);
+ }
+ slang_fixup_table_free(&func->fixups);
}
/*
@@ -84,60 +108,82 @@ void slang_function_destruct (slang_function *func)
*/
GLvoid
-_slang_function_scope_ctr (slang_function_scope *self)
+_slang_function_scope_ctr(slang_function_scope * self)
{
self->functions = NULL;
self->num_functions = 0;
self->outer_scope = NULL;
}
-void slang_function_scope_destruct (slang_function_scope *scope)
+void
+slang_function_scope_destruct(slang_function_scope * scope)
{
- unsigned int i;
+ unsigned int i;
- for (i = 0; i < scope->num_functions; i++)
- slang_function_destruct (scope->functions + i);
- slang_alloc_free (scope->functions);
+ for (i = 0; i < scope->num_functions; i++)
+ slang_function_destruct(scope->functions + i);
+ slang_alloc_free(scope->functions);
}
-int slang_function_scope_find_by_name (slang_function_scope *funcs, slang_atom a_name, int all_scopes)
+
+/**
+ * Search a list of functions for a particular function by name.
+ * \param funcs the list of functions to search
+ * \param a_name the name to search for
+ * \param all_scopes if non-zero, search containing scopes too.
+ * \return pointer to found function, or NULL.
+ */
+int
+slang_function_scope_find_by_name(slang_function_scope * funcs,
+ slang_atom a_name, int all_scopes)
{
- unsigned int i;
-
- for (i = 0; i < funcs->num_functions; i++)
- if (a_name == funcs->functions[i].header.a_name)
- return 1;
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find_by_name (funcs->outer_scope, a_name, 1);
- return 0;
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++)
+ if (a_name == funcs->functions[i].header.a_name)
+ return 1;
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find_by_name(funcs->outer_scope, a_name, 1);
+ return 0;
}
-slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_function *fun,
- int all_scopes)
+
+/**
+ * Search a list of functions for a particular function (for implementing
+ * function calls. Matching is done by first comparing the function's name,
+ * then the function's parameter list.
+ *
+ * \param funcs the list of functions to search
+ * \param fun the function to search for
+ * \param all_scopes if non-zero, search containing scopes too.
+ * \return pointer to found function, or NULL.
+ */
+slang_function *
+slang_function_scope_find(slang_function_scope * funcs, slang_function * fun,
+ int all_scopes)
{
- unsigned int i;
-
- for (i = 0; i < funcs->num_functions; i++)
- {
- slang_function *f = &funcs->functions[i];
- unsigned int j;
-
- if (fun->header.a_name != f->header.a_name)
- continue;
- if (fun->param_count != f->param_count)
- continue;
- for (j = 0; j < fun->param_count; j++)
- {
- if (!slang_type_specifier_equal (&fun->parameters->variables[j].type.specifier,
- &f->parameters->variables[j].type.specifier))
- break;
- }
- if (j == fun->param_count)
- return f;
- }
- if (all_scopes && funcs->outer_scope != NULL)
- return slang_function_scope_find (funcs->outer_scope, fun, 1);
- return NULL;
+ unsigned int i;
+
+ for (i = 0; i < funcs->num_functions; i++) {
+ slang_function *f = &funcs->functions[i];
+ unsigned int j;
+
+ if (fun->header.a_name != f->header.a_name)
+ continue;
+ if (fun->param_count != f->param_count)
+ continue;
+ for (j = 0; j < fun->param_count; j++) {
+ if (!slang_type_specifier_equal
+ (&fun->parameters->variables[j].type.specifier,
+ &f->parameters->variables[j].type.specifier))
+ break;
+ }
+ if (j == fun->param_count)
+ return f;
+ }
+ if (all_scopes && funcs->outer_scope != NULL)
+ return slang_function_scope_find(funcs->outer_scope, fun, 1);
+ return NULL;
}
/*
@@ -145,31 +191,30 @@ slang_function *slang_function_scope_find (slang_function_scope *funcs, slang_fu
*/
GLboolean
-_slang_build_export_code_table (slang_export_code_table *tbl, slang_function_scope *funs,
- slang_code_unit *unit)
+_slang_build_export_code_table(slang_export_code_table * tbl,
+ slang_function_scope * funs,
+ slang_code_unit * unit)
{
- slang_atom mainAtom;
- GLuint i;
-
- mainAtom = slang_atom_pool_atom (tbl->atoms, "main");
- if (mainAtom == SLANG_ATOM_NULL)
- return GL_FALSE;
-
- for (i = 0; i < funs->num_functions; i++)
- {
- if (funs->functions[i].header.a_name == mainAtom)
- {
- slang_function *fun = &funs->functions[i];
- slang_export_code_entry *e;
- slang_assemble_ctx A;
-
- e = slang_export_code_table_add (tbl);
- if (e == NULL)
- return GL_FALSE;
+ slang_atom mainAtom;
+ GLuint i;
+
+ mainAtom = slang_atom_pool_atom(tbl->atoms, "main");
+ if (mainAtom == SLANG_ATOM_NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < funs->num_functions; i++) {
+ if (funs->functions[i].header.a_name == mainAtom) {
+ slang_function *fun = &funs->functions[i];
+ slang_export_code_entry *e;
+ slang_assemble_ctx A;
+
+ e = slang_export_code_table_add(tbl);
+ if (e == NULL)
+ return GL_FALSE;
e->address = unit->object->assembly.count;
- e->name = slang_atom_pool_atom (tbl->atoms, "@main");
- if (e->name == SLANG_ATOM_NULL)
- return GL_FALSE;
+ e->name = slang_atom_pool_atom(tbl->atoms, "@main");
+ if (e->name == SLANG_ATOM_NULL)
+ return GL_FALSE;
A.file = &unit->object->assembly;
A.mach = &unit->object->machine;
@@ -177,12 +222,13 @@ _slang_build_export_code_table (slang_export_code_table *tbl, slang_function_sco
A.space.funcs = &unit->funs;
A.space.structs = &unit->structs;
A.space.vars = &unit->vars;
- slang_assembly_file_push_label (&unit->object->assembly, slang_asm_local_alloc, 20);
- slang_assembly_file_push_label (&unit->object->assembly, slang_asm_enter, 20);
- _slang_assemble_function_call (&A, fun, NULL, 0, GL_FALSE);
- slang_assembly_file_push (&unit->object->assembly, slang_asm_exit);
- }
- }
- return GL_TRUE;
+ slang_assembly_file_push_label(&unit->object->assembly,
+ slang_asm_local_alloc, 20);
+ slang_assembly_file_push_label(&unit->object->assembly,
+ slang_asm_enter, 20);
+ _slang_assemble_function_call(&A, fun, NULL, 0, GL_FALSE);
+ slang_assembly_file_push(&unit->object->assembly, slang_asm_exit);
+ }
+ }
+ return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h
index 24bc0d6ffd1..c05c6f4d850 100644
--- a/src/mesa/shader/slang/slang_compile_function.h
+++ b/src/mesa/shader/slang/slang_compile_function.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_FUNCTION_H
+#ifndef SLANG_COMPILE_FUNCTION_H
#define SLANG_COMPILE_FUNCTION_H
#if defined __cplusplus
@@ -31,57 +31,81 @@ extern "C" {
struct slang_code_unit_;
+/**
+ * Types of functions.
+ */
typedef enum slang_function_kind_
{
- slang_func_ordinary,
- slang_func_constructor,
- slang_func_operator
+ slang_func_ordinary,
+ slang_func_constructor,
+ slang_func_operator
} slang_function_kind;
+
+/**
+ * When we need to fill in addresses which we won't know until the future,
+ * we keep track of them with a fix-up table.
+ */
typedef struct slang_fixup_table_
{
- GLuint *table;
- GLuint count;
+ GLuint *table; /**< array[count] of addresses */
+ GLuint count;
} slang_fixup_table;
-void slang_fixup_table_init (slang_fixup_table *);
-void slang_fixup_table_free (slang_fixup_table *);
+extern void slang_fixup_table_init(slang_fixup_table *);
+extern void slang_fixup_table_free(slang_fixup_table *);
+extern GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address);
+
+/**
+ * Description of a compiled shader function.
+ */
typedef struct slang_function_
{
- slang_function_kind kind;
- slang_variable header;
- slang_variable_scope *parameters;
- unsigned int param_count;
- slang_operation *body;
- unsigned int address;
- slang_fixup_table fixups;
+ slang_function_kind kind;
+ slang_variable header; /**< The function's name and return type */
+ slang_variable_scope *parameters; /**< formal parameters AND local vars */
+ unsigned int param_count; /**< number of formal params (no locals) */
+ slang_operation *body; /**< The instruction tree */
+ unsigned int address; /**< Address of this func in memory */
+ slang_fixup_table fixups; /**< Mem locations which need func's address */
} slang_function;
-int slang_function_construct (slang_function *);
-void slang_function_destruct (slang_function *);
+extern int slang_function_construct(slang_function *);
+extern void slang_function_destruct(slang_function *);
+
+/**
+ * Basically, a list of compiled functions.
+ */
typedef struct slang_function_scope_
{
- slang_function *functions;
+ slang_function *functions;
GLuint num_functions;
- struct slang_function_scope_ *outer_scope;
+ struct slang_function_scope_ *outer_scope;
} slang_function_scope;
+
extern GLvoid
-_slang_function_scope_ctr (slang_function_scope *);
+_slang_function_scope_ctr(slang_function_scope *);
+
+extern void
+slang_function_scope_destruct(slang_function_scope *);
+
+extern int
+slang_function_scope_find_by_name(slang_function_scope *, slang_atom, int);
-void slang_function_scope_destruct (slang_function_scope *);
-int slang_function_scope_find_by_name (slang_function_scope *, slang_atom, int);
-slang_function *slang_function_scope_find (slang_function_scope *, slang_function *, int);
+extern slang_function *
+slang_function_scope_find(slang_function_scope *, slang_function *, int);
extern GLboolean
-_slang_build_export_code_table (slang_export_code_table *, slang_function_scope *,
- struct slang_code_unit_ *);
+_slang_build_export_code_table(slang_export_code_table *,
+ slang_function_scope *,
+ struct slang_code_unit_ *);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_FUNCTION_H */
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
index 7e920135597..73f57bfb123 100644
--- a/src/mesa/shader/slang/slang_compile_operation.c
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -31,68 +31,85 @@
#include "imports.h"
#include "slang_compile.h"
-/* slang_operation */
-int slang_operation_construct (slang_operation *oper)
+/**
+ * Init a slang_operation object
+ */
+GLboolean
+slang_operation_construct(slang_operation * oper)
{
- oper->type = slang_oper_none;
- oper->children = NULL;
- oper->num_children = 0;
- oper->literal = (float) 0;
- oper->a_id = SLANG_ATOM_NULL;
- oper->locals = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope));
- if (oper->locals == NULL)
- return 0;
- _slang_variable_scope_ctr (oper->locals);
- return 1;
+ oper->type = slang_oper_none;
+ oper->children = NULL;
+ oper->num_children = 0;
+ oper->literal = (float) 0;
+ oper->a_id = SLANG_ATOM_NULL;
+ oper->locals =
+ (slang_variable_scope *)
+ slang_alloc_malloc(sizeof(slang_variable_scope));
+ if (oper->locals == NULL)
+ return GL_FALSE;
+ _slang_variable_scope_ctr(oper->locals);
+ return GL_TRUE;
}
-void slang_operation_destruct (slang_operation *oper)
+void
+slang_operation_destruct(slang_operation * oper)
{
- unsigned int i;
+ GLuint i;
- for (i = 0; i < oper->num_children; i++)
- slang_operation_destruct (oper->children + i);
- slang_alloc_free (oper->children);
- slang_variable_scope_destruct (oper->locals);
- slang_alloc_free (oper->locals);
+ for (i = 0; i < oper->num_children; i++)
+ slang_operation_destruct(oper->children + i);
+ slang_alloc_free(oper->children);
+ slang_variable_scope_destruct(oper->locals);
+ slang_alloc_free(oper->locals);
}
-int slang_operation_copy (slang_operation *x, const slang_operation *y)
+/**
+ * Recursively copy a slang_operation node.
+ * \return GL_TRUE for success, GL_FALSE if failure
+ */
+GLboolean
+slang_operation_copy(slang_operation * x, const slang_operation * y)
{
- slang_operation z;
- unsigned int i;
+ slang_operation z;
+ GLuint i;
- if (!slang_operation_construct (&z))
- return 0;
- z.type = y->type;
- z.children = (slang_operation *) slang_alloc_malloc (y->num_children * sizeof (slang_operation));
- if (z.children == NULL)
- {
- slang_operation_destruct (&z);
- return 0;
- }
- for (z.num_children = 0; z.num_children < y->num_children; z.num_children++)
- if (!slang_operation_construct (&z.children[z.num_children]))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- for (i = 0; i < z.num_children; i++)
- if (!slang_operation_copy (&z.children[i], &y->children[i]))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- z.literal = y->literal;
- z.a_id = y->a_id;
- if (!slang_variable_scope_copy (z.locals, y->locals))
- {
- slang_operation_destruct (&z);
- return 0;
- }
- slang_operation_destruct (x);
- *x = z;
- return 1;
+ if (!slang_operation_construct(&z))
+ return GL_FALSE;
+ z.type = y->type;
+ z.children = (slang_operation *)
+ slang_alloc_malloc(y->num_children * sizeof(slang_operation));
+ if (z.children == NULL) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ for (z.num_children = 0; z.num_children < y->num_children;
+ z.num_children++) {
+ if (!slang_operation_construct(&z.children[z.num_children])) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ }
+ for (i = 0; i < z.num_children; i++) {
+ if (!slang_operation_copy(&z.children[i], &y->children[i])) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ }
+ z.literal = y->literal;
+ z.a_id = y->a_id;
+ if (!slang_variable_scope_copy(z.locals, y->locals)) {
+ slang_operation_destruct(&z);
+ return GL_FALSE;
+ }
+ slang_operation_destruct(x);
+ *x = z;
+ return GL_TRUE;
}
+
+slang_operation *
+slang_operation_new(GLuint count)
+{
+ return (slang_operation *) _mesa_calloc(count * sizeof(slang_operation));
+}
diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h
index d9bce36b9bd..a9376ec945f 100644
--- a/src/mesa/shader/slang/slang_compile_operation.h
+++ b/src/mesa/shader/slang/slang_compile_operation.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,96 +22,119 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_OPERATION_H
+#ifndef SLANG_COMPILE_OPERATION_H
#define SLANG_COMPILE_OPERATION_H
#if defined __cplusplus
extern "C" {
#endif
+
+/**
+ * Types of slang operations.
+ * These are the types of the AST (abstract syntax tree) nodes.
+ * [foo] indicates a sub-tree or reference to another type of node
+ */
typedef enum slang_operation_type_
{
- slang_oper_none,
- slang_oper_block_no_new_scope,
- slang_oper_block_new_scope,
- slang_oper_variable_decl,
- slang_oper_asm,
- slang_oper_break,
- slang_oper_continue,
- slang_oper_discard,
- slang_oper_return,
- slang_oper_expression,
- slang_oper_if,
- slang_oper_while,
- slang_oper_do,
- slang_oper_for,
- slang_oper_void,
- slang_oper_literal_bool,
- slang_oper_literal_int,
- slang_oper_literal_float,
- slang_oper_identifier,
- slang_oper_sequence,
- slang_oper_assign,
- slang_oper_addassign,
- slang_oper_subassign,
- slang_oper_mulassign,
- slang_oper_divassign,
- /*slang_oper_modassign,*/
- /*slang_oper_lshassign,*/
- /*slang_oper_rshassign,*/
- /*slang_oper_orassign,*/
- /*slang_oper_xorassign,*/
- /*slang_oper_andassign,*/
- slang_oper_select,
- slang_oper_logicalor,
- slang_oper_logicalxor,
- slang_oper_logicaland,
- /*slang_oper_bitor,*/
- /*slang_oper_bitxor,*/
- /*slang_oper_bitand,*/
- slang_oper_equal,
- slang_oper_notequal,
- slang_oper_less,
- slang_oper_greater,
- slang_oper_lessequal,
- slang_oper_greaterequal,
- /*slang_oper_lshift,*/
- /*slang_oper_rshift,*/
- slang_oper_add,
- slang_oper_subtract,
- slang_oper_multiply,
- slang_oper_divide,
- /*slang_oper_modulus,*/
- slang_oper_preincrement,
- slang_oper_predecrement,
- slang_oper_plus,
- slang_oper_minus,
- /*slang_oper_complement,*/
- slang_oper_not,
- slang_oper_subscript,
- slang_oper_call,
- slang_oper_field,
- slang_oper_postincrement,
- slang_oper_postdecrement
+ slang_oper_none,
+ slang_oper_block_no_new_scope, /* "{" sequence "}" */
+ slang_oper_block_new_scope, /* "{" sequence "}" */
+ slang_oper_variable_decl, /* [type] [var] or [var] = [expr] */
+ slang_oper_asm,
+ slang_oper_break, /* "break" statement */
+ slang_oper_continue, /* "continue" statement */
+ slang_oper_discard, /* "discard" (kill fragment) statement */
+ slang_oper_return, /* "return" [expr] */
+ slang_oper_expression, /* [expr] */
+ slang_oper_if, /* "if" [0] then [1] else [2] */
+ slang_oper_while, /* "while" [cond] [body] */
+ slang_oper_do, /* "do" [body] "while" [cond] */
+ slang_oper_for, /* "for" [init] [while] [incr] [body] */
+ slang_oper_void, /* nop */
+ slang_oper_literal_bool, /* "true" or "false" */
+ slang_oper_literal_int, /* integer literal */
+ slang_oper_literal_float, /* float literal */
+ slang_oper_identifier, /* var name, func name, etc */
+ slang_oper_sequence, /* [expr] "," [expr] "," etc */
+ slang_oper_assign, /* [var] "=" [expr] */
+ slang_oper_addassign, /* [var] "+=" [expr] */
+ slang_oper_subassign, /* [var] "-=" [expr] */
+ slang_oper_mulassign, /* [var] "*=" [expr] */
+ slang_oper_divassign, /* [var] "/=" [expr] */
+ /*slang_oper_modassign, */
+ /*slang_oper_lshassign, */
+ /*slang_oper_rshassign, */
+ /*slang_oper_orassign, */
+ /*slang_oper_xorassign, */
+ /*slang_oper_andassign, */
+ slang_oper_select, /* [expr] "?" [expr] ":" [expr] */
+ slang_oper_logicalor, /* [expr] "||" [expr] */
+ slang_oper_logicalxor, /* [expr] "^^" [expr] */
+ slang_oper_logicaland, /* [expr] "&&" [expr] */
+ /*slang_oper_bitor, */
+ /*slang_oper_bitxor, */
+ /*slang_oper_bitand, */
+ slang_oper_equal, /* [expr] "==" [expr] */
+ slang_oper_notequal, /* [expr] "!=" [expr] */
+ slang_oper_less, /* [expr] "<" [expr] */
+ slang_oper_greater, /* [expr] ">" [expr] */
+ slang_oper_lessequal, /* [expr] "<=" [expr] */
+ slang_oper_greaterequal, /* [expr] ">=" [expr] */
+ /*slang_oper_lshift, */
+ /*slang_oper_rshift, */
+ slang_oper_add, /* [expr] "+" [expr] */
+ slang_oper_subtract, /* [expr] "-" [expr] */
+ slang_oper_multiply, /* [expr] "*" [expr] */
+ slang_oper_divide, /* [expr] "/" [expr] */
+ /*slang_oper_modulus, */
+ slang_oper_preincrement, /* "++" [var] */
+ slang_oper_predecrement, /* "--" [var] */
+ slang_oper_plus, /* "-" [expr] */
+ slang_oper_minus, /* "+" [expr] */
+ /*slang_oper_complement, */
+ slang_oper_not, /* "!" [expr] */
+ slang_oper_subscript, /* [expr] "[" [expr] "]" */
+ slang_oper_call, /* [func name] [param] [param] [...] */
+ slang_oper_field, /* i.e.: ".next" or ".xzy" or ".xxx" etc */
+ slang_oper_postincrement, /* [var] "++" */
+ slang_oper_postdecrement /* [var] "--" */
} slang_operation_type;
+
+/**
+ * A slang_operation is basically a compiled instruction (such as assignment,
+ * a while-loop, a conditional, a multiply, a function call, etc).
+ * The AST (abstract syntax tree) is built from these nodes.
+ * NOTE: This structure could have been implemented as a union of simpler
+ * structs which would correspond to the operation types above.
+ */
typedef struct slang_operation_
{
- slang_operation_type type;
- struct slang_operation_ *children;
- unsigned int num_children;
- float literal; /* type: bool, literal_int, literal_float */
- slang_atom a_id; /* type: asm, identifier, call, field */
- slang_variable_scope *locals;
+ slang_operation_type type;
+ struct slang_operation_ *children;
+ GLuint num_children;
+ GLfloat literal; /**< Used for float, int and bool values */
+ slang_atom a_id; /**< type: asm, identifier, call, field */
+ slang_variable_scope *locals; /**< local vars for scope */
} slang_operation;
-int slang_operation_construct (slang_operation *);
-void slang_operation_destruct (slang_operation *);
-int slang_operation_copy (slang_operation *, const slang_operation *);
+
+extern GLboolean
+slang_operation_construct(slang_operation *);
+
+extern void
+slang_operation_destruct(slang_operation *);
+
+extern GLboolean
+slang_operation_copy(slang_operation *, const slang_operation *);
+
+extern slang_operation *
+slang_operation_new(GLuint count);
+
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_OPERATION_H */
diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c
index b62743addb0..a8a2d6aa6a0 100644
--- a/src/mesa/shader/slang/slang_compile_variable.c
+++ b/src/mesa/shader/slang/slang_compile_variable.c
@@ -35,89 +35,92 @@
typedef struct
{
- const char *name;
- slang_type_specifier_type type;
+ const char *name;
+ slang_type_specifier_type type;
} type_specifier_type_name;
-static type_specifier_type_name type_specifier_type_names[] = {
- { "void", slang_spec_void },
- { "bool", slang_spec_bool },
- { "bvec2", slang_spec_bvec2 },
- { "bvec3", slang_spec_bvec3 },
- { "bvec4", slang_spec_bvec4 },
- { "int", slang_spec_int },
- { "ivec2", slang_spec_ivec2 },
- { "ivec3", slang_spec_ivec3 },
- { "ivec4", slang_spec_ivec4 },
- { "float", slang_spec_float },
- { "vec2", slang_spec_vec2 },
- { "vec3", slang_spec_vec3 },
- { "vec4", slang_spec_vec4 },
- { "mat2", slang_spec_mat2 },
- { "mat3", slang_spec_mat3 },
- { "mat4", slang_spec_mat4 },
- { "sampler1D", slang_spec_sampler1D },
- { "sampler2D", slang_spec_sampler2D },
- { "sampler3D", slang_spec_sampler3D },
- { "samplerCube", slang_spec_samplerCube },
- { "sampler1DShadow", slang_spec_sampler1DShadow },
- { "sampler2DShadow", slang_spec_sampler2DShadow },
- { NULL, slang_spec_void }
+static const type_specifier_type_name type_specifier_type_names[] = {
+ {"void", slang_spec_void},
+ {"bool", slang_spec_bool},
+ {"bvec2", slang_spec_bvec2},
+ {"bvec3", slang_spec_bvec3},
+ {"bvec4", slang_spec_bvec4},
+ {"int", slang_spec_int},
+ {"ivec2", slang_spec_ivec2},
+ {"ivec3", slang_spec_ivec3},
+ {"ivec4", slang_spec_ivec4},
+ {"float", slang_spec_float},
+ {"vec2", slang_spec_vec2},
+ {"vec3", slang_spec_vec3},
+ {"vec4", slang_spec_vec4},
+ {"mat2", slang_spec_mat2},
+ {"mat3", slang_spec_mat3},
+ {"mat4", slang_spec_mat4},
+ {"sampler1D", slang_spec_sampler1D},
+ {"sampler2D", slang_spec_sampler2D},
+ {"sampler3D", slang_spec_sampler3D},
+ {"samplerCube", slang_spec_samplerCube},
+ {"sampler1DShadow", slang_spec_sampler1DShadow},
+ {"sampler2DShadow", slang_spec_sampler2DShadow},
+ {NULL, slang_spec_void}
};
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *name)
+slang_type_specifier_type
+slang_type_specifier_type_from_string(const char *name)
{
- type_specifier_type_name *p = type_specifier_type_names;
- while (p->name != NULL)
- {
- if (slang_string_compare (p->name, name) == 0)
- break;
- p++;
- }
- return p->type;
+ const type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL) {
+ if (slang_string_compare(p->name, name) == 0)
+ break;
+ p++;
+ }
+ return p->type;
}
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type type)
+const char *
+slang_type_specifier_type_to_string(slang_type_specifier_type type)
{
- type_specifier_type_name *p = type_specifier_type_names;
- while (p->name != NULL)
- {
- if (p->type == type)
- break;
- p++;
- }
- return p->name;
+ const type_specifier_type_name *p = type_specifier_type_names;
+ while (p->name != NULL) {
+ if (p->type == type)
+ break;
+ p++;
+ }
+ return p->name;
}
/* slang_fully_specified_type */
-int slang_fully_specified_type_construct (slang_fully_specified_type *type)
+int
+slang_fully_specified_type_construct(slang_fully_specified_type * type)
{
- type->qualifier = slang_qual_none;
- slang_type_specifier_ctr (&type->specifier);
- return 1;
+ type->qualifier = slang_qual_none;
+ slang_type_specifier_ctr(&type->specifier);
+ return 1;
}
-void slang_fully_specified_type_destruct (slang_fully_specified_type *type)
+void
+slang_fully_specified_type_destruct(slang_fully_specified_type * type)
{
- slang_type_specifier_dtr (&type->specifier);
+ slang_type_specifier_dtr(&type->specifier);
}
-int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_fully_specified_type *y)
+int
+slang_fully_specified_type_copy(slang_fully_specified_type * x,
+ const slang_fully_specified_type * y)
{
- slang_fully_specified_type z;
-
- if (!slang_fully_specified_type_construct (&z))
- return 0;
- z.qualifier = y->qualifier;
- if (!slang_type_specifier_copy (&z.specifier, &y->specifier))
- {
- slang_fully_specified_type_destruct (&z);
- return 0;
- }
- slang_fully_specified_type_destruct (x);
- *x = z;
- return 1;
+ slang_fully_specified_type z;
+
+ if (!slang_fully_specified_type_construct(&z))
+ return 0;
+ z.qualifier = y->qualifier;
+ if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) {
+ slang_fully_specified_type_destruct(&z);
+ return 0;
+ }
+ slang_fully_specified_type_destruct(x);
+ *x = z;
+ return 1;
}
/*
@@ -125,246 +128,281 @@ int slang_fully_specified_type_copy (slang_fully_specified_type *x, const slang_
*/
GLvoid
-_slang_variable_scope_ctr (slang_variable_scope *self)
+_slang_variable_scope_ctr(slang_variable_scope * self)
{
self->variables = NULL;
self->num_variables = 0;
self->outer_scope = NULL;
}
-void slang_variable_scope_destruct (slang_variable_scope *scope)
+void
+slang_variable_scope_destruct(slang_variable_scope * scope)
{
- unsigned int i;
+ unsigned int i;
+
+ if (!scope)
+ return;
+ for (i = 0; i < scope->num_variables; i++)
+ slang_variable_destruct(scope->variables + i);
+ slang_alloc_free(scope->variables);
+ /* do not free scope->outer_scope */
+}
- for (i = 0; i < scope->num_variables; i++)
- slang_variable_destruct (scope->variables + i);
- slang_alloc_free (scope->variables);
- /* do not free scope->outer_scope */
+int
+slang_variable_scope_copy(slang_variable_scope * x,
+ const slang_variable_scope * y)
+{
+ slang_variable_scope z;
+ unsigned int i;
+
+ _slang_variable_scope_ctr(&z);
+ z.variables = (slang_variable *)
+ slang_alloc_malloc(y->num_variables * sizeof(slang_variable));
+ if (z.variables == NULL) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ for (z.num_variables = 0; z.num_variables < y->num_variables;
+ z.num_variables++) {
+ if (!slang_variable_construct(&z.variables[z.num_variables])) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ }
+ for (i = 0; i < z.num_variables; i++) {
+ if (!slang_variable_copy(&z.variables[i], &y->variables[i])) {
+ slang_variable_scope_destruct(&z);
+ return 0;
+ }
+ }
+ z.outer_scope = y->outer_scope;
+ slang_variable_scope_destruct(x);
+ *x = z;
+ return 1;
}
-int slang_variable_scope_copy (slang_variable_scope *x, const slang_variable_scope *y)
+
+/**
+ * Grow the variable list by one.
+ * \return pointer to space for the new variable (will be initialized)
+ */
+slang_variable *
+slang_variable_scope_grow(slang_variable_scope *scope)
{
- slang_variable_scope z;
- unsigned int i;
-
- _slang_variable_scope_ctr (&z);
- z.variables = (slang_variable *) slang_alloc_malloc (y->num_variables * sizeof (slang_variable));
- if (z.variables == NULL)
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- for (z.num_variables = 0; z.num_variables < y->num_variables; z.num_variables++)
- if (!slang_variable_construct (&z.variables[z.num_variables]))
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- for (i = 0; i < z.num_variables; i++)
- if (!slang_variable_copy (&z.variables[i], &y->variables[i]))
- {
- slang_variable_scope_destruct (&z);
- return 0;
- }
- z.outer_scope = y->outer_scope;
- slang_variable_scope_destruct (x);
- *x = z;
- return 1;
+ const int n = scope->num_variables;
+ scope->variables = (slang_variable *)
+ slang_alloc_realloc(scope->variables,
+ n * sizeof(slang_variable),
+ (n + 1) * sizeof(slang_variable));
+ if (!scope->variables)
+ return NULL;
+
+ scope->num_variables++;
+
+ if (!slang_variable_construct(scope->variables + n))
+ return NULL;
+
+ return scope->variables + n;
}
+
+
/* slang_variable */
-int slang_variable_construct (slang_variable *var)
+int
+slang_variable_construct(slang_variable * var)
{
- if (!slang_fully_specified_type_construct (&var->type))
- return 0;
- var->a_name = SLANG_ATOM_NULL;
- var->array_len = 0;
- var->initializer = NULL;
- var->address = ~0;
- var->size = 0;
- var->global = 0;
- return 1;
+ if (!slang_fully_specified_type_construct(&var->type))
+ return 0;
+ var->a_name = SLANG_ATOM_NULL;
+ var->array_len = 0;
+ var->initializer = NULL;
+ var->address = ~0;
+ var->address2 = 0;
+ var->size = 0;
+ var->global = GL_FALSE;
+ return 1;
}
-void slang_variable_destruct (slang_variable *var)
+void
+slang_variable_destruct(slang_variable * var)
{
- slang_fully_specified_type_destruct (&var->type);
- if (var->initializer != NULL)
- {
- slang_operation_destruct (var->initializer);
- slang_alloc_free (var->initializer);
- }
+ slang_fully_specified_type_destruct(&var->type);
+ if (var->initializer != NULL) {
+ slang_operation_destruct(var->initializer);
+ slang_alloc_free(var->initializer);
+ }
}
-int slang_variable_copy (slang_variable *x, const slang_variable *y)
+int
+slang_variable_copy(slang_variable * x, const slang_variable * y)
{
- slang_variable z;
-
- if (!slang_variable_construct (&z))
- return 0;
- if (!slang_fully_specified_type_copy (&z.type, &y->type))
- {
- slang_variable_destruct (&z);
- return 0;
- }
- z.a_name = y->a_name;
- z.array_len = y->array_len;
- if (y->initializer != NULL)
- {
- z.initializer = (slang_operation *) slang_alloc_malloc (sizeof (slang_operation));
- if (z.initializer == NULL)
- {
- slang_variable_destruct (&z);
- return 0;
- }
- if (!slang_operation_construct (z.initializer))
- {
- slang_alloc_free (z.initializer);
- slang_variable_destruct (&z);
- return 0;
- }
- if (!slang_operation_copy (z.initializer, y->initializer))
- {
- slang_variable_destruct (&z);
- return 0;
- }
- }
- z.address = y->address;
- z.size = y->size;
- z.global = y->global;
- slang_variable_destruct (x);
- *x = z;
- return 1;
+ slang_variable z;
+
+ if (!slang_variable_construct(&z))
+ return 0;
+ if (!slang_fully_specified_type_copy(&z.type, &y->type)) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ z.a_name = y->a_name;
+ z.array_len = y->array_len;
+ if (y->initializer != NULL) {
+ z.initializer =
+ (slang_operation *) slang_alloc_malloc(sizeof(slang_operation));
+ if (z.initializer == NULL) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ if (!slang_operation_construct(z.initializer)) {
+ slang_alloc_free(z.initializer);
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ if (!slang_operation_copy(z.initializer, y->initializer)) {
+ slang_variable_destruct(&z);
+ return 0;
+ }
+ }
+ z.address = y->address;
+ z.size = y->size;
+ z.global = y->global;
+ slang_variable_destruct(x);
+ *x = z;
+ return 1;
}
-slang_variable *_slang_locate_variable (slang_variable_scope *scope, slang_atom a_name, GLboolean all)
+slang_variable *
+_slang_locate_variable(const slang_variable_scope * scope,
+ const slang_atom a_name, GLboolean all)
{
- GLuint i;
-
- for (i = 0; i < scope->num_variables; i++)
- if (a_name == scope->variables[i].a_name)
- return &scope->variables[i];
- if (all && scope->outer_scope != NULL)
- return _slang_locate_variable (scope->outer_scope, a_name, 1);
- return NULL;
+ GLuint i;
+
+ for (i = 0; i < scope->num_variables; i++)
+ if (a_name == scope->variables[i].a_name)
+ return &scope->variables[i];
+ if (all && scope->outer_scope != NULL)
+ return _slang_locate_variable(scope->outer_scope, a_name, 1);
+ return NULL;
}
/*
* _slang_build_export_data_table()
*/
-static GLenum gl_type_from_specifier (const slang_type_specifier *type)
+static GLenum
+gl_type_from_specifier(const slang_type_specifier * type)
{
- switch (type->type)
- {
- case slang_spec_bool:
- return GL_BOOL_ARB;
- case slang_spec_bvec2:
- return GL_BOOL_VEC2_ARB;
- case slang_spec_bvec3:
- return GL_BOOL_VEC3_ARB;
- case slang_spec_bvec4:
- return GL_BOOL_VEC4_ARB;
- case slang_spec_int:
- return GL_INT;
- case slang_spec_ivec2:
- return GL_INT_VEC2_ARB;
- case slang_spec_ivec3:
- return GL_INT_VEC3_ARB;
- case slang_spec_ivec4:
- return GL_INT_VEC4_ARB;
- case slang_spec_float:
- return GL_FLOAT;
- case slang_spec_vec2:
- return GL_FLOAT_VEC2_ARB;
- case slang_spec_vec3:
- return GL_FLOAT_VEC3_ARB;
- case slang_spec_vec4:
- return GL_FLOAT_VEC4_ARB;
- case slang_spec_mat2:
- return GL_FLOAT_MAT2_ARB;
- case slang_spec_mat3:
- return GL_FLOAT_MAT3_ARB;
- case slang_spec_mat4:
- return GL_FLOAT_MAT4_ARB;
- case slang_spec_sampler1D:
- return GL_SAMPLER_1D_ARB;
- case slang_spec_sampler2D:
- return GL_SAMPLER_2D_ARB;
- case slang_spec_sampler3D:
- return GL_SAMPLER_3D_ARB;
- case slang_spec_samplerCube:
- return GL_SAMPLER_CUBE_ARB;
- case slang_spec_sampler1DShadow:
- return GL_SAMPLER_1D_SHADOW_ARB;
- case slang_spec_sampler2DShadow:
- return GL_SAMPLER_2D_SHADOW_ARB;
- case slang_spec_array:
- return gl_type_from_specifier (type->_array);
- default:
- return GL_FLOAT;
- }
+ switch (type->type) {
+ case slang_spec_bool:
+ return GL_BOOL_ARB;
+ case slang_spec_bvec2:
+ return GL_BOOL_VEC2_ARB;
+ case slang_spec_bvec3:
+ return GL_BOOL_VEC3_ARB;
+ case slang_spec_bvec4:
+ return GL_BOOL_VEC4_ARB;
+ case slang_spec_int:
+ return GL_INT;
+ case slang_spec_ivec2:
+ return GL_INT_VEC2_ARB;
+ case slang_spec_ivec3:
+ return GL_INT_VEC3_ARB;
+ case slang_spec_ivec4:
+ return GL_INT_VEC4_ARB;
+ case slang_spec_float:
+ return GL_FLOAT;
+ case slang_spec_vec2:
+ return GL_FLOAT_VEC2_ARB;
+ case slang_spec_vec3:
+ return GL_FLOAT_VEC3_ARB;
+ case slang_spec_vec4:
+ return GL_FLOAT_VEC4_ARB;
+ case slang_spec_mat2:
+ return GL_FLOAT_MAT2_ARB;
+ case slang_spec_mat3:
+ return GL_FLOAT_MAT3_ARB;
+ case slang_spec_mat4:
+ return GL_FLOAT_MAT4_ARB;
+ case slang_spec_sampler1D:
+ return GL_SAMPLER_1D_ARB;
+ case slang_spec_sampler2D:
+ return GL_SAMPLER_2D_ARB;
+ case slang_spec_sampler3D:
+ return GL_SAMPLER_3D_ARB;
+ case slang_spec_samplerCube:
+ return GL_SAMPLER_CUBE_ARB;
+ case slang_spec_sampler1DShadow:
+ return GL_SAMPLER_1D_SHADOW_ARB;
+ case slang_spec_sampler2DShadow:
+ return GL_SAMPLER_2D_SHADOW_ARB;
+ case slang_spec_array:
+ return gl_type_from_specifier(type->_array);
+ default:
+ return GL_FLOAT;
+ }
}
-static GLboolean build_quant (slang_export_data_quant *q, slang_variable *var)
+static GLboolean
+build_quant(slang_export_data_quant * q, const slang_variable * var)
{
- slang_type_specifier *spec = &var->type.specifier;
-
- q->name = var->a_name;
- q->size = var->size;
- if (spec->type == slang_spec_array)
- {
- q->array_len = var->array_len;
- q->size /= var->array_len;
- spec = spec->_array;
- }
- if (spec->type == slang_spec_struct)
- {
- GLuint i;
-
- q->u.field_count = spec->_struct->fields->num_variables;
- q->structure = (slang_export_data_quant *) slang_alloc_malloc (
- q->u.field_count * sizeof (slang_export_data_quant));
- if (q->structure == NULL)
- return GL_FALSE;
-
- for (i = 0; i < q->u.field_count; i++)
- slang_export_data_quant_ctr (&q->structure[i]);
- for (i = 0; i < q->u.field_count; i++)
- if (!build_quant (&q->structure[i], &spec->_struct->fields->variables[i]))
- return GL_FALSE;
- }
- else
- q->u.basic_type = gl_type_from_specifier (spec);
- return GL_TRUE;
+ const slang_type_specifier *spec = &var->type.specifier;
+
+ q->name = var->a_name;
+ q->size = var->size;
+ if (spec->type == slang_spec_array) {
+ q->array_len = var->array_len;
+ q->size /= var->array_len;
+ spec = spec->_array;
+ }
+ if (spec->type == slang_spec_struct) {
+ GLuint i;
+
+ q->u.field_count = spec->_struct->fields->num_variables;
+ q->structure = (slang_export_data_quant *)
+ slang_alloc_malloc(q->u.field_count
+ * sizeof(slang_export_data_quant));
+ if (q->structure == NULL)
+ return GL_FALSE;
+
+ for (i = 0; i < q->u.field_count; i++)
+ slang_export_data_quant_ctr(&q->structure[i]);
+ for (i = 0; i < q->u.field_count; i++) {
+ if (!build_quant(&q->structure[i],
+ &spec->_struct->fields->variables[i]))
+ return GL_FALSE;
+ }
+ }
+ else
+ q->u.basic_type = gl_type_from_specifier(spec);
+ return GL_TRUE;
}
-GLboolean _slang_build_export_data_table (slang_export_data_table *tbl, slang_variable_scope *vars)
+GLboolean
+_slang_build_export_data_table(slang_export_data_table * tbl,
+ slang_variable_scope * vars)
{
- GLuint i;
-
- for (i = 0; i < vars->num_variables; i++)
- {
- slang_variable *var = &vars->variables[i];
- slang_export_data_entry *e;
-
- e = slang_export_data_table_add (tbl);
- if (e == NULL)
- return GL_FALSE;
- if (!build_quant (&e->quant, var))
- return GL_FALSE;
- if (var->type.qualifier == slang_qual_uniform)
- e->access = slang_exp_uniform;
- else if (var->type.qualifier == slang_qual_attribute)
- e->access = slang_exp_attribute;
- else
- e->access = slang_exp_varying;
- e->address = var->address;
- }
-
- if (vars->outer_scope != NULL)
- return _slang_build_export_data_table (tbl, vars->outer_scope);
- return GL_TRUE;
+ GLuint i;
+
+ for (i = 0; i < vars->num_variables; i++) {
+ const slang_variable *var = &vars->variables[i];
+ slang_export_data_entry *e;
+
+ e = slang_export_data_table_add(tbl);
+ if (e == NULL)
+ return GL_FALSE;
+ if (!build_quant(&e->quant, var))
+ return GL_FALSE;
+ if (var->type.qualifier == slang_qual_uniform)
+ e->access = slang_exp_uniform;
+ else if (var->type.qualifier == slang_qual_attribute)
+ e->access = slang_exp_attribute;
+ else
+ e->access = slang_exp_varying;
+ e->address = var->address;
+ }
+
+ if (vars->outer_scope != NULL)
+ return _slang_build_export_data_table(tbl, vars->outer_scope);
+ return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h
index 6b9679a3b75..b0910e855ea 100644
--- a/src/mesa/shader/slang/slang_compile_variable.h
+++ b/src/mesa/shader/slang/slang_compile_variable.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,74 +22,113 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_COMPILE_VARIABLE_H
+#ifndef SLANG_COMPILE_VARIABLE_H
#define SLANG_COMPILE_VARIABLE_H
#if defined __cplusplus
extern "C" {
#endif
+
typedef enum slang_type_qualifier_
{
- slang_qual_none,
- slang_qual_const,
- slang_qual_attribute,
- slang_qual_varying,
- slang_qual_uniform,
- slang_qual_out,
- slang_qual_inout,
- slang_qual_fixedoutput, /* internal */
- slang_qual_fixedinput /* internal */
+ slang_qual_none,
+ slang_qual_const,
+ slang_qual_attribute,
+ slang_qual_varying,
+ slang_qual_uniform,
+ slang_qual_out,
+ slang_qual_inout,
+ slang_qual_fixedoutput, /* internal */
+ slang_qual_fixedinput /* internal */
} slang_type_qualifier;
-slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
-const char *slang_type_specifier_type_to_string (slang_type_specifier_type);
+extern slang_type_specifier_type
+slang_type_specifier_type_from_string(const char *);
+
+extern const char *
+slang_type_specifier_type_to_string(slang_type_specifier_type);
+
+
typedef struct slang_fully_specified_type_
{
- slang_type_qualifier qualifier;
- slang_type_specifier specifier;
+ slang_type_qualifier qualifier;
+ slang_type_specifier specifier;
} slang_fully_specified_type;
-int slang_fully_specified_type_construct (slang_fully_specified_type *);
-void slang_fully_specified_type_destruct (slang_fully_specified_type *);
-int slang_fully_specified_type_copy (slang_fully_specified_type *, const slang_fully_specified_type *);
+extern int
+slang_fully_specified_type_construct(slang_fully_specified_type *);
+
+extern void
+slang_fully_specified_type_destruct(slang_fully_specified_type *);
+
+extern int
+slang_fully_specified_type_copy(slang_fully_specified_type *,
+ const slang_fully_specified_type *);
+
+
+/**
+ * A shading language program variable.
+ */
+typedef struct slang_variable_
+{
+ slang_fully_specified_type type; /**< Variable's data type */
+ slang_atom a_name; /**< The variable's name (char *) */
+ GLuint array_len; /**< only if type == slang_spec_array */
+ struct slang_operation_ *initializer; /**< Optional initializer code */
+ GLuint address; /**< Storage location */
+ GLuint address2; /**< Storage location */
+ GLuint size; /**< Variable's size in bytes */
+ GLboolean global; /**< A global var? */
+ void *aux; /**< Used during code gen */
+} slang_variable;
+
+/**
+ * Basically a list of variables, with a pointer to the parent scope.
+ */
typedef struct slang_variable_scope_
{
- struct slang_variable_ *variables;
+ slang_variable *variables; /**< Array [num_variables] */
GLuint num_variables;
- struct slang_variable_scope_ *outer_scope;
+ struct slang_variable_scope_ *outer_scope;
} slang_variable_scope;
extern GLvoid
-_slang_variable_scope_ctr (slang_variable_scope *);
+_slang_variable_scope_ctr(slang_variable_scope *);
-void slang_variable_scope_destruct (slang_variable_scope *);
-int slang_variable_scope_copy (slang_variable_scope *, const slang_variable_scope *);
+extern void
+slang_variable_scope_destruct(slang_variable_scope *);
-typedef struct slang_variable_
-{
- slang_fully_specified_type type;
- slang_atom a_name;
- GLuint array_len; /* type: spec_array */
- struct slang_operation_ *initializer;
- unsigned int address;
- unsigned int size;
- int global;
-} slang_variable;
+extern int
+slang_variable_scope_copy(slang_variable_scope *,
+ const slang_variable_scope *);
+
+slang_variable *
+slang_variable_scope_grow(slang_variable_scope *);
-int slang_variable_construct (slang_variable *);
-void slang_variable_destruct (slang_variable *);
-int slang_variable_copy (slang_variable *, const slang_variable *);
+extern int
+slang_variable_construct(slang_variable *);
+
+extern void
+slang_variable_destruct(slang_variable *);
+
+extern int
+slang_variable_copy(slang_variable *, const slang_variable *);
+
+extern slang_variable *
+_slang_locate_variable(const slang_variable_scope *, const slang_atom a_name,
+ GLboolean all);
+
+extern GLboolean
+_slang_build_export_data_table(slang_export_data_table *,
+ slang_variable_scope *);
-slang_variable *_slang_locate_variable (slang_variable_scope *, slang_atom a_name, GLboolean all);
-GLboolean _slang_build_export_data_table (slang_export_data_table *, slang_variable_scope *);
#ifdef __cplusplus
}
#endif
-#endif
-
+#endif /* SLANG_COMPILE_VARIABLE_H */
diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c
index 98bfd896c4e..e469de02075 100644
--- a/src/mesa/shader/slang/slang_execute.c
+++ b/src/mesa/shader/slang/slang_execute.c
@@ -36,571 +36,625 @@
#define DEBUG_SLANG 0
-GLvoid slang_machine_ctr (slang_machine *self)
+GLvoid
+slang_machine_ctr(slang_machine * self)
{
- slang_machine_init (self);
+ slang_machine_init(self);
self->infolog = NULL;
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- self->x86.compiled_func = NULL;
+ self->x86.compiled_func = NULL;
#endif
}
-GLvoid slang_machine_dtr (slang_machine *self)
+GLvoid
+slang_machine_dtr(slang_machine * self)
{
if (self->infolog != NULL) {
- slang_info_log_destruct (self->infolog);
- slang_alloc_free (self->infolog);
+ slang_info_log_destruct(self->infolog);
+ slang_alloc_free(self->infolog);
}
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- if (self->x86.compiled_func != NULL)
- _mesa_exec_free (self->x86.compiled_func);
+ if (self->x86.compiled_func != NULL)
+ _mesa_exec_free(self->x86.compiled_func);
#endif
}
-void slang_machine_init (slang_machine *mach)
+
+/**
+ * Initialize the shader virtual machine.
+ * NOTE: stack grows downward in memory.
+ */
+void
+slang_machine_init(slang_machine * mach)
{
- mach->ip = 0;
- mach->sp = SLANG_MACHINE_STACK_SIZE;
- mach->bp = 0;
- mach->kill = 0;
- mach->exit = 0;
+ mach->ip = 0;
+ mach->sp = SLANG_MACHINE_STACK_SIZE;
+ mach->bp = 0;
+ mach->kill = GL_FALSE;
+ mach->exit = GL_FALSE;
}
#if DEBUG_SLANG
-static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i)
+static void
+dump_instruction(FILE * f, slang_assembly * a, unsigned int i)
{
- fprintf (f, "%.5u:\t", i);
-
- switch (a->type)
- {
- /* core */
- case slang_asm_none:
- fprintf (f, "none");
- break;
- case slang_asm_float_copy:
- fprintf (f, "float_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_move:
- fprintf (f, "float_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_push:
- fprintf (f, "float_push\t%f", a->literal);
- break;
- case slang_asm_float_deref:
- fprintf (f, "float_deref");
- break;
- case slang_asm_float_add:
- fprintf (f, "float_add");
- break;
- case slang_asm_float_multiply:
- fprintf (f, "float_multiply");
- break;
- case slang_asm_float_divide:
- fprintf (f, "float_divide");
- break;
- case slang_asm_float_negate:
- fprintf (f, "float_negate");
- break;
- case slang_asm_float_less:
- fprintf (f, "float_less");
- break;
- case slang_asm_float_equal_exp:
- fprintf (f, "float_equal");
- break;
- case slang_asm_float_equal_int:
- fprintf (f, "float_equal\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_float_to_int:
- fprintf (f, "float_to_int");
- break;
- case slang_asm_float_sine:
- fprintf (f, "float_sine");
- break;
- case slang_asm_float_arcsine:
- fprintf (f, "float_arcsine");
- break;
- case slang_asm_float_arctan:
- fprintf (f, "float_arctan");
- break;
- case slang_asm_float_power:
- fprintf (f, "float_power");
- break;
- case slang_asm_float_log2:
- fprintf (f, "float_log2");
- break;
- case slang_asm_float_floor:
- fprintf (f, "float_floor");
- break;
- case slang_asm_float_ceil:
- fprintf (f, "float_ceil");
- break;
- case slang_asm_float_noise1:
- fprintf (f, "float_noise1");
- break;
- case slang_asm_float_noise2:
- fprintf (f, "float_noise2");
- break;
- case slang_asm_float_noise3:
- fprintf (f, "float_noise3");
- break;
- case slang_asm_float_noise4:
- fprintf (f, "float_noise4");
- break;
- case slang_asm_int_copy:
- fprintf (f, "int_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_int_move:
- fprintf (f, "int_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_int_push:
- fprintf (f, "int_push\t%d", (GLint) a->literal);
- break;
- case slang_asm_int_deref:
- fprintf (f, "int_deref");
- break;
- case slang_asm_int_to_float:
- fprintf (f, "int_to_float");
- break;
- case slang_asm_int_to_addr:
- fprintf (f, "int_to_addr");
- break;
- case slang_asm_bool_copy:
- fprintf (f, "bool_copy\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_bool_move:
- fprintf (f, "bool_move\t%d, %d", a->param[0], a->param[1]);
- break;
- case slang_asm_bool_push:
- fprintf (f, "bool_push\t%d", a->literal != 0.0f);
- break;
- case slang_asm_bool_deref:
- fprintf (f, "bool_deref");
- break;
- case slang_asm_addr_copy:
- fprintf (f, "addr_copy");
- break;
- case slang_asm_addr_push:
- fprintf (f, "addr_push\t%u", a->param[0]);
- break;
- case slang_asm_addr_deref:
- fprintf (f, "addr_deref");
- break;
- case slang_asm_addr_add:
- fprintf (f, "addr_add");
- break;
- case slang_asm_addr_multiply:
- fprintf (f, "addr_multiply");
- break;
- case slang_asm_vec4_tex1d:
- fprintf (f, "vec4_tex1d");
- break;
- case slang_asm_vec4_tex2d:
- fprintf (f, "vec4_tex2d");
- break;
- case slang_asm_vec4_tex3d:
- fprintf (f, "vec4_tex3d");
- break;
- case slang_asm_vec4_texcube:
- fprintf (f, "vec4_texcube");
- break;
- case slang_asm_vec4_shad1d:
- fprintf (f, "vec4_shad1d");
- break;
- case slang_asm_vec4_shad2d:
- fprintf (f, "vec4_shad2d");
- break;
- case slang_asm_jump:
- fprintf (f, "jump\t%u", a->param[0]);
- break;
- case slang_asm_jump_if_zero:
- fprintf (f, "jump_if_zero\t%u", a->param[0]);
- break;
- case slang_asm_enter:
- fprintf (f, "enter\t%u", a->param[0]);
- break;
- case slang_asm_leave:
- fprintf (f, "leave");
- break;
- case slang_asm_local_alloc:
- fprintf (f, "local_alloc\t%u", a->param[0]);
- break;
- case slang_asm_local_free:
- fprintf (f, "local_free\t%u", a->param[0]);
- break;
- case slang_asm_local_addr:
- fprintf (f, "local_addr\t%u, %u", a->param[0], a->param[1]);
- break;
- case slang_asm_global_addr:
- fprintf (f, "global_addr\t%u", a->param[0]);
- break;
- case slang_asm_call:
- fprintf (f, "call\t%u", a->param[0]);
- break;
- case slang_asm_return:
- fprintf (f, "return");
- break;
- case slang_asm_discard:
- fprintf (f, "discard");
- break;
- case slang_asm_exit:
- fprintf (f, "exit");
- break;
- /* GL_MESA_shader_debug */
- case slang_asm_float_print:
- fprintf (f, "float_print");
- break;
- case slang_asm_int_print:
- fprintf (f, "int_print");
- break;
- case slang_asm_bool_print:
- fprintf (f, "bool_print");
- break;
- /* vec4 */
+ fprintf(f, "%.5u:\t", i);
+
+ switch (a->type) {
+ /* core */
+ case slang_asm_none:
+ fprintf(f, "none");
+ break;
+ case slang_asm_float_copy:
+ fprintf(f, "float_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_move:
+ fprintf(f, "float_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_push:
+ fprintf(f, "float_push\t%f", a->literal);
+ break;
+ case slang_asm_float_deref:
+ fprintf(f, "float_deref");
+ break;
+ case slang_asm_float_add:
+ fprintf(f, "float_add");
+ break;
+ case slang_asm_float_multiply:
+ fprintf(f, "float_multiply");
+ break;
+ case slang_asm_float_divide:
+ fprintf(f, "float_divide");
+ break;
+ case slang_asm_float_negate:
+ fprintf(f, "float_negate");
+ break;
+ case slang_asm_float_less:
+ fprintf(f, "float_less");
+ break;
+ case slang_asm_float_equal_exp:
+ fprintf(f, "float_equal");
+ break;
+ case slang_asm_float_equal_int:
+ fprintf(f, "float_equal\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_float_to_int:
+ fprintf(f, "float_to_int");
+ break;
+ case slang_asm_float_sine:
+ fprintf(f, "float_sine");
+ break;
+ case slang_asm_float_arcsine:
+ fprintf(f, "float_arcsine");
+ break;
+ case slang_asm_float_arctan:
+ fprintf(f, "float_arctan");
+ break;
+ case slang_asm_float_power:
+ fprintf(f, "float_power");
+ break;
+ case slang_asm_float_log2:
+ fprintf(f, "float_log2");
+ break;
+ case slang_asm_float_floor:
+ fprintf(f, "float_floor");
+ break;
+ case slang_asm_float_ceil:
+ fprintf(f, "float_ceil");
+ break;
+ case slang_asm_float_noise1:
+ fprintf(f, "float_noise1");
+ break;
+ case slang_asm_float_noise2:
+ fprintf(f, "float_noise2");
+ break;
+ case slang_asm_float_noise3:
+ fprintf(f, "float_noise3");
+ break;
+ case slang_asm_float_noise4:
+ fprintf(f, "float_noise4");
+ break;
+ case slang_asm_int_copy:
+ fprintf(f, "int_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_move:
+ fprintf(f, "int_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_int_push:
+ fprintf(f, "int_push\t%d", (GLint) a->literal);
+ break;
+ case slang_asm_int_deref:
+ fprintf(f, "int_deref");
+ break;
+ case slang_asm_int_to_float:
+ fprintf(f, "int_to_float");
+ break;
+ case slang_asm_int_to_addr:
+ fprintf(f, "int_to_addr");
+ break;
+ case slang_asm_bool_copy:
+ fprintf(f, "bool_copy\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_move:
+ fprintf(f, "bool_move\t%d, %d", a->param[0], a->param[1]);
+ break;
+ case slang_asm_bool_push:
+ fprintf(f, "bool_push\t%d", a->literal != 0.0f);
+ break;
+ case slang_asm_bool_deref:
+ fprintf(f, "bool_deref");
+ break;
+ case slang_asm_addr_copy:
+ fprintf(f, "addr_copy");
+ break;
+ case slang_asm_addr_push:
+ fprintf(f, "addr_push\t%u", a->param[0]);
+ break;
+ case slang_asm_addr_deref:
+ fprintf(f, "addr_deref");
+ break;
+ case slang_asm_addr_add:
+ fprintf(f, "addr_add");
+ break;
+ case slang_asm_addr_multiply:
+ fprintf(f, "addr_multiply");
+ break;
+ case slang_asm_vec4_tex1d:
+ fprintf(f, "vec4_tex1d");
+ break;
+ case slang_asm_vec4_tex2d:
+ fprintf(f, "vec4_tex2d");
+ break;
+ case slang_asm_vec4_tex3d:
+ fprintf(f, "vec4_tex3d");
+ break;
+ case slang_asm_vec4_texcube:
+ fprintf(f, "vec4_texcube");
+ break;
+ case slang_asm_vec4_shad1d:
+ fprintf(f, "vec4_shad1d");
+ break;
+ case slang_asm_vec4_shad2d:
+ fprintf(f, "vec4_shad2d");
+ break;
+ case slang_asm_jump:
+ fprintf(f, "jump\t%u", a->param[0]);
+ break;
+ case slang_asm_jump_if_zero:
+ fprintf(f, "jump_if_zero\t%u", a->param[0]);
+ break;
+ case slang_asm_enter:
+ fprintf(f, "enter\t%u", a->param[0]);
+ break;
+ case slang_asm_leave:
+ fprintf(f, "leave");
+ break;
+ case slang_asm_local_alloc:
+ fprintf(f, "local_alloc\t%u", a->param[0]);
+ break;
+ case slang_asm_local_free:
+ fprintf(f, "local_free\t%u", a->param[0]);
+ break;
+ case slang_asm_local_addr:
+ fprintf(f, "local_addr\t%u, %u", a->param[0], a->param[1]);
+ break;
+ case slang_asm_global_addr:
+ fprintf(f, "global_addr\t%u", a->param[0]);
+ break;
+ case slang_asm_call:
+ fprintf(f, "call\t%u", a->param[0]);
+ break;
+ case slang_asm_return:
+ fprintf(f, "return");
+ break;
+ case slang_asm_discard:
+ fprintf(f, "discard");
+ break;
+ case slang_asm_exit:
+ fprintf(f, "exit");
+ break;
+ /* GL_MESA_shader_debug */
+ case slang_asm_float_print:
+ fprintf(f, "float_print");
+ break;
+ case slang_asm_int_print:
+ fprintf(f, "int_print");
+ break;
+ case slang_asm_bool_print:
+ fprintf(f, "bool_print");
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
- fprintf (f, "float_to_vec4");
+ fprintf(f, "float_to_vec4");
break;
case slang_asm_vec4_add:
- fprintf (f, "vec4_add");
+ fprintf(f, "vec4_add");
break;
case slang_asm_vec4_subtract:
- fprintf (f, "vec4_subtract");
+ fprintf(f, "vec4_subtract");
break;
case slang_asm_vec4_multiply:
- fprintf (f, "vec4_multiply");
+ fprintf(f, "vec4_multiply");
break;
case slang_asm_vec4_divide:
- fprintf (f, "vec4_divide");
+ fprintf(f, "vec4_divide");
break;
case slang_asm_vec4_negate:
- fprintf (f, "vec4_negate");
+ fprintf(f, "vec4_negate");
break;
case slang_asm_vec4_dot:
- fprintf (f, "vec4_dot");
+ fprintf(f, "vec4_dot");
break;
case slang_asm_vec4_copy:
- fprintf (f, "vec4_copy");
+ fprintf(f, "vec4_copy");
break;
case slang_asm_vec4_deref:
- fprintf (f, "vec4_deref");
+ fprintf(f, "vec4_deref");
break;
case slang_asm_vec4_equal_int:
- fprintf (f, "vec4_equal");
+ fprintf(f, "vec4_equal");
break;
default:
- break;
- }
+ break;
+ }
- fprintf (f, "\n");
+ fprintf(f, "\n");
}
-static void dump (const slang_assembly_file *file)
+static void
+dump(const slang_assembly_file * file)
{
- unsigned int i;
- static unsigned int counter = 0;
- FILE *f;
- char filename[256];
+ unsigned int i;
+ static unsigned int counter = 0;
+ FILE *f;
+ char filename[256];
- counter++;
- _mesa_sprintf (filename, "~mesa-slang-assembly-dump-(%u).txt", counter);
- f = fopen (filename, "w");
- if (f == NULL)
- return;
+ counter++;
+ _mesa_sprintf(filename, "~mesa-slang-assembly-dump-(%u).txt", counter);
+ f = fopen(filename, "w");
+ if (f == NULL)
+ return;
- for (i = 0; i < file->count; i++)
- dump_instruction (f, file->code + i, i);
+ for (i = 0; i < file->count; i++)
+ dump_instruction(f, file->code + i, i);
- fclose (f);
+ fclose(f);
}
#endif
static GLvoid
-ensure_infolog_created (slang_info_log **infolog)
+ensure_infolog_created(slang_info_log ** infolog)
{
if (*infolog == NULL) {
- *infolog = slang_alloc_malloc (sizeof (slang_info_log));
+ *infolog = slang_alloc_malloc(sizeof(slang_info_log));
if (*infolog == NULL)
return;
- slang_info_log_construct (*infolog);
+ slang_info_log_construct(*infolog);
}
}
GLboolean
-_slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
+_slang_execute2(const slang_assembly_file * file, slang_machine * mach)
{
- slang_machine_slot *stack;
+ slang_machine_slot *stack;
#if DEBUG_SLANG
- static unsigned int counter = 0;
- char filename[256];
- FILE *f;
+ static unsigned int counter = 0;
+ char filename[256];
+ FILE *f;
#endif
- /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */
- static_assert(sizeof (GLfloat) == 4);
- static_assert(sizeof (GLuint) == 4);
+ /* assume 32-bit floats and uints; should work fine also on 64-bit platforms */
+ static_assert(sizeof(GLfloat) == 4);
+ static_assert(sizeof(GLuint) == 4);
#if DEBUG_SLANG
- dump (file);
- counter++;
- _mesa_sprintf (filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
- f = fopen (filename, "w");
+ dump(file);
+ counter++;
+ _mesa_sprintf(filename, "~mesa-slang-assembly-exec-(%u).txt", counter);
+ f = fopen(filename, "w");
#endif
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- if (mach->x86.compiled_func != NULL)
- {
- mach->x86.compiled_func (mach);
- return GL_TRUE;
- }
+ if (mach->x86.compiled_func != NULL) {
+ mach->x86.compiled_func(mach);
+ return GL_TRUE;
+ }
#endif
- stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
+ stack = mach->mem + SLANG_MACHINE_GLOBAL_SIZE;
- while (!mach->exit)
- {
- slang_assembly *a = &file->code[mach->ip];
+ while (!mach->exit) {
+ const slang_assembly *a = &file->code[mach->ip];
#if DEBUG_SLANG
- if (f != NULL && a->type != slang_asm_none)
- {
- unsigned int i;
+ if (f != NULL && a->type != slang_asm_none) {
+ unsigned int i;
- dump_instruction (f, file->code + mach->ip, mach->ip);
- fprintf (f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
- for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
- fprintf (f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float, stack[i]._addr);
- fflush (f);
- }
+ dump_instruction(f, file->code + mach->ip, mach->ip);
+ fprintf(f, "\t\tsp=%u bp=%u\n", mach->sp, mach->bp);
+ for (i = mach->sp; i < SLANG_MACHINE_STACK_SIZE; i++)
+ fprintf(f, "\t%.5u\t%6f\t%u\n", i, stack[i]._float,
+ stack[i]._addr);
+ fflush(f);
+ }
#endif
- mach->ip++;
+ mach->ip++;
- switch (a->type)
- {
- /* core */
- case slang_asm_none:
- break;
- case slang_asm_float_copy:
- case slang_asm_int_copy:
- case slang_asm_bool_copy:
- mach->mem[(stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4]._float =
- stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_move:
- case slang_asm_int_move:
- case slang_asm_bool_move:
- stack[mach->sp + a->param[0] / 4]._float =
- stack[mach->sp + (stack[mach->sp]._addr + a->param[1]) / 4]._float;
- break;
- case slang_asm_float_push:
- case slang_asm_int_push:
- case slang_asm_bool_push:
- mach->sp--;
- stack[mach->sp]._float = a->literal;
- break;
- case slang_asm_float_deref:
- case slang_asm_int_deref:
- case slang_asm_bool_deref:
- stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
- break;
- case slang_asm_float_add:
- stack[mach->sp + 1]._float += stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_multiply:
- stack[mach->sp + 1]._float *= stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_divide:
- stack[mach->sp + 1]._float /= stack[mach->sp]._float;
- mach->sp++;
- break;
- case slang_asm_float_negate:
- stack[mach->sp]._float = -stack[mach->sp]._float;
- break;
- case slang_asm_float_less:
- stack[mach->sp + 1]._float =
- stack[mach->sp + 1]._float < stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
- mach->sp++;
- break;
- case slang_asm_float_equal_exp:
- stack[mach->sp + 1]._float =
- stack[mach->sp + 1]._float == stack[mach->sp]._float ? (GLfloat) 1 : (GLfloat) 0;
- mach->sp++;
- break;
- case slang_asm_float_equal_int:
- mach->sp--;
- stack[mach->sp]._float = stack[mach->sp + 1 + a->param[0] / 4]._float ==
- stack[mach->sp + 1 + a->param[1] / 4]._float ? (GLfloat) 1 : (GLfloat) 0;
- break;
- case slang_asm_float_to_int:
- stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
- break;
- case slang_asm_float_sine:
- stack[mach->sp]._float = (GLfloat) _mesa_sin (stack[mach->sp]._float);
- break;
- case slang_asm_float_arcsine:
- stack[mach->sp]._float = _mesa_asinf (stack[mach->sp]._float);
- break;
- case slang_asm_float_arctan:
- stack[mach->sp]._float = _mesa_atanf (stack[mach->sp]._float);
- break;
- case slang_asm_float_power:
- stack[mach->sp + 1]._float =
- (GLfloat) _mesa_pow (stack[mach->sp + 1]._float, stack[mach->sp]._float);
- mach->sp++;
- break;
- case slang_asm_float_log2:
- stack[mach->sp]._float = LOG2 (stack[mach->sp]._float);
- break;
- case slang_asm_float_floor:
- stack[mach->sp]._float = FLOORF (stack[mach->sp]._float);
- break;
- case slang_asm_float_ceil:
- stack[mach->sp]._float = CEILF (stack[mach->sp]._float);
- break;
- case slang_asm_float_noise1:
- stack[mach->sp]._float = _slang_library_noise1 (stack[mach->sp]._float);
- break;
- case slang_asm_float_noise2:
- stack[mach->sp + 1]._float = _slang_library_noise2 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float);
- mach->sp++;
- break;
- case slang_asm_float_noise3:
- stack[mach->sp + 2]._float = _slang_library_noise3 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float);
- mach->sp += 2;
- break;
- case slang_asm_float_noise4:
- stack[mach->sp + 3]._float = _slang_library_noise4 (stack[mach->sp]._float,
- stack[mach->sp + 1]._float, stack[mach->sp + 2]._float, stack[mach->sp + 3]._float);
- mach->sp += 3;
- break;
- case slang_asm_int_to_float:
- break;
- case slang_asm_int_to_addr:
- stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
- break;
- case slang_asm_addr_copy:
- mach->mem[stack[mach->sp + 1]._addr / 4]._addr = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_addr_push:
- case slang_asm_global_addr:
- mach->sp--;
- stack[mach->sp]._addr = a->param[0];
- break;
- case slang_asm_addr_deref:
- stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
- break;
- case slang_asm_addr_add:
- stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_addr_multiply:
- stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_vec4_tex1d:
- _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);
- mach->sp += 3;
- break;
- case slang_asm_vec4_tex2d:
- _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,
- &mach->mem[stack[mach->sp + 4]._addr / 4]._float);
- mach->sp += 4;
- break;
- case slang_asm_vec4_tex3d:
- _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_texcube:
- _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_shad1d:
- _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_vec4_shad2d:
- _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,
- stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,
- &mach->mem[stack[mach->sp + 5]._addr / 4]._float);
- mach->sp += 5;
- break;
- case slang_asm_jump:
- mach->ip = a->param[0];
- break;
- case slang_asm_jump_if_zero:
- if (stack[mach->sp]._float == 0.0f)
- mach->ip = a->param[0];
- mach->sp++;
- break;
- case slang_asm_enter:
- mach->sp--;
- stack[mach->sp]._addr = mach->bp;
- mach->bp = mach->sp + a->param[0] / 4;
- break;
- case slang_asm_leave:
- mach->bp = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_local_alloc:
- mach->sp -= a->param[0] / 4;
- break;
- case slang_asm_local_free:
- mach->sp += a->param[0] / 4;
- break;
- case slang_asm_local_addr:
- mach->sp--;
- stack[mach->sp]._addr = SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 -
- (a->param[0] + a->param[1]) + 4;
- break;
- case slang_asm_call:
- mach->sp--;
- stack[mach->sp]._addr = mach->ip;
- mach->ip = a->param[0];
- break;
- case slang_asm_return:
- mach->ip = stack[mach->sp]._addr;
- mach->sp++;
- break;
- case slang_asm_discard:
- mach->kill = 1;
- break;
- case slang_asm_exit:
- mach->exit = 1;
- break;
- /* GL_MESA_shader_debug */
- case slang_asm_float_print:
- _mesa_printf ("slang print: %f\n", stack[mach->sp]._float);
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%f", stack[mach->sp]._float);
- break;
- case slang_asm_int_print:
- _mesa_printf ("slang print: %d\n", (GLint) stack[mach->sp]._float);
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%d", (GLint) (stack[mach->sp]._float));
- break;
- case slang_asm_bool_print:
- _mesa_printf ("slang print: %s\n", (GLint) stack[mach->sp]._float ? "true" : "false");
- ensure_infolog_created (&mach->infolog);
- slang_info_log_print (mach->infolog, "%s",
- (GLint) (stack[mach->sp]._float) ? "true" : "false");
- break;
- /* vec4 */
+ switch (a->type) {
+ /* core */
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ /* store top value on stack to memory */
+ {
+ GLuint address
+ = (stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4;
+ GLfloat value = stack[mach->sp]._float;
+ mach->mem[address]._float = value;
+ }
+ mach->sp++;
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ stack[mach->sp + a->param[0] / 4]._float =
+ stack[mach->sp +
+ (stack[mach->sp]._addr + a->param[1]) / 4]._float;
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* push float/int/bool literal onto stop of stack */
+ mach->sp--;
+ stack[mach->sp]._float = a->literal;
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ /* load value from memory, replace stop of stack with it */
+ stack[mach->sp]._float = mach->mem[stack[mach->sp]._addr / 4]._float;
+ break;
+ case slang_asm_float_add:
+ /* pop two top floats, push sum */
+ stack[mach->sp + 1]._float += stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_multiply:
+ stack[mach->sp + 1]._float *= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_divide:
+ stack[mach->sp + 1]._float /= stack[mach->sp]._float;
+ mach->sp++;
+ break;
+ case slang_asm_float_negate:
+ stack[mach->sp]._float = -stack[mach->sp]._float;
+ break;
+ case slang_asm_float_less:
+ stack[mach->sp + 1]._float =
+ (stack[mach->sp + 1]._float < stack[mach->sp]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_exp:
+ stack[mach->sp + 1]._float =
+ (stack[mach->sp + 1]._float == stack[mach->sp]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ mach->sp++;
+ break;
+ case slang_asm_float_equal_int:
+ /* pop top two values, compare, push 0 or 1 */
+ mach->sp--;
+ stack[mach->sp]._float =
+ (stack[mach->sp + 1 + a->param[0] / 4]._float ==
+ stack[mach->sp + 1 + a->param[1] / 4]._float)
+ ? (GLfloat) 1 : (GLfloat) 0;
+ break;
+ case slang_asm_float_to_int:
+ stack[mach->sp]._float = (GLfloat) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_float_sine:
+ stack[mach->sp]._float = (GLfloat) _mesa_sin(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arcsine:
+ stack[mach->sp]._float = _mesa_asinf(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_arctan:
+ stack[mach->sp]._float = _mesa_atanf(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_power:
+ stack[mach->sp + 1]._float = (GLfloat)
+ _mesa_pow(stack[mach->sp + 1]._float, stack[mach->sp]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_log2:
+ stack[mach->sp]._float = LOG2(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_floor:
+ stack[mach->sp]._float = FLOORF(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_ceil:
+ stack[mach->sp]._float = CEILF(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise1:
+ stack[mach->sp]._float =
+ _slang_library_noise1(stack[mach->sp]._float);
+ break;
+ case slang_asm_float_noise2:
+ stack[mach->sp + 1]._float =
+ _slang_library_noise2(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float);
+ mach->sp++;
+ break;
+ case slang_asm_float_noise3:
+ stack[mach->sp + 2]._float =
+ _slang_library_noise3(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float);
+ mach->sp += 2;
+ break;
+ case slang_asm_float_noise4:
+ stack[mach->sp + 3]._float =
+ _slang_library_noise4(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ stack[mach->sp]._addr = (GLuint) (GLint) stack[mach->sp]._float;
+ break;
+ case slang_asm_addr_copy:
+ mach->mem[stack[mach->sp + 1]._addr / 4]._addr =
+ stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_push:
+ case slang_asm_global_addr:
+ mach->sp--;
+ stack[mach->sp]._addr = a->param[0];
+ break;
+ case slang_asm_addr_deref:
+ stack[mach->sp]._addr = mach->mem[stack[mach->sp]._addr / 4]._addr;
+ break;
+ case slang_asm_addr_add:
+ stack[mach->sp + 1]._addr += stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_addr_multiply:
+ stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_vec4_tex1d:
+ _slang_library_tex1d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ &mach->mem[stack[mach->sp + 3]._addr /
+ 4]._float);
+ mach->sp += 3;
+ break;
+ case slang_asm_vec4_tex2d:
+ _slang_library_tex2d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ &mach->mem[stack[mach->sp + 4]._addr /
+ 4]._float);
+ mach->sp += 4;
+ break;
+ case slang_asm_vec4_tex3d:
+ _slang_library_tex3d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_texcube:
+ _slang_library_texcube(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad1d:
+ _slang_library_shad1d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_vec4_shad2d:
+ _slang_library_shad2d(stack[mach->sp]._float,
+ stack[mach->sp + 1]._float,
+ stack[mach->sp + 2]._float,
+ stack[mach->sp + 3]._float,
+ stack[mach->sp + 4]._float,
+ &mach->mem[stack[mach->sp + 5]._addr /
+ 4]._float);
+ mach->sp += 5;
+ break;
+ case slang_asm_jump:
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_jump_if_zero:
+ if (stack[mach->sp]._float == 0.0f)
+ mach->ip = a->param[0];
+ mach->sp++;
+ break;
+ case slang_asm_enter:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->bp;
+ mach->bp = mach->sp + a->param[0] / 4;
+ break;
+ case slang_asm_leave:
+ mach->bp = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_local_alloc:
+ mach->sp -= a->param[0] / 4;
+ break;
+ case slang_asm_local_free:
+ mach->sp += a->param[0] / 4;
+ break;
+ case slang_asm_local_addr:
+ mach->sp--;
+ stack[mach->sp]._addr =
+ SLANG_MACHINE_GLOBAL_SIZE * 4 + mach->bp * 4 - (a->param[0] +
+ a->param[1]) + 4;
+ break;
+ case slang_asm_call:
+ mach->sp--;
+ stack[mach->sp]._addr = mach->ip;
+ mach->ip = a->param[0];
+ break;
+ case slang_asm_return:
+ mach->ip = stack[mach->sp]._addr;
+ mach->sp++;
+ break;
+ case slang_asm_discard:
+ mach->kill = GL_TRUE;
+ break;
+ case slang_asm_exit:
+ mach->exit = GL_TRUE;
+ break;
+ /* GL_MESA_shader_debug */
+ case slang_asm_float_print:
+ _mesa_printf("slang print: %f\n", stack[mach->sp]._float);
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%f", stack[mach->sp]._float);
+ break;
+ case slang_asm_int_print:
+ _mesa_printf("slang print: %d\n", (GLint) stack[mach->sp]._float);
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%d",
+ (GLint) (stack[mach->sp]._float));
+ break;
+ case slang_asm_bool_print:
+ _mesa_printf("slang print: %s\n",
+ (GLint) stack[mach->sp]._float ? "true" : "false");
+ ensure_infolog_created(&mach->infolog);
+ slang_info_log_print(mach->infolog, "%s",
+ (GLint) (stack[mach->sp].
+ _float) ? "true" : "false");
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
/* [vec4] | float > [vec4] */
{
@@ -660,7 +714,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
mach->mem[da / 4]._float = -mach->mem[da / 4]._float;
mach->mem[(da + 4) / 4]._float = -mach->mem[(da + 4) / 4]._float;
mach->mem[(da + 8) / 4]._float = -mach->mem[(da + 8) / 4]._float;
- mach->mem[(da + 12) / 4]._float = -mach->mem[(da + 12) / 4]._float;
+ mach->mem[(da + 12) / 4]._float =
+ -mach->mem[(da + 12) / 4]._float;
}
break;
case slang_asm_vec4_dot:
@@ -721,9 +776,8 @@ _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)
#if DEBUG_SLANG
if (f != NULL)
- fclose (f);
+ fclose(f);
#endif
return GL_TRUE;
}
-
diff --git a/src/mesa/shader/slang/slang_execute.h b/src/mesa/shader/slang/slang_execute.h
index cb152c71420..138f1393081 100644
--- a/src/mesa/shader/slang/slang_execute.h
+++ b/src/mesa/shader/slang/slang_execute.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if !defined SLANG_EXECUTE_H
+#ifndef SLANG_EXECUTE_H
#define SLANG_EXECUTE_H
#include "slang_assemble.h"
@@ -31,55 +31,75 @@
extern "C" {
#endif
+
+/**
+ * A memory location
+ */
typedef union slang_machine_slot_
{
- GLfloat _float;
- GLuint _addr;
+ GLfloat _float;
+ GLuint _addr;
} slang_machine_slot;
#define SLANG_MACHINE_GLOBAL_SIZE 3072
#define SLANG_MACHINE_STACK_SIZE 1024
#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)
+
#if defined(USE_X86_ASM) || defined(SLANG_X86)
+/**
+ * Extra machine state for x86 execution.
+ */
typedef struct
{
- GLvoid (* compiled_func) (struct slang_machine_ *);
- GLuint esp_restore;
- GLshort fpucntl_rnd_neg;
- GLshort fpucntl_restore;
+ GLvoid(*compiled_func) (struct slang_machine_ *);
+ GLuint esp_restore;
+ GLshort fpucntl_rnd_neg;
+ GLshort fpucntl_restore;
} slang_machine_x86;
#endif
+
+/**
+ * Runtime shader machine state.
+ */
typedef struct slang_machine_
{
- GLuint ip; /* instruction pointer, for flow control */
- GLuint sp; /* stack pointer, for stack access */
- GLuint bp; /* base pointer, for local variable access */
- GLuint kill; /* discard the fragment */
- GLuint exit; /* terminate the shader */
- slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
- struct slang_info_log_ *infolog; /* printMESA() support */
+ GLuint ip; /**< instruction pointer, for flow control */
+ GLuint sp; /**< stack pointer, for stack access */
+ GLuint bp; /**< base pointer, for local variable access */
+ GLboolean kill; /**< discard the fragment? */
+ GLboolean exit; /**< terminate the shader */
+ /** Machine memory */
+ slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
+ struct slang_info_log_ *infolog; /**< printMESA() support */
#if defined(USE_X86_ASM) || defined(SLANG_X86)
- slang_machine_x86 x86;
+ slang_machine_x86 x86;
#endif
} slang_machine;
-GLvoid slang_machine_ctr (slang_machine *);
-GLvoid slang_machine_dtr (slang_machine *);
-void slang_machine_init (slang_machine *);
+extern GLvoid
+slang_machine_ctr(slang_machine *);
+
+extern GLvoid
+slang_machine_dtr(slang_machine *);
+
+extern void
+slang_machine_init(slang_machine *);
+
+extern GLboolean
+_slang_execute2(const slang_assembly_file *, slang_machine *);
-GLboolean
-_slang_execute2 (const slang_assembly_file *, slang_machine *);
#if defined(USE_X86_ASM) || defined(SLANG_X86)
-GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
+extern GLboolean
+_slang_x86_codegen(slang_machine *, slang_assembly_file *, GLuint);
#endif
+
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/src/mesa/shader/slang/slang_execute_x86.c b/src/mesa/shader/slang/slang_execute_x86.c
index 3e21edff6a3..958086ff07c 100644
--- a/src/mesa/shader/slang/slang_execute_x86.c
+++ b/src/mesa/shader/slang/slang_execute_x86.c
@@ -40,40 +40,42 @@
typedef struct
{
- GLuint index;
- GLubyte *csr;
+ GLuint index;
+ GLubyte *csr;
} fixup;
typedef struct
{
- struct x86_function f;
- struct x86_reg r_eax;
- struct x86_reg r_ecx;
- struct x86_reg r_edx;
+ struct x86_function f;
+ struct x86_reg r_eax;
+ struct x86_reg r_ecx;
+ struct x86_reg r_edx;
struct x86_reg r_ebx;
- struct x86_reg r_esp;
- struct x86_reg r_ebp;
- struct x86_reg r_st0;
- struct x86_reg r_st1;
- struct x86_reg r_st2;
- struct x86_reg r_st3;
+ struct x86_reg r_esp;
+ struct x86_reg r_ebp;
+ struct x86_reg r_st0;
+ struct x86_reg r_st1;
+ struct x86_reg r_st2;
+ struct x86_reg r_st3;
struct x86_reg r_st4;
- fixup *fixups;
- GLuint fixup_count;
- GLubyte **labels;
- slang_machine *mach;
- GLubyte *l_discard;
- GLubyte *l_exit;
- GLshort fpucntl;
+ fixup *fixups;
+ GLuint fixup_count;
+ GLubyte **labels;
+ slang_machine *mach;
+ GLubyte *l_discard;
+ GLubyte *l_exit;
+ GLshort fpucntl;
} codegen_ctx;
-static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
+static GLvoid
+add_fixup(codegen_ctx * G, GLuint index, GLubyte * csr)
{
- G->fixups = (fixup *) slang_alloc_realloc (G->fixups, G->fixup_count * sizeof (fixup),
- (G->fixup_count + 1) * sizeof (fixup));
- G->fixups[G->fixup_count].index = index;
- G->fixups[G->fixup_count].csr = csr;
- G->fixup_count++;
+ G->fixups =
+ (fixup *) slang_alloc_realloc(G->fixups, G->fixup_count * sizeof(fixup),
+ (G->fixup_count + 1) * sizeof(fixup));
+ G->fixups[G->fixup_count].index = index;
+ G->fixups[G->fixup_count].csr = csr;
+ G->fixup_count++;
}
#ifdef NO_FAST_MATH
@@ -88,661 +90,665 @@ static GLvoid add_fixup (codegen_ctx *G, GLuint index, GLubyte *csr)
/*
* XXX
- * These should produce a valid code that computes powers. Unfortunately, it does not.
+ * These should produce a valid code that computes powers.
+ * Unfortunately, it does not.
*/
-static void set_fpu_round_neg_inf (codegen_ctx *G)
+static void
+set_fpu_round_neg_inf(codegen_ctx * G)
{
- if (G->fpucntl != RND_NEG_FPU)
- {
- G->fpucntl = RND_NEG_FPU;
- x87_fnclex (&G->f);
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->x86.fpucntl_rnd_neg);
- x87_fldcw (&G->f, x86_deref (G->r_eax));
- }
+ if (G->fpucntl != RND_NEG_FPU) {
+ G->fpucntl = RND_NEG_FPU;
+ x87_fnclex(&G->f);
+ x86_mov_reg_imm(&G->f, G->r_eax,
+ (GLint) & G->mach->x86.fpucntl_rnd_neg);
+ x87_fldcw(&G->f, x86_deref(G->r_eax));
+ }
}
-static void emit_x87_ex2 (codegen_ctx *G)
+static void
+emit_x87_ex2(codegen_ctx * G)
{
- set_fpu_round_neg_inf (G);
-
- x87_fld (&G->f, G->r_st0); /* a a */
- x87_fprndint (&G->f); /* int(a) a */
- x87_fld (&G->f, G->r_st0); /* int(a) int(a) a */
- x87_fstp (&G->f, G->r_st3); /* int(a) a int(a)*/
- x87_fsubp (&G->f, G->r_st1);/* frac(a) int(a) */
- x87_f2xm1 (&G->f); /* (2^frac(a))-1 int(a)*/
- x87_fld1 (&G->f); /* 1 (2^frac(a))-1 int(a)*/
- x87_faddp (&G->f, G->r_st1);/* 2^frac(a) int(a) */
- x87_fscale (&G->f); /* 2^a */
+ set_fpu_round_neg_inf(G);
+
+ x87_fld(&G->f, G->r_st0); /* a a */
+ x87_fprndint(&G->f); /* int(a) a */
+ x87_fld(&G->f, G->r_st0); /* int(a) int(a) a */
+ x87_fstp(&G->f, G->r_st3); /* int(a) a int(a) */
+ x87_fsubp(&G->f, G->r_st1); /* frac(a) int(a) */
+ x87_f2xm1(&G->f); /* (2^frac(a))-1 int(a) */
+ x87_fld1(&G->f); /* 1 (2^frac(a))-1 int(a) */
+ x87_faddp(&G->f, G->r_st1); /* 2^frac(a) int(a) */
+ x87_fscale(&G->f); /* 2^a */
}
-static void emit_pow (codegen_ctx *G)
+static void
+emit_pow(codegen_ctx * G)
{
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fyl2x (&G->f);
- emit_x87_ex2 (G);
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fyl2x(&G->f);
+ emit_x87_ex2(G);
}
#endif
-static GLfloat do_ceilf (GLfloat x)
+static GLfloat
+do_ceilf(GLfloat x)
{
- return CEILF (x);
+ return CEILF(x);
}
-static GLfloat do_floorf (GLfloat x)
+static GLfloat
+do_floorf(GLfloat x)
{
- return FLOORF (x);
+ return FLOORF(x);
}
static GLfloat
-do_ftoi (GLfloat x)
+do_ftoi(GLfloat x)
{
return (GLfloat) ((GLint) (x));
}
-static GLfloat do_powf (GLfloat y, GLfloat x)
+static GLfloat
+do_powf(GLfloat y, GLfloat x)
{
- return (GLfloat) _mesa_pow ((GLdouble) x, (GLdouble) y);
+ return (GLfloat) _mesa_pow((GLdouble) x, (GLdouble) y);
}
static GLvoid
-ensure_infolog_created (slang_info_log **infolog)
+ensure_infolog_created(slang_info_log ** infolog)
{
if (*infolog == NULL) {
- *infolog = slang_alloc_malloc (sizeof (slang_info_log));
+ *infolog = slang_alloc_malloc(sizeof(slang_info_log));
if (*infolog == NULL)
return;
- slang_info_log_construct (*infolog);
+ slang_info_log_construct(*infolog);
}
}
-static GLvoid do_print_float (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_float(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %f\n", x);
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%f", x);
+ _mesa_printf("slang print: %f\n", x);
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%f", x);
}
-static GLvoid do_print_int (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_int(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %d\n", (GLint) (x));
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%d", (GLint) (x));
+ _mesa_printf("slang print: %d\n", (GLint) (x));
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%d", (GLint) (x));
}
-static GLvoid do_print_bool (slang_info_log **infolog, GLfloat x)
+static GLvoid
+do_print_bool(slang_info_log ** infolog, GLfloat x)
{
- _mesa_printf ("slang print: %s\n", (GLint) (x) ? "true" : "false");
- ensure_infolog_created (infolog);
- slang_info_log_print (*infolog, "%s", (GLint) (x) ? "true" : "false");
+ _mesa_printf("slang print: %s\n", (GLint) (x) ? "true" : "false");
+ ensure_infolog_created(infolog);
+ slang_info_log_print(*infolog, "%s", (GLint) (x) ? "true" : "false");
}
#define FLOAT_ONE 0x3f800000
#define FLOAT_ZERO 0
-static GLvoid codegen_assem (codegen_ctx *G, slang_assembly *a, slang_info_log **infolog)
+static GLvoid
+codegen_assem(codegen_ctx * G, slang_assembly * a, slang_info_log ** infolog)
{
- GLint disp, i;
-
- switch (a->type)
- {
- case slang_asm_none:
- break;
- case slang_asm_float_copy:
- case slang_asm_int_copy:
- case slang_asm_bool_copy:
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
- break;
- case slang_asm_float_move:
- case slang_asm_int_move:
- case slang_asm_bool_move:
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[1]));
- x86_add (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
- x86_mov (&G->f, x86_make_disp (G->r_esp, a->param[0]), G->r_eax);
- break;
- case slang_asm_float_push:
- case slang_asm_int_push:
- case slang_asm_bool_push:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, *((GLint *) &a->literal));
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_float_deref:
- case slang_asm_int_deref:
- case slang_asm_bool_deref:
- case slang_asm_addr_deref:
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_eax));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_float_add:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_faddp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_multiply:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fmulp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_divide:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fdivp (&G->f, G->r_st1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_negate:
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fchs (&G->f);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_less:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fcomp (&G->f, x86_deref (G->r_esp));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x100);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_equal_exp:
- x87_fld (&G->f, x86_make_disp (G->r_esp, 4));
- x87_fcomp (&G->f, x86_deref (G->r_esp));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_equal_int:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
- x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4));
- x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4));
- x87_fnstsw (&G->f, G->r_eax);
- /* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_eax, G->r_ecx);
- {
- GLubyte *lab0, *lab1;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
- /* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- }
- break;
- case slang_asm_float_to_int:
+ GLint disp, i;
+
+ switch (a->type) {
+ case slang_asm_none:
+ break;
+ case slang_asm_float_copy:
+ case slang_asm_int_copy:
+ case slang_asm_bool_copy:
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0]));
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx);
+ break;
+ case slang_asm_float_move:
+ case slang_asm_int_move:
+ case slang_asm_bool_move:
+ x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[1]));
+ x86_add(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax));
+ x86_mov(&G->f, x86_make_disp(G->r_esp, a->param[0]), G->r_eax);
+ break;
+ case slang_asm_float_push:
+ case slang_asm_int_push:
+ case slang_asm_bool_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, *((GLint *) & a->literal));
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_float_deref:
+ case slang_asm_int_deref:
+ case slang_asm_bool_deref:
+ case slang_asm_addr_deref:
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_eax));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_float_add:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_faddp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_multiply:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fmulp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_divide:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fdivp(&G->f, G->r_st1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_negate:
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fchs(&G->f);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_less:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fcomp(&G->f, x86_deref(G->r_esp));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x100);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_exp:
+ x87_fld(&G->f, x86_make_disp(G->r_esp, 4));
+ x87_fcomp(&G->f, x86_deref(G->r_esp));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_equal_int:
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4));
+ x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4));
+ x87_fnstsw(&G->f, G->r_eax);
+ /* TODO: use test r8,imm8 */
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_eax, G->r_ecx);
+ {
+ GLubyte *lab0, *lab1;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
+ /* TODO: use jmp rel8 */
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ }
+ break;
+ case slang_asm_float_to_int:
/* TODO: use fistp without rounding */
- x86_call (&G->f, (GLubyte *) (do_ftoi));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_sine:
- /* TODO: use fsin */
- x86_call (&G->f, (GLubyte *) _mesa_sinf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_arcsine:
- /* TODO: use fpatan (?) */
- x86_call (&G->f, (GLubyte *) _mesa_asinf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_arctan:
- /* TODO: use fpatan */
- x86_call (&G->f, (GLubyte *) _mesa_atanf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_power:
- /* TODO: use emit_pow() */
- x86_call (&G->f, (GLubyte *) do_powf);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_log2:
- x87_fld1 (&G->f);
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fyl2x (&G->f);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_floor:
- x86_call (&G->f, (GLubyte *) do_floorf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_ceil:
- x86_call (&G->f, (GLubyte *) do_ceilf);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise1:
- x86_call (&G->f, (GLubyte *) _slang_library_noise1);
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise2:
- x86_call (&G->f, (GLubyte *) _slang_library_noise2);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise3:
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 8));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_float_noise4:
- x86_call (&G->f, (GLubyte *) _slang_library_noise4);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
- x87_fstp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_int_to_float:
- break;
- case slang_asm_int_to_addr:
- x87_fld (&G->f, x86_deref (G->r_esp));
- x87_fistp (&G->f, x86_deref (G->r_esp));
- break;
- case slang_asm_addr_copy:
- x86_pop (&G->f, G->r_eax);
- x86_mov (&G->f, G->r_ecx, x86_deref (G->r_esp));
- x86_mov (&G->f, x86_deref (G->r_ecx), G->r_eax);
- break;
- case slang_asm_addr_push:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) a->param[0]);
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_addr_add:
- x86_pop (&G->f, G->r_eax);
- x86_add (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_addr_multiply:
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mul (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);
- break;
- case slang_asm_vec4_tex1d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex1d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));
- break;
- case slang_asm_vec4_tex2d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex2d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
- break;
- case slang_asm_vec4_tex3d:
- x86_call (&G->f, (GLubyte *) _slang_library_tex3d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_texcube:
- x86_call (&G->f, (GLubyte *) _slang_library_texcube);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_shad1d:
- x86_call (&G->f, (GLubyte *) _slang_library_shad1d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_vec4_shad2d:
- x86_call (&G->f, (GLubyte *) _slang_library_shad2d);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));
- break;
- case slang_asm_jump:
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
- break;
- case slang_asm_jump_if_zero:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_xor (&G->f, G->r_eax, G->r_eax);
- x86_cmp (&G->f, G->r_eax, x86_make_disp (G->r_esp, -4));
- {
- GLubyte *lab0;
-
- /* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_NE);
- add_fixup (G, a->param[0], x86_jmp_forward (&G->f));
- x86_fixup_fwd_jump (&G->f, lab0);
- }
- break;
- case slang_asm_enter:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_push (&G->f, G->r_ebp);
- x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
- break;
- case slang_asm_leave:
- x86_pop (&G->f, G->r_ebp);
- break;
- case slang_asm_local_alloc:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -(GLint) a->param[0]));
- break;
- case slang_asm_local_free:
- /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
- assert (a->param[0] != 0);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, (GLint) a->param[0]));
- break;
- case slang_asm_local_addr:
- disp = -(GLint) (a->param[0] + a->param[1]) + 4;
- if (disp != 0)
- {
- x86_lea (&G->f, G->r_eax, x86_make_disp (G->r_ebp, disp));
- x86_push (&G->f, G->r_eax);
- }
- else
- x86_push (&G->f, G->r_ebp);
- break;
- case slang_asm_global_addr:
- /* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) &G->mach->mem + a->param[0]);
- x86_push (&G->f, G->r_eax);
- break;
- case slang_asm_call:
- add_fixup (G, a->param[0], x86_call_forward (&G->f));
- break;
- case slang_asm_return:
- x86_ret (&G->f);
- break;
- case slang_asm_discard:
- x86_jmp (&G->f, G->l_discard);
- break;
- case slang_asm_exit:
- x86_jmp (&G->f, G->l_exit);
- break;
- /* GL_MESA_shader_debug */
+ x86_call(&G->f, (GLubyte *) (do_ftoi));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_sine:
+ /* TODO: use fsin */
+ x86_call(&G->f, (GLubyte *) _mesa_sinf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_arcsine:
+ /* TODO: use fpatan (?) */
+ x86_call(&G->f, (GLubyte *) _mesa_asinf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_arctan:
+ /* TODO: use fpatan */
+ x86_call(&G->f, (GLubyte *) _mesa_atanf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_power:
+ /* TODO: use emit_pow() */
+ x86_call(&G->f, (GLubyte *) do_powf);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_log2:
+ x87_fld1(&G->f);
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fyl2x(&G->f);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_floor:
+ x86_call(&G->f, (GLubyte *) do_floorf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_ceil:
+ x86_call(&G->f, (GLubyte *) do_ceilf);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise1:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise1);
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise2:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise2);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise3:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 8));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_float_noise4:
+ x86_call(&G->f, (GLubyte *) _slang_library_noise4);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12));
+ x87_fstp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_int_to_float:
+ break;
+ case slang_asm_int_to_addr:
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x87_fistp(&G->f, x86_deref(G->r_esp));
+ break;
+ case slang_asm_addr_copy:
+ x86_pop(&G->f, G->r_eax);
+ x86_mov(&G->f, G->r_ecx, x86_deref(G->r_esp));
+ x86_mov(&G->f, x86_deref(G->r_ecx), G->r_eax);
+ break;
+ case slang_asm_addr_push:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) a->param[0]);
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_addr_add:
+ x86_pop(&G->f, G->r_eax);
+ x86_add(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_addr_multiply:
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mul(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_eax);
+ break;
+ case slang_asm_vec4_tex1d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex1d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 12));
+ break;
+ case slang_asm_vec4_tex2d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex2d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
+ break;
+ case slang_asm_vec4_tex3d:
+ x86_call(&G->f, (GLubyte *) _slang_library_tex3d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_texcube:
+ x86_call(&G->f, (GLubyte *) _slang_library_texcube);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad1d:
+ x86_call(&G->f, (GLubyte *) _slang_library_shad1d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_vec4_shad2d:
+ x86_call(&G->f, (GLubyte *) _slang_library_shad2d);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 20));
+ break;
+ case slang_asm_jump:
+ add_fixup(G, a->param[0], x86_jmp_forward(&G->f));
+ break;
+ case slang_asm_jump_if_zero:
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_xor(&G->f, G->r_eax, G->r_eax);
+ x86_cmp(&G->f, G->r_eax, x86_make_disp(G->r_esp, -4));
+ {
+ GLubyte *lab0;
+ /* TODO: use jcc rel8 */
+ lab0 = x86_jcc_forward(&G->f, cc_NE);
+ add_fixup(G, a->param[0], x86_jmp_forward(&G->f));
+ x86_fixup_fwd_jump(&G->f, lab0);
+ }
+ break;
+ case slang_asm_enter:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_push(&G->f, G->r_ebp);
+ x86_lea(&G->f, G->r_ebp, x86_make_disp(G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_leave:
+ x86_pop(&G->f, G->r_ebp);
+ break;
+ case slang_asm_local_alloc:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -(GLint) a->param[0]));
+ break;
+ case slang_asm_local_free:
+ /* FIXME: x86_make_disp(esp, 0) + x86_lea() generates bogus code */
+ assert(a->param[0] != 0);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, (GLint) a->param[0]));
+ break;
+ case slang_asm_local_addr:
+ disp = -(GLint) (a->param[0] + a->param[1]) + 4;
+ if (disp != 0) {
+ x86_lea(&G->f, G->r_eax, x86_make_disp(G->r_ebp, disp));
+ x86_push(&G->f, G->r_eax);
+ }
+ else
+ x86_push(&G->f, G->r_ebp);
+ break;
+ case slang_asm_global_addr:
+ /* TODO: use push imm32 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) & G->mach->mem + a->param[0]);
+ x86_push(&G->f, G->r_eax);
+ break;
+ case slang_asm_call:
+ add_fixup(G, a->param[0], x86_call_forward(&G->f));
+ break;
+ case slang_asm_return:
+ x86_ret(&G->f);
+ break;
+ case slang_asm_discard:
+ x86_jmp(&G->f, G->l_discard);
+ break;
+ case slang_asm_exit:
+ x86_jmp(&G->f, G->l_exit);
+ break;
+ /* GL_MESA_shader_debug */
case slang_asm_float_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) (do_print_float));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) (do_print_float));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
break;
- case slang_asm_int_print:
+ case slang_asm_int_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) do_print_int);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- break;
- case slang_asm_bool_print:
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) do_print_int);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ break;
+ case slang_asm_bool_print:
/* TODO: use push imm32 */
- x86_mov_reg_imm (&G->f, G->r_eax, (GLint) (infolog));
- x86_push (&G->f, G->r_eax);
- x86_call (&G->f, (GLubyte *) do_print_bool);
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- break;
- /* vec4 */
+ x86_mov_reg_imm(&G->f, G->r_eax, (GLint) (infolog));
+ x86_push(&G->f, G->r_eax);
+ x86_call(&G->f, (GLubyte *) do_print_bool);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ break;
+ /* vec4 */
case slang_asm_float_to_vec4:
/* [vec4] | float > [vec4] */
- x87_fld (&G->f, x86_deref (G->r_esp));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 4));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 12));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 8));
- x87_fst (&G->f, x86_make_disp (G->r_eax, 4));
- x87_fstp (&G->f, x86_deref (G->r_eax));
+ x87_fld(&G->f, x86_deref(G->r_esp));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 4));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 12));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 8));
+ x87_fst(&G->f, x86_make_disp(G->r_eax, 4));
+ x87_fstp(&G->f, x86_deref(G->r_eax));
break;
case slang_asm_vec4_add:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_faddp (&G->f, G->r_st4);
+ x87_faddp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_subtract:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fsubp (&G->f, G->r_st4);
+ x87_fsubp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_multiply:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fmulp (&G->f, G->r_st4);
+ x87_fmulp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_divide:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
for (i = 0; i < 4; i++)
- x87_fdivp (&G->f, G->r_st4);
+ x87_fdivp(&G->f, G->r_st4);
for (i = 0; i < 4; i++)
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
break;
case slang_asm_vec4_negate:
/* [vec4] > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++) {
- x87_fchs (&G->f);
- x87_fstp (&G->f, x86_make_disp (G->r_eax, 12 - i * 4));
+ x87_fchs(&G->f);
+ x87_fstp(&G->f, x86_make_disp(G->r_eax, 12 - i * 4));
}
break;
case slang_asm_vec4_dot:
/* [vec4] | vec4 > [float] */
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_esp, i * 4));
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
+ x87_fld(&G->f, x86_make_disp(G->r_esp, i * 4));
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, 16));
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
for (i = 0; i < 4; i++)
- x87_fld (&G->f, x86_make_disp (G->r_eax, i * 4));
+ x87_fld(&G->f, x86_make_disp(G->r_eax, i * 4));
for (i = 0; i < 4; i++)
- x87_fmulp (&G->f, G->r_st4);
+ x87_fmulp(&G->f, G->r_st4);
for (i = 0; i < 3; i++)
- x87_faddp (&G->f, G->r_st1);
- x87_fstp (&G->f, x86_deref (G->r_eax));
+ x87_faddp(&G->f, G->r_st1);
+ x87_fstp(&G->f, x86_deref(G->r_eax));
break;
case slang_asm_vec4_copy:
/* [vec4] | vec4 > [vec4] */
- x86_mov (&G->f, G->r_eax, x86_make_disp (G->r_esp, a->param[0]));
- x86_pop (&G->f, G->r_ecx);
- x86_pop (&G->f, G->r_edx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1]), G->r_ecx);
- x86_pop (&G->f, G->r_ebx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 4), G->r_edx);
- x86_pop (&G->f, G->r_ecx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 8), G->r_ebx);
- x86_mov (&G->f, x86_make_disp (G->r_eax, a->param[1] + 12), G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_make_disp(G->r_esp, a->param[0]));
+ x86_pop(&G->f, G->r_ecx);
+ x86_pop(&G->f, G->r_edx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1]), G->r_ecx);
+ x86_pop(&G->f, G->r_ebx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 4), G->r_edx);
+ x86_pop(&G->f, G->r_ecx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 8), G->r_ebx);
+ x86_mov(&G->f, x86_make_disp(G->r_eax, a->param[1] + 12), G->r_ecx);
break;
case slang_asm_vec4_deref:
/* [vec4] > vec4 */
- x86_mov (&G->f, G->r_eax, x86_deref (G->r_esp));
- x86_mov (&G->f, G->r_ecx, x86_make_disp (G->r_eax, 12));
- x86_mov (&G->f, G->r_edx, x86_make_disp (G->r_eax, 8));
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
- x86_mov (&G->f, G->r_ebx, x86_make_disp (G->r_eax, 4));
- x86_push (&G->f, G->r_edx);
- x86_mov (&G->f, G->r_ecx, x86_deref (G->r_eax));
- x86_push (&G->f, G->r_ebx);
- x86_push (&G->f, G->r_ecx);
+ x86_mov(&G->f, G->r_eax, x86_deref(G->r_esp));
+ x86_mov(&G->f, G->r_ecx, x86_make_disp(G->r_eax, 12));
+ x86_mov(&G->f, G->r_edx, x86_make_disp(G->r_eax, 8));
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
+ x86_mov(&G->f, G->r_ebx, x86_make_disp(G->r_eax, 4));
+ x86_push(&G->f, G->r_edx);
+ x86_mov(&G->f, G->r_ecx, x86_deref(G->r_eax));
+ x86_push(&G->f, G->r_ebx);
+ x86_push(&G->f, G->r_ecx);
break;
case slang_asm_vec4_equal_int:
- x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, -4));
- x86_mov_reg_imm (&G->f, G->r_edx, 0x4000);
+ x86_lea(&G->f, G->r_esp, x86_make_disp(G->r_esp, -4));
+ x86_mov_reg_imm(&G->f, G->r_edx, 0x4000);
for (i = 0; i < 4; i++) {
- x87_fld (&G->f, x86_make_disp (G->r_esp, a->param[0] + 4 + i * 4));
- x87_fcomp (&G->f, x86_make_disp (G->r_esp, a->param[1] + 4 + i * 4));
- x87_fnstsw (&G->f, G->r_eax);
- x86_and (&G->f, G->r_edx, G->r_eax);
+ x87_fld(&G->f, x86_make_disp(G->r_esp, a->param[0] + 4 + i * 4));
+ x87_fcomp(&G->f, x86_make_disp(G->r_esp, a->param[1] + 4 + i * 4));
+ x87_fnstsw(&G->f, G->r_eax);
+ x86_and(&G->f, G->r_edx, G->r_eax);
}
/* TODO: use test r8,imm8 */
- x86_mov_reg_imm (&G->f, G->r_ecx, 0x4000);
- x86_test (&G->f, G->r_edx, G->r_ecx);
+ x86_mov_reg_imm(&G->f, G->r_ecx, 0x4000);
+ x86_test(&G->f, G->r_edx, G->r_ecx);
{
GLubyte *lab0, *lab1;
/* TODO: use jcc rel8 */
- lab0 = x86_jcc_forward (&G->f, cc_E);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ONE);
+ lab0 = x86_jcc_forward(&G->f, cc_E);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ONE);
/* TODO: use jmp rel8 */
- lab1 = x86_jmp_forward (&G->f);
- x86_fixup_fwd_jump (&G->f, lab0);
- x86_mov_reg_imm (&G->f, G->r_ecx, FLOAT_ZERO);
- x86_fixup_fwd_jump (&G->f, lab1);
- x86_mov (&G->f, x86_deref (G->r_esp), G->r_ecx);
+ lab1 = x86_jmp_forward(&G->f);
+ x86_fixup_fwd_jump(&G->f, lab0);
+ x86_mov_reg_imm(&G->f, G->r_ecx, FLOAT_ZERO);
+ x86_fixup_fwd_jump(&G->f, lab1);
+ x86_mov(&G->f, x86_deref(G->r_esp), G->r_ecx);
}
break;
default:
- assert (0);
+ _mesa_problem(NULL, "Unexpected switch case in codegen_assem");
}
}
-GLboolean _slang_x86_codegen (slang_machine *mach, slang_assembly_file *file, GLuint start)
+GLboolean
+_slang_x86_codegen(slang_machine * mach, slang_assembly_file * file,
+ GLuint start)
{
- codegen_ctx G;
- GLubyte *j_body, *j_exit;
- GLuint i;
+ codegen_ctx G;
+ GLubyte *j_body, *j_exit;
+ GLuint i;
/* Free the old code - if any.
*/
if (mach->x86.compiled_func != NULL) {
- _mesa_exec_free (mach->x86.compiled_func);
+ _mesa_exec_free(mach->x86.compiled_func);
mach->x86.compiled_func = NULL;
}
- /*
- * We need as much as 1M because *all* assembly, including built-in library, is
- * being translated to x86.
- * The built-in library occupies 450K, so we can be safe for now.
- * It is going to change in the future, when we get assembly analysis running.
- */
- x86_init_func_size (&G.f, 1048576);
- G.r_eax = x86_make_reg (file_REG32, reg_AX);
- G.r_ecx = x86_make_reg (file_REG32, reg_CX);
- G.r_edx = x86_make_reg (file_REG32, reg_DX);
- G.r_ebx = x86_make_reg (file_REG32, reg_BX);
- G.r_esp = x86_make_reg (file_REG32, reg_SP);
- G.r_ebp = x86_make_reg (file_REG32, reg_BP);
- G.r_st0 = x86_make_reg (file_x87, 0);
- G.r_st1 = x86_make_reg (file_x87, 1);
- G.r_st2 = x86_make_reg (file_x87, 2);
- G.r_st3 = x86_make_reg (file_x87, 3);
- G.r_st4 = x86_make_reg (file_x87, 4);
- G.fixups = NULL;
- G.fixup_count = 0;
- G.labels = (GLubyte **) slang_alloc_malloc (file->count * sizeof (GLubyte *));
- G.mach = mach;
- G.fpucntl = RESTORE_FPU;
-
- mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
- mach->x86.fpucntl_restore = RESTORE_FPU;
-
- /* prepare stack and jump to start */
- x86_push (&G.f, G.r_ebp);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
- x86_push (&G.f, G.r_esp);
- x86_pop (&G.f, G.r_ecx);
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
- j_body = x86_jmp_forward (&G.f);
-
- /* "discard" instructions jump to this label */
- G.l_discard = x86_get_label (&G.f);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);
- x86_mov_reg_imm (&G.f, G.r_ecx, 1);
- x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);
- G.l_exit = x86_get_label (&G.f);
- j_exit = x86_jmp_forward (&G.f);
-
- for (i = 0; i < file->count; i++)
- {
- G.labels[i] = x86_get_label (&G.f);
- if (i == start)
- x86_fixup_fwd_jump (&G.f, j_body);
- codegen_assem (&G, &file->code[i], &mach->infolog);
- }
-
- /*
- * Restore stack and return.
- * This must be handled this way, because "discard" can be invoked from any
- * place in the code.
- */
- x86_fixup_fwd_jump (&G.f, j_exit);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);
- x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));
- x86_pop (&G.f, G.r_ebp);
- if (G.fpucntl != RESTORE_FPU)
- {
- x87_fnclex (&G.f);
- x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->x86.fpucntl_restore);
- x87_fldcw (&G.f, x86_deref (G.r_eax));
- }
- x86_ret (&G.f);
-
- /* fixup forward labels */
- for (i = 0; i < G.fixup_count; i++)
- {
- G.f.csr = G.labels[G.fixups[i].index];
- x86_fixup_fwd_jump (&G.f, G.fixups[i].csr);
- }
-
- slang_alloc_free (G.fixups);
- slang_alloc_free (G.labels);
-
- /* install new code */
- mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);
-
- return GL_TRUE;
+ /*
+ * We need as much as 1M because *all* assembly, including built-in library, is
+ * being translated to x86.
+ * The built-in library occupies 450K, so we can be safe for now.
+ * It is going to change in the future, when we get assembly analysis running.
+ */
+ x86_init_func_size(&G.f, 1048576);
+ G.r_eax = x86_make_reg(file_REG32, reg_AX);
+ G.r_ecx = x86_make_reg(file_REG32, reg_CX);
+ G.r_edx = x86_make_reg(file_REG32, reg_DX);
+ G.r_ebx = x86_make_reg(file_REG32, reg_BX);
+ G.r_esp = x86_make_reg(file_REG32, reg_SP);
+ G.r_ebp = x86_make_reg(file_REG32, reg_BP);
+ G.r_st0 = x86_make_reg(file_x87, 0);
+ G.r_st1 = x86_make_reg(file_x87, 1);
+ G.r_st2 = x86_make_reg(file_x87, 2);
+ G.r_st3 = x86_make_reg(file_x87, 3);
+ G.r_st4 = x86_make_reg(file_x87, 4);
+ G.fixups = NULL;
+ G.fixup_count = 0;
+ G.labels =
+ (GLubyte **) slang_alloc_malloc(file->count * sizeof(GLubyte *));
+ G.mach = mach;
+ G.fpucntl = RESTORE_FPU;
+
+ mach->x86.fpucntl_rnd_neg = RND_NEG_FPU;
+ mach->x86.fpucntl_restore = RESTORE_FPU;
+
+ /* prepare stack and jump to start */
+ x86_push(&G.f, G.r_ebp);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore);
+ x86_push(&G.f, G.r_esp);
+ x86_pop(&G.f, G.r_ecx);
+ x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx);
+ j_body = x86_jmp_forward(&G.f);
+
+ /* "discard" instructions jump to this label */
+ G.l_discard = x86_get_label(&G.f);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->kill);
+ x86_mov_reg_imm(&G.f, G.r_ecx, 1);
+ x86_mov(&G.f, x86_deref(G.r_eax), G.r_ecx);
+ G.l_exit = x86_get_label(&G.f);
+ j_exit = x86_jmp_forward(&G.f);
+
+ for (i = 0; i < file->count; i++) {
+ G.labels[i] = x86_get_label(&G.f);
+ if (i == start)
+ x86_fixup_fwd_jump(&G.f, j_body);
+ codegen_assem(&G, &file->code[i], &mach->infolog);
+ }
+
+ /*
+ * Restore stack and return.
+ * This must be handled this way, because "discard" can be invoked from any
+ * place in the code.
+ */
+ x86_fixup_fwd_jump(&G.f, j_exit);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & mach->x86.esp_restore);
+ x86_mov(&G.f, G.r_esp, x86_deref(G.r_eax));
+ x86_pop(&G.f, G.r_ebp);
+ if (G.fpucntl != RESTORE_FPU) {
+ x87_fnclex(&G.f);
+ x86_mov_reg_imm(&G.f, G.r_eax, (GLint) & G.mach->x86.fpucntl_restore);
+ x87_fldcw(&G.f, x86_deref(G.r_eax));
+ }
+ x86_ret(&G.f);
+
+ /* fixup forward labels */
+ for (i = 0; i < G.fixup_count; i++) {
+ G.f.csr = G.labels[G.fixups[i].index];
+ x86_fixup_fwd_jump(&G.f, G.fixups[i].csr);
+ }
+
+ slang_alloc_free(G.fixups);
+ slang_alloc_free(G.labels);
+
+ /* install new code */
+ mach->x86.compiled_func = (GLvoid(*)(slang_machine *)) x86_get_func(&G.f);
+
+ return GL_TRUE;
}
#endif
-
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index 2195ec5bdfa..433964223a5 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.6
+ * Version: 6.5.2
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -38,13 +38,15 @@ enum
SLANG_SHADER_MAX
};
-/*
+
+/**
* Active variables.
*
- * Active uniforms/attribs can be queried by the application to get a list of
- * uniforms/attribs actually used by shaders (uniforms) or vertex shader only (attribs).
+ * Active uniforms/attribs can be queried by the application to get a
+ * list of uniforms/attribs actually used by shaders (uniforms) or
+ * vertex shader only (attribs).
*/
-
+/*@{*/
typedef struct
{
slang_export_data_quant *quant;
@@ -56,14 +58,17 @@ typedef struct
slang_active_variable *table;
GLuint count;
} slang_active_variables;
+/*@}*/
-/*
+
+/**
* Attrib binding override.
*
- * The application can override GL attrib binding by specifying its preferred index assignment
- * for a given attrib name. Those overrides are taken into account while linking the program.
+ * The application can override GL attrib binding by specifying its
+ * preferred index assignment for a given attrib name. Those overrides
+ * are taken into account while linking the program.
*/
-
+/*@{*/
typedef struct
{
GLuint index;
@@ -75,26 +80,33 @@ typedef struct
slang_attrib_override *table;
GLuint count;
} slang_attrib_overrides;
+/*@}*/
+
extern GLboolean
_slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *);
-/*
+
+/**
* Uniform bindings.
*
- * Each slang_uniform_binding holds an array of addresses to actual memory locations in those
- * shader types that use that uniform. Uniform bindings are held in an array and accessed
- * by array index which is seen to the application as a uniform location.
+ * Each slang_uniform_binding holds an array of addresses to actual
+ * memory locations in those shader types that use that
+ * uniform. Uniform bindings are held in an array and accessed by
+ * array index which is seen to the application as a uniform location.
*
- * When the application writes to a particular uniform, it specifies its location.
- * This location is treated as an array index to slang_uniform_bindings::table and tested
- * against slang_uniform_bindings::count limit. The result is a pointer to slang_uniform_binding.
- * The type of data being written to uniform is tested against slang_uniform_binding::quant.
- * If the types are compatible, the array slang_uniform_binding::address is iterated for
- * each shader type and if the address is valid (i.e. the uniform is used by this shader type),
- * the new uniform value is written at that address.
+ * When the application writes to a particular uniform, it specifies
+ * its location. This location is treated as an array index to
+ * slang_uniform_bindings::table and tested against
+ * slang_uniform_bindings::count limit. The result is a pointer to
+ * slang_uniform_binding. The type of data being written to uniform
+ * is tested against slang_uniform_binding::quant. If the types are
+ * compatible, the array slang_uniform_binding::address is iterated
+ * for each shader type and if the address is valid (i.e. the uniform
+ * is used by this shader type), the new uniform value is written at
+ * that address.
*/
-
+/*@{*/
typedef struct
{
slang_export_data_quant *quant;
@@ -107,16 +119,20 @@ typedef struct
slang_uniform_binding *table;
GLuint count;
} slang_uniform_bindings;
+/*@}*/
-/*
+
+/**
* Attrib bindings.
*
- * There is a fixed number of vertex attrib vectors (attrib slots). The slang_attrib_slot::addr
- * maps vertex attrib index to the actual memory location of the attrib in vertex shader.
- * One vertex attrib can span over many attrib slots (this is the case for matrices). The
- * slang_attrib_binding::first_slot_index holds the first slot index that the attrib is bound to.
+ * There is a fixed number of vertex attrib vectors (attrib
+ * slots). The slang_attrib_slot::addr maps vertex attrib index to the
+ * actual memory location of the attrib in vertex shader. One vertex
+ * attrib can span over many attrib slots (this is the case for
+ * matrices). The slang_attrib_binding::first_slot_index holds the
+ * first slot index that the attrib is bound to.
*/
-
+/*@{*/
typedef struct
{
slang_export_data_quant *quant;
@@ -126,8 +142,8 @@ typedef struct
typedef struct
{
- GLuint addr; /* memory location */
- GLuint fill; /* 1..4, number of components used */
+ GLuint addr; /**< memory location */
+ GLuint fill; /**< 1..4, number of components used */
} slang_attrib_slot;
typedef struct
@@ -136,16 +152,20 @@ typedef struct
GLuint binding_count;
slang_attrib_slot slots[MAX_VERTEX_ATTRIBS];
} slang_attrib_bindings;
+/*@}*/
-/*
+
+
+/**
* Varying bindings.
*
- * There is a fixed number of varying floats (varying slots). The slang_varying_slot::vert_addr
- * maps varying float index to the actual memory location of the output variable in vertex shader.
- * The slang_varying_slot::frag_addr maps varying float index to the actual memory location of
- * the input variable in fragment shader.
+ * There is a fixed number of varying floats (varying slots). The
+ * slang_varying_slot::vert_addr maps varying float index to the
+ * actual memory location of the output variable in vertex shader.
+ * The slang_varying_slot::frag_addr maps varying float index to the
+ * actual memory location of the input variable in fragment shader.
*/
-
+/*@{*/
typedef struct
{
GLuint vert_addr;
@@ -166,20 +186,25 @@ typedef struct
slang_varying_slot slots[MAX_VARYING_FLOATS];
GLuint slot_count;
} slang_varying_bindings;
+/*@}*/
-/*
+
+/**
* Texture usage.
*
- * A slang_texture_usage struct holds indirect information about texture image unit usage. The
- * slang_texture_usages::table is derived from active uniform table by extracting only uniforms
- * that are samplers.
+ * A slang_texture_usage struct holds indirect information about
+ * texture image unit usage. The slang_texture_usages::table is
+ * derived from active uniform table by extracting only uniforms that
+ * are samplers.
*
- * To collect current texture usage one must iterate the slang_texture_usages::table and read
- * uniform at address slang_texture_usage::frag_address to get texture unit index. This
- * index, coupled with texture access type (target) taken from slang_texture_usage::quant
- * forms texture usage for that texture unit.
+ * To collect current texture usage one must iterate the
+ * slang_texture_usages::table and read uniform at address
+ * slang_texture_usage::frag_address to get texture unit index. This
+ * index, coupled with texture access type (target) taken from
+ * slang_texture_usage::quant forms texture usage for that texture
+ * unit.
*/
-
+/*@{*/
typedef struct
{
slang_export_data_quant *quant;
@@ -191,6 +216,8 @@ typedef struct
slang_texture_usage *table;
GLuint count;
} slang_texture_usages;
+/*@}*/
+
extern GLvoid
_slang_texture_usages_ctr (slang_texture_usages *);
diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c
index 43aa9a1e95e..66a6a983927 100644
--- a/src/mesa/shader/slang/slang_preprocess.c
+++ b/src/mesa/shader/slang/slang_preprocess.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.6
+ * Version: 6.5.2
*
* Copyright (C) 2005-2006 Brian Paul All Rights Reserved.
*
@@ -32,15 +32,15 @@
#include "grammar_mesa.h"
#include "slang_preprocess.h"
-static const char *slang_pp_directives_syn =
+LONGSTRING static const char *slang_pp_directives_syn =
#include "library/slang_pp_directives_syn.h"
;
-static const char *slang_pp_expression_syn =
+LONGSTRING static const char *slang_pp_expression_syn =
#include "library/slang_pp_expression_syn.h"
;
-static const char *slang_pp_version_syn =
+LONGSTRING static const char *slang_pp_version_syn =
#include "library/slang_pp_version_syn.h"
;
diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c
index 54fcc8a2382..256d52455db 100644
--- a/src/mesa/shader/slang/slang_utility.c
+++ b/src/mesa/shader/slang/slang_utility.c
@@ -131,75 +131,92 @@ slang_string_cstr (slang_string *self)
/* slang_atom_pool */
-void slang_atom_pool_construct (slang_atom_pool *pool)
+void
+slang_atom_pool_construct(slang_atom_pool * pool)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
- pool->entries[i] = NULL;
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
+ pool->entries[i] = NULL;
}
-void slang_atom_pool_destruct (slang_atom_pool *pool)
+void
+slang_atom_pool_destruct (slang_atom_pool * pool)
{
- GLuint i;
+ GLuint i;
- for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++)
- {
- slang_atom_entry *entry;
+ for (i = 0; i < SLANG_ATOM_POOL_SIZE; i++) {
+ slang_atom_entry * entry;
- entry = pool->entries[i];
- while (entry != NULL)
- {
- slang_atom_entry *next;
-
- next = entry->next;
- slang_alloc_free (entry->id);
- slang_alloc_free (entry);
- entry = next;
+ entry = pool->entries[i];
+ while (entry != NULL) {
+ slang_atom_entry *next;
+
+ next = entry->next;
+ slang_alloc_free(entry->id);
+ slang_alloc_free(entry);
+ entry = next;
}
}
}
-slang_atom slang_atom_pool_atom (slang_atom_pool *pool, const char *id)
+/*
+ * Search the atom pool for an atom with a given name.
+ * If atom is not found, create and add it to the pool.
+ * Returns ATOM_NULL if the atom was not found and the function failed to create a new atom.
+ */
+slang_atom
+slang_atom_pool_atom(slang_atom_pool * pool, const char * id)
{
- GLuint hash;
- const char *p = id;
- slang_atom_entry **entry;
-
- hash = 0;
- while (*p != '\0')
- {
- GLuint g;
-
- hash = (hash << 4) + (GLuint) *p++;
- g = hash & 0xf0000000;
- if (g != 0)
- hash ^= g >> 24;
- hash &= ~g;
- }
- hash %= SLANG_ATOM_POOL_SIZE;
-
- entry = &pool->entries[hash];
- while (*entry != NULL)
- {
- if (slang_string_compare ((**entry).id, id) == 0)
- return (slang_atom) (**entry).id;
- entry = &(**entry).next;
- }
-
- *entry = (slang_atom_entry *) slang_alloc_malloc (sizeof (slang_atom_entry));
- if (*entry == NULL)
- return SLANG_ATOM_NULL;
+ GLuint hash;
+ const char * p = id;
+ slang_atom_entry ** entry;
+
+ /* Hash a given string to a number in the range [0, ATOM_POOL_SIZE). */
+ hash = 0;
+ while (*p != '\0') {
+ GLuint g;
+
+ hash = (hash << 4) + (GLuint) (*p++);
+ g = hash & 0xf0000000;
+ if (g != 0)
+ hash ^= g >> 24;
+ hash &= ~g;
+ }
+ hash %= SLANG_ATOM_POOL_SIZE;
+
+ /* Now the hash points to a linked list of atoms with names that have the same hash value.
+ * Search the linked list for a given name. */
+ entry = &pool->entries[hash];
+ while (*entry != NULL) {
+ /* If the same, return the associated atom. */
+ if (slang_string_compare((**entry).id, id) == 0)
+ return (slang_atom) (**entry).id;
+ /* Grab the next atom in the linked list. */
+ entry = &(**entry).next;
+ }
- (**entry).next = NULL;
- (**entry).id = slang_string_duplicate (id);
- if ((**entry).id == NULL)
- return SLANG_ATOM_NULL;
- return (slang_atom) (**entry).id;
+ /* Okay, we have not found an atom. Create a new entry for it.
+ * Note that the <entry> points to the last entry's <next> field. */
+ *entry = (slang_atom_entry *) (slang_alloc_malloc(sizeof(slang_atom_entry)));
+ if (*entry == NULL)
+ return SLANG_ATOM_NULL;
+
+ /* Initialize a new entry. Because we'll need the actual name of the atom, we use the pointer
+ * to this string as an actual atom's value. */
+ (**entry).next = NULL;
+ (**entry).id = slang_string_duplicate(id);
+ if ((**entry).id == NULL)
+ return SLANG_ATOM_NULL;
+ return (slang_atom) (**entry).id;
}
-const char *slang_atom_pool_id (slang_atom_pool *pool, slang_atom atom)
+/*
+ * Return the name of a given atom.
+ */
+const char *
+slang_atom_pool_id(slang_atom_pool * pool, slang_atom atom)
{
- return (const char *) atom;
+ return (const char *) (atom);
}
diff --git a/src/mesa/shader/slang/sources b/src/mesa/shader/slang/sources
index f03f1ed187a..00d617fa8af 100644
--- a/src/mesa/shader/slang/sources
+++ b/src/mesa/shader/slang/sources
@@ -19,3 +19,26 @@ slang_link.c \
slang_preprocess.c \
slang_storage.c \
slang_utility.c
+
+MESA_SHADER_SLANG_HEADERS = \
+slang_analyse.h \
+slang_assemble.h \
+slang_assemble_assignment.h \
+slang_assemble_conditional.h \
+slang_assemble_constructor.h \
+slang_assemble_typeinfo.h \
+slang_compile.h \
+slang_compile_function.h \
+slang_compile_operation.h \
+slang_compile_struct.h \
+slang_compile_variable.h \
+slang_execute.h \
+slang_export.h \
+slang_library_noise.h \
+slang_library_texsample.h \
+slang_link.h \
+slang_mesa.h \
+slang_preprocess.h \
+slang_storage.h \
+slang_utility.h \
+traverse_wrap.h
diff --git a/src/mesa/shader/sources b/src/mesa/shader/sources
index 573be89b9ab..27871872766 100644
--- a/src/mesa/shader/sources
+++ b/src/mesa/shader/sources
@@ -1,4 +1,4 @@
-# List of ource files in this directory used for X.org xserver build
+# List of source files in this directory used for X.org xserver build
MESA_SHADER_SOURCES = \
arbprogparse.c \
arbprogram.c \
@@ -11,3 +11,18 @@ program.c \
programopt.c \
shaderobjects.c \
shaderobjects_3dlabs.c
+
+MESA_SHADER_HEADERS = \
+arbprogparse.h \
+arbprogram.h \
+arbprogram_syn.h \
+atifragshader.h \
+nvfragparse.h \
+nvprogram.h \
+nvvertexec.h \
+nvvertparse.h \
+programopt.h \
+program.h \
+program_instruction.h \
+shaderobjects.h \
+shaderobjects_3dlabs.h
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index b3fbb5bf720..c2a8ca6154d 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -473,9 +473,28 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function
.globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function
.globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function
+ .globl glAttachShader ; .type glAttachShader,#function
+ .globl glCreateProgram ; .type glCreateProgram,#function
+ .globl glCreateShader ; .type glCreateShader,#function
+ .globl glDeleteProgram ; .type glDeleteProgram,#function
+ .globl glDeleteShader ; .type glDeleteShader,#function
+ .globl glDetachShader ; .type glDetachShader,#function
+ .globl glGetAttachedShaders ; .type glGetAttachedShaders,#function
+ .globl glGetProgramInfoLog ; .type glGetProgramInfoLog,#function
+ .globl glGetProgramiv ; .type glGetProgramiv,#function
+ .globl glGetShaderInfoLog ; .type glGetShaderInfoLog,#function
+ .globl glGetShaderiv ; .type glGetShaderiv,#function
+ .globl glIsProgram ; .type glIsProgram,#function
+ .globl glIsShader ; .type glIsShader,#function
.globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function
.globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function
.globl glStencilOpSeparate ; .type glStencilOpSeparate,#function
+ .globl glUniformMatrix2x3fv ; .type glUniformMatrix2x3fv,#function
+ .globl glUniformMatrix2x4fv ; .type glUniformMatrix2x4fv,#function
+ .globl glUniformMatrix3x2fv ; .type glUniformMatrix3x2fv,#function
+ .globl glUniformMatrix3x4fv ; .type glUniformMatrix3x4fv,#function
+ .globl glUniformMatrix4x2fv ; .type glUniformMatrix4x2fv,#function
+ .globl glUniformMatrix4x3fv ; .type glUniformMatrix4x3fv,#function
.globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function
.globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function
.globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function
@@ -608,14 +627,14 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function
.globl glDrawBuffersARB ; .type glDrawBuffersARB,#function
.globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function
- .globl gl_dispatch_stub_543 ; .type gl_dispatch_stub_543,#function
- .globl gl_dispatch_stub_544 ; .type gl_dispatch_stub_544,#function
- .globl gl_dispatch_stub_545 ; .type gl_dispatch_stub_545,#function
- .globl gl_dispatch_stub_546 ; .type gl_dispatch_stub_546,#function
- .globl gl_dispatch_stub_547 ; .type gl_dispatch_stub_547,#function
- .globl gl_dispatch_stub_548 ; .type gl_dispatch_stub_548,#function
- .globl gl_dispatch_stub_549 ; .type gl_dispatch_stub_549,#function
- .globl gl_dispatch_stub_550 ; .type gl_dispatch_stub_550,#function
+ .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function
+ .globl gl_dispatch_stub_563 ; .type gl_dispatch_stub_563,#function
+ .globl gl_dispatch_stub_564 ; .type gl_dispatch_stub_564,#function
+ .globl gl_dispatch_stub_565 ; .type gl_dispatch_stub_565,#function
+ .globl gl_dispatch_stub_566 ; .type gl_dispatch_stub_566,#function
+ .globl gl_dispatch_stub_567 ; .type gl_dispatch_stub_567,#function
+ .globl gl_dispatch_stub_568 ; .type gl_dispatch_stub_568,#function
+ .globl gl_dispatch_stub_569 ; .type gl_dispatch_stub_569,#function
.globl glColorPointerEXT ; .type glColorPointerEXT,#function
.globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function
.globl glIndexPointerEXT ; .type glIndexPointerEXT,#function
@@ -626,8 +645,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function
.globl glLockArraysEXT ; .type glLockArraysEXT,#function
.globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function
- .globl gl_dispatch_stub_561 ; .type gl_dispatch_stub_561,#function
- .globl gl_dispatch_stub_562 ; .type gl_dispatch_stub_562,#function
+ .globl gl_dispatch_stub_580 ; .type gl_dispatch_stub_580,#function
+ .globl gl_dispatch_stub_581 ; .type gl_dispatch_stub_581,#function
.globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function
.globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function
.globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function
@@ -652,7 +671,7 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function
.globl glFogCoordfEXT ; .type glFogCoordfEXT,#function
.globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function
- .globl gl_dispatch_stub_587 ; .type gl_dispatch_stub_587,#function
+ .globl gl_dispatch_stub_606 ; .type gl_dispatch_stub_606,#function
.globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function
.globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function
.globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function
@@ -694,15 +713,15 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function
.globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function
.globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function
- .globl gl_dispatch_stub_629 ; .type gl_dispatch_stub_629,#function
- .globl gl_dispatch_stub_630 ; .type gl_dispatch_stub_630,#function
- .globl gl_dispatch_stub_631 ; .type gl_dispatch_stub_631,#function
- .globl gl_dispatch_stub_632 ; .type gl_dispatch_stub_632,#function
- .globl gl_dispatch_stub_633 ; .type gl_dispatch_stub_633,#function
- .globl gl_dispatch_stub_634 ; .type gl_dispatch_stub_634,#function
- .globl gl_dispatch_stub_635 ; .type gl_dispatch_stub_635,#function
- .globl gl_dispatch_stub_636 ; .type gl_dispatch_stub_636,#function
- .globl gl_dispatch_stub_637 ; .type gl_dispatch_stub_637,#function
+ .globl gl_dispatch_stub_648 ; .type gl_dispatch_stub_648,#function
+ .globl gl_dispatch_stub_649 ; .type gl_dispatch_stub_649,#function
+ .globl gl_dispatch_stub_650 ; .type gl_dispatch_stub_650,#function
+ .globl gl_dispatch_stub_651 ; .type gl_dispatch_stub_651,#function
+ .globl gl_dispatch_stub_652 ; .type gl_dispatch_stub_652,#function
+ .globl gl_dispatch_stub_653 ; .type gl_dispatch_stub_653,#function
+ .globl gl_dispatch_stub_654 ; .type gl_dispatch_stub_654,#function
+ .globl gl_dispatch_stub_655 ; .type gl_dispatch_stub_655,#function
+ .globl gl_dispatch_stub_656 ; .type gl_dispatch_stub_656,#function
.globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function
.globl glBindProgramNV ; .type glBindProgramNV,#function
.globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function
@@ -783,19 +802,19 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
.globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function
.globl glPointParameteriNV ; .type glPointParameteriNV,#function
.globl glPointParameterivNV ; .type glPointParameterivNV,#function
- .globl gl_dispatch_stub_718 ; .type gl_dispatch_stub_718,#function
- .globl gl_dispatch_stub_719 ; .type gl_dispatch_stub_719,#function
- .globl gl_dispatch_stub_720 ; .type gl_dispatch_stub_720,#function
- .globl gl_dispatch_stub_721 ; .type gl_dispatch_stub_721,#function
- .globl gl_dispatch_stub_722 ; .type gl_dispatch_stub_722,#function
+ .globl gl_dispatch_stub_737 ; .type gl_dispatch_stub_737,#function
+ .globl gl_dispatch_stub_738 ; .type gl_dispatch_stub_738,#function
+ .globl gl_dispatch_stub_739 ; .type gl_dispatch_stub_739,#function
+ .globl gl_dispatch_stub_740 ; .type gl_dispatch_stub_740,#function
+ .globl gl_dispatch_stub_741 ; .type gl_dispatch_stub_741,#function
.globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function
.globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function
.globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function
.globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function
.globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function
.globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function
- .globl gl_dispatch_stub_729 ; .type gl_dispatch_stub_729,#function
- .globl gl_dispatch_stub_730 ; .type gl_dispatch_stub_730,#function
+ .globl gl_dispatch_stub_748 ; .type gl_dispatch_stub_748,#function
+ .globl gl_dispatch_stub_749 ; .type gl_dispatch_stub_749,#function
.globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function
.globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function
.globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function
@@ -813,11 +832,11 @@ __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_748 ; .type gl_dispatch_stub_748,#function
- .globl gl_dispatch_stub_749 ; .type gl_dispatch_stub_749,#function
- .globl gl_dispatch_stub_750 ; .type gl_dispatch_stub_750,#function
- .globl gl_dispatch_stub_751 ; .type gl_dispatch_stub_751,#function
- .globl gl_dispatch_stub_752 ; .type gl_dispatch_stub_752,#function
+ .globl gl_dispatch_stub_767 ; .type gl_dispatch_stub_767,#function
+ .globl gl_dispatch_stub_768 ; .type gl_dispatch_stub_768,#function
+ .globl gl_dispatch_stub_769 ; .type gl_dispatch_stub_769,#function
+ .globl gl_dispatch_stub_770 ; .type gl_dispatch_stub_770,#function
+ .globl gl_dispatch_stub_771 ; .type gl_dispatch_stub_771,#function
.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
_mesa_sparc_glapi_begin:
@@ -1229,9 +1248,28 @@ _mesa_sparc_glapi_begin:
GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB)
GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB)
GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB)
+ GL_STUB(glAttachShader, _gloffset_AttachShader)
+ GL_STUB(glCreateProgram, _gloffset_CreateProgram)
+ GL_STUB(glCreateShader, _gloffset_CreateShader)
+ GL_STUB(glDeleteProgram, _gloffset_DeleteProgram)
+ GL_STUB(glDeleteShader, _gloffset_DeleteShader)
+ GL_STUB(glDetachShader, _gloffset_DetachShader)
+ GL_STUB(glGetAttachedShaders, _gloffset_GetAttachedShaders)
+ GL_STUB(glGetProgramInfoLog, _gloffset_GetProgramInfoLog)
+ GL_STUB(glGetProgramiv, _gloffset_GetProgramiv)
+ GL_STUB(glGetShaderInfoLog, _gloffset_GetShaderInfoLog)
+ GL_STUB(glGetShaderiv, _gloffset_GetShaderiv)
+ GL_STUB(glIsProgram, _gloffset_IsProgram)
+ GL_STUB(glIsShader, _gloffset_IsShader)
GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate)
GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate)
GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate)
+ GL_STUB(glUniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv)
+ GL_STUB(glUniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv)
+ GL_STUB(glUniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv)
+ GL_STUB(glUniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv)
+ GL_STUB(glUniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv)
+ GL_STUB(glUniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv)
GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB)
GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB)
GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB)
@@ -1364,14 +1402,14 @@ _mesa_sparc_glapi_begin:
GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB)
GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB)
GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT)
- GL_STUB(gl_dispatch_stub_543, _gloffset__dispatch_stub_543)
- GL_STUB(gl_dispatch_stub_544, _gloffset__dispatch_stub_544)
- GL_STUB(gl_dispatch_stub_545, _gloffset__dispatch_stub_545)
- GL_STUB(gl_dispatch_stub_546, _gloffset__dispatch_stub_546)
- GL_STUB(gl_dispatch_stub_547, _gloffset__dispatch_stub_547)
- GL_STUB(gl_dispatch_stub_548, _gloffset__dispatch_stub_548)
- GL_STUB(gl_dispatch_stub_549, _gloffset__dispatch_stub_549)
- GL_STUB(gl_dispatch_stub_550, _gloffset__dispatch_stub_550)
+ GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562)
+ GL_STUB(gl_dispatch_stub_563, _gloffset__dispatch_stub_563)
+ GL_STUB(gl_dispatch_stub_564, _gloffset__dispatch_stub_564)
+ GL_STUB(gl_dispatch_stub_565, _gloffset__dispatch_stub_565)
+ GL_STUB(gl_dispatch_stub_566, _gloffset__dispatch_stub_566)
+ GL_STUB(gl_dispatch_stub_567, _gloffset__dispatch_stub_567)
+ GL_STUB(gl_dispatch_stub_568, _gloffset__dispatch_stub_568)
+ GL_STUB(gl_dispatch_stub_569, _gloffset__dispatch_stub_569)
GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT)
GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT)
GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT)
@@ -1382,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_561, _gloffset__dispatch_stub_561)
- GL_STUB(gl_dispatch_stub_562, _gloffset__dispatch_stub_562)
+ GL_STUB(gl_dispatch_stub_580, _gloffset__dispatch_stub_580)
+ GL_STUB(gl_dispatch_stub_581, _gloffset__dispatch_stub_581)
GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT)
GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT)
GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT)
@@ -1408,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_587, _gloffset__dispatch_stub_587)
+ GL_STUB(gl_dispatch_stub_606, _gloffset__dispatch_stub_606)
GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT)
GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV)
GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV)
@@ -1450,15 +1488,15 @@ _mesa_sparc_glapi_begin:
GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA)
GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA)
GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA)
- GL_STUB(gl_dispatch_stub_629, _gloffset__dispatch_stub_629)
- GL_STUB(gl_dispatch_stub_630, _gloffset__dispatch_stub_630)
- GL_STUB(gl_dispatch_stub_631, _gloffset__dispatch_stub_631)
- GL_STUB(gl_dispatch_stub_632, _gloffset__dispatch_stub_632)
- GL_STUB(gl_dispatch_stub_633, _gloffset__dispatch_stub_633)
- GL_STUB(gl_dispatch_stub_634, _gloffset__dispatch_stub_634)
- GL_STUB(gl_dispatch_stub_635, _gloffset__dispatch_stub_635)
- GL_STUB(gl_dispatch_stub_636, _gloffset__dispatch_stub_636)
- GL_STUB(gl_dispatch_stub_637, _gloffset__dispatch_stub_637)
+ GL_STUB(gl_dispatch_stub_648, _gloffset__dispatch_stub_648)
+ GL_STUB(gl_dispatch_stub_649, _gloffset__dispatch_stub_649)
+ GL_STUB(gl_dispatch_stub_650, _gloffset__dispatch_stub_650)
+ GL_STUB(gl_dispatch_stub_651, _gloffset__dispatch_stub_651)
+ GL_STUB(gl_dispatch_stub_652, _gloffset__dispatch_stub_652)
+ GL_STUB(gl_dispatch_stub_653, _gloffset__dispatch_stub_653)
+ GL_STUB(gl_dispatch_stub_654, _gloffset__dispatch_stub_654)
+ GL_STUB(gl_dispatch_stub_655, _gloffset__dispatch_stub_655)
+ GL_STUB(gl_dispatch_stub_656, _gloffset__dispatch_stub_656)
GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV)
GL_STUB(glBindProgramNV, _gloffset_BindProgramNV)
GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV)
@@ -1539,19 +1577,19 @@ _mesa_sparc_glapi_begin:
GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI)
GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV)
GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV)
- GL_STUB(gl_dispatch_stub_718, _gloffset__dispatch_stub_718)
- GL_STUB(gl_dispatch_stub_719, _gloffset__dispatch_stub_719)
- GL_STUB(gl_dispatch_stub_720, _gloffset__dispatch_stub_720)
- GL_STUB(gl_dispatch_stub_721, _gloffset__dispatch_stub_721)
- GL_STUB(gl_dispatch_stub_722, _gloffset__dispatch_stub_722)
+ GL_STUB(gl_dispatch_stub_737, _gloffset__dispatch_stub_737)
+ GL_STUB(gl_dispatch_stub_738, _gloffset__dispatch_stub_738)
+ GL_STUB(gl_dispatch_stub_739, _gloffset__dispatch_stub_739)
+ GL_STUB(gl_dispatch_stub_740, _gloffset__dispatch_stub_740)
+ GL_STUB(gl_dispatch_stub_741, _gloffset__dispatch_stub_741)
GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV)
GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV)
GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV)
GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV)
GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV)
GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV)
- GL_STUB(gl_dispatch_stub_729, _gloffset__dispatch_stub_729)
- GL_STUB(gl_dispatch_stub_730, _gloffset__dispatch_stub_730)
+ GL_STUB(gl_dispatch_stub_748, _gloffset__dispatch_stub_748)
+ GL_STUB(gl_dispatch_stub_749, _gloffset__dispatch_stub_749)
GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT)
GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT)
GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT)
@@ -1569,11 +1607,11 @@ _mesa_sparc_glapi_begin:
GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT)
GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT)
GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT)
- GL_STUB(gl_dispatch_stub_748, _gloffset__dispatch_stub_748)
- GL_STUB(gl_dispatch_stub_749, _gloffset__dispatch_stub_749)
- GL_STUB(gl_dispatch_stub_750, _gloffset__dispatch_stub_750)
- GL_STUB(gl_dispatch_stub_751, _gloffset__dispatch_stub_751)
- GL_STUB(gl_dispatch_stub_752, _gloffset__dispatch_stub_752)
+ GL_STUB(gl_dispatch_stub_767, _gloffset__dispatch_stub_767)
+ GL_STUB(gl_dispatch_stub_768, _gloffset__dispatch_stub_768)
+ GL_STUB(gl_dispatch_stub_769, _gloffset__dispatch_stub_769)
+ GL_STUB(gl_dispatch_stub_770, _gloffset__dispatch_stub_770)
+ GL_STUB(gl_dispatch_stub_771, _gloffset__dispatch_stub_771)
.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
_mesa_sparc_glapi_end:
@@ -1663,6 +1701,43 @@ _mesa_sparc_glapi_end:
.globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB
.globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB
.globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB
+ .globl glDisableVertexAttribArray ; .type glDisableVertexAttribArray,#function ; glDisableVertexAttribArray = glDisableVertexAttribArrayARB
+ .globl glEnableVertexAttribArray ; .type glEnableVertexAttribArray,#function ; glEnableVertexAttribArray = glEnableVertexAttribArrayARB
+ .globl glGetVertexAttribdv ; .type glGetVertexAttribdv,#function ; glGetVertexAttribdv = glGetVertexAttribdvARB
+ .globl glGetVertexAttribfv ; .type glGetVertexAttribfv,#function ; glGetVertexAttribfv = glGetVertexAttribfvARB
+ .globl glGetVertexAttribiv ; .type glGetVertexAttribiv,#function ; glGetVertexAttribiv = glGetVertexAttribivARB
+ .globl glVertexAttrib1d ; .type glVertexAttrib1d,#function ; glVertexAttrib1d = glVertexAttrib1dARB
+ .globl glVertexAttrib1dv ; .type glVertexAttrib1dv,#function ; glVertexAttrib1dv = glVertexAttrib1dvARB
+ .globl glVertexAttrib1f ; .type glVertexAttrib1f,#function ; glVertexAttrib1f = glVertexAttrib1fARB
+ .globl glVertexAttrib1fv ; .type glVertexAttrib1fv,#function ; glVertexAttrib1fv = glVertexAttrib1fvARB
+ .globl glVertexAttrib1s ; .type glVertexAttrib1s,#function ; glVertexAttrib1s = glVertexAttrib1sARB
+ .globl glVertexAttrib1sv ; .type glVertexAttrib1sv,#function ; glVertexAttrib1sv = glVertexAttrib1svARB
+ .globl glVertexAttrib2d ; .type glVertexAttrib2d,#function ; glVertexAttrib2d = glVertexAttrib2dARB
+ .globl glVertexAttrib2dv ; .type glVertexAttrib2dv,#function ; glVertexAttrib2dv = glVertexAttrib2dvARB
+ .globl glVertexAttrib2f ; .type glVertexAttrib2f,#function ; glVertexAttrib2f = glVertexAttrib2fARB
+ .globl glVertexAttrib2fv ; .type glVertexAttrib2fv,#function ; glVertexAttrib2fv = glVertexAttrib2fvARB
+ .globl glVertexAttrib2s ; .type glVertexAttrib2s,#function ; glVertexAttrib2s = glVertexAttrib2sARB
+ .globl glVertexAttrib2sv ; .type glVertexAttrib2sv,#function ; glVertexAttrib2sv = glVertexAttrib2svARB
+ .globl glVertexAttrib3d ; .type glVertexAttrib3d,#function ; glVertexAttrib3d = glVertexAttrib3dARB
+ .globl glVertexAttrib3dv ; .type glVertexAttrib3dv,#function ; glVertexAttrib3dv = glVertexAttrib3dvARB
+ .globl glVertexAttrib3f ; .type glVertexAttrib3f,#function ; glVertexAttrib3f = glVertexAttrib3fARB
+ .globl glVertexAttrib3fv ; .type glVertexAttrib3fv,#function ; glVertexAttrib3fv = glVertexAttrib3fvARB
+ .globl glVertexAttrib3s ; .type glVertexAttrib3s,#function ; glVertexAttrib3s = glVertexAttrib3sARB
+ .globl glVertexAttrib3sv ; .type glVertexAttrib3sv,#function ; glVertexAttrib3sv = glVertexAttrib3svARB
+ .globl glVertexAttrib4Nbv ; .type glVertexAttrib4Nbv,#function ; glVertexAttrib4Nbv = glVertexAttrib4NbvARB
+ .globl glVertexAttrib4Niv ; .type glVertexAttrib4Niv,#function ; glVertexAttrib4Niv = glVertexAttrib4NivARB
+ .globl glVertexAttrib4Nsv ; .type glVertexAttrib4Nsv,#function ; glVertexAttrib4Nsv = glVertexAttrib4NsvARB
+ .globl glVertexAttrib4Nub ; .type glVertexAttrib4Nub,#function ; glVertexAttrib4Nub = glVertexAttrib4NubARB
+ .globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB
+ .globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB
+ .globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB
+ .globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB
+ .globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB
+ .globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB
+ .globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB
+ .globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB
+ .globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB
+ .globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB
.globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB
.globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB
.globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB
@@ -1682,6 +1757,38 @@ _mesa_sparc_glapi_end:
.globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB
.globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB
.globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB
+ .globl glCompileShader ; .type glCompileShader,#function ; glCompileShader = glCompileShaderARB
+ .globl glGetActiveUniform ; .type glGetActiveUniform,#function ; glGetActiveUniform = glGetActiveUniformARB
+ .globl glGetShaderSource ; .type glGetShaderSource,#function ; glGetShaderSource = glGetShaderSourceARB
+ .globl glGetUniformLocation ; .type glGetUniformLocation,#function ; glGetUniformLocation = glGetUniformLocationARB
+ .globl glGetUniformfv ; .type glGetUniformfv,#function ; glGetUniformfv = glGetUniformfvARB
+ .globl glGetUniformiv ; .type glGetUniformiv,#function ; glGetUniformiv = glGetUniformivARB
+ .globl glLinkProgram ; .type glLinkProgram,#function ; glLinkProgram = glLinkProgramARB
+ .globl glShaderSource ; .type glShaderSource,#function ; glShaderSource = glShaderSourceARB
+ .globl glUniform1f ; .type glUniform1f,#function ; glUniform1f = glUniform1fARB
+ .globl glUniform1fv ; .type glUniform1fv,#function ; glUniform1fv = glUniform1fvARB
+ .globl glUniform1i ; .type glUniform1i,#function ; glUniform1i = glUniform1iARB
+ .globl glUniform1iv ; .type glUniform1iv,#function ; glUniform1iv = glUniform1ivARB
+ .globl glUniform2f ; .type glUniform2f,#function ; glUniform2f = glUniform2fARB
+ .globl glUniform2fv ; .type glUniform2fv,#function ; glUniform2fv = glUniform2fvARB
+ .globl glUniform2i ; .type glUniform2i,#function ; glUniform2i = glUniform2iARB
+ .globl glUniform2iv ; .type glUniform2iv,#function ; glUniform2iv = glUniform2ivARB
+ .globl glUniform3f ; .type glUniform3f,#function ; glUniform3f = glUniform3fARB
+ .globl glUniform3fv ; .type glUniform3fv,#function ; glUniform3fv = glUniform3fvARB
+ .globl glUniform3i ; .type glUniform3i,#function ; glUniform3i = glUniform3iARB
+ .globl glUniform3iv ; .type glUniform3iv,#function ; glUniform3iv = glUniform3ivARB
+ .globl glUniform4f ; .type glUniform4f,#function ; glUniform4f = glUniform4fARB
+ .globl glUniform4fv ; .type glUniform4fv,#function ; glUniform4fv = glUniform4fvARB
+ .globl glUniform4i ; .type glUniform4i,#function ; glUniform4i = glUniform4iARB
+ .globl glUniform4iv ; .type glUniform4iv,#function ; glUniform4iv = glUniform4ivARB
+ .globl glUniformMatrix2fv ; .type glUniformMatrix2fv,#function ; glUniformMatrix2fv = glUniformMatrix2fvARB
+ .globl glUniformMatrix3fv ; .type glUniformMatrix3fv,#function ; glUniformMatrix3fv = glUniformMatrix3fvARB
+ .globl glUniformMatrix4fv ; .type glUniformMatrix4fv,#function ; glUniformMatrix4fv = glUniformMatrix4fvARB
+ .globl glUseProgram ; .type glUseProgram,#function ; glUseProgram = glUseProgramObjectARB
+ .globl glValidateProgram ; .type glValidateProgram,#function ; glValidateProgram = glValidateProgramARB
+ .globl glBindAttribLocation ; .type glBindAttribLocation,#function ; glBindAttribLocation = glBindAttribLocationARB
+ .globl glGetActiveAttrib ; .type glGetActiveAttrib,#function ; glGetActiveAttrib = glGetActiveAttribARB
+ .globl glGetAttribLocation ; .type glGetAttribLocation,#function ; glGetAttribLocation = glGetAttribLocationARB
.globl glDrawBuffers ; .type glDrawBuffers,#function ; glDrawBuffers = glDrawBuffersARB
.globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB
.globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT
diff --git a/src/mesa/swrast/s_arbshader.c b/src/mesa/swrast/s_arbshader.c
index ee971a36ecc..356e43c8198 100644
--- a/src/mesa/swrast/s_arbshader.c
+++ b/src/mesa/swrast/s_arbshader.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.6
+ * Version: 6.5.3
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -103,18 +103,20 @@ _swrast_exec_arbshader(GLcontext *ctx, SWspan *span)
span->writeAll = GL_FALSE;
}
else {
+ GLboolean zWritten = GL_FALSE; /* temp hack (bug 9345) */
(**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOLOR,
vec, 0, 4 * sizeof(GLfloat), GL_FALSE);
COPY_4V(span->array->color.sz4.rgba[i], vec);
-
- (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGDEPTH, vec, 0,
- sizeof (GLfloat), GL_FALSE);
- if (vec[0] <= 0.0f)
- span->array->z[i] = 0;
- else if (vec[0] >= 1.0f)
- span->array->z[i] = ctx->DrawBuffer->_DepthMax;
- else
- span->array->z[i] = IROUND(vec[0] * ctx->DrawBuffer->_DepthMaxF);
+ if (zWritten) {
+ (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGDEPTH,
+ vec, 0, sizeof (GLfloat), GL_FALSE);
+ if (vec[0] <= 0.0f)
+ span->array->z[i] = 0;
+ else if (vec[0] >= 1.0f)
+ span->array->z[i] = ctx->DrawBuffer->_DepthMax;
+ else
+ span->array->z[i] = IROUND(vec[0] * ctx->DrawBuffer->_DepthMaxF);
+ }
}
}
}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 62cf6f2f5ae..d4b8080ddc9 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.3
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -201,7 +201,10 @@ _swrast_update_fog_state( GLcontext *ctx )
/* determine if fog is needed, and if so, which fog mode */
swrast->_FogEnabled = GL_FALSE;
- if (ctx->FragmentProgram._Enabled) {
+ if (ctx->ShaderObjects._FragmentShaderPresent) {
+ swrast->_FogEnabled = GL_FALSE;
+ }
+ else if (ctx->FragmentProgram._Enabled) {
if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) {
const struct gl_fragment_program *fp
= ctx->FragmentProgram._Current;
@@ -227,7 +230,12 @@ _swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState)
{
if (ctx->FragmentProgram._Enabled) {
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+#if 0
+ /* XXX Need a way to trigger the initial loading of parameters
+ * even when there's no recent state changes.
+ */
if (fp->Base.Parameters->StateFlags & newState)
+#endif
_mesa_load_state_parameters(ctx, fp->Base.Parameters);
}
}
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index f5b2d95653f..8b3918511d1 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -80,14 +80,15 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
GLint numPixels;
GLint xstep, ystep;
#if defined(DEPTH_TYPE)
- const GLint depthBits = ctx->Visual.depthBits;
+ const GLint depthBits = ctx->DrawBuffer->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
struct gl_renderbuffer *zrb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
#define FixedToDepth(F) ((F) >> fixedToDepthShift)
GLint zPtrXstep, zPtrYstep;
DEPTH_TYPE *zPtr;
#elif defined(INTERP_Z)
- const GLint depthBits = ctx->Visual.depthBits;
+ const GLint depthBits = ctx->DrawBuffer->Visual.depthBits;
+/*ctx->Visual.depthBits;*/
#endif
#ifdef PIXEL_ADDRESS
PIXEL_TYPE *pixelPtr;
@@ -268,7 +269,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
}
else {
/* don't use fixed point */
- span.z = (GLint) vert0->win[2];
+ span.z = (GLuint) vert0->win[2];
span.zStep = (GLint) ((vert1->win[2] - vert0->win[2]) / numPixels);
}
}
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 7a6785b1d29..028ddc0090d 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -57,6 +57,9 @@ struct fp_machine
GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4];
GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4];
GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */
+
+ GLuint CallStack[MAX_PROGRAM_CALL_DEPTH]; /**< For CAL/RET instructions */
+ GLuint StackDepth; /**< Index/ptr to top of CallStack[] */
};
@@ -697,6 +700,37 @@ execute_program( GLcontext *ctx,
}
}
break;
+ case OPCODE_BRA: /* conditional branch */
+ {
+ /* NOTE: The return is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ /* take branch */
+ pc = inst->BranchTarget;
+ }
+ }
+ break;
+ case OPCODE_CAL: /* Call subroutine */
+ {
+ /* NOTE: The call is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ if (machine->StackDepth >= MAX_PROGRAM_CALL_DEPTH) {
+ return GL_TRUE; /* Per GL_NV_vertex_program2 spec */
+ }
+ machine->CallStack[machine->StackDepth++] = pc + 1;
+ pc = inst->BranchTarget;
+ }
+ }
+ break;
case OPCODE_CMP:
{
GLfloat a[4], b[4], c[4], result[4];
@@ -1093,6 +1127,22 @@ execute_program( GLcontext *ctx,
store_vector4( inst, machine, result );
}
break;
+ case OPCODE_RET: /* return from subroutine */
+ {
+ /* NOTE: The return is conditional! */
+ const GLuint swizzle = inst->DstReg.CondSwizzle;
+ const GLuint condMask = inst->DstReg.CondMask;
+ if (test_cc(machine->CondCodes[GET_SWZ(swizzle, 0)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 1)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 2)], condMask) ||
+ test_cc(machine->CondCodes[GET_SWZ(swizzle, 3)], condMask)) {
+ if (machine->StackDepth == 0) {
+ return GL_TRUE; /* Per GL_NV_vertex_program2 spec */
+ }
+ pc = machine->CallStack[--machine->StackDepth];
+ }
+ }
+ break;
case OPCODE_RFL: /* reflection vector */
{
GLfloat axis[4], dir[4], result[4], tmpX, tmpW;
@@ -1539,6 +1589,9 @@ init_machine( GLcontext *ctx, struct fp_machine *machine,
machine->CondCodes[1] = COND_EQ;
machine->CondCodes[2] = COND_EQ;
machine->CondCodes[3] = COND_EQ;
+
+ /* init call stack */
+ machine->StackDepth = 0;
}
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 6316833a686..083f1ebe83c 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -194,7 +194,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
{{
GLint x, y;
const GLfloat radius = 0.5F * size;
- const GLint z = (GLint) (vert->win[2] + 0.5F);
+ const GLuint z = (GLuint) (vert->win[2] + 0.5F);
GLuint count;
#if FLAGS & SMOOTH
const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index cbfb7712d82..128ce0afb33 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -554,7 +554,7 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
/* The ReadPixels region is totally outside the window bounds */
- return;
+ goto end;
}
if (clippedPacking.BufferObj->Name) {
diff --git a/src/mesa/swrast/sources b/src/mesa/swrast/sources
index 8807b56a619..9ffd4cca722 100644
--- a/src/mesa/swrast/sources
+++ b/src/mesa/swrast/sources
@@ -1,4 +1,4 @@
-# List of ource files in this directory used for X.org xserver build
+# List of source files in this directory used for X.org xserver build
MESA_SWRAST_SOURCES = \
s_aaline.c \
s_aatriangle.c \
@@ -30,3 +30,36 @@ s_texfilter.c \
s_texstore.c \
s_triangle.c \
s_zoom.c
+
+MESA_SWRAST_HEADERS = \
+s_aaline.h \
+s_aalinetemp.h \
+s_aatriangle.h \
+s_aatritemp.h \
+s_accum.h \
+s_alpha.h \
+s_arbshader.h \
+s_atifragshader.h \
+s_blend.h \
+s_context.h \
+s_depth.h \
+s_drawpix.h \
+s_feedback.h \
+s_fog.h \
+s_lines.h \
+s_linetemp.h \
+s_logic.h \
+s_masking.h \
+s_nvfragprog.h \
+s_points.h \
+s_pointtemp.h \
+s_span.h \
+s_spantemp.h \
+s_stencil.h \
+s_texcombine.h \
+s_texfilter.h \
+s_triangle.h \
+s_trispan.h \
+s_tritemp.h \
+s_zoom.h \
+swrast.h
diff --git a/src/mesa/swrast_setup/sources b/src/mesa/swrast_setup/sources
index d5b606d65ef..dee14b6774e 100644
--- a/src/mesa/swrast_setup/sources
+++ b/src/mesa/swrast_setup/sources
@@ -1,3 +1,10 @@
MESA_SWRAST_SETUP_SOURCES = \
ss_context.c \
ss_triangle.c
+
+MESA_SWRAST_SETUP_HEADERS = \
+ss_context.h \
+ss_triangle.h \
+ss_tritmp.h \
+ss_vb.h \
+swrast_setup.h
diff --git a/src/mesa/tnl/sources b/src/mesa/tnl/sources
index 50f2f3a96d0..a0888be11d6 100644
--- a/src/mesa/tnl/sources
+++ b/src/mesa/tnl/sources
@@ -1,4 +1,4 @@
-# List of ource files in this directory used for X.org xserver build
+# List of source files in this directory used for X.org xserver build
MESA_TNL_SOURCES = \
t_context.c \
t_pipeline.c \
@@ -19,3 +19,16 @@ t_vertex.c \
t_vertex_generic.c \
t_vertex_sse.c \
t_vp_build.c
+
+MESA_TNL_HEADERS = \
+t_array_api.h \
+t_array_import.h \
+t_context.h \
+t_pipeline.h \
+t_vb_arbprogram.h \
+t_vb_cliptmp.h \
+t_vb_lighttmp.h \
+t_vb_rendertmp.h \
+t_vertex.h \
+t_vp_build.h \
+tnl.h
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index bd459a77479..d9458b74eca 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -182,10 +182,7 @@ void
_tnl_need_projected_coords( GLcontext *ctx, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- if (tnl->NeedNdcCoords != mode) {
- tnl->NeedNdcCoords = mode;
- _tnl_InvalidateState( ctx, _NEW_PROJECTION );
- }
+ tnl->NeedNdcCoords = mode;
}
void
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
new file mode 100644
index 00000000000..dbbd095fe47
--- /dev/null
+++ b/src/mesa/tnl/t_save_api.c
@@ -0,0 +1,1741 @@
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ */
+
+
+
+/**
+ * The display list compiler attempts to store lists of vertices with the
+ * same vertex layout. Additionally it attempts to minimize the need
+ * for execute-time fixup of these vertex lists, allowing them to be
+ * cached on hardware.
+ *
+ * There are still some circumstances where this can be thwarted, for
+ * example by building a list that consists of one very long primitive
+ * (eg Begin(Triangles), 1000 vertices, End), and calling that list
+ * from inside a different begin/end object (Begin(Lines), CallList,
+ * End).
+ *
+ * In that case the code will have to replay the list as individual
+ * commands through the Exec dispatch table, or fix up the copied
+ * vertices at execute-time.
+ *
+ * The other case where fixup is required is when a vertex attribute
+ * is introduced in the middle of a primitive. Eg:
+ * Begin(Lines)
+ * TexCoord1f() Vertex2f()
+ * TexCoord1f() Color3f() Vertex2f()
+ * End()
+ *
+ * If the current value of Color isn't known at compile-time, this
+ * primitive will require fixup.
+ *
+ *
+ * The list compiler currently doesn't attempt to compile lists
+ * containing EvalCoord or EvalPoint commands. On encountering one of
+ * these, compilation falls back to opcodes.
+ *
+ * This could be improved to fallback only when a mix of EvalCoord and
+ * Vertex commands are issued within a single primitive.
+ */
+
+
+#include "glheader.h"
+#include "context.h"
+#include "dlist.h"
+#include "enums.h"
+#include "macros.h"
+#include "api_validate.h"
+#include "api_arrayelt.h"
+#include "vtxfmt.h"
+#include "t_save_api.h"
+#include "dispatch.h"
+
+/*
+ * NOTE: Old 'parity' issue is gone, but copying can still be
+ * wrong-footed on replay.
+ */
+static GLuint _save_copy_vertices( GLcontext *ctx,
+ const struct tnl_vertex_list *node )
+{
+ TNLcontext *tnl = TNL_CONTEXT( ctx );
+ const struct tnl_prim *prim = &node->prim[node->prim_count-1];
+ GLuint nr = prim->count;
+ GLuint sz = tnl->save.vertex_size;
+ const GLfloat *src = node->buffer + prim->start * sz;
+ GLfloat *dst = tnl->save.copied.buffer;
+ GLuint ovf, i;
+
+ if (prim->mode & PRIM_END)
+ return 0;
+
+ switch( prim->mode & PRIM_MODE_MASK )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ else {
+ _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ return 1;
+ }
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ return 1;
+ } else {
+ _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ case GL_QUAD_STRIP:
+ switch (nr) {
+ case 0: ovf = 0; break;
+ case 1: ovf = 1; break;
+ default: ovf = 2 + (nr&1); break;
+ }
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+static void
+build_normal_lengths( struct tnl_vertex_list *node )
+{
+ GLuint i;
+ GLfloat *len;
+ GLfloat *n = node->buffer;
+ GLuint stride = node->vertex_size;
+ GLuint count = node->count;
+
+ len = node->normal_lengths = (GLfloat *) MALLOC( count * sizeof(GLfloat) );
+ if (!len)
+ return;
+
+ /* Find the normal of the first vertex:
+ */
+ for (i = 0 ; i < _TNL_ATTRIB_NORMAL ; i++)
+ n += node->attrsz[i];
+
+ for (i = 0 ; i < count ; i++, n += stride) {
+ len[i] = LEN_3FV( n );
+ if (len[i] > 0.0F) len[i] = 1.0F / len[i];
+ }
+}
+
+static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx )
+{
+ struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store);
+ (void) ctx;
+ store->used = 0;
+ store->refcount = 1;
+ return store;
+}
+
+static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx )
+{
+ struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store);
+ (void) ctx;
+ store->used = 0;
+ store->refcount = 1;
+ return store;
+}
+
+static void _save_reset_counters( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ tnl->save.prim = tnl->save.prim_store->buffer + tnl->save.prim_store->used;
+ tnl->save.buffer = (tnl->save.vertex_store->buffer +
+ tnl->save.vertex_store->used);
+
+ if (tnl->save.vertex_size)
+ tnl->save.initial_counter = ((SAVE_BUFFER_SIZE -
+ tnl->save.vertex_store->used) /
+ tnl->save.vertex_size);
+ else
+ tnl->save.initial_counter = 0;
+
+ if (tnl->save.initial_counter > ctx->Const.MaxArrayLockSize )
+ tnl->save.initial_counter = ctx->Const.MaxArrayLockSize;
+
+ tnl->save.counter = tnl->save.initial_counter;
+ tnl->save.prim_count = 0;
+ tnl->save.prim_max = SAVE_PRIM_SIZE - tnl->save.prim_store->used;
+ tnl->save.copied.nr = 0;
+ tnl->save.dangling_attr_ref = 0;
+}
+
+
+/* Insert the active immediate struct onto the display list currently
+ * being built.
+ */
+static void _save_compile_vertex_list( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct tnl_vertex_list *node;
+
+ /* Allocate space for this structure in the display list currently
+ * being compiled.
+ */
+ node = (struct tnl_vertex_list *)
+ _mesa_alloc_instruction(ctx, tnl->save.opcode_vertex_list, sizeof(*node));
+
+ if (!node)
+ return;
+
+ /* Duplicate our template, increment refcounts to the storage structs:
+ */
+ _mesa_memcpy(node->attrsz, tnl->save.attrsz, sizeof(node->attrsz));
+ node->vertex_size = tnl->save.vertex_size;
+ node->buffer = tnl->save.buffer;
+ node->count = tnl->save.initial_counter - tnl->save.counter;
+ node->wrap_count = tnl->save.copied.nr;
+ node->have_materials = tnl->save.have_materials;
+ node->dangling_attr_ref = tnl->save.dangling_attr_ref;
+ node->normal_lengths = NULL;
+ node->prim = tnl->save.prim;
+ node->prim_count = tnl->save.prim_count;
+ node->vertex_store = tnl->save.vertex_store;
+ node->prim_store = tnl->save.prim_store;
+
+ node->vertex_store->refcount++;
+ node->prim_store->refcount++;
+
+ assert(node->attrsz[_TNL_ATTRIB_POS] != 0 ||
+ node->count == 0);
+
+ if (tnl->save.dangling_attr_ref)
+ ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS;
+
+ /* Maybe calculate normal lengths:
+ */
+ if (tnl->CalcDListNormalLengths &&
+ node->attrsz[_TNL_ATTRIB_NORMAL] == 3 &&
+ !(ctx->ListState.CurrentList->flags & MESA_DLIST_DANGLING_REFS))
+ build_normal_lengths( node );
+
+
+ tnl->save.vertex_store->used += tnl->save.vertex_size * node->count;
+ tnl->save.prim_store->used += node->prim_count;
+
+ /* Decide whether the storage structs are full, or can be used for
+ * the next vertex lists as well.
+ */
+ if (tnl->save.vertex_store->used >
+ SAVE_BUFFER_SIZE - 16 * (tnl->save.vertex_size + 4)) {
+
+ tnl->save.vertex_store->refcount--;
+ assert(tnl->save.vertex_store->refcount != 0);
+ tnl->save.vertex_store = alloc_vertex_store( ctx );
+ tnl->save.vbptr = tnl->save.vertex_store->buffer;
+ }
+
+ if (tnl->save.prim_store->used > SAVE_PRIM_SIZE - 6) {
+ tnl->save.prim_store->refcount--;
+ assert(tnl->save.prim_store->refcount != 0);
+ tnl->save.prim_store = alloc_prim_store( ctx );
+ }
+
+ /* Reset our structures for the next run of vertices:
+ */
+ _save_reset_counters( ctx );
+
+ /* Copy duplicated vertices
+ */
+ tnl->save.copied.nr = _save_copy_vertices( ctx, node );
+
+
+ /* Deal with GL_COMPILE_AND_EXECUTE:
+ */
+ if (ctx->ExecuteFlag) {
+ _tnl_playback_vertex_list( ctx, (void *) node );
+ }
+}
+
+
+/* TODO -- If no new vertices have been stored, don't bother saving
+ * it.
+ */
+static void _save_wrap_buffers( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i = tnl->save.prim_count - 1;
+ GLenum mode;
+
+ assert(i < (GLint) tnl->save.prim_max);
+ assert(i >= 0);
+
+ /* Close off in-progress primitive.
+ */
+ tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) -
+ tnl->save.prim[i].start);
+ mode = tnl->save.prim[i].mode & ~(PRIM_BEGIN|PRIM_END);
+
+ /* store the copied vertices, and allocate a new list.
+ */
+ _save_compile_vertex_list( ctx );
+
+ /* Restart interrupted primitive
+ */
+ tnl->save.prim[0].mode = mode;
+ tnl->save.prim[0].start = 0;
+ tnl->save.prim[0].count = 0;
+ tnl->save.prim_count = 1;
+}
+
+
+
+/* Called only when buffers are wrapped as the result of filling the
+ * vertex_store struct.
+ */
+static void _save_wrap_filled_vertex( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLfloat *data = tnl->save.copied.buffer;
+ GLuint i;
+
+ /* Emit a glEnd to close off the last vertex list.
+ */
+ _save_wrap_buffers( ctx );
+
+ /* Copy stored stored vertices to start of new list.
+ */
+ assert(tnl->save.counter > tnl->save.copied.nr);
+
+ for (i = 0 ; i < tnl->save.copied.nr ; i++) {
+ _mesa_memcpy( tnl->save.vbptr, data, tnl->save.vertex_size * sizeof(GLfloat));
+ data += tnl->save.vertex_size;
+ tnl->save.vbptr += tnl->save.vertex_size;
+ tnl->save.counter--;
+ }
+}
+
+
+static void _save_copy_to_current( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ /* XXX Use _TNL_FIRST_* and _TNL_LAST_* values instead? */
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) {
+ if (tnl->save.attrsz[i]) {
+ tnl->save.currentsz[i][0] = tnl->save.attrsz[i];
+ COPY_CLEAN_4V(tnl->save.current[i],
+ tnl->save.attrsz[i],
+ tnl->save.attrptr[i]);
+ }
+ }
+
+ /* Edgeflag requires special treatment:
+ *
+ * TODO: change edgeflag to GLfloat in Mesa.
+ */
+ if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ ctx->ListState.ActiveEdgeFlag = 1;
+ tnl->save.CurrentFloatEdgeFlag =
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0];
+ ctx->ListState.CurrentEdgeFlag =
+ (tnl->save.CurrentFloatEdgeFlag == 1.0);
+ }
+}
+
+
+static void _save_copy_from_current( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i;
+
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++)
+ switch (tnl->save.attrsz[i]) {
+ case 4: tnl->save.attrptr[i][3] = tnl->save.current[i][3];
+ case 3: tnl->save.attrptr[i][2] = tnl->save.current[i][2];
+ case 2: tnl->save.attrptr[i][1] = tnl->save.current[i][1];
+ case 1: tnl->save.attrptr[i][0] = tnl->save.current[i][0];
+ case 0: break;
+ }
+
+ /* Edgeflag requires special treatment:
+ */
+ if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ tnl->save.CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag;
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] = tnl->save.CurrentFloatEdgeFlag;
+ }
+}
+
+
+
+
+/* Flush existing data, set new attrib size, replay copied vertices.
+ */
+static void _save_upgrade_vertex( GLcontext *ctx,
+ GLuint attr,
+ GLuint newsz )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint oldsz;
+ GLuint i;
+ GLfloat *tmp;
+
+ /* Store the current run of vertices, and emit a GL_END. Emit a
+ * BEGIN in the new buffer.
+ */
+ if (tnl->save.initial_counter != tnl->save.counter)
+ _save_wrap_buffers( ctx );
+ else
+ assert( tnl->save.copied.nr == 0 );
+
+ /* Do a COPY_TO_CURRENT to ensure back-copying works for the case
+ * when the attribute already exists in the vertex and is having
+ * its size increased.
+ */
+ _save_copy_to_current( ctx );
+
+ /* Fix up sizes:
+ */
+ oldsz = tnl->save.attrsz[attr];
+ tnl->save.attrsz[attr] = newsz;
+
+ tnl->save.vertex_size += newsz - oldsz;
+ tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) /
+ tnl->save.vertex_size);
+ if (tnl->save.counter > ctx->Const.MaxArrayLockSize )
+ tnl->save.counter = ctx->Const.MaxArrayLockSize;
+ tnl->save.initial_counter = tnl->save.counter;
+
+ /* Recalculate all the attrptr[] values:
+ */
+ for (i = 0, tmp = tnl->save.vertex ; i < _TNL_ATTRIB_MAX ; i++) {
+ if (tnl->save.attrsz[i]) {
+ tnl->save.attrptr[i] = tmp;
+ tmp += tnl->save.attrsz[i];
+ }
+ else
+ tnl->save.attrptr[i] = NULL; /* will not be dereferenced. */
+ }
+
+ /* Copy from current to repopulate the vertex with correct values.
+ */
+ _save_copy_from_current( ctx );
+
+ /* Replay stored vertices to translate them to new format here.
+ *
+ * If there are copied vertices and the new (upgraded) attribute
+ * has not been defined before, this list is somewhat degenerate,
+ * and will need fixup at runtime.
+ */
+ if (tnl->save.copied.nr)
+ {
+ GLfloat *data = tnl->save.copied.buffer;
+ GLfloat *dest = tnl->save.buffer;
+ GLuint j;
+
+ /* Need to note this and fix up at runtime (or loopback):
+ */
+ if (tnl->save.currentsz[attr][0] == 0) {
+ assert(oldsz == 0);
+ tnl->save.dangling_attr_ref = GL_TRUE;
+
+/* _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n", */
+/* attr); */
+
+#if 0
+ /* The current strategy is to punt these degenerate cases
+ * through _tnl_loopback_vertex_list(), a lower-performance
+ * option. To minimize the impact of this, artificially
+ * reduce the size of this vertex_list.
+ */
+ if (t->save.counter > 10) {
+ t->save.initial_counter = 10;
+ t->save.counter = 10;
+ }
+#endif
+ }
+
+ for (i = 0 ; i < tnl->save.copied.nr ; i++) {
+ for (j = 0 ; j < _TNL_ATTRIB_MAX ; j++) {
+ if (tnl->save.attrsz[j]) {
+ if (j == attr) {
+ if (oldsz) {
+ COPY_CLEAN_4V( dest, oldsz, data );
+ data += oldsz;
+ dest += newsz;
+ }
+ else {
+ COPY_SZ_4V( dest, newsz, tnl->save.current[attr] );
+ dest += newsz;
+ }
+ }
+ else {
+ GLint sz = tnl->save.attrsz[j];
+ COPY_SZ_4V( dest, sz, data );
+ data += sz;
+ dest += sz;
+ }
+ }
+ }
+ }
+
+ tnl->save.vbptr = dest;
+ tnl->save.counter -= tnl->save.copied.nr;
+ }
+}
+
+
+
+
+/* Helper function for 'CHOOSE' macro. Do what's necessary when an
+ * entrypoint is called for the first time.
+ */
+static void do_choose( GLuint attr, GLuint sz,
+ void (*attr_func)( const GLfloat *),
+ void (*choose1)( const GLfloat *),
+ void (*choose2)( const GLfloat *),
+ void (*choose3)( const GLfloat *),
+ void (*choose4)( const GLfloat *),
+ const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ static GLfloat id[4] = { 0, 0, 0, 1 };
+ int i;
+
+ if (tnl->save.attrsz[attr] < sz) {
+ /* New size is larger. Need to flush existing vertices and get
+ * an enlarged vertex format.
+ */
+ _save_upgrade_vertex( ctx, attr, sz );
+ }
+ else {
+ /* New size is equal or smaller - just need to fill in some
+ * zeros.
+ */
+ for (i = sz ; i <= tnl->save.attrsz[attr] ; i++)
+ tnl->save.attrptr[attr][i-1] = id[i-1];
+ }
+
+ /* Reset any active pointers for this attribute
+ */
+ tnl->save.tabfv[attr][0] = choose1;
+ tnl->save.tabfv[attr][1] = choose2;
+ tnl->save.tabfv[attr][2] = choose3;
+ tnl->save.tabfv[attr][3] = choose4;
+
+ /* Update the secondary dispatch table with the new function
+ */
+ tnl->save.tabfv[attr][sz-1] = attr_func;
+
+ (*attr_func)(v);
+}
+
+
+
+/* Only one size for each attribute may be active at once. Eg. if
+ * Color3f is installed/active, then Color4f may not be, even if the
+ * vertex actually contains 4 color coordinates. This is because the
+ * 3f version won't otherwise set color[3] to 1.0 -- this is the job
+ * of the chooser function when switching between Color4f and Color3f.
+ */
+#define ATTRFV( ATTR, N ) \
+static void save_choose_##ATTR##_##N( const GLfloat *v ); \
+ \
+static void save_attrib_##ATTR##_##N( const GLfloat *v ) \
+{ \
+ GET_CURRENT_CONTEXT( ctx ); \
+ TNLcontext *tnl = TNL_CONTEXT(ctx); \
+ \
+ if ((ATTR) == 0) { \
+ GLuint i; \
+ \
+ if (N>0) tnl->save.vbptr[0] = v[0]; \
+ if (N>1) tnl->save.vbptr[1] = v[1]; \
+ if (N>2) tnl->save.vbptr[2] = v[2]; \
+ if (N>3) tnl->save.vbptr[3] = v[3]; \
+ \
+ for (i = N; i < tnl->save.vertex_size; i++) \
+ tnl->save.vbptr[i] = tnl->save.vertex[i]; \
+ \
+ tnl->save.vbptr += tnl->save.vertex_size; \
+ \
+ if (--tnl->save.counter == 0) \
+ _save_wrap_filled_vertex( ctx ); \
+ } \
+ else { \
+ GLfloat *dest = tnl->save.attrptr[ATTR]; \
+ if (N>0) dest[0] = v[0]; \
+ if (N>1) dest[1] = v[1]; \
+ if (N>2) dest[2] = v[2]; \
+ if (N>3) dest[3] = v[3]; \
+ } \
+}
+
+#define CHOOSE( ATTR, N ) \
+static void save_choose_##ATTR##_##N( const GLfloat *v ) \
+{ \
+ do_choose(ATTR, N, \
+ save_attrib_##ATTR##_##N, \
+ save_choose_##ATTR##_1, \
+ save_choose_##ATTR##_2, \
+ save_choose_##ATTR##_3, \
+ save_choose_##ATTR##_4, \
+ v ); \
+}
+
+#define INIT(ATTR) \
+static void save_init_##ATTR( TNLcontext *tnl ) \
+{ \
+ tnl->save.tabfv[ATTR][0] = save_choose_##ATTR##_1; \
+ tnl->save.tabfv[ATTR][1] = save_choose_##ATTR##_2; \
+ tnl->save.tabfv[ATTR][2] = save_choose_##ATTR##_3; \
+ tnl->save.tabfv[ATTR][3] = save_choose_##ATTR##_4; \
+}
+
+#define ATTRS( ATTRIB ) \
+ ATTRFV( ATTRIB, 1 ) \
+ ATTRFV( ATTRIB, 2 ) \
+ ATTRFV( ATTRIB, 3 ) \
+ ATTRFV( ATTRIB, 4 ) \
+ CHOOSE( ATTRIB, 1 ) \
+ CHOOSE( ATTRIB, 2 ) \
+ CHOOSE( ATTRIB, 3 ) \
+ CHOOSE( ATTRIB, 4 ) \
+ INIT( ATTRIB ) \
+
+
+/* Generate a lot of functions. These are the actual worker
+ * functions, which are equivalent to those generated via codegen
+ * elsewhere.
+ */
+ATTRS( 0 )
+ATTRS( 1 )
+ATTRS( 2 )
+ATTRS( 3 )
+ATTRS( 4 )
+ATTRS( 5 )
+ATTRS( 6 )
+ATTRS( 7 )
+ATTRS( 8 )
+ATTRS( 9 )
+ATTRS( 10 )
+ATTRS( 11 )
+ATTRS( 12 )
+ATTRS( 13 )
+ATTRS( 14 )
+ATTRS( 15 )
+
+
+static void _save_reset_vertex( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ save_init_0( tnl );
+ save_init_1( tnl );
+ save_init_2( tnl );
+ save_init_3( tnl );
+ save_init_4( tnl );
+ save_init_5( tnl );
+ save_init_6( tnl );
+ save_init_7( tnl );
+ save_init_8( tnl );
+ save_init_9( tnl );
+ save_init_10( tnl );
+ save_init_11( tnl );
+ save_init_12( tnl );
+ save_init_13( tnl );
+ save_init_14( tnl );
+ save_init_15( tnl );
+
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ tnl->save.attrsz[i] = 0;
+
+ tnl->save.vertex_size = 0;
+ tnl->save.have_materials = 0;
+
+ _save_reset_counters( ctx );
+}
+
+
+
+/* Cope with aliasing of classic Vertex, Normal, etc. and the fan-out
+ * of glMultTexCoord and glProgramParamterNV by routing all these
+ * through a second level dispatch table.
+ */
+#define DISPATCH_ATTRFV( ATTR, COUNT, P ) \
+do { \
+ GET_CURRENT_CONTEXT( ctx ); \
+ TNLcontext *tnl = TNL_CONTEXT(ctx); \
+ tnl->save.tabfv[ATTR][COUNT-1]( P ); \
+} while (0)
+
+#define DISPATCH_ATTR1FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 1, V )
+#define DISPATCH_ATTR2FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 2, V )
+#define DISPATCH_ATTR3FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 3, V )
+#define DISPATCH_ATTR4FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 4, V )
+
+#define DISPATCH_ATTR1F( ATTR, S ) DISPATCH_ATTRFV( ATTR, 1, &(S) )
+
+#if defined(USE_X86_ASM) && 0 /* will break register calling convention */
+/* Naughty cheat:
+ */
+#define DISPATCH_ATTR2F( ATTR, S,T ) DISPATCH_ATTRFV( ATTR, 2, &(S) )
+#define DISPATCH_ATTR3F( ATTR, S,T,R ) DISPATCH_ATTRFV( ATTR, 3, &(S) )
+#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) DISPATCH_ATTRFV( ATTR, 4, &(S) )
+#else
+/* Safe:
+ */
+#define DISPATCH_ATTR2F( ATTR, S,T ) \
+do { \
+ GLfloat v[2]; \
+ v[0] = S; v[1] = T; \
+ DISPATCH_ATTR2FV( ATTR, v ); \
+} while (0)
+#define DISPATCH_ATTR3F( ATTR, S,T,R ) \
+do { \
+ GLfloat v[3]; \
+ v[0] = S; v[1] = T; v[2] = R; \
+ DISPATCH_ATTR3FV( ATTR, v ); \
+} while (0)
+#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) \
+do { \
+ GLfloat v[4]; \
+ v[0] = S; v[1] = T; v[2] = R; v[3] = Q; \
+ DISPATCH_ATTR4FV( ATTR, v ); \
+} while (0)
+#endif
+
+
+static void enum_error( void )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
+}
+
+static void GLAPIENTRY _save_Vertex2f( GLfloat x, GLfloat y )
+{
+ DISPATCH_ATTR2F( _TNL_ATTRIB_POS, x, y );
+}
+
+static void GLAPIENTRY _save_Vertex2fv( const GLfloat *v )
+{
+ DISPATCH_ATTR2FV( _TNL_ATTRIB_POS, v );
+}
+
+static void GLAPIENTRY _save_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ DISPATCH_ATTR3F( _TNL_ATTRIB_POS, x, y, z );
+}
+
+static void GLAPIENTRY _save_Vertex3fv( const GLfloat *v )
+{
+ DISPATCH_ATTR3FV( _TNL_ATTRIB_POS, v );
+}
+
+static void GLAPIENTRY _save_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ DISPATCH_ATTR4F( _TNL_ATTRIB_POS, x, y, z, w );
+}
+
+static void GLAPIENTRY _save_Vertex4fv( const GLfloat *v )
+{
+ DISPATCH_ATTR4FV( _TNL_ATTRIB_POS, v );
+}
+
+static void GLAPIENTRY _save_TexCoord1f( GLfloat x )
+{
+ DISPATCH_ATTR1F( _TNL_ATTRIB_TEX0, x );
+}
+
+static void GLAPIENTRY _save_TexCoord1fv( const GLfloat *v )
+{
+ DISPATCH_ATTR1FV( _TNL_ATTRIB_TEX0, v );
+}
+
+static void GLAPIENTRY _save_TexCoord2f( GLfloat x, GLfloat y )
+{
+ DISPATCH_ATTR2F( _TNL_ATTRIB_TEX0, x, y );
+}
+
+static void GLAPIENTRY _save_TexCoord2fv( const GLfloat *v )
+{
+ DISPATCH_ATTR2FV( _TNL_ATTRIB_TEX0, v );
+}
+
+static void GLAPIENTRY _save_TexCoord3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ DISPATCH_ATTR3F( _TNL_ATTRIB_TEX0, x, y, z );
+}
+
+static void GLAPIENTRY _save_TexCoord3fv( const GLfloat *v )
+{
+ DISPATCH_ATTR3FV( _TNL_ATTRIB_TEX0, v );
+}
+
+static void GLAPIENTRY _save_TexCoord4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ DISPATCH_ATTR4F( _TNL_ATTRIB_TEX0, x, y, z, w );
+}
+
+static void GLAPIENTRY _save_TexCoord4fv( const GLfloat *v )
+{
+ DISPATCH_ATTR4FV( _TNL_ATTRIB_TEX0, v );
+}
+
+static void GLAPIENTRY _save_Normal3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ DISPATCH_ATTR3F( _TNL_ATTRIB_NORMAL, x, y, z );
+}
+
+static void GLAPIENTRY _save_Normal3fv( const GLfloat *v )
+{
+ DISPATCH_ATTR3FV( _TNL_ATTRIB_NORMAL, v );
+}
+
+static void GLAPIENTRY _save_FogCoordfEXT( GLfloat x )
+{
+ DISPATCH_ATTR1F( _TNL_ATTRIB_FOG, x );
+}
+
+static void GLAPIENTRY _save_FogCoordfvEXT( const GLfloat *v )
+{
+ DISPATCH_ATTR1FV( _TNL_ATTRIB_FOG, v );
+}
+
+static void GLAPIENTRY _save_Color3f( GLfloat x, GLfloat y, GLfloat z )
+{
+ DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR0, x, y, z );
+}
+
+static void GLAPIENTRY _save_Color3fv( const GLfloat *v )
+{
+ DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR0, v );
+}
+
+static void GLAPIENTRY _save_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ DISPATCH_ATTR4F( _TNL_ATTRIB_COLOR0, x, y, z, w );
+}
+
+static void GLAPIENTRY _save_Color4fv( const GLfloat *v )
+{
+ DISPATCH_ATTR4FV( _TNL_ATTRIB_COLOR0, v );
+}
+
+static void GLAPIENTRY _save_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z )
+{
+ DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR1, x, y, z );
+}
+
+static void GLAPIENTRY _save_SecondaryColor3fvEXT( const GLfloat *v )
+{
+ DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR1, v );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord1f( GLenum target, GLfloat x )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR1F( attr, x );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord1fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR1FV( attr, v );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR2F( attr, x, y );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord2fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR2FV( attr, v );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y,
+ GLfloat z)
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR3F( attr, x, y, z );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord3fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR3FV( attr, v );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR4F( attr, x, y, z, w );
+}
+
+static void GLAPIENTRY _save_MultiTexCoord4fv( GLenum target, const GLfloat *v )
+{
+ GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
+ DISPATCH_ATTR4FV( attr, v );
+}
+
+static void GLAPIENTRY _save_VertexAttrib1fNV( GLuint index, GLfloat x )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR1F( index, x );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR1FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR2F( index, x, y );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR2FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y,
+ GLfloat z )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR3F( index, x, y, z );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR3FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR4F( index, x, y, z, w );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY _save_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
+ DISPATCH_ATTR4FV( index, v );
+ else
+ enum_error();
+}
+
+
+static void GLAPIENTRY
+_save_VertexAttrib1fARB( GLuint index, GLfloat x )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR1F( index, x );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR1FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR2F( index, x, y );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR2FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib3fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR3F( index, x, y, z );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR3FV( index, v );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib4fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR4F( index, x, y, z, w );
+ else
+ enum_error();
+}
+
+static void GLAPIENTRY
+_save_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
+{
+ if (index < MAX_VERTEX_ATTRIBS)
+ DISPATCH_ATTR4FV( index, v );
+ else
+ enum_error();
+}
+
+
+/* Materials:
+ *
+ * These are treated as per-vertex attributes, at indices above where
+ * the NV_vertex_program leaves off. There are a lot of good things
+ * about treating materials this way.
+ *
+ * However: I don't want to double the number of generated functions
+ * just to cope with this, so I unroll the 'C' varients of CHOOSE and
+ * ATTRF into this function, and dispense with codegen and
+ * second-level dispatch.
+ *
+ * There is no aliasing of material attributes with other entrypoints.
+ */
+#define MAT_ATTR( A, N, params ) \
+do { \
+ if (tnl->save.attrsz[A] < N) { \
+ _save_upgrade_vertex( ctx, A, N ); \
+ tnl->save.have_materials = GL_TRUE; \
+ } \
+ \
+ { \
+ GLfloat *dest = tnl->save.attrptr[A]; \
+ if (N>0) dest[0] = params[0]; \
+ if (N>1) dest[1] = params[1]; \
+ if (N>2) dest[2] = params[2]; \
+ if (N>3) dest[3] = params[3]; \
+ } \
+} while (0)
+
+
+#define MAT( ATTR, N, face, params ) \
+do { \
+ if (face != GL_BACK) \
+ MAT_ATTR( ATTR, N, params ); /* front */ \
+ if (face != GL_FRONT) \
+ MAT_ATTR( ATTR + 1, N, params ); /* back */ \
+} while (0)
+
+
+/* NOTE: Have to remove/deal-with colormaterial crossovers, probably
+ * later on - in the meantime just store everything.
+ */
+static void GLAPIENTRY _save_Materialfv( GLenum face, GLenum pname,
+ const GLfloat *params )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ switch (pname) {
+ case GL_EMISSION:
+ MAT( _TNL_ATTRIB_MAT_FRONT_EMISSION, 4, face, params );
+ break;
+ case GL_AMBIENT:
+ MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
+ break;
+ case GL_DIFFUSE:
+ MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
+ break;
+ case GL_SPECULAR:
+ MAT( _TNL_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params );
+ break;
+ case GL_SHININESS:
+ MAT( _TNL_ATTRIB_MAT_FRONT_SHININESS, 1, face, params );
+ break;
+ case GL_COLOR_INDEXES:
+ MAT( _TNL_ATTRIB_MAT_FRONT_INDEXES, 3, face, params );
+ break;
+ case GL_AMBIENT_AND_DIFFUSE:
+ MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
+ MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
+ break;
+ default:
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
+ return;
+ }
+}
+
+
+#define IDX_ATTR( A, IDX ) \
+do { \
+ GET_CURRENT_CONTEXT( ctx ); \
+ TNLcontext *tnl = TNL_CONTEXT(ctx); \
+ \
+ if (tnl->save.attrsz[A] < 1) { \
+ _save_upgrade_vertex( ctx, A, 1 ); \
+ } \
+ \
+ { \
+ GLfloat *dest = tnl->save.attrptr[A]; \
+ dest[0] = IDX; \
+ } \
+} while (0)
+
+
+static void GLAPIENTRY _save_EdgeFlag( GLboolean b )
+{
+ IDX_ATTR( _TNL_ATTRIB_EDGEFLAG, (GLfloat)b );
+}
+
+
+static void GLAPIENTRY _save_Indexf( GLfloat f )
+{
+ IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f );
+}
+
+static void GLAPIENTRY _save_Indexfv( const GLfloat *f )
+{
+ IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f[0] );
+}
+
+
+
+
+/* Cope with EvalCoord/CallList called within a begin/end object:
+ * -- Flush current buffer
+ * -- Fallback to opcodes for the rest of the begin/end object.
+ */
+#define FALLBACK(ctx) \
+do { \
+ TNLcontext *tnl = TNL_CONTEXT(ctx); \
+ \
+ if (tnl->save.initial_counter != tnl->save.counter || \
+ tnl->save.prim_count) \
+ _save_compile_vertex_list( ctx ); \
+ \
+ _save_copy_to_current( ctx ); \
+ _save_reset_vertex( ctx ); \
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); \
+ ctx->Driver.SaveNeedFlush = 0; \
+} while (0)
+
+static void GLAPIENTRY _save_EvalCoord1f( GLfloat u )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalCoord1f(ctx->Save, ( u ));
+}
+
+static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalCoord1fv(ctx->Save, ( v ));
+}
+
+static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalCoord2f(ctx->Save, ( u, v ));
+}
+
+static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalCoord2fv(ctx->Save, ( v ));
+}
+
+static void GLAPIENTRY _save_EvalPoint1( GLint i )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalPoint1(ctx->Save, ( i ));
+}
+
+static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_EvalPoint2(ctx->Save, ( i, j ));
+}
+
+static void GLAPIENTRY _save_CallList( GLuint l )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_CallList(ctx->Save, ( l ));
+}
+
+static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FALLBACK(ctx);
+ CALL_CallLists(ctx->Save, ( n, type, v ));
+}
+
+
+
+
+/**
+ * Called via ctx->Driver.NotifySaveBegin(ctx, mode) when we get a
+ * glBegin() call while compiling a display list.
+ * See save_Begin() in dlist.c
+ *
+ * This plugs in our special TNL-related display list functions.
+ * All subsequent glBegin/glVertex/glEnd()s found while compiling a
+ * display list will get routed to the functions in this file.
+ *
+ * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of.
+ */
+static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ if (1) {
+ GLuint i = tnl->save.prim_count++;
+
+ assert(i < tnl->save.prim_max);
+ tnl->save.prim[i].mode = mode | PRIM_BEGIN;
+ tnl->save.prim[i].start = tnl->save.initial_counter - tnl->save.counter;
+ tnl->save.prim[i].count = 0;
+
+ _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt );
+ ctx->Driver.SaveNeedFlush = 1;
+ return GL_TRUE;
+ }
+ else
+ return GL_FALSE;
+}
+
+
+
+static void GLAPIENTRY _save_End( void )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i = tnl->save.prim_count - 1;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ if (ctx->ExecuteFlag)
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+
+ tnl->save.prim[i].mode |= PRIM_END;
+ tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) -
+ tnl->save.prim[i].start);
+
+ if (i == (GLint) tnl->save.prim_max - 1) {
+ _save_compile_vertex_list( ctx );
+ assert(tnl->save.copied.nr == 0);
+ }
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+}
+
+
+/* These are all errors as this vtxfmt is only installed inside
+ * begin/end pairs.
+ */
+static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) count; (void) type; (void) indices;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
+}
+
+
+static void GLAPIENTRY _save_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
+}
+
+static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) start; (void) count;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
+}
+
+static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) x1; (void) y1; (void) x2; (void) y2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
+}
+
+static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) i1; (void) i2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
+}
+
+static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
+ GLint j1, GLint j2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) i1; (void) i2; (void) j1; (void) j2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
+}
+
+/**
+ * This is only called if someone tries to compile nested glBegin()s
+ * in their display list.
+ */
+static void GLAPIENTRY _save_Begin( GLenum mode )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ (void) mode;
+ _mesa_compile_error(ctx, GL_INVALID_OPERATION,
+ "glBegin(called inside glBegin/End)");
+}
+
+
+/* Unlike the functions above, these are to be hooked into the vtxfmt
+ * maintained in ctx->ListState, active when the list is known or
+ * suspected to be outside any begin/end primitive.
+ */
+static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _save_NotifyBegin( ctx, GL_QUADS | PRIM_WEAK );
+ CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 ));
+ CALL_End(GET_DISPATCH(), ());
+}
+
+
+static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
+ return;
+
+ _ae_map_vbos( ctx );
+
+ _save_NotifyBegin( ctx, mode | PRIM_WEAK );
+ for (i = 0; i < count; i++)
+ CALL_ArrayElement(GET_DISPATCH(), (start + i));
+ CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
+}
+
+
+static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
+ return;
+
+ _ae_map_vbos( ctx );
+
+ _save_NotifyBegin( ctx, mode | PRIM_WEAK );
+
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
+ break;
+ case GL_UNSIGNED_SHORT:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
+ break;
+ case GL_UNSIGNED_INT:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
+ break;
+ }
+
+ CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
+}
+
+static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (_mesa_validate_DrawRangeElements( ctx, mode,
+ start, end,
+ count, type, indices ))
+ _save_OBE_DrawElements( mode, count, type, indices );
+}
+
+
+
+
+
+static void _save_vtxfmt_init( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLvertexformat *vfmt = &tnl->save_vtxfmt;
+
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Begin = _save_Begin;
+ vfmt->Color3f = _save_Color3f;
+ vfmt->Color3fv = _save_Color3fv;
+ vfmt->Color4f = _save_Color4f;
+ vfmt->Color4fv = _save_Color4fv;
+ vfmt->EdgeFlag = _save_EdgeFlag;
+ vfmt->End = _save_End;
+ vfmt->FogCoordfEXT = _save_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = _save_FogCoordfvEXT;
+ vfmt->Indexf = _save_Indexf;
+ vfmt->Indexfv = _save_Indexfv;
+ vfmt->Materialfv = _save_Materialfv;
+ vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f;
+ vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv;
+ vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f;
+ vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv;
+ vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f;
+ vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv;
+ vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f;
+ vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv;
+ vfmt->Normal3f = _save_Normal3f;
+ vfmt->Normal3fv = _save_Normal3fv;
+ vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT;
+ vfmt->TexCoord1f = _save_TexCoord1f;
+ vfmt->TexCoord1fv = _save_TexCoord1fv;
+ vfmt->TexCoord2f = _save_TexCoord2f;
+ vfmt->TexCoord2fv = _save_TexCoord2fv;
+ vfmt->TexCoord3f = _save_TexCoord3f;
+ vfmt->TexCoord3fv = _save_TexCoord3fv;
+ vfmt->TexCoord4f = _save_TexCoord4f;
+ vfmt->TexCoord4fv = _save_TexCoord4fv;
+ vfmt->Vertex2f = _save_Vertex2f;
+ vfmt->Vertex2fv = _save_Vertex2fv;
+ vfmt->Vertex3f = _save_Vertex3f;
+ vfmt->Vertex3fv = _save_Vertex3fv;
+ vfmt->Vertex4f = _save_Vertex4f;
+ vfmt->Vertex4fv = _save_Vertex4fv;
+ vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV;
+ vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV;
+ vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV;
+ vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV;
+ vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV;
+ vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV;
+ vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV;
+ vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV;
+ vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB;
+ vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB;
+ vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB;
+ vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB;
+ vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB;
+ vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB;
+ vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB;
+ vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB;
+
+ /* This will all require us to fallback to saving the list as opcodes:
+ */
+ vfmt->CallList = _save_CallList; /* inside begin/end */
+ vfmt->CallLists = _save_CallLists; /* inside begin/end */
+ vfmt->EvalCoord1f = _save_EvalCoord1f;
+ vfmt->EvalCoord1fv = _save_EvalCoord1fv;
+ vfmt->EvalCoord2f = _save_EvalCoord2f;
+ vfmt->EvalCoord2fv = _save_EvalCoord2fv;
+ vfmt->EvalPoint1 = _save_EvalPoint1;
+ vfmt->EvalPoint2 = _save_EvalPoint2;
+
+ /* These are all errors as we at least know we are in some sort of
+ * begin/end pair:
+ */
+ vfmt->EvalMesh1 = _save_EvalMesh1;
+ vfmt->EvalMesh2 = _save_EvalMesh2;
+ vfmt->Begin = _save_Begin;
+ vfmt->Rectf = _save_Rectf;
+ vfmt->DrawArrays = _save_DrawArrays;
+ vfmt->DrawElements = _save_DrawElements;
+ vfmt->DrawRangeElements = _save_DrawRangeElements;
+
+}
+
+
+void _tnl_SaveFlushVertices( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ /* Noop when we are actually active:
+ */
+ if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
+ ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
+ return;
+
+ if (tnl->save.initial_counter != tnl->save.counter ||
+ tnl->save.prim_count)
+ _save_compile_vertex_list( ctx );
+
+ _save_copy_to_current( ctx );
+ _save_reset_vertex( ctx );
+ ctx->Driver.SaveNeedFlush = 0;
+}
+
+void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ (void) list; (void) mode;
+
+ if (!tnl->save.prim_store)
+ tnl->save.prim_store = alloc_prim_store( ctx );
+
+ if (!tnl->save.vertex_store) {
+ tnl->save.vertex_store = alloc_vertex_store( ctx );
+ tnl->save.vbptr = tnl->save.vertex_store->buffer;
+ }
+
+ _save_reset_vertex( ctx );
+ ctx->Driver.SaveNeedFlush = 0;
+}
+
+void _tnl_EndList( GLcontext *ctx )
+{
+ (void) ctx;
+ assert(TNL_CONTEXT(ctx)->save.vertex_size == 0);
+}
+
+void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->save.replay_flags |= dlist->flags;
+ tnl->save.replay_flags |= tnl->LoopbackDListCassettes;
+}
+
+void _tnl_EndCallList( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ if (ctx->ListState.CallDepth == 1)
+ tnl->save.replay_flags = 0;
+}
+
+
+static void _tnl_destroy_vertex_list( GLcontext *ctx, void *data )
+{
+ struct tnl_vertex_list *node = (struct tnl_vertex_list *)data;
+ (void) ctx;
+
+ if ( --node->vertex_store->refcount == 0 )
+ FREE( node->vertex_store );
+
+ if ( --node->prim_store->refcount == 0 )
+ FREE( node->prim_store );
+
+ if ( node->normal_lengths )
+ FREE( node->normal_lengths );
+}
+
+
+static void _tnl_print_vertex_list( GLcontext *ctx, void *data )
+{
+ struct tnl_vertex_list *node = (struct tnl_vertex_list *)data;
+ GLuint i;
+ (void) ctx;
+
+ _mesa_debug(NULL, "TNL-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
+ node->count,
+ node->prim_count,
+ node->vertex_size);
+
+ for (i = 0 ; i < node->prim_count ; i++) {
+ struct tnl_prim *prim = &node->prim[i];
+ _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n",
+ i,
+ _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK),
+ prim->start,
+ prim->start + prim->count,
+ (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)",
+ (prim->mode & PRIM_END) ? "END" : "(wrap)");
+ }
+}
+
+
+static void _save_current_init( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i;
+
+ for (i = 0; i < _TNL_ATTRIB_MAT_FRONT_AMBIENT; i++) {
+ ASSERT(i < VERT_ATTRIB_MAX);
+ tnl->save.currentsz[i] = &ctx->ListState.ActiveAttribSize[i];
+ tnl->save.current[i] = ctx->ListState.CurrentAttrib[i];
+ }
+
+ for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
+ const GLuint j = i - _TNL_FIRST_MAT;
+ ASSERT(j < MAT_ATTRIB_MAX);
+ tnl->save.currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
+ tnl->save.current[i] = ctx->ListState.CurrentMaterial[j];
+ }
+
+ tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
+ tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag;
+}
+
+/**
+ * Initialize the display list compiler
+ */
+void _tnl_save_init( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct tnl_vertex_arrays *tmp = &tnl->save_inputs;
+ GLuint i;
+
+
+ for (i = 0; i < _TNL_ATTRIB_MAX; i++)
+ _mesa_vector4f_init( &tmp->Attribs[i], 0, NULL);
+
+ tnl->save.opcode_vertex_list =
+ _mesa_alloc_opcode( ctx,
+ sizeof(struct tnl_vertex_list),
+ _tnl_playback_vertex_list,
+ _tnl_destroy_vertex_list,
+ _tnl_print_vertex_list );
+
+ ctx->Driver.NotifySaveBegin = _save_NotifyBegin;
+
+ _save_vtxfmt_init( ctx );
+ _save_current_init( ctx );
+
+ /* Hook our array functions into the outside-begin-end vtxfmt in
+ * ctx->ListState.
+ */
+ ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf;
+ ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays;
+ ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements;
+ ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+}
+
+
+/**
+ * Deallocate the immediate-mode buffer for the given context, if
+ * its reference count goes to zero.
+ */
+void _tnl_save_destroy( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ /* Decrement the refcounts. References may still be held by
+ * display lists yet to be destroyed, so it may not yet be time to
+ * free these items.
+ */
+ if (tnl->save.prim_store &&
+ --tnl->save.prim_store->refcount == 0 )
+ FREE( tnl->save.prim_store );
+
+ if (tnl->save.vertex_store &&
+ --tnl->save.vertex_store->refcount == 0 )
+ FREE( tnl->save.vertex_store );
+}
diff --git a/src/mesa/tnl/t_save_playback.c b/src/mesa/tnl/t_save_playback.c
new file mode 100644
index 00000000000..426e94372ec
--- /dev/null
+++ b/src/mesa/tnl/t_save_playback.c
@@ -0,0 +1,216 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.1
+ *
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* Author:
+ * Keith Whitwell <[email protected]>
+ */
+
+#include "glheader.h"
+#include "context.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "macros.h"
+#include "light.h"
+#include "state.h"
+#include "t_pipeline.h"
+#include "t_save_api.h"
+#include "t_vtx_api.h"
+
+static INLINE GLint get_size( const GLfloat *f )
+{
+ if (f[3] != 1.0) return 4;
+ if (f[2] != 0.0) return 3;
+ return 2;
+}
+
+
+/* Some nasty stuff still hanging on here.
+ *
+ * TODO - remove VB->ColorPtr, etc and just use the AttrPtr's.
+ */
+static void _tnl_bind_vertex_list( GLcontext *ctx,
+ const struct tnl_vertex_list *node )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ struct tnl_vertex_arrays *tmp = &tnl->save_inputs;
+ GLfloat *data = node->buffer;
+ GLuint attr, i;
+
+ /* Setup constant data in the VB.
+ */
+ VB->Count = node->count;
+ VB->Primitive = node->prim;
+ VB->PrimitiveCount = node->prim_count;
+ VB->Elts = NULL;
+ VB->NormalLengthPtr = node->normal_lengths;
+
+ for (attr = 0; attr <= _TNL_ATTRIB_EDGEFLAG; attr++) {
+ if (node->attrsz[attr]) {
+ tmp->Attribs[attr].count = node->count;
+ tmp->Attribs[attr].data = (GLfloat (*)[4]) data;
+ tmp->Attribs[attr].start = data;
+ tmp->Attribs[attr].size = node->attrsz[attr];
+ tmp->Attribs[attr].stride = node->vertex_size * sizeof(GLfloat);
+ VB->AttribPtr[attr] = &tmp->Attribs[attr];
+ data += node->attrsz[attr];
+ }
+ else {
+ tmp->Attribs[attr].count = 1;
+ tmp->Attribs[attr].data = (GLfloat (*)[4]) tnl->vtx.current[attr];
+ tmp->Attribs[attr].start = tnl->vtx.current[attr];
+ tmp->Attribs[attr].size = get_size( tnl->vtx.current[attr] );
+ tmp->Attribs[attr].stride = 0;
+ VB->AttribPtr[attr] = &tmp->Attribs[attr];
+ }
+ }
+
+
+ /* Copy edgeflag to a contiguous array
+ */
+ if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) {
+ if (node->attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ VB->EdgeFlag = _tnl_translate_edgeflag( ctx, data,
+ node->count,
+ node->vertex_size );
+ data++;
+ }
+ else
+ VB->EdgeFlag = _tnl_import_current_edgeflag( ctx, node->count );
+ }
+
+ /* Legacy pointers -- remove one day.
+ */
+ VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS];
+ VB->NormalPtr = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
+ VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
+ VB->ColorPtr[1] = NULL;
+ VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX];
+ VB->IndexPtr[1] = NULL;
+ VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
+ VB->SecondaryColorPtr[1] = NULL;
+ VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i];
+ }
+}
+
+static void _playback_copy_to_current( GLcontext *ctx,
+ const struct tnl_vertex_list *node )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ const GLfloat *data;
+ GLuint i;
+
+ if (node->count)
+ data = node->buffer + (node->count-1) * node->vertex_size;
+ else
+ data = node->buffer;
+
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) {
+ if (node->attrsz[i]) {
+ COPY_CLEAN_4V(tnl->vtx.current[i], node->attrsz[i], data);
+ data += node->attrsz[i];
+ }
+ }
+
+ /* Edgeflag requires special treatment:
+ */
+ if (node->attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ ctx->Current.EdgeFlag = (data[0] == 1.0);
+ }
+
+ /* Colormaterial -- this kindof sucks.
+ */
+ if (ctx->Light.ColorMaterialEnabled) {
+ _mesa_update_color_material(ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
+ }
+
+ if (node->have_materials) {
+ tnl->Driver.NotifyMaterialChange( ctx );
+ ctx->NewState |= _NEW_LIGHT;
+ }
+
+ /* CurrentExecPrimitive
+ */
+ if (node->prim_count) {
+ GLenum mode = node->prim[node->prim_count - 1].mode;
+ if (mode & PRIM_END)
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+ else
+ ctx->Driver.CurrentExecPrimitive = (mode & PRIM_MODE_MASK);
+ }
+}
+
+
+/**
+ * Execute the buffer and save copied verts.
+ */
+void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
+{
+ const struct tnl_vertex_list *node = (const struct tnl_vertex_list *) data;
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (node->prim_count > 0 && node->count > 0) {
+
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END &&
+ (node->prim[0].mode & PRIM_BEGIN)) {
+
+ /* Degenerate case: list is called inside begin/end pair and
+ * includes operations such as glBegin or glDrawArrays.
+ */
+ _mesa_error( ctx, GL_INVALID_OPERATION, "displaylist recursive begin");
+ _tnl_loopback_vertex_list( ctx, node );
+ return;
+ }
+ else if (tnl->save.replay_flags) {
+ /* Various degnerate cases: translate into immediate mode
+ * calls rather than trying to execute in place.
+ */
+ _tnl_loopback_vertex_list( ctx, node );
+ return;
+ }
+
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) ||
+ (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBegin (invalid vertex/fragment program)");
+ return;
+ }
+
+ _tnl_bind_vertex_list( ctx, node );
+
+ tnl->Driver.RunPipeline( ctx );
+ }
+
+ /* Copy to current?
+ */
+ _playback_copy_to_current( ctx, node );
+}
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 71fb45dd95c..bf4c1d52237 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -1529,7 +1529,7 @@ const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage =
void
_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program)
{
- if (program->Target == GL_VERTEX_PROGRAM_ARB) {
+ if (target == GL_VERTEX_PROGRAM_ARB) {
/* free any existing tnl data hanging off the program */
struct gl_vertex_program *vprog = (struct gl_vertex_program *) program;
if (vprog->TnlData) {
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index 894a13b7046..805d05ae728 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -33,7 +33,7 @@
#include "glheader.h"
#include "macros.h"
#include "enums.h"
-#include "t_context.h"
+#include "t_context.h" /* NOTE: very light dependency on this */
#include "t_vp_build.h"
#include "shader/program.h"
@@ -386,7 +386,7 @@ static struct ureg register_const4f( struct tnl_program *p,
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
new file mode 100644
index 00000000000..77eec8b3b44
--- /dev/null
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -0,0 +1,1046 @@
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ */
+
+#include "glheader.h"
+#include "context.h"
+#include "macros.h"
+#include "vtxfmt.h"
+#include "dlist.h"
+#include "state.h"
+#include "light.h"
+#include "api_arrayelt.h"
+#include "api_noop.h"
+#include "t_vtx_api.h"
+#include "simple_list.h"
+
+#include "dispatch.h"
+
+static void reset_attrfv( TNLcontext *tnl );
+
+/** Note extra space for error index: */
+static tnl_attrfv_func choose[_TNL_ATTRIB_ERROR+1][4];
+static tnl_attrfv_func generic_attr_func[_TNL_MAX_ATTR_CODEGEN][4];
+
+
+/* Close off the last primitive, execute the buffer, restart the
+ * primitive.
+ */
+static void _tnl_wrap_buffers( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+
+ if (tnl->vtx.prim_count == 0) {
+ tnl->vtx.copied.nr = 0;
+ tnl->vtx.counter = tnl->vtx.initial_counter;
+ tnl->vtx.vbptr = tnl->vtx.buffer;
+ }
+ else {
+ GLuint last_prim = tnl->vtx.prim[tnl->vtx.prim_count-1].mode;
+ GLuint last_count;
+
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ GLint i = tnl->vtx.prim_count - 1;
+ assert(i >= 0);
+ tnl->vtx.prim[i].count = ((tnl->vtx.initial_counter -
+ tnl->vtx.counter) -
+ tnl->vtx.prim[i].start);
+ }
+
+ last_count = tnl->vtx.prim[tnl->vtx.prim_count-1].count;
+
+ /* Execute the buffer and save copied vertices.
+ */
+ if (tnl->vtx.counter != tnl->vtx.initial_counter)
+ _tnl_flush_vtx( ctx );
+ else {
+ tnl->vtx.prim_count = 0;
+ tnl->vtx.copied.nr = 0;
+ }
+
+ /* Emit a glBegin to start the new list.
+ */
+ assert(tnl->vtx.prim_count == 0);
+
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ tnl->vtx.prim[0].mode = ctx->Driver.CurrentExecPrimitive;
+ tnl->vtx.prim[0].start = 0;
+ tnl->vtx.prim[0].count = 0;
+ tnl->vtx.prim_count++;
+
+ if (tnl->vtx.copied.nr == last_count)
+ tnl->vtx.prim[0].mode |= last_prim & PRIM_BEGIN;
+ }
+ }
+}
+
+
+/* Deal with buffer wrapping where provoked by the vertex buffer
+ * filling up, as opposed to upgrade_vertex().
+ *
+ * Make it GLAPIENTRY, so we can tail from the codegen'ed Vertex*fv
+ */
+void GLAPIENTRY _tnl_wrap_filled_vertex( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLfloat *data = tnl->vtx.copied.buffer;
+ GLuint i;
+
+ /* Run pipeline on current vertices, copy wrapped vertices
+ * to tnl->copied.
+ */
+ _tnl_wrap_buffers( ctx );
+
+ /* Copy stored stored vertices to start of new list.
+ */
+ assert(tnl->vtx.counter > tnl->vtx.copied.nr);
+
+ for (i = 0 ; i < tnl->vtx.copied.nr ; i++) {
+ _mesa_memcpy( tnl->vtx.vbptr, data,
+ tnl->vtx.vertex_size * sizeof(GLfloat));
+ tnl->vtx.vbptr += tnl->vtx.vertex_size;
+ data += tnl->vtx.vertex_size;
+ tnl->vtx.counter--;
+ }
+
+ tnl->vtx.copied.nr = 0;
+}
+
+
+/*
+ * Copy the active vertex's values to the ctx->Current fields.
+ */
+static void _tnl_copy_to_current( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ for (i = _TNL_ATTRIB_POS+1 ; i < _TNL_ATTRIB_EDGEFLAG ; i++) {
+ if (tnl->vtx.attrsz[i]) {
+ /* Note: the tnl->vtx.current[i] pointers points to
+ * the ctx->Current fields. The first 16 or so, anyway.
+ */
+ COPY_CLEAN_4V(tnl->vtx.current[i],
+ tnl->vtx.attrsz[i],
+ tnl->vtx.attrptr[i]);
+ }
+ }
+
+ /* Edgeflag requires additional treatment:
+ */
+ if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ ctx->Current.EdgeFlag =
+ (tnl->vtx.CurrentFloatEdgeFlag == 1.0);
+ }
+
+ /* Colormaterial -- this kindof sucks.
+ */
+ if (ctx->Light.ColorMaterialEnabled) {
+ _mesa_update_color_material(ctx,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
+ }
+
+ if (tnl->vtx.have_materials) {
+ tnl->Driver.NotifyMaterialChange( ctx );
+ ctx->NewState |= _NEW_LIGHT;
+ }
+
+ ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
+}
+
+
+static void _tnl_copy_from_current( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i;
+
+ /* Edgeflag requires additional treatment:
+ */
+ tnl->vtx.CurrentFloatEdgeFlag = (GLfloat) ctx->Current.EdgeFlag;
+
+ for (i = _TNL_ATTRIB_POS+1 ; i < _TNL_ATTRIB_MAX ; i++)
+ switch (tnl->vtx.attrsz[i]) {
+ case 4: tnl->vtx.attrptr[i][3] = tnl->vtx.current[i][3];
+ case 3: tnl->vtx.attrptr[i][2] = tnl->vtx.current[i][2];
+ case 2: tnl->vtx.attrptr[i][1] = tnl->vtx.current[i][1];
+ case 1: tnl->vtx.attrptr[i][0] = tnl->vtx.current[i][0];
+ break;
+ }
+
+ ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
+}
+
+
+/* Flush existing data, set new attrib size, replay copied vertices.
+ */
+static void _tnl_wrap_upgrade_vertex( GLcontext *ctx,
+ GLuint attr,
+ GLuint newsz )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint oldsz;
+ GLuint i;
+ GLfloat *tmp;
+ GLint lastcount = tnl->vtx.initial_counter - tnl->vtx.counter;
+
+ /* Run pipeline on current vertices, copy wrapped vertices
+ * to tnl->vtx.copied.
+ */
+ _tnl_wrap_buffers( ctx );
+
+
+ /* Do a COPY_TO_CURRENT to ensure back-copying works for the case
+ * when the attribute already exists in the vertex and is having
+ * its size increased.
+ */
+ _tnl_copy_to_current( ctx );
+
+
+ /* Heuristic: Attempt to isolate attributes received outside
+ * begin/end so that they don't bloat the vertices.
+ */
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END &&
+ tnl->vtx.attrsz[attr] == 0 &&
+ lastcount > 8 &&
+ tnl->vtx.vertex_size) {
+ reset_attrfv( tnl );
+ }
+
+ /* Fix up sizes:
+ */
+ oldsz = tnl->vtx.attrsz[attr];
+ tnl->vtx.attrsz[attr] = newsz;
+
+ tnl->vtx.vertex_size += newsz - oldsz;
+ tnl->vtx.counter = MIN2( VERT_BUFFER_SIZE / tnl->vtx.vertex_size,
+ ctx->Const.MaxArrayLockSize );
+ tnl->vtx.initial_counter = tnl->vtx.counter;
+ tnl->vtx.vbptr = tnl->vtx.buffer;
+
+
+ /* Recalculate all the attrptr[] values
+ */
+ for (i = 0, tmp = tnl->vtx.vertex ; i < _TNL_ATTRIB_MAX ; i++) {
+ if (tnl->vtx.attrsz[i]) {
+ tnl->vtx.attrptr[i] = tmp;
+ tmp += tnl->vtx.attrsz[i];
+ }
+ else
+ tnl->vtx.attrptr[i] = NULL; /* will not be dereferenced */
+ }
+
+ /* Copy from current to repopulate the vertex with correct values.
+ */
+ _tnl_copy_from_current( ctx );
+
+ /* Replay stored vertices to translate them
+ * to new format here.
+ *
+ * -- No need to replay - just copy piecewise
+ */
+ if (tnl->vtx.copied.nr)
+ {
+ const GLfloat *data = tnl->vtx.copied.buffer;
+ GLfloat *dest = tnl->vtx.buffer;
+ GLuint j;
+
+ for (i = 0 ; i < tnl->vtx.copied.nr ; i++) {
+ for (j = 0 ; j < _TNL_ATTRIB_MAX ; j++) {
+ if (tnl->vtx.attrsz[j]) {
+ if (j == attr) {
+ if (oldsz) {
+ COPY_CLEAN_4V( dest, oldsz, data );
+ data += oldsz;
+ dest += newsz;
+ } else {
+ COPY_SZ_4V( dest, newsz, tnl->vtx.current[j] );
+ dest += newsz;
+ }
+ }
+ else {
+ GLuint sz = tnl->vtx.attrsz[j];
+ COPY_SZ_4V( dest, sz, data );
+ dest += sz;
+ data += sz;
+ }
+ }
+ }
+ }
+
+ tnl->vtx.vbptr = dest;
+ tnl->vtx.counter -= tnl->vtx.copied.nr;
+ tnl->vtx.copied.nr = 0;
+ }
+
+ /* For codegen - attrptr's may have changed, so need to redo
+ * codegen. Might be a reasonable place to try & detect attributes
+ * in the vertex which aren't being submitted any more.
+ */
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ if (tnl->vtx.attrsz[i]) {
+ GLuint j = tnl->vtx.attrsz[i] - 1;
+
+ if (i < _TNL_MAX_ATTR_CODEGEN)
+ tnl->vtx.tabfv[i][j] = choose[i][j];
+ }
+
+}
+
+
+static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ static const GLfloat id[4] = { 0, 0, 0, 1 };
+ int i;
+
+ if (0)
+ _mesa_printf("%s attr %d sz %d -> %d\n",
+ __FUNCTION__, attr, tnl->vtx.attrsz[attr], sz);
+
+ if (tnl->vtx.attrsz[attr] < sz) {
+ /* New size is larger. Need to flush existing vertices and get
+ * an enlarged vertex format.
+ */
+ _tnl_wrap_upgrade_vertex( ctx, attr, sz );
+ }
+ else if (sz < tnl->vtx.active_sz[attr]) {
+ /* New size is smaller - just need to fill in some
+ * zeros. Don't need to flush or wrap.
+ */
+ for (i = sz ; i <= tnl->vtx.attrsz[attr] ; i++)
+ tnl->vtx.attrptr[attr][i-1] = id[i-1];
+ }
+
+ tnl->vtx.active_sz[attr] = sz;
+
+ /* Does setting NeedFlush belong here? Necessitates resetting
+ * vtxfmt on each flush (otherwise flags won't get reset
+ * afterwards).
+ */
+ if (attr == 0)
+ ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+ else
+ ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
+}
+
+#ifdef USE_X86_ASM
+
+static struct _tnl_dynfn *lookup( struct _tnl_dynfn *l, GLuint key )
+{
+ struct _tnl_dynfn *f;
+
+ foreach( f, l ) {
+ if (f->key == key)
+ return f;
+ }
+
+ return NULL;
+}
+
+
+static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct _tnl_dynfn *dfn = NULL;
+
+ if (attr == 0) {
+ GLuint key = tnl->vtx.vertex_size;
+
+ dfn = lookup( &tnl->vtx.cache.Vertex[sz-1], key );
+
+ if (!dfn)
+ dfn = tnl->vtx.gen.Vertex[sz-1]( ctx, key );
+ }
+ else {
+ GLuint key = (GLuint) tnl->vtx.attrptr[attr];
+
+ dfn = lookup( &tnl->vtx.cache.Attribute[sz-1], key );
+
+ if (!dfn)
+ dfn = tnl->vtx.gen.Attribute[sz-1]( ctx, key );
+ }
+
+ if (dfn)
+ return *(tnl_attrfv_func *) &dfn->code;
+ else
+ return NULL;
+}
+
+#endif /* USE_X86_ASM */
+
+/* Helper function for 'CHOOSE' macro. Do what's necessary when an
+ * entrypoint is called for the first time.
+ */
+
+static tnl_attrfv_func do_choose( GLuint attr, GLuint sz )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint oldsz = tnl->vtx.active_sz[attr];
+
+ assert(attr < _TNL_MAX_ATTR_CODEGEN);
+
+ if (oldsz != sz) {
+ /* Reset any active pointers for this attribute
+ */
+ if (oldsz)
+ tnl->vtx.tabfv[attr][oldsz-1] = choose[attr][oldsz-1];
+
+ _tnl_fixup_vertex( ctx, attr, sz );
+
+ }
+
+
+ /* Try to use codegen:
+ */
+#ifdef USE_X86_ASM
+ if (tnl->AllowCodegen)
+ tnl->vtx.tabfv[attr][sz-1] = do_codegen( ctx, attr, sz );
+ else
+#endif
+ tnl->vtx.tabfv[attr][sz-1] = NULL;
+
+ /* Else use generic version:
+ */
+ if (!tnl->vtx.tabfv[attr][sz-1])
+ tnl->vtx.tabfv[attr][sz-1] = generic_attr_func[attr][sz-1];
+
+ ASSERT(tnl->vtx.tabfv[attr][sz-1]);
+ return tnl->vtx.tabfv[attr][sz-1];
+}
+
+
+
+#define CHOOSE( ATTR, N ) \
+static void choose_##ATTR##_##N( const GLfloat *v ) \
+{ \
+ tnl_attrfv_func f = do_choose(ATTR, N); \
+ ASSERT(f); \
+ f( v ); \
+}
+
+#define CHOOSERS( ATTRIB ) \
+ CHOOSE( ATTRIB, 1 ) \
+ CHOOSE( ATTRIB, 2 ) \
+ CHOOSE( ATTRIB, 3 ) \
+ CHOOSE( ATTRIB, 4 ) \
+
+
+#define INIT_CHOOSERS(ATTR) \
+ ASSERT(ATTR <= _TNL_ATTRIB_ERROR);\
+ choose[ATTR][0] = choose_##ATTR##_1; \
+ choose[ATTR][1] = choose_##ATTR##_2; \
+ choose[ATTR][2] = choose_##ATTR##_3; \
+ choose[ATTR][3] = choose_##ATTR##_4;
+
+/* conventional attributes */
+CHOOSERS( 0 )
+CHOOSERS( 1 )
+CHOOSERS( 2 )
+CHOOSERS( 3 )
+CHOOSERS( 4 )
+CHOOSERS( 5 )
+CHOOSERS( 6 )
+CHOOSERS( 7 )
+CHOOSERS( 8 )
+CHOOSERS( 9 )
+CHOOSERS( 10 )
+CHOOSERS( 11 )
+CHOOSERS( 12 )
+CHOOSERS( 13 )
+CHOOSERS( 14 )
+CHOOSERS( 15 )
+
+/* generic attributes */
+CHOOSERS( 16 )
+CHOOSERS( 17 )
+CHOOSERS( 18 )
+CHOOSERS( 19 )
+CHOOSERS( 20 )
+CHOOSERS( 21 )
+CHOOSERS( 22 )
+CHOOSERS( 23 )
+CHOOSERS( 24 )
+CHOOSERS( 25 )
+CHOOSERS( 26 )
+CHOOSERS( 27 )
+CHOOSERS( 28 )
+CHOOSERS( 29 )
+CHOOSERS( 30 )
+CHOOSERS( 31 )
+
+
+/**
+ * This function will get called when glVertexAttribNV/ARB() is called
+ * with an invalid index parameter.
+ */
+static void
+error_attrib(const GLfloat *unused)
+{
+ GET_CURRENT_CONTEXT( ctx );
+ (void) unused;
+ _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib(index)" );
+}
+
+
+
+/**
+ * Reset all the per-vertex functions pointers to point to the default
+ * "chooser" functions.
+ */
+static void
+reset_attrfv(TNLcontext *tnl)
+{
+ GLuint i;
+
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ if (tnl->vtx.attrsz[i]) {
+ GLint j = tnl->vtx.attrsz[i] - 1;
+ tnl->vtx.attrsz[i] = 0;
+ tnl->vtx.active_sz[i] = 0;
+
+ if (i < _TNL_MAX_ATTR_CODEGEN) {
+ while (j >= 0) {
+ tnl->vtx.tabfv[i][j] = choose[i][j];
+ j--;
+ }
+ }
+ }
+
+ tnl->vtx.vertex_size = 0;
+ tnl->vtx.have_materials = 0;
+}
+
+
+
+/**
+ * Materials:
+ *
+ * These are treated as per-vertex attributes, at indices above where
+ * the NV_vertex_program leaves off. There are a lot of good things
+ * about treating materials this way.
+ *
+ * However: I don't want to double the number of generated functions
+ * just to cope with this, so I unroll the 'C' varients of CHOOSE and
+ * ATTRF into this function, and dispense with codegen and
+ * second-level dispatch.
+ *
+ * There is no aliasing of material attributes with other entrypoints.
+ */
+#define OTHER_ATTR( A, N, params ) \
+do { \
+ if (tnl->vtx.active_sz[A] != N) { \
+ _tnl_fixup_vertex( ctx, A, N ); \
+ } \
+ \
+ { \
+ GLfloat *dest = tnl->vtx.attrptr[A]; \
+ if (N>0) dest[0] = (params)[0]; \
+ if (N>1) dest[1] = (params)[1]; \
+ if (N>2) dest[2] = (params)[2]; \
+ if (N>3) dest[3] = (params)[3]; \
+ } \
+} while (0)
+
+
+#define MAT( ATTR, N, face, params ) \
+do { \
+ if (face != GL_BACK) \
+ OTHER_ATTR( ATTR, N, params ); /* front */ \
+ if (face != GL_FRONT) \
+ OTHER_ATTR( ATTR + 1, N, params ); /* back */ \
+} while (0)
+
+
+/**
+ * Called by glMaterialfv().
+ * Colormaterial is dealt with later on.
+ */
+static void GLAPIENTRY
+_tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ switch (face) {
+ case GL_FRONT:
+ case GL_BACK:
+ case GL_FRONT_AND_BACK:
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
+ return;
+ }
+
+ switch (pname) {
+ case GL_EMISSION:
+ MAT( _TNL_ATTRIB_MAT_FRONT_EMISSION, 4, face, params );
+ break;
+ case GL_AMBIENT:
+ MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
+ break;
+ case GL_DIFFUSE:
+ MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
+ break;
+ case GL_SPECULAR:
+ MAT( _TNL_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params );
+ break;
+ case GL_SHININESS:
+ MAT( _TNL_ATTRIB_MAT_FRONT_SHININESS, 1, face, params );
+ break;
+ case GL_COLOR_INDEXES:
+ MAT( _TNL_ATTRIB_MAT_FRONT_INDEXES, 3, face, params );
+ break;
+ case GL_AMBIENT_AND_DIFFUSE:
+ MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
+ MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
+ return;
+ }
+
+ tnl->vtx.have_materials = GL_TRUE;
+}
+
+
+static void GLAPIENTRY _tnl_EdgeFlag( GLboolean b )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLfloat f = (GLfloat)b;
+
+ OTHER_ATTR( _TNL_ATTRIB_EDGEFLAG, 1, &f );
+}
+
+
+/* Eval
+ */
+static void GLAPIENTRY _tnl_EvalCoord1f( GLfloat u )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ /* TODO: use a CHOOSE() function for this: */
+ {
+ GLint i;
+ if (tnl->vtx.eval.new_state)
+ _tnl_update_eval( ctx );
+
+ for (i = 0; i < _TNL_NUM_EVAL; i++) {
+ if (tnl->vtx.eval.map1[i].map)
+ if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map1[i].sz)
+ _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map1[i].sz );
+ }
+ }
+
+
+ _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex,
+ tnl->vtx.vertex_size * sizeof(GLfloat));
+
+ _tnl_do_EvalCoord1f( ctx, u );
+
+ _mesa_memcpy( tnl->vtx.vertex, tnl->vtx.copied.buffer,
+ tnl->vtx.vertex_size * sizeof(GLfloat));
+}
+
+static void GLAPIENTRY _tnl_EvalCoord2f( GLfloat u, GLfloat v )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ /* TODO: use a CHOOSE() function for this: */
+ {
+ GLint i;
+ if (tnl->vtx.eval.new_state)
+ _tnl_update_eval( ctx );
+
+ for (i = 0; i < _TNL_NUM_EVAL; i++) {
+ if (tnl->vtx.eval.map2[i].map)
+ if (tnl->vtx.active_sz[i] != tnl->vtx.eval.map2[i].sz)
+ _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map2[i].sz );
+ }
+
+ if (ctx->Eval.AutoNormal)
+ if (tnl->vtx.active_sz[_TNL_ATTRIB_NORMAL] != 3)
+ _tnl_fixup_vertex( ctx, _TNL_ATTRIB_NORMAL, 3 );
+ }
+
+ _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex,
+ tnl->vtx.vertex_size * sizeof(GLfloat));
+
+ _tnl_do_EvalCoord2f( ctx, u, v );
+
+ _mesa_memcpy( tnl->vtx.vertex, tnl->vtx.copied.buffer,
+ tnl->vtx.vertex_size * sizeof(GLfloat));
+}
+
+static void GLAPIENTRY _tnl_EvalCoord1fv( const GLfloat *u )
+{
+ _tnl_EvalCoord1f( u[0] );
+}
+
+static void GLAPIENTRY _tnl_EvalCoord2fv( const GLfloat *u )
+{
+ _tnl_EvalCoord2f( u[0], u[1] );
+}
+
+static void GLAPIENTRY _tnl_EvalPoint1( GLint i )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ GLfloat du = ((ctx->Eval.MapGrid1u2 - ctx->Eval.MapGrid1u1) /
+ (GLfloat) ctx->Eval.MapGrid1un);
+ GLfloat u = i * du + ctx->Eval.MapGrid1u1;
+
+ _tnl_EvalCoord1f( u );
+}
+
+
+static void GLAPIENTRY _tnl_EvalPoint2( GLint i, GLint j )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) /
+ (GLfloat) ctx->Eval.MapGrid2un);
+ GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) /
+ (GLfloat) ctx->Eval.MapGrid2vn);
+ GLfloat u = i * du + ctx->Eval.MapGrid2u1;
+ GLfloat v = j * dv + ctx->Eval.MapGrid2v1;
+
+ _tnl_EvalCoord2f( u, v );
+}
+
+
+/**
+ * Called from glBegin.
+ * ctx->Driver.CurrentExecPrimitive will be set to <mode>.
+ */
+static void GLAPIENTRY _tnl_Begin( GLenum mode )
+{
+ GET_CURRENT_CONTEXT( ctx );
+
+ if (mode > GL_POLYGON) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
+ return;
+ }
+
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ /* we're not inside a glBegin/End pair */
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
+
+ if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) ||
+ (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBegin (invalid vertex/fragment program)");
+ tnl->DiscardPrimitive = GL_TRUE;
+ return;
+ }
+
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glBegin(incomplete framebuffer)");
+ tnl->DiscardPrimitive = GL_TRUE;
+ return;
+ }
+
+ tnl->DiscardPrimitive = GL_FALSE;
+
+ if (!(tnl->Driver.NotifyBegin &&
+ tnl->Driver.NotifyBegin( ctx, mode )))
+ CALL_Begin(ctx->Exec, (mode));
+ return;
+ }
+
+ /* Heuristic: attempt to isolate attributes occuring outside
+ * begin/end pairs.
+ */
+ if (tnl->vtx.vertex_size && !tnl->vtx.attrsz[0])
+ _tnl_FlushVertices( ctx, ~0 );
+
+ i = tnl->vtx.prim_count++;
+ tnl->vtx.prim[i].mode = mode | PRIM_BEGIN;
+ tnl->vtx.prim[i].start = tnl->vtx.initial_counter - tnl->vtx.counter;
+ tnl->vtx.prim[i].count = 0;
+
+ ctx->Driver.CurrentExecPrimitive = mode;
+ }
+ else {
+ /* already inside glBegin/End */
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
+ }
+}
+
+
+/**
+ * Called from glEnd.
+ */
+static void GLAPIENTRY _tnl_End( void )
+{
+ GET_CURRENT_CONTEXT( ctx );
+
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ /* closing an open glBegin primitive */
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ int idx = tnl->vtx.initial_counter - tnl->vtx.counter;
+ int i = tnl->vtx.prim_count - 1;
+
+ tnl->vtx.prim[i].mode |= PRIM_END;
+ tnl->vtx.prim[i].count = idx - tnl->vtx.prim[i].start;
+
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+
+ /* Two choices which effect the way vertex attributes are
+ * carried over (or not) between adjacent primitives.
+ */
+#if 0
+ if (tnl->vtx.prim_count == TNL_MAX_PRIM)
+ _tnl_FlushVertices( ctx, ~0 );
+#else
+ if (tnl->vtx.prim_count == TNL_MAX_PRIM)
+ _tnl_flush_vtx( ctx );
+#endif
+
+ }
+ else {
+ /* glBegin hasn't been called! */
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
+ }
+}
+
+
+/**
+ * XXX why aren't all members initialized here??
+ */
+static void _tnl_exec_vtxfmt_init( GLcontext *ctx )
+{
+ GLvertexformat *vfmt = &(TNL_CONTEXT(ctx)->exec_vtxfmt);
+
+ vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
+ vfmt->Begin = _tnl_Begin;
+ vfmt->CallList = _mesa_CallList;
+ vfmt->CallLists = _mesa_CallLists;
+ vfmt->EdgeFlag = _tnl_EdgeFlag;
+ vfmt->End = _tnl_End;
+ vfmt->EvalCoord1f = _tnl_EvalCoord1f;
+ vfmt->EvalCoord1fv = _tnl_EvalCoord1fv;
+ vfmt->EvalCoord2f = _tnl_EvalCoord2f;
+ vfmt->EvalCoord2fv = _tnl_EvalCoord2fv;
+ vfmt->EvalPoint1 = _tnl_EvalPoint1;
+ vfmt->EvalPoint2 = _tnl_EvalPoint2;
+ vfmt->Materialfv = _tnl_Materialfv;
+
+ vfmt->Rectf = _mesa_noop_Rectf;
+ vfmt->EvalMesh1 = _mesa_noop_EvalMesh1;
+ vfmt->EvalMesh2 = _mesa_noop_EvalMesh2;
+}
+
+
+
+void _tnl_FlushVertices( GLcontext *ctx, GLuint flags )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ (void) flags;
+
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ /* still inside a glBegin/End pair. How'd we get here??? */
+ return;
+ }
+
+ if (tnl->DiscardPrimitive) {
+ /* discard any primitives */
+ tnl->vtx.prim_count = 0;
+ tnl->vtx.counter = tnl->vtx.initial_counter;
+ tnl->vtx.vbptr = tnl->vtx.buffer;
+ }
+
+ if (tnl->vtx.counter != tnl->vtx.initial_counter) {
+ _tnl_flush_vtx( ctx );
+ }
+
+ if (tnl->vtx.vertex_size) {
+ _tnl_copy_to_current( ctx );
+ reset_attrfv( tnl );
+ }
+
+ ctx->Driver.NeedFlush = 0;
+}
+
+
+/**
+ * Init the tnl->vtx->current[] pointers to point to the corresponding
+ * fields in ctx->Current attribute group.
+ */
+static void _tnl_current_init( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLint i;
+
+ /* setup the pointers for the typical (32) vertex attributes */
+ for (i = 0; i < VERT_ATTRIB_MAX; i++)
+ tnl->vtx.current[i] = ctx->Current.Attrib[i];
+
+ /* setup pointers for the 12 material attributes */
+ for (i = 0; i < MAT_ATTRIB_MAX; i++)
+ tnl->vtx.current[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] =
+ ctx->Light.Material.Attrib[i];
+
+ /* special case */
+ tnl->vtx.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->vtx.CurrentFloatEdgeFlag;
+}
+
+static struct _tnl_dynfn *no_codegen( GLcontext *ctx, int key )
+{
+ (void) ctx; (void) key;
+ return NULL;
+}
+
+void _tnl_vtx_init( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct tnl_vertex_arrays *tmp = &tnl->vtx_inputs;
+ GLuint i;
+ static int firsttime = 1;
+
+ if (firsttime) {
+ firsttime = 0;
+
+ /* conventional attributes */
+ INIT_CHOOSERS( 0 );
+ INIT_CHOOSERS( 1 );
+ INIT_CHOOSERS( 2 );
+ INIT_CHOOSERS( 3 );
+ INIT_CHOOSERS( 4 );
+ INIT_CHOOSERS( 5 );
+ INIT_CHOOSERS( 6 );
+ INIT_CHOOSERS( 7 );
+ INIT_CHOOSERS( 8 );
+ INIT_CHOOSERS( 9 );
+ INIT_CHOOSERS( 10 );
+ INIT_CHOOSERS( 11 );
+ INIT_CHOOSERS( 12 );
+ INIT_CHOOSERS( 13 );
+ INIT_CHOOSERS( 14 );
+ INIT_CHOOSERS( 15 );
+
+ /* generic attributes */
+ INIT_CHOOSERS( 16 );
+ INIT_CHOOSERS( 17 );
+ INIT_CHOOSERS( 18 );
+ INIT_CHOOSERS( 19 );
+ INIT_CHOOSERS( 20 );
+ INIT_CHOOSERS( 21 );
+ INIT_CHOOSERS( 22 );
+ INIT_CHOOSERS( 23 );
+ INIT_CHOOSERS( 24 );
+ INIT_CHOOSERS( 25 );
+ INIT_CHOOSERS( 26 );
+ INIT_CHOOSERS( 27 );
+ INIT_CHOOSERS( 28 );
+ INIT_CHOOSERS( 29 );
+ INIT_CHOOSERS( 30 );
+ INIT_CHOOSERS( 31 );
+
+ choose[_TNL_ATTRIB_ERROR][0] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][1] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][2] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][3] = error_attrib;
+
+#ifdef USE_X86_ASM
+ if (tnl->AllowCodegen) {
+ _tnl_x86choosers(choose, do_choose); /* x86 INIT_CHOOSERS */
+ }
+#endif
+
+ _tnl_generic_attr_table_init( generic_attr_func );
+ }
+
+ for (i = 0; i < _TNL_ATTRIB_EDGEFLAG; i++)
+ _mesa_vector4f_init( &tmp->Attribs[i], 0, NULL);
+
+ for (i = 0; i < 4; i++) {
+ make_empty_list( &tnl->vtx.cache.Vertex[i] );
+ make_empty_list( &tnl->vtx.cache.Attribute[i] );
+ tnl->vtx.gen.Vertex[i] = no_codegen;
+ tnl->vtx.gen.Attribute[i] = no_codegen;
+ }
+
+#ifdef USE_X86_ASM
+ _tnl_InitX86Codegen( &tnl->vtx.gen );
+#endif
+
+ _tnl_current_init( ctx );
+ _tnl_exec_vtxfmt_init( ctx );
+ _tnl_generic_exec_vtxfmt_init( ctx );
+#ifdef USE_X86_ASM
+ if (tnl->AllowCodegen) {
+ _tnl_x86_exec_vtxfmt_init( ctx ); /* x86 DISPATCH_ATTRFV */
+ }
+#endif
+
+ _mesa_install_exec_vtxfmt( ctx, &tnl->exec_vtxfmt );
+
+ _mesa_memcpy( tnl->vtx.tabfv, choose, sizeof(choose) );
+
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) {
+ tnl->vtx.attrsz[i] = 0;
+ tnl->vtx.active_sz[i] = 0;
+ }
+
+ tnl->vtx.vertex_size = 0;
+ tnl->vtx.have_materials = 0;
+}
+
+static void free_funcs( struct _tnl_dynfn *l )
+{
+ struct _tnl_dynfn *f, *tmp;
+ foreach_s (f, tmp, l) {
+ remove_from_list( f );
+ ALIGN_FREE( f->code );
+ FREE( f );
+ }
+}
+
+
+void _tnl_vtx_destroy( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+
+ for (i = 0; i < 4; i++) {
+ free_funcs( &tnl->vtx.cache.Vertex[i] );
+ free_funcs( &tnl->vtx.cache.Attribute[i] );
+ }
+}
+
diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c
new file mode 100644
index 00000000000..900c4ab6cc1
--- /dev/null
+++ b/src/mesa/tnl/t_vtx_exec.c
@@ -0,0 +1,293 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 5.1
+ *
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <[email protected]>
+ */
+
+#include "glheader.h"
+#include "api_eval.h"
+#include "context.h"
+#include "enums.h"
+#include "state.h"
+#include "macros.h"
+#include "math/m_eval.h"
+#include "t_vtx_api.h"
+#include "t_pipeline.h"
+
+
+static void _tnl_print_vtx( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
+ GLuint i;
+
+ _mesa_debug(ctx, "_tnl_print_vtx: %u vertices %d primitives, %d vertsize\n",
+ count,
+ tnl->vtx.prim_count,
+ tnl->vtx.vertex_size);
+
+ for (i = 0 ; i < tnl->vtx.prim_count ; i++) {
+ struct tnl_prim *prim = &tnl->vtx.prim[i];
+ _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n",
+ i,
+ _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK),
+ prim->start,
+ prim->start + prim->count,
+ (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)",
+ (prim->mode & PRIM_END) ? "END" : "(wrap)");
+ }
+}
+
+GLboolean *_tnl_translate_edgeflag( GLcontext *ctx, const GLfloat *data,
+ GLuint count, GLuint stride )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLboolean *ef = tnl->vtx.edgeflag_tmp;
+ GLuint i;
+
+ if (!ef)
+ ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size );
+
+ for (i = 0 ; i < count ; i++, data += stride)
+ ef[i] = (data[0] == 1.0);
+
+ return ef;
+}
+
+
+GLboolean *_tnl_import_current_edgeflag( GLcontext *ctx,
+ GLuint count )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLboolean *ef = tnl->vtx.edgeflag_tmp;
+ GLboolean tmp = ctx->Current.EdgeFlag;
+ GLuint i;
+
+ if (!ef)
+ ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size );
+
+ for (i = 0 ; i < count ; i++)
+ ef[i] = tmp;
+
+ return ef;
+}
+
+static INLINE GLint get_size( const GLfloat *f )
+{
+ if (f[3] != 1.0) return 4;
+ if (f[2] != 0.0) return 3;
+ return 2;
+}
+
+/* Some nasty stuff still hanging on here.
+ *
+ * TODO - remove VB->NormalPtr, etc and just use the AttrPtr's.
+ */
+static void _tnl_vb_bind_vtx( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ struct tnl_vertex_arrays *tmp = &tnl->vtx_inputs;
+ GLfloat *data = tnl->vtx.buffer;
+ GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter;
+ GLuint attr, i;
+
+#undef DEBUG_VTX
+
+#ifdef DEBUG_VTX
+ fprintf(stderr, "_tnl_vb_bind_vtx(): %d verts %d vertsize\n",
+ count, tnl->vtx.vertex_size);
+#endif
+
+
+ /* Setup constant data in the VB.
+ */
+ VB->Count = count;
+ VB->Primitive = tnl->vtx.prim;
+ VB->PrimitiveCount = tnl->vtx.prim_count;
+ VB->Elts = NULL;
+ VB->NormalLengthPtr = NULL;
+
+ for (attr = 0; attr <= _TNL_ATTRIB_EDGEFLAG ; attr++) {
+ if (tnl->vtx.attrsz[attr]) {
+ tmp->Attribs[attr].count = count;
+ tmp->Attribs[attr].data = (GLfloat (*)[4]) data;
+ tmp->Attribs[attr].start = data;
+ tmp->Attribs[attr].size = tnl->vtx.attrsz[attr];
+ tmp->Attribs[attr].stride = tnl->vtx.vertex_size * sizeof(GLfloat);
+ VB->AttribPtr[attr] = &tmp->Attribs[attr];
+ data += tnl->vtx.attrsz[attr];
+ }
+ else {
+/* VB->AttribPtr[attr] = &tnl->current.Attribs[attr]; */
+
+
+ tmp->Attribs[attr].count = 1;
+ tmp->Attribs[attr].data = (GLfloat (*)[4]) tnl->vtx.current[attr];
+ tmp->Attribs[attr].start = tnl->vtx.current[attr];
+ tmp->Attribs[attr].size = get_size( tnl->vtx.current[attr] );
+ tmp->Attribs[attr].stride = 0;
+ VB->AttribPtr[attr] = &tmp->Attribs[attr];
+ }
+ }
+
+
+ /* Copy and translate EdgeFlag to a contiguous array of GLbooleans
+ */
+ if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) {
+ if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ VB->EdgeFlag = _tnl_translate_edgeflag( ctx, data, count,
+ tnl->vtx.vertex_size );
+ data++;
+ }
+ else
+ VB->EdgeFlag = _tnl_import_current_edgeflag( ctx, count );
+ }
+
+ /* Legacy pointers -- remove one day.
+ */
+ VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS];
+ VB->NormalPtr = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
+ VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
+ VB->ColorPtr[1] = NULL;
+ VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
+ VB->SecondaryColorPtr[1] = NULL;
+ VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX];
+ VB->IndexPtr[1] = NULL;
+ VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i];
+ }
+}
+
+
+/*
+ * NOTE: Need to have calculated primitives by this point -- do it on the fly.
+ * NOTE: Old 'parity' issue is gone.
+ */
+static GLuint _tnl_copy_vertices( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT( ctx );
+ GLuint nr = tnl->vtx.prim[tnl->vtx.prim_count-1].count;
+ GLuint ovf, i;
+ GLuint sz = tnl->vtx.vertex_size;
+ GLfloat *dst = tnl->vtx.copied.buffer;
+ GLfloat *src = (tnl->vtx.buffer +
+ tnl->vtx.prim[tnl->vtx.prim_count-1].start *
+ tnl->vtx.vertex_size);
+
+
+ switch( ctx->Driver.CurrentExecPrimitive )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ else {
+ _mesa_memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) );
+ return 1;
+ }
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) );
+ return 1;
+ } else {
+ _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) );
+ _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ /* no parity issue, but need to make sure the tri is not drawn twice */
+ if (nr & 1) {
+ tnl->vtx.prim[tnl->vtx.prim_count-1].count--;
+ }
+ /* fallthrough */
+ case GL_QUAD_STRIP:
+ switch (nr) {
+ case 0: ovf = 0; break;
+ case 1: ovf = 1; break;
+ default: ovf = 2 + (nr&1); break;
+ }
+ for (i = 0 ; i < ovf ; i++)
+ _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) );
+ return i;
+ case PRIM_OUTSIDE_BEGIN_END:
+ return 0;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+/**
+ * Execute the buffer and save copied verts.
+ */
+void _tnl_flush_vtx( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint vertex_count = tnl->vtx.initial_counter - tnl->vtx.counter;
+
+ if (0)
+ _tnl_print_vtx( ctx );
+
+ if (tnl->vtx.prim_count && vertex_count) {
+
+ tnl->vtx.copied.nr = _tnl_copy_vertices( ctx );
+
+ if (tnl->vtx.copied.nr != vertex_count) {
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ _tnl_vb_bind_vtx( ctx );
+
+ tnl->Driver.RunPipeline( ctx );
+ }
+ }
+
+ tnl->vtx.prim_count = 0;
+ tnl->vtx.counter = tnl->vtx.initial_counter;
+ tnl->vtx.vbptr = tnl->vtx.buffer;
+}
diff --git a/src/mesa/vbo/vbo_attrib.h b/src/mesa/vbo/vbo_attrib.h
index 9de4fd06835..0ae928f2af4 100644
--- a/src/mesa/vbo/vbo_attrib.h
+++ b/src/mesa/vbo/vbo_attrib.h
@@ -100,6 +100,7 @@ enum {
};
#define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT
+#define VBO_ATTRIB_LAST_MATERIAL VBO_ATTRIB_MAT_BACK_INDEXES
#define VBO_MAX_COPIED_VERTS 3
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index ade48d220e6..f718cdd91a7 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -835,10 +835,15 @@ static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei co
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
return;
+ _ae_map_vbos( ctx );
+
vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
+
for (i = 0; i < count; i++)
CALL_ArrayElement(GET_DISPATCH(), (start + i));
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
/* Could do better by copying the arrays and element list intact and
@@ -853,6 +858,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
return;
+ _ae_map_vbos( ctx );
+
vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
switch (type) {
@@ -874,6 +881,8 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
}
CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
}
static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
@@ -1095,7 +1104,7 @@ static void _save_current_init( GLcontext *ctx )
save->current[i] = ctx->ListState.CurrentAttrib[j];
}
- for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_MAT_FRONT_AMBIENT; i++) {
+ for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) {
const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
ASSERT(j < MAT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index ab3275ec94a..daa686072ef 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -37,7 +37,10 @@
#include "vbo_context.h"
-
+/*
+ * After playback, copy everything but the position from the
+ * last vertex to the saved state
+ */
static void _playback_copy_to_current( GLcontext *ctx,
const struct vbo_save_vertex_list *node )
{
@@ -46,14 +49,16 @@ static void _playback_copy_to_current( GLcontext *ctx,
GLuint i, offset;
if (node->count)
- offset = node->buffer_offset + (node->count-1) * node->vertex_size;
+ offset = (node->buffer_offset +
+ (node->count-1) * node->vertex_size * sizeof(GLfloat));
else
offset = node->buffer_offset;
- ctx->Driver.GetBufferSubData( ctx, 0, offset, node->vertex_size,
+ ctx->Driver.GetBufferSubData( ctx, 0, offset,
+ node->vertex_size * sizeof(GLfloat),
data, node->vertex_store->bufferobj );
- for (i = VBO_ATTRIB_POS+1 ; i <= VBO_ATTRIB_INDEX ; i++) {
+ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
if (node->attrsz[i]) {
GLfloat *current = (GLfloat *)vbo->currval[i].Ptr;
@@ -65,8 +70,8 @@ static void _playback_copy_to_current( GLcontext *ctx,
data += node->attrsz[i];
- if (i >= VBO_ATTRIB_MAT_FRONT_AMBIENT &&
- i <= VBO_ATTRIB_MAT_BACK_INDEXES)
+ if (i >= VBO_ATTRIB_FIRST_MATERIAL &&
+ i <= VBO_ATTRIB_LAST_MATERIAL)
ctx->NewState |= _NEW_LIGHT;
}
}
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index 0adad71732f..08eae2db40f 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -173,7 +173,7 @@ static void begin( struct copy_context *copy, GLenum mode, GLboolean begin_flag
{
struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
- _mesa_printf("begin %s (%d)\n", _mesa_lookup_enum_by_nr(mode), begin_flag);
+/* _mesa_printf("begin %s (%d)\n", _mesa_lookup_enum_by_nr(mode), begin_flag); */
prim->mode = mode;
prim->begin = begin_flag;
@@ -188,7 +188,7 @@ static GLuint elt(struct copy_context *copy, GLuint elt_idx)
GLuint elt = copy->srcelt[elt_idx];
GLuint slot = elt & (ELT_TABLE_SIZE-1);
- _mesa_printf("elt %d\n", elt);
+/* _mesa_printf("elt %d\n", elt); */
/* Look up the incoming element in the vertex cache. Re-emit if
* necessary.
@@ -197,7 +197,7 @@ static GLuint elt(struct copy_context *copy, GLuint elt_idx)
GLubyte *csr = copy->dstptr;
GLuint i;
- _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr);
+/* _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */
for (i = 0; i < copy->nr_varying; i++) {
const struct gl_client_array *srcarray = copy->varying[i].array;
@@ -206,6 +206,7 @@ static GLuint elt(struct copy_context *copy, GLuint elt_idx)
memcpy(csr, srcptr, copy->varying[i].size);
csr += copy->varying[i].size;
+ if (0)
{
const GLuint *f = (const GLuint *)srcptr;
GLuint j;
@@ -226,10 +227,10 @@ static GLuint elt(struct copy_context *copy, GLuint elt_idx)
copy->dstbuf_nr *
copy->vertex_size));
}
- else
- _mesa_printf(" --> reuse vertex\n");
+/* else */
+/* _mesa_printf(" --> reuse vertex\n"); */
- _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out);
+/* _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out); */
copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out;
return check_flush(copy);
}
@@ -238,7 +239,7 @@ static void end( struct copy_context *copy, GLboolean end_flag )
{
struct _mesa_prim *prim = &copy->dstprim[copy->dstprim_nr];
- _mesa_printf("end (%d)\n", end_flag);
+/* _mesa_printf("end (%d)\n", end_flag); */
prim->end = end_flag;
prim->count = copy->dstelt_nr - prim->start;
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index 97d8ce7175c..d8ef5eae095 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -40,6 +40,7 @@
# if defined(USE_MGL_NAMESPACE)
# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
# else
# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))
# endif
@@ -15146,12 +15147,469 @@ GL_PREFIX(MultiTexCoord4svARB):
.size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB)
.p2align 4,,15
+ .globl GL_PREFIX(AttachShader)
+ .type GL_PREFIX(AttachShader), @function
+GL_PREFIX(AttachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateProgram)
+ .type GL_PREFIX(CreateProgram), @function
+GL_PREFIX(CreateProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateShader)
+ .type GL_PREFIX(CreateShader), @function
+GL_PREFIX(CreateShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteProgram)
+ .type GL_PREFIX(DeleteProgram), @function
+GL_PREFIX(DeleteProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteShader)
+ .type GL_PREFIX(DeleteShader), @function
+GL_PREFIX(DeleteShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DetachShader)
+ .type GL_PREFIX(DetachShader), @function
+GL_PREFIX(DetachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetAttachedShaders)
+ .type GL_PREFIX(GetAttachedShaders), @function
+GL_PREFIX(GetAttachedShaders):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramInfoLog)
+ .type GL_PREFIX(GetProgramInfoLog), @function
+GL_PREFIX(GetProgramInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramiv)
+ .type GL_PREFIX(GetProgramiv), @function
+GL_PREFIX(GetProgramiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderInfoLog)
+ .type GL_PREFIX(GetShaderInfoLog), @function
+GL_PREFIX(GetShaderInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderiv)
+ .type GL_PREFIX(GetShaderiv), @function
+GL_PREFIX(GetShaderiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsProgram)
+ .type GL_PREFIX(IsProgram), @function
+GL_PREFIX(IsProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsShader)
+ .type GL_PREFIX(IsShader), @function
+GL_PREFIX(IsShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader)
+
+ .p2align 4,,15
.globl GL_PREFIX(StencilFuncSeparate)
.type GL_PREFIX(StencilFuncSeparate), @function
GL_PREFIX(StencilFuncSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15165,13 +15623,13 @@ GL_PREFIX(StencilFuncSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15185,7 +15643,7 @@ GL_PREFIX(StencilFuncSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3264(%rax), %r11
+ movq 3368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate)
@@ -15196,7 +15654,7 @@ GL_PREFIX(StencilFuncSeparate):
GL_PREFIX(StencilMaskSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15206,13 +15664,13 @@ GL_PREFIX(StencilMaskSeparate):
popq %rbp
popq %rsi
popq %rdi
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15222,7 +15680,7 @@ GL_PREFIX(StencilMaskSeparate):
popq %rbp
popq %rsi
popq %rdi
- movq 3272(%rax), %r11
+ movq 3376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate)
@@ -15233,7 +15691,7 @@ GL_PREFIX(StencilMaskSeparate):
GL_PREFIX(StencilOpSeparate):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15247,13 +15705,13 @@ GL_PREFIX(StencilOpSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15267,36 +15725,306 @@ GL_PREFIX(StencilOpSeparate):
popq %rdx
popq %rsi
popq %rdi
- movq 3280(%rax), %r11
+ movq 3384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate)
.p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x3fv)
+ .type GL_PREFIX(UniformMatrix2x3fv), @function
+GL_PREFIX(UniformMatrix2x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x4fv)
+ .type GL_PREFIX(UniformMatrix2x4fv), @function
+GL_PREFIX(UniformMatrix2x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x2fv)
+ .type GL_PREFIX(UniformMatrix3x2fv), @function
+GL_PREFIX(UniformMatrix3x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x4fv)
+ .type GL_PREFIX(UniformMatrix3x4fv), @function
+GL_PREFIX(UniformMatrix3x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x2fv)
+ .type GL_PREFIX(UniformMatrix4x2fv), @function
+GL_PREFIX(UniformMatrix4x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x3fv)
+ .type GL_PREFIX(UniformMatrix4x3fv), @function
+GL_PREFIX(UniformMatrix4x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv)
+
+ .p2align 4,,15
.globl GL_PREFIX(LoadTransposeMatrixdARB)
.type GL_PREFIX(LoadTransposeMatrixdARB), @function
GL_PREFIX(LoadTransposeMatrixdARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3288(%rax), %r11
+ movq 3440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB)
@@ -15307,25 +16035,25 @@ GL_PREFIX(LoadTransposeMatrixdARB):
GL_PREFIX(LoadTransposeMatrixfARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3296(%rax), %r11
+ movq 3448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB)
@@ -15336,25 +16064,25 @@ GL_PREFIX(LoadTransposeMatrixfARB):
GL_PREFIX(MultTransposeMatrixdARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3304(%rax), %r11
+ movq 3456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB)
@@ -15365,25 +16093,25 @@ GL_PREFIX(MultTransposeMatrixdARB):
GL_PREFIX(MultTransposeMatrixfARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3312(%rax), %r11
+ movq 3464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB)
@@ -15394,7 +16122,7 @@ GL_PREFIX(MultTransposeMatrixfARB):
GL_PREFIX(SampleCoverageARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15404,13 +16132,13 @@ GL_PREFIX(SampleCoverageARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15420,7 +16148,7 @@ GL_PREFIX(SampleCoverageARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3320(%rax), %r11
+ movq 3472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB)
@@ -15431,7 +16159,7 @@ GL_PREFIX(SampleCoverageARB):
GL_PREFIX(CompressedTexImage1DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15449,13 +16177,13 @@ GL_PREFIX(CompressedTexImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15473,7 +16201,7 @@ GL_PREFIX(CompressedTexImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3328(%rax), %r11
+ movq 3480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB)
@@ -15484,7 +16212,7 @@ GL_PREFIX(CompressedTexImage1DARB):
GL_PREFIX(CompressedTexImage2DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15502,13 +16230,13 @@ GL_PREFIX(CompressedTexImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15526,7 +16254,7 @@ GL_PREFIX(CompressedTexImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3336(%rax), %r11
+ movq 3488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB)
@@ -15537,7 +16265,7 @@ GL_PREFIX(CompressedTexImage2DARB):
GL_PREFIX(CompressedTexImage3DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15555,13 +16283,13 @@ GL_PREFIX(CompressedTexImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15579,7 +16307,7 @@ GL_PREFIX(CompressedTexImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3344(%rax), %r11
+ movq 3496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB)
@@ -15590,7 +16318,7 @@ GL_PREFIX(CompressedTexImage3DARB):
GL_PREFIX(CompressedTexSubImage1DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15608,13 +16336,13 @@ GL_PREFIX(CompressedTexSubImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15632,7 +16360,7 @@ GL_PREFIX(CompressedTexSubImage1DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3352(%rax), %r11
+ movq 3504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB)
@@ -15643,7 +16371,7 @@ GL_PREFIX(CompressedTexSubImage1DARB):
GL_PREFIX(CompressedTexSubImage2DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15661,13 +16389,13 @@ GL_PREFIX(CompressedTexSubImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15685,7 +16413,7 @@ GL_PREFIX(CompressedTexSubImage2DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3360(%rax), %r11
+ movq 3512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB)
@@ -15696,7 +16424,7 @@ GL_PREFIX(CompressedTexSubImage2DARB):
GL_PREFIX(CompressedTexSubImage3DARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15714,13 +16442,13 @@ GL_PREFIX(CompressedTexSubImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15738,7 +16466,7 @@ GL_PREFIX(CompressedTexSubImage3DARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3368(%rax), %r11
+ movq 3520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB)
@@ -15749,7 +16477,7 @@ GL_PREFIX(CompressedTexSubImage3DARB):
GL_PREFIX(GetCompressedTexImageARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15759,13 +16487,13 @@ GL_PREFIX(GetCompressedTexImageARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15775,7 +16503,7 @@ GL_PREFIX(GetCompressedTexImageARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3376(%rax), %r11
+ movq 3528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB)
@@ -15786,25 +16514,25 @@ GL_PREFIX(GetCompressedTexImageARB):
GL_PREFIX(DisableVertexAttribArrayARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3384(%rax), %r11
+ movq 3536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB)
@@ -15815,25 +16543,25 @@ GL_PREFIX(DisableVertexAttribArrayARB):
GL_PREFIX(EnableVertexAttribArrayARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3392(%rax), %r11
+ movq 3544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB)
@@ -15844,7 +16572,7 @@ GL_PREFIX(EnableVertexAttribArrayARB):
GL_PREFIX(GetProgramEnvParameterdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15854,13 +16582,13 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15870,7 +16598,7 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3400(%rax), %r11
+ movq 3552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB)
@@ -15881,7 +16609,7 @@ GL_PREFIX(GetProgramEnvParameterdvARB):
GL_PREFIX(GetProgramEnvParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15891,13 +16619,13 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15907,7 +16635,7 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3408(%rax), %r11
+ movq 3560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB)
@@ -15918,7 +16646,7 @@ GL_PREFIX(GetProgramEnvParameterfvARB):
GL_PREFIX(GetProgramLocalParameterdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15928,13 +16656,13 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15944,7 +16672,7 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3416(%rax), %r11
+ movq 3568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB)
@@ -15955,7 +16683,7 @@ GL_PREFIX(GetProgramLocalParameterdvARB):
GL_PREFIX(GetProgramLocalParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -15965,13 +16693,13 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -15981,7 +16709,7 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3424(%rax), %r11
+ movq 3576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB)
@@ -15992,7 +16720,7 @@ GL_PREFIX(GetProgramLocalParameterfvARB):
GL_PREFIX(GetProgramStringARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16002,13 +16730,13 @@ GL_PREFIX(GetProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16018,7 +16746,7 @@ GL_PREFIX(GetProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3432(%rax), %r11
+ movq 3584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB)
@@ -16029,7 +16757,7 @@ GL_PREFIX(GetProgramStringARB):
GL_PREFIX(GetProgramivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16039,13 +16767,13 @@ GL_PREFIX(GetProgramivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16055,7 +16783,7 @@ GL_PREFIX(GetProgramivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3440(%rax), %r11
+ movq 3592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB)
@@ -16066,7 +16794,7 @@ GL_PREFIX(GetProgramivARB):
GL_PREFIX(GetVertexAttribdvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16076,13 +16804,13 @@ GL_PREFIX(GetVertexAttribdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16092,7 +16820,7 @@ GL_PREFIX(GetVertexAttribdvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3448(%rax), %r11
+ movq 3600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB)
@@ -16103,7 +16831,7 @@ GL_PREFIX(GetVertexAttribdvARB):
GL_PREFIX(GetVertexAttribfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16113,13 +16841,13 @@ GL_PREFIX(GetVertexAttribfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16129,7 +16857,7 @@ GL_PREFIX(GetVertexAttribfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3456(%rax), %r11
+ movq 3608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB)
@@ -16140,7 +16868,7 @@ GL_PREFIX(GetVertexAttribfvARB):
GL_PREFIX(GetVertexAttribivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16150,13 +16878,13 @@ GL_PREFIX(GetVertexAttribivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16166,7 +16894,7 @@ GL_PREFIX(GetVertexAttribivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3464(%rax), %r11
+ movq 3616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB)
@@ -16177,7 +16905,7 @@ GL_PREFIX(GetVertexAttribivARB):
GL_PREFIX(ProgramEnvParameter4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16195,13 +16923,13 @@ GL_PREFIX(ProgramEnvParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16219,7 +16947,7 @@ GL_PREFIX(ProgramEnvParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3472(%rax), %r11
+ movq 3624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB)
@@ -16230,7 +16958,7 @@ GL_PREFIX(ProgramEnvParameter4dARB):
GL_PREFIX(ProgramEnvParameter4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16240,13 +16968,13 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16256,7 +16984,7 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3480(%rax), %r11
+ movq 3632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB)
@@ -16267,7 +16995,7 @@ GL_PREFIX(ProgramEnvParameter4dvARB):
GL_PREFIX(ProgramEnvParameter4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16285,13 +17013,13 @@ GL_PREFIX(ProgramEnvParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16309,7 +17037,7 @@ GL_PREFIX(ProgramEnvParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3488(%rax), %r11
+ movq 3640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB)
@@ -16320,7 +17048,7 @@ GL_PREFIX(ProgramEnvParameter4fARB):
GL_PREFIX(ProgramEnvParameter4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16330,13 +17058,13 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16346,7 +17074,7 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3496(%rax), %r11
+ movq 3648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB)
@@ -16357,7 +17085,7 @@ GL_PREFIX(ProgramEnvParameter4fvARB):
GL_PREFIX(ProgramLocalParameter4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16375,13 +17103,13 @@ GL_PREFIX(ProgramLocalParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16399,7 +17127,7 @@ GL_PREFIX(ProgramLocalParameter4dARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3504(%rax), %r11
+ movq 3656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB)
@@ -16410,7 +17138,7 @@ GL_PREFIX(ProgramLocalParameter4dARB):
GL_PREFIX(ProgramLocalParameter4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16420,13 +17148,13 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16436,7 +17164,7 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3512(%rax), %r11
+ movq 3664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB)
@@ -16447,7 +17175,7 @@ GL_PREFIX(ProgramLocalParameter4dvARB):
GL_PREFIX(ProgramLocalParameter4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -16465,13 +17193,13 @@ GL_PREFIX(ProgramLocalParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -16489,7 +17217,7 @@ GL_PREFIX(ProgramLocalParameter4fARB):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 3520(%rax), %r11
+ movq 3672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB)
@@ -16500,7 +17228,7 @@ GL_PREFIX(ProgramLocalParameter4fARB):
GL_PREFIX(ProgramLocalParameter4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16510,13 +17238,13 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16526,7 +17254,7 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3528(%rax), %r11
+ movq 3680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB)
@@ -16537,7 +17265,7 @@ GL_PREFIX(ProgramLocalParameter4fvARB):
GL_PREFIX(ProgramStringARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16551,13 +17279,13 @@ GL_PREFIX(ProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16571,7 +17299,7 @@ GL_PREFIX(ProgramStringARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3536(%rax), %r11
+ movq 3688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB)
@@ -16582,7 +17310,7 @@ GL_PREFIX(ProgramStringARB):
GL_PREFIX(VertexAttrib1dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16592,13 +17320,13 @@ GL_PREFIX(VertexAttrib1dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16608,7 +17336,7 @@ GL_PREFIX(VertexAttrib1dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3544(%rax), %r11
+ movq 3696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB)
@@ -16619,7 +17347,7 @@ GL_PREFIX(VertexAttrib1dARB):
GL_PREFIX(VertexAttrib1dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16629,13 +17357,13 @@ GL_PREFIX(VertexAttrib1dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16645,7 +17373,7 @@ GL_PREFIX(VertexAttrib1dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3552(%rax), %r11
+ movq 3704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB)
@@ -16656,7 +17384,7 @@ GL_PREFIX(VertexAttrib1dvARB):
GL_PREFIX(VertexAttrib1fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16666,13 +17394,13 @@ GL_PREFIX(VertexAttrib1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16682,7 +17410,7 @@ GL_PREFIX(VertexAttrib1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3560(%rax), %r11
+ movq 3712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB)
@@ -16693,7 +17421,7 @@ GL_PREFIX(VertexAttrib1fARB):
GL_PREFIX(VertexAttrib1fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16703,13 +17431,13 @@ GL_PREFIX(VertexAttrib1fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16719,7 +17447,7 @@ GL_PREFIX(VertexAttrib1fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3568(%rax), %r11
+ movq 3720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB)
@@ -16730,7 +17458,7 @@ GL_PREFIX(VertexAttrib1fvARB):
GL_PREFIX(VertexAttrib1sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16740,13 +17468,13 @@ GL_PREFIX(VertexAttrib1sARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16756,7 +17484,7 @@ GL_PREFIX(VertexAttrib1sARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3576(%rax), %r11
+ movq 3728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB)
@@ -16767,7 +17495,7 @@ GL_PREFIX(VertexAttrib1sARB):
GL_PREFIX(VertexAttrib1svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16777,13 +17505,13 @@ GL_PREFIX(VertexAttrib1svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16793,7 +17521,7 @@ GL_PREFIX(VertexAttrib1svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3584(%rax), %r11
+ movq 3736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB)
@@ -16804,7 +17532,7 @@ GL_PREFIX(VertexAttrib1svARB):
GL_PREFIX(VertexAttrib2dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16816,13 +17544,13 @@ GL_PREFIX(VertexAttrib2dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16834,7 +17562,7 @@ GL_PREFIX(VertexAttrib2dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3592(%rax), %r11
+ movq 3744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB)
@@ -16845,7 +17573,7 @@ GL_PREFIX(VertexAttrib2dARB):
GL_PREFIX(VertexAttrib2dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16855,13 +17583,13 @@ GL_PREFIX(VertexAttrib2dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16871,7 +17599,7 @@ GL_PREFIX(VertexAttrib2dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3600(%rax), %r11
+ movq 3752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB)
@@ -16882,7 +17610,7 @@ GL_PREFIX(VertexAttrib2dvARB):
GL_PREFIX(VertexAttrib2fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -16894,13 +17622,13 @@ GL_PREFIX(VertexAttrib2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -16912,7 +17640,7 @@ GL_PREFIX(VertexAttrib2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 3608(%rax), %r11
+ movq 3760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB)
@@ -16923,7 +17651,7 @@ GL_PREFIX(VertexAttrib2fARB):
GL_PREFIX(VertexAttrib2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16933,13 +17661,13 @@ GL_PREFIX(VertexAttrib2fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16949,7 +17677,7 @@ GL_PREFIX(VertexAttrib2fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3616(%rax), %r11
+ movq 3768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB)
@@ -16960,7 +17688,7 @@ GL_PREFIX(VertexAttrib2fvARB):
GL_PREFIX(VertexAttrib2sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -16970,13 +17698,13 @@ GL_PREFIX(VertexAttrib2sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -16986,7 +17714,7 @@ GL_PREFIX(VertexAttrib2sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3624(%rax), %r11
+ movq 3776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB)
@@ -16997,7 +17725,7 @@ GL_PREFIX(VertexAttrib2sARB):
GL_PREFIX(VertexAttrib2svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17007,13 +17735,13 @@ GL_PREFIX(VertexAttrib2svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17023,7 +17751,7 @@ GL_PREFIX(VertexAttrib2svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3632(%rax), %r11
+ movq 3784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB)
@@ -17034,7 +17762,7 @@ GL_PREFIX(VertexAttrib2svARB):
GL_PREFIX(VertexAttrib3dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17048,13 +17776,13 @@ GL_PREFIX(VertexAttrib3dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17068,7 +17796,7 @@ GL_PREFIX(VertexAttrib3dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3640(%rax), %r11
+ movq 3792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB)
@@ -17079,7 +17807,7 @@ GL_PREFIX(VertexAttrib3dARB):
GL_PREFIX(VertexAttrib3dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17089,13 +17817,13 @@ GL_PREFIX(VertexAttrib3dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17105,7 +17833,7 @@ GL_PREFIX(VertexAttrib3dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3648(%rax), %r11
+ movq 3800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB)
@@ -17116,7 +17844,7 @@ GL_PREFIX(VertexAttrib3dvARB):
GL_PREFIX(VertexAttrib3fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17130,13 +17858,13 @@ GL_PREFIX(VertexAttrib3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17150,7 +17878,7 @@ GL_PREFIX(VertexAttrib3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3656(%rax), %r11
+ movq 3808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB)
@@ -17161,7 +17889,7 @@ GL_PREFIX(VertexAttrib3fARB):
GL_PREFIX(VertexAttrib3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17171,13 +17899,13 @@ GL_PREFIX(VertexAttrib3fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17187,7 +17915,7 @@ GL_PREFIX(VertexAttrib3fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3664(%rax), %r11
+ movq 3816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB)
@@ -17198,7 +17926,7 @@ GL_PREFIX(VertexAttrib3fvARB):
GL_PREFIX(VertexAttrib3sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17212,13 +17940,13 @@ GL_PREFIX(VertexAttrib3sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17232,7 +17960,7 @@ GL_PREFIX(VertexAttrib3sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3672(%rax), %r11
+ movq 3824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB)
@@ -17243,7 +17971,7 @@ GL_PREFIX(VertexAttrib3sARB):
GL_PREFIX(VertexAttrib3svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17253,13 +17981,13 @@ GL_PREFIX(VertexAttrib3svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17269,7 +17997,7 @@ GL_PREFIX(VertexAttrib3svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3680(%rax), %r11
+ movq 3832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB)
@@ -17280,7 +18008,7 @@ GL_PREFIX(VertexAttrib3svARB):
GL_PREFIX(VertexAttrib4NbvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17290,13 +18018,13 @@ GL_PREFIX(VertexAttrib4NbvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17306,7 +18034,7 @@ GL_PREFIX(VertexAttrib4NbvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3688(%rax), %r11
+ movq 3840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB)
@@ -17317,7 +18045,7 @@ GL_PREFIX(VertexAttrib4NbvARB):
GL_PREFIX(VertexAttrib4NivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17327,13 +18055,13 @@ GL_PREFIX(VertexAttrib4NivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17343,7 +18071,7 @@ GL_PREFIX(VertexAttrib4NivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3696(%rax), %r11
+ movq 3848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB)
@@ -17354,7 +18082,7 @@ GL_PREFIX(VertexAttrib4NivARB):
GL_PREFIX(VertexAttrib4NsvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17364,13 +18092,13 @@ GL_PREFIX(VertexAttrib4NsvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17380,7 +18108,7 @@ GL_PREFIX(VertexAttrib4NsvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3704(%rax), %r11
+ movq 3856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB)
@@ -17391,7 +18119,7 @@ GL_PREFIX(VertexAttrib4NsvARB):
GL_PREFIX(VertexAttrib4NubARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17405,13 +18133,13 @@ GL_PREFIX(VertexAttrib4NubARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17425,7 +18153,7 @@ GL_PREFIX(VertexAttrib4NubARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3712(%rax), %r11
+ movq 3864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB)
@@ -17436,7 +18164,7 @@ GL_PREFIX(VertexAttrib4NubARB):
GL_PREFIX(VertexAttrib4NubvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17446,13 +18174,13 @@ GL_PREFIX(VertexAttrib4NubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17462,7 +18190,7 @@ GL_PREFIX(VertexAttrib4NubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3720(%rax), %r11
+ movq 3872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB)
@@ -17473,7 +18201,7 @@ GL_PREFIX(VertexAttrib4NubvARB):
GL_PREFIX(VertexAttrib4NuivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17483,13 +18211,13 @@ GL_PREFIX(VertexAttrib4NuivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17499,7 +18227,7 @@ GL_PREFIX(VertexAttrib4NuivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3728(%rax), %r11
+ movq 3880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB)
@@ -17510,7 +18238,7 @@ GL_PREFIX(VertexAttrib4NuivARB):
GL_PREFIX(VertexAttrib4NusvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17520,13 +18248,13 @@ GL_PREFIX(VertexAttrib4NusvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17536,7 +18264,7 @@ GL_PREFIX(VertexAttrib4NusvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3736(%rax), %r11
+ movq 3888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB)
@@ -17547,7 +18275,7 @@ GL_PREFIX(VertexAttrib4NusvARB):
GL_PREFIX(VertexAttrib4bvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17557,13 +18285,13 @@ GL_PREFIX(VertexAttrib4bvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17573,7 +18301,7 @@ GL_PREFIX(VertexAttrib4bvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3744(%rax), %r11
+ movq 3896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB)
@@ -17584,7 +18312,7 @@ GL_PREFIX(VertexAttrib4bvARB):
GL_PREFIX(VertexAttrib4dARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17600,13 +18328,13 @@ GL_PREFIX(VertexAttrib4dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17622,7 +18350,7 @@ GL_PREFIX(VertexAttrib4dARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3752(%rax), %r11
+ movq 3904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB)
@@ -17633,7 +18361,7 @@ GL_PREFIX(VertexAttrib4dARB):
GL_PREFIX(VertexAttrib4dvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17643,13 +18371,13 @@ GL_PREFIX(VertexAttrib4dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17659,7 +18387,7 @@ GL_PREFIX(VertexAttrib4dvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3760(%rax), %r11
+ movq 3912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB)
@@ -17670,7 +18398,7 @@ GL_PREFIX(VertexAttrib4dvARB):
GL_PREFIX(VertexAttrib4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -17686,13 +18414,13 @@ GL_PREFIX(VertexAttrib4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -17708,7 +18436,7 @@ GL_PREFIX(VertexAttrib4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 3768(%rax), %r11
+ movq 3920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB)
@@ -17719,7 +18447,7 @@ GL_PREFIX(VertexAttrib4fARB):
GL_PREFIX(VertexAttrib4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17729,13 +18457,13 @@ GL_PREFIX(VertexAttrib4fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17745,7 +18473,7 @@ GL_PREFIX(VertexAttrib4fvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3776(%rax), %r11
+ movq 3928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB)
@@ -17756,7 +18484,7 @@ GL_PREFIX(VertexAttrib4fvARB):
GL_PREFIX(VertexAttrib4ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17766,13 +18494,13 @@ GL_PREFIX(VertexAttrib4ivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17782,7 +18510,7 @@ GL_PREFIX(VertexAttrib4ivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3784(%rax), %r11
+ movq 3936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB)
@@ -17793,7 +18521,7 @@ GL_PREFIX(VertexAttrib4ivARB):
GL_PREFIX(VertexAttrib4sARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17807,13 +18535,13 @@ GL_PREFIX(VertexAttrib4sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17827,7 +18555,7 @@ GL_PREFIX(VertexAttrib4sARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3792(%rax), %r11
+ movq 3944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB)
@@ -17838,7 +18566,7 @@ GL_PREFIX(VertexAttrib4sARB):
GL_PREFIX(VertexAttrib4svARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17848,13 +18576,13 @@ GL_PREFIX(VertexAttrib4svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17864,7 +18592,7 @@ GL_PREFIX(VertexAttrib4svARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3800(%rax), %r11
+ movq 3952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB)
@@ -17875,7 +18603,7 @@ GL_PREFIX(VertexAttrib4svARB):
GL_PREFIX(VertexAttrib4ubvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17885,13 +18613,13 @@ GL_PREFIX(VertexAttrib4ubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17901,7 +18629,7 @@ GL_PREFIX(VertexAttrib4ubvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3808(%rax), %r11
+ movq 3960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB)
@@ -17912,7 +18640,7 @@ GL_PREFIX(VertexAttrib4ubvARB):
GL_PREFIX(VertexAttrib4uivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17922,13 +18650,13 @@ GL_PREFIX(VertexAttrib4uivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17938,7 +18666,7 @@ GL_PREFIX(VertexAttrib4uivARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3816(%rax), %r11
+ movq 3968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB)
@@ -17949,7 +18677,7 @@ GL_PREFIX(VertexAttrib4uivARB):
GL_PREFIX(VertexAttrib4usvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -17959,13 +18687,13 @@ GL_PREFIX(VertexAttrib4usvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -17975,7 +18703,7 @@ GL_PREFIX(VertexAttrib4usvARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3824(%rax), %r11
+ movq 3976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB)
@@ -17986,7 +18714,7 @@ GL_PREFIX(VertexAttrib4usvARB):
GL_PREFIX(VertexAttribPointerARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18004,13 +18732,13 @@ GL_PREFIX(VertexAttribPointerARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18028,7 +18756,7 @@ GL_PREFIX(VertexAttribPointerARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3832(%rax), %r11
+ movq 3984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB)
@@ -18039,7 +18767,7 @@ GL_PREFIX(VertexAttribPointerARB):
GL_PREFIX(BindBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18049,13 +18777,13 @@ GL_PREFIX(BindBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18065,7 +18793,7 @@ GL_PREFIX(BindBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3840(%rax), %r11
+ movq 3992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB)
@@ -18076,7 +18804,7 @@ GL_PREFIX(BindBufferARB):
GL_PREFIX(BufferDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18090,13 +18818,13 @@ GL_PREFIX(BufferDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18110,7 +18838,7 @@ GL_PREFIX(BufferDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3848(%rax), %r11
+ movq 4000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB)
@@ -18121,7 +18849,7 @@ GL_PREFIX(BufferDataARB):
GL_PREFIX(BufferSubDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18135,13 +18863,13 @@ GL_PREFIX(BufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18155,7 +18883,7 @@ GL_PREFIX(BufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3856(%rax), %r11
+ movq 4008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB)
@@ -18166,7 +18894,7 @@ GL_PREFIX(BufferSubDataARB):
GL_PREFIX(DeleteBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18176,13 +18904,13 @@ GL_PREFIX(DeleteBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18192,7 +18920,7 @@ GL_PREFIX(DeleteBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3864(%rax), %r11
+ movq 4016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB)
@@ -18203,7 +18931,7 @@ GL_PREFIX(DeleteBuffersARB):
GL_PREFIX(GenBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18213,13 +18941,13 @@ GL_PREFIX(GenBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18229,7 +18957,7 @@ GL_PREFIX(GenBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3872(%rax), %r11
+ movq 4024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB)
@@ -18240,7 +18968,7 @@ GL_PREFIX(GenBuffersARB):
GL_PREFIX(GetBufferParameterivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18250,13 +18978,13 @@ GL_PREFIX(GetBufferParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18266,7 +18994,7 @@ GL_PREFIX(GetBufferParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3880(%rax), %r11
+ movq 4032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB)
@@ -18277,7 +19005,7 @@ GL_PREFIX(GetBufferParameterivARB):
GL_PREFIX(GetBufferPointervARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18287,13 +19015,13 @@ GL_PREFIX(GetBufferPointervARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18303,7 +19031,7 @@ GL_PREFIX(GetBufferPointervARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3888(%rax), %r11
+ movq 4040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB)
@@ -18314,7 +19042,7 @@ GL_PREFIX(GetBufferPointervARB):
GL_PREFIX(GetBufferSubDataARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18328,13 +19056,13 @@ GL_PREFIX(GetBufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18348,7 +19076,7 @@ GL_PREFIX(GetBufferSubDataARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3896(%rax), %r11
+ movq 4048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB)
@@ -18359,25 +19087,25 @@ GL_PREFIX(GetBufferSubDataARB):
GL_PREFIX(IsBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3904(%rax), %r11
+ movq 4056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB)
@@ -18388,7 +19116,7 @@ GL_PREFIX(IsBufferARB):
GL_PREFIX(MapBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18398,13 +19126,13 @@ GL_PREFIX(MapBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18414,7 +19142,7 @@ GL_PREFIX(MapBufferARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3912(%rax), %r11
+ movq 4064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB)
@@ -18425,25 +19153,25 @@ GL_PREFIX(MapBufferARB):
GL_PREFIX(UnmapBufferARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3920(%rax), %r11
+ movq 4072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB)
@@ -18454,7 +19182,7 @@ GL_PREFIX(UnmapBufferARB):
GL_PREFIX(BeginQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18464,13 +19192,13 @@ GL_PREFIX(BeginQueryARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18480,7 +19208,7 @@ GL_PREFIX(BeginQueryARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3928(%rax), %r11
+ movq 4080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB)
@@ -18491,7 +19219,7 @@ GL_PREFIX(BeginQueryARB):
GL_PREFIX(DeleteQueriesARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18501,13 +19229,13 @@ GL_PREFIX(DeleteQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18517,7 +19245,7 @@ GL_PREFIX(DeleteQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3936(%rax), %r11
+ movq 4088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB)
@@ -18528,25 +19256,25 @@ GL_PREFIX(DeleteQueriesARB):
GL_PREFIX(EndQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3944(%rax), %r11
+ movq 4096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB)
@@ -18557,7 +19285,7 @@ GL_PREFIX(EndQueryARB):
GL_PREFIX(GenQueriesARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18567,13 +19295,13 @@ GL_PREFIX(GenQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18583,7 +19311,7 @@ GL_PREFIX(GenQueriesARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3952(%rax), %r11
+ movq 4104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB)
@@ -18594,7 +19322,7 @@ GL_PREFIX(GenQueriesARB):
GL_PREFIX(GetQueryObjectivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18604,13 +19332,13 @@ GL_PREFIX(GetQueryObjectivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18620,7 +19348,7 @@ GL_PREFIX(GetQueryObjectivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3960(%rax), %r11
+ movq 4112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB)
@@ -18631,7 +19359,7 @@ GL_PREFIX(GetQueryObjectivARB):
GL_PREFIX(GetQueryObjectuivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18641,13 +19369,13 @@ GL_PREFIX(GetQueryObjectuivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18657,7 +19385,7 @@ GL_PREFIX(GetQueryObjectuivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3968(%rax), %r11
+ movq 4120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB)
@@ -18668,7 +19396,7 @@ GL_PREFIX(GetQueryObjectuivARB):
GL_PREFIX(GetQueryivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18678,13 +19406,13 @@ GL_PREFIX(GetQueryivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18694,7 +19422,7 @@ GL_PREFIX(GetQueryivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 3976(%rax), %r11
+ movq 4128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB)
@@ -18705,25 +19433,25 @@ GL_PREFIX(GetQueryivARB):
GL_PREFIX(IsQueryARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 3984(%rax), %r11
+ movq 4136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB)
@@ -18734,7 +19462,7 @@ GL_PREFIX(IsQueryARB):
GL_PREFIX(AttachObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18744,13 +19472,13 @@ GL_PREFIX(AttachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18760,7 +19488,7 @@ GL_PREFIX(AttachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 3992(%rax), %r11
+ movq 4144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB)
@@ -18771,25 +19499,25 @@ GL_PREFIX(AttachObjectARB):
GL_PREFIX(CompileShaderARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4000(%rax), %r11
+ movq 4152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB)
@@ -18800,25 +19528,25 @@ GL_PREFIX(CompileShaderARB):
GL_PREFIX(CreateProgramObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4008(%rax), %r11
+ movq 4160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB)
@@ -18829,25 +19557,25 @@ GL_PREFIX(CreateProgramObjectARB):
GL_PREFIX(CreateShaderObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4016(%rax), %r11
+ movq 4168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB)
@@ -18858,25 +19586,25 @@ GL_PREFIX(CreateShaderObjectARB):
GL_PREFIX(DeleteObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4024(%rax), %r11
+ movq 4176(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB)
@@ -18887,7 +19615,7 @@ GL_PREFIX(DeleteObjectARB):
GL_PREFIX(DetachObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18897,13 +19625,13 @@ GL_PREFIX(DetachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18913,7 +19641,7 @@ GL_PREFIX(DetachObjectARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4032(%rax), %r11
+ movq 4184(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB)
@@ -18924,7 +19652,7 @@ GL_PREFIX(DetachObjectARB):
GL_PREFIX(GetActiveUniformARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18942,13 +19670,13 @@ GL_PREFIX(GetActiveUniformARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -18966,7 +19694,7 @@ GL_PREFIX(GetActiveUniformARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4040(%rax), %r11
+ movq 4192(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB)
@@ -18977,7 +19705,7 @@ GL_PREFIX(GetActiveUniformARB):
GL_PREFIX(GetAttachedObjectsARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -18991,13 +19719,13 @@ GL_PREFIX(GetAttachedObjectsARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19011,7 +19739,7 @@ GL_PREFIX(GetAttachedObjectsARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4048(%rax), %r11
+ movq 4200(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB)
@@ -19022,25 +19750,25 @@ GL_PREFIX(GetAttachedObjectsARB):
GL_PREFIX(GetHandleARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4056(%rax), %r11
+ movq 4208(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB)
@@ -19051,7 +19779,7 @@ GL_PREFIX(GetHandleARB):
GL_PREFIX(GetInfoLogARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19065,13 +19793,13 @@ GL_PREFIX(GetInfoLogARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19085,7 +19813,7 @@ GL_PREFIX(GetInfoLogARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4064(%rax), %r11
+ movq 4216(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB)
@@ -19096,7 +19824,7 @@ GL_PREFIX(GetInfoLogARB):
GL_PREFIX(GetObjectParameterfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19106,13 +19834,13 @@ GL_PREFIX(GetObjectParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19122,7 +19850,7 @@ GL_PREFIX(GetObjectParameterfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4072(%rax), %r11
+ movq 4224(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB)
@@ -19133,7 +19861,7 @@ GL_PREFIX(GetObjectParameterfvARB):
GL_PREFIX(GetObjectParameterivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19143,13 +19871,13 @@ GL_PREFIX(GetObjectParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19159,7 +19887,7 @@ GL_PREFIX(GetObjectParameterivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4080(%rax), %r11
+ movq 4232(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB)
@@ -19170,7 +19898,7 @@ GL_PREFIX(GetObjectParameterivARB):
GL_PREFIX(GetShaderSourceARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19184,13 +19912,13 @@ GL_PREFIX(GetShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19204,7 +19932,7 @@ GL_PREFIX(GetShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4088(%rax), %r11
+ movq 4240(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB)
@@ -19215,7 +19943,7 @@ GL_PREFIX(GetShaderSourceARB):
GL_PREFIX(GetUniformLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19225,13 +19953,13 @@ GL_PREFIX(GetUniformLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19241,7 +19969,7 @@ GL_PREFIX(GetUniformLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4096(%rax), %r11
+ movq 4248(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB)
@@ -19252,7 +19980,7 @@ GL_PREFIX(GetUniformLocationARB):
GL_PREFIX(GetUniformfvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19262,13 +19990,13 @@ GL_PREFIX(GetUniformfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19278,7 +20006,7 @@ GL_PREFIX(GetUniformfvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4104(%rax), %r11
+ movq 4256(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB)
@@ -19289,7 +20017,7 @@ GL_PREFIX(GetUniformfvARB):
GL_PREFIX(GetUniformivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19299,13 +20027,13 @@ GL_PREFIX(GetUniformivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19315,7 +20043,7 @@ GL_PREFIX(GetUniformivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4112(%rax), %r11
+ movq 4264(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB)
@@ -19326,25 +20054,25 @@ GL_PREFIX(GetUniformivARB):
GL_PREFIX(LinkProgramARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4120(%rax), %r11
+ movq 4272(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB)
@@ -19355,7 +20083,7 @@ GL_PREFIX(LinkProgramARB):
GL_PREFIX(ShaderSourceARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19369,13 +20097,13 @@ GL_PREFIX(ShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19389,7 +20117,7 @@ GL_PREFIX(ShaderSourceARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4128(%rax), %r11
+ movq 4280(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB)
@@ -19400,7 +20128,7 @@ GL_PREFIX(ShaderSourceARB):
GL_PREFIX(Uniform1fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -19410,13 +20138,13 @@ GL_PREFIX(Uniform1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -19426,7 +20154,7 @@ GL_PREFIX(Uniform1fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4136(%rax), %r11
+ movq 4288(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB)
@@ -19437,7 +20165,7 @@ GL_PREFIX(Uniform1fARB):
GL_PREFIX(Uniform1fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19447,13 +20175,13 @@ GL_PREFIX(Uniform1fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19463,7 +20191,7 @@ GL_PREFIX(Uniform1fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4144(%rax), %r11
+ movq 4296(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB)
@@ -19474,7 +20202,7 @@ GL_PREFIX(Uniform1fvARB):
GL_PREFIX(Uniform1iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19484,13 +20212,13 @@ GL_PREFIX(Uniform1iARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19500,7 +20228,7 @@ GL_PREFIX(Uniform1iARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4152(%rax), %r11
+ movq 4304(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB)
@@ -19511,7 +20239,7 @@ GL_PREFIX(Uniform1iARB):
GL_PREFIX(Uniform1ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19521,13 +20249,13 @@ GL_PREFIX(Uniform1ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19537,7 +20265,7 @@ GL_PREFIX(Uniform1ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4160(%rax), %r11
+ movq 4312(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB)
@@ -19548,7 +20276,7 @@ GL_PREFIX(Uniform1ivARB):
GL_PREFIX(Uniform2fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -19560,13 +20288,13 @@ GL_PREFIX(Uniform2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -19578,7 +20306,7 @@ GL_PREFIX(Uniform2fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4168(%rax), %r11
+ movq 4320(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB)
@@ -19589,7 +20317,7 @@ GL_PREFIX(Uniform2fARB):
GL_PREFIX(Uniform2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19599,13 +20327,13 @@ GL_PREFIX(Uniform2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19615,7 +20343,7 @@ GL_PREFIX(Uniform2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4176(%rax), %r11
+ movq 4328(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB)
@@ -19626,7 +20354,7 @@ GL_PREFIX(Uniform2fvARB):
GL_PREFIX(Uniform2iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19636,13 +20364,13 @@ GL_PREFIX(Uniform2iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19652,7 +20380,7 @@ GL_PREFIX(Uniform2iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4184(%rax), %r11
+ movq 4336(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB)
@@ -19663,7 +20391,7 @@ GL_PREFIX(Uniform2iARB):
GL_PREFIX(Uniform2ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19673,13 +20401,13 @@ GL_PREFIX(Uniform2ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19689,7 +20417,7 @@ GL_PREFIX(Uniform2ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4192(%rax), %r11
+ movq 4344(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB)
@@ -19700,7 +20428,7 @@ GL_PREFIX(Uniform2ivARB):
GL_PREFIX(Uniform3fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -19714,13 +20442,13 @@ GL_PREFIX(Uniform3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -19734,7 +20462,7 @@ GL_PREFIX(Uniform3fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4200(%rax), %r11
+ movq 4352(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB)
@@ -19745,7 +20473,7 @@ GL_PREFIX(Uniform3fARB):
GL_PREFIX(Uniform3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19755,13 +20483,13 @@ GL_PREFIX(Uniform3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19771,7 +20499,7 @@ GL_PREFIX(Uniform3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4208(%rax), %r11
+ movq 4360(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB)
@@ -19782,7 +20510,7 @@ GL_PREFIX(Uniform3fvARB):
GL_PREFIX(Uniform3iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19796,13 +20524,13 @@ GL_PREFIX(Uniform3iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19816,7 +20544,7 @@ GL_PREFIX(Uniform3iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4216(%rax), %r11
+ movq 4368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB)
@@ -19827,7 +20555,7 @@ GL_PREFIX(Uniform3iARB):
GL_PREFIX(Uniform3ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19837,13 +20565,13 @@ GL_PREFIX(Uniform3ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19853,7 +20581,7 @@ GL_PREFIX(Uniform3ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4224(%rax), %r11
+ movq 4376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB)
@@ -19864,7 +20592,7 @@ GL_PREFIX(Uniform3ivARB):
GL_PREFIX(Uniform4fARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -19880,13 +20608,13 @@ GL_PREFIX(Uniform4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -19902,7 +20630,7 @@ GL_PREFIX(Uniform4fARB):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 4232(%rax), %r11
+ movq 4384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB)
@@ -19913,7 +20641,7 @@ GL_PREFIX(Uniform4fARB):
GL_PREFIX(Uniform4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19923,13 +20651,13 @@ GL_PREFIX(Uniform4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19939,7 +20667,7 @@ GL_PREFIX(Uniform4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4240(%rax), %r11
+ movq 4392(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB)
@@ -19950,7 +20678,7 @@ GL_PREFIX(Uniform4fvARB):
GL_PREFIX(Uniform4iARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -19964,13 +20692,13 @@ GL_PREFIX(Uniform4iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -19984,7 +20712,7 @@ GL_PREFIX(Uniform4iARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4248(%rax), %r11
+ movq 4400(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB)
@@ -19995,7 +20723,7 @@ GL_PREFIX(Uniform4iARB):
GL_PREFIX(Uniform4ivARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20005,13 +20733,13 @@ GL_PREFIX(Uniform4ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20021,7 +20749,7 @@ GL_PREFIX(Uniform4ivARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4256(%rax), %r11
+ movq 4408(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB)
@@ -20032,7 +20760,7 @@ GL_PREFIX(Uniform4ivARB):
GL_PREFIX(UniformMatrix2fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20046,13 +20774,13 @@ GL_PREFIX(UniformMatrix2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20066,7 +20794,7 @@ GL_PREFIX(UniformMatrix2fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4264(%rax), %r11
+ movq 4416(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB)
@@ -20077,7 +20805,7 @@ GL_PREFIX(UniformMatrix2fvARB):
GL_PREFIX(UniformMatrix3fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20091,13 +20819,13 @@ GL_PREFIX(UniformMatrix3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20111,7 +20839,7 @@ GL_PREFIX(UniformMatrix3fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4272(%rax), %r11
+ movq 4424(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB)
@@ -20122,7 +20850,7 @@ GL_PREFIX(UniformMatrix3fvARB):
GL_PREFIX(UniformMatrix4fvARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20136,13 +20864,13 @@ GL_PREFIX(UniformMatrix4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20156,7 +20884,7 @@ GL_PREFIX(UniformMatrix4fvARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4280(%rax), %r11
+ movq 4432(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB)
@@ -20167,25 +20895,25 @@ GL_PREFIX(UniformMatrix4fvARB):
GL_PREFIX(UseProgramObjectARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4288(%rax), %r11
+ movq 4440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB)
@@ -20196,25 +20924,25 @@ GL_PREFIX(UseProgramObjectARB):
GL_PREFIX(ValidateProgramARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4296(%rax), %r11
+ movq 4448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB)
@@ -20225,7 +20953,7 @@ GL_PREFIX(ValidateProgramARB):
GL_PREFIX(BindAttribLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20235,13 +20963,13 @@ GL_PREFIX(BindAttribLocationARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20251,7 +20979,7 @@ GL_PREFIX(BindAttribLocationARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4304(%rax), %r11
+ movq 4456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB)
@@ -20262,7 +20990,7 @@ GL_PREFIX(BindAttribLocationARB):
GL_PREFIX(GetActiveAttribARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20280,13 +21008,13 @@ GL_PREFIX(GetActiveAttribARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20304,7 +21032,7 @@ GL_PREFIX(GetActiveAttribARB):
popq %rdx
popq %rsi
popq %rdi
- movq 4312(%rax), %r11
+ movq 4464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB)
@@ -20315,7 +21043,7 @@ GL_PREFIX(GetActiveAttribARB):
GL_PREFIX(GetAttribLocationARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20325,13 +21053,13 @@ GL_PREFIX(GetAttribLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20341,7 +21069,7 @@ GL_PREFIX(GetAttribLocationARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4320(%rax), %r11
+ movq 4472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB)
@@ -20352,7 +21080,7 @@ GL_PREFIX(GetAttribLocationARB):
GL_PREFIX(DrawBuffersARB):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20362,13 +21090,13 @@ GL_PREFIX(DrawBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20378,7 +21106,7 @@ GL_PREFIX(DrawBuffersARB):
popq %rbp
popq %rsi
popq %rdi
- movq 4328(%rax), %r11
+ movq 4480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
@@ -20389,7 +21117,7 @@ GL_PREFIX(DrawBuffersARB):
GL_PREFIX(PolygonOffsetEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -20399,13 +21127,13 @@ GL_PREFIX(PolygonOffsetEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -20415,19 +21143,19 @@ GL_PREFIX(PolygonOffsetEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4336(%rax), %r11
+ movq 4488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_543)
- .type GL_PREFIX(_dispatch_stub_543), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_543))
-GL_PREFIX(_dispatch_stub_543):
+ .globl GL_PREFIX(_dispatch_stub_562)
+ .type GL_PREFIX(_dispatch_stub_562), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_562))
+GL_PREFIX(_dispatch_stub_562):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4344(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20437,13 +21165,13 @@ GL_PREFIX(_dispatch_stub_543):
popq %rbp
popq %rsi
popq %rdi
- movq 4344(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4344(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20453,19 +21181,19 @@ GL_PREFIX(_dispatch_stub_543):
popq %rbp
popq %rsi
popq %rdi
- movq 4344(%rax), %r11
+ movq 4496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_543), .-GL_PREFIX(_dispatch_stub_543)
+ .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_544)
- .type GL_PREFIX(_dispatch_stub_544), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_544))
-GL_PREFIX(_dispatch_stub_544):
+ .globl GL_PREFIX(_dispatch_stub_563)
+ .type GL_PREFIX(_dispatch_stub_563), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_563))
+GL_PREFIX(_dispatch_stub_563):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4352(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20475,13 +21203,13 @@ GL_PREFIX(_dispatch_stub_544):
popq %rbp
popq %rsi
popq %rdi
- movq 4352(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4352(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20491,19 +21219,19 @@ GL_PREFIX(_dispatch_stub_544):
popq %rbp
popq %rsi
popq %rdi
- movq 4352(%rax), %r11
+ movq 4504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_544), .-GL_PREFIX(_dispatch_stub_544)
+ .size GL_PREFIX(_dispatch_stub_563), .-GL_PREFIX(_dispatch_stub_563)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_545)
- .type GL_PREFIX(_dispatch_stub_545), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_545))
-GL_PREFIX(_dispatch_stub_545):
+ .globl GL_PREFIX(_dispatch_stub_564)
+ .type GL_PREFIX(_dispatch_stub_564), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_564))
+GL_PREFIX(_dispatch_stub_564):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4360(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -20513,13 +21241,13 @@ GL_PREFIX(_dispatch_stub_545):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4360(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4360(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -20529,19 +21257,19 @@ GL_PREFIX(_dispatch_stub_545):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4360(%rax), %r11
+ movq 4512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_545), .-GL_PREFIX(_dispatch_stub_545)
+ .size GL_PREFIX(_dispatch_stub_564), .-GL_PREFIX(_dispatch_stub_564)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_546)
- .type GL_PREFIX(_dispatch_stub_546), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_546))
-GL_PREFIX(_dispatch_stub_546):
+ .globl GL_PREFIX(_dispatch_stub_565)
+ .type GL_PREFIX(_dispatch_stub_565), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_565))
+GL_PREFIX(_dispatch_stub_565):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4368(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20551,13 +21279,13 @@ GL_PREFIX(_dispatch_stub_546):
popq %rbp
popq %rsi
popq %rdi
- movq 4368(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4368(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20567,19 +21295,19 @@ GL_PREFIX(_dispatch_stub_546):
popq %rbp
popq %rsi
popq %rdi
- movq 4368(%rax), %r11
+ movq 4520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_546), .-GL_PREFIX(_dispatch_stub_546)
+ .size GL_PREFIX(_dispatch_stub_565), .-GL_PREFIX(_dispatch_stub_565)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_547)
- .type GL_PREFIX(_dispatch_stub_547), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_547))
-GL_PREFIX(_dispatch_stub_547):
+ .globl GL_PREFIX(_dispatch_stub_566)
+ .type GL_PREFIX(_dispatch_stub_566), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_566))
+GL_PREFIX(_dispatch_stub_566):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4376(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20589,13 +21317,13 @@ GL_PREFIX(_dispatch_stub_547):
popq %rbp
popq %rsi
popq %rdi
- movq 4376(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4376(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20605,19 +21333,19 @@ GL_PREFIX(_dispatch_stub_547):
popq %rbp
popq %rsi
popq %rdi
- movq 4376(%rax), %r11
+ movq 4528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_547), .-GL_PREFIX(_dispatch_stub_547)
+ .size GL_PREFIX(_dispatch_stub_566), .-GL_PREFIX(_dispatch_stub_566)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_548)
- .type GL_PREFIX(_dispatch_stub_548), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_548))
-GL_PREFIX(_dispatch_stub_548):
+ .globl GL_PREFIX(_dispatch_stub_567)
+ .type GL_PREFIX(_dispatch_stub_567), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_567))
+GL_PREFIX(_dispatch_stub_567):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4384(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20627,13 +21355,13 @@ GL_PREFIX(_dispatch_stub_548):
popq %rbp
popq %rsi
popq %rdi
- movq 4384(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4384(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20643,19 +21371,19 @@ GL_PREFIX(_dispatch_stub_548):
popq %rbp
popq %rsi
popq %rdi
- movq 4384(%rax), %r11
+ movq 4536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_548), .-GL_PREFIX(_dispatch_stub_548)
+ .size GL_PREFIX(_dispatch_stub_567), .-GL_PREFIX(_dispatch_stub_567)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_549)
- .type GL_PREFIX(_dispatch_stub_549), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_549))
-GL_PREFIX(_dispatch_stub_549):
+ .globl GL_PREFIX(_dispatch_stub_568)
+ .type GL_PREFIX(_dispatch_stub_568), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_568))
+GL_PREFIX(_dispatch_stub_568):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4392(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20665,13 +21393,13 @@ GL_PREFIX(_dispatch_stub_549):
popq %rbp
popq %rsi
popq %rdi
- movq 4392(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4392(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20681,40 +21409,40 @@ GL_PREFIX(_dispatch_stub_549):
popq %rbp
popq %rsi
popq %rdi
- movq 4392(%rax), %r11
+ movq 4544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_549), .-GL_PREFIX(_dispatch_stub_549)
+ .size GL_PREFIX(_dispatch_stub_568), .-GL_PREFIX(_dispatch_stub_568)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_550)
- .type GL_PREFIX(_dispatch_stub_550), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_550))
-GL_PREFIX(_dispatch_stub_550):
+ .globl GL_PREFIX(_dispatch_stub_569)
+ .type GL_PREFIX(_dispatch_stub_569), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_569))
+GL_PREFIX(_dispatch_stub_569):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4400(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4400(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4400(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4400(%rax), %r11
+ movq 4552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_550), .-GL_PREFIX(_dispatch_stub_550)
+ .size GL_PREFIX(_dispatch_stub_569), .-GL_PREFIX(_dispatch_stub_569)
.p2align 4,,15
.globl GL_PREFIX(ColorPointerEXT)
@@ -20722,7 +21450,7 @@ GL_PREFIX(_dispatch_stub_550):
GL_PREFIX(ColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4408(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20736,13 +21464,13 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4408(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4408(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20756,7 +21484,7 @@ GL_PREFIX(ColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4408(%rax), %r11
+ movq 4560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
@@ -20767,7 +21495,7 @@ GL_PREFIX(ColorPointerEXT):
GL_PREFIX(EdgeFlagPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4416(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20777,13 +21505,13 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4416(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4416(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20793,7 +21521,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4416(%rax), %r11
+ movq 4568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
@@ -20804,7 +21532,7 @@ GL_PREFIX(EdgeFlagPointerEXT):
GL_PREFIX(IndexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4424(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20818,13 +21546,13 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4424(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4424(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20838,7 +21566,7 @@ GL_PREFIX(IndexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4424(%rax), %r11
+ movq 4576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
@@ -20849,7 +21577,7 @@ GL_PREFIX(IndexPointerEXT):
GL_PREFIX(NormalPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4432(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20863,13 +21591,13 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4432(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4432(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20883,7 +21611,7 @@ GL_PREFIX(NormalPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4432(%rax), %r11
+ movq 4584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
@@ -20894,7 +21622,7 @@ GL_PREFIX(NormalPointerEXT):
GL_PREFIX(TexCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4440(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20908,13 +21636,13 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4440(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4440(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20928,7 +21656,7 @@ GL_PREFIX(TexCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4440(%rax), %r11
+ movq 4592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
@@ -20939,7 +21667,7 @@ GL_PREFIX(TexCoordPointerEXT):
GL_PREFIX(VertexPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4448(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -20953,13 +21681,13 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4448(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4448(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -20973,7 +21701,7 @@ GL_PREFIX(VertexPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4448(%rax), %r11
+ movq 4600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
@@ -20984,7 +21712,7 @@ GL_PREFIX(VertexPointerEXT):
GL_PREFIX(PointParameterfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4456(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -20994,13 +21722,13 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4456(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4456(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21010,7 +21738,7 @@ GL_PREFIX(PointParameterfEXT):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4456(%rax), %r11
+ movq 4608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
@@ -21021,7 +21749,7 @@ GL_PREFIX(PointParameterfEXT):
GL_PREFIX(PointParameterfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4464(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21031,13 +21759,13 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4464(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4464(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21047,7 +21775,7 @@ GL_PREFIX(PointParameterfvEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4464(%rax), %r11
+ movq 4616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
@@ -21058,7 +21786,7 @@ GL_PREFIX(PointParameterfvEXT):
GL_PREFIX(LockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4472(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21068,13 +21796,13 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4472(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4472(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21084,7 +21812,7 @@ GL_PREFIX(LockArraysEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 4472(%rax), %r11
+ movq 4624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
@@ -21095,37 +21823,37 @@ GL_PREFIX(LockArraysEXT):
GL_PREFIX(UnlockArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4480(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4480(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4480(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4480(%rax), %r11
+ movq 4632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_561)
- .type GL_PREFIX(_dispatch_stub_561), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_561))
-GL_PREFIX(_dispatch_stub_561):
+ .globl GL_PREFIX(_dispatch_stub_580)
+ .type GL_PREFIX(_dispatch_stub_580), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_580))
+GL_PREFIX(_dispatch_stub_580):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4488(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21135,13 +21863,13 @@ GL_PREFIX(_dispatch_stub_561):
popq %rbp
popq %rsi
popq %rdi
- movq 4488(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4488(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21151,19 +21879,19 @@ GL_PREFIX(_dispatch_stub_561):
popq %rbp
popq %rsi
popq %rdi
- movq 4488(%rax), %r11
+ movq 4640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_561), .-GL_PREFIX(_dispatch_stub_561)
+ .size GL_PREFIX(_dispatch_stub_580), .-GL_PREFIX(_dispatch_stub_580)
.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(_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 4496(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21173,13 +21901,13 @@ GL_PREFIX(_dispatch_stub_562):
popq %rbp
popq %rsi
popq %rdi
- movq 4496(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4496(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21189,10 +21917,10 @@ GL_PREFIX(_dispatch_stub_562):
popq %rbp
popq %rsi
popq %rdi
- movq 4496(%rax), %r11
+ movq 4648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_562), .-GL_PREFIX(_dispatch_stub_562)
+ .size GL_PREFIX(_dispatch_stub_581), .-GL_PREFIX(_dispatch_stub_581)
.p2align 4,,15
.globl GL_PREFIX(SecondaryColor3bEXT)
@@ -21200,7 +21928,7 @@ GL_PREFIX(_dispatch_stub_562):
GL_PREFIX(SecondaryColor3bEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4504(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21210,13 +21938,13 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4504(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4504(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21226,7 +21954,7 @@ GL_PREFIX(SecondaryColor3bEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4504(%rax), %r11
+ movq 4656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
@@ -21237,25 +21965,25 @@ GL_PREFIX(SecondaryColor3bEXT):
GL_PREFIX(SecondaryColor3bvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4512(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4512(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4512(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4512(%rax), %r11
+ movq 4664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
@@ -21266,7 +21994,7 @@ GL_PREFIX(SecondaryColor3bvEXT):
GL_PREFIX(SecondaryColor3dEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4520(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21278,13 +22006,13 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4520(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4520(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21296,7 +22024,7 @@ GL_PREFIX(SecondaryColor3dEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4520(%rax), %r11
+ movq 4672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
@@ -21307,25 +22035,25 @@ GL_PREFIX(SecondaryColor3dEXT):
GL_PREFIX(SecondaryColor3dvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4528(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4528(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4528(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4528(%rax), %r11
+ movq 4680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
@@ -21336,7 +22064,7 @@ GL_PREFIX(SecondaryColor3dvEXT):
GL_PREFIX(SecondaryColor3fEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4536(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -21348,13 +22076,13 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4536(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4536(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -21366,7 +22094,7 @@ GL_PREFIX(SecondaryColor3fEXT):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4536(%rax), %r11
+ movq 4688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
@@ -21377,25 +22105,25 @@ GL_PREFIX(SecondaryColor3fEXT):
GL_PREFIX(SecondaryColor3fvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4544(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4544(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4544(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4544(%rax), %r11
+ movq 4696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
@@ -21406,7 +22134,7 @@ GL_PREFIX(SecondaryColor3fvEXT):
GL_PREFIX(SecondaryColor3iEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4552(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21416,13 +22144,13 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4552(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4552(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21432,7 +22160,7 @@ GL_PREFIX(SecondaryColor3iEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4552(%rax), %r11
+ movq 4704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
@@ -21443,25 +22171,25 @@ GL_PREFIX(SecondaryColor3iEXT):
GL_PREFIX(SecondaryColor3ivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4560(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4560(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4560(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4560(%rax), %r11
+ movq 4712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
@@ -21472,7 +22200,7 @@ GL_PREFIX(SecondaryColor3ivEXT):
GL_PREFIX(SecondaryColor3sEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4568(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21482,13 +22210,13 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4568(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21498,7 +22226,7 @@ GL_PREFIX(SecondaryColor3sEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4568(%rax), %r11
+ movq 4720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
@@ -21509,25 +22237,25 @@ GL_PREFIX(SecondaryColor3sEXT):
GL_PREFIX(SecondaryColor3svEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4576(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4576(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4576(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4576(%rax), %r11
+ movq 4728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
@@ -21538,7 +22266,7 @@ GL_PREFIX(SecondaryColor3svEXT):
GL_PREFIX(SecondaryColor3ubEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4584(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21548,13 +22276,13 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4584(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4584(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21564,7 +22292,7 @@ GL_PREFIX(SecondaryColor3ubEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4584(%rax), %r11
+ movq 4736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
@@ -21575,25 +22303,25 @@ GL_PREFIX(SecondaryColor3ubEXT):
GL_PREFIX(SecondaryColor3ubvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4592(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4592(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4592(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4592(%rax), %r11
+ movq 4744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
@@ -21604,7 +22332,7 @@ GL_PREFIX(SecondaryColor3ubvEXT):
GL_PREFIX(SecondaryColor3uiEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4600(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21614,13 +22342,13 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4600(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21630,7 +22358,7 @@ GL_PREFIX(SecondaryColor3uiEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4600(%rax), %r11
+ movq 4752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
@@ -21641,25 +22369,25 @@ GL_PREFIX(SecondaryColor3uiEXT):
GL_PREFIX(SecondaryColor3uivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4608(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4608(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4608(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4608(%rax), %r11
+ movq 4760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
@@ -21670,7 +22398,7 @@ GL_PREFIX(SecondaryColor3uivEXT):
GL_PREFIX(SecondaryColor3usEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4616(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21680,13 +22408,13 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4616(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21696,7 +22424,7 @@ GL_PREFIX(SecondaryColor3usEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4616(%rax), %r11
+ movq 4768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
@@ -21707,25 +22435,25 @@ GL_PREFIX(SecondaryColor3usEXT):
GL_PREFIX(SecondaryColor3usvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4624(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4624(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4624(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4624(%rax), %r11
+ movq 4776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
@@ -21736,7 +22464,7 @@ GL_PREFIX(SecondaryColor3usvEXT):
GL_PREFIX(SecondaryColorPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4632(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21750,13 +22478,13 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4632(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4632(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21770,7 +22498,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4632(%rax), %r11
+ movq 4784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
@@ -21781,7 +22509,7 @@ GL_PREFIX(SecondaryColorPointerEXT):
GL_PREFIX(MultiDrawArraysEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4640(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21795,13 +22523,13 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4640(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4640(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21815,7 +22543,7 @@ GL_PREFIX(MultiDrawArraysEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4640(%rax), %r11
+ movq 4792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
@@ -21826,7 +22554,7 @@ GL_PREFIX(MultiDrawArraysEXT):
GL_PREFIX(MultiDrawElementsEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4648(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21840,13 +22568,13 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4648(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4648(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21860,7 +22588,7 @@ GL_PREFIX(MultiDrawElementsEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4648(%rax), %r11
+ movq 4800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
@@ -21871,7 +22599,7 @@ GL_PREFIX(MultiDrawElementsEXT):
GL_PREFIX(FogCoordPointerEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4656(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -21881,13 +22609,13 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4656(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4656(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -21897,7 +22625,7 @@ GL_PREFIX(FogCoordPointerEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4656(%rax), %r11
+ movq 4808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
@@ -21908,7 +22636,7 @@ GL_PREFIX(FogCoordPointerEXT):
GL_PREFIX(FogCoorddEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4664(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -21916,13 +22644,13 @@ GL_PREFIX(FogCoorddEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4664(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4664(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -21930,7 +22658,7 @@ GL_PREFIX(FogCoorddEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4664(%rax), %r11
+ movq 4816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
@@ -21941,25 +22669,25 @@ GL_PREFIX(FogCoorddEXT):
GL_PREFIX(FogCoorddvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4672(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4672(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4672(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4672(%rax), %r11
+ movq 4824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
@@ -21970,7 +22698,7 @@ GL_PREFIX(FogCoorddvEXT):
GL_PREFIX(FogCoordfEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4680(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $8, %rsp
@@ -21978,13 +22706,13 @@ GL_PREFIX(FogCoordfEXT):
call _x86_64_get_dispatch@PLT
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4680(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4680(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
1:
subq $8, %rsp
@@ -21992,7 +22720,7 @@ GL_PREFIX(FogCoordfEXT):
call _glapi_get_dispatch
movq (%rsp), %xmm0
addq $8, %rsp
- movq 4680(%rax), %r11
+ movq 4832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
@@ -22003,58 +22731,58 @@ GL_PREFIX(FogCoordfEXT):
GL_PREFIX(FogCoordfvEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4688(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4688(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4688(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4688(%rax), %r11
+ movq 4840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_587)
- .type GL_PREFIX(_dispatch_stub_587), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_587))
-GL_PREFIX(_dispatch_stub_587):
+ .globl GL_PREFIX(_dispatch_stub_606)
+ .type GL_PREFIX(_dispatch_stub_606), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_606))
+GL_PREFIX(_dispatch_stub_606):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4696(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4696(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4696(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4696(%rax), %r11
+ movq 4848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_587), .-GL_PREFIX(_dispatch_stub_587)
+ .size GL_PREFIX(_dispatch_stub_606), .-GL_PREFIX(_dispatch_stub_606)
.p2align 4,,15
.globl GL_PREFIX(BlendFuncSeparateEXT)
@@ -22062,7 +22790,7 @@ GL_PREFIX(_dispatch_stub_587):
GL_PREFIX(BlendFuncSeparateEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4704(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22076,13 +22804,13 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4704(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4704(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22096,7 +22824,7 @@ GL_PREFIX(BlendFuncSeparateEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 4704(%rax), %r11
+ movq 4856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
@@ -22107,25 +22835,25 @@ GL_PREFIX(BlendFuncSeparateEXT):
GL_PREFIX(FlushVertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4712(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4712(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4712(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4712(%rax), %r11
+ movq 4864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
@@ -22136,7 +22864,7 @@ GL_PREFIX(FlushVertexArrayRangeNV):
GL_PREFIX(VertexArrayRangeNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4720(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22146,13 +22874,13 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4720(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4720(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22162,7 +22890,7 @@ GL_PREFIX(VertexArrayRangeNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4720(%rax), %r11
+ movq 4872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
@@ -22173,7 +22901,7 @@ GL_PREFIX(VertexArrayRangeNV):
GL_PREFIX(CombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4728(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22191,13 +22919,13 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4728(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4728(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22215,7 +22943,7 @@ GL_PREFIX(CombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4728(%rax), %r11
+ movq 4880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
@@ -22226,7 +22954,7 @@ GL_PREFIX(CombinerInputNV):
GL_PREFIX(CombinerOutputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4736(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22244,13 +22972,13 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4736(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4736(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22268,7 +22996,7 @@ GL_PREFIX(CombinerOutputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4736(%rax), %r11
+ movq 4888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
@@ -22279,7 +23007,7 @@ GL_PREFIX(CombinerOutputNV):
GL_PREFIX(CombinerParameterfNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4744(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22289,13 +23017,13 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4744(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4744(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22305,7 +23033,7 @@ GL_PREFIX(CombinerParameterfNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 4744(%rax), %r11
+ movq 4896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
@@ -22316,7 +23044,7 @@ GL_PREFIX(CombinerParameterfNV):
GL_PREFIX(CombinerParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4752(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22326,13 +23054,13 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4752(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4752(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22342,7 +23070,7 @@ GL_PREFIX(CombinerParameterfvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4752(%rax), %r11
+ movq 4904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
@@ -22353,7 +23081,7 @@ GL_PREFIX(CombinerParameterfvNV):
GL_PREFIX(CombinerParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4760(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22363,13 +23091,13 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4760(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4760(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22379,7 +23107,7 @@ GL_PREFIX(CombinerParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4760(%rax), %r11
+ movq 4912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
@@ -22390,7 +23118,7 @@ GL_PREFIX(CombinerParameteriNV):
GL_PREFIX(CombinerParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4768(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22400,13 +23128,13 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4768(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22416,7 +23144,7 @@ GL_PREFIX(CombinerParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 4768(%rax), %r11
+ movq 4920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
@@ -22427,7 +23155,7 @@ GL_PREFIX(CombinerParameterivNV):
GL_PREFIX(FinalCombinerInputNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4776(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22441,13 +23169,13 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4776(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4776(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22461,7 +23189,7 @@ GL_PREFIX(FinalCombinerInputNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4776(%rax), %r11
+ movq 4928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
@@ -22472,7 +23200,7 @@ GL_PREFIX(FinalCombinerInputNV):
GL_PREFIX(GetCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4784(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22486,13 +23214,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4784(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22506,7 +23234,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4784(%rax), %r11
+ movq 4936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
@@ -22517,7 +23245,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV):
GL_PREFIX(GetCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4792(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22531,13 +23259,13 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4792(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4792(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22551,7 +23279,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4792(%rax), %r11
+ movq 4944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
@@ -22562,7 +23290,7 @@ GL_PREFIX(GetCombinerInputParameterivNV):
GL_PREFIX(GetCombinerOutputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4800(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22576,13 +23304,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4800(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4800(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22596,7 +23324,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4800(%rax), %r11
+ movq 4952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
@@ -22607,7 +23335,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV):
GL_PREFIX(GetCombinerOutputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4808(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22621,13 +23349,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4808(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4808(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22641,7 +23369,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4808(%rax), %r11
+ movq 4960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
@@ -22652,7 +23380,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV):
GL_PREFIX(GetFinalCombinerInputParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4816(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22662,13 +23390,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4816(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4816(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22678,7 +23406,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4816(%rax), %r11
+ movq 4968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
@@ -22689,7 +23417,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV):
GL_PREFIX(GetFinalCombinerInputParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4824(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22699,13 +23427,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4824(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4824(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22715,7 +23443,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 4824(%rax), %r11
+ movq 4976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
@@ -22726,25 +23454,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV):
GL_PREFIX(ResizeBuffersMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4832(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 4832(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4832(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 4832(%rax), %r11
+ movq 4984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
@@ -22755,7 +23483,7 @@ GL_PREFIX(ResizeBuffersMESA):
GL_PREFIX(WindowPos2dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4840(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22765,13 +23493,13 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4840(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4840(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22781,7 +23509,7 @@ GL_PREFIX(WindowPos2dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4840(%rax), %r11
+ movq 4992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
@@ -22792,25 +23520,25 @@ GL_PREFIX(WindowPos2dMESA):
GL_PREFIX(WindowPos2dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4848(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4848(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4848(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4848(%rax), %r11
+ movq 5000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
@@ -22821,7 +23549,7 @@ GL_PREFIX(WindowPos2dvMESA):
GL_PREFIX(WindowPos2fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4856(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -22831,13 +23559,13 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4856(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4856(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -22847,7 +23575,7 @@ GL_PREFIX(WindowPos2fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4856(%rax), %r11
+ movq 5008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
@@ -22858,25 +23586,25 @@ GL_PREFIX(WindowPos2fMESA):
GL_PREFIX(WindowPos2fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4864(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4864(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4864(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4864(%rax), %r11
+ movq 5016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
@@ -22887,7 +23615,7 @@ GL_PREFIX(WindowPos2fvMESA):
GL_PREFIX(WindowPos2iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4872(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22897,13 +23625,13 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 4872(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4872(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22913,7 +23641,7 @@ GL_PREFIX(WindowPos2iMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 4872(%rax), %r11
+ movq 5024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
@@ -22924,25 +23652,25 @@ GL_PREFIX(WindowPos2iMESA):
GL_PREFIX(WindowPos2ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4880(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4880(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4880(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4880(%rax), %r11
+ movq 5032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
@@ -22953,7 +23681,7 @@ GL_PREFIX(WindowPos2ivMESA):
GL_PREFIX(WindowPos2sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4888(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -22963,13 +23691,13 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4888(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -22979,7 +23707,7 @@ GL_PREFIX(WindowPos2sMESA):
popq %rbp
popq %rsi
popq %rdi
- movq 4888(%rax), %r11
+ movq 5040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
@@ -22990,25 +23718,25 @@ GL_PREFIX(WindowPos2sMESA):
GL_PREFIX(WindowPos2svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4896(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4896(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4896(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4896(%rax), %r11
+ movq 5048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
@@ -23019,7 +23747,7 @@ GL_PREFIX(WindowPos2svMESA):
GL_PREFIX(WindowPos3dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4904(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23031,13 +23759,13 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4904(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4904(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23049,7 +23777,7 @@ GL_PREFIX(WindowPos3dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4904(%rax), %r11
+ movq 5056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
@@ -23060,25 +23788,25 @@ GL_PREFIX(WindowPos3dMESA):
GL_PREFIX(WindowPos3dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4912(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4912(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4912(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4912(%rax), %r11
+ movq 5064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
@@ -23089,7 +23817,7 @@ GL_PREFIX(WindowPos3dvMESA):
GL_PREFIX(WindowPos3fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4920(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -23101,13 +23829,13 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4920(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4920(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -23119,7 +23847,7 @@ GL_PREFIX(WindowPos3fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $24, %rsp
- movq 4920(%rax), %r11
+ movq 5072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
@@ -23130,25 +23858,25 @@ GL_PREFIX(WindowPos3fMESA):
GL_PREFIX(WindowPos3fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4928(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4928(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4928(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4928(%rax), %r11
+ movq 5080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
@@ -23159,7 +23887,7 @@ GL_PREFIX(WindowPos3fvMESA):
GL_PREFIX(WindowPos3iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4936(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23169,13 +23897,13 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4936(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23185,7 +23913,7 @@ GL_PREFIX(WindowPos3iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 4936(%rax), %r11
+ movq 5088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
@@ -23196,25 +23924,25 @@ GL_PREFIX(WindowPos3iMESA):
GL_PREFIX(WindowPos3ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4944(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4944(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4944(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4944(%rax), %r11
+ movq 5096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
@@ -23225,7 +23953,7 @@ GL_PREFIX(WindowPos3ivMESA):
GL_PREFIX(WindowPos3sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4952(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23235,13 +23963,13 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4952(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23251,7 +23979,7 @@ GL_PREFIX(WindowPos3sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 4952(%rax), %r11
+ movq 5104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
@@ -23262,25 +23990,25 @@ GL_PREFIX(WindowPos3sMESA):
GL_PREFIX(WindowPos3svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4960(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4960(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4960(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4960(%rax), %r11
+ movq 5112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
@@ -23291,7 +24019,7 @@ GL_PREFIX(WindowPos3svMESA):
GL_PREFIX(WindowPos4dMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4968(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -23305,13 +24033,13 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 4968(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4968(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -23325,7 +24053,7 @@ GL_PREFIX(WindowPos4dMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 4968(%rax), %r11
+ movq 5120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
@@ -23336,25 +24064,25 @@ GL_PREFIX(WindowPos4dMESA):
GL_PREFIX(WindowPos4dvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4976(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4976(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4976(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4976(%rax), %r11
+ movq 5128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
@@ -23365,7 +24093,7 @@ GL_PREFIX(WindowPos4dvMESA):
GL_PREFIX(WindowPos4fMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4984(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -23379,13 +24107,13 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 4984(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4984(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -23399,7 +24127,7 @@ GL_PREFIX(WindowPos4fMESA):
movq 8(%rsp), %xmm1
movq (%rsp), %xmm0
addq $40, %rsp
- movq 4984(%rax), %r11
+ movq 5136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
@@ -23410,25 +24138,25 @@ GL_PREFIX(WindowPos4fMESA):
GL_PREFIX(WindowPos4fvMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 4992(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 4992(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 4992(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 4992(%rax), %r11
+ movq 5144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
@@ -23439,7 +24167,7 @@ GL_PREFIX(WindowPos4fvMESA):
GL_PREFIX(WindowPos4iMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5000(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23453,13 +24181,13 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5000(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5000(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23473,7 +24201,7 @@ GL_PREFIX(WindowPos4iMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5000(%rax), %r11
+ movq 5152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
@@ -23484,25 +24212,25 @@ GL_PREFIX(WindowPos4iMESA):
GL_PREFIX(WindowPos4ivMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5008(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5008(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5008(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5008(%rax), %r11
+ movq 5160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
@@ -23513,7 +24241,7 @@ GL_PREFIX(WindowPos4ivMESA):
GL_PREFIX(WindowPos4sMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5016(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23527,13 +24255,13 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5016(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5016(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23547,7 +24275,7 @@ GL_PREFIX(WindowPos4sMESA):
popq %rdx
popq %rsi
popq %rdi
- movq 5016(%rax), %r11
+ movq 5168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
@@ -23558,37 +24286,37 @@ GL_PREFIX(WindowPos4sMESA):
GL_PREFIX(WindowPos4svMESA):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5024(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5024(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5024(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5024(%rax), %r11
+ movq 5176(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_629)
- .type GL_PREFIX(_dispatch_stub_629), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_629))
-GL_PREFIX(_dispatch_stub_629):
+ .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 5032(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23602,13 +24330,13 @@ GL_PREFIX(_dispatch_stub_629):
popq %rdx
popq %rsi
popq %rdi
- movq 5032(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5032(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23622,19 +24350,19 @@ GL_PREFIX(_dispatch_stub_629):
popq %rdx
popq %rsi
popq %rdi
- movq 5032(%rax), %r11
+ movq 5184(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_629), .-GL_PREFIX(_dispatch_stub_629)
+ .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_630)
- .type GL_PREFIX(_dispatch_stub_630), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_630))
-GL_PREFIX(_dispatch_stub_630):
+ .globl GL_PREFIX(_dispatch_stub_649)
+ .type GL_PREFIX(_dispatch_stub_649), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_649))
+GL_PREFIX(_dispatch_stub_649):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5040(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23652,13 +24380,13 @@ GL_PREFIX(_dispatch_stub_630):
popq %rdx
popq %rsi
popq %rdi
- movq 5040(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5040(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23676,19 +24404,19 @@ GL_PREFIX(_dispatch_stub_630):
popq %rdx
popq %rsi
popq %rdi
- movq 5040(%rax), %r11
+ movq 5192(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_630), .-GL_PREFIX(_dispatch_stub_630)
+ .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_631)
- .type GL_PREFIX(_dispatch_stub_631), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_631))
-GL_PREFIX(_dispatch_stub_631):
+ .globl GL_PREFIX(_dispatch_stub_650)
+ .type GL_PREFIX(_dispatch_stub_650), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_650))
+GL_PREFIX(_dispatch_stub_650):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5048(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23698,13 +24426,13 @@ GL_PREFIX(_dispatch_stub_631):
popq %rbp
popq %rsi
popq %rdi
- movq 5048(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5048(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23714,49 +24442,49 @@ GL_PREFIX(_dispatch_stub_631):
popq %rbp
popq %rsi
popq %rdi
- movq 5048(%rax), %r11
+ movq 5200(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_631), .-GL_PREFIX(_dispatch_stub_631)
+ .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_632)
- .type GL_PREFIX(_dispatch_stub_632), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_632))
-GL_PREFIX(_dispatch_stub_632):
+ .globl GL_PREFIX(_dispatch_stub_651)
+ .type GL_PREFIX(_dispatch_stub_651), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_651))
+GL_PREFIX(_dispatch_stub_651):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5056(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5056(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5056(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5056(%rax), %r11
+ movq 5208(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_632), .-GL_PREFIX(_dispatch_stub_632)
+ .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_633)
- .type GL_PREFIX(_dispatch_stub_633), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_633))
-GL_PREFIX(_dispatch_stub_633):
+ .globl GL_PREFIX(_dispatch_stub_652)
+ .type GL_PREFIX(_dispatch_stub_652), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_652))
+GL_PREFIX(_dispatch_stub_652):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5064(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23766,13 +24494,13 @@ GL_PREFIX(_dispatch_stub_633):
popq %rbp
popq %rsi
popq %rdi
- movq 5064(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5064(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23782,19 +24510,19 @@ GL_PREFIX(_dispatch_stub_633):
popq %rbp
popq %rsi
popq %rdi
- movq 5064(%rax), %r11
+ movq 5216(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_633), .-GL_PREFIX(_dispatch_stub_633)
+ .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_634)
- .type GL_PREFIX(_dispatch_stub_634), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_634))
-GL_PREFIX(_dispatch_stub_634):
+ .globl GL_PREFIX(_dispatch_stub_653)
+ .type GL_PREFIX(_dispatch_stub_653), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_653))
+GL_PREFIX(_dispatch_stub_653):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5072(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23804,13 +24532,13 @@ GL_PREFIX(_dispatch_stub_634):
popq %rdx
popq %rsi
popq %rdi
- movq 5072(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5072(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23820,49 +24548,49 @@ GL_PREFIX(_dispatch_stub_634):
popq %rdx
popq %rsi
popq %rdi
- movq 5072(%rax), %r11
+ movq 5224(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_634), .-GL_PREFIX(_dispatch_stub_634)
+ .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_635)
- .type GL_PREFIX(_dispatch_stub_635), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_635))
-GL_PREFIX(_dispatch_stub_635):
+ .globl GL_PREFIX(_dispatch_stub_654)
+ .type GL_PREFIX(_dispatch_stub_654), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_654))
+GL_PREFIX(_dispatch_stub_654):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5080(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5080(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5080(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5080(%rax), %r11
+ movq 5232(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_635), .-GL_PREFIX(_dispatch_stub_635)
+ .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_636)
- .type GL_PREFIX(_dispatch_stub_636), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_636))
-GL_PREFIX(_dispatch_stub_636):
+ .globl GL_PREFIX(_dispatch_stub_655)
+ .type GL_PREFIX(_dispatch_stub_655), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_655))
+GL_PREFIX(_dispatch_stub_655):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5088(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23872,13 +24600,13 @@ GL_PREFIX(_dispatch_stub_636):
popq %rbp
popq %rsi
popq %rdi
- movq 5088(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5088(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23888,40 +24616,40 @@ GL_PREFIX(_dispatch_stub_636):
popq %rbp
popq %rsi
popq %rdi
- movq 5088(%rax), %r11
+ movq 5240(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_636), .-GL_PREFIX(_dispatch_stub_636)
+ .size GL_PREFIX(_dispatch_stub_655), .-GL_PREFIX(_dispatch_stub_655)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_637)
- .type GL_PREFIX(_dispatch_stub_637), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_637))
-GL_PREFIX(_dispatch_stub_637):
+ .globl GL_PREFIX(_dispatch_stub_656)
+ .type GL_PREFIX(_dispatch_stub_656), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_656))
+GL_PREFIX(_dispatch_stub_656):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5096(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5096(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5096(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5096(%rax), %r11
+ movq 5248(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_637), .-GL_PREFIX(_dispatch_stub_637)
+ .size GL_PREFIX(_dispatch_stub_656), .-GL_PREFIX(_dispatch_stub_656)
.p2align 4,,15
.globl GL_PREFIX(AreProgramsResidentNV)
@@ -23929,7 +24657,7 @@ GL_PREFIX(_dispatch_stub_637):
GL_PREFIX(AreProgramsResidentNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5104(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23939,13 +24667,13 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5104(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5104(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23955,7 +24683,7 @@ GL_PREFIX(AreProgramsResidentNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5104(%rax), %r11
+ movq 5256(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
@@ -23966,7 +24694,7 @@ GL_PREFIX(AreProgramsResidentNV):
GL_PREFIX(BindProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5112(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -23976,13 +24704,13 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5112(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5112(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -23992,7 +24720,7 @@ GL_PREFIX(BindProgramNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5112(%rax), %r11
+ movq 5264(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
@@ -24003,7 +24731,7 @@ GL_PREFIX(BindProgramNV):
GL_PREFIX(DeleteProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5120(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24013,13 +24741,13 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5120(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5120(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24029,7 +24757,7 @@ GL_PREFIX(DeleteProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5120(%rax), %r11
+ movq 5272(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
@@ -24040,7 +24768,7 @@ GL_PREFIX(DeleteProgramsNV):
GL_PREFIX(ExecuteProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5128(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24050,13 +24778,13 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5128(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5128(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24066,7 +24794,7 @@ GL_PREFIX(ExecuteProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5128(%rax), %r11
+ movq 5280(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
@@ -24077,7 +24805,7 @@ GL_PREFIX(ExecuteProgramNV):
GL_PREFIX(GenProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5136(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24087,13 +24815,13 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5136(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5136(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24103,7 +24831,7 @@ GL_PREFIX(GenProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5136(%rax), %r11
+ movq 5288(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
@@ -24114,7 +24842,7 @@ GL_PREFIX(GenProgramsNV):
GL_PREFIX(GetProgramParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5144(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24128,13 +24856,13 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5144(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5144(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24148,7 +24876,7 @@ GL_PREFIX(GetProgramParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5144(%rax), %r11
+ movq 5296(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
@@ -24159,7 +24887,7 @@ GL_PREFIX(GetProgramParameterdvNV):
GL_PREFIX(GetProgramParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5152(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24173,13 +24901,13 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5152(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5152(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24193,7 +24921,7 @@ GL_PREFIX(GetProgramParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5152(%rax), %r11
+ movq 5304(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
@@ -24204,7 +24932,7 @@ GL_PREFIX(GetProgramParameterfvNV):
GL_PREFIX(GetProgramStringNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5160(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24214,13 +24942,13 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5160(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5160(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24230,7 +24958,7 @@ GL_PREFIX(GetProgramStringNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5160(%rax), %r11
+ movq 5312(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
@@ -24241,7 +24969,7 @@ GL_PREFIX(GetProgramStringNV):
GL_PREFIX(GetProgramivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5168(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24251,13 +24979,13 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5168(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24267,7 +24995,7 @@ GL_PREFIX(GetProgramivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5168(%rax), %r11
+ movq 5320(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
@@ -24278,7 +25006,7 @@ GL_PREFIX(GetProgramivNV):
GL_PREFIX(GetTrackMatrixivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5176(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24292,13 +25020,13 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5176(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5176(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24312,7 +25040,7 @@ GL_PREFIX(GetTrackMatrixivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5176(%rax), %r11
+ movq 5328(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
@@ -24323,7 +25051,7 @@ GL_PREFIX(GetTrackMatrixivNV):
GL_PREFIX(GetVertexAttribPointervNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5184(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24333,13 +25061,13 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5184(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5184(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24349,7 +25077,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5184(%rax), %r11
+ movq 5336(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
@@ -24360,7 +25088,7 @@ GL_PREFIX(GetVertexAttribPointervNV):
GL_PREFIX(GetVertexAttribdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5192(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24370,13 +25098,13 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5192(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5192(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24386,7 +25114,7 @@ GL_PREFIX(GetVertexAttribdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5192(%rax), %r11
+ movq 5344(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
@@ -24397,7 +25125,7 @@ GL_PREFIX(GetVertexAttribdvNV):
GL_PREFIX(GetVertexAttribfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5200(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24407,13 +25135,13 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5200(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5200(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24423,7 +25151,7 @@ GL_PREFIX(GetVertexAttribfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5200(%rax), %r11
+ movq 5352(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
@@ -24434,7 +25162,7 @@ GL_PREFIX(GetVertexAttribfvNV):
GL_PREFIX(GetVertexAttribivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5208(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24444,13 +25172,13 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5208(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5208(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24460,7 +25188,7 @@ GL_PREFIX(GetVertexAttribivNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5208(%rax), %r11
+ movq 5360(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
@@ -24471,25 +25199,25 @@ GL_PREFIX(GetVertexAttribivNV):
GL_PREFIX(IsProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5216(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5216(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5216(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5216(%rax), %r11
+ movq 5368(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
@@ -24500,7 +25228,7 @@ GL_PREFIX(IsProgramNV):
GL_PREFIX(LoadProgramNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5224(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24514,13 +25242,13 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5224(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5224(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24534,7 +25262,7 @@ GL_PREFIX(LoadProgramNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5224(%rax), %r11
+ movq 5376(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
@@ -24545,7 +25273,7 @@ GL_PREFIX(LoadProgramNV):
GL_PREFIX(ProgramParameter4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5232(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -24563,13 +25291,13 @@ GL_PREFIX(ProgramParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5232(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5232(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -24587,7 +25315,7 @@ GL_PREFIX(ProgramParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5232(%rax), %r11
+ movq 5384(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4dNV), .-GL_PREFIX(ProgramParameter4dNV)
@@ -24598,7 +25326,7 @@ GL_PREFIX(ProgramParameter4dNV):
GL_PREFIX(ProgramParameter4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5240(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24608,13 +25336,13 @@ GL_PREFIX(ProgramParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5240(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5240(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24624,7 +25352,7 @@ GL_PREFIX(ProgramParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5240(%rax), %r11
+ movq 5392(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4dvNV), .-GL_PREFIX(ProgramParameter4dvNV)
@@ -24635,7 +25363,7 @@ GL_PREFIX(ProgramParameter4dvNV):
GL_PREFIX(ProgramParameter4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5248(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -24653,13 +25381,13 @@ GL_PREFIX(ProgramParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5248(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5248(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -24677,7 +25405,7 @@ GL_PREFIX(ProgramParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5248(%rax), %r11
+ movq 5400(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4fNV), .-GL_PREFIX(ProgramParameter4fNV)
@@ -24688,7 +25416,7 @@ GL_PREFIX(ProgramParameter4fNV):
GL_PREFIX(ProgramParameter4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5256(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24698,13 +25426,13 @@ GL_PREFIX(ProgramParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5256(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24714,7 +25442,7 @@ GL_PREFIX(ProgramParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5256(%rax), %r11
+ movq 5408(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameter4fvNV), .-GL_PREFIX(ProgramParameter4fvNV)
@@ -24725,7 +25453,7 @@ GL_PREFIX(ProgramParameter4fvNV):
GL_PREFIX(ProgramParameters4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5264(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24739,13 +25467,13 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5264(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24759,7 +25487,7 @@ GL_PREFIX(ProgramParameters4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5264(%rax), %r11
+ movq 5416(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
@@ -24770,7 +25498,7 @@ GL_PREFIX(ProgramParameters4dvNV):
GL_PREFIX(ProgramParameters4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5272(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24784,13 +25512,13 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5272(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24804,7 +25532,7 @@ GL_PREFIX(ProgramParameters4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5272(%rax), %r11
+ movq 5424(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
@@ -24815,7 +25543,7 @@ GL_PREFIX(ProgramParameters4fvNV):
GL_PREFIX(RequestResidentProgramsNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5280(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24825,13 +25553,13 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5280(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24841,7 +25569,7 @@ GL_PREFIX(RequestResidentProgramsNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5280(%rax), %r11
+ movq 5432(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
@@ -24852,7 +25580,7 @@ GL_PREFIX(RequestResidentProgramsNV):
GL_PREFIX(TrackMatrixNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5288(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24866,13 +25594,13 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5288(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24886,7 +25614,7 @@ GL_PREFIX(TrackMatrixNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5288(%rax), %r11
+ movq 5440(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
@@ -24897,7 +25625,7 @@ GL_PREFIX(TrackMatrixNV):
GL_PREFIX(VertexAttrib1dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5296(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -24907,13 +25635,13 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5296(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5296(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -24923,7 +25651,7 @@ GL_PREFIX(VertexAttrib1dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5296(%rax), %r11
+ movq 5448(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
@@ -24934,7 +25662,7 @@ GL_PREFIX(VertexAttrib1dNV):
GL_PREFIX(VertexAttrib1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5304(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -24944,13 +25672,13 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5304(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -24960,7 +25688,7 @@ GL_PREFIX(VertexAttrib1dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5304(%rax), %r11
+ movq 5456(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
@@ -24971,7 +25699,7 @@ GL_PREFIX(VertexAttrib1dvNV):
GL_PREFIX(VertexAttrib1fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5312(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -24981,13 +25709,13 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5312(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5312(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -24997,7 +25725,7 @@ GL_PREFIX(VertexAttrib1fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5312(%rax), %r11
+ movq 5464(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
@@ -25008,7 +25736,7 @@ GL_PREFIX(VertexAttrib1fNV):
GL_PREFIX(VertexAttrib1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5320(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25018,13 +25746,13 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5320(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25034,7 +25762,7 @@ GL_PREFIX(VertexAttrib1fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5320(%rax), %r11
+ movq 5472(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
@@ -25045,7 +25773,7 @@ GL_PREFIX(VertexAttrib1fvNV):
GL_PREFIX(VertexAttrib1sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5328(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25055,13 +25783,13 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5328(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25071,7 +25799,7 @@ GL_PREFIX(VertexAttrib1sNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5328(%rax), %r11
+ movq 5480(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
@@ -25082,7 +25810,7 @@ GL_PREFIX(VertexAttrib1sNV):
GL_PREFIX(VertexAttrib1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5336(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25092,13 +25820,13 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5336(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25108,7 +25836,7 @@ GL_PREFIX(VertexAttrib1svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5336(%rax), %r11
+ movq 5488(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
@@ -25119,7 +25847,7 @@ GL_PREFIX(VertexAttrib1svNV):
GL_PREFIX(VertexAttrib2dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5344(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25131,13 +25859,13 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5344(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5344(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25149,7 +25877,7 @@ GL_PREFIX(VertexAttrib2dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5344(%rax), %r11
+ movq 5496(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
@@ -25160,7 +25888,7 @@ GL_PREFIX(VertexAttrib2dNV):
GL_PREFIX(VertexAttrib2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5352(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25170,13 +25898,13 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5352(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25186,7 +25914,7 @@ GL_PREFIX(VertexAttrib2dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5352(%rax), %r11
+ movq 5504(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
@@ -25197,7 +25925,7 @@ GL_PREFIX(VertexAttrib2dvNV):
GL_PREFIX(VertexAttrib2fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5360(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $24, %rsp
@@ -25209,13 +25937,13 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5360(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5360(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
1:
subq $24, %rsp
@@ -25227,7 +25955,7 @@ GL_PREFIX(VertexAttrib2fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $24, %rsp
- movq 5360(%rax), %r11
+ movq 5512(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
@@ -25238,7 +25966,7 @@ GL_PREFIX(VertexAttrib2fNV):
GL_PREFIX(VertexAttrib2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5368(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25248,13 +25976,13 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5368(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5368(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25264,7 +25992,7 @@ GL_PREFIX(VertexAttrib2fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5368(%rax), %r11
+ movq 5520(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
@@ -25275,7 +26003,7 @@ GL_PREFIX(VertexAttrib2fvNV):
GL_PREFIX(VertexAttrib2sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5376(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25285,13 +26013,13 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5376(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5376(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25301,7 +26029,7 @@ GL_PREFIX(VertexAttrib2sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5376(%rax), %r11
+ movq 5528(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
@@ -25312,7 +26040,7 @@ GL_PREFIX(VertexAttrib2sNV):
GL_PREFIX(VertexAttrib2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5384(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25322,13 +26050,13 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5384(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25338,7 +26066,7 @@ GL_PREFIX(VertexAttrib2svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5384(%rax), %r11
+ movq 5536(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
@@ -25349,7 +26077,7 @@ GL_PREFIX(VertexAttrib2svNV):
GL_PREFIX(VertexAttrib3dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5392(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25363,13 +26091,13 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5392(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5392(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -25383,7 +26111,7 @@ GL_PREFIX(VertexAttrib3dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5392(%rax), %r11
+ movq 5544(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
@@ -25394,7 +26122,7 @@ GL_PREFIX(VertexAttrib3dNV):
GL_PREFIX(VertexAttrib3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5400(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25404,13 +26132,13 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5400(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25420,7 +26148,7 @@ GL_PREFIX(VertexAttrib3dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5400(%rax), %r11
+ movq 5552(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
@@ -25431,7 +26159,7 @@ GL_PREFIX(VertexAttrib3dvNV):
GL_PREFIX(VertexAttrib3fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5408(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25445,13 +26173,13 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5408(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5408(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -25465,7 +26193,7 @@ GL_PREFIX(VertexAttrib3fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5408(%rax), %r11
+ movq 5560(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
@@ -25476,7 +26204,7 @@ GL_PREFIX(VertexAttrib3fNV):
GL_PREFIX(VertexAttrib3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5416(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25486,13 +26214,13 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5416(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5416(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25502,7 +26230,7 @@ GL_PREFIX(VertexAttrib3fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5416(%rax), %r11
+ movq 5568(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
@@ -25513,7 +26241,7 @@ GL_PREFIX(VertexAttrib3fvNV):
GL_PREFIX(VertexAttrib3sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5424(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25527,13 +26255,13 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5424(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5424(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25547,7 +26275,7 @@ GL_PREFIX(VertexAttrib3sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5424(%rax), %r11
+ movq 5576(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
@@ -25558,7 +26286,7 @@ GL_PREFIX(VertexAttrib3sNV):
GL_PREFIX(VertexAttrib3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5432(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25568,13 +26296,13 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5432(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5432(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25584,7 +26312,7 @@ GL_PREFIX(VertexAttrib3svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5432(%rax), %r11
+ movq 5584(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
@@ -25595,7 +26323,7 @@ GL_PREFIX(VertexAttrib3svNV):
GL_PREFIX(VertexAttrib4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5440(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25611,13 +26339,13 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5440(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5440(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -25633,7 +26361,7 @@ GL_PREFIX(VertexAttrib4dNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5440(%rax), %r11
+ movq 5592(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
@@ -25644,7 +26372,7 @@ GL_PREFIX(VertexAttrib4dNV):
GL_PREFIX(VertexAttrib4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5448(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25654,13 +26382,13 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5448(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25670,7 +26398,7 @@ GL_PREFIX(VertexAttrib4dvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5448(%rax), %r11
+ movq 5600(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
@@ -25681,7 +26409,7 @@ GL_PREFIX(VertexAttrib4dvNV):
GL_PREFIX(VertexAttrib4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5456(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $40, %rsp
@@ -25697,13 +26425,13 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5456(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5456(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
1:
subq $40, %rsp
@@ -25719,7 +26447,7 @@ GL_PREFIX(VertexAttrib4fNV):
movq 8(%rsp), %xmm0
movq (%rsp), %rdi
addq $40, %rsp
- movq 5456(%rax), %r11
+ movq 5608(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
@@ -25730,7 +26458,7 @@ GL_PREFIX(VertexAttrib4fNV):
GL_PREFIX(VertexAttrib4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5464(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25740,13 +26468,13 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5464(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5464(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25756,7 +26484,7 @@ GL_PREFIX(VertexAttrib4fvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5464(%rax), %r11
+ movq 5616(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
@@ -25767,7 +26495,7 @@ GL_PREFIX(VertexAttrib4fvNV):
GL_PREFIX(VertexAttrib4sNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5472(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25781,13 +26509,13 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5472(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5472(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25801,7 +26529,7 @@ GL_PREFIX(VertexAttrib4sNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5472(%rax), %r11
+ movq 5624(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
@@ -25812,7 +26540,7 @@ GL_PREFIX(VertexAttrib4sNV):
GL_PREFIX(VertexAttrib4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5480(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25822,13 +26550,13 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5480(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5480(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25838,7 +26566,7 @@ GL_PREFIX(VertexAttrib4svNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5480(%rax), %r11
+ movq 5632(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
@@ -25849,7 +26577,7 @@ GL_PREFIX(VertexAttrib4svNV):
GL_PREFIX(VertexAttrib4ubNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5488(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25863,13 +26591,13 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5488(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5488(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25883,7 +26611,7 @@ GL_PREFIX(VertexAttrib4ubNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5488(%rax), %r11
+ movq 5640(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
@@ -25894,7 +26622,7 @@ GL_PREFIX(VertexAttrib4ubNV):
GL_PREFIX(VertexAttrib4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5496(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25904,13 +26632,13 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5496(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25920,7 +26648,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5496(%rax), %r11
+ movq 5648(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
@@ -25931,7 +26659,7 @@ GL_PREFIX(VertexAttrib4ubvNV):
GL_PREFIX(VertexAttribPointerNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5504(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25945,13 +26673,13 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5504(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -25965,7 +26693,7 @@ GL_PREFIX(VertexAttribPointerNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5504(%rax), %r11
+ movq 5656(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
@@ -25976,7 +26704,7 @@ GL_PREFIX(VertexAttribPointerNV):
GL_PREFIX(VertexAttribs1dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5512(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -25986,13 +26714,13 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5512(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5512(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26002,7 +26730,7 @@ GL_PREFIX(VertexAttribs1dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5512(%rax), %r11
+ movq 5664(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
@@ -26013,7 +26741,7 @@ GL_PREFIX(VertexAttribs1dvNV):
GL_PREFIX(VertexAttribs1fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5520(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26023,13 +26751,13 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5520(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5520(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26039,7 +26767,7 @@ GL_PREFIX(VertexAttribs1fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5520(%rax), %r11
+ movq 5672(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
@@ -26050,7 +26778,7 @@ GL_PREFIX(VertexAttribs1fvNV):
GL_PREFIX(VertexAttribs1svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5528(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26060,13 +26788,13 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5528(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5528(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26076,7 +26804,7 @@ GL_PREFIX(VertexAttribs1svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5528(%rax), %r11
+ movq 5680(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
@@ -26087,7 +26815,7 @@ GL_PREFIX(VertexAttribs1svNV):
GL_PREFIX(VertexAttribs2dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5536(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26097,13 +26825,13 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5536(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5536(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26113,7 +26841,7 @@ GL_PREFIX(VertexAttribs2dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5536(%rax), %r11
+ movq 5688(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
@@ -26124,7 +26852,7 @@ GL_PREFIX(VertexAttribs2dvNV):
GL_PREFIX(VertexAttribs2fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5544(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26134,13 +26862,13 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5544(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26150,7 +26878,7 @@ GL_PREFIX(VertexAttribs2fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5544(%rax), %r11
+ movq 5696(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
@@ -26161,7 +26889,7 @@ GL_PREFIX(VertexAttribs2fvNV):
GL_PREFIX(VertexAttribs2svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5552(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26171,13 +26899,13 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5552(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26187,7 +26915,7 @@ GL_PREFIX(VertexAttribs2svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5552(%rax), %r11
+ movq 5704(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
@@ -26198,7 +26926,7 @@ GL_PREFIX(VertexAttribs2svNV):
GL_PREFIX(VertexAttribs3dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5560(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26208,13 +26936,13 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5560(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5560(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26224,7 +26952,7 @@ GL_PREFIX(VertexAttribs3dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5560(%rax), %r11
+ movq 5712(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
@@ -26235,7 +26963,7 @@ GL_PREFIX(VertexAttribs3dvNV):
GL_PREFIX(VertexAttribs3fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5568(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26245,13 +26973,13 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5568(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5568(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26261,7 +26989,7 @@ GL_PREFIX(VertexAttribs3fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5568(%rax), %r11
+ movq 5720(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
@@ -26272,7 +27000,7 @@ GL_PREFIX(VertexAttribs3fvNV):
GL_PREFIX(VertexAttribs3svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5576(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26282,13 +27010,13 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5576(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5576(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26298,7 +27026,7 @@ GL_PREFIX(VertexAttribs3svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5576(%rax), %r11
+ movq 5728(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
@@ -26309,7 +27037,7 @@ GL_PREFIX(VertexAttribs3svNV):
GL_PREFIX(VertexAttribs4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5584(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26319,13 +27047,13 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5584(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5584(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26335,7 +27063,7 @@ GL_PREFIX(VertexAttribs4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5584(%rax), %r11
+ movq 5736(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
@@ -26346,7 +27074,7 @@ GL_PREFIX(VertexAttribs4dvNV):
GL_PREFIX(VertexAttribs4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5592(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26356,13 +27084,13 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5592(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26372,7 +27100,7 @@ GL_PREFIX(VertexAttribs4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5592(%rax), %r11
+ movq 5744(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
@@ -26383,7 +27111,7 @@ GL_PREFIX(VertexAttribs4fvNV):
GL_PREFIX(VertexAttribs4svNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5600(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26393,13 +27121,13 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5600(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26409,7 +27137,7 @@ GL_PREFIX(VertexAttribs4svNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5600(%rax), %r11
+ movq 5752(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
@@ -26420,7 +27148,7 @@ GL_PREFIX(VertexAttribs4svNV):
GL_PREFIX(VertexAttribs4ubvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5608(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26430,13 +27158,13 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5608(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26446,7 +27174,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5608(%rax), %r11
+ movq 5760(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
@@ -26457,7 +27185,7 @@ GL_PREFIX(VertexAttribs4ubvNV):
GL_PREFIX(AlphaFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5616(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26475,13 +27203,13 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5616(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26499,7 +27227,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5616(%rax), %r11
+ movq 5768(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
@@ -26510,7 +27238,7 @@ GL_PREFIX(AlphaFragmentOp1ATI):
GL_PREFIX(AlphaFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5624(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26528,13 +27256,13 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5624(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26552,7 +27280,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5624(%rax), %r11
+ movq 5776(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
@@ -26563,7 +27291,7 @@ GL_PREFIX(AlphaFragmentOp2ATI):
GL_PREFIX(AlphaFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5632(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26581,13 +27309,13 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5632(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26605,7 +27333,7 @@ GL_PREFIX(AlphaFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5632(%rax), %r11
+ movq 5784(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
@@ -26616,25 +27344,25 @@ GL_PREFIX(AlphaFragmentOp3ATI):
GL_PREFIX(BeginFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5640(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5640(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5640(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5640(%rax), %r11
+ movq 5792(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
@@ -26645,25 +27373,25 @@ GL_PREFIX(BeginFragmentShaderATI):
GL_PREFIX(BindFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5648(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5648(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5648(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5648(%rax), %r11
+ movq 5800(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
@@ -26674,7 +27402,7 @@ GL_PREFIX(BindFragmentShaderATI):
GL_PREFIX(ColorFragmentOp1ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5656(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26692,13 +27420,13 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5656(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26716,7 +27444,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5656(%rax), %r11
+ movq 5808(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
@@ -26727,7 +27455,7 @@ GL_PREFIX(ColorFragmentOp1ATI):
GL_PREFIX(ColorFragmentOp2ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5664(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26745,13 +27473,13 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5664(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26769,7 +27497,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5664(%rax), %r11
+ movq 5816(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
@@ -26780,7 +27508,7 @@ GL_PREFIX(ColorFragmentOp2ATI):
GL_PREFIX(ColorFragmentOp3ATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5672(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26798,13 +27526,13 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5672(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26822,7 +27550,7 @@ GL_PREFIX(ColorFragmentOp3ATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5672(%rax), %r11
+ movq 5824(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
@@ -26833,25 +27561,25 @@ GL_PREFIX(ColorFragmentOp3ATI):
GL_PREFIX(DeleteFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5680(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5680(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5680(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5680(%rax), %r11
+ movq 5832(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
@@ -26862,25 +27590,25 @@ GL_PREFIX(DeleteFragmentShaderATI):
GL_PREFIX(EndFragmentShaderATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5688(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rbp
call _x86_64_get_dispatch@PLT
popq %rbp
- movq 5688(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5688(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
1:
pushq %rbp
call _glapi_get_dispatch
popq %rbp
- movq 5688(%rax), %r11
+ movq 5840(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
@@ -26891,25 +27619,25 @@ GL_PREFIX(EndFragmentShaderATI):
GL_PREFIX(GenFragmentShadersATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5696(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5696(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5696(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5696(%rax), %r11
+ movq 5848(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
@@ -26920,7 +27648,7 @@ GL_PREFIX(GenFragmentShadersATI):
GL_PREFIX(PassTexCoordATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5704(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26930,13 +27658,13 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5704(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26946,7 +27674,7 @@ GL_PREFIX(PassTexCoordATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5704(%rax), %r11
+ movq 5856(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
@@ -26957,7 +27685,7 @@ GL_PREFIX(PassTexCoordATI):
GL_PREFIX(SampleMapATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5712(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -26967,13 +27695,13 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5712(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -26983,7 +27711,7 @@ GL_PREFIX(SampleMapATI):
popq %rdx
popq %rsi
popq %rdi
- movq 5712(%rax), %r11
+ movq 5864(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
@@ -26994,7 +27722,7 @@ GL_PREFIX(SampleMapATI):
GL_PREFIX(SetFragmentShaderConstantATI):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5720(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27004,13 +27732,13 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5720(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27020,7 +27748,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
popq %rbp
popq %rsi
popq %rdi
- movq 5720(%rax), %r11
+ movq 5872(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
@@ -27031,7 +27759,7 @@ GL_PREFIX(SetFragmentShaderConstantATI):
GL_PREFIX(PointParameteriNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5728(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27041,13 +27769,13 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5728(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27057,7 +27785,7 @@ GL_PREFIX(PointParameteriNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5728(%rax), %r11
+ movq 5880(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
@@ -27068,7 +27796,7 @@ GL_PREFIX(PointParameteriNV):
GL_PREFIX(PointParameterivNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5736(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27078,13 +27806,13 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5736(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27094,79 +27822,79 @@ GL_PREFIX(PointParameterivNV):
popq %rbp
popq %rsi
popq %rdi
- movq 5736(%rax), %r11
+ movq 5888(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_718)
- .type GL_PREFIX(_dispatch_stub_718), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_718))
-GL_PREFIX(_dispatch_stub_718):
+ .globl GL_PREFIX(_dispatch_stub_737)
+ .type GL_PREFIX(_dispatch_stub_737), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_737))
+GL_PREFIX(_dispatch_stub_737):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5744(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5744(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5744(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5744(%rax), %r11
+ movq 5896(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_718), .-GL_PREFIX(_dispatch_stub_718)
+ .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_719)
- .type GL_PREFIX(_dispatch_stub_719), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_719))
-GL_PREFIX(_dispatch_stub_719):
+ .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 5752(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5752(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5752(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5752(%rax), %r11
+ movq 5904(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_719), .-GL_PREFIX(_dispatch_stub_719)
+ .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_720)
- .type GL_PREFIX(_dispatch_stub_720), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_720))
-GL_PREFIX(_dispatch_stub_720):
+ .globl GL_PREFIX(_dispatch_stub_739)
+ .type GL_PREFIX(_dispatch_stub_739), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_739))
+GL_PREFIX(_dispatch_stub_739):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5760(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27176,13 +27904,13 @@ GL_PREFIX(_dispatch_stub_720):
popq %rbp
popq %rsi
popq %rdi
- movq 5760(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5760(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27192,19 +27920,19 @@ GL_PREFIX(_dispatch_stub_720):
popq %rbp
popq %rsi
popq %rdi
- movq 5760(%rax), %r11
+ movq 5912(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_720), .-GL_PREFIX(_dispatch_stub_720)
+ .size GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_721)
- .type GL_PREFIX(_dispatch_stub_721), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_721))
-GL_PREFIX(_dispatch_stub_721):
+ .globl GL_PREFIX(_dispatch_stub_740)
+ .type GL_PREFIX(_dispatch_stub_740), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_740))
+GL_PREFIX(_dispatch_stub_740):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5768(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27214,13 +27942,13 @@ GL_PREFIX(_dispatch_stub_721):
popq %rbp
popq %rsi
popq %rdi
- movq 5768(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5768(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27230,40 +27958,40 @@ GL_PREFIX(_dispatch_stub_721):
popq %rbp
popq %rsi
popq %rdi
- movq 5768(%rax), %r11
+ movq 5920(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_721), .-GL_PREFIX(_dispatch_stub_721)
+ .size GL_PREFIX(_dispatch_stub_740), .-GL_PREFIX(_dispatch_stub_740)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_722)
- .type GL_PREFIX(_dispatch_stub_722), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_722))
-GL_PREFIX(_dispatch_stub_722):
+ .globl GL_PREFIX(_dispatch_stub_741)
+ .type GL_PREFIX(_dispatch_stub_741), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_741))
+GL_PREFIX(_dispatch_stub_741):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5776(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5776(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5776(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5776(%rax), %r11
+ movq 5928(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_722), .-GL_PREFIX(_dispatch_stub_722)
+ .size GL_PREFIX(_dispatch_stub_741), .-GL_PREFIX(_dispatch_stub_741)
.p2align 4,,15
.globl GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27271,7 +27999,7 @@ GL_PREFIX(_dispatch_stub_722):
GL_PREFIX(GetProgramNamedParameterdvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5784(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27285,13 +28013,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5784(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27305,7 +28033,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5784(%rax), %r11
+ movq 5936(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
@@ -27316,7 +28044,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV):
GL_PREFIX(GetProgramNamedParameterfvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5792(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27330,13 +28058,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5792(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27350,7 +28078,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5792(%rax), %r11
+ movq 5944(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
@@ -27361,7 +28089,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV):
GL_PREFIX(ProgramNamedParameter4dNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5800(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -27381,13 +28109,13 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5800(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5800(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -27407,7 +28135,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5800(%rax), %r11
+ movq 5952(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
@@ -27418,7 +28146,7 @@ GL_PREFIX(ProgramNamedParameter4dNV):
GL_PREFIX(ProgramNamedParameter4dvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5808(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27432,13 +28160,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5808(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5808(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27452,7 +28180,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5808(%rax), %r11
+ movq 5960(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
@@ -27463,7 +28191,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV):
GL_PREFIX(ProgramNamedParameter4fNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5816(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
subq $56, %rsp
@@ -27483,13 +28211,13 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5816(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5816(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
1:
subq $56, %rsp
@@ -27509,7 +28237,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
movq 8(%rsp), %rsi
movq (%rsp), %rdi
addq $56, %rsp
- movq 5816(%rax), %r11
+ movq 5968(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
@@ -27520,7 +28248,7 @@ GL_PREFIX(ProgramNamedParameter4fNV):
GL_PREFIX(ProgramNamedParameter4fvNV):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5824(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27534,13 +28262,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5824(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5824(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27554,19 +28282,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV):
popq %rdx
popq %rsi
popq %rdi
- movq 5824(%rax), %r11
+ movq 5976(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_729)
- .type GL_PREFIX(_dispatch_stub_729), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_729))
-GL_PREFIX(_dispatch_stub_729):
+ .globl GL_PREFIX(_dispatch_stub_748)
+ .type GL_PREFIX(_dispatch_stub_748), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_748))
+GL_PREFIX(_dispatch_stub_748):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5832(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27576,13 +28304,13 @@ GL_PREFIX(_dispatch_stub_729):
popq %rbp
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5832(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27592,19 +28320,19 @@ GL_PREFIX(_dispatch_stub_729):
popq %rbp
popq %rsi
popq %rdi
- movq 5832(%rax), %r11
+ movq 5984(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_729), .-GL_PREFIX(_dispatch_stub_729)
+ .size GL_PREFIX(_dispatch_stub_748), .-GL_PREFIX(_dispatch_stub_748)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_730)
- .type GL_PREFIX(_dispatch_stub_730), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_730))
-GL_PREFIX(_dispatch_stub_730):
+ .globl GL_PREFIX(_dispatch_stub_749)
+ .type GL_PREFIX(_dispatch_stub_749), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_749))
+GL_PREFIX(_dispatch_stub_749):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5840(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27614,13 +28342,13 @@ GL_PREFIX(_dispatch_stub_730):
popq %rbp
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5840(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27630,10 +28358,10 @@ GL_PREFIX(_dispatch_stub_730):
popq %rbp
popq %rsi
popq %rdi
- movq 5840(%rax), %r11
+ movq 5992(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_730), .-GL_PREFIX(_dispatch_stub_730)
+ .size GL_PREFIX(_dispatch_stub_749), .-GL_PREFIX(_dispatch_stub_749)
.p2align 4,,15
.globl GL_PREFIX(BindFramebufferEXT)
@@ -27641,7 +28369,7 @@ GL_PREFIX(_dispatch_stub_730):
GL_PREFIX(BindFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5848(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27651,13 +28379,13 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5848(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27667,7 +28395,7 @@ GL_PREFIX(BindFramebufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5848(%rax), %r11
+ movq 6000(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
@@ -27678,7 +28406,7 @@ GL_PREFIX(BindFramebufferEXT):
GL_PREFIX(BindRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5856(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27688,13 +28416,13 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5856(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27704,7 +28432,7 @@ GL_PREFIX(BindRenderbufferEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5856(%rax), %r11
+ movq 6008(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
@@ -27715,25 +28443,25 @@ GL_PREFIX(BindRenderbufferEXT):
GL_PREFIX(CheckFramebufferStatusEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5864(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5864(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5864(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5864(%rax), %r11
+ movq 6016(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
@@ -27744,7 +28472,7 @@ GL_PREFIX(CheckFramebufferStatusEXT):
GL_PREFIX(DeleteFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5872(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27754,13 +28482,13 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5872(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5872(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27770,7 +28498,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5872(%rax), %r11
+ movq 6024(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
@@ -27781,7 +28509,7 @@ GL_PREFIX(DeleteFramebuffersEXT):
GL_PREFIX(DeleteRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5880(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27791,13 +28519,13 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5880(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5880(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27807,7 +28535,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5880(%rax), %r11
+ movq 6032(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
@@ -27818,7 +28546,7 @@ GL_PREFIX(DeleteRenderbuffersEXT):
GL_PREFIX(FramebufferRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5888(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27832,13 +28560,13 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5888(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5888(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27852,7 +28580,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5888(%rax), %r11
+ movq 6040(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
@@ -27863,7 +28591,7 @@ GL_PREFIX(FramebufferRenderbufferEXT):
GL_PREFIX(FramebufferTexture1DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5896(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27877,13 +28605,13 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5896(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5896(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27897,7 +28625,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5896(%rax), %r11
+ movq 6048(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
@@ -27908,7 +28636,7 @@ GL_PREFIX(FramebufferTexture1DEXT):
GL_PREFIX(FramebufferTexture2DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5904(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27922,13 +28650,13 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5904(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5904(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27942,7 +28670,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5904(%rax), %r11
+ movq 6056(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
@@ -27953,7 +28681,7 @@ GL_PREFIX(FramebufferTexture2DEXT):
GL_PREFIX(FramebufferTexture3DEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5912(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -27971,13 +28699,13 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5912(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -27995,7 +28723,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5912(%rax), %r11
+ movq 6064(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
@@ -28006,7 +28734,7 @@ GL_PREFIX(FramebufferTexture3DEXT):
GL_PREFIX(GenFramebuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5920(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28016,13 +28744,13 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5920(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5920(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28032,7 +28760,7 @@ GL_PREFIX(GenFramebuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5920(%rax), %r11
+ movq 6072(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
@@ -28043,7 +28771,7 @@ GL_PREFIX(GenFramebuffersEXT):
GL_PREFIX(GenRenderbuffersEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5928(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28053,13 +28781,13 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5928(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5928(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28069,7 +28797,7 @@ GL_PREFIX(GenRenderbuffersEXT):
popq %rbp
popq %rsi
popq %rdi
- movq 5928(%rax), %r11
+ movq 6080(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
@@ -28080,25 +28808,25 @@ GL_PREFIX(GenRenderbuffersEXT):
GL_PREFIX(GenerateMipmapEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5936(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5936(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5936(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5936(%rax), %r11
+ movq 6088(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
@@ -28109,7 +28837,7 @@ GL_PREFIX(GenerateMipmapEXT):
GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5944(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28123,13 +28851,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5944(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5944(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28143,7 +28871,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5944(%rax), %r11
+ movq 6096(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
@@ -28154,7 +28882,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
GL_PREFIX(GetRenderbufferParameterivEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5952(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28164,13 +28892,13 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5952(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28180,7 +28908,7 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5952(%rax), %r11
+ movq 6104(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
@@ -28191,25 +28919,25 @@ GL_PREFIX(GetRenderbufferParameterivEXT):
GL_PREFIX(IsFramebufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5960(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5960(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5960(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5960(%rax), %r11
+ movq 6112(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
@@ -28220,25 +28948,25 @@ GL_PREFIX(IsFramebufferEXT):
GL_PREFIX(IsRenderbufferEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5968(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
call _x86_64_get_dispatch@PLT
popq %rdi
- movq 5968(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5968(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
1:
pushq %rdi
call _glapi_get_dispatch
popq %rdi
- movq 5968(%rax), %r11
+ movq 6120(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
@@ -28249,7 +28977,7 @@ GL_PREFIX(IsRenderbufferEXT):
GL_PREFIX(RenderbufferStorageEXT):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 5976(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28263,13 +28991,13 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5976(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28283,19 +29011,19 @@ GL_PREFIX(RenderbufferStorageEXT):
popq %rdx
popq %rsi
popq %rdi
- movq 5976(%rax), %r11
+ movq 6128(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
.size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_748)
- .type GL_PREFIX(_dispatch_stub_748), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_748))
-GL_PREFIX(_dispatch_stub_748):
+ .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 5984(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28313,13 +29041,13 @@ GL_PREFIX(_dispatch_stub_748):
popq %rdx
popq %rsi
popq %rdi
- movq 5984(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5984(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28337,19 +29065,19 @@ GL_PREFIX(_dispatch_stub_748):
popq %rdx
popq %rsi
popq %rdi
- movq 5984(%rax), %r11
+ movq 6136(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_748), .-GL_PREFIX(_dispatch_stub_748)
+ .size GL_PREFIX(_dispatch_stub_767), .-GL_PREFIX(_dispatch_stub_767)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_749)
- .type GL_PREFIX(_dispatch_stub_749), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_749))
-GL_PREFIX(_dispatch_stub_749):
+ .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 5992(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28363,13 +29091,13 @@ GL_PREFIX(_dispatch_stub_749):
popq %rdx
popq %rsi
popq %rdi
- movq 5992(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 5992(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28383,19 +29111,19 @@ GL_PREFIX(_dispatch_stub_749):
popq %rdx
popq %rsi
popq %rdi
- movq 5992(%rax), %r11
+ movq 6144(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_749), .-GL_PREFIX(_dispatch_stub_749)
+ .size GL_PREFIX(_dispatch_stub_768), .-GL_PREFIX(_dispatch_stub_768)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_750)
- .type GL_PREFIX(_dispatch_stub_750), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_750))
-GL_PREFIX(_dispatch_stub_750):
+ .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 6000(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28409,13 +29137,13 @@ GL_PREFIX(_dispatch_stub_750):
popq %rdx
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6000(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28429,19 +29157,19 @@ GL_PREFIX(_dispatch_stub_750):
popq %rdx
popq %rsi
popq %rdi
- movq 6000(%rax), %r11
+ movq 6152(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_750), .-GL_PREFIX(_dispatch_stub_750)
+ .size GL_PREFIX(_dispatch_stub_769), .-GL_PREFIX(_dispatch_stub_769)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_751)
- .type GL_PREFIX(_dispatch_stub_751), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_751))
-GL_PREFIX(_dispatch_stub_751):
+ .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 6008(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28451,13 +29179,13 @@ GL_PREFIX(_dispatch_stub_751):
popq %rdx
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6008(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28467,19 +29195,19 @@ GL_PREFIX(_dispatch_stub_751):
popq %rdx
popq %rsi
popq %rdi
- movq 6008(%rax), %r11
+ movq 6160(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_751), .-GL_PREFIX(_dispatch_stub_751)
+ .size GL_PREFIX(_dispatch_stub_770), .-GL_PREFIX(_dispatch_stub_770)
.p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_752)
- .type GL_PREFIX(_dispatch_stub_752), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_752))
-GL_PREFIX(_dispatch_stub_752):
+ .globl GL_PREFIX(_dispatch_stub_771)
+ .type GL_PREFIX(_dispatch_stub_771), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_771))
+GL_PREFIX(_dispatch_stub_771):
#if defined(GLX_USE_TLS)
call _x86_64_get_dispatch@PLT
- movq 6016(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#elif defined(PTHREADS)
pushq %rdi
@@ -28489,13 +29217,13 @@ GL_PREFIX(_dispatch_stub_752):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#else
movq _glapi_Dispatch(%rip), %rax
testq %rax, %rax
je 1f
- movq 6016(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
1:
pushq %rdi
@@ -28505,10 +29233,10 @@ GL_PREFIX(_dispatch_stub_752):
popq %rdx
popq %rsi
popq %rdi
- movq 6016(%rax), %r11
+ movq 6168(%rax), %r11
jmp *%r11
#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_752), .-GL_PREFIX(_dispatch_stub_752)
+ .size GL_PREFIX(_dispatch_stub_771), .-GL_PREFIX(_dispatch_stub_771)
.globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
.globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
@@ -28595,6 +29323,43 @@ GL_PREFIX(_dispatch_stub_752):
.globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB)
.globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB)
.globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB)
+ .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB)
+ .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB)
+ .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB)
+ .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB)
+ .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB)
+ .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB)
+ .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB)
+ .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB)
+ .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB)
+ .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB)
+ .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB)
+ .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB)
+ .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB)
+ .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB)
+ .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB)
+ .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB)
+ .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB)
+ .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB)
+ .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB)
+ .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB)
+ .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB)
+ .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB)
+ .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB)
+ .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB)
+ .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB)
+ .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB)
+ .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB)
+ .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB)
+ .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB)
+ .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB)
+ .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB)
+ .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB)
+ .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB)
+ .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB)
+ .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB)
+ .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB)
+ .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB)
.globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
.globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
.globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB)
@@ -28614,6 +29379,38 @@ GL_PREFIX(_dispatch_stub_752):
.globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB)
.globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB)
.globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB)
+ .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB)
+ .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB)
+ .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB)
+ .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB)
+ .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB)
+ .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB)
+ .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB)
+ .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB)
+ .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB)
+ .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB)
+ .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB)
+ .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB)
+ .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB)
+ .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB)
+ .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB)
+ .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB)
+ .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB)
+ .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB)
+ .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB)
+ .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB)
+ .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB)
+ .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB)
+ .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB)
+ .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB)
+ .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB)
+ .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB)
+ .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB)
+ .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB)
+ .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB)
+ .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB)
+ .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB)
+ .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB)
.globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB)
.globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
.globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT)
@@ -28684,7 +29481,7 @@ GL_PREFIX(_dispatch_stub_752):
.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_730)
+ .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_749)
#if defined(GLX_USE_TLS) && defined(__linux__)
.section ".note.ABI-tag", "a"
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index bd3b755e5c7..2c01b38aeb7 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -38,6 +38,7 @@
#else
# if defined(USE_MGL_NAMESPACE)
# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
# else
# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
# endif
@@ -549,9 +550,28 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(MultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
GL_STUB(MultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB, MultiTexCoord4sARB@20)
GL_STUB(MultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB, MultiTexCoord4svARB@8)
+ GL_STUB(AttachShader, _gloffset_AttachShader, AttachShader@8)
+ GL_STUB(CreateProgram, _gloffset_CreateProgram, CreateProgram@0)
+ GL_STUB(CreateShader, _gloffset_CreateShader, CreateShader@4)
+ GL_STUB(DeleteProgram, _gloffset_DeleteProgram, DeleteProgram@4)
+ GL_STUB(DeleteShader, _gloffset_DeleteShader, DeleteShader@4)
+ GL_STUB(DetachShader, _gloffset_DetachShader, DetachShader@8)
+ GL_STUB(GetAttachedShaders, _gloffset_GetAttachedShaders, GetAttachedShaders@16)
+ GL_STUB(GetProgramInfoLog, _gloffset_GetProgramInfoLog, GetProgramInfoLog@16)
+ GL_STUB(GetProgramiv, _gloffset_GetProgramiv, GetProgramiv@12)
+ GL_STUB(GetShaderInfoLog, _gloffset_GetShaderInfoLog, GetShaderInfoLog@16)
+ GL_STUB(GetShaderiv, _gloffset_GetShaderiv, GetShaderiv@12)
+ GL_STUB(IsProgram, _gloffset_IsProgram, IsProgram@4)
+ GL_STUB(IsShader, _gloffset_IsShader, IsShader@4)
GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16)
GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8)
GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16)
+ GL_STUB(UniformMatrix2x3fv, _gloffset_UniformMatrix2x3fv, UniformMatrix2x3fv@16)
+ GL_STUB(UniformMatrix2x4fv, _gloffset_UniformMatrix2x4fv, UniformMatrix2x4fv@16)
+ GL_STUB(UniformMatrix3x2fv, _gloffset_UniformMatrix3x2fv, UniformMatrix3x2fv@16)
+ GL_STUB(UniformMatrix3x4fv, _gloffset_UniformMatrix3x4fv, UniformMatrix3x4fv@16)
+ GL_STUB(UniformMatrix4x2fv, _gloffset_UniformMatrix4x2fv, UniformMatrix4x2fv@16)
+ GL_STUB(UniformMatrix4x3fv, _gloffset_UniformMatrix4x3fv, UniformMatrix4x3fv@16)
GL_STUB(LoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
GL_STUB(LoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
GL_STUB(MultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
@@ -684,22 +704,22 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(GetAttribLocationARB, _gloffset_GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB(DrawBuffersARB, _gloffset_DrawBuffersARB, DrawBuffersARB@8)
GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8)
- GL_STUB(_dispatch_stub_543, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_543@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_543, _dispatch_stub_543@8))
- GL_STUB(_dispatch_stub_544, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_544@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_544, _dispatch_stub_544@8))
- GL_STUB(_dispatch_stub_545, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_545@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_545, _dispatch_stub_545@8))
- GL_STUB(_dispatch_stub_546, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_546@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_546, _dispatch_stub_546@8))
- GL_STUB(_dispatch_stub_547, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_547@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_547, _dispatch_stub_547@8))
- GL_STUB(_dispatch_stub_548, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_548@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_548, _dispatch_stub_548@8))
- GL_STUB(_dispatch_stub_549, _gloffset_SampleMaskSGIS, _dispatch_stub_549@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_549, _dispatch_stub_549@8))
- GL_STUB(_dispatch_stub_550, _gloffset_SamplePatternSGIS, _dispatch_stub_550@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_550, _dispatch_stub_550@4))
+ GL_STUB(_dispatch_stub_562, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_562@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8))
+ GL_STUB(_dispatch_stub_563, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_563@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_563, _dispatch_stub_563@8))
+ GL_STUB(_dispatch_stub_564, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_564@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_564, _dispatch_stub_564@8))
+ GL_STUB(_dispatch_stub_565, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_565@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_565, _dispatch_stub_565@8))
+ GL_STUB(_dispatch_stub_566, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_566@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_566, _dispatch_stub_566@8))
+ GL_STUB(_dispatch_stub_567, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_567@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_567, _dispatch_stub_567@8))
+ GL_STUB(_dispatch_stub_568, _gloffset_SampleMaskSGIS, _dispatch_stub_568@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_568, _dispatch_stub_568@8))
+ GL_STUB(_dispatch_stub_569, _gloffset_SamplePatternSGIS, _dispatch_stub_569@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_569, _dispatch_stub_569@4))
GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20)
GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12)
GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16)
@@ -710,10 +730,10 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8)
GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8)
GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0)
- GL_STUB(_dispatch_stub_561, _gloffset_CullParameterdvEXT, _dispatch_stub_561@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_561, _dispatch_stub_561@8))
- GL_STUB(_dispatch_stub_562, _gloffset_CullParameterfvEXT, _dispatch_stub_562@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_562, _dispatch_stub_562@8))
+ GL_STUB(_dispatch_stub_580, _gloffset_CullParameterdvEXT, _dispatch_stub_580@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8))
+ GL_STUB(_dispatch_stub_581, _gloffset_CullParameterfvEXT, _dispatch_stub_581@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8))
GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12)
GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24)
@@ -738,8 +758,8 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4)
GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4)
GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB(_dispatch_stub_587, _gloffset_PixelTexGenSGIX, _dispatch_stub_587@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_587, _dispatch_stub_587@4))
+ GL_STUB(_dispatch_stub_606, _gloffset_PixelTexGenSGIX, _dispatch_stub_606@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_606, _dispatch_stub_606@4))
GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0)
GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8)
@@ -781,24 +801,24 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4)
GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16)
GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4)
- GL_STUB(_dispatch_stub_629, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_629@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_629, _dispatch_stub_629@20))
- GL_STUB(_dispatch_stub_630, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_630@24)
- HIDDEN(GL_PREFIX(_dispatch_stub_630, _dispatch_stub_630@24))
- GL_STUB(_dispatch_stub_631, _gloffset_DeleteFencesNV, _dispatch_stub_631@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_631, _dispatch_stub_631@8))
- GL_STUB(_dispatch_stub_632, _gloffset_FinishFenceNV, _dispatch_stub_632@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_632, _dispatch_stub_632@4))
- GL_STUB(_dispatch_stub_633, _gloffset_GenFencesNV, _dispatch_stub_633@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_633, _dispatch_stub_633@8))
- GL_STUB(_dispatch_stub_634, _gloffset_GetFenceivNV, _dispatch_stub_634@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_634, _dispatch_stub_634@12))
- GL_STUB(_dispatch_stub_635, _gloffset_IsFenceNV, _dispatch_stub_635@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_635, _dispatch_stub_635@4))
- GL_STUB(_dispatch_stub_636, _gloffset_SetFenceNV, _dispatch_stub_636@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_636, _dispatch_stub_636@8))
- GL_STUB(_dispatch_stub_637, _gloffset_TestFenceNV, _dispatch_stub_637@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_637, _dispatch_stub_637@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(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12)
GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8)
GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8)
@@ -879,26 +899,26 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8)
GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8)
GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8)
- GL_STUB(_dispatch_stub_718, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_718@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_718, _dispatch_stub_718@4))
- GL_STUB(_dispatch_stub_719, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_719@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_719, _dispatch_stub_719@4))
- GL_STUB(_dispatch_stub_720, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_720@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_720, _dispatch_stub_720@8))
- GL_STUB(_dispatch_stub_721, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_721@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_721, _dispatch_stub_721@8))
- GL_STUB(_dispatch_stub_722, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_722@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_722, _dispatch_stub_722@4))
+ GL_STUB(_dispatch_stub_737, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_737@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
+ GL_STUB(_dispatch_stub_738, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_738@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@4))
+ GL_STUB(_dispatch_stub_739, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_739@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@8))
+ GL_STUB(_dispatch_stub_740, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_740@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_740, _dispatch_stub_740@8))
+ GL_STUB(_dispatch_stub_741, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_741@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_741, _dispatch_stub_741@4))
GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16)
GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16)
GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44)
GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16)
GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28)
GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16)
- GL_STUB(_dispatch_stub_729, _gloffset_DepthBoundsEXT, _dispatch_stub_729@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_729, _dispatch_stub_729@16))
- GL_STUB(_dispatch_stub_730, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_730@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_730, _dispatch_stub_730@8))
+ GL_STUB(_dispatch_stub_748, _gloffset_DepthBoundsEXT, _dispatch_stub_748@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@16))
+ GL_STUB(_dispatch_stub_749, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_749@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@8))
GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8)
GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8)
GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
@@ -916,16 +936,16 @@ 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_748, _gloffset_BlitFramebufferEXT, _dispatch_stub_748@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_748, _dispatch_stub_748@40))
- GL_STUB(_dispatch_stub_749, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_749@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_749, _dispatch_stub_749@16))
- GL_STUB(_dispatch_stub_750, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_750@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_750, _dispatch_stub_750@16))
- GL_STUB(_dispatch_stub_751, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_751@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_751, _dispatch_stub_751@12))
- GL_STUB(_dispatch_stub_752, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_752@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_752, _dispatch_stub_752@12))
+ GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40))
+ GL_STUB(_dispatch_stub_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16))
+ GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16))
+ GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12))
+ GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12))
GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
@@ -1069,6 +1089,43 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(CompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
GL_STUB_ALIAS(CompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
GL_STUB_ALIAS(GetCompressedTexImage, _gloffset_GetCompressedTexImageARB, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12)
+ GL_STUB_ALIAS(DisableVertexAttribArray, _gloffset_DisableVertexAttribArrayARB, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(EnableVertexAttribArray, _gloffset_EnableVertexAttribArrayARB, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(GetVertexAttribdv, _gloffset_GetVertexAttribdvARB, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribfv, _gloffset_GetVertexAttribfvARB, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribiv, _gloffset_GetVertexAttribivARB, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
+ GL_STUB_ALIAS(VertexAttrib1d, _gloffset_VertexAttrib1dARB, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
+ GL_STUB_ALIAS(VertexAttrib1dv, _gloffset_VertexAttrib1dvARB, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1f, _gloffset_VertexAttrib1fARB, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)
+ GL_STUB_ALIAS(VertexAttrib1fv, _gloffset_VertexAttrib1fvARB, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1s, _gloffset_VertexAttrib1sARB, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8)
+ GL_STUB_ALIAS(VertexAttrib1sv, _gloffset_VertexAttrib1svARB, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8)
+ GL_STUB_ALIAS(VertexAttrib2d, _gloffset_VertexAttrib2dARB, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20)
+ GL_STUB_ALIAS(VertexAttrib2dv, _gloffset_VertexAttrib2dvARB, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2f, _gloffset_VertexAttrib2fARB, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12)
+ GL_STUB_ALIAS(VertexAttrib2fv, _gloffset_VertexAttrib2fvARB, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2s, _gloffset_VertexAttrib2sARB, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12)
+ GL_STUB_ALIAS(VertexAttrib2sv, _gloffset_VertexAttrib2svARB, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8)
+ GL_STUB_ALIAS(VertexAttrib3d, _gloffset_VertexAttrib3dARB, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28)
+ GL_STUB_ALIAS(VertexAttrib3dv, _gloffset_VertexAttrib3dvARB, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3f, _gloffset_VertexAttrib3fARB, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16)
+ GL_STUB_ALIAS(VertexAttrib3fv, _gloffset_VertexAttrib3fvARB, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3s, _gloffset_VertexAttrib3sARB, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16)
+ GL_STUB_ALIAS(VertexAttrib3sv, _gloffset_VertexAttrib3svARB, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nbv, _gloffset_VertexAttrib4NbvARB, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Niv, _gloffset_VertexAttrib4NivARB, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nsv, _gloffset_VertexAttrib4NsvARB, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nub, _gloffset_VertexAttrib4NubARB, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20)
+ GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
+ GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
+ GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
+ GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
+ GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8)
GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16)
GL_STUB_ALIAS(BufferSubData, _gloffset_BufferSubDataARB, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16)
@@ -1088,6 +1145,38 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(GetQueryObjectuiv, _gloffset_GetQueryObjectuivARB, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12)
GL_STUB_ALIAS(GetQueryiv, _gloffset_GetQueryivARB, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12)
GL_STUB_ALIAS(IsQuery, _gloffset_IsQueryARB, IsQuery@4, IsQueryARB, IsQueryARB@4)
+ GL_STUB_ALIAS(CompileShader, _gloffset_CompileShaderARB, CompileShader@4, CompileShaderARB, CompileShaderARB@4)
+ GL_STUB_ALIAS(GetActiveUniform, _gloffset_GetActiveUniformARB, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28)
+ GL_STUB_ALIAS(GetShaderSource, _gloffset_GetShaderSourceARB, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16)
+ GL_STUB_ALIAS(GetUniformLocation, _gloffset_GetUniformLocationARB, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8)
+ GL_STUB_ALIAS(GetUniformfv, _gloffset_GetUniformfvARB, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12)
+ GL_STUB_ALIAS(GetUniformiv, _gloffset_GetUniformivARB, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12)
+ GL_STUB_ALIAS(LinkProgram, _gloffset_LinkProgramARB, LinkProgram@4, LinkProgramARB, LinkProgramARB@4)
+ GL_STUB_ALIAS(ShaderSource, _gloffset_ShaderSourceARB, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16)
+ GL_STUB_ALIAS(Uniform1f, _gloffset_Uniform1fARB, Uniform1f@8, Uniform1fARB, Uniform1fARB@8)
+ GL_STUB_ALIAS(Uniform1fv, _gloffset_Uniform1fvARB, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12)
+ GL_STUB_ALIAS(Uniform1i, _gloffset_Uniform1iARB, Uniform1i@8, Uniform1iARB, Uniform1iARB@8)
+ GL_STUB_ALIAS(Uniform1iv, _gloffset_Uniform1ivARB, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12)
+ GL_STUB_ALIAS(Uniform2f, _gloffset_Uniform2fARB, Uniform2f@12, Uniform2fARB, Uniform2fARB@12)
+ GL_STUB_ALIAS(Uniform2fv, _gloffset_Uniform2fvARB, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12)
+ GL_STUB_ALIAS(Uniform2i, _gloffset_Uniform2iARB, Uniform2i@12, Uniform2iARB, Uniform2iARB@12)
+ GL_STUB_ALIAS(Uniform2iv, _gloffset_Uniform2ivARB, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12)
+ GL_STUB_ALIAS(Uniform3f, _gloffset_Uniform3fARB, Uniform3f@16, Uniform3fARB, Uniform3fARB@16)
+ GL_STUB_ALIAS(Uniform3fv, _gloffset_Uniform3fvARB, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12)
+ GL_STUB_ALIAS(Uniform3i, _gloffset_Uniform3iARB, Uniform3i@16, Uniform3iARB, Uniform3iARB@16)
+ GL_STUB_ALIAS(Uniform3iv, _gloffset_Uniform3ivARB, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12)
+ GL_STUB_ALIAS(Uniform4f, _gloffset_Uniform4fARB, Uniform4f@20, Uniform4fARB, Uniform4fARB@20)
+ GL_STUB_ALIAS(Uniform4fv, _gloffset_Uniform4fvARB, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12)
+ GL_STUB_ALIAS(Uniform4i, _gloffset_Uniform4iARB, Uniform4i@20, Uniform4iARB, Uniform4iARB@20)
+ GL_STUB_ALIAS(Uniform4iv, _gloffset_Uniform4ivARB, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12)
+ GL_STUB_ALIAS(UniformMatrix2fv, _gloffset_UniformMatrix2fvARB, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix3fv, _gloffset_UniformMatrix3fvARB, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix4fv, _gloffset_UniformMatrix4fvARB, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16)
+ GL_STUB_ALIAS(UseProgram, _gloffset_UseProgramObjectARB, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4)
+ GL_STUB_ALIAS(ValidateProgram, _gloffset_ValidateProgramARB, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4)
+ GL_STUB_ALIAS(BindAttribLocation, _gloffset_BindAttribLocationARB, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12)
+ GL_STUB_ALIAS(GetActiveAttrib, _gloffset_GetActiveAttribARB, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28)
+ GL_STUB_ALIAS(GetAttribLocation, _gloffset_GetAttribLocationARB, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB_ALIAS(DrawBuffers, _gloffset_DrawBuffersARB, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8)