Merge branch '7.8'
authorBrian Paul <brianp@vmware.com>
Tue, 23 Mar 2010 15:14:17 +0000 (09:14 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 23 Mar 2010 15:14:17 +0000 (09:14 -0600)
Conflicts:

Makefile
src/gallium/state_trackers/glx/xlib/xm_api.c
src/mesa/drivers/dri/intel/intel_blit.c
src/mesa/drivers/dri/intel/intel_pixel_copy.c
src/mesa/main/version.h

768 files changed:
Makefile
SConstruct
bin/mklib
configs/autoconf.in
configs/default
configs/freebsd-dri
configs/linux-cell
configs/linux-dri
configs/linux-dri-xcb
configs/linux-egl
configs/linux-i965
configs/linux-indirect
configs/linux-llvm
configs/linux-opengl-es
configure.ac
docs/GL3.txt
docs/egl.html
docs/install.html
docs/relnotes-7.9.html [new file with mode: 0644]
include/GL/gl_mangle.h
include/GL/glut_h.dja [deleted file]
include/GL/internal/dri_interface.h
include/GL/mglmesa.h [deleted file]
progs/demos/stex3d.c
progs/egl/Makefile
progs/fpglsl/dowhile.glsl [new file with mode: 0644]
progs/fpglsl/dowhile2.glsl [new file with mode: 0644]
progs/fpglsl/for.glsl [new file with mode: 0644]
progs/fpglsl/forbreak.glsl [new file with mode: 0644]
progs/fpglsl/fp-tri.c
progs/fpglsl/simpleif.glsl [new file with mode: 0644]
progs/fpglsl/while.glsl [new file with mode: 0644]
progs/fpglsl/while2.glsl [new file with mode: 0644]
progs/gallium/python/retrace/interpreter.py
progs/gallium/unit/u_format_test.c
progs/objviewer/skybox.c
progs/samples/copy.c
progs/samples/loadppm.c
progs/tests/fbotest1.c
progs/tests/fbotest2.c
progs/tests/fbotest3.c
progs/tests/stencil_twoside.c
progs/trivial/Makefile
progs/trivial/SConscript
progs/trivial/clear-fbo-scissor.c [new file with mode: 0644]
progs/trivial/tri-stencil.c
progs/xdemos/Makefile
progs/xdemos/omlsync.c
scons/llvm.py
src/SConscript
src/gallium/SConscript
src/gallium/auxiliary/Makefile
src/gallium/auxiliary/SConscript
src/gallium/auxiliary/cso_cache/cso_cache.c
src/gallium/auxiliary/cso_cache/cso_cache.h
src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/cso_cache/cso_context.h
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/draw/draw_pt_decompose.h
src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h
src/gallium/auxiliary/gallivm/lp_bld.h [new file with mode: 0644]
src/gallium/auxiliary/gallivm/lp_bld_alpha.h
src/gallium/auxiliary/gallivm/lp_bld_arit.c
src/gallium/auxiliary/gallivm/lp_bld_arit.h
src/gallium/auxiliary/gallivm/lp_bld_blend.h
src/gallium/auxiliary/gallivm/lp_bld_const.c
src/gallium/auxiliary/gallivm/lp_bld_const.h
src/gallium/auxiliary/gallivm/lp_bld_conv.c
src/gallium/auxiliary/gallivm/lp_bld_conv.h
src/gallium/auxiliary/gallivm/lp_bld_debug.h
src/gallium/auxiliary/gallivm/lp_bld_depth.c
src/gallium/auxiliary/gallivm/lp_bld_depth.h
src/gallium/auxiliary/gallivm/lp_bld_flow.c
src/gallium/auxiliary/gallivm/lp_bld_flow.h
src/gallium/auxiliary/gallivm/lp_bld_format.h
src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
src/gallium/auxiliary/gallivm/lp_bld_interp.c
src/gallium/auxiliary/gallivm/lp_bld_interp.h
src/gallium/auxiliary/gallivm/lp_bld_intr.h
src/gallium/auxiliary/gallivm/lp_bld_logic.c
src/gallium/auxiliary/gallivm/lp_bld_logic.h
src/gallium/auxiliary/gallivm/lp_bld_pack.c
src/gallium/auxiliary/gallivm/lp_bld_pack.h
src/gallium/auxiliary/gallivm/lp_bld_sample.c
src/gallium/auxiliary/gallivm/lp_bld_sample.h
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
src/gallium/auxiliary/gallivm/lp_bld_struct.h
src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
src/gallium/auxiliary/gallivm/lp_bld_swizzle.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/auxiliary/gallivm/lp_bld_type.c
src/gallium/auxiliary/gallivm/lp_bld_type.h
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/auxiliary/target-helpers/wrap_screen.c [new file with mode: 0644]
src/gallium/auxiliary/target-helpers/wrap_screen.h [new file with mode: 0644]
src/gallium/auxiliary/translate/translate_generic.c
src/gallium/auxiliary/translate/translate_sse.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_blit.h
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_blitter.h
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_debug.h
src/gallium/auxiliary/util/u_draw_quad.c
src/gallium/auxiliary/util/u_dump_state.c
src/gallium/auxiliary/util/u_format.csv
src/gallium/auxiliary/util/u_format.h
src/gallium/auxiliary/util/u_format_pack.py
src/gallium/auxiliary/util/u_format_parse.py
src/gallium/auxiliary/util/u_format_table.py
src/gallium/auxiliary/util/u_format_tests.c [new file with mode: 0644]
src/gallium/auxiliary/util/u_format_tests.h [new file with mode: 0644]
src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_gen_mipmap.h
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_pack_color.h
src/gallium/auxiliary/util/u_rect.c
src/gallium/auxiliary/util/u_sampler.c [new file with mode: 0644]
src/gallium/auxiliary/util/u_sampler.h [new file with mode: 0644]
src/gallium/auxiliary/util/u_simple_screen.c
src/gallium/auxiliary/util/u_tile.c
src/gallium/auxiliary/util/u_tile.h
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_compositor.h
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
src/gallium/docs/source/context.rst
src/gallium/docs/source/cso/rasterizer.rst
src/gallium/docs/source/cso/velems.rst [new file with mode: 0644]
src/gallium/drivers/cell/ppu/Makefile
src/gallium/drivers/cell/ppu/cell_buffer.c [new file with mode: 0644]
src/gallium/drivers/cell/ppu/cell_buffer.h [new file with mode: 0644]
src/gallium/drivers/cell/ppu/cell_context.c
src/gallium/drivers/cell/ppu/cell_context.h
src/gallium/drivers/cell/ppu/cell_draw_arrays.c
src/gallium/drivers/cell/ppu/cell_fence.c
src/gallium/drivers/cell/ppu/cell_pipe_state.c
src/gallium/drivers/cell/ppu/cell_public.h [new file with mode: 0644]
src/gallium/drivers/cell/ppu/cell_screen.c
src/gallium/drivers/cell/ppu/cell_screen.h
src/gallium/drivers/cell/ppu/cell_state_emit.c
src/gallium/drivers/cell/ppu/cell_state_shader.c
src/gallium/drivers/cell/ppu/cell_state_vertex.c
src/gallium/drivers/cell/ppu/cell_texture.c
src/gallium/drivers/cell/ppu/cell_texture.h
src/gallium/drivers/cell/ppu/cell_vertex_shader.c
src/gallium/drivers/cell/ppu/cell_winsys.h [deleted file]
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/failover/fo_context.h
src/gallium/drivers/failover/fo_state.c
src/gallium/drivers/failover/fo_state_emit.c
src/gallium/drivers/i915/i915_context.c
src/gallium/drivers/i915/i915_context.h
src/gallium/drivers/i915/i915_debug_fp.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/i915/i915_state_derived.c
src/gallium/drivers/i915/i915_state_emit.c
src/gallium/drivers/i915/i915_state_sampler.c
src/gallium/drivers/i915/i915_texture.c
src/gallium/drivers/i915/intel_winsys.h
src/gallium/drivers/i965/brw_context.c
src/gallium/drivers/i965/brw_context.h
src/gallium/drivers/i965/brw_draw_upload.c
src/gallium/drivers/i965/brw_pipe_sampler.c
src/gallium/drivers/i965/brw_pipe_vertex.c
src/gallium/drivers/i965/brw_screen.c
src/gallium/drivers/i965/brw_screen.h
src/gallium/drivers/i965/brw_screen_texture.c
src/gallium/drivers/i965/brw_structs.h
src/gallium/drivers/i965/brw_winsys.h
src/gallium/drivers/i965/brw_wm.c
src/gallium/drivers/i965/brw_wm_sampler_state.c
src/gallium/drivers/i965/brw_wm_surface_state.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/identity/id_drm.c
src/gallium/drivers/identity/id_objects.c
src/gallium/drivers/identity/id_objects.h
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/llvmpipe/README
src/gallium/drivers/llvmpipe/lp_buffer.c
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_flush.c
src/gallium/drivers/llvmpipe/lp_flush.h
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_jit.h
src/gallium/drivers/llvmpipe/lp_public.h [new file with mode: 0644]
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_rast.h
src/gallium/drivers/llvmpipe/lp_rast_priv.h
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/llvmpipe/lp_scene.h
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_screen.h
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup.h
src/gallium/drivers/llvmpipe/lp_setup_context.h
src/gallium/drivers/llvmpipe/lp_setup_line.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c
src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
src/gallium/drivers/llvmpipe/lp_state.h
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
src/gallium/drivers/llvmpipe/lp_state_sampler.c
src/gallium/drivers/llvmpipe/lp_state_vertex.c
src/gallium/drivers/llvmpipe/lp_surface.c
src/gallium/drivers/llvmpipe/lp_test.h
src/gallium/drivers/llvmpipe/lp_test_format.c
src/gallium/drivers/llvmpipe/lp_tex_sample.h
src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/llvmpipe/lp_texture.h
src/gallium/drivers/llvmpipe/lp_winsys.h [deleted file]
src/gallium/drivers/nouveau/Makefile
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_screen.h
src/gallium/drivers/nouveau/nouveau_util.h
src/gallium/drivers/nouveau/nouveau_winsys.h
src/gallium/drivers/nouveau/nv04_surface_2d.c [deleted file]
src/gallium/drivers/nouveau/nv04_surface_2d.h [deleted file]
src/gallium/drivers/nv30/Makefile [deleted file]
src/gallium/drivers/nv30/nv30_clear.c [deleted file]
src/gallium/drivers/nv30/nv30_context.c [deleted file]
src/gallium/drivers/nv30/nv30_context.h [deleted file]
src/gallium/drivers/nv30/nv30_draw.c [deleted file]
src/gallium/drivers/nv30/nv30_fragprog.c [deleted file]
src/gallium/drivers/nv30/nv30_fragtex.c [deleted file]
src/gallium/drivers/nv30/nv30_miptree.c [deleted file]
src/gallium/drivers/nv30/nv30_query.c [deleted file]
src/gallium/drivers/nv30/nv30_screen.c [deleted file]
src/gallium/drivers/nv30/nv30_screen.h [deleted file]
src/gallium/drivers/nv30/nv30_shader.h [deleted file]
src/gallium/drivers/nv30/nv30_state.c [deleted file]
src/gallium/drivers/nv30/nv30_state.h [deleted file]
src/gallium/drivers/nv30/nv30_state_blend.c [deleted file]
src/gallium/drivers/nv30/nv30_state_emit.c [deleted file]
src/gallium/drivers/nv30/nv30_state_fb.c [deleted file]
src/gallium/drivers/nv30/nv30_state_rasterizer.c [deleted file]
src/gallium/drivers/nv30/nv30_state_scissor.c [deleted file]
src/gallium/drivers/nv30/nv30_state_stipple.c [deleted file]
src/gallium/drivers/nv30/nv30_state_viewport.c [deleted file]
src/gallium/drivers/nv30/nv30_state_zsa.c [deleted file]
src/gallium/drivers/nv30/nv30_surface.c [deleted file]
src/gallium/drivers/nv30/nv30_transfer.c [deleted file]
src/gallium/drivers/nv30/nv30_vbo.c [deleted file]
src/gallium/drivers/nv30/nv30_vertprog.c [deleted file]
src/gallium/drivers/nv40/Makefile [deleted file]
src/gallium/drivers/nv40/nv40_clear.c [deleted file]
src/gallium/drivers/nv40/nv40_context.c [deleted file]
src/gallium/drivers/nv40/nv40_context.h [deleted file]
src/gallium/drivers/nv40/nv40_draw.c [deleted file]
src/gallium/drivers/nv40/nv40_fragprog.c [deleted file]
src/gallium/drivers/nv40/nv40_fragtex.c [deleted file]
src/gallium/drivers/nv40/nv40_miptree.c [deleted file]
src/gallium/drivers/nv40/nv40_query.c [deleted file]
src/gallium/drivers/nv40/nv40_screen.c [deleted file]
src/gallium/drivers/nv40/nv40_screen.h [deleted file]
src/gallium/drivers/nv40/nv40_shader.h [deleted file]
src/gallium/drivers/nv40/nv40_state.c [deleted file]
src/gallium/drivers/nv40/nv40_state.h [deleted file]
src/gallium/drivers/nv40/nv40_state_blend.c [deleted file]
src/gallium/drivers/nv40/nv40_state_emit.c [deleted file]
src/gallium/drivers/nv40/nv40_state_fb.c [deleted file]
src/gallium/drivers/nv40/nv40_state_rasterizer.c [deleted file]
src/gallium/drivers/nv40/nv40_state_scissor.c [deleted file]
src/gallium/drivers/nv40/nv40_state_stipple.c [deleted file]
src/gallium/drivers/nv40/nv40_state_viewport.c [deleted file]
src/gallium/drivers/nv40/nv40_state_zsa.c [deleted file]
src/gallium/drivers/nv40/nv40_surface.c [deleted file]
src/gallium/drivers/nv40/nv40_transfer.c [deleted file]
src/gallium/drivers/nv40/nv40_vbo.c [deleted file]
src/gallium/drivers/nv40/nv40_vertprog.c [deleted file]
src/gallium/drivers/nv50/Makefile
src/gallium/drivers/nv50/nv50_clear.c
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_program.c
src/gallium/drivers/nv50/nv50_push.c [new file with mode: 0644]
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_screen.h
src/gallium/drivers/nv50/nv50_state.c
src/gallium/drivers/nv50/nv50_state_validate.c
src/gallium/drivers/nv50/nv50_surface.c
src/gallium/drivers/nv50/nv50_tex.c
src/gallium/drivers/nv50/nv50_texture.h
src/gallium/drivers/nv50/nv50_transfer.c
src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/nvfx/Makefile [new file with mode: 0644]
src/gallium/drivers/nvfx/nv04_surface_2d.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nv04_surface_2d.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nv30_fragtex.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nv30_vertprog.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nv40_fragtex.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nv40_vertprog.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_clear.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_context.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_context.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_draw.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_fragprog.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_fragtex.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_miptree.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_query.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_screen.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_screen.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_shader.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_blend.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_emit.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_fb.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_rasterizer.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_scissor.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_stipple.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_viewport.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_state_zsa.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_surface.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_tex.h [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_transfer.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_vbo.c [new file with mode: 0644]
src/gallium/drivers/nvfx/nvfx_vertprog.c [new file with mode: 0644]
src/gallium/drivers/r300/Makefile
src/gallium/drivers/r300/SConscript
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_cs.h
src/gallium/drivers/r300/r300_debug.c
src/gallium/drivers/r300/r300_defines.h [new file with mode: 0644]
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_emit.h
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_fs.c
src/gallium/drivers/r300/r300_query.c
src/gallium/drivers/r300/r300_reg.h
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_screen.h
src/gallium/drivers/r300/r300_screen_buffer.c [new file with mode: 0644]
src/gallium/drivers/r300/r300_screen_buffer.h [new file with mode: 0644]
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_state_derived.c
src/gallium/drivers/r300/r300_state_inlines.h
src/gallium/drivers/r300/r300_state_invariant.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r300/r300_texture.h
src/gallium/drivers/r300/r300_transfer.c [new file with mode: 0644]
src/gallium/drivers/r300/r300_transfer.h [new file with mode: 0644]
src/gallium/drivers/r300/r300_vs.c
src/gallium/drivers/r300/r300_vs.h
src/gallium/drivers/r300/r300_winsys.h
src/gallium/drivers/softpipe/Makefile
src/gallium/drivers/softpipe/SConscript
src/gallium/drivers/softpipe/sp_buffer.c [new file with mode: 0644]
src/gallium/drivers/softpipe/sp_buffer.h [new file with mode: 0644]
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_fence.c [new file with mode: 0644]
src/gallium/drivers/softpipe/sp_fence.h [new file with mode: 0644]
src/gallium/drivers/softpipe/sp_flush.c
src/gallium/drivers/softpipe/sp_fs_exec.c
src/gallium/drivers/softpipe/sp_fs_sse.c
src/gallium/drivers/softpipe/sp_prim_vbuf.c
src/gallium/drivers/softpipe/sp_public.h [new file with mode: 0644]
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/softpipe/sp_screen.h
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/softpipe/sp_state_fs.c
src/gallium/drivers/softpipe/sp_state_sampler.c
src/gallium/drivers/softpipe/sp_state_vertex.c
src/gallium/drivers/softpipe/sp_tex_sample.c
src/gallium/drivers/softpipe/sp_tex_tile_cache.c
src/gallium/drivers/softpipe/sp_tex_tile_cache.h
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/softpipe/sp_texture.h
src/gallium/drivers/softpipe/sp_tile_cache.c
src/gallium/drivers/softpipe/sp_tile_cache.h
src/gallium/drivers/softpipe/sp_winsys.c [deleted file]
src/gallium/drivers/softpipe/sp_winsys.h [deleted file]
src/gallium/drivers/svga/svga_context.c
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_sampler.c
src/gallium/drivers/svga/svga_pipe_vertex.c
src/gallium/drivers/svga/svga_screen_texture.c
src/gallium/drivers/svga/svga_screen_texture.h
src/gallium/drivers/svga/svga_state_constants.c
src/gallium/drivers/svga/svga_state_fs.c
src/gallium/drivers/svga/svga_state_need_swtnl.c
src/gallium/drivers/svga/svga_state_rss.c
src/gallium/drivers/svga/svga_state_tss.c
src/gallium/drivers/svga/svga_state_vdecl.c
src/gallium/drivers/svga/svga_state_vs.c
src/gallium/drivers/svga/svga_swtnl_state.c
src/gallium/drivers/svga/svga_winsys.h
src/gallium/drivers/svga/svgadump/svga_shader_dump.c
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_context.h
src/gallium/drivers/trace/tr_drm.c
src/gallium/drivers/trace/tr_dump_state.c
src/gallium/drivers/trace/tr_public.h [new file with mode: 0644]
src/gallium/drivers/trace/tr_rbug.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/drivers/trace/tr_screen.h
src/gallium/drivers/trace/tr_texture.c
src/gallium/drivers/trace/tr_texture.h
src/gallium/include/pipe/p_compiler.h
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_format.h
src/gallium/include/pipe/p_screen.h
src/gallium/include/pipe/p_state.h
src/gallium/include/state_tracker/dri1_api.h
src/gallium/include/state_tracker/drm_api.h
src/gallium/include/state_tracker/st_api.h [new file with mode: 0644]
src/gallium/include/state_tracker/sw_winsys.h [new file with mode: 0644]
src/gallium/include/state_tracker/xlib_sw_winsys.h [new file with mode: 0644]
src/gallium/state_trackers/dri/Makefile
src/gallium/state_trackers/dri/SConscript
src/gallium/state_trackers/dri/dri1.c [new file with mode: 0644]
src/gallium/state_trackers/dri/dri1.h [new file with mode: 0644]
src/gallium/state_trackers/dri/dri_context.c
src/gallium/state_trackers/dri/dri_context.h
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/dri/dri_drawable.h
src/gallium/state_trackers/dri/dri_extensions.c
src/gallium/state_trackers/dri/dri_screen.c
src/gallium/state_trackers/dri/dri_screen.h
src/gallium/state_trackers/dri/dri_st_api.c [new file with mode: 0644]
src/gallium/state_trackers/dri/dri_st_api.h [new file with mode: 0644]
src/gallium/state_trackers/egl/common/egl_g3d.c
src/gallium/state_trackers/egl/common/egl_g3d.h
src/gallium/state_trackers/egl/common/egl_g3d_st.c [new file with mode: 0644]
src/gallium/state_trackers/egl/common/egl_g3d_st.h [new file with mode: 0644]
src/gallium/state_trackers/egl/common/egl_st.c [deleted file]
src/gallium/state_trackers/egl/common/egl_st.h [deleted file]
src/gallium/state_trackers/egl/common/native.h
src/gallium/state_trackers/egl/common/st_public_tmp.h [deleted file]
src/gallium/state_trackers/egl/kms/native_kms.c
src/gallium/state_trackers/egl/x11/native_dri2.c
src/gallium/state_trackers/egl/x11/native_x11.c
src/gallium/state_trackers/egl/x11/native_x11.h
src/gallium/state_trackers/egl/x11/native_ximage.c
src/gallium/state_trackers/egl/x11/sw_winsys.c [deleted file]
src/gallium/state_trackers/egl/x11/sw_winsys.h [deleted file]
src/gallium/state_trackers/es/Makefile
src/gallium/state_trackers/es/st_es1.c
src/gallium/state_trackers/es/st_es2.c
src/gallium/state_trackers/glx/xlib/Makefile
src/gallium/state_trackers/glx/xlib/SConscript
src/gallium/state_trackers/glx/xlib/glx_api.c
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/state_trackers/glx/xlib/xm_api.h
src/gallium/state_trackers/glx/xlib/xm_public.h [new file with mode: 0644]
src/gallium/state_trackers/glx/xlib/xm_st.c [new file with mode: 0644]
src/gallium/state_trackers/glx/xlib/xm_st.h [new file with mode: 0644]
src/gallium/state_trackers/glx/xlib/xm_winsys.h [deleted file]
src/gallium/state_trackers/python/SConscript
src/gallium/state_trackers/python/gallium.i
src/gallium/state_trackers/python/p_context.i
src/gallium/state_trackers/python/st_device.c
src/gallium/state_trackers/python/st_device.h
src/gallium/state_trackers/python/st_hardpipe_winsys.c
src/gallium/state_trackers/python/st_llvmpipe_winsys.c [deleted file]
src/gallium/state_trackers/python/st_softpipe_winsys.c
src/gallium/state_trackers/python/st_winsys.h
src/gallium/state_trackers/vega/Makefile
src/gallium/state_trackers/vega/api_context.c
src/gallium/state_trackers/vega/api_filters.c
src/gallium/state_trackers/vega/api_images.c
src/gallium/state_trackers/vega/api_masks.c
src/gallium/state_trackers/vega/image.c
src/gallium/state_trackers/vega/image.h
src/gallium/state_trackers/vega/mask.c
src/gallium/state_trackers/vega/mask.h
src/gallium/state_trackers/vega/paint.c
src/gallium/state_trackers/vega/paint.h
src/gallium/state_trackers/vega/polygon.c
src/gallium/state_trackers/vega/renderer.c
src/gallium/state_trackers/vega/renderer.h
src/gallium/state_trackers/vega/shader.c
src/gallium/state_trackers/vega/st_inlines.h
src/gallium/state_trackers/vega/vg_context.c
src/gallium/state_trackers/vega/vg_context.h
src/gallium/state_trackers/vega/vg_manager.c [new file with mode: 0644]
src/gallium/state_trackers/vega/vg_manager.h [new file with mode: 0644]
src/gallium/state_trackers/vega/vg_tracker.c
src/gallium/state_trackers/vega/vg_tracker.h
src/gallium/state_trackers/wgl/stw_context.c
src/gallium/state_trackers/wgl/stw_device.c
src/gallium/state_trackers/wgl/stw_device.h
src/gallium/state_trackers/wgl/stw_ext_gallium.c
src/gallium/state_trackers/wgl/stw_framebuffer.c
src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_exa.h
src/gallium/state_trackers/xorg/xorg_renderer.c
src/gallium/state_trackers/xorg/xorg_renderer.h
src/gallium/state_trackers/xorg/xorg_xv.c
src/gallium/state_trackers/xorg/xvmc/surface.c
src/gallium/targets/Makefile [new file with mode: 0644]
src/gallium/targets/SConscript [new file with mode: 0644]
src/gallium/targets/libgl-gdi/SConscript [new file with mode: 0644]
src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c [new file with mode: 0644]
src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c [new file with mode: 0644]
src/gallium/targets/libgl-xlib/Makefile [new file with mode: 0644]
src/gallium/targets/libgl-xlib/SConscript [new file with mode: 0644]
src/gallium/targets/libgl-xlib/xlib.c [new file with mode: 0644]
src/gallium/winsys/drm/Makefile
src/gallium/winsys/drm/Makefile.egl
src/gallium/winsys/drm/Makefile.template
src/gallium/winsys/drm/i965/dri/Makefile
src/gallium/winsys/drm/i965/gem/i965_drm_api.c
src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c
src/gallium/winsys/drm/i965/xlib/xlib_i965.c
src/gallium/winsys/drm/intel/gem/intel_drm_api.c
src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c
src/gallium/winsys/drm/nouveau/dri/Makefile
src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
src/gallium/winsys/drm/nouveau/egl/Makefile
src/gallium/winsys/drm/nouveau/xorg/Makefile
src/gallium/winsys/drm/radeon/core/Makefile
src/gallium/winsys/drm/radeon/core/radeon_buffer.c [deleted file]
src/gallium/winsys/drm/radeon/core/radeon_buffer.h
src/gallium/winsys/drm/radeon/core/radeon_drm.c
src/gallium/winsys/drm/radeon/core/radeon_drm.h
src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c [new file with mode: 0644]
src/gallium/winsys/drm/radeon/core/radeon_r300.c
src/gallium/winsys/drm/radeon/core/radeon_r300.h
src/gallium/winsys/drm/radeon/core/radeon_winsys.h
src/gallium/winsys/drm/radeon/python/README [deleted file]
src/gallium/winsys/drm/radeon/python/SConscript [deleted file]
src/gallium/winsys/drm/radeon/python/radeon_hardpipe_winsys.c [deleted file]
src/gallium/winsys/drm/radeon/python/xf86dri.c [deleted file]
src/gallium/winsys/drm/radeon/python/xf86dri.h [deleted file]
src/gallium/winsys/drm/radeon/python/xf86dristr.h [deleted file]
src/gallium/winsys/drm/sw/Makefile [new file with mode: 0644]
src/gallium/winsys/drm/sw/sw_drm_api.c [new file with mode: 0644]
src/gallium/winsys/drm/sw/sw_drm_api.h [new file with mode: 0644]
src/gallium/winsys/drm/sw/wrapper_sw_winsys.c [new file with mode: 0644]
src/gallium/winsys/drm/sw/wrapper_sw_winsys.h [new file with mode: 0644]
src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c
src/gallium/winsys/gdi/SConscript
src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c [deleted file]
src/gallium/winsys/gdi/gdi_softpipe_winsys.c [deleted file]
src/gallium/winsys/gdi/gdi_sw_winsys.c [new file with mode: 0644]
src/gallium/winsys/gdi/gdi_sw_winsys.h [new file with mode: 0644]
src/gallium/winsys/null/Makefile [new file with mode: 0644]
src/gallium/winsys/null/SConscript [new file with mode: 0644]
src/gallium/winsys/null/null_sw_winsys.c [new file with mode: 0644]
src/gallium/winsys/null/null_sw_winsys.h [new file with mode: 0644]
src/gallium/winsys/xlib/Makefile
src/gallium/winsys/xlib/SConscript
src/gallium/winsys/xlib/xlib.c [deleted file]
src/gallium/winsys/xlib/xlib.h [deleted file]
src/gallium/winsys/xlib/xlib_brw_context.c [deleted file]
src/gallium/winsys/xlib/xlib_cell.c [deleted file]
src/gallium/winsys/xlib/xlib_llvmpipe.c [deleted file]
src/gallium/winsys/xlib/xlib_softpipe.c [deleted file]
src/gallium/winsys/xlib/xlib_sw_winsys.c [new file with mode: 0644]
src/gallium/winsys/xlib/xmesa.h [deleted file]
src/gallium/winsys/xlib/xmesa_x.h [deleted file]
src/glx/drisw_glx.c
src/glx/glxcmds.c
src/glx/single2.c
src/mesa/SConscript
src/mesa/drivers/common/meta.c
src/mesa/drivers/dri/Makefile.template
src/mesa/drivers/dri/common/dri_test.c [new file with mode: 0644]
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/common/drisw_util.c [new file with mode: 0644]
src/mesa/drivers/dri/common/drisw_util.h [new file with mode: 0644]
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/common/utils.h
src/mesa/drivers/dri/common/xmlconfig.c
src/mesa/drivers/dri/i810/Makefile
src/mesa/drivers/dri/i810/server/i810_dri.c [deleted file]
src/mesa/drivers/dri/i915/Makefile
src/mesa/drivers/dri/i915/i830_texstate.c
src/mesa/drivers/dri/i915/i915_tex_layout.c
src/mesa/drivers/dri/i915/i915_texstate.c
src/mesa/drivers/dri/i915/server/intel_dri.c [deleted symlink]
src/mesa/drivers/dri/i965/Makefile
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_disasm.c
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_optimize.c [new file with mode: 0644]
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/i965/brw_vs_emit.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_emit.c
src/mesa/drivers/dri/i965/brw_wm_glsl.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen6_gs_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c
src/mesa/drivers/dri/i965/server/intel_dri.c [deleted symlink]
src/mesa/drivers/dri/intel/intel_blit.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h
src/mesa/drivers/dri/intel/intel_pixel_copy.c
src/mesa/drivers/dri/intel/intel_regions.c
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_span.c
src/mesa/drivers/dri/intel/intel_tex_copy.c
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/intel/intel_tex_layout.c
src/mesa/drivers/dri/intel/server/intel_dri.c [deleted file]
src/mesa/drivers/dri/mach64/Makefile
src/mesa/drivers/dri/mach64/mach64_context.c
src/mesa/drivers/dri/mga/Makefile
src/mesa/drivers/dri/mga/server/mga_dri.c [deleted file]
src/mesa/drivers/dri/nouveau/Makefile
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nouveau_context.h
src/mesa/drivers/dri/nouveau/nouveau_driver.c
src/mesa/drivers/dri/nouveau/nouveau_fbo.c
src/mesa/drivers/dri/nouveau/nouveau_gldefs.h
src/mesa/drivers/dri/nouveau/nouveau_render.h
src/mesa/drivers/dri/nouveau/nouveau_render_t.c
src/mesa/drivers/dri/nouveau/nouveau_span.c
src/mesa/drivers/dri/nouveau/nouveau_state.c
src/mesa/drivers/dri/nouveau/nouveau_state.h
src/mesa/drivers/dri/nouveau/nouveau_texture.c
src/mesa/drivers/dri/nouveau/nouveau_texture.h
src/mesa/drivers/dri/nouveau/nouveau_util.h
src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
src/mesa/drivers/dri/nouveau/nv04_context.c
src/mesa/drivers/dri/nouveau/nv04_state_fb.c
src/mesa/drivers/dri/nouveau/nv04_state_raster.c
src/mesa/drivers/dri/nouveau/nv10_context.c
src/mesa/drivers/dri/nouveau/nv10_driver.h
src/mesa/drivers/dri/nouveau/nv10_state_fb.c
src/mesa/drivers/dri/nouveau/nv10_state_tex.c
src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
src/mesa/drivers/dri/nouveau/nv20_context.c
src/mesa/drivers/dri/nouveau/nv20_driver.h
src/mesa/drivers/dri/nouveau/nv20_state_fb.c
src/mesa/drivers/dri/nouveau/nv20_state_tex.c
src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
src/mesa/drivers/dri/r128/Makefile
src/mesa/drivers/dri/r128/server/r128_dri.c [deleted file]
src/mesa/drivers/dri/r200/Makefile
src/mesa/drivers/dri/r200/r200_blit.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_pixel.c [deleted file]
src/mesa/drivers/dri/r200/r200_pixel.h [deleted file]
src/mesa/drivers/dri/r200/r200_reg.h
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_state.h
src/mesa/drivers/dri/r200/radeon_pixel_read.c [new symlink]
src/mesa/drivers/dri/r200/radeon_tex_getimage.c [new symlink]
src/mesa/drivers/dri/r200/radeon_tile.c [new symlink]
src/mesa/drivers/dri/r200/radeon_tile.h [new symlink]
src/mesa/drivers/dri/r200/server/radeon_dri.c [deleted symlink]
src/mesa/drivers/dri/r300/Makefile
src/mesa/drivers/dri/r300/r300_blit.c
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_state.h
src/mesa/drivers/dri/r300/r300_tex.c
src/mesa/drivers/dri/r300/r300_tex.h
src/mesa/drivers/dri/r300/radeon_pixel_read.c [new symlink]
src/mesa/drivers/dri/r300/radeon_tex_getimage.c [new symlink]
src/mesa/drivers/dri/r300/radeon_tile.c [new symlink]
src/mesa/drivers/dri/r300/radeon_tile.h [new symlink]
src/mesa/drivers/dri/r300/server/radeon_dri.c [deleted symlink]
src/mesa/drivers/dri/r600/Makefile
src/mesa/drivers/dri/r600/r600_context.c
src/mesa/drivers/dri/r600/r700_state.c
src/mesa/drivers/dri/r600/r700_state.h
src/mesa/drivers/dri/r600/radeon_pixel_read.c [new symlink]
src/mesa/drivers/dri/r600/radeon_tex_getimage.c [new symlink]
src/mesa/drivers/dri/r600/radeon_tile.c [new symlink]
src/mesa/drivers/dri/r600/radeon_tile.h [new symlink]
src/mesa/drivers/dri/r600/server/radeon_dri.c [deleted symlink]
src/mesa/drivers/dri/radeon/Makefile
src/mesa/drivers/dri/radeon/radeon_blit.c
src/mesa/drivers/dri/radeon/radeon_common.h
src/mesa/drivers/dri/radeon/radeon_common_context.h
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h
src/mesa/drivers/dri/radeon/radeon_pixel_read.c [new file with mode: 0644]
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/drivers/dri/radeon/radeon_tex_copy.c
src/mesa/drivers/dri/radeon/radeon_tex_getimage.c [new file with mode: 0644]
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.h
src/mesa/drivers/dri/radeon/radeon_tile.c [new file with mode: 0644]
src/mesa/drivers/dri/radeon/radeon_tile.h [new file with mode: 0644]
src/mesa/drivers/dri/radeon/server/radeon_dri.c [deleted file]
src/mesa/drivers/dri/savage/Makefile
src/mesa/drivers/dri/sis/Makefile
src/mesa/drivers/dri/swrast/Makefile
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/dri/swrast/swrast_priv.h
src/mesa/drivers/dri/swrast/swrast_span.c
src/mesa/drivers/dri/swrast/swrast_spantemp.h
src/mesa/drivers/dri/tdfx/Makefile
src/mesa/drivers/dri/tdfx/server/tdfx_dri.c [deleted file]
src/mesa/drivers/dri/unichrome/Makefile
src/mesa/drivers/dri/unichrome/server/via_dri.c [deleted file]
src/mesa/drivers/glslcompiler/Makefile
src/mesa/es/state_tracker/st_cb_drawtex.c
src/mesa/glapi/glapi.c
src/mesa/glapi/glapi.h
src/mesa/glapi/glapi_entrypoint.c [new file with mode: 0644]
src/mesa/glapi/glapi_execmem.c [new file with mode: 0644]
src/mesa/glapi/glapi_getproc.c
src/mesa/glapi/glapi_priv.h [new file with mode: 0644]
src/mesa/main/bufferobj.c
src/mesa/main/fbobject.c
src/mesa/main/framebuffer.c
src/mesa/main/get.c
src/mesa/main/get_gen.py
src/mesa/main/mtypes.h
src/mesa/main/texparam.c
src/mesa/main/version.h
src/mesa/sources.mak
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_atom_framebuffer.c
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_atom_texture.c
src/mesa/state_tracker/st_cb_accum.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_blit.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_fbo.h
src/mesa/state_tracker/st_cb_flush.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw_feedback.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_framebuffer.c
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_inlines.h
src/mesa/state_tracker/st_manager.c [new file with mode: 0644]
src/mesa/state_tracker/st_manager.h [new file with mode: 0644]
src/mesa/state_tracker/st_public.h
src/mesa/state_tracker/st_texture.c
src/mesa/state_tracker/st_texture.h
windows/VC8/mesa/mesa/mesa.vcproj

index 7c75d7f833d545d13668c14be9078f229e6954bf..e0d852e534ef590a62c3792b201211437d263dd0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -180,7 +180,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-VERSION=7.8-rc2
+VERSION=7.9-devel
 DIRECTORY = Mesa-$(VERSION)
 LIB_NAME = MesaLib-$(VERSION)
 DEMO_NAME = MesaDemos-$(VERSION)
@@ -215,7 +215,6 @@ MAIN_FILES = \
        $(DIRECTORY)/include/GL/glx_mangle.h                            \
        $(DIRECTORY)/include/GL/glfbdev.h                               \
        $(DIRECTORY)/include/GL/mesa_wgl.h                              \
-       $(DIRECTORY)/include/GL/mglmesa.h                               \
        $(DIRECTORY)/include/GL/osmesa.h                                \
        $(DIRECTORY)/include/GL/vms_x_fix.h                             \
        $(DIRECTORY)/include/GL/wglext.h                                \
index e1c4a1898ce01aec5f97d8127eeee1f961a65861..6ed44ddd0677181de86101896643b6404dd879fc 100644 (file)
@@ -110,9 +110,11 @@ Export([
 #######################################################################
 # Environment setup
 
-# Always build trace driver
+# Always build trace and identity drivers
 if 'trace' not in env['drivers']:
     env['drivers'].append('trace')
+if 'identity' not in env['drivers']:
+    env['drivers'].append('identity')
 
 # Includes
 env.Append(CPPPATH = [
@@ -120,6 +122,7 @@ env.Append(CPPPATH = [
        '#/src/gallium/include',
        '#/src/gallium/auxiliary',
        '#/src/gallium/drivers',
+       '#/src/gallium/winsys',
 ])
 
 if env['msvc']:
index 08ef99ec105ffc5ea5258500e7baa422e5a89e07..c2760e5d892724b0c6a065695c1f3752605ab43f 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -494,13 +494,16 @@ case $ARCH in
                OPTS="${OPTS} -Wl,-Mmapfile.scope"
            fi
 
-           # Check if objects are SPARC v9
+           # Check if objects are 64-bit
            # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
            set ${OBJECTS}
            if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
-               SPARCV9=`file $1 | grep SPARCV9`
-               if [ "${SPARCV9}" ] ; then
-                   OPTS="${OPTS} -xarch=v9"
+               ABI64=`file $1 | grep "ELF 64-bit"`
+               if [ "${ABI64}" ] ; then
+                   case `uname -p` in
+                       sparc)      OPTS="${OPTS} -xarch=v9" ;;
+                       i386)       OPTS="${OPTS} -xarch=amd64" ;;
+                   esac
                fi
            fi
             if [ "${ALTOPTS}" ] ; then
index 30637877f3b37ddcd614ba496da1f689f7534c71..f50fb7dd0935ffd0aafaaedb11e672ae0c89a55e 100644 (file)
@@ -24,6 +24,8 @@ RADEON_CFLAGS = @RADEON_CFLAGS@
 RADEON_LDFLAGS = @RADEON_LDFLAGS@
 INTEL_LIBS = @INTEL_LIBS@
 INTEL_CFLAGS = @INTEL_CFLAGS@
+X_LIBS = @X_LIBS@
+X_CFLAGS = @X_CFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
@@ -73,6 +75,7 @@ EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
 GALLIUM_DIRS = @GALLIUM_DIRS@
 GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
 GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
+GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
 GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@
 GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
 GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -83,7 +86,6 @@ PROGRAM_DIRS = @PROGRAM_DIRS@
 
 # Driver specific build vars
 DRI_DIRS = @DRI_DIRS@ 
-WINDOW_SYSTEM = @WINDOW_SYSTEM@
 EGL_DISPLAYS = @EGL_DISPLAYS@
 
 # Dependencies
index ad6d93c92ff6479d32086946c864c55b763ba035..8fbf8dd219a0cb4d0e2e4f6c33391b80092c7941 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_NAME = default
 
 # Version info
 MESA_MAJOR=7
-MESA_MINOR=8
+MESA_MINOR=9
 MESA_TINY=0
 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
@@ -86,7 +86,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
 
 # Directories to build
 LIB_DIR = lib
-SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw
+SRC_DIRS = glsl mesa gallium egl gallium/winsys gallium/targets glu glut/glx glew glw
 GLU_DIRS = sgi
 DRIVER_DIRS = x11 osmesa
 # Which subdirs under $(TOP)/progs/ to enter:
@@ -100,7 +100,8 @@ GALLIUM_DIRS = auxiliary drivers state_trackers
 GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
 GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity
 GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
-GALLIUM_WINSYS_DIRS = drm xlib
+GALLIUM_WINSYS_DIRS = null xlib drm
+GALLIUM_TARGET_DIRS = libgl-xlib
 GALLIUM_WINSYS_DRM_DIRS = swrast
 GALLIUM_STATE_TRACKERS_DIRS = glx vega
 
index 0b91cfc37e9629d1fb31480fd25d6534ac69776b..2c697e1c6e49ab2f7a76a0d7ed0394626d3e05f5 100644 (file)
@@ -44,7 +44,6 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
 SRC_DIRS = glx gallium mesa glu glut/glx glew glw
 DRIVER_DIRS = dri
 PROGRAM_DIRS = 
-WINDOW_SYSTEM=dri
 
 DRM_SOURCE_PATH=$(TOP)/../drm
 
index e89a08cd93455fd1e1819d1aa90b7b189f2692bf..0908dba9e05660b0f9e6c20a1a25c1b4d0de78c7 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_NAME = linux-cell
 
 
 # Omiting other gallium drivers:
-GALLIUM_DRIVERS_DIRS = cell softpipe trace
+GALLIUM_DRIVERS_DIRS = cell softpipe trace identity
 
 
 # Compiler and flags
@@ -37,7 +37,7 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS)
 
 
 # Omitting glw here:
-SRC_DIRS = glsl mesa gallium gallium/winsys glu glut/glx glew
+SRC_DIRS = glsl mesa gallium gallium/winsys gallium/targets glu glut/glx glew
 
 # Build no traditional Mesa drivers:
 DRIVER_DIRS =
index e8e8ccfcf94f5f94224cda4876d32b7b0383ac0e..d362fd8b377bd393e5d4ac1d23452547cba0ba6b 100644 (file)
@@ -58,8 +58,8 @@ PROGRAM_DIRS := egl $(PROGRAM_DIRS)
 EGL_DRIVERS_DIRS = glx
 
 DRIVER_DIRS = dri
-WINDOW_SYSTEM = dri
-GALLIUM_WINSYS_DIRS = drm
+GALLIUM_WINSYS_DIRS = null xlib drm
+GALLIUM_TARGET_DIRS =
 GALLIUM_WINSYS_DRM_DIRS = vmware intel i965
 GALLIUM_STATE_TRACKERS_DIRS = egl
 
index c5ed89c4b340beeaf8f87e68eacaf39a6b5908cd..1ed980aa36e2d1e16e7cd5d4c9503337de852789 100644 (file)
@@ -51,7 +51,5 @@ SRC_DIRS = glx gallium mesa glu glut/glx glew glw
 PROGRAM_DIRS = xdemos
 
 DRIVER_DIRS = dri
-WINDOW_SYSTEM=dri
-
 DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
        savage sis tdfx unichrome
index 2c2834b81d793d4e13b71d9c83520e68aaeff38c..28165ed5b5a3f30a6d0d86c223a97b0fbdb445b0 100644 (file)
@@ -47,11 +47,11 @@ GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
 
 
 # Directories
-SRC_DIRS = gallium mesa gallium/winsys glu egl
+SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
 PROGRAM_DIRS = egl
 
 DRIVER_DIRS = dri
-WINDOW_SYSTEM = dri
 GALLIUM_WINSYS_DIRS = egl_drm
+GALLIUM_TARGET_DIRS =
 
 DRI_DIRS = intel 
index e66abc347bb68486018f902db2decfbf03b04440..7656a2adc5eedda07d4c52b03e88c83048e19891 100644 (file)
@@ -6,3 +6,4 @@ CONFIG_NAME = linux-i965
 
 GALLIUM_DRIVER_DIRS = i965
 GALLIUM_WINSYS_DIRS = drm/i965/xlib
+GALLIUM_TARGET_DIRS =
index 0914fba19bc16be53b7260f36c105c4643483099..1c7dd857db6dd7ce5530aa10799e7232ba6f98a5 100644 (file)
@@ -50,4 +50,3 @@ GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
 SRC_DIRS = glx glu glut/glx glew glw
 DRIVER_DIRS =
 PROGRAM_DIRS = 
-WINDOW_SYSTEM=dri
index 27e082ebf7e2b85b37144e03b6d830edd4762327..608f42d6df017b22c7443c4be6e2288a23099000 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_NAME = linux-llvm
 GALLIUM_DRIVERS_DIRS += llvmpipe
 
 OPT_FLAGS = -O3 -ansi -pedantic
-ARCH_FLAGS = -m32 -mmmx -msse -msse2 -mstackrealign
+ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
 
 DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DDRAW_LLVM -DHAVE_UDIS86
 
index 259c26a931bd525c1806a1c0f0198547d5b933c8..76054aad14e25160a5d2ecdb9b91b30dd033d459 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_NAME = linux-opengl-es
 
 # Directories to build
 LIB_DIR = lib
-SRC_DIRS = egl glsl mesa/es gallium gallium/winsys
+SRC_DIRS = egl glsl mesa/es gallium gallium/winsys gallium/targets
 PROGRAM_DIRS = es1/screen es1/xegl es2/xegl
 
 # egl st needs this
index 61487c3905ef61e3c014ade038c8ba0477ce28b6..0f51097ef623427b03ef3437f6579e40592d90d4 100644 (file)
@@ -459,8 +459,8 @@ CORE_DIRS="glsl mesa"
 
 SRC_DIRS="glew"
 GLU_DIRS="sgi"
-WINDOW_SYSTEM=""
 GALLIUM_DIRS="auxiliary drivers state_trackers"
+GALLIUM_TARGET_DIRS=""
 GALLIUM_WINSYS_DIRS=""
 GALLIUM_WINSYS_DRM_DIRS=""
 GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
@@ -470,12 +470,12 @@ case "$mesa_driver" in
 xlib)
     DRIVER_DIRS="x11"
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
+    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
     ;;
 dri)
     SRC_DIRS="$SRC_DIRS glx"
     DRIVER_DIRS="dri"
-    WINDOW_SYSTEM="dri"
-    GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
+    GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib drm"
     ;;
 osmesa)
     DRIVER_DIRS="osmesa"
@@ -484,8 +484,8 @@ esac
 AC_SUBST([SRC_DIRS])
 AC_SUBST([GLU_DIRS])
 AC_SUBST([DRIVER_DIRS])
-AC_SUBST([WINDOW_SYSTEM])
 AC_SUBST([GALLIUM_DIRS])
+AC_SUBST([GALLIUM_TARGET_DIRS])
 AC_SUBST([GALLIUM_WINSYS_DIRS])
 AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
 AC_SUBST([GALLIUM_DRIVERS_DIRS])
@@ -547,7 +547,9 @@ else
     x11_pkgconfig=no
 fi
 dnl Use the autoconf macro if no pkg-config files
-if test "$x11_pkgconfig" = no; then
+if test "$x11_pkgconfig" = yes; then
+    PKG_CHECK_MODULES([X], [x11])
+else
     AC_PATH_XTRA
 fi
 
@@ -1358,7 +1360,7 @@ AC_ARG_ENABLE([gallium-nouveau],
     [enable_gallium_nouveau=no])
 if test "x$enable_gallium_nouveau" = xyes; then
     GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv40 nv50"
+    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
 fi
 
 dnl
@@ -1426,6 +1428,7 @@ echo ""
 if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
     echo "        Gallium:         yes"
     echo "        Gallium dirs:    $GALLIUM_DIRS"
+    echo "        Target dirs:     $GALLIUM_TARGET_DIRS"
     echo "        Winsys dirs:     $GALLIUM_WINSYS_DIRS"
     echo "        Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
     echo "        Driver dirs:     $GALLIUM_DRIVERS_DIRS"
index 889edefbce17f5b4b9e4f17e3286ca1e8017fea5..a485878af2d1003b7f72b0aab61b78cd2df3c938 100644 (file)
@@ -16,6 +16,7 @@ GLSL changes (GL_EXT_gpu_shader4, etc)                not started
 Conditional rendering (GL_NV_conditional_render)      DONE (swrast & softpipe)
 Map buffer subranges (GL_APPLE_flush_buffer_range)    not started
 Float textures, renderbuffers                         some infrastructure done
+ (incl. GL_EXT_packed_float, GL_EXT_shared_exponent)
 Framebuffer objects (GL_EXT_framebuffer_object)       DONE
 Half-float                                            some infrastructure done
 Multisample blit                                      DONE
index 55907f6cfac2dfb8bfa60aa98ce708eecc9e58a1..e960309fc475957f7202030cd4bec314649e95b0 100644 (file)
@@ -106,11 +106,11 @@ noted that the classic <code>libGL</code> is not a state tracker and cannot be
 used with EGL (unless the EGL driver in use is <code>egl_glx</code>).  To build
 the OpenGL state tracker, one may append <code>glx</code> to
 <code>--with-state-trackers</code> and manually build
-<code>src/gallium/winsys/xlib/</code>.</p>
+<code>src/gallium/targets/libgl-xlib/</code>.</p>
 
 <h2>Use EGL</h2>
 
-<p> The demos for OpenGL ES and OpenVG can be found in <code>progs/es1/</code>,
+<p>The demos for OpenGL ES and OpenVG can be found in <code>progs/es1/</code>,
 <code>progs/es2/</code> and <code>progs/openvg/</code>.  You can use them to
 test your build.  For example,</p>
 
index 5aea92e0b5119dbbb526fee67d665435f6b84187..3962ea5c91e12ace2584412944c6d754f1515223 100644 (file)
@@ -361,7 +361,7 @@ To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler tool
 This will create:
 </p>
 <ul>
-<li>build/windows-x86-debug/gallium/winsys/gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll 
+<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll 
 <li>build/windows-x86-debug/glut/glx/glut32.dll
 <li>progs/build/windows-x86-debug/wgl/wglinfo.exe
 <li>progs/build/windows-x86-debug/trivial/tri.exe
diff --git a/docs/relnotes-7.9.html b/docs/relnotes-7.9.html
new file mode 100644 (file)
index 0000000..f7d5016
--- /dev/null
@@ -0,0 +1,50 @@
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 7.9 Release Notes / date TBD</H1>
+
+<p>
+Mesa 7.9 is a new development release.
+People who are concerned with stability and reliability should stick
+with a previous release or wait for Mesa 7.9.1.
+</p>
+<p>
+Mesa 7.9 implements the OpenGL 2.1 API, but the version reported by
+glGetString(GL_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 2.1.
+</p>
+<p>
+See the <a href="install.html">Compiling/Installing page</a> for prerequisites
+for DRI hardware acceleration.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+tbd
+</pre>
+
+
+<h2>New features</h2>
+<ul>
+</ul>
+
+
+<h2>Bug fixes</h2>
+<ul>
+</ul>
+
+
+<h2>Changes</h2>
+<ul>
+</ul>
+
+</body>
+</html>
index b292840f917d94ab33733fd21102f9f09443a68d..43d2e896b0b2ec1f2aceb363d54da077b25af6c4 100644 (file)
 #define glEdgeFlagPointerListIBM               MANGLE(EdgeFlagPointerListIBM)
 #define glEdgeFlagPointer              MANGLE(EdgeFlagPointer)
 #define glEdgeFlagv            MANGLE(EdgeFlagv)
+#define glEGLImageTargetRenderbufferStorageOES         MANGLE(EGLImageTargetRenderbufferStorageOES)
+#define glEGLImageTargetTexture2DOES           MANGLE(EGLImageTargetTexture2DOES)
 #define glElementPointerAPPLE          MANGLE(ElementPointerAPPLE)
 #define glElementPointerATI            MANGLE(ElementPointerATI)
 #define glEnableClientStateIndexedEXT          MANGLE(EnableClientStateIndexedEXT)
diff --git a/include/GL/glut_h.dja b/include/GL/glut_h.dja
deleted file mode 100644 (file)
index e76dcb9..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-
-/*
- * Mesa 3-D graphics library
- * Version:  3.1
- * Copyright (C) 1995-1998  Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-/*
- * This header file is based on the REAL glut.h by Mark J. Kilgard.
- *
- * The DJGPP/ALLEGRO (DJA) GLUT implementation was written by
- * Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose
- * of compiling all the sample programs (which use GLUT). Therefore,
- * is NOT AT ALL a complete version of GLUT!
- */
-
-
-#ifndef __AGLUT_H__
-#define __AGLUT_H__
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#define GLUTCALLBACK
-#define APIENTRY
-#define GLUTAPI             extern
-
-#define GLUT_RGB                       0
-#define GLUT_RGBA                      GLUT_RGB
-#define GLUT_INDEX                     1
-#define GLUT_SINGLE                    0
-#define GLUT_DOUBLE                    2
-#define GLUT_ACCUM                     4
-#define GLUT_ALPHA                     8
-#define GLUT_DEPTH                     16
-#define GLUT_STENCIL        32
-
-/* Mouse buttons. */
-#define GLUT_LEFT_BUTTON    0
-#define GLUT_MIDDLE_BUTTON  1
-#define GLUT_RIGHT_BUTTON   2
-
-/* Mouse button  state. */
-#define GLUT_DOWN                      0
-#define GLUT_UP                                1
-
-/* function keys */
-#define GLUT_KEY_F1                    1
-#define GLUT_KEY_F2                    2
-#define GLUT_KEY_F3                    3
-#define GLUT_KEY_F4                    4
-#define GLUT_KEY_F5                    5
-#define GLUT_KEY_F6                    6
-#define GLUT_KEY_F7                    7
-#define GLUT_KEY_F8                    8
-#define GLUT_KEY_F9                    9
-#define GLUT_KEY_F10        10
-#define GLUT_KEY_F11        11
-#define GLUT_KEY_F12        12
-
-/* directional keys */
-#define GLUT_KEY_LEFT       100
-#define GLUT_KEY_UP                    101
-#define GLUT_KEY_RIGHT      102
-#define GLUT_KEY_DOWN       103
-#define GLUT_KEY_PAGE_UP    104
-#define GLUT_KEY_PAGE_DOWN  105
-#define GLUT_KEY_HOME       106
-#define GLUT_KEY_END        107
-#define GLUT_KEY_INSERT     108
-
-/* Entry/exit  state. */
-#define GLUT_LEFT                      0
-#define GLUT_ENTERED        1
-
-/* Visibility  state. */
-#define GLUT_NOT_VISIBLE    0
-#define GLUT_VISIBLE        1
-
-/* Color index component selection values. */
-#define GLUT_RED                       0
-#define GLUT_GREEN                     1
-#define GLUT_BLUE                      2
-
-/* Layers for use. */
-#define GLUT_NORMAL                    0
-#define GLUT_OVERLAY        1
-
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN           ((void*)0)
-#define GLUT_STROKE_MONO_ROMAN         ((void*)1)
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15         ((void*)2)
-#define GLUT_BITMAP_8_BY_13         ((void*)3)
-#define GLUT_BITMAP_TIMES_ROMAN_10     ((void*)4)
-#define GLUT_BITMAP_TIMES_ROMAN_24     ((void*)5)
-#define GLUT_BITMAP_HELVETICA_10       ((void*)6)
-#define GLUT_BITMAP_HELVETICA_12       ((void*)7)
-#define GLUT_BITMAP_HELVETICA_18    ((void*)8)
-
-/* glutGet parameters. */
-#define GLUT_WINDOW_X                   100
-#define GLUT_WINDOW_Y                   101
-#define GLUT_WINDOW_WIDTH               102
-#define GLUT_WINDOW_HEIGHT              103
-#define GLUT_WINDOW_BUFFER_SIZE         104
-#define GLUT_WINDOW_STENCIL_SIZE        105
-#define GLUT_WINDOW_DEPTH_SIZE          106
-#define GLUT_WINDOW_RED_SIZE            107
-#define GLUT_WINDOW_GREEN_SIZE          108
-#define GLUT_WINDOW_BLUE_SIZE           109
-#define GLUT_WINDOW_ALPHA_SIZE          110
-#define GLUT_WINDOW_ACCUM_RED_SIZE      111
-#define GLUT_WINDOW_ACCUM_GREEN_SIZE   112
-#define GLUT_WINDOW_ACCUM_BLUE_SIZE     113
-#define GLUT_WINDOW_ACCUM_ALPHA_SIZE   114
-#define GLUT_WINDOW_DOUBLEBUFFER        115
-#define GLUT_WINDOW_RGBA                116
-#define GLUT_WINDOW_PARENT              117
-#define GLUT_WINDOW_NUM_CHILDREN        118
-#define GLUT_WINDOW_COLORMAP_SIZE       119
-#define GLUT_WINDOW_NUM_SAMPLES         120
-#define GLUT_WINDOW_STEREO              121
-#define GLUT_WINDOW_CURSOR              122
-#define GLUT_SCREEN_WIDTH               200
-#define GLUT_SCREEN_HEIGHT              201
-#define GLUT_SCREEN_WIDTH_MM            202
-#define GLUT_SCREEN_HEIGHT_MM           203
-#define GLUT_MENU_NUM_ITEMS             300
-#define GLUT_DISPLAY_MODE_POSSIBLE      400
-#define GLUT_INIT_WINDOW_X              500
-#define GLUT_INIT_WINDOW_Y              501
-#define GLUT_INIT_WINDOW_WIDTH          502
-#define GLUT_INIT_WINDOW_HEIGHT         503
-#define GLUT_INIT_DISPLAY_MODE          504
-#define GLUT_ELAPSED_TIME               700
-#define GLUT_WINDOW_FORMAT_ID           123
-
-/* glutDeviceGet parameters. */
-#define GLUT_HAS_KEYBOARD               600
-#define GLUT_HAS_MOUSE                  601
-#define GLUT_HAS_SPACEBALL              602
-#define GLUT_HAS_DIAL_AND_BUTTON_BOX   603
-#define GLUT_HAS_TABLET                 604
-#define GLUT_NUM_MOUSE_BUTTONS          605
-#define GLUT_NUM_SPACEBALL_BUTTONS      606
-#define GLUT_NUM_BUTTON_BOX_BUTTONS     607
-#define GLUT_NUM_DIALS                  608
-#define GLUT_NUM_TABLET_BUTTONS         609
-#define GLUT_DEVICE_IGNORE_KEY_REPEAT   610
-#define GLUT_DEVICE_KEY_REPEAT          611
-#define GLUT_HAS_JOYSTICK               612
-#define GLUT_OWNS_JOYSTICK              613
-#define GLUT_JOYSTICK_BUTTONS           614
-#define GLUT_JOYSTICK_AXES              615
-#define GLUT_JOYSTICK_POLL_RATE         616
-
-/* glutLayerGet parameters. */
-#define GLUT_OVERLAY_POSSIBLE           800
-#define GLUT_LAYER_IN_USE               801
-#define GLUT_HAS_OVERLAY                802
-#define GLUT_TRANSPARENT_INDEX          803
-#define GLUT_NORMAL_DAMAGED             804
-#define GLUT_OVERLAY_DAMAGED            805
-
-/* glutVideoResizeGet parameters. */
-#define GLUT_VIDEO_RESIZE_POSSIBLE      900
-#define GLUT_VIDEO_RESIZE_IN_USE        901
-#define GLUT_VIDEO_RESIZE_X_DELTA       902
-#define GLUT_VIDEO_RESIZE_Y_DELTA       903
-#define GLUT_VIDEO_RESIZE_WIDTH_DELTA  904
-#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
-#define GLUT_VIDEO_RESIZE_X             906
-#define GLUT_VIDEO_RESIZE_Y             907
-#define GLUT_VIDEO_RESIZE_WIDTH         908
-#define GLUT_VIDEO_RESIZE_HEIGHT        909
-
-/* glutUseLayer parameters. */
-#define GLUT_NORMAL                     0
-#define GLUT_OVERLAY                    1
-
-/* glutGetModifiers return mask. */
-#define GLUT_ACTIVE_SHIFT               1
-#define GLUT_ACTIVE_CTRL                2
-#define GLUT_ACTIVE_ALT                 4
-
-/* glutSetCursor parameters. */
-/* Basic arrows. */
-#define GLUT_CURSOR_RIGHT_ARROW         0
-#define GLUT_CURSOR_LEFT_ARROW          1
-/* Symbolic cursor shapes. */
-#define GLUT_CURSOR_INFO                2
-#define GLUT_CURSOR_DESTROY             3
-#define GLUT_CURSOR_HELP                4
-#define GLUT_CURSOR_CYCLE               5
-#define GLUT_CURSOR_SPRAY               6
-#define GLUT_CURSOR_WAIT                7
-#define GLUT_CURSOR_TEXT                8
-#define GLUT_CURSOR_CROSSHAIR           9
-/* Directional cursors. */
-#define GLUT_CURSOR_UP_DOWN             10
-#define GLUT_CURSOR_LEFT_RIGHT          11
-/* Sizing cursors. */
-#define GLUT_CURSOR_TOP_SIDE            12
-#define GLUT_CURSOR_BOTTOM_SIDE         13
-#define GLUT_CURSOR_LEFT_SIDE           14
-#define GLUT_CURSOR_RIGHT_SIDE          15
-#define GLUT_CURSOR_TOP_LEFT_CORNER     16
-#define GLUT_CURSOR_TOP_RIGHT_CORNER   17
-#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER        18
-#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
-/* Inherit from parent window. */
-#define GLUT_CURSOR_INHERIT             100
-/* Blank cursor. */
-#define GLUT_CURSOR_NONE                101
-/* Fullscreen crosshair (if available). */
-#define GLUT_CURSOR_FULL_CROSSHAIR      102
-
-/* GLUT initialization sub-API. */
-GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
-GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
-GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
-GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
-GLUTAPI void APIENTRY glutMainLoop(void);
-
-/* GLUT window sub-API. */
-GLUTAPI int APIENTRY glutCreateWindow(const char *title);
-GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutDestroyWindow(int win);
-GLUTAPI void APIENTRY glutPostRedisplay(void);
-GLUTAPI void APIENTRY glutSwapBuffers(void);
-GLUTAPI int APIENTRY glutGetWindow(void);
-GLUTAPI void APIENTRY glutSetWindow(int win);
-GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
-GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
-GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
-GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
-GLUTAPI void APIENTRY glutPopWindow(void);
-GLUTAPI void APIENTRY glutPushWindow(void);
-GLUTAPI void APIENTRY glutIconifyWindow(void);
-GLUTAPI void APIENTRY glutShowWindow(void);
-GLUTAPI void APIENTRY glutHideWindow(void);
-
-/* GLUT overlay sub-API. */
-GLUTAPI void APIENTRY glutEstablishOverlay(void);
-GLUTAPI void APIENTRY glutRemoveOverlay(void);
-GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
-GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
-GLUTAPI void APIENTRY glutShowOverlay(void);
-GLUTAPI void APIENTRY glutHideOverlay(void);
-
-/* GLUT menu sub-API. */
-GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int));
-GLUTAPI void APIENTRY glutDestroyMenu(int menu);
-GLUTAPI int APIENTRY glutGetMenu(void);
-GLUTAPI void APIENTRY glutSetMenu(int menu);
-GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
-GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
-GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
-GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
-GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
-GLUTAPI void APIENTRY glutAttachMenu(int button);
-GLUTAPI void APIENTRY glutDetachMenu(int button);
-
-/* GLUT window callback sub-API. */
-GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
-GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value);
-GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state));
-GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state));
-GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state));
-GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value));
-GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y));
-GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y));
-GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void));
-GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state));
-
-/* GLUT color index sub-API. */
-GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
-GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
-GLUTAPI void APIENTRY glutCopyColormap(int win);
-
-/* GLUT state retrieval sub-API. */
-GLUTAPI int APIENTRY glutGet(GLenum type);
-GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
-
-/* GLUT font sub-API */
-GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
-GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
-
-/* GLUT pre-built models sub-API */
-GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCube(GLdouble size);
-GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
-GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutWireDodecahedron(void);
-GLUTAPI void APIENTRY glutSolidDodecahedron(void);
-GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutWireOctahedron(void);
-GLUTAPI void APIENTRY glutSolidOctahedron(void);
-GLUTAPI void APIENTRY glutWireTetrahedron(void);
-GLUTAPI void APIENTRY glutSolidTetrahedron(void);
-GLUTAPI void APIENTRY glutWireIcosahedron(void);
-GLUTAPI void APIENTRY glutSolidIcosahedron(void);
-
-#endif /* __AGLUT_H__ */
index 1d4e82e154a4dd93a8b90f2ac0b91979dacff937..aa56eb45d798cfaa1b1cf0d9a247bc68e2320665 100644 (file)
 #define DRI_INTERFACE_H
 
 /* For archs with no drm.h */
-#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__)
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
 #include <drm.h>
 #else
 typedef unsigned int drm_context_t;
diff --git a/include/GL/mglmesa.h b/include/GL/mglmesa.h
deleted file mode 100644 (file)
index 0f9f789..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-*
-*                      Mesa bindings for SciTech MGL
-*
-*                   Copyright (C) 1996 SciTech Software.
-*                           All rights reserved.
-*
-* Filename:     mglmesa.h
-* Version:      Revision: 1.1.1.1
-*
-* Language:     ANSI C
-* Environment:  Any
-*
-* Description:  Header file for the Mesa/OpenGL interface bindings for the
-*               SciTech MGL graphics library. Uses the MGL internal
-*               device context structures to get direct access to the
-*               high performance MGL rasterization functions for maximum
-*               performance. Utilizes the VESA VBE/AF Accelerator Functions
-*               via the MGL's accelerated device driver functions, as well
-*               as basic DirectDraw accelerated functions provided by the
-*               MGL.
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Library General Public
-* License as published by the Free Software Foundation; either
-* version 2 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* Library General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public
-* License along with this library; if not, write to the Free
-* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*
-****************************************************************************/
-
-#ifndef __MGLMESA_H
-#define __MGLMESA_H
-
-#include "mgraph.h"
-
-/*------------------------- Function Prototypes ---------------------------*/
-
-#ifdef  __cplusplus
-extern "C" {            /* Use "C" linkage when in C++ mode */
-#endif
-
-#ifndef __WINDOWS__
-#define GLAPIENTRY
-#endif
-
-#ifdef  __WINDOWS__
-bool    GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version);
-#endif
-void    GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual);
-bool    GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual);
-bool    GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC);
-void    GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc);
-void    GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc);
-void    GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT);
-
-/* Palette manipulation support. The reason we provide palette manipulation
- * routines is so that when rendering in double buffered modes with a
- * software backbuffer, the palette for the backbuffer is kept consistent
- * with the hardware front buffer.
- */
-
-void    GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue);
-void    GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex);
-void    GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT);
-
-#ifdef  __cplusplus
-}                       /* End of "C" linkage for C++   */
-#endif  /* __cplusplus */
-
-#endif  /* __MGLMESA_H */
index c0bbea0960f4933589924c75b7142f42124bedb1..de18480c25e6cc69221ee1146792f9281ba9e1a2 100644 (file)
@@ -36,6 +36,7 @@ static int tex_width=64, tex_height=64, tex_depth=64;
 static float angx=0, angy=0, angz=0;
 static int texgen = 2, animate = 1, smooth = 1, wireframe = 0;
 static int CurTexture = NOISE_TEXTURE, CurObject = TORUS;
+static GLenum Filter = GL_LINEAR;
 
 
 static void
@@ -298,8 +299,6 @@ create3Dtexture(void)
    printf("setting up 3d texture...\n");
 
    glBindTexture(GL_TEXTURE_3D, NOISE_TEXTURE);
-   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
@@ -406,6 +405,9 @@ drawScene(void)
       glDisable(GL_TEXTURE_GEN_R);
    }
 
+   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, Filter);
+   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, Filter);
+
    glCallList(CurObject);
    glPopMatrix();
 
@@ -505,6 +507,12 @@ KeyHandler(unsigned char key, int x, int y)
       else
          CurObject = TORUS;
       break;
+   case 'f':
+      if (Filter == GL_LINEAR)
+         Filter = GL_NEAREST;
+      else
+         Filter = GL_LINEAR;
+      break;
    case 'i':
       if (CurTexture == NOISE_TEXTURE)
          CurTexture = GRADIENT_TEXTURE;
@@ -513,6 +521,7 @@ KeyHandler(unsigned char key, int x, int y)
       glBindTexture(GL_TEXTURE_3D, CurTexture);
       break;
    case 'a':
+   case ' ':
       animate = !animate;
       if (animate)
          glutIdleFunc(Idle);
@@ -559,8 +568,6 @@ create3Dgradient(void)
 
 
    glBindTexture(GL_TEXTURE_3D, GRADIENT_TEXTURE);
-   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-   glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
index 25de6e1f70387504f6c89fe4a3a74dc4029121a8..5f51104fed6fbc6d3bda0f8d852e260fbf49180a 100644 (file)
@@ -57,13 +57,13 @@ peglgears: peglgears.o $(HEADERS) $(LIB_DEP)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(LIBDRM_LIB) -lm
 
 xeglgears: xeglgears.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 xeglthreads: xeglthreads.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 xegl_tri: xegl_tri.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 clean:
        -rm -f *.o *~
diff --git a/progs/fpglsl/dowhile.glsl b/progs/fpglsl/dowhile.glsl
new file mode 100644 (file)
index 0000000..ed9d729
--- /dev/null
@@ -0,0 +1,8 @@
+void main() {
+    float sum = 0.0;
+    do {
+       sum += 0.1;
+       break;
+    } while (true);
+    gl_FragColor = vec4(sum);
+}
diff --git a/progs/fpglsl/dowhile2.glsl b/progs/fpglsl/dowhile2.glsl
new file mode 100644 (file)
index 0000000..f3e00b8
--- /dev/null
@@ -0,0 +1,10 @@
+void main() {
+    float sum = 0.0;
+    do {
+       sum += 0.1;
+       if (sum < 0.499999)
+           continue;
+       break;
+    } while (true);
+    gl_FragColor = vec4(sum);
+}
diff --git a/progs/fpglsl/for.glsl b/progs/fpglsl/for.glsl
new file mode 100644 (file)
index 0000000..862ca8b
--- /dev/null
@@ -0,0 +1,11 @@
+uniform int KernelSizeInt;
+
+void main() {
+    int i;
+    vec4 sum = vec4(0.0);
+    for (i = 0; i < KernelSizeInt; ++i) {
+       sum.g += 0.25;
+    }
+    sum.a = 1.0;
+    gl_FragColor = sum;
+}
diff --git a/progs/fpglsl/forbreak.glsl b/progs/fpglsl/forbreak.glsl
new file mode 100644 (file)
index 0000000..0b8d957
--- /dev/null
@@ -0,0 +1,13 @@
+uniform int KernelSizeInt;
+
+void main() {
+    int i;
+    vec4 sum = vec4(0.0);
+    for (i = 0; i < KernelSizeInt; ++i) {
+       sum.g += 0.25;
+        if (i > 0)
+           break;
+    }
+    sum.a = 1.0;
+    gl_FragColor = sum;
+}
index c9b08fbbad72f1921d49e1043d7d47e0b3f1d3fb..8af09845dd86b676e231ad61d84dd0cb5594ecd8 100644 (file)
@@ -128,6 +128,11 @@ static void setup_uniforms()
 
    }
 
+   {
+      GLint loci = glGetUniformLocationARB(program, "KernelSizeInt");
+      if (loci >= 0)
+         glUniform1i(loci, 4);
+   }
    {
       GLint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
       GLint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
diff --git a/progs/fpglsl/simpleif.glsl b/progs/fpglsl/simpleif.glsl
new file mode 100644 (file)
index 0000000..922421b
--- /dev/null
@@ -0,0 +1,6 @@
+void main() {
+    // this should always be true
+    if (gl_FragCoord.x >= 0.0) {
+       gl_FragColor = vec4(0.5, 0.0, 0.5, 1.0);
+    }
+}
diff --git a/progs/fpglsl/while.glsl b/progs/fpglsl/while.glsl
new file mode 100644 (file)
index 0000000..05fb860
--- /dev/null
@@ -0,0 +1,7 @@
+void main() {
+    float sum = 0.0;
+    while (sum < 0.499999) {
+       sum += 0.1;
+    }
+    gl_FragColor = vec4(sum);
+}
diff --git a/progs/fpglsl/while2.glsl b/progs/fpglsl/while2.glsl
new file mode 100644 (file)
index 0000000..19c8904
--- /dev/null
@@ -0,0 +1,9 @@
+void main() {
+    float sum = 0.0;
+    while (true) {
+       sum += 0.1;
+        if (sum > 0.8)
+           break;
+    }
+    gl_FragColor = vec4(sum);
+}
index b30469dfaeebc75b8c670bd5c790f77b8595784d..1a9618125535768250f054924229e3d7719d1f05 100755 (executable)
@@ -551,7 +551,6 @@ class Context(Object):
                 data = vbuf.buffer.read()
                 values = unpack_from(format, data, offset)
                 sys.stdout.write('\t\t{' + ', '.join(map(str, values)) + '},\n')
-                assert len(values) == velem.nr_components
             sys.stdout.write('\t},\n')
         sys.stdout.flush()
 
index 2dfba5538bf1fab43d056dd5ea761597cdc4b0c2..5274311e0351d872b2d38c2c01f3cd76f13a811a 100644 (file)
 #include <stdio.h>
 
 #include "util/u_format.h"
+#include "util/u_format_tests.h"
 #include "util/u_format_pack.h"
 
 
-#define MAX_PACKED_BYTES 16
-
-
-/**
- * A (packed, unpacked) color pair.
- */
-struct util_format_test_case
-{
-   enum pipe_format format;
-
-   /**
-    * Mask of the bits that actually meaningful data. Used to mask out the
-    * "X" channels.
-    */
-   uint8_t mask[MAX_PACKED_BYTES];
-
-   uint8_t packed[MAX_PACKED_BYTES];
-
-   /**
-    * RGBA.
-    */
-   double unpacked[4];
-};
-
-
-/*
- * Helper macros to create the packed bytes for longer words.
- */
-
-#define PACKED_1x8(x)          {x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_2x8(x, y)       {x, y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_3x8(x, y, z)    {x, y, z, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_4x8(x, y, z, w) {x, y, z, w, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-
-#define PACKED_1x16(x)          {(x) & 0xff, (x) >> 8,          0,        0,          0,        0,          0,        0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_2x16(x, y)       {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8,          0,        0,          0,        0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_3x16(x, y, z)    {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8, (z) & 0xff, (z) >> 8,          0,        0, 0, 0, 0, 0, 0, 0, 0, 0}
-#define PACKED_4x16(x, y, z, w) {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8, (z) & 0xff, (z) >> 8, (w) & 0xff, (w) >> 8, 0, 0, 0, 0, 0, 0, 0, 0}
-
-#define PACKED_1x32(x)          {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24,          0,                 0,                  0,         0,          0,                 0,                  0,         0,          0,                 0,                  0,         0}
-#define PACKED_2x32(x, y)       {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24,          0,                 0,                  0,         0,          0,                 0,                  0,         0}
-#define PACKED_3x32(x, y, z)    {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24, (z) & 0xff, ((z) >> 8) & 0xff, ((z) >> 16) & 0xff, (z) >> 24,          0,                 0,                  0,         0}
-#define PACKED_4x32(x, y, z, w) {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24, (z) & 0xff, ((z) >> 8) & 0xff, ((z) >> 16) & 0xff, (z) >> 24, (w) & 0xff, ((w) >> 8) & 0xff, ((w) >> 16) & 0xff, (w) >> 24}
-
-
-/**
- * Test cases.
- *
- * These were manually entered. We could generate these
- *
- * To keep this to a we cover only the corner cases, which should produce
- * good enough coverage since that pixel format transformations are afine for
- * non SRGB formats.
- */
-static const struct util_format_test_case
-test_cases[] =
-{
-
-   /*
-    * 32-bit rendertarget formats
-    */
-
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x0000ff00), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00ff0000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x0000ff00), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xff000000), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x0000ff00), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xff000000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000003ff), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000ffc00), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x3ff00000), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xc0000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   /*
-    * 16-bit rendertarget formats
-    */
-
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x001f), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x03e0), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x7c00), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x000f), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x00f0), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0f00), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x001f), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x07e0), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf800), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   /*
-    * Luminance/intensity/alpha formats
-    */
-
-   {PIPE_FORMAT_L8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_L8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_A8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_A8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {0.0, 0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_I8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_I8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x00ff), {1.0, 1.0, 1.0, 0.0}},
-   {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xff00), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_L16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_L16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   /*
-    * TODO: SRGB formats
-    */
-
-   /*
-    * Mixed-signed formats
-    */
-
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00000000), { 0.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x0000007f), { 1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00000081), {-1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00007f00), { 0.0,  1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00008100), { 0.0, -1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00ff0000), { 0.0,  0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0xff000000), { 0.0,  0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), { 0.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x000f), { 1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0011), {-1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x01e0), { 0.0,  1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0220), { 0.0, -1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0xfc00), { 0.0,  0.0, 1.0, 1.0}},
-
-   /*
-    * TODO: Depth-stencil formats
-    */
-
-   /*
-    * TODO: YUV formats
-    */
-
-   /*
-    * TODO: Compressed formats
-    */
-
-   /*
-    * Standard 8-bit integer formats
-    */
-
-   {PIPE_FORMAT_R8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0x00), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0xff), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0xff), {1.0, 1.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0x00, 0x00), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0xff, 0x00), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0xff), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0xff, 0xff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0x00, 0x00, 0x00), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0xff, 0x00, 0x00), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0xff, 0x00), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0xff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0xff, 0xff, 0xff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0x00), {  0.0,   0.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0xff), {255.0,   0.0,   0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), {  0.0,   0.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0x00), {255.0,   0.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0xff), {  0.0, 255.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0xff), {255.0, 255.0,   0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), {  0.0,   0.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0x00, 0x00), {255.0,   0.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0xff, 0x00), {  0.0, 255.0,   0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0xff), {  0.0,   0.0, 255.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0xff, 0xff), {255.0, 255.0, 255.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), {  0.0,   0.0,   0.0,   0.0}},
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0x00, 0x00, 0x00), {255.0,   0.0,   0.0,   0.0}},
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0xff, 0x00, 0x00), {  0.0, 255.0,   0.0,   0.0}},
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0xff, 0x00), {  0.0,   0.0, 255.0,   0.0}},
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0xff), {  0.0,   0.0,   0.0, 255.0}},
-   {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0xff, 0xff, 0xff), {255.0, 255.0, 255.0, 255.0}},
-
-   {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), { 0.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x7f), { 1.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x81), {-1.0,  0.0,  0.0,  1.0}},
-
-   {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), { 0.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x7f, 0x00), { 1.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x81, 0x00), {-1.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x7f), { 0.0,  1.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x81), { 0.0, -1.0,  0.0,  1.0}},
-
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), { 0.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x7f, 0x00, 0x00), { 1.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x81, 0x00, 0x00), {-1.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x7f, 0x00), { 0.0,  1.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x81, 0x00), { 0.0, -1.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x7f), { 0.0,  0.0,  1.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x81), { 0.0,  0.0, -1.0,  1.0}},
-
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), { 0.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x7f, 0x00, 0x00, 0x00), { 1.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x81, 0x00, 0x00, 0x00), {-1.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x7f, 0x00, 0x00), { 0.0,  1.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x81, 0x00, 0x00), { 0.0, -1.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x7f, 0x00), { 0.0,  0.0,  1.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x81, 0x00), { 0.0,  0.0, -1.0,  0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x7f), { 0.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x81), { 0.0,  0.0,  0.0, -1.0}},
-
-   {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x00), {   0.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x7f), { 127.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x80), {-128.0,    0.0,    0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), {   0.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x7f, 0x00), { 127.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x80, 0x00), {-128.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x7f), {   0.0,  127.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x80), {   0.0, -128.0,    0.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), {   0.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x7f, 0x00, 0x00), { 127.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x80, 0x00, 0x00), {-128.0,    0.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x7f, 0x00), {   0.0,  127.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x80, 0x00), {   0.0, -128.0,    0.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x7f), {   0.0,    0.0,  127.0, 1.0}},
-   {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x80), {   0.0,    0.0, -128.0, 1.0}},
-
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), {   0.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x7f, 0x00, 0x00, 0x00), { 127.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x80, 0x00, 0x00, 0x00), {-128.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x7f, 0x00, 0x00), {   0.0,  127.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x80, 0x00, 0x00), {   0.0, -128.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x7f, 0x00), {   0.0,    0.0,  127.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x80, 0x00), {   0.0,    0.0, -128.0,    0.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x7f), {   0.0,    0.0,    0.0,  127.0}},
-   {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x80), {   0.0,    0.0,    0.0, -128.0}},
-
-   /*
-    * Standard 16-bit integer formats
-    */
-
-   {PIPE_FORMAT_R16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0x0000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0xffff), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0xffff), {1.0, 1.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0x0000, 0x0000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0xffff, 0x0000), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0xffff), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0xffff, 0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0x0000, 0x0000, 0x0000), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0xffff, 0x0000, 0x0000), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0xffff, 0x0000), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0xffff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R16_USCALED, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {    0.0,     0.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16_USCALED, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {65535.0,     0.0,     0.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), {    0.0,     0.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0x0000), {65535.0,     0.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0xffff), {    0.0, 65535.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0xffff), {65535.0, 65535.0,     0.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), {    0.0,     0.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0x0000, 0x0000), {65535.0,     0.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0xffff, 0x0000), {    0.0, 65535.0,     0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0xffff), {    0.0,     0.0, 65535.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0xffff, 0xffff), {65535.0, 65535.0, 65535.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), {    0.0,     0.0,     0.0,     0.0}},
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0x0000, 0x0000, 0x0000), {65535.0,     0.0,     0.0,     0.0}},
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0xffff, 0x0000, 0x0000), {    0.0, 65535.0,     0.0,     0.0}},
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0xffff, 0x0000), {    0.0,     0.0, 65535.0,     0.0}},
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0xffff), {    0.0,     0.0,     0.0, 65535.0}},
-   {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), {65535.0, 65535.0, 65535.0, 65535.0}},
-
-   {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x7fff), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8001), {  -1.0,    0.0,    0.0,    1.0}},
-
-   {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x7fff, 0x0000), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x8001, 0x0000), {  -1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x7fff), {   0.0,    1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x8001), {   0.0,   -1.0,    0.0,    1.0}},
-
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x7fff, 0x0000, 0x0000), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x8001, 0x0000, 0x0000), {  -1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x7fff, 0x0000), {   0.0,    1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x8001, 0x0000), {   0.0,   -1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x7fff), {   0.0,    0.0,    1.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x8001), {   0.0,    0.0,   -1.0,    1.0}},
-
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), {   0.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x7fff, 0x0000, 0x0000, 0x0000), {   1.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x8001, 0x0000, 0x0000, 0x0000), {  -1.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x7fff, 0x0000, 0x0000), {   0.0,    1.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x8001, 0x0000, 0x0000), {   0.0,   -1.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x7fff, 0x0000), {   0.0,    0.0,    1.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x8001, 0x0000), {   0.0,    0.0,   -1.0,    0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x7fff), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x8001), {   0.0,    0.0,    0.0,   -1.0}},
-
-   {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {     0.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x7fff), { 32767.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x8000), {-32768.0,      0.0,      0.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), {     0.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x7fff, 0x0000), { 32767.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x8000, 0x0000), {-32768.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x7fff), {     0.0,  32767.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x8000), {     0.0, -32768.0,      0.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), {     0.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x7fff, 0x0000, 0x0000), { 32767.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x8000, 0x0000, 0x0000), {-32768.0,      0.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x7fff, 0x0000), {     0.0,  32767.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x8000, 0x0000), {     0.0, -32768.0,      0.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x7fff), {     0.0,      0.0,  32767.0,   1.0}},
-   {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x8000), {     0.0,      0.0, -32768.0,   1.0}},
-
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), {     0.0,      0.0,      0.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x7fff, 0x0000, 0x0000, 0x0000), { 32767.0,      0.0,      0.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x8000, 0x0000, 0x0000, 0x0000), {-32768.0,      0.0,      0.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x7fff, 0x0000, 0x0000), {     0.0,  32767.0,      0.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x8000, 0x0000, 0x0000), {     0.0, -32768.0,      0.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x7fff, 0x0000), {     0.0,      0.0,  32767.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x8000, 0x0000), {     0.0,      0.0, -32768.0,      0.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x7fff), {     0.0,      0.0,      0.0,  32767.0}},
-   {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x8000), {     0.0,      0.0,      0.0, -32768.0}},
-
-   /*
-    * Standard 32-bit integer formats
-    *
-    * NOTE: We can't accurately represent integers larger than +/-0x1000000
-    * with single precision floats, so that's as far as we test.
-    */
-
-   {PIPE_FORMAT_R32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xffffffff, 0x00000000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xffffffff), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xffffffff, 0xffffffff), {1.0, 1.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xffffffff, 0x00000000, 0x00000000), {1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xffffffff, 0x00000000), {0.0, 1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xffffffff), {0.0, 0.0, 1.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), {0.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xffffffff, 0x00000000, 0x00000000, 0x00000000), {1.0, 0.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xffffffff, 0x00000000, 0x00000000), {0.0, 1.0, 0.0, 0.0}},
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xffffffff, 0x00000000), {0.0, 0.0, 1.0, 0.0}},
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xffffffff), {0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), {1.0, 1.0, 1.0, 1.0}},
-
-   {PIPE_FORMAT_R32_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {       0.0,        0.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x01000000), {16777216.0,        0.0,        0.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), {       0.0,        0.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x00000000), {16777216.0,        0.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x01000000), {       0.0, 16777216.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x01000000), {16777216.0, 16777216.0,        0.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), {       0.0,        0.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x00000000, 0x00000000), {16777216.0,        0.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x01000000, 0x00000000), {       0.0, 16777216.0,        0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x01000000), {       0.0,        0.0, 16777216.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x01000000, 0x01000000), {16777216.0, 16777216.0, 16777216.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), {       0.0,        0.0,        0.0,        0.0}},
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x00000000, 0x00000000, 0x00000000), {16777216.0,        0.0,        0.0,        0.0}},
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x01000000, 0x00000000, 0x00000000), {       0.0, 16777216.0,        0.0,        0.0}},
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x01000000, 0x00000000), {       0.0,        0.0, 16777216.0,        0.0}},
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x01000000), {       0.0,        0.0,        0.0, 16777216.0}},
-   {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x01000000, 0x01000000, 0x01000000), {16777216.0, 16777216.0, 16777216.0, 16777216.0}},
-
-   {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x7fffffff), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x80000001), {  -1.0,    0.0,    0.0,    1.0}},
-
-   {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x7fffffff, 0x00000000), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x80000001, 0x00000000), {  -1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x7fffffff), {   0.0,    1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x80000001), {   0.0,   -1.0,    0.0,    1.0}},
-
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x7fffffff, 0x00000000, 0x00000000), {   1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x80000001, 0x00000000, 0x00000000), {  -1.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x7fffffff, 0x00000000), {   0.0,    1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x80000001, 0x00000000), {   0.0,   -1.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x7fffffff), {   0.0,    0.0,    1.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x80000001), {   0.0,    0.0,   -1.0,    1.0}},
-
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), {   0.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x7fffffff, 0x00000000, 0x00000000, 0x00000000), {   1.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x80000001, 0x00000000, 0x00000000, 0x00000000), {  -1.0,    0.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x7fffffff, 0x00000000, 0x00000000), {   0.0,    1.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x80000001, 0x00000000, 0x00000000), {   0.0,   -1.0,    0.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x7fffffff, 0x00000000), {   0.0,    0.0,    1.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x80000001, 0x00000000), {   0.0,    0.0,   -1.0,    0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x7fffffff), {   0.0,    0.0,    0.0,    1.0}},
-   {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x80000001), {   0.0,    0.0,    0.0,   -1.0}},
-
-   {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {        0.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x01000000), { 16777216.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {-16777216.0,         0.0,         0.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), {        0.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x00000000), { 16777216.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xff000000, 0x00000000), {-16777216.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x01000000), {        0.0,  16777216.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xff000000), {        0.0, -16777216.0,         0.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), {        0.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x00000000, 0x00000000), { 16777216.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xff000000, 0x00000000, 0x00000000), {-16777216.0,         0.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x01000000, 0x00000000), {        0.0,  16777216.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xff000000, 0x00000000), {        0.0, -16777216.0,         0.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x01000000), {        0.0,         0.0,  16777216.0,   1.0}},
-   {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xff000000), {        0.0,         0.0, -16777216.0,   1.0}},
-
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), {        0.0,         0.0,         0.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x00000000, 0x00000000, 0x00000000), { 16777216.0,         0.0,         0.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xff000000, 0x00000000, 0x00000000, 0x00000000), {-16777216.0,         0.0,         0.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x01000000, 0x00000000, 0x00000000), {        0.0,  16777216.0,         0.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xff000000, 0x00000000, 0x00000000), {        0.0, -16777216.0,         0.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x01000000, 0x00000000), {        0.0,         0.0,  16777216.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xff000000, 0x00000000), {        0.0,         0.0, -16777216.0,         0.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x01000000), {        0.0,         0.0,         0.0,  16777216.0}},
-   {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xff000000), {        0.0,         0.0,         0.0, -16777216.0}},
-
-   /*
-    * Standard 32-bit float formats
-    */
-
-   {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {  0.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x3f800000), {  1.0, 0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0xbf800000), { -1.0, 0.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), { 0.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x3f800000, 0x00000000), { 1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xbf800000, 0x00000000), {-1.0,  0.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x3f800000), { 0.0,  1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xbf800000), { 0.0, -1.0, 0.0, 1.0}},
-   {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x3f800000, 0x3f800000), { 1.0,  1.0, 0.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), { 0.0,  0.0,  0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x3f800000, 0x00000000, 0x00000000), { 1.0,  0.0,  0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xbf800000, 0x00000000, 0x00000000), {-1.0,  0.0,  0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x3f800000, 0x00000000), { 0.0,  1.0,  0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xbf800000, 0x00000000), { 0.0, -1.0,  0.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x3f800000), { 0.0,  0.0,  1.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xbf800000), { 0.0,  0.0, -1.0, 1.0}},
-   {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x3f800000, 0x3f800000, 0x3f800000), { 1.0,  1.0,  1.0, 1.0}},
-
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), { 0.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x3f800000, 0x00000000, 0x00000000, 0x00000000), { 1.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xbf800000, 0x00000000, 0x00000000, 0x00000000), {-1.0,  0.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x3f800000, 0x00000000, 0x00000000), { 0.0,  1.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xbf800000, 0x00000000, 0x00000000), { 0.0, -1.0,  0.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x3f800000, 0x00000000), { 0.0,  0.0,  1.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xbf800000, 0x00000000), { 0.0,  0.0, -1.0,  0.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x3f800000), { 0.0,  0.0,  0.0,  1.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xbf800000), { 0.0,  0.0,  0.0, -1.0}},
-   {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000), { 1.0,  1.0,  1.0,  1.0}},
-};
-
-
 static boolean
 test_format_unpack_4f(const struct util_format_test_case *test)
 {
@@ -596,7 +60,7 @@ test_format_unpack_4f(const struct util_format_test_case *test)
 static boolean
 test_format_pack_4f(const struct util_format_test_case *test)
 {
-   uint8_t packed[MAX_PACKED_BYTES];
+   uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
    unsigned i;
    boolean success;
 
@@ -605,7 +69,7 @@ test_format_pack_4f(const struct util_format_test_case *test)
    util_format_pack_4f(test->format, packed, test->unpacked[0], test->unpacked[1], test->unpacked[2], test->unpacked[3]);
 
    success = TRUE;
-   for (i = 0; i < MAX_PACKED_BYTES; ++i)
+   for (i = 0; i < UTIL_FORMAT_MAX_PACKED_BYTES; ++i)
       if ((test->packed[i] & test->mask[i]) != (packed[i] & test->mask[i]))
          success = FALSE;
 
@@ -627,13 +91,27 @@ test_format_pack_4f(const struct util_format_test_case *test)
 }
 
 
-static void
+static boolean
 convert_4f_to_4ub(uint8_t *dst, const double *src)
 {
    unsigned i;
+   boolean accurate = TRUE;
 
-   for (i = 0; i < 4; ++i)
-      dst[i] = CLAMP(src[i], 0.0, 1.0) * 255.0;
+   for (i = 0; i < 4; ++i) {
+      if (src[i] < 0.0) {
+         accurate = FALSE;
+         dst[i] = 0;
+      }
+      else if (src[i] > 1.0) {
+         accurate = FALSE;
+         dst[i] = 255;
+      }
+      else {
+         dst[i] = src[i] * 255.0;
+      }
+   }
+
+   return accurate;
 }
 
 
@@ -667,18 +145,23 @@ static boolean
 test_format_pack_4ub(const struct util_format_test_case *test)
 {
    uint8_t unpacked[4];
-   uint8_t packed[MAX_PACKED_BYTES];
+   uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
    unsigned i;
    boolean success;
 
-   convert_4f_to_4ub(unpacked, test->unpacked);
+   if (!convert_4f_to_4ub(unpacked, test->unpacked)) {
+      /*
+       * Skip test cases which cannot be represented by four unorm bytes.
+       */
+      return TRUE;
+   }
 
    memset(packed, 0, sizeof packed);
 
    util_format_pack_4ub(test->format, packed, unpacked[0], unpacked[1], unpacked[2], unpacked[3]);
 
    success = TRUE;
-   for (i = 0; i < MAX_PACKED_BYTES; ++i)
+   for (i = 0; i < UTIL_FORMAT_MAX_PACKED_BYTES; ++i)
       if ((test->packed[i] & test->mask[i]) != (packed[i] & test->mask[i]))
          success = FALSE;
 
@@ -711,15 +194,16 @@ test_one(test_func_t func, const char *suffix)
    unsigned i;
    bool success = TRUE;
 
-   for (i = 0; i < sizeof(test_cases)/sizeof(test_cases[0]); ++i) {
-      if (test_cases[i].format != last_format) {
+   for (i = 0; i < util_format_nr_test_cases; ++i) {
+      const struct util_format_test_case *test = &util_format_test_cases[i];
+      if (test->format != last_format) {
          const struct util_format_description *format_desc;
-         format_desc = util_format_description(test_cases[i].format);
-         printf("Testing %s.%s ...\n", format_desc->name, suffix);
-         last_format = test_cases[i].format;
+         format_desc = util_format_description(test->format);
+         printf("Testing util_format_%s_%s ...\n", format_desc->short_name, suffix);
+         last_format = test->format;
       }
 
-      if (!func(&test_cases[i]))
+      if (!func(&util_format_test_cases[i]))
         success = FALSE;
    }
 
index 4e30742e208b09c54d2ed97a4a0587785578b827..93331b9c16838aa5e89694d66b8cb0cb3065abbe 100644 (file)
@@ -88,9 +88,9 @@ LoadSkyBoxCubeTexture(const char *filePosX,
       return 0;
    if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, fileNegX, GL_TRUE, GL_TRUE))
       return 0;
-   if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, filePosY, 1+GL_FALSE, GL_TRUE))
+   if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, filePosY, GL_TRUE, GL_TRUE))
       return 0;
-   if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, fileNegY, 1+GL_FALSE, GL_TRUE))
+   if (!load(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, fileNegY, GL_TRUE, GL_TRUE))
       return 0;
    if (!load(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, filePosZ, GL_TRUE, GL_TRUE))
       return 0;
index 391c637d6fa6a955144091b64ebca52f406a4e57..353a3a2e1a21e96e2f5d8cb1a7dc3c8829be63bc 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 
@@ -35,7 +36,6 @@ GLint windW, windH;
 
 char *fileName = 0;
 PPMImage *image;
-float point[3];
 float zoom;
 GLint x, y;
 
@@ -97,27 +97,27 @@ static void Mouse(int button, int state, int mouseX, int mouseY)
 
 static void Draw(void)
 {
+    GLint src[3], dst[3];
 
     glClear(GL_COLOR_BUFFER_BIT);
 
-    point[0] = (windW / 2) - (image->sizeX / 2);
-    point[1] = (windH / 2) - (image->sizeY / 2);
-    point[2] = 0;
-    glRasterPos3fv(point);
+    src[0] = (int) ((windW / 2.0) - (image->sizeX / 2.0));
+    src[1] = (int) ((windH / 2.0) - (image->sizeY / 2.0));
+    src[2] = 0;
+    glWindowPos3ivARB(src);
 
     glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     glPixelZoom(1.0, 1.0);
     glDrawPixels(image->sizeX, image->sizeY, GL_RGB, GL_UNSIGNED_BYTE,
                 image->data);
 
-    point[0] = (float)x;
-    point[1] = windH - (float)y;
-    point[2] = 0.0;
-    glRasterPos3fv(point);
+    dst[0] = x;
+    dst[1] = windH - y;
+    dst[2] = 0;
+    glWindowPos3ivARB(dst);
 
     glPixelZoom(zoom, zoom);
-    glCopyPixels((windW/2)-(image->sizeX/2),
-                (windH/2)-(image->sizeY/2),
+    glCopyPixels(src[0], src[1],
                 image->sizeX, image->sizeY, GL_COLOR);
 
     glFlush();
@@ -170,8 +170,8 @@ int main(int argc, char **argv)
 
     image = LoadPPM(fileName);
 
-    windW = 300;
-    windH = 300;
+    windW = 2*300;
+    windH = 2*300;
     glutInitWindowPosition(0, 0); glutInitWindowSize( windW, windH);
 
     type = GLUT_RGB;
@@ -182,6 +182,7 @@ int main(int argc, char **argv)
        exit(1);
     }
 
+    glewInit();
     Init();
 
     glutReshapeFunc(Reshape);
index be056d62940503949a0bea7e58d73c58ed0d366b..adae9b491e49ee74c9062ad93cd3f0ccdf68047a 100644 (file)
@@ -9,7 +9,7 @@ static PPMImage *LoadPPM(const char *filename)
     char buff[16];
     PPMImage *result;
     FILE *fp;
-    int maxval;
+    int maxval, w, h;
 
     fp = fopen(filename, "rb");
     if (!fp)
@@ -37,11 +37,13 @@ static PPMImage *LoadPPM(const char *filename)
        exit(1);
     }
 
-    if (fscanf(fp, "%lu %lu", &result->sizeX, &result->sizeY) != 2)
+    if (fscanf(fp, "%d %d", &w, &h) != 2)
     {
        fprintf(stderr, "Error loading image `%s'\n", filename);
        exit(1);
     }
+    result->sizeX = w;
+    result->sizeY = h;
 
     if (fscanf(fp, "%d", &maxval) != 1)
     {
index 0cd7f95c355c616755777adf861b0e9c78b61e8f..a95fdff74c35b32ac74ca125a460b51a25de5142 100644 (file)
@@ -36,8 +36,8 @@ Display( void )
 
    /* draw to user framebuffer */
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
-   glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
-   glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+   glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+   glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
 
    status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -161,7 +161,7 @@ Init( void )
    assert(i == MyFB);
 
    CheckError(__LINE__);
-   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
+   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
                                 GL_RENDERBUFFER_EXT, MyRB);
 
    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
index f9c506193f64196e27c5fd391b10905fd43f2939..faf0dd874842070118b572ce6ef8e017328a14fc 100644 (file)
@@ -33,15 +33,16 @@ CheckError(int line)
 static void
 Display( void )
 {
-   GLubyte *buffer = malloc(Width * Height * 4);
+   GLboolean copyPix = GL_FALSE;
+   GLboolean blitPix = GL_FALSE;
    GLenum status;
 
    CheckError(__LINE__);
 
    /* draw to user framebuffer */
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
-   glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
-   glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+   glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+   glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
 
    status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -63,16 +64,43 @@ Display( void )
    glutSolidTeapot(2.0);
    glPopMatrix();
 
-   /* read from user framebuffer */
-   glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+   if (copyPix) {
+      glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, MyFB);
+      glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+      glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+      glDrawBuffer(GL_BACK);
 
-   /* draw to window */
-   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-   glDisable(GL_DEPTH_TEST);  /* in case window has depth buffer */
-   glWindowPos2iARB(0, 0);
-   glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+      glDisable(GL_DEPTH_TEST);  /* in case window has depth buffer */
+
+      glWindowPos2iARB(0, 0);
+      glCopyPixels(0, 0, Width, Height, GL_COLOR);
+   }
+   else if (blitPix) {
+      glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, MyFB);
+      glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+      glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+      glDrawBuffer(GL_BACK);
+
+      glDisable(GL_DEPTH_TEST);  /* in case window has depth buffer */
+
+      glBlitFramebufferEXT(0, 0, Width, Height,
+                           0, 0, Width, Height,
+                           GL_COLOR_BUFFER_BIT, GL_NEAREST);
+   }
+   else {
+      GLubyte *buffer = malloc(Width * Height * 4);
+      /* read from user framebuffer */
+      glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+      /* draw to window */
+      glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+      glDisable(GL_DEPTH_TEST);  /* in case window has depth buffer */
+      glWindowPos2iARB(0, 0);
+      glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+      free(buffer);
+   }
 
-   free(buffer);
    glutSwapBuffers();
    CheckError(__LINE__);
 }
@@ -163,7 +191,7 @@ Init( void )
    glGenRenderbuffersEXT(1, &ColorRb);
    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
    assert(glIsRenderbufferEXT(ColorRb));
-   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
+   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
                                 GL_RENDERBUFFER_EXT, ColorRb);
    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
 
index 8e288b38b8323b4a7f7b0220da851904c2625dd8..c176f82d2ba9661f4a18d91a7215121f17e74f7a 100644 (file)
@@ -50,8 +50,8 @@ Display( void )
 
    /* draw to user framebuffer */
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
-   glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
-   glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+   glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+   glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
 
    status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -189,7 +189,7 @@ Init( void )
    glGenRenderbuffersEXT(1, &ColorRb);
    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
    assert(glIsRenderbufferEXT(ColorRb));
-   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
+   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
                                 GL_RENDERBUFFER_EXT, ColorRb);
    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
 
index 7d871e5877fa9336cd32fb988034c665fe58d6d1..1010139a20ec5cf9ab65fea4a2c1fe684229451c 100644 (file)
@@ -26,7 +26,7 @@
  * \file stencil_twoside.c
  * 
  * Simple test of GL_ATI_separate_stencil (or the OGL 2.0 equivalent) functionality.
- * Four squares are drawn
+ * Five squares (or six if stencil wrap is available) are drawn
  * with different stencil modes, but all should be rendered with the same
  * final color.
  */
@@ -37,7 +37,7 @@
 #include <GL/glut.h>
 
 static int use20syntax = 1;
-static int Width = 550;
+static int Width = 650;
 static int Height = 200;
 static const GLfloat Near = 5.0, Far = 25.0;
 
@@ -70,7 +70,7 @@ static void Display( void )
     */
 
    glDisable(GL_STENCIL_TEST);
-   glTranslatef(-6.0, 0, 0);
+   glTranslatef(-7.0, 0, 0);
    glBegin(GL_QUADS);
    glColor3f( 0.5, 0.5, 0.5 );
    glVertex2f(-1, -1);
@@ -85,6 +85,9 @@ static void Display( void )
    /* Draw the first two squares using incr for the affected face
     */
 
+   /*************************************************************************
+    * 2nd square
+    */
    if (use20syntax) {
       stencil_func_separate(GL_FRONT, GL_ALWAYS, 0, ~0);
       stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
@@ -98,8 +101,8 @@ static void Display( void )
    glTranslatef(3.0, 0, 0);
    glBegin(GL_QUADS);
    glColor3f( 0.9, 0.9, 0.9 );
-   /* this should be front facing */
    for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
+      /* this should be front facing */
       glVertex2f(-1, -1);
       glVertex2f( 1, -1);
       glVertex2f( 1,  1);
@@ -107,6 +110,7 @@ static void Display( void )
    }
    glEnd();
 
+   /* stencil vals should be equal to max_stencil */
    glStencilFunc(GL_EQUAL, max_stencil, ~0);
    glBegin(GL_QUADS);
    glColor3f( 0.5, 0.5, 0.5 );
@@ -116,6 +120,9 @@ static void Display( void )
    glVertex2f(-1,  1);
    glEnd();
 
+   /*************************************************************************
+    * 3rd square
+    */
    if (use20syntax) {
       stencil_func_separate(GL_FRONT, GL_ALWAYS, 0, ~0);
       stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
@@ -129,9 +136,8 @@ static void Display( void )
    glTranslatef(3.0, 0, 0);
    glBegin(GL_QUADS);
    glColor3f( 0.9, 0.9, 0.9 );
-
-   /* this should be back facing */
    for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
+      /* this should be back facing */
       glVertex2f(-1, -1);
       glVertex2f(-1,  1);
       glVertex2f( 1,  1);
@@ -139,6 +145,7 @@ static void Display( void )
    }
    glEnd();
 
+   /* stencil vals should be equal to max_stencil */
    glStencilFunc(GL_EQUAL, max_stencil, ~0);
    glBegin(GL_QUADS);
    glColor3f( 0.5, 0.5, 0.5 );
@@ -148,6 +155,9 @@ static void Display( void )
    glVertex2f(-1,  1);
    glEnd();
 
+   /*************************************************************************
+    * 4th square
+    */
    if (use20syntax) {
       stencil_func_separate(GL_FRONT, GL_NEVER, 0, ~0);
       stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
@@ -161,15 +171,13 @@ static void Display( void )
    glTranslatef(3.0, 0, 0);
    glBegin(GL_QUADS);
    glColor3f( 0.9, 0.9, 0.9 );
-
-   /* this should be back facing */
    for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
-   /* this should be back facing */
+      /* this should be back facing */
       glVertex2f(-1, -1);
       glVertex2f(-1,  1);
       glVertex2f( 1,  1);
       glVertex2f( 1, -1);
-   /* this should be front facing */
+      /* this should be front facing */
       glVertex2f(-1, -1);
       glVertex2f( 1, -1);
       glVertex2f( 1,  1);
@@ -177,6 +185,7 @@ static void Display( void )
    }
    glEnd();
 
+   /* stencil vals should be equal to max_stencil */
    glStencilFunc(GL_EQUAL, max_stencil, ~0);
    glBegin(GL_QUADS);
    glColor3f( 0.5, 0.5, 0.5 );
@@ -186,6 +195,9 @@ static void Display( void )
    glVertex2f(-1,  1);
    glEnd();
 
+   /*************************************************************************
+    * 5th square
+    */
    if (use20syntax) {
       stencil_func_separate(GL_FRONT, GL_ALWAYS, 0, ~0);
       stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
@@ -193,21 +205,19 @@ static void Display( void )
    else {
       stencil_func_separate_ati(GL_ALWAYS, GL_ALWAYS, 0, ~0);
    }
-   stencil_op_separate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
-   stencil_op_separate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
+   stencil_op_separate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
+   stencil_op_separate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
 
    glTranslatef(3.0, 0, 0);
    glBegin(GL_QUADS);
    glColor3f( 0.9, 0.9, 0.9 );
-
-   /* this should be back facing */
    for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
-   /* this should be back facing */
+      /* this should be back facing */
       glVertex2f(-1, -1);
       glVertex2f(-1,  1);
       glVertex2f( 1,  1);
       glVertex2f( 1, -1);
-   /* this should be front facing */
+      /* this should be front facing */
       glVertex2f(-1, -1);
       glVertex2f( 1, -1);
       glVertex2f( 1,  1);
@@ -224,6 +234,47 @@ static void Display( void )
    glVertex2f(-1,  1);
    glEnd();
 
+   /*************************************************************************
+    * 6th square
+    */
+   if (glutExtensionSupported("GL_EXT_stencil_wrap")) {
+      if (use20syntax) {
+         stencil_func_separate(GL_FRONT, GL_ALWAYS, 0, ~0);
+         stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
+      }
+      else {
+         stencil_func_separate_ati(GL_ALWAYS, GL_ALWAYS, 0, ~0);
+      }
+      stencil_op_separate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
+      stencil_op_separate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
+
+      glTranslatef(3.0, 0, 0);
+      glBegin(GL_QUADS);
+      glColor3f( 0.9, 0.9, 0.9 );
+      for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
+         /* this should be back facing */
+         glVertex2f(-1, -1);
+         glVertex2f(-1,  1);
+         glVertex2f( 1,  1);
+         glVertex2f( 1, -1);
+         /* this should be front facing */
+         glVertex2f(-1, -1);
+         glVertex2f( 1, -1);
+         glVertex2f( 1,  1);
+         glVertex2f(-1,  1);
+      }
+      glEnd();
+
+      glStencilFunc(GL_EQUAL, 260 - 255, ~0);
+      glBegin(GL_QUADS);
+      glColor3f( 0.5, 0.5, 0.5 );
+      glVertex2f(-1, -1);
+      glVertex2f( 1, -1);
+      glVertex2f( 1,  1);
+      glVertex2f(-1,  1);
+      glEnd();
+   }
+
    glPopMatrix();
 
    glutSwapBuffers();
@@ -278,7 +329,7 @@ static void Init( void )
    stencil_func_separate_ati = (PFNGLSTENCILFUNCSEPARATEATIPROC) glutGetProcAddress( "glStencilFuncSeparateATI" );
    stencil_op_separate = (PFNGLSTENCILOPSEPARATEPROC) glutGetProcAddress( "glStencilOpSeparate" );
 
-   printf("\nAll 5 squares should be the same color.\n");
+   printf("\nAll 5 (or 6) squares should be the same color.\n");
 }
 
 
index b4a903cb68ff5be8bbc92246af6c8a88872fa430..a10748f9487d71f1f24a6e8eae720c13ef89f72c 100644 (file)
@@ -11,6 +11,7 @@ include $(TOP)/configs/current
 LIBS = -L$(TOP)/$(LIB_DIR) -l $(GLEW_LIB) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
 
 SOURCES = \
+       clear-fbo-scissor.c \
        clear-fbo-tex.c \
        clear-fbo.c \
        clear-scissor.c \
index f480da047eb1049fbacf3d0bc184887436afedd9..24b4f91fb0ae18804b700c747f6fef6684eb9f56 100644 (file)
@@ -1,7 +1,8 @@
 Import('*')
 
 progs = [
-    'clear-fbo-tex',
+       'clear-fbo-scissor',
+       'clear-fbo-tex',
        'clear-fbo',
        'clear-scissor',
        'clear-undefined',
diff --git a/progs/trivial/clear-fbo-scissor.c b/progs/trivial/clear-fbo-scissor.c
new file mode 100644 (file)
index 0000000..6a605e1
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Use scissor to clear the four quadrants of the FBO to different
+ * colors.  Then draw a grey triangle in the middle.
+ */
+
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+#include <GL/glu.h>
+
+
+static int Width = 512, Height = 512;
+static GLuint MyFB, MyRB;
+static GLboolean UseTex = GL_FALSE;
+static GLboolean UseCopyPix = GL_FALSE;
+
+
+#define CheckError() \
+   do { \
+      GLenum err = glGetError(); \
+      if (err != GL_NO_ERROR) \
+         printf("Error: %s\n", gluErrorString(err)); \
+      assert(err == GL_NO_ERROR); \
+   } while (0)
+
+
+static void
+Init(void)
+{
+   GLenum status;
+
+   fprintf(stderr, "GL_RENDERER   = %s\n", (char *) glGetString(GL_RENDERER));
+   fprintf(stderr, "GL_VERSION    = %s\n", (char *) glGetString(GL_VERSION));
+   fprintf(stderr, "GL_VENDOR     = %s\n", (char *) glGetString(GL_VENDOR));
+   fflush(stderr);
+
+   if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+      printf("GL_EXT_framebuffer_object not found!\n");
+      exit(0);
+   }
+
+   glGenFramebuffersEXT(1, &MyFB);
+   glGenRenderbuffersEXT(1, &MyRB);
+
+   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+   if (UseTex) {
+      GLuint tex;
+      glGenTextures(1, &tex);
+      glBindTexture(GL_TEXTURE_2D, tex);
+      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Width, Height, 0,
+                   GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+      glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, 
+                                GL_COLOR_ATTACHMENT0_EXT,
+                                GL_TEXTURE_2D, tex, 0);
+   }
+   else {
+      glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, MyRB);
+
+      glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+                                   GL_COLOR_ATTACHMENT0_EXT,
+                                   GL_RENDERBUFFER_EXT, MyRB);
+
+      glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+   }
+
+   status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+   if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+      fprintf(stderr, "Framebuffer object is incomplete (0x%x)!\n", status);
+   }
+
+   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+}
+
+
+static void
+Reshape(int width, int height)
+{
+   glViewport(0, 0, width, height);
+   glMatrixMode(GL_PROJECTION);
+   glLoadIdentity();
+   glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
+   glMatrixMode(GL_MODELVIEW);
+
+   Width = width;
+   Height = height;
+   if (!UseTex) {
+      glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+   }
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+   if (key == 27) {
+      exit(0);
+   }
+   glutPostRedisplay();
+}
+
+
+static void
+Draw(void)
+{
+   GLboolean scissor = GL_TRUE;
+
+   /* draw to user framebuffer */
+   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+   glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+   glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+
+   glViewport(0, 0, Width, Height);
+   CheckError();
+
+   if (scissor) {
+      glEnable(GL_SCISSOR_TEST);
+
+      /* lower-left = red */
+      glClearColor(1, 0, 0, 0);
+      glScissor(0, 0, Width / 2, Height / 2);
+      glClear(GL_COLOR_BUFFER_BIT); 
+
+      /* lower-right = green */
+      glClearColor(0, 1, 0, 0);
+      glScissor(Width / 2, 0, Width - Width / 2, Height / 2);
+      glClear(GL_COLOR_BUFFER_BIT); 
+
+      /* upper-left = blue */
+      glClearColor(0, 0, 1, 0);
+      glScissor(0, Height / 2, Width / 2, Height - Height / 2);
+      glClear(GL_COLOR_BUFFER_BIT); 
+
+      /* upper-right = white */
+      glClearColor(1, 1, 1, 0);
+      glScissor(Width / 2, Height / 2, Width - Width / 2, Height - Height / 2);
+      glClear(GL_COLOR_BUFFER_BIT); 
+
+      glDisable(GL_SCISSOR_TEST);
+   }
+   else {
+      glClearColor(0, 1, 0, 0);
+      glClear(GL_COLOR_BUFFER_BIT);
+   }
+
+   CheckError();
+
+   /* gray triangle in middle, pointing up */
+   glColor3f(0.5, 0.5, 0.5);
+   glBegin(GL_TRIANGLES);
+   glVertex2f(Width/4, Height/4);
+   glVertex2f(Width*3/4, Height/4);
+   glVertex2f(Width/2, Height*3/4);
+   glVertex2f(-0.5, -0.5);
+   glVertex2f(+0.5, -0.5);
+   glVertex2f( 0.0, 0.7);
+   glEnd();
+
+   CheckError();
+
+   /* copy fbo to window */
+   glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, MyFB);
+   glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+   glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+   glDrawBuffer(GL_BACK);
+   
+   if (UseCopyPix) {
+      glWindowPos2i(0, 0);
+      glCopyPixels(0, 0, Width, Height, GL_COLOR);
+   }
+   else {
+      GLubyte *buffer = malloc(Width * Height * 4);
+
+      /* read from user framebuffer */
+      glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+      /* draw to window */
+      glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+      glWindowPos2iARB(0, 0);
+      glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+      free(buffer);
+   }
+
+   /* Bind normal framebuffer */
+   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+
+   glutSwapBuffers();
+
+   CheckError();
+}
+
+
+int
+main(int argc, char *argv[])
+{
+   int i;
+
+   glutInit(&argc, argv);
+   glutInitWindowPosition(100, 0);
+   glutInitWindowSize(Width, Height);
+   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+
+   for (i = 1; i < argc; i++) {
+      if (strcmp(argv[i], "-t") == 0)
+         UseTex = GL_TRUE;
+      else if (strcmp(argv[i], "-c") == 0)
+         UseCopyPix = GL_TRUE;
+   }
+
+   if (UseTex)
+      printf("Using render to texture\n");
+   else
+      printf("Using user-created render buffer\n");
+
+   if (!glutCreateWindow(argv[0])) {
+      exit(1);
+   }
+
+   glewInit();
+   Init();
+   glutReshapeFunc(Reshape);
+   glutKeyboardFunc(Key);
+   glutDisplayFunc(Draw);
+   glutMainLoop();
+   return 0;
+}
index 9f68bca9149f95339600eee36c4099c08e1a0377..d66b68c415aadb8041db98df3efb8739d55e8622 100644 (file)
@@ -77,6 +77,7 @@ static void Draw(void)
    glStencilFunc(GL_ALWAYS, 1, 1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
 
+   /* red triangle (setting stencil to 1) */
    glColor3ub(200, 0, 0);
    glBegin(GL_POLYGON);        
    glVertex3i(-4, -4, 0);
@@ -88,6 +89,7 @@ static void Draw(void)
    glStencilFunc(GL_EQUAL, 1, 1);
    glStencilOp(GL_INCR, GL_KEEP, GL_DECR);
 
+   /* green quad (if over red, decr stencil to 0, else incr to 1) */
    glColor3ub(0, 200, 0);
    glBegin(GL_POLYGON);
    glVertex3i(3, 3, 0);
@@ -101,6 +103,7 @@ static void Draw(void)
    glStencilFunc(GL_EQUAL, 1, 1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
 
+   /* blue quad (where stencil == 1) */
    glColor3ub(0, 0, 200);
    glBegin(GL_POLYGON);
    glVertex3f(2.5, 2.5, 0);
index e87d55d011e2d55c378f330071b289e66b2c13a1..f81aafe00f629c5a3c378f0dad4216708efd616b 100644 (file)
@@ -9,9 +9,9 @@ INCDIR = $(TOP)/include
 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 # Add X11 and pthread libs to satisfy GNU gold.
-APP_LIB_DEPS += -lX11 -lpthread
+APP_LIB_DEPS += $(X_LIBS) -lpthread
 
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(libdir) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
 
 PROGS = \
        corender \
index a2baf4ad7203ba5a57ba696d8fad20a0cb3175c0..061d6c68613ba930f8ec00684d2d5c31d5d57883 100644 (file)
@@ -249,11 +249,13 @@ int main(int argc, char *argv[])
                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                glRectf(0, 0, width, height);
 
-               glXSwapBuffersMscOML(disp, winGL, 0, divisor, remainder);
-
-               if (wait_interval) {
+               if (!wait_interval)
+                       glXSwapBuffersMscOML(disp, winGL, 0, divisor,
+                                            remainder);
+               else {
                        glXWaitForMscOML(disp, winGL, msc + wait_interval,
-                                        0, 0, &ust, &msc, &sbc);
+                                        divisor, remainder, &ust, &msc, &sbc);
+                       glXSwapBuffersMscOML(disp, winGL, 0, 0, 0);
                }
        }
 
index 37c503ec986dd959104dae30392979bef7c3b8fc..01eae2403a7a79d89aa1b4bb036bcbe6e24004ab 100644 (file)
@@ -29,7 +29,9 @@ Tool-specific initialization for LLVM
 
 import os
 import os.path
+import re
 import sys
+import distutils.version
 
 import SCons.Errors
 import SCons.Util
@@ -60,71 +62,98 @@ def generate(env):
 
     if env['platform'] == 'windows':
         # XXX: There is no llvm-config on Windows, so assume a standard layout
-        if llvm_dir is not None:
-            env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
-            env.AppendUnique(CPPDEFINES = [
-                '__STDC_LIMIT_MACROS', 
-                '__STDC_CONSTANT_MACROS',
-                'HAVE_STDINT_H',
+        if llvm_dir is None:
+            return
+
+        # Try to determine the LLVM version from llvm/Config/config.h
+        llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h')
+        if not os.path.exists(llvm_config):
+            print 'scons: could not find %s' % llvm_config
+            return
+        llvm_version_re = re.compile(r'^#define PACKAGE_VERSION "([^"]*)"')
+        llvm_version = None
+        for line in open(llvm_config, 'rt'):
+            mo = llvm_version_re.match(line)
+            if mo:
+                llvm_version = mo.group(1)
+                llvm_version = distutils.version.LooseVersion(llvm_version)
+                break
+        if llvm_version is None:
+            print 'scons: could not determine the LLVM version from %s' % llvm_config
+            return
+
+        env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
+        env.AppendUnique(CPPDEFINES = [
+            '__STDC_LIMIT_MACROS', 
+            '__STDC_CONSTANT_MACROS',
+            'HAVE_STDINT_H',
+        ])
+        env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
+        if llvm_version >= distutils.version.LooseVersion('2.7'):
+            # 2.7
+            env.Prepend(LIBS = [
+                'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
+                'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
+                'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
+                'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
+                'LLVMSelectionDAG', 'LLVMX86Info', 'LLVMAsmPrinter',
+                'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
+                'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
+                'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
+                'LLVMMC', 'LLVMCore', 'LLVMSupport', 'LLVMSystem',
             ])
-            env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
+        else:
+            # 2.6
             env.Prepend(LIBS = [
-                'LLVMX86AsmParser',
-                'LLVMX86AsmPrinter',
-                'LLVMX86CodeGen',
-                'LLVMX86Info',
-                'LLVMLinker',
-                'LLVMipo',
-                'LLVMInterpreter',
-                'LLVMInstrumentation',
-                'LLVMJIT',
-                'LLVMExecutionEngine',
-                'LLVMDebugger',
-                'LLVMBitWriter',
-                'LLVMAsmParser',
-                'LLVMArchive',
-                'LLVMBitReader',
-                'LLVMSelectionDAG',
-                'LLVMAsmPrinter',
-                'LLVMCodeGen',
-                'LLVMScalarOpts',
-                'LLVMTransformUtils',
-                'LLVMipa',
-                'LLVMAnalysis',
-                'LLVMTarget',
-                'LLVMMC',
-                'LLVMCore',
-                'LLVMSupport',
+                'LLVMX86AsmParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
+                'LLVMX86Info', 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
+                'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
+                'LLVMDebugger', 'LLVMBitWriter', 'LLVMAsmParser',
+                'LLVMArchive', 'LLVMBitReader', 'LLVMSelectionDAG',
+                'LLVMAsmPrinter', 'LLVMCodeGen', 'LLVMScalarOpts',
+                'LLVMTransformUtils', 'LLVMipa', 'LLVMAnalysis',
+                'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport',
                 'LLVMSystem',
-                'imagehlp',
-                'psapi',
             ])
-            if env['msvc']:
-                # Some of the LLVM C headers use the inline keyword without
-                # defining it.
-                env.Append(CPPDEFINES = [('inline', '__inline')])
-                if env['debug']:
-                    # LLVM libraries are static, build with /MT, and they
-                    # automatically link agains LIBCMT. When we're doing a
-                    # debug build we'll be linking against LIBCMTD, so disable
-                    # that.
-                    env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT'])
-            env['LLVM_VERSION'] = '2.6'
-        return
+        env.Append(LIBS = [
+            'imagehlp',
+            'psapi',
+        ])
+        if env['msvc']:
+            # Some of the LLVM C headers use the inline keyword without
+            # defining it.
+            env.Append(CPPDEFINES = [('inline', '__inline')])
+            if env['debug']:
+                # LLVM libraries are static, build with /MT, and they
+                # automatically link agains LIBCMT. When we're doing a
+                # debug build we'll be linking against LIBCMTD, so disable
+                # that.
+                env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT'])
     elif env.Detect('llvm-config'):
-        version = env.backtick('llvm-config --version').rstrip()
+        llvm_version = env.backtick('llvm-config --version').rstrip()
+        llvm_version = distutils.version.LooseVersion(llvm_version)
 
         try:
             env.ParseConfig('llvm-config --cppflags')
             env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
             env.ParseConfig('llvm-config --ldflags')
         except OSError:
-            print 'llvm-config version %s failed' % version
+            print 'llvm-config version %s failed' % llvm_version
         else:
-            if env['platform'] == 'windows':
-                env.Append(LIBS = ['imagehlp', 'psapi'])
             env['LINK'] = env['CXX']
-            env['LLVM_VERSION'] = version
+    else:
+        return
+
+    assert llvm_version is not None
+
+    print 'scons: Found LLVM version %s' % llvm_version
+    env['LLVM_VERSION'] = llvm_version
+
+    # Define HAVE_LLVM macro with the major/minor version number (e.g., 0x0206 for 2.6)
+    llvm_version_major = int(llvm_version.version[0])
+    llvm_version_minor = int(llvm_version.version[1])
+    llvm_version_hex = '0x%02x%02x' % (llvm_version_major, llvm_version_minor)
+    env.Prepend(CPPDEFINES = [('HAVE_LLVM', llvm_version_hex)])
 
 def exists(env):
     return True
index cd4896ada401935a25d97d798773981f86fe7b04..cf6db730da24c4c3725068ede845848df71d00ef 100644 (file)
@@ -1,13 +1,12 @@
 Import('*')
 
 SConscript('glsl/SConscript')
-SConscript('gallium/SConscript')
 
 if 'mesa' in env['statetrackers']:
-       SConscript('mesa/SConscript')
+    SConscript('mesa/SConscript')
 
-SConscript('gallium/winsys/SConscript')
+SConscript('gallium/SConscript')
 
 if platform != 'embedded':
-       SConscript('glut/glx/SConscript')
-       SConscript('glew/SConscript')
+    SConscript('glut/glx/SConscript')
+    SConscript('glew/SConscript')
index d56c5c84617a3b1be30a929b8785a59375e163bc..c833d83e65b947f5653ecb4bd53fd3826f43c36c 100644 (file)
@@ -7,6 +7,9 @@ SConscript('auxiliary/SConscript')
 for driver in env['drivers']:
        SConscript(os.path.join('drivers', driver, 'SConscript'))
 
+# Needed by some state trackers
+SConscript('winsys/null/SConscript')
+
 SConscript('state_trackers/python/SConscript')
 if platform != 'embedded':
        SConscript('state_trackers/glx/xlib/SConscript')
@@ -15,3 +18,7 @@ if platform != 'embedded':
 
 if platform == 'windows':
        SConscript('state_trackers/wgl/SConscript')
+
+SConscript('winsys/SConscript')
+
+SConscript('targets/SConscript')
index 1d0930e024b47672b5fb211f64e28aa8b584a1cd..e1c3bc43a24451043ef8400407aae2ec09b871ca 100644 (file)
@@ -107,6 +107,7 @@ C_SOURCES = \
        util/u_draw_quad.c \
        util/u_format_access.c \
        util/u_format_table.c \
+       util/u_format_tests.c \
        util/u_gen_mipmap.c \
        util/u_handle_table.c \
        util/u_hash_table.c \
@@ -118,6 +119,7 @@ C_SOURCES = \
        util/u_mm.c \
        util/u_rect.c \
        util/u_ringbuffer.c \
+       util/u_sampler.c \
        util/u_simple_shaders.c \
        util/u_snprintf.c \
        util/u_surface.c \
@@ -126,11 +128,14 @@ C_SOURCES = \
        util/u_timed_winsys.c \
        util/u_upload_mgr.c \
        util/u_simple_screen.c \
-       vl/vl_bitstream_parser.c \
-       vl/vl_mpeg12_mc_renderer.c \
-       vl/vl_compositor.c \
-       vl/vl_csc.c \
-       vl/vl_shader_build.c
+       target-helpers/wrap_screen.c
+
+       # Disabling until pipe-video branch gets merged in
+       #vl/vl_bitstream_parser.c \
+       #vl/vl_mpeg12_mc_renderer.c \
+       #vl/vl_compositor.c \
+       #vl/vl_csc.c \
+       #vl/vl_shader_build.c \
 
 GALLIVM_SOURCES = \
         gallivm/lp_bld_alpha.c \
index f365c4bbdd6666e663d44eb50b22e53fb572a5bc..65e1dc8a58d1bff01f75201269c4674a220f8b70 100644 (file)
@@ -7,6 +7,8 @@ env.Append(CPPPATH = [
     'util',
 ])
 
+env.Tool('udis86')
+
 env.CodeGenerate(
     target = 'indices/u_indices_gen.c', 
     script = 'indices/u_indices_gen.py', 
@@ -149,6 +151,7 @@ source = [
     'util/u_draw_quad.c',
     'util/u_format_access.c',
     'util/u_format_table.c',
+    'util/u_format_tests.c',
     'util/u_gen_mipmap.c',
     'util/u_handle_table.c',
     'util/u_hash.c',
@@ -159,6 +162,7 @@ source = [
     'util/u_mm.c',
     'util/u_rect.c',
     'util/u_ringbuffer.c',
+    'util/u_sampler.c',
     'util/u_simple_shaders.c',
     'util/u_snprintf.c',
     'util/u_surface.c',
@@ -167,11 +171,13 @@ source = [
     'util/u_timed_winsys.c',
     'util/u_upload_mgr.c',
     'util/u_simple_screen.c',
-    'vl/vl_bitstream_parser.c',
-    'vl/vl_mpeg12_mc_renderer.c',
-    'vl/vl_compositor.c',
-    'vl/vl_csc.c',
-    'vl/vl_shader_build.c',
+    # Disabling until pipe-video branch gets merged in
+    #'vl/vl_bitstream_parser.c',
+    #'vl/vl_mpeg12_mc_renderer.c',
+    #'vl/vl_compositor.c',
+    #'vl/vl_csc.c',
+    #'vl/vl_shader_build.c',
+    'target-helpers/wrap_screen.c',
 ]
 
 if drawllvm:
index a6a07e72c2f985bdad571aa95bb0a64f07e09747..900c64df4b93279ac951a780a63bfb15a0b1b045 100644 (file)
@@ -43,6 +43,7 @@ struct cso_cache {
    struct cso_hash *vs_hash;
    struct cso_hash *rasterizer_hash;
    struct cso_hash *sampler_hash;
+   struct cso_hash *velements_hash;
    int    max_size;
 
    cso_sanitize_callback sanitize_cb;
@@ -108,6 +109,9 @@ static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_
    case CSO_VERTEX_SHADER:
       hash = sc->vs_hash;
       break;
+   case CSO_VELEMENTS:
+      hash = sc->velements_hash;
+      break;
    }
 
    return hash;
@@ -161,6 +165,13 @@ static void delete_vs_state(void *state, void *data)
    FREE(state);
 }
 
+static void delete_velements(void *state, void *data)
+{
+   struct cso_velements *cso = (struct cso_velements *)state;
+   if (cso->delete_state)
+      cso->delete_state(cso->context, cso->data);
+   FREE(state);
+}
 
 static INLINE void delete_cso(void *state, enum cso_cache_type type)
 {
@@ -183,6 +194,9 @@ static INLINE void delete_cso(void *state, enum cso_cache_type type)
    case CSO_VERTEX_SHADER:
       delete_vs_state(state, 0);
       break;
+   case CSO_VELEMENTS:
+      delete_velements(state, 0);
+      break;
    default:
       assert(0);
       FREE(state);
@@ -294,6 +308,7 @@ struct cso_cache *cso_cache_create(void)
    sc->rasterizer_hash    = cso_hash_create();
    sc->fs_hash            = cso_hash_create();
    sc->vs_hash            = cso_hash_create();
+   sc->velements_hash     = cso_hash_create();
    sc->sanitize_cb        = sanitize_cb;
    sc->sanitize_data      = 0;
 
@@ -325,6 +340,9 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
    case CSO_VERTEX_SHADER:
       hash = sc->vs_hash;
       break;
+   case CSO_VELEMENTS:
+      hash = sc->velements_hash;
+      break;
    }
 
    iter = cso_hash_first_node(hash);
@@ -351,6 +369,7 @@ void cso_cache_delete(struct cso_cache *sc)
    cso_for_each_state(sc, CSO_VERTEX_SHADER, delete_vs_state, 0);
    cso_for_each_state(sc, CSO_RASTERIZER, delete_rasterizer_state, 0);
    cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0);
+   cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0);
 
    cso_hash_delete(sc->blend_hash);
    cso_hash_delete(sc->sampler_hash);
@@ -358,6 +377,7 @@ void cso_cache_delete(struct cso_cache *sc)
    cso_hash_delete(sc->rasterizer_hash);
    cso_hash_delete(sc->fs_hash);
    cso_hash_delete(sc->vs_hash);
+   cso_hash_delete(sc->velements_hash);
    FREE(sc);
 }
 
@@ -372,6 +392,7 @@ void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
    sanitize_hash(sc, sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size);
    sanitize_hash(sc, sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size);
    sanitize_hash(sc, sc->sampler_hash, CSO_SAMPLER, sc->max_size);
+   sanitize_hash(sc, sc->velements_hash, CSO_VELEMENTS, sc->max_size);
 }
 
 int cso_maximum_cache_size(const struct cso_cache *sc)
index eea60b940bb8663f5037a804f1f0cec4068bbfc6..fb09b83c623ef61be9ca4f540540667126dc8d80 100644 (file)
@@ -53,6 +53,7 @@
   * - rasterizer (old setup)
   * - sampler
   * - vertex shader
+  * - vertex elements
   *
   * Things that are not constant state objects include:
   * - blend_color
@@ -90,7 +91,8 @@ enum cso_cache_type {
    CSO_DEPTH_STENCIL_ALPHA,
    CSO_RASTERIZER,
    CSO_FRAGMENT_SHADER,
-   CSO_VERTEX_SHADER
+   CSO_VERTEX_SHADER,
+   CSO_VELEMENTS
 };
 
 typedef void (*cso_state_callback)(void *ctx, void *obj);
@@ -144,6 +146,18 @@ struct cso_sampler {
    struct pipe_context *context;
 };
 
+struct cso_velems_state {
+   unsigned count;
+   struct pipe_vertex_element velems[PIPE_MAX_ATTRIBS];
+};
+
+struct cso_velements {
+   struct cso_velems_state state;
+   void *data;
+   cso_state_callback delete_state;
+   struct pipe_context *context;
+};
+
 unsigned cso_construct_key(void *item, int item_size);
 
 struct cso_cache *cso_cache_create(void);
index a7335c340ca8d930235aa30605fcfacef3414293..6fd4bd36428058173a4e28526bdb7fef80282d6e 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
+#include "util/u_math.h"
 #include "util/u_memory.h"
 #include "tgsi/tgsi_parse.h"
 
@@ -69,17 +70,17 @@ struct cso_context {
    unsigned nr_vertex_samplers_saved;
    void *vertex_samplers_saved[PIPE_MAX_VERTEX_SAMPLERS];
 
-   struct pipe_texture *textures[PIPE_MAX_SAMPLERS];
-   uint nr_textures;
+   uint nr_fragment_sampler_views;
+   struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
 
-   struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS];
-   uint nr_vertex_textures;
+   uint nr_vertex_sampler_views;
+   struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
 
-   uint nr_textures_saved;
-   struct pipe_texture *textures_saved[PIPE_MAX_SAMPLERS];
+   uint nr_fragment_sampler_views_saved;
+   struct pipe_sampler_view *fragment_sampler_views_saved[PIPE_MAX_SAMPLERS];
 
-   uint nr_vertex_textures_saved;
-   struct pipe_texture *vertex_textures_saved[PIPE_MAX_SAMPLERS];
+   uint nr_vertex_sampler_views_saved;
+   struct pipe_sampler_view *vertex_sampler_views_saved[PIPE_MAX_VERTEX_SAMPLERS];
 
    /** Current and saved state.
     * The saved state is used as a 1-deep stack.
@@ -89,6 +90,7 @@ struct cso_context {
    void *rasterizer, *rasterizer_saved;
    void *fragment_shader, *fragment_shader_saved, *geometry_shader;
    void *vertex_shader, *vertex_shader_saved, *geometry_shader_saved;
+   void *velements, *velements_saved;
 
    struct pipe_clip_state clip;
    struct pipe_clip_state clip_saved;
@@ -174,6 +176,20 @@ static boolean delete_vs_state(struct cso_context *ctx, void *state)
    return FALSE;
 }
 
+static boolean delete_vertex_elements(struct cso_context *ctx,
+                                      void *state)
+{
+   struct cso_velements *cso = (struct cso_velements *)state;
+
+   if (ctx->velements == cso->data)
+      return FALSE;
+
+   if (cso->delete_state)
+      cso->delete_state(cso->context, cso->data);
+   FREE(state);
+   return TRUE;
+}
+
 
 static INLINE boolean delete_cso(struct cso_context *ctx,
                                  void *state, enum cso_cache_type type)
@@ -197,6 +213,9 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
    case CSO_VERTEX_SHADER:
       return delete_vs_state(ctx, state);
       break;
+   case CSO_VELEMENTS:
+      return delete_vertex_elements(ctx, state);
+      break;
    default:
       assert(0);
       FREE(state);
@@ -271,16 +290,17 @@ void cso_release_all( struct cso_context *ctx )
       ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL );
       ctx->pipe->bind_fs_state( ctx->pipe, NULL );
       ctx->pipe->bind_vs_state( ctx->pipe, NULL );
+      ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
    }
 
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
-      pipe_texture_reference(&ctx->textures[i], NULL);
-      pipe_texture_reference(&ctx->textures_saved[i], NULL);
+      pipe_sampler_view_reference(&ctx->fragment_sampler_views[i], NULL);
+      pipe_sampler_view_reference(&ctx->fragment_sampler_views_saved[i], NULL);
    }
 
    for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
-      pipe_texture_reference(&ctx->vertex_textures[i], NULL);
-      pipe_texture_reference(&ctx->vertex_textures_saved[i], NULL);
+      pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
+      pipe_sampler_view_reference(&ctx->vertex_sampler_views_saved[i], NULL);
    }
 
    free_framebuffer_state(&ctx->fb);
@@ -597,114 +617,6 @@ cso_restore_vertex_samplers(struct cso_context *ctx)
 }
 
 
-enum pipe_error cso_set_sampler_textures( struct cso_context *ctx,
-                                          uint count,
-                                          struct pipe_texture **textures )
-{
-   uint i;
-
-   ctx->nr_textures = count;
-
-   for (i = 0; i < count; i++)
-      pipe_texture_reference(&ctx->textures[i], textures[i]);
-   for ( ; i < PIPE_MAX_SAMPLERS; i++)
-      pipe_texture_reference(&ctx->textures[i], NULL);
-
-   ctx->pipe->set_fragment_sampler_textures(ctx->pipe, count, textures);
-
-   return PIPE_OK;
-}
-
-void cso_save_sampler_textures( struct cso_context *ctx )
-{
-   uint i;
-
-   ctx->nr_textures_saved = ctx->nr_textures;
-   for (i = 0; i < ctx->nr_textures; i++) {
-      assert(!ctx->textures_saved[i]);
-      pipe_texture_reference(&ctx->textures_saved[i], ctx->textures[i]);
-   }
-}
-
-void cso_restore_sampler_textures( struct cso_context *ctx )
-{
-   uint i;
-
-   ctx->nr_textures = ctx->nr_textures_saved;
-
-   for (i = 0; i < ctx->nr_textures; i++) {
-      pipe_texture_reference(&ctx->textures[i], NULL);
-      ctx->textures[i] = ctx->textures_saved[i];
-      ctx->textures_saved[i] = NULL;
-   }
-   for ( ; i < PIPE_MAX_SAMPLERS; i++)
-      pipe_texture_reference(&ctx->textures[i], NULL);
-
-   ctx->pipe->set_fragment_sampler_textures(ctx->pipe, ctx->nr_textures, ctx->textures);
-
-   ctx->nr_textures_saved = 0;
-}
-
-
-
-enum pipe_error
-cso_set_vertex_sampler_textures(struct cso_context *ctx,
-                                uint count,
-                                struct pipe_texture **textures)
-{
-   uint i;
-
-   ctx->nr_vertex_textures = count;
-
-   for (i = 0; i < count; i++) {
-      pipe_texture_reference(&ctx->vertex_textures[i], textures[i]);
-   }
-   for ( ; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
-      pipe_texture_reference(&ctx->vertex_textures[i], NULL);
-   }
-
-   ctx->pipe->set_vertex_sampler_textures(ctx->pipe, count, textures);
-
-   return PIPE_OK;
-}
-
-void
-cso_save_vertex_sampler_textures(struct cso_context *ctx)
-{
-   uint i;
-
-   ctx->nr_vertex_textures_saved = ctx->nr_vertex_textures;
-   for (i = 0; i < ctx->nr_vertex_textures; i++) {
-      assert(!ctx->vertex_textures_saved[i]);
-      pipe_texture_reference(&ctx->vertex_textures_saved[i], ctx->vertex_textures[i]);
-   }
-}
-
-void
-cso_restore_vertex_sampler_textures(struct cso_context *ctx)
-{
-   uint i;
-
-   ctx->nr_vertex_textures = ctx->nr_vertex_textures_saved;
-
-   for (i = 0; i < ctx->nr_vertex_textures; i++) {
-      pipe_texture_reference(&ctx->vertex_textures[i], NULL);
-      ctx->vertex_textures[i] = ctx->vertex_textures_saved[i];
-      ctx->vertex_textures_saved[i] = NULL;
-   }
-   for ( ; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
-      pipe_texture_reference(&ctx->vertex_textures[i], NULL);
-   }
-
-   ctx->pipe->set_vertex_sampler_textures(ctx->pipe,
-                                          ctx->nr_vertex_textures,
-                                          ctx->vertex_textures);
-
-   ctx->nr_vertex_textures_saved = 0;
-}
-
-
-
 enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
                                             const struct pipe_depth_stencil_alpha_state *templ)
 {
@@ -1130,7 +1042,6 @@ void cso_restore_geometry_shader(struct cso_context *ctx)
    ctx->geometry_shader_saved = NULL;
 }
 
-
 /* clip state */
 
 static INLINE void
@@ -1180,3 +1091,185 @@ cso_restore_clip(struct cso_context *ctx)
       ctx->pipe->set_clip_state(ctx->pipe, &ctx->clip_saved);
    }
 }
+
+enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
+                                        unsigned count,
+                                        const struct pipe_vertex_element *states)
+{
+   unsigned key_size, hash_key;
+   struct cso_hash_iter iter;
+   void *handle;
+   struct cso_velems_state velems_state;
+
+   /* need to include the count into the stored state data too.
+      Otherwise first few count pipe_vertex_elements could be identical even if count
+      is different, and there's no guarantee the hash would be different in that
+      case neither */
+   key_size = sizeof(struct pipe_vertex_element) * count + sizeof(unsigned);
+   velems_state.count = count;
+   memcpy(velems_state.velems, states, sizeof(struct pipe_vertex_element) * count);
+   hash_key = cso_construct_key((void*)&velems_state, key_size);
+   iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)&velems_state, key_size);
+
+   if (cso_hash_iter_is_null(iter)) {
+      struct cso_velements *cso = MALLOC(sizeof(struct cso_velements));
+      if (!cso)
+         return PIPE_ERROR_OUT_OF_MEMORY;
+
+      memcpy(&cso->state, &velems_state, key_size);
+      cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state.velems[0]);
+      cso->delete_state = (cso_state_callback)ctx->pipe->delete_vertex_elements_state;
+      cso->context = ctx->pipe;
+
+      iter = cso_insert_state(ctx->cache, hash_key, CSO_VELEMENTS, cso);
+      if (cso_hash_iter_is_null(iter)) {
+         FREE(cso);
+         return PIPE_ERROR_OUT_OF_MEMORY;
+      }
+
+      handle = cso->data;
+   }
+   else {
+      handle = ((struct cso_velements *)cso_hash_iter_data(iter))->data;
+   }
+
+   if (ctx->velements != handle) {
+      ctx->velements = handle;
+      ctx->pipe->bind_vertex_elements_state(ctx->pipe, handle);
+   }
+   return PIPE_OK;
+}
+
+void cso_save_vertex_elements(struct cso_context *ctx)
+{
+   assert(!ctx->velements_saved);
+   ctx->velements_saved = ctx->velements;
+}
+
+void cso_restore_vertex_elements(struct cso_context *ctx)
+{
+   if (ctx->velements != ctx->velements_saved) {
+      ctx->velements = ctx->velements_saved;
+      ctx->pipe->bind_vertex_elements_state(ctx->pipe, ctx->velements_saved);
+   }
+   ctx->velements_saved = NULL;
+}
+
+/* fragment sampler view state */
+
+void
+cso_set_fragment_sampler_views(struct cso_context *cso,
+                               uint count,
+                               struct pipe_sampler_view **views)
+{
+   uint i;
+
+   for (i = 0; i < count; i++) {
+      pipe_sampler_view_reference(&cso->fragment_sampler_views[i], views[i]);
+   }
+   for (; i < cso->nr_fragment_sampler_views; i++) {
+      pipe_sampler_view_reference(&cso->fragment_sampler_views[i], NULL);
+   }
+
+   cso->pipe->set_fragment_sampler_views(cso->pipe,
+                                         MAX2(count, cso->nr_fragment_sampler_views),
+                                         cso->fragment_sampler_views);
+
+   cso->nr_fragment_sampler_views = count;
+}
+
+void
+cso_save_fragment_sampler_views(struct cso_context *cso)
+{
+   uint i;
+
+   cso->nr_fragment_sampler_views_saved = cso->nr_fragment_sampler_views;
+
+   for (i = 0; i < cso->nr_fragment_sampler_views; i++) {
+      assert(!cso->fragment_sampler_views_saved[i]);
+
+      pipe_sampler_view_reference(&cso->fragment_sampler_views_saved[i],
+                                  cso->fragment_sampler_views[i]);
+   }
+}
+
+void
+cso_restore_fragment_sampler_views(struct cso_context *cso)
+{
+   uint i;
+
+   for (i = 0; i < cso->nr_fragment_sampler_views_saved; i++) {
+      pipe_sampler_view_reference(&cso->fragment_sampler_views[i], cso->fragment_sampler_views_saved[i]);
+      pipe_sampler_view_reference(&cso->fragment_sampler_views_saved[i], NULL);
+   }
+   for (; i < cso->nr_fragment_sampler_views; i++) {
+      pipe_sampler_view_reference(&cso->fragment_sampler_views[i], NULL);
+   }
+
+   cso->pipe->set_fragment_sampler_views(cso->pipe,
+                                         MAX2(cso->nr_fragment_sampler_views, cso->nr_fragment_sampler_views_saved),
+                                         cso->fragment_sampler_views);
+
+   cso->nr_fragment_sampler_views = cso->nr_fragment_sampler_views_saved;
+   cso->nr_fragment_sampler_views_saved = 0;
+}
+
+
+/* vertex sampler view state */
+
+void
+cso_set_vertex_sampler_views(struct cso_context *cso,
+                             uint count,
+                             struct pipe_sampler_view **views)
+{
+   uint i;
+
+   for (i = 0; i < count; i++) {
+      pipe_sampler_view_reference(&cso->vertex_sampler_views[i], views[i]);
+   }
+   for (; i < cso->nr_vertex_sampler_views; i++) {
+      pipe_sampler_view_reference(&cso->vertex_sampler_views[i], NULL);
+   }
+
+   cso->pipe->set_vertex_sampler_views(cso->pipe,
+                                       MAX2(count, cso->nr_vertex_sampler_views),
+                                       cso->vertex_sampler_views);
+
+   cso->nr_vertex_sampler_views = count;
+}
+
+void
+cso_save_vertex_sampler_views(struct cso_context *cso)
+{
+   uint i;
+
+   cso->nr_vertex_sampler_views_saved = cso->nr_vertex_sampler_views;
+
+   for (i = 0; i < cso->nr_vertex_sampler_views; i++) {
+      assert(!cso->vertex_sampler_views_saved[i]);
+
+      pipe_sampler_view_reference(&cso->vertex_sampler_views_saved[i],
+                                  cso->vertex_sampler_views[i]);
+   }
+}
+
+void
+cso_restore_vertex_sampler_views(struct cso_context *cso)
+{
+   uint i;
+
+   for (i = 0; i < cso->nr_vertex_sampler_views_saved; i++) {
+      pipe_sampler_view_reference(&cso->vertex_sampler_views[i], cso->vertex_sampler_views_saved[i]);
+      pipe_sampler_view_reference(&cso->vertex_sampler_views_saved[i], NULL);
+   }
+   for (; i < cso->nr_vertex_sampler_views; i++) {
+      pipe_sampler_view_reference(&cso->vertex_sampler_views[i], NULL);
+   }
+
+   cso->pipe->set_vertex_sampler_views(cso->pipe,
+                                       MAX2(cso->nr_vertex_sampler_views, cso->nr_vertex_sampler_views_saved),
+                                       cso->vertex_sampler_views);
+
+   cso->nr_vertex_sampler_views = cso->nr_vertex_sampler_views_saved;
+   cso->nr_vertex_sampler_views_saved = 0;
+}
index 251a9a644f85a1b46f928d9048ff984339b6a04c..d6bcb1fe8f761efa44d4b5f5844822187288703d 100644 (file)
@@ -103,24 +103,11 @@ void
 cso_single_vertex_sampler_done(struct cso_context *cso);
 
 
-
-enum pipe_error cso_set_sampler_textures( struct cso_context *cso,
-                                          uint count,
-                                          struct pipe_texture **textures );
-void cso_save_sampler_textures( struct cso_context *cso );
-void cso_restore_sampler_textures( struct cso_context *cso );
-
-
-
-enum pipe_error
-cso_set_vertex_sampler_textures(struct cso_context *cso,
-                                uint count,
-                                struct pipe_texture **textures);
-void
-cso_save_vertex_sampler_textures(struct cso_context *cso);
-void
-cso_restore_vertex_sampler_textures(struct cso_context *cso);
-
+enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
+                                        unsigned count,
+                                        const struct pipe_vertex_element *states);
+void cso_save_vertex_elements(struct cso_context *ctx);
+void cso_restore_vertex_elements(struct cso_context *ctx);
 
 
 /* These aren't really sensible -- most of the time the api provides
@@ -157,7 +144,6 @@ void cso_save_geometry_shader(struct cso_context *cso);
 void cso_restore_geometry_shader(struct cso_context *cso);
 
 
-
 enum pipe_error cso_set_framebuffer(struct cso_context *cso,
                                     const struct pipe_framebuffer_state *fb);
 void cso_save_framebuffer(struct cso_context *cso);
@@ -193,6 +179,34 @@ void
 cso_restore_clip(struct cso_context *cso);
 
 
+/* fragment sampler view state */
+
+void
+cso_set_fragment_sampler_views(struct cso_context *cso,
+                               uint count,
+                               struct pipe_sampler_view **views);
+
+void
+cso_save_fragment_sampler_views(struct cso_context *cso);
+
+void
+cso_restore_fragment_sampler_views(struct cso_context *cso);
+
+
+/* vertex sampler view state */
+
+void
+cso_set_vertex_sampler_views(struct cso_context *cso,
+                             uint count,
+                             struct pipe_sampler_view **views);
+
+void
+cso_save_vertex_sampler_views(struct cso_context *cso);
+
+void
+cso_restore_vertex_sampler_views(struct cso_context *cso);
+
+
 #ifdef __cplusplus
 }
 #endif
index 8f6ca15dfa2815383a4e15fe5a501ed3081064f1..f4615064e655e66a9eb2415af4bba4182de519eb 100644 (file)
@@ -40,6 +40,7 @@
 #include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
+#include "util/u_sampler.h"
 
 #include "tgsi/tgsi_transform.h"
 #include "tgsi/tgsi_dump.h"
@@ -88,8 +89,9 @@ struct aaline_stage
 
    void *sampler_cso;
    struct pipe_texture *texture;
+   struct pipe_sampler_view *sampler_view;
    uint num_samplers;
-   uint num_textures;
+   uint num_sampler_views;
 
 
    /*
@@ -98,7 +100,7 @@ struct aaline_stage
    struct aaline_fragment_shader *fs;
    struct {
       void *sampler[PIPE_MAX_SAMPLERS];
-      struct pipe_texture *texture[PIPE_MAX_SAMPLERS];
+      struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
    } state;
 
    /*
@@ -111,8 +113,9 @@ struct aaline_stage
 
    void (*driver_bind_sampler_states)(struct pipe_context *, unsigned,
                                       void **);
-   void (*driver_set_sampler_textures)(struct pipe_context *, unsigned,
-                                       struct pipe_texture **);
+   void (*driver_set_sampler_views)(struct pipe_context *,
+                                    unsigned,
+                                    struct pipe_sampler_view **);
 
    struct pipe_context *pipe;
 };
@@ -394,6 +397,7 @@ aaline_create_texture(struct aaline_stage *aaline)
    struct pipe_context *pipe = aaline->pipe;
    struct pipe_screen *screen = pipe->screen;
    struct pipe_texture texTemp;
+   struct pipe_sampler_view viewTempl;
    uint level;
 
    memset(&texTemp, 0, sizeof(texTemp));
@@ -408,6 +412,16 @@ aaline_create_texture(struct aaline_stage *aaline)
    if (!aaline->texture)
  &