summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-02-15 11:15:47 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-02-15 11:15:47 +0000
commit6ac2c1cc0cd1253ba2014d459010032127f185ec (patch)
tree6348de9de19e7394800a983c8c614566d22b870b
parentc04a7f8929d674971a472ffa4d3a31200c22aa5a (diff)
parent6d3831b11d9f5aaba61cc2fb8ade61437ad7c335 (diff)
Merge commit 'origin/gallium-0.1' into gallium-0.1
Conflicts: src/gallium/drivers/softpipe/sp_quad_fs.c src/gallium/drivers/softpipe/sp_state.h src/gallium/drivers/softpipe/sp_state_fs.c
-rw-r--r--configs/beos2
-rw-r--r--configs/darwin2
-rw-r--r--configs/darwin-x86ppc2
-rw-r--r--configs/default2
-rw-r--r--configs/freebsd-dri2
-rw-r--r--configs/linux-cell2
-rw-r--r--configs/linux-directfb2
-rw-r--r--configs/linux-dri6
-rw-r--r--configs/linux-dri-xcb4
-rw-r--r--configs/linux-fbdev2
-rw-r--r--configs/linux-osmesa2
-rw-r--r--configs/linux-osmesa162
-rw-r--r--configs/linux-osmesa16-static2
-rw-r--r--configs/linux-osmesa322
-rw-r--r--configs/linux-solo2
-rw-r--r--progs/trivial/Makefile1
-rw-r--r--progs/trivial/pgon-mode.c136
-rw-r--r--src/gallium/Makefile20
-rw-r--r--src/gallium/Makefile.template (renamed from src/mesa/pipe/Makefile.template)7
-rw-r--r--src/gallium/README.portability (renamed from src/mesa/pipe/README.portability)0
-rw-r--r--src/gallium/SConscript (renamed from src/mesa/pipe/SConscript)0
-rw-r--r--src/gallium/aux/Makefile24
-rw-r--r--src/gallium/aux/cso_cache/cso_cache.c (renamed from src/mesa/pipe/cso_cache/cso_cache.c)0
-rw-r--r--src/gallium/aux/cso_cache/cso_cache.h (renamed from src/mesa/pipe/cso_cache/cso_cache.h)0
-rw-r--r--src/gallium/aux/cso_cache/cso_hash.c (renamed from src/mesa/pipe/cso_cache/cso_hash.c)0
-rw-r--r--src/gallium/aux/cso_cache/cso_hash.h (renamed from src/mesa/pipe/cso_cache/cso_hash.h)0
-rw-r--r--src/gallium/aux/draw/Makefile (renamed from src/mesa/pipe/draw/Makefile)0
-rw-r--r--src/gallium/aux/draw/draw_clip.c (renamed from src/mesa/pipe/draw/draw_clip.c)4
-rw-r--r--src/gallium/aux/draw/draw_context.c (renamed from src/mesa/pipe/draw/draw_context.c)4
-rw-r--r--src/gallium/aux/draw/draw_context.h (renamed from src/mesa/pipe/draw/draw_context.h)0
-rw-r--r--src/gallium/aux/draw/draw_cull.c (renamed from src/mesa/pipe/draw/draw_cull.c)4
-rw-r--r--src/gallium/aux/draw/draw_debug.c (renamed from src/mesa/pipe/draw/draw_debug.c)0
-rw-r--r--src/gallium/aux/draw/draw_flatshade.c (renamed from src/mesa/pipe/draw/draw_flatshade.c)4
-rw-r--r--src/gallium/aux/draw/draw_offset.c (renamed from src/mesa/pipe/draw/draw_offset.c)4
-rw-r--r--src/gallium/aux/draw/draw_prim.c (renamed from src/mesa/pipe/draw/draw_prim.c)0
-rw-r--r--src/gallium/aux/draw/draw_private.h (renamed from src/mesa/pipe/draw/draw_private.h)8
-rw-r--r--src/gallium/aux/draw/draw_stipple.c (renamed from src/mesa/pipe/draw/draw_stipple.c)3
-rw-r--r--src/gallium/aux/draw/draw_twoside.c (renamed from src/mesa/pipe/draw/draw_twoside.c)4
-rw-r--r--src/gallium/aux/draw/draw_unfilled.c (renamed from src/mesa/pipe/draw/draw_unfilled.c)6
-rw-r--r--src/gallium/aux/draw/draw_validate.c (renamed from src/mesa/pipe/draw/draw_validate.c)0
-rw-r--r--src/gallium/aux/draw/draw_vbuf.c (renamed from src/mesa/pipe/draw/draw_vbuf.c)3
-rw-r--r--src/gallium/aux/draw/draw_vbuf.h (renamed from src/mesa/pipe/draw/draw_vbuf.h)0
-rw-r--r--src/gallium/aux/draw/draw_vertex.c (renamed from src/mesa/pipe/draw/draw_vertex.c)4
-rw-r--r--src/gallium/aux/draw/draw_vertex.h (renamed from src/mesa/pipe/draw/draw_vertex.h)7
-rw-r--r--src/gallium/aux/draw/draw_vertex_cache.c (renamed from src/mesa/pipe/draw/draw_vertex_cache.c)0
-rw-r--r--src/gallium/aux/draw/draw_vertex_fetch.c (renamed from src/mesa/pipe/draw/draw_vertex_fetch.c)0
-rw-r--r--src/gallium/aux/draw/draw_vertex_shader.c (renamed from src/mesa/pipe/draw/draw_vertex_shader.c)4
-rw-r--r--src/gallium/aux/draw/draw_vf.c (renamed from src/mesa/pipe/draw/draw_vf.c)2
-rw-r--r--src/gallium/aux/draw/draw_vf.h (renamed from src/mesa/pipe/draw/draw_vf.h)17
-rw-r--r--src/gallium/aux/draw/draw_vf_generic.c (renamed from src/mesa/pipe/draw/draw_vf_generic.c)0
-rw-r--r--src/gallium/aux/draw/draw_vf_sse.c (renamed from src/mesa/pipe/draw/draw_vf_sse.c)0
-rw-r--r--src/gallium/aux/draw/draw_wide_prims.c (renamed from src/mesa/pipe/draw/draw_wide_prims.c)10
-rw-r--r--src/gallium/aux/llvm/Makefile (renamed from src/mesa/pipe/llvm/Makefile)10
-rw-r--r--src/gallium/aux/llvm/gallivm.cpp (renamed from src/mesa/pipe/llvm/gallivm.cpp)4
-rw-r--r--src/gallium/aux/llvm/gallivm.h (renamed from src/mesa/pipe/llvm/gallivm.h)0
-rw-r--r--src/gallium/aux/llvm/gallivm_builtins.cpp (renamed from src/mesa/pipe/llvm/gallivm_builtins.cpp)0
-rw-r--r--src/gallium/aux/llvm/gallivm_cpu.cpp (renamed from src/mesa/pipe/llvm/gallivm_cpu.cpp)4
-rw-r--r--src/gallium/aux/llvm/gallivm_p.h (renamed from src/mesa/pipe/llvm/gallivm_p.h)0
-rw-r--r--src/gallium/aux/llvm/instructions.cpp (renamed from src/mesa/pipe/llvm/instructions.cpp)0
-rw-r--r--src/gallium/aux/llvm/instructions.h (renamed from src/mesa/pipe/llvm/instructions.h)0
-rw-r--r--src/gallium/aux/llvm/instructionssoa.cpp121
-rw-r--r--src/gallium/aux/llvm/instructionssoa.h (renamed from src/mesa/pipe/llvm/instructionssoa.h)10
-rw-r--r--src/gallium/aux/llvm/llvm_builtins.c (renamed from src/mesa/pipe/llvm/llvm_builtins.c)0
-rw-r--r--src/gallium/aux/llvm/loweringpass.cpp (renamed from src/mesa/pipe/llvm/loweringpass.cpp)0
-rw-r--r--src/gallium/aux/llvm/loweringpass.h (renamed from src/mesa/pipe/llvm/loweringpass.h)0
-rw-r--r--src/gallium/aux/llvm/storage.cpp (renamed from src/mesa/pipe/llvm/storage.cpp)0
-rw-r--r--src/gallium/aux/llvm/storage.h (renamed from src/mesa/pipe/llvm/storage.h)0
-rw-r--r--src/gallium/aux/llvm/storagesoa.cpp389
-rw-r--r--src/gallium/aux/llvm/storagesoa.h (renamed from src/mesa/pipe/llvm/storagesoa.h)55
-rw-r--r--src/gallium/aux/llvm/tgsitollvm.cpp (renamed from src/mesa/pipe/llvm/tgsitollvm.cpp)49
-rw-r--r--src/gallium/aux/llvm/tgsitollvm.h (renamed from src/mesa/pipe/llvm/tgsitollvm.h)0
-rw-r--r--src/gallium/aux/pipebuffer/Makefile (renamed from src/mesa/pipe/pipebuffer/Makefile)2
-rw-r--r--src/gallium/aux/pipebuffer/linked_list.h (renamed from src/mesa/pipe/pipebuffer/linked_list.h)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_buffer.h (renamed from src/mesa/pipe/pipebuffer/pb_buffer.h)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_buffer_fenced.c (renamed from src/mesa/pipe/pipebuffer/pb_buffer_fenced.c)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_buffer_fenced.h (renamed from src/mesa/pipe/pipebuffer/pb_buffer_fenced.h)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_buffer_malloc.c (renamed from src/mesa/pipe/pipebuffer/pb_buffer_malloc.c)4
-rw-r--r--src/gallium/aux/pipebuffer/pb_bufmgr.h (renamed from src/mesa/pipe/pipebuffer/pb_bufmgr.h)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_bufmgr_fenced.c (renamed from src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_bufmgr_mm.c (renamed from src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_bufmgr_pool.c (renamed from src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c)0
-rw-r--r--src/gallium/aux/pipebuffer/pb_winsys.c (renamed from src/mesa/pipe/pipebuffer/pb_winsys.c)0
-rw-r--r--src/gallium/aux/tgsi/Makefile (renamed from src/mesa/pipe/tgsi/Makefile)0
-rw-r--r--src/gallium/aux/tgsi/exec/Makefile (renamed from src/mesa/pipe/tgsi/exec/Makefile)0
-rw-r--r--src/gallium/aux/tgsi/exec/tgsi_exec.c (renamed from src/mesa/pipe/tgsi/exec/tgsi_exec.c)43
-rw-r--r--src/gallium/aux/tgsi/exec/tgsi_exec.h (renamed from src/mesa/pipe/tgsi/exec/tgsi_exec.h)0
-rwxr-xr-xsrc/gallium/aux/tgsi/exec/tgsi_sse2.c (renamed from src/mesa/pipe/tgsi/exec/tgsi_sse2.c)4
-rwxr-xr-xsrc/gallium/aux/tgsi/exec/tgsi_sse2.h (renamed from src/mesa/pipe/tgsi/exec/tgsi_sse2.h)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_build.c (renamed from src/mesa/pipe/tgsi/util/tgsi_build.c)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_build.h (renamed from src/mesa/pipe/tgsi/util/tgsi_build.h)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_dump.c (renamed from src/mesa/pipe/tgsi/util/tgsi_dump.c)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_dump.h (renamed from src/mesa/pipe/tgsi/util/tgsi_dump.h)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_parse.c (renamed from src/mesa/pipe/tgsi/util/tgsi_parse.c)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_parse.h (renamed from src/mesa/pipe/tgsi/util/tgsi_parse.h)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_transform.c199
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_transform.h93
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_util.c (renamed from src/mesa/pipe/tgsi/util/tgsi_util.c)0
-rw-r--r--src/gallium/aux/tgsi/util/tgsi_util.h (renamed from src/mesa/pipe/tgsi/util/tgsi_util.h)0
-rw-r--r--src/gallium/aux/util/p_debug.c (renamed from src/mesa/pipe/util/p_debug.c)0
-rw-r--r--src/gallium/aux/util/p_tile.c (renamed from src/mesa/pipe/util/p_tile.c)0
-rw-r--r--src/gallium/aux/util/p_tile.h (renamed from src/mesa/pipe/util/p_tile.h)0
-rw-r--r--src/gallium/aux/util/p_util.c (renamed from src/mesa/pipe/util/p_util.c)0
-rw-r--r--src/gallium/drivers/Makefile (renamed from src/mesa/pipe/Makefile)6
-rw-r--r--src/gallium/drivers/cell/Makefile (renamed from src/mesa/pipe/cell/Makefile)0
-rw-r--r--src/gallium/drivers/cell/common.h (renamed from src/mesa/pipe/cell/common.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/Makefile (renamed from src/mesa/pipe/cell/ppu/Makefile)7
-rw-r--r--src/gallium/drivers/cell/ppu/cell_batch.c (renamed from src/mesa/pipe/cell/ppu/cell_batch.c)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_batch.h (renamed from src/mesa/pipe/cell/ppu/cell_batch.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_clear.c (renamed from src/mesa/pipe/cell/ppu/cell_clear.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_clear.h (renamed from src/mesa/pipe/cell/ppu/cell_clear.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_context.c (renamed from src/mesa/pipe/cell/ppu/cell_context.c)6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_context.h (renamed from src/mesa/pipe/cell/ppu/cell_context.h)6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_draw_arrays.c (renamed from src/mesa/pipe/cell/ppu/cell_draw_arrays.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_draw_arrays.h (renamed from src/mesa/pipe/cell/ppu/cell_draw_arrays.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_flush.c (renamed from src/mesa/pipe/cell/ppu/cell_flush.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_flush.h (renamed from src/mesa/pipe/cell/ppu/cell_flush.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_render.c (renamed from src/mesa/pipe/cell/ppu/cell_render.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_render.h (renamed from src/mesa/pipe/cell/ppu/cell_render.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_spu.c (renamed from src/mesa/pipe/cell/ppu/cell_spu.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_spu.h (renamed from src/mesa/pipe/cell/ppu/cell_spu.h)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state.h (renamed from src/mesa/pipe/cell/ppu/cell_state.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_blend.c (renamed from src/mesa/pipe/cell/ppu/cell_state_blend.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_clip.c (renamed from src/mesa/pipe/cell/ppu/cell_state_clip.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_derived.c (renamed from src/mesa/pipe/cell/ppu/cell_state_derived.c)4
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.c (renamed from src/mesa/pipe/cell/ppu/cell_state_emit.c)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.h (renamed from src/mesa/pipe/cell/ppu/cell_state_emit.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_fs.c (renamed from src/mesa/pipe/cell/ppu/cell_state_fs.c)8
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_rasterizer.c (renamed from src/mesa/pipe/cell/ppu/cell_state_rasterizer.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_sampler.c (renamed from src/mesa/pipe/cell/ppu/cell_state_sampler.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_surface.c (renamed from src/mesa/pipe/cell/ppu/cell_state_surface.c)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_vertex.c (renamed from src/mesa/pipe/cell/ppu/cell_state_vertex.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_surface.c (renamed from src/mesa/pipe/cell/ppu/cell_surface.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_surface.h (renamed from src/mesa/pipe/cell/ppu/cell_surface.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c (renamed from src/mesa/pipe/cell/ppu/cell_texture.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.h (renamed from src/mesa/pipe/cell/ppu/cell_texture.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_vbuf.c (renamed from src/mesa/pipe/cell/ppu/cell_vbuf.c)2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_vbuf.h (renamed from src/mesa/pipe/cell/ppu/cell_vbuf.h)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_vertex_shader.c (renamed from src/mesa/pipe/cell/ppu/cell_vertex_shader.c)6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_winsys.c (renamed from src/mesa/pipe/cell/ppu/cell_winsys.c)0
-rw-r--r--src/gallium/drivers/cell/ppu/cell_winsys.h (renamed from src/mesa/pipe/cell/ppu/cell_winsys.h)0
-rw-r--r--src/gallium/drivers/cell/spu/Makefile (renamed from src/mesa/pipe/cell/spu/Makefile)6
-rw-r--r--src/gallium/drivers/cell/spu/spu_blend.c (renamed from src/mesa/pipe/cell/spu/spu_blend.c)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_blend.h (renamed from src/mesa/pipe/cell/spu/spu_blend.h)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_colorpack.h (renamed from src/mesa/pipe/cell/spu/spu_colorpack.h)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_exec.c (renamed from src/mesa/pipe/cell/spu/spu_exec.c)4
-rw-r--r--src/gallium/drivers/cell/spu/spu_exec.h (renamed from src/mesa/pipe/cell/spu/spu_exec.h)2
-rw-r--r--src/gallium/drivers/cell/spu/spu_main.c (renamed from src/mesa/pipe/cell/spu/spu_main.c)2
-rw-r--r--src/gallium/drivers/cell/spu/spu_main.h (renamed from src/mesa/pipe/cell/spu/spu_main.h)4
-rw-r--r--src/gallium/drivers/cell/spu/spu_render.c (renamed from src/mesa/pipe/cell/spu/spu_render.c)2
-rw-r--r--src/gallium/drivers/cell/spu/spu_render.h (renamed from src/mesa/pipe/cell/spu/spu_render.h)2
-rw-r--r--src/gallium/drivers/cell/spu/spu_texture.c (renamed from src/mesa/pipe/cell/spu/spu_texture.c)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_texture.h (renamed from src/mesa/pipe/cell/spu/spu_texture.h)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_tile.c (renamed from src/mesa/pipe/cell/spu/spu_tile.c)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_tile.h (renamed from src/mesa/pipe/cell/spu/spu_tile.h)2
-rw-r--r--src/gallium/drivers/cell/spu/spu_tri.c (renamed from src/mesa/pipe/cell/spu/spu_tri.c)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_tri.h (renamed from src/mesa/pipe/cell/spu/spu_tri.h)0
-rw-r--r--src/gallium/drivers/cell/spu/spu_util.c (renamed from src/mesa/pipe/cell/spu/spu_util.c)4
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_fetch.c673
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_shader.c (renamed from src/mesa/pipe/cell/spu/spu_vertex_shader.c)6
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_shader.h (renamed from src/mesa/pipe/cell/spu/spu_vertex_shader.h)4
-rw-r--r--src/gallium/drivers/cell/spu/spu_ztest.h (renamed from src/mesa/pipe/cell/spu/spu_ztest.h)0
-rw-r--r--src/gallium/drivers/failover/Makefile (renamed from src/mesa/pipe/failover/Makefile)2
-rw-r--r--src/gallium/drivers/failover/fo_context.c (renamed from src/mesa/pipe/failover/fo_context.c)0
-rw-r--r--src/gallium/drivers/failover/fo_context.h (renamed from src/mesa/pipe/failover/fo_context.h)0
-rw-r--r--src/gallium/drivers/failover/fo_state.c (renamed from src/mesa/pipe/failover/fo_state.c)0
-rw-r--r--src/gallium/drivers/failover/fo_state_emit.c (renamed from src/mesa/pipe/failover/fo_state_emit.c)0
-rw-r--r--src/gallium/drivers/failover/fo_winsys.h (renamed from src/mesa/pipe/failover/fo_winsys.h)0
-rw-r--r--src/gallium/drivers/i915simple/Makefile (renamed from src/mesa/pipe/i915simple/Makefile)2
-rw-r--r--src/gallium/drivers/i915simple/SConscript (renamed from src/mesa/pipe/i915simple/SConscript)0
-rw-r--r--src/gallium/drivers/i915simple/i915_batch.h (renamed from src/mesa/pipe/i915simple/i915_batch.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_blit.c (renamed from src/mesa/pipe/i915simple/i915_blit.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_blit.h (renamed from src/mesa/pipe/i915simple/i915_blit.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_clear.c (renamed from src/mesa/pipe/i915simple/i915_clear.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_context.c (renamed from src/mesa/pipe/i915simple/i915_context.c)2
-rw-r--r--src/gallium/drivers/i915simple/i915_context.h (renamed from src/mesa/pipe/i915simple/i915_context.h)2
-rw-r--r--src/gallium/drivers/i915simple/i915_debug.c (renamed from src/mesa/pipe/i915simple/i915_debug.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_debug.h (renamed from src/mesa/pipe/i915simple/i915_debug.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_debug_fp.c (renamed from src/mesa/pipe/i915simple/i915_debug_fp.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_flush.c (renamed from src/mesa/pipe/i915simple/i915_flush.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_fpc.h (renamed from src/mesa/pipe/i915simple/i915_fpc.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_fpc_emit.c (renamed from src/mesa/pipe/i915simple/i915_fpc_emit.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_fpc_translate.c (renamed from src/mesa/pipe/i915simple/i915_fpc_translate.c)4
-rw-r--r--src/gallium/drivers/i915simple/i915_prim_emit.c (renamed from src/mesa/pipe/i915simple/i915_prim_emit.c)2
-rw-r--r--src/gallium/drivers/i915simple/i915_prim_vbuf.c (renamed from src/mesa/pipe/i915simple/i915_prim_vbuf.c)2
-rw-r--r--src/gallium/drivers/i915simple/i915_reg.h (renamed from src/mesa/pipe/i915simple/i915_reg.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state.c (renamed from src/mesa/pipe/i915simple/i915_state.c)2
-rw-r--r--src/gallium/drivers/i915simple/i915_state.h (renamed from src/mesa/pipe/i915simple/i915_state.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state_derived.c (renamed from src/mesa/pipe/i915simple/i915_state_derived.c)4
-rw-r--r--src/gallium/drivers/i915simple/i915_state_dynamic.c (renamed from src/mesa/pipe/i915simple/i915_state_dynamic.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state_emit.c (renamed from src/mesa/pipe/i915simple/i915_state_emit.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state_immediate.c (renamed from src/mesa/pipe/i915simple/i915_state_immediate.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state_inlines.h (renamed from src/mesa/pipe/i915simple/i915_state_inlines.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_state_sampler.c (renamed from src/mesa/pipe/i915simple/i915_state_sampler.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_strings.c (renamed from src/mesa/pipe/i915simple/i915_strings.c)2
-rw-r--r--src/gallium/drivers/i915simple/i915_surface.c (renamed from src/mesa/pipe/i915simple/i915_surface.c)4
-rw-r--r--src/gallium/drivers/i915simple/i915_texture.c (renamed from src/mesa/pipe/i915simple/i915_texture.c)0
-rw-r--r--src/gallium/drivers/i915simple/i915_texture.h (renamed from src/mesa/pipe/i915simple/i915_texture.h)0
-rw-r--r--src/gallium/drivers/i915simple/i915_winsys.h (renamed from src/mesa/pipe/i915simple/i915_winsys.h)0
-rw-r--r--src/gallium/drivers/i965simple/Makefile (renamed from src/mesa/pipe/i965simple/Makefile)2
-rw-r--r--src/gallium/drivers/i965simple/SConscript (renamed from src/mesa/pipe/i965simple/SConscript)0
-rw-r--r--src/gallium/drivers/i965simple/brw_batch.h (renamed from src/mesa/pipe/i965simple/brw_batch.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_blit.c (renamed from src/mesa/pipe/i965simple/brw_blit.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_blit.h (renamed from src/mesa/pipe/i965simple/brw_blit.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_cc.c (renamed from src/mesa/pipe/i965simple/brw_cc.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip.c (renamed from src/mesa/pipe/i965simple/brw_clip.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip.h (renamed from src/mesa/pipe/i965simple/brw_clip.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_line.c (renamed from src/mesa/pipe/i965simple/brw_clip_line.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_point.c (renamed from src/mesa/pipe/i965simple/brw_clip_point.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_state.c (renamed from src/mesa/pipe/i965simple/brw_clip_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_tri.c (renamed from src/mesa/pipe/i965simple/brw_clip_tri.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_unfilled.c (renamed from src/mesa/pipe/i965simple/brw_clip_unfilled.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_clip_util.c (renamed from src/mesa/pipe/i965simple/brw_clip_util.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_context.c (renamed from src/mesa/pipe/i965simple/brw_context.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_context.h (renamed from src/mesa/pipe/i965simple/brw_context.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_curbe.c (renamed from src/mesa/pipe/i965simple/brw_curbe.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_defines.h (renamed from src/mesa/pipe/i965simple/brw_defines.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_draw.c (renamed from src/mesa/pipe/i965simple/brw_draw.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_draw.h (renamed from src/mesa/pipe/i965simple/brw_draw.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_draw_upload.c (renamed from src/mesa/pipe/i965simple/brw_draw_upload.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_eu.c (renamed from src/mesa/pipe/i965simple/brw_eu.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_eu.h (renamed from src/mesa/pipe/i965simple/brw_eu.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_eu_debug.c (renamed from src/mesa/pipe/i965simple/brw_eu_debug.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_eu_emit.c (renamed from src/mesa/pipe/i965simple/brw_eu_emit.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_eu_util.c (renamed from src/mesa/pipe/i965simple/brw_eu_util.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_flush.c (renamed from src/mesa/pipe/i965simple/brw_flush.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_gs.c (renamed from src/mesa/pipe/i965simple/brw_gs.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_gs.h (renamed from src/mesa/pipe/i965simple/brw_gs.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_gs_emit.c (renamed from src/mesa/pipe/i965simple/brw_gs_emit.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_gs_state.c (renamed from src/mesa/pipe/i965simple/brw_gs_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_misc_state.c (renamed from src/mesa/pipe/i965simple/brw_misc_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_reg.h (renamed from src/mesa/pipe/i965simple/brw_reg.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_sf.c (renamed from src/mesa/pipe/i965simple/brw_sf.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_sf.h (renamed from src/mesa/pipe/i965simple/brw_sf.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_sf_emit.c (renamed from src/mesa/pipe/i965simple/brw_sf_emit.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_sf_state.c (renamed from src/mesa/pipe/i965simple/brw_sf_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_shader_info.c (renamed from src/mesa/pipe/i965simple/brw_shader_info.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_state.c (renamed from src/mesa/pipe/i965simple/brw_state.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_state.h (renamed from src/mesa/pipe/i965simple/brw_state.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_state_batch.c (renamed from src/mesa/pipe/i965simple/brw_state_batch.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_state_cache.c (renamed from src/mesa/pipe/i965simple/brw_state_cache.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_state_pool.c (renamed from src/mesa/pipe/i965simple/brw_state_pool.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_state_upload.c (renamed from src/mesa/pipe/i965simple/brw_state_upload.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_strings.c (renamed from src/mesa/pipe/i965simple/brw_strings.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_structs.h (renamed from src/mesa/pipe/i965simple/brw_structs.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_surface.c (renamed from src/mesa/pipe/i965simple/brw_surface.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_tex_layout.c (renamed from src/mesa/pipe/i965simple/brw_tex_layout.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_tex_layout.h (renamed from src/mesa/pipe/i965simple/brw_tex_layout.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_urb.c (renamed from src/mesa/pipe/i965simple/brw_urb.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_util.c (renamed from src/mesa/pipe/i965simple/brw_util.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_util.h (renamed from src/mesa/pipe/i965simple/brw_util.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_vs.c (renamed from src/mesa/pipe/i965simple/brw_vs.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_vs.h (renamed from src/mesa/pipe/i965simple/brw_vs.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_vs_emit.c (renamed from src/mesa/pipe/i965simple/brw_vs_emit.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_vs_state.c (renamed from src/mesa/pipe/i965simple/brw_vs_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_winsys.h (renamed from src/mesa/pipe/i965simple/brw_winsys.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm.c (renamed from src/mesa/pipe/i965simple/brw_wm.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm.h (renamed from src/mesa/pipe/i965simple/brw_wm.h)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_decl.c (renamed from src/mesa/pipe/i965simple/brw_wm_decl.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_glsl.c (renamed from src/mesa/pipe/i965simple/brw_wm_glsl.c)2
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_iz.c (renamed from src/mesa/pipe/i965simple/brw_wm_iz.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_sampler_state.c (renamed from src/mesa/pipe/i965simple/brw_wm_sampler_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_state.c (renamed from src/mesa/pipe/i965simple/brw_wm_state.c)0
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_surface_state.c (renamed from src/mesa/pipe/i965simple/brw_wm_surface_state.c)0
-rw-r--r--src/gallium/drivers/softpipe/Makefile (renamed from src/mesa/pipe/softpipe/Makefile)2
-rw-r--r--src/gallium/drivers/softpipe/SConscript (renamed from src/mesa/pipe/softpipe/SConscript)0
-rw-r--r--src/gallium/drivers/softpipe/sp_clear.c (renamed from src/mesa/pipe/softpipe/sp_clear.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_clear.h (renamed from src/mesa/pipe/softpipe/sp_clear.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c (renamed from src/mesa/pipe/softpipe/sp_context.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h (renamed from src/mesa/pipe/softpipe/sp_context.h)2
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c (renamed from src/mesa/pipe/softpipe/sp_draw_arrays.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_flush.c (renamed from src/mesa/pipe/softpipe/sp_flush.c)3
-rw-r--r--src/gallium/drivers/softpipe/sp_flush.h (renamed from src/mesa/pipe/softpipe/sp_flush.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_fs.h54
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_exec.c (renamed from src/mesa/pipe/softpipe/sp_fs_exec.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_llvm.c (renamed from src/mesa/pipe/softpipe/sp_fs_llvm.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_sse.c (renamed from src/mesa/pipe/softpipe/sp_fs_sse.c)4
-rw-r--r--src/gallium/drivers/softpipe/sp_headers.h (renamed from src/mesa/pipe/softpipe/sp_headers.h)2
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_setup.c (renamed from src/mesa/pipe/softpipe/sp_prim_setup.c)25
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_setup.h (renamed from src/mesa/pipe/softpipe/sp_prim_setup.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c (renamed from src/mesa/pipe/softpipe/sp_prim_vbuf.c)11
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.h (renamed from src/mesa/pipe/softpipe/sp_prim_vbuf.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad.c (renamed from src/mesa/pipe/softpipe/sp_quad.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad.h (renamed from src/mesa/pipe/softpipe/sp_quad.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_alpha_test.c (renamed from src/mesa/pipe/softpipe/sp_quad_alpha_test.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c (renamed from src/mesa/pipe/softpipe/sp_quad_blend.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_bufloop.c (renamed from src/mesa/pipe/softpipe/sp_quad_bufloop.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_colormask.c (renamed from src/mesa/pipe/softpipe/sp_quad_colormask.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_coverage.c (renamed from src/mesa/pipe/softpipe/sp_quad_coverage.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c (renamed from src/mesa/pipe/softpipe/sp_quad_depth_test.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_earlyz.c (renamed from src/mesa/pipe/softpipe/sp_quad_earlyz.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c (renamed from src/mesa/pipe/softpipe/sp_quad_fs.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_occlusion.c (renamed from src/mesa/pipe/softpipe/sp_quad_occlusion.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_output.c (renamed from src/mesa/pipe/softpipe/sp_quad_output.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stencil.c (renamed from src/mesa/pipe/softpipe/sp_quad_stencil.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stipple.c (renamed from src/mesa/pipe/softpipe/sp_quad_stipple.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_query.c (renamed from src/mesa/pipe/softpipe/sp_query.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_query.h (renamed from src/mesa/pipe/softpipe/sp_query.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_state.h (renamed from src/mesa/pipe/softpipe/sp_state.h)9
-rw-r--r--src/gallium/drivers/softpipe/sp_state_blend.c (renamed from src/mesa/pipe/softpipe/sp_state_blend.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_state_clip.c (renamed from src/mesa/pipe/softpipe/sp_state_clip.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c235
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c (renamed from src/mesa/pipe/softpipe/sp_state_fs.c)4
-rw-r--r--src/gallium/drivers/softpipe/sp_state_rasterizer.c (renamed from src/mesa/pipe/softpipe/sp_state_rasterizer.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_state_sampler.c (renamed from src/mesa/pipe/softpipe/sp_state_sampler.c)6
-rw-r--r--src/gallium/drivers/softpipe/sp_state_surface.c (renamed from src/mesa/pipe/softpipe/sp_state_surface.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_state_vertex.c (renamed from src/mesa/pipe/softpipe/sp_state_vertex.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_surface.c (renamed from src/mesa/pipe/softpipe/sp_surface.c)4
-rw-r--r--src/gallium/drivers/softpipe/sp_surface.h (renamed from src/mesa/pipe/softpipe/sp_surface.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c (renamed from src/mesa/pipe/softpipe/sp_tex_sample.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.h (renamed from src/mesa/pipe/softpipe/sp_tex_sample.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c (renamed from src/mesa/pipe/softpipe/sp_texture.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.h (renamed from src/mesa/pipe/softpipe/sp_texture.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c (renamed from src/mesa/pipe/softpipe/sp_tile_cache.c)2
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.h (renamed from src/mesa/pipe/softpipe/sp_tile_cache.h)0
-rw-r--r--src/gallium/drivers/softpipe/sp_winsys.h (renamed from src/mesa/pipe/softpipe/sp_winsys.h)0
-rw-r--r--src/gallium/include/pipe/p_compiler.h (renamed from src/mesa/pipe/p_compiler.h)0
-rw-r--r--src/gallium/include/pipe/p_context.h (renamed from src/mesa/pipe/p_context.h)0
-rw-r--r--src/gallium/include/pipe/p_debug.h (renamed from src/mesa/pipe/p_debug.h)0
-rw-r--r--src/gallium/include/pipe/p_defines.h (renamed from src/mesa/pipe/p_defines.h)0
-rw-r--r--src/gallium/include/pipe/p_format.h (renamed from src/mesa/pipe/p_format.h)0
-rw-r--r--src/gallium/include/pipe/p_inlines.h (renamed from src/mesa/pipe/p_inlines.h)0
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h (renamed from src/mesa/pipe/p_shader_tokens.h)0
-rw-r--r--src/gallium/include/pipe/p_state.h (renamed from src/mesa/pipe/p_state.h)0
-rw-r--r--src/gallium/include/pipe/p_thread.h (renamed from src/mesa/pipe/p_thread.h)0
-rw-r--r--src/gallium/include/pipe/p_util.h (renamed from src/mesa/pipe/p_util.h)4
-rw-r--r--src/gallium/include/pipe/p_winsys.h (renamed from src/mesa/pipe/p_winsys.h)0
-rw-r--r--src/gallium/state_trackers/README2
-rw-r--r--src/gallium/winsys/dri/Makefile38
-rw-r--r--src/gallium/winsys/dri/Makefile.template113
-rw-r--r--src/gallium/winsys/dri/intel/Makefile (renamed from src/mesa/drivers/dri/intel_winsys/Makefile)8
-rw-r--r--src/gallium/winsys/dri/intel/SConscript (renamed from src/mesa/drivers/dri/intel_winsys/SConscript)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_batchbuffer.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_batchbuffer.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_batchpool.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_batchpool.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_batchpool.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_batchpool.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_context.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_context.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_context.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_context.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_lock.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_lock.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_reg.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_reg.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_screen.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_screen.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_screen.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_screen.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_swapbuffers.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c)1
-rw-r--r--src/gallium/winsys/dri/intel/intel_swapbuffers.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys.h (renamed from src/mesa/drivers/dri/intel_winsys/intel_winsys.h)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys_i915.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c)2
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys_pipe.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c)0
-rw-r--r--src/gallium/winsys/dri/intel/intel_winsys_softpipe.c (renamed from src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c)2
-rw-r--r--src/gallium/winsys/dri/intel/server/i830_common.h (renamed from src/mesa/drivers/dri/intel_winsys/server/i830_common.h)0
-rw-r--r--src/gallium/winsys/dri/intel/server/i830_dri.h (renamed from src/mesa/drivers/dri/intel_winsys/server/i830_dri.h)0
-rw-r--r--src/gallium/winsys/dri/intel/server/intel.h (renamed from src/mesa/drivers/dri/intel_winsys/server/intel.h)0
-rw-r--r--src/gallium/winsys/dri/intel/server/intel_dri.c (renamed from src/mesa/drivers/dri/intel_winsys/server/intel_dri.c)0
-rw-r--r--src/gallium/winsys/xlib/brw_aub.c (renamed from src/mesa/pipe/xlib/brw_aub.c)0
-rw-r--r--src/gallium/winsys/xlib/brw_aub.h (renamed from src/mesa/pipe/xlib/brw_aub.h)0
-rw-r--r--src/gallium/winsys/xlib/fakeglx.c (renamed from src/mesa/pipe/xlib/fakeglx.c)0
-rw-r--r--src/gallium/winsys/xlib/glxapi.c (renamed from src/mesa/pipe/xlib/glxapi.c)0
-rw-r--r--src/gallium/winsys/xlib/glxapi.h (renamed from src/mesa/pipe/xlib/glxapi.h)0
-rw-r--r--src/gallium/winsys/xlib/glxheader.h (renamed from src/mesa/pipe/xlib/glxheader.h)0
-rw-r--r--src/gallium/winsys/xlib/realglx.c (renamed from src/mesa/pipe/xlib/realglx.c)0
-rw-r--r--src/gallium/winsys/xlib/realglx.h (renamed from src/mesa/pipe/xlib/realglx.h)0
-rw-r--r--src/gallium/winsys/xlib/xfonts.c (renamed from src/mesa/pipe/xlib/xfonts.c)0
-rw-r--r--src/gallium/winsys/xlib/xfonts.h (renamed from src/mesa/pipe/xlib/xfonts.h)0
-rw-r--r--src/gallium/winsys/xlib/xm_api.c (renamed from src/mesa/pipe/xlib/xm_api.c)0
-rw-r--r--src/gallium/winsys/xlib/xm_image.c (renamed from src/mesa/pipe/xlib/xm_image.c)0
-rw-r--r--src/gallium/winsys/xlib/xm_image.h (renamed from src/mesa/pipe/xlib/xm_image.h)0
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c (renamed from src/mesa/pipe/xlib/xm_winsys.c)6
-rw-r--r--src/gallium/winsys/xlib/xm_winsys_aub.c (renamed from src/mesa/pipe/xlib/xm_winsys_aub.c)2
-rw-r--r--src/gallium/winsys/xlib/xm_winsys_aub.h (renamed from src/mesa/pipe/xlib/xm_winsys_aub.h)0
-rw-r--r--src/gallium/winsys/xlib/xmesaP.h (renamed from src/mesa/pipe/xlib/xmesaP.h)0
-rw-r--r--src/mesa/Makefile16
-rw-r--r--src/mesa/drivers/x11/xm_api.c2
-rw-r--r--src/mesa/drivers/x11/xm_dd.c2
-rw-r--r--src/mesa/drivers/x11/xm_surface.c8
-rw-r--r--src/mesa/drivers/x11/xm_winsys.c2
-rw-r--r--src/mesa/drivers/x11/xmesaP.h4
-rw-r--r--src/mesa/pipe/cell/spu/spu_vertex_fetch.c393
-rw-r--r--src/mesa/pipe/llvm/instructionssoa.cpp46
-rw-r--r--src/mesa/pipe/llvm/llvm_base_shader.cpp833
-rw-r--r--src/mesa/pipe/llvm/llvm_entry.c163
-rw-r--r--src/mesa/pipe/llvm/storagesoa.cpp208
-rw-r--r--src/mesa/pipe/softpipe/sp_state_derived.c190
-rw-r--r--src/mesa/ppc/rtasm/spe_asm.c351
-rw-r--r--src/mesa/ppc/rtasm/spe_asm.h310
-rw-r--r--src/mesa/sources84
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c2
-rw-r--r--src/mesa/state_tracker/st_cache.c4
-rw-r--r--src/mesa/state_tracker/st_cache.h2
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c2
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c117
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c2
-rw-r--r--src/mesa/state_tracker/st_cb_feedback.c6
-rw-r--r--src/mesa/state_tracker/st_cb_program.c4
-rw-r--r--src/mesa/state_tracker/st_cb_rasterpos.c4
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c2
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
-rw-r--r--src/mesa/state_tracker/st_context.c4
-rw-r--r--src/mesa/state_tracker/st_debug.c4
-rw-r--r--src/mesa/state_tracker/st_draw.c4
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c2
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c6
-rw-r--r--src/mesa/state_tracker/st_program.c4
400 files changed, 3276 insertions, 2191 deletions
diff --git a/configs/beos b/configs/beos
index f07973d0c7..2b74af739d 100644
--- a/configs/beos
+++ b/configs/beos
@@ -86,7 +86,7 @@ else
endif
# Directories
-SRC_DIRS = mesa glu glut/beos
+SRC_DIRS = gallium mesa glu glut/beos
GLU_DIRS = sgi
DRIVER_DIRS = beos
PROGRAM_DIRS = beos samples redbook demos tests
diff --git a/configs/darwin b/configs/darwin
index 7826ecc605..bba7802696 100644
--- a/configs/darwin
+++ b/configs/darwin
@@ -25,5 +25,5 @@ GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
-SRC_DIRS = mesa glu glut/glx
+SRC_DIRS = gallium mesa glu glut/glx
diff --git a/configs/darwin-x86ppc b/configs/darwin-x86ppc
index 13172327a7..ebeb25051f 100644
--- a/configs/darwin-x86ppc
+++ b/configs/darwin-x86ppc
@@ -29,5 +29,5 @@ GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
-SRC_DIRS = mesa glu glut/glx
+SRC_DIRS = gallium mesa glu glut/glx
diff --git a/configs/default b/configs/default
index 166205a1d3..25a87e66a1 100644
--- a/configs/default
+++ b/configs/default
@@ -60,7 +60,7 @@ GLW_SOURCES = GLwDrawA.c
# Directories to build
LIB_DIR = lib
-SRC_DIRS = mesa glu glut/glx glw
+SRC_DIRS = gallium mesa glu glut/glx glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Which subdirs under $(TOP)/progs/ to enter:
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index 402883d1de..67d253b869 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -36,7 +36,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11
# Directories
-SRC_DIRS = glx/x11 mesa glu glut/glx glw
+SRC_DIRS = glx/x11 gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
diff --git a/configs/linux-cell b/configs/linux-cell
index 3d874491e4..fdf20deeeb 100644
--- a/configs/linux-cell
+++ b/configs/linux-cell
@@ -21,7 +21,7 @@ CFLAGS = $(OPT_FLAGS) -Wall -Winline -fPIC -m32 -mabi=altivec -maltivec -I. -I$(
CXXFLAGS = $(CFLAGS)
# Omitting glw here:
-SRC_DIRS = mesa glu glut/glx
+SRC_DIRS = gallium mesa glu glut/glx
MKDEP_OPTIONS = -fdepend -Y
diff --git a/configs/linux-directfb b/configs/linux-directfb
index 09332f4808..dff27f7850 100644
--- a/configs/linux-directfb
+++ b/configs/linux-directfb
@@ -22,7 +22,7 @@ ifeq ($(HAVE_X86), yes)
endif
# Directories
-SRC_DIRS = mesa glu glut/directfb
+SRC_DIRS = gallium mesa glu glut/directfb
GLU_DIRS = sgi
DRIVER_DIRS = directfb
PROGRAM_DIRS = demos directfb
diff --git a/configs/linux-dri b/configs/linux-dri
index 936fce9982..e6135856fc 100644
--- a/configs/linux-dri
+++ b/configs/linux-dri
@@ -54,10 +54,10 @@ USING_EGL=0
# Directories
ifeq ($(USING_EGL), 1)
-SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
+SRC_DIRS = egl glx/x11 gallium mesa glu glut/glx glw
PROGRAM_DIRS = egl
else
-SRC_DIRS = glx/x11 mesa glu glut/glx glw
+SRC_DIRS = glx/x11 gallium mesa glu glut/glx glw
PROGRAM_DIRS =
endif
@@ -66,4 +66,4 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
-DRI_DIRS = intel_winsys
+DRI_DIRS = intel
diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
index aa292a13ec..ea4bdf1864 100644
--- a/configs/linux-dri-xcb
+++ b/configs/linux-dri-xcb
@@ -53,10 +53,10 @@ USING_EGL=0
# Directories
ifeq ($(USING_EGL), 1)
-SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
+SRC_DIRS = egl glx/x11 gallium mesa glu glut/glx glw
PROGRAM_DIRS = egl
else
-SRC_DIRS = glx/x11 mesa glu glut/glx glw
+SRC_DIRS = glx/x11 gallium mesa glu glut/glx glw
PROGRAM_DIRS =
endif
diff --git a/configs/linux-fbdev b/configs/linux-fbdev
index e36d20a702..1ddccb3f52 100644
--- a/configs/linux-fbdev
+++ b/configs/linux-fbdev
@@ -6,7 +6,7 @@ CONFIG_NAME = linux-fbdev
CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER
-SRC_DIRS = mesa glu glut/fbdev
+SRC_DIRS = gallium mesa glu glut/fbdev
DRIVER_DIRS = fbdev osmesa
PROGRAM_DIRS = fbdev demos redbook samples
diff --git a/configs/linux-osmesa b/configs/linux-osmesa
index cc1fbbd109..0382a19553 100644
--- a/configs/linux-osmesa
+++ b/configs/linux-osmesa
@@ -14,7 +14,7 @@ CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOUR
# Directories
-SRC_DIRS = mesa glu
+SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS = osdemos
diff --git a/configs/linux-osmesa16 b/configs/linux-osmesa16
index 1fb0186d31..9a527592f1 100644
--- a/configs/linux-osmesa16
+++ b/configs/linux-osmesa16
@@ -17,7 +17,7 @@ OSMESA_LIB_NAME = libOSMesa16.so
# Directories
-SRC_DIRS = mesa glu
+SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
diff --git a/configs/linux-osmesa16-static b/configs/linux-osmesa16-static
index 6645504478..1e6380b02e 100644
--- a/configs/linux-osmesa16-static
+++ b/configs/linux-osmesa16-static
@@ -18,7 +18,7 @@ OSMESA_LIB_NAME = libOSMesa16.a
# Directories
-SRC_DIRS = mesa glu
+SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
diff --git a/configs/linux-osmesa32 b/configs/linux-osmesa32
index a1e5a358d6..f0ef1831b0 100644
--- a/configs/linux-osmesa32
+++ b/configs/linux-osmesa32
@@ -17,7 +17,7 @@ OSMESA_LIB_NAME = libOSMesa32.so
# Directories
-SRC_DIRS = mesa glu
+SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
PROGRAM_DIRS =
diff --git a/configs/linux-solo b/configs/linux-solo
index 220fe58b9a..d49b972228 100644
--- a/configs/linux-solo
+++ b/configs/linux-solo
@@ -43,7 +43,7 @@ GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
-SRC_DIRS = glx/mini mesa glu glut/mini
+SRC_DIRS = glx/mini gallium mesa glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index 3a1caf15e7..d19abe7e86 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -39,6 +39,7 @@ SOURCES = \
linestrip-stipple-wide.c \
linestrip-stipple.c \
linestrip.c \
+ pgon-mode.c \
point-clip.c \
point-param.c \
point-sprite.c \
diff --git a/progs/trivial/pgon-mode.c b/progs/trivial/pgon-mode.c
new file mode 100644
index 0000000000..db58638619
--- /dev/null
+++ b/progs/trivial/pgon-mode.c
@@ -0,0 +1,136 @@
+/**
+ * Test glPolygonMode.
+ * A tri-strip w/ two tris is drawn so that the first tri is front-facing
+ * but the second tri is back-facing.
+ * Set glPolygonMode differently for the front/back faces
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+static int Win;
+static GLfloat Zrot = 0;
+static GLboolean FrontFillBackUnfilled = GL_TRUE;
+static GLboolean Lines = GL_TRUE;
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (FrontFillBackUnfilled) {
+ if (Lines) {
+ printf("FrontMode = FILL, BackMode = LINE\n");
+ glPolygonMode(GL_BACK, GL_LINE);
+ }
+ else {
+ printf("FrontMode = FILL, BackMode = POINT\n");
+ glPolygonMode(GL_BACK, GL_POINT);
+ }
+ glPolygonMode(GL_FRONT, GL_FILL);
+ }
+ else {
+ if (Lines) {
+ printf("FrontMode = LINE, BackMode = FILL\n");
+ glPolygonMode(GL_FRONT, GL_LINE);
+ }
+ else {
+ printf("FrontMode = POINT, BackMode = FILL\n");
+ glPolygonMode(GL_FRONT, GL_POINT);
+ }
+ glPolygonMode(GL_BACK, GL_FILL);
+ }
+
+ glPushMatrix();
+ glRotatef(Zrot, 0, 0, 1);
+
+ glBegin(GL_TRIANGLE_STRIP);
+ glVertex2f(-1, 0);
+ glVertex2f( 1, 0);
+ glVertex2f(0, 1);
+ glVertex2f(0, -1);
+ glEnd();
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'p':
+ FrontFillBackUnfilled = !FrontFillBackUnfilled;
+ break;
+ case 'l':
+ Lines = !Lines;
+ break;
+ case 'z':
+ Zrot -= step;
+ break;
+ case 'Z':
+ Zrot += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ printf("GL_RENDERER = %s\n", (char*) glGetString(GL_RENDERER));
+
+ glLineWidth(3.0);
+ glPointSize(3.0);
+
+ glColor4f(1, 1, 1, 0.8);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ printf("Press 'p' to toggle polygon mode\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/src/gallium/Makefile b/src/gallium/Makefile
new file mode 100644
index 0000000000..a13b9a52d3
--- /dev/null
+++ b/src/gallium/Makefile
@@ -0,0 +1,20 @@
+TOP = ../..
+include $(TOP)/configs/current
+
+
+SUBDIRS = aux drivers
+
+
+default: subdirs
+
+
+subdirs:
+ @for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE)) || exit 1 ; \
+ fi \
+ done
+
+
+clean:
+ rm -f `find . -name \*.[oa]`
diff --git a/src/mesa/pipe/Makefile.template b/src/gallium/Makefile.template
index 8e84f8eb2d..0717ed8dd2 100644
--- a/src/mesa/pipe/Makefile.template
+++ b/src/gallium/Makefile.template
@@ -15,7 +15,10 @@ OBJECTS = $(C_SOURCES:.c=.o) \
### Include directories
INCLUDES = \
-I. \
- -I$(TOP)/src/mesa/pipe \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/include/pipe \
+ -I$(TOP)/src/gallium/aux \
+ -I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/mesa \
-I$(TOP)/include \
$(DRIVER_INCLUDES)
@@ -38,7 +41,7 @@ INCLUDES = \
default: depend symlinks $(LIBNAME)
-$(LIBNAME): $(OBJECTS) Makefile $(TOP)/src/mesa/pipe/Makefile.template
+$(LIBNAME): $(OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
$(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS)
diff --git a/src/mesa/pipe/README.portability b/src/gallium/README.portability
index c70ca774da..c70ca774da 100644
--- a/src/mesa/pipe/README.portability
+++ b/src/gallium/README.portability
diff --git a/src/mesa/pipe/SConscript b/src/gallium/SConscript
index d9c20e0100..d9c20e0100 100644
--- a/src/mesa/pipe/SConscript
+++ b/src/gallium/SConscript
diff --git a/src/gallium/aux/Makefile b/src/gallium/aux/Makefile
new file mode 100644
index 0000000000..da68498aa1
--- /dev/null
+++ b/src/gallium/aux/Makefile
@@ -0,0 +1,24 @@
+TOP = ../../..
+include $(TOP)/configs/current
+
+
+ifeq ($(CONFIG_NAME), linux-llvm)
+LLVM_DIR = llvm
+endif
+
+SUBDIRS = pipebuffer $(LLVM_DIR)
+
+
+default: subdirs
+
+
+subdirs:
+ @for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE)) || exit 1 ; \
+ fi \
+ done
+
+
+clean:
+ rm -f `find . -name \*.[oa]`
diff --git a/src/mesa/pipe/cso_cache/cso_cache.c b/src/gallium/aux/cso_cache/cso_cache.c
index 9e77e0774d..9e77e0774d 100644
--- a/src/mesa/pipe/cso_cache/cso_cache.c
+++ b/src/gallium/aux/cso_cache/cso_cache.c
diff --git a/src/mesa/pipe/cso_cache/cso_cache.h b/src/gallium/aux/cso_cache/cso_cache.h
index 116e2eaa2c..116e2eaa2c 100644
--- a/src/mesa/pipe/cso_cache/cso_cache.h
+++ b/src/gallium/aux/cso_cache/cso_cache.h
diff --git a/src/mesa/pipe/cso_cache/cso_hash.c b/src/gallium/aux/cso_cache/cso_hash.c
index 0338cb3b47..0338cb3b47 100644
--- a/src/mesa/pipe/cso_cache/cso_hash.c
+++ b/src/gallium/aux/cso_cache/cso_hash.c
diff --git a/src/mesa/pipe/cso_cache/cso_hash.h b/src/gallium/aux/cso_cache/cso_hash.h
index b4aa111860..b4aa111860 100644
--- a/src/mesa/pipe/cso_cache/cso_hash.h
+++ b/src/gallium/aux/cso_cache/cso_hash.h
diff --git a/src/mesa/pipe/draw/Makefile b/src/gallium/aux/draw/Makefile
index 451911a354..451911a354 100644
--- a/src/mesa/pipe/draw/Makefile
+++ b/src/gallium/aux/draw/Makefile
diff --git a/src/mesa/pipe/draw/draw_clip.c b/src/gallium/aux/draw/draw_clip.c
index 61130c5600..e3051507ea 100644
--- a/src/mesa/pipe/draw/draw_clip.c
+++ b/src/gallium/aux/draw/draw_clip.c
@@ -459,7 +459,7 @@ static void clip_reset_stipple_counter( struct draw_stage *stage )
static void clip_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -472,7 +472,7 @@ struct draw_stage *draw_clip_stage( struct draw_context *draw )
{
struct clipper *clipper = CALLOC_STRUCT(clipper);
- draw_alloc_tmps( &clipper->stage, MAX_CLIPPED_VERTICES+1 );
+ draw_alloc_temp_verts( &clipper->stage, MAX_CLIPPED_VERTICES+1 );
clipper->stage.draw = draw;
clipper->stage.point = clip_point;
diff --git a/src/mesa/pipe/draw/draw_context.c b/src/gallium/aux/draw/draw_context.c
index b15f57c824..4be3830316 100644
--- a/src/mesa/pipe/draw/draw_context.c
+++ b/src/gallium/aux/draw/draw_context.c
@@ -242,7 +242,7 @@ draw_convert_wide_lines(struct draw_context *draw, boolean enable)
/**
* Allocate space for temporary post-transform vertices, such as for clipping.
*/
-void draw_alloc_tmps( struct draw_stage *stage, unsigned nr )
+void draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr )
{
assert(!stage->tmp);
@@ -260,7 +260,7 @@ void draw_alloc_tmps( struct draw_stage *stage, unsigned nr )
}
-void draw_free_tmps( struct draw_stage *stage )
+void draw_free_temp_verts( struct draw_stage *stage )
{
if (stage->tmp) {
FREE( stage->tmp[0] );
diff --git a/src/mesa/pipe/draw/draw_context.h b/src/gallium/aux/draw/draw_context.h
index ddeb184497..ddeb184497 100644
--- a/src/mesa/pipe/draw/draw_context.h
+++ b/src/gallium/aux/draw/draw_context.h
diff --git a/src/mesa/pipe/draw/draw_cull.c b/src/gallium/aux/draw/draw_cull.c
index 05c274e4dc..8177b0ac86 100644
--- a/src/mesa/pipe/draw/draw_cull.c
+++ b/src/gallium/aux/draw/draw_cull.c
@@ -123,7 +123,7 @@ static void cull_reset_stipple_counter( struct draw_stage *stage )
static void cull_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -135,7 +135,7 @@ struct draw_stage *draw_cull_stage( struct draw_context *draw )
{
struct cull_stage *cull = CALLOC_STRUCT(cull_stage);
- draw_alloc_tmps( &cull->stage, 0 );
+ draw_alloc_temp_verts( &cull->stage, 0 );
cull->stage.draw = draw;
cull->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_debug.c b/src/gallium/aux/draw/draw_debug.c
index d6220b5f62..d6220b5f62 100644
--- a/src/mesa/pipe/draw/draw_debug.c
+++ b/src/gallium/aux/draw/draw_debug.c
diff --git a/src/mesa/pipe/draw/draw_flatshade.c b/src/gallium/aux/draw/draw_flatshade.c
index 1419f287d2..4398abbc60 100644
--- a/src/mesa/pipe/draw/draw_flatshade.c
+++ b/src/gallium/aux/draw/draw_flatshade.c
@@ -176,7 +176,7 @@ static void flatshade_reset_stipple_counter( struct draw_stage *stage )
static void flatshade_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -188,7 +188,7 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw )
{
struct flat_stage *flatshade = CALLOC_STRUCT(flat_stage);
- draw_alloc_tmps( &flatshade->stage, 2 );
+ draw_alloc_temp_verts( &flatshade->stage, 2 );
flatshade->stage.draw = draw;
flatshade->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_offset.c b/src/gallium/aux/draw/draw_offset.c
index a2990ee8a8..dbc676deae 100644
--- a/src/mesa/pipe/draw/draw_offset.c
+++ b/src/gallium/aux/draw/draw_offset.c
@@ -159,7 +159,7 @@ static void offset_reset_stipple_counter( struct draw_stage *stage )
static void offset_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -171,7 +171,7 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw )
{
struct offset_stage *offset = CALLOC_STRUCT(offset_stage);
- draw_alloc_tmps( &offset->stage, 3 );
+ draw_alloc_temp_verts( &offset->stage, 3 );
offset->stage.draw = draw;
offset->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_prim.c b/src/gallium/aux/draw/draw_prim.c
index 51e2242719..51e2242719 100644
--- a/src/mesa/pipe/draw/draw_prim.c
+++ b/src/gallium/aux/draw/draw_prim.c
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/gallium/aux/draw/draw_private.h
index 7782db0477..3d09aef87c 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/gallium/aux/draw/draw_private.h
@@ -45,7 +45,7 @@
#include "pipe/p_defines.h"
#include "x86/rtasm/x86sse.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_exec.h"
struct gallivm_prog;
@@ -276,9 +276,9 @@ extern struct draw_stage *draw_wide_stage( struct draw_context *context );
extern struct draw_stage *draw_validate_stage( struct draw_context *context );
-extern void draw_free_tmps( struct draw_stage *stage );
-extern void draw_reset_tmps( struct draw_stage *stage );
-extern void draw_alloc_tmps( struct draw_stage *stage, unsigned nr );
+extern void draw_free_temp_verts( struct draw_stage *stage );
+
+extern void draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr );
extern void draw_reset_vertex_ids( struct draw_context *draw );
diff --git a/src/mesa/pipe/draw/draw_stipple.c b/src/gallium/aux/draw/draw_stipple.c
index 9029101916..506f33512c 100644
--- a/src/mesa/pipe/draw/draw_stipple.c
+++ b/src/gallium/aux/draw/draw_stipple.c
@@ -212,6 +212,7 @@ passthrough_tri(struct draw_stage *stage, struct prim_header *header)
static void
stipple_destroy( struct draw_stage *stage )
{
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -223,7 +224,7 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw )
{
struct stipple_stage *stipple = CALLOC_STRUCT(stipple_stage);
- draw_alloc_tmps( &stipple->stage, 2 );
+ draw_alloc_temp_verts( &stipple->stage, 2 );
stipple->stage.draw = draw;
stipple->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_twoside.c b/src/gallium/aux/draw/draw_twoside.c
index ad2aaf10bb..1c38957987 100644
--- a/src/mesa/pipe/draw/draw_twoside.c
+++ b/src/gallium/aux/draw/draw_twoside.c
@@ -176,7 +176,7 @@ static void twoside_reset_stipple_counter( struct draw_stage *stage )
static void twoside_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -188,7 +188,7 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw )
{
struct twoside_stage *twoside = CALLOC_STRUCT(twoside_stage);
- draw_alloc_tmps( &twoside->stage, 3 );
+ draw_alloc_temp_verts( &twoside->stage, 3 );
twoside->stage.draw = draw;
twoside->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_unfilled.c b/src/gallium/aux/draw/draw_unfilled.c
index 364bda8b79..8777cfdfc8 100644
--- a/src/mesa/pipe/draw/draw_unfilled.c
+++ b/src/gallium/aux/draw/draw_unfilled.c
@@ -165,6 +165,8 @@ static void unfilled_flush( struct draw_stage *stage,
unsigned flags )
{
stage->next->flush( stage->next, flags );
+
+ stage->tri = unfilled_first_tri;
}
@@ -176,7 +178,7 @@ static void unfilled_reset_stipple_counter( struct draw_stage *stage )
static void unfilled_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -188,7 +190,7 @@ struct draw_stage *draw_unfilled_stage( struct draw_context *draw )
{
struct unfilled_stage *unfilled = CALLOC_STRUCT(unfilled_stage);
- draw_alloc_tmps( &unfilled->stage, 0 );
+ draw_alloc_temp_verts( &unfilled->stage, 0 );
unfilled->stage.draw = draw;
unfilled->stage.next = NULL;
diff --git a/src/mesa/pipe/draw/draw_validate.c b/src/gallium/aux/draw/draw_validate.c
index 4375ebabbc..4375ebabbc 100644
--- a/src/mesa/pipe/draw/draw_validate.c
+++ b/src/gallium/aux/draw/draw_validate.c
diff --git a/src/mesa/pipe/draw/draw_vbuf.c b/src/gallium/aux/draw/draw_vbuf.c
index be96c8fdeb..71ac73912b 100644
--- a/src/mesa/pipe/draw/draw_vbuf.c
+++ b/src/gallium/aux/draw/draw_vbuf.c
@@ -523,6 +523,9 @@ static void vbuf_destroy( struct draw_stage *stage )
if(vbuf->vf)
draw_vf_destroy( vbuf->vf );
+ if (vbuf->render)
+ vbuf->render->destroy( vbuf->render );
+
FREE( stage );
}
diff --git a/src/mesa/pipe/draw/draw_vbuf.h b/src/gallium/aux/draw/draw_vbuf.h
index cfd2b9820c..cfd2b9820c 100644
--- a/src/mesa/pipe/draw/draw_vbuf.h
+++ b/src/gallium/aux/draw/draw_vbuf.h
diff --git a/src/mesa/pipe/draw/draw_vertex.c b/src/gallium/aux/draw/draw_vertex.c
index 2d6592150f..daf1ef4b80 100644
--- a/src/mesa/pipe/draw/draw_vertex.c
+++ b/src/gallium/aux/draw/draw_vertex.c
@@ -34,8 +34,8 @@
*/
-#include "pipe/draw/draw_private.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_private.h"
+#include "draw/draw_vertex.h"
/**
diff --git a/src/mesa/pipe/draw/draw_vertex.h b/src/gallium/aux/draw/draw_vertex.h
index dfc637b19b..267c74203b 100644
--- a/src/mesa/pipe/draw/draw_vertex.h
+++ b/src/gallium/aux/draw/draw_vertex.h
@@ -25,7 +25,12 @@
*
**************************************************************************/
-/* Author:
+/**
+ * Post-transform vertex format info. The vertex_info struct is used by
+ * the draw_vbuf code to emit hardware-specific vertex layouts into hw
+ * vertex buffers.
+ *
+ * Author:
* Brian Paul
*/
diff --git a/src/mesa/pipe/draw/draw_vertex_cache.c b/src/gallium/aux/draw/draw_vertex_cache.c
index 44427999cc..44427999cc 100644
--- a/src/mesa/pipe/draw/draw_vertex_cache.c
+++ b/src/gallium/aux/draw/draw_vertex_cache.c
diff --git a/src/mesa/pipe/draw/draw_vertex_fetch.c b/src/gallium/aux/draw/draw_vertex_fetch.c
index e13df04605..e13df04605 100644
--- a/src/mesa/pipe/draw/draw_vertex_fetch.c
+++ b/src/gallium/aux/draw/draw_vertex_fetch.c
diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/gallium/aux/draw/draw_vertex_shader.c
index bf340ef9b0..9413f8b43a 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader.c
+++ b/src/gallium/aux/draw/draw_vertex_shader.c
@@ -34,13 +34,13 @@
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#if defined(__i386__) || defined(__386__)
-#include "pipe/tgsi/exec/tgsi_sse2.h"
+#include "tgsi/exec/tgsi_sse2.h"
#endif
#include "draw_private.h"
#include "draw_context.h"
#include "x86/rtasm/x86sse.h"
-#include "pipe/llvm/gallivm.h"
+#include "llvm/gallivm.h"
#define DBG_VS 0
diff --git a/src/mesa/pipe/draw/draw_vf.c b/src/gallium/aux/draw/draw_vf.c
index f23d7fcec5..dc3a5ecd21 100644
--- a/src/mesa/pipe/draw/draw_vf.c
+++ b/src/gallium/aux/draw/draw_vf.c
@@ -370,7 +370,7 @@ void draw_vf_emit_vertex( struct draw_vertex_fetch *vf,
unsigned j;
for (j = 0; j < vf->attr_count; j++) {
- if(!a[j].isconst) {
+ if (!a[j].isconst) {
a[j].inputptr = (uint8_t *)&vertex->data[a[j].attrib][0];
a[j].inputstride = 0; /* XXX: one-vertex-max ATM */
}
diff --git a/src/mesa/pipe/draw/draw_vf.h b/src/gallium/aux/draw/draw_vf.h
index e694b98675..011c8f0ff1 100644
--- a/src/mesa/pipe/draw/draw_vf.h
+++ b/src/gallium/aux/draw/draw_vf.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Tungsten Graphics, inc.
+ * Copyright 2008 Tungsten Graphics, inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -20,6 +20,17 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * Vertex fetch/store/convert code. This functionality is used in two places:
+ * 1. Vertex fetch/convert - to grab vertex data from incoming vertex
+ * arrays and convert to format needed by vertex shaders.
+ * 2. Vertex store/emit - to convert simple float[][4] vertex attributes
+ * (which is the organization used throughout the draw/prim pipeline) to
+ * hardware-specific formats and emit into hardware vertex buffers.
+ *
*
* Authors:
* Keith Whitwell <keithw@tungstengraphics.com>
@@ -33,7 +44,7 @@
#include "pipe/p_state.h"
#include "draw_vertex.h"
-#include "draw_private.h" // for vertex_header
+#include "draw_private.h" /* for vertex_header */
enum draw_vf_attr_format {
@@ -181,6 +192,7 @@ struct draw_vf_attr_type {
unsigned offset;
};
+/** XXX this could be moved into draw_vf.c */
struct draw_vf_fastpath {
unsigned vertex_stride;
unsigned attr_count;
@@ -209,6 +221,7 @@ void
draw_vf_generate_sse_emit( struct draw_vertex_fetch *vf );
+/** XXX this type and function could probably be moved into draw_vf.c */
struct draw_vf_format_info {
const char *name;
draw_vf_insert_func insert[4];
diff --git a/src/mesa/pipe/draw/draw_vf_generic.c b/src/gallium/aux/draw/draw_vf_generic.c
index 7a60a9db9c..7a60a9db9c 100644
--- a/src/mesa/pipe/draw/draw_vf_generic.c
+++ b/src/gallium/aux/draw/draw_vf_generic.c
diff --git a/src/mesa/pipe/draw/draw_vf_sse.c b/src/gallium/aux/draw/draw_vf_sse.c
index 1ad2ae756d..1ad2ae756d 100644
--- a/src/mesa/pipe/draw/draw_vf_sse.c
+++ b/src/gallium/aux/draw/draw_vf_sse.c
diff --git a/src/mesa/pipe/draw/draw_wide_prims.c b/src/gallium/aux/draw/draw_wide_prims.c
index 4c7e279b20..655774b155 100644
--- a/src/mesa/pipe/draw/draw_wide_prims.c
+++ b/src/gallium/aux/draw/draw_wide_prims.c
@@ -175,7 +175,7 @@ static void wide_line_aa(struct draw_stage *stage,
float *pos;
float dx = header->v[1]->data[0][0] - header->v[0]->data[0][0];
float dy = header->v[1]->data[0][1] - header->v[0]->data[0][1];
- const float len = sqrt(dx * dx + dy * dy);
+ const float len = (float) sqrt(dx * dx + dy * dy);
uint i;
dx = dx * half_width / len;
@@ -400,7 +400,7 @@ static void wide_flush( struct draw_stage *stage, unsigned flags )
}
-static void draw_reset_stipple_counter( struct draw_stage *stage )
+static void wide_reset_stipple_counter( struct draw_stage *stage )
{
stage->next->reset_stipple_counter( stage->next );
}
@@ -408,7 +408,7 @@ static void draw_reset_stipple_counter( struct draw_stage *stage )
static void wide_destroy( struct draw_stage *stage )
{
- draw_free_tmps( stage );
+ draw_free_temp_verts( stage );
FREE( stage );
}
@@ -417,7 +417,7 @@ struct draw_stage *draw_wide_stage( struct draw_context *draw )
{
struct wide_stage *wide = CALLOC_STRUCT(wide_stage);
- draw_alloc_tmps( &wide->stage, 4 );
+ draw_alloc_temp_verts( &wide->stage, 4 );
wide->stage.draw = draw;
wide->stage.next = NULL;
@@ -425,7 +425,7 @@ struct draw_stage *draw_wide_stage( struct draw_context *draw )
wide->stage.line = wide_first_line;
wide->stage.tri = passthrough_tri;
wide->stage.flush = wide_flush;
- wide->stage.reset_stipple_counter = draw_reset_stipple_counter;
+ wide->stage.reset_stipple_counter = wide_reset_stipple_counter;
wide->stage.destroy = wide_destroy;
return &wide->stage;
diff --git a/src/mesa/pipe/llvm/Makefile b/src/gallium/aux/llvm/Makefile
index a0494ba966..e6ac399d08 100644
--- a/src/mesa/pipe/llvm/Makefile
+++ b/src/gallium/aux/llvm/Makefile
@@ -15,7 +15,7 @@ GALLIVM_SOURCES = \
storagesoa.cpp \
instructionssoa.cpp
-INC_SOURCES = gallivm_builtins.cpp llvm_base_shader.cpp
+INC_SOURCES = gallivm_builtins.cpp
CPP_SOURCES = \
$(GALLIVM_SOURCES)
@@ -30,7 +30,9 @@ OBJECTS = $(C_SOURCES:.c=.o) \
### Include directories
INCLUDES = \
-I. \
- -I$(TOP)/src/mesa/pipe \
+ -I$(TOP)/src/gallium/drivers
+ -I$(TOP)/src/gallium/aux \
+ -I$(TOP)/src/gallium/include \
-I$(TOP)/src/mesa \
-I$(TOP)/include
@@ -65,8 +67,6 @@ depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(INC_SOURCES)
gallivm_builtins.cpp: llvm_builtins.c
clang --emit-llvm $< |llvm-as|opt -std-compile-opts|llvm2cpp -gen-contents -o=$@ -f -for=shader -funcname=createGallivmBuiltins
-llvm_base_shader.cpp: llvm_entry.c
- clang --emit-llvm $< |llvm-as |opt -std-compile-opts |llvm2cpp -for=Shader -gen-module -o=$@ -f -funcname=createBaseShader
# Emacs tags
tags:
@@ -77,7 +77,7 @@ tags:
clean:
-rm -f *.o */*.o *~ *.so *~ server/*.o
-rm -f depend depend.bak
- -rm -f gallivm_builtins.cpp llvm_base_shader.cpp
+ -rm -f gallivm_builtins.cpp
symlinks:
diff --git a/src/mesa/pipe/llvm/gallivm.cpp b/src/gallium/aux/llvm/gallivm.cpp
index da0105c2c9..d14bb3b99a 100644
--- a/src/mesa/pipe/llvm/gallivm.cpp
+++ b/src/gallium/aux/llvm/gallivm.cpp
@@ -42,8 +42,8 @@
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/util/tgsi_dump.h"
#include <llvm/Module.h>
#include <llvm/CallingConv.h>
diff --git a/src/mesa/pipe/llvm/gallivm.h b/src/gallium/aux/llvm/gallivm.h
index 92da4bca7f..92da4bca7f 100644
--- a/src/mesa/pipe/llvm/gallivm.h
+++ b/src/gallium/aux/llvm/gallivm.h
diff --git a/src/mesa/pipe/llvm/gallivm_builtins.cpp b/src/gallium/aux/llvm/gallivm_builtins.cpp
index 1796f0a177..1796f0a177 100644
--- a/src/mesa/pipe/llvm/gallivm_builtins.cpp
+++ b/src/gallium/aux/llvm/gallivm_builtins.cpp
diff --git a/src/mesa/pipe/llvm/gallivm_cpu.cpp b/src/gallium/aux/llvm/gallivm_cpu.cpp
index dc4d92a72a..8f9830d0b1 100644
--- a/src/mesa/pipe/llvm/gallivm_cpu.cpp
+++ b/src/gallium/aux/llvm/gallivm_cpu.cpp
@@ -42,8 +42,8 @@
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/util/tgsi_dump.h"
#include <llvm/Module.h>
#include <llvm/CallingConv.h>
diff --git a/src/mesa/pipe/llvm/gallivm_p.h b/src/gallium/aux/llvm/gallivm_p.h
index cfe7b1901b..cfe7b1901b 100644
--- a/src/mesa/pipe/llvm/gallivm_p.h
+++ b/src/gallium/aux/llvm/gallivm_p.h
diff --git a/src/mesa/pipe/llvm/instructions.cpp b/src/gallium/aux/llvm/instructions.cpp
index 55d39fa5f1..55d39fa5f1 100644
--- a/src/mesa/pipe/llvm/instructions.cpp
+++ b/src/gallium/aux/llvm/instructions.cpp
diff --git a/src/mesa/pipe/llvm/instructions.h b/src/gallium/aux/llvm/instructions.h
index 9ebc17dd8e..9ebc17dd8e 100644
--- a/src/mesa/pipe/llvm/instructions.h
+++ b/src/gallium/aux/llvm/instructions.h
diff --git a/src/gallium/aux/llvm/instructionssoa.cpp b/src/gallium/aux/llvm/instructionssoa.cpp
new file mode 100644
index 0000000000..a4d5046637
--- /dev/null
+++ b/src/gallium/aux/llvm/instructionssoa.cpp
@@ -0,0 +1,121 @@
+#include "instructionssoa.h"
+
+#include "storagesoa.h"
+
+#include <llvm/Constants.h>
+
+using namespace llvm;
+
+InstructionsSoa::InstructionsSoa(llvm::Module *mod, llvm::Function *func,
+ llvm::BasicBlock *block, StorageSoa *storage)
+ : m_builder(block),
+ m_storage(storage),
+ m_idx(0)
+{
+}
+
+const char * InstructionsSoa::name(const char *prefix) const
+{
+ ++m_idx;
+ snprintf(m_name, 32, "%s%d", prefix, m_idx);
+ return m_name;
+}
+
+llvm::Value * InstructionsSoa::vectorFromVals(llvm::Value *x, llvm::Value *y,
+ llvm::Value *z, llvm::Value *w)
+{
+ VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
+ Constant *constVector = Constant::getNullValue(vectorType);
+ Value *res = m_builder.CreateInsertElement(constVector, x,
+ m_storage->constantInt(0),
+ name("vecx"));
+ res = m_builder.CreateInsertElement(res, y, m_storage->constantInt(1),
+ name("vecxy"));
+ res = m_builder.CreateInsertElement(res, z, m_storage->constantInt(2),
+ name("vecxyz"));
+ if (w)
+ res = m_builder.CreateInsertElement(res, w, m_storage->constantInt(3),
+ name("vecxyzw"));
+ return res;
+}
+
+std::vector<llvm::Value*> InstructionsSoa::arl(const std::vector<llvm::Value*> in)
+{
+ std::vector<llvm::Value*> res(4);
+
+ //Extract x's
+ llvm::Value *x1 = m_builder.CreateExtractElement(in[0],
+ m_storage->constantInt(0),
+ name("extractX"));
+ //cast it to an unsigned int
+ x1 = m_builder.CreateFPToUI(x1, IntegerType::get(32), name("x1IntCast"));
+
+ res[0] = x1;//vectorFromVals(x1, x2, x3, x4);
+ //only x is valid. the others shouldn't be necessary
+ /*
+ res[1] = Constant::getNullValue(m_floatVecType);
+ res[2] = Constant::getNullValue(m_floatVecType);
+ res[3] = Constant::getNullValue(m_floatVecType);
+ */
+
+ return res;
+}
+
+
+std::vector<llvm::Value*> InstructionsSoa::add(const std::vector<llvm::Value*> in1,
+ const std::vector<llvm::Value*> in2)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = m_builder.CreateAdd(in1[0], in2[0], name("addx"));
+ res[1] = m_builder.CreateAdd(in1[1], in2[1], name("addy"));
+ res[2] = m_builder.CreateAdd(in1[2], in2[2], name("addz"));
+ res[3] = m_builder.CreateAdd(in1[3], in2[3], name("addw"));
+
+ return res;
+}
+
+std::vector<llvm::Value*> InstructionsSoa::mul(const std::vector<llvm::Value*> in1,
+ const std::vector<llvm::Value*> in2)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = m_builder.CreateMul(in1[0], in2[0], name("mulx"));
+ res[1] = m_builder.CreateMul(in1[1], in2[1], name("muly"));
+ res[2] = m_builder.CreateMul(in1[2], in2[2], name("mulz"));
+ res[3] = m_builder.CreateMul(in1[3], in2[3], name("mulw"));
+
+ return res;
+}
+
+void InstructionsSoa::end()
+{
+ m_builder.CreateRetVoid();
+}
+
+std::vector<llvm::Value*> InstructionsSoa::madd(const std::vector<llvm::Value*> in1,
+ const std::vector<llvm::Value*> in2,
+ const std::vector<llvm::Value*> in3)
+{
+ std::vector<llvm::Value*> res = mul(in1, in2);
+ return add(res, in3);
+}
+
+std::vector<llvm::Value*> InstructionsSoa::extractVector(llvm::Value *vector)
+{
+ std::vector<llvm::Value*> res(4);
+ res[0] = m_builder.CreateExtractElement(vector,
+ m_storage->constantInt(0),
+ name("extract1X"));
+ res[1] = m_builder.CreateExtractElement(vector,
+ m_storage->constantInt(1),
+ name("extract2X"));
+ res[2] = m_builder.CreateExtractElement(vector,
+ m_storage->constantInt(2),
+ name("extract3X"));
+ res[3] = m_builder.CreateExtractElement(vector,
+ m_storage->constantInt(3),
+ name("extract4X"));
+
+ return res;
+}
diff --git a/src/mesa/pipe/llvm/instructionssoa.h b/src/gallium/aux/llvm/instructionssoa.h
index 0195501584..4169dcbb2e 100644
--- a/src/mesa/pipe/llvm/instructionssoa.h
+++ b/src/gallium/aux/llvm/instructionssoa.h
@@ -46,17 +46,25 @@ public:
InstructionsSoa(llvm::Module *mod, llvm::Function *func,
llvm::BasicBlock *block, StorageSoa *storage);
+ std::vector<llvm::Value*> arl(const std::vector<llvm::Value*> in);
+
std::vector<llvm::Value*> add(const std::vector<llvm::Value*> in1,
const std::vector<llvm::Value*> in2);
+ std::vector<llvm::Value*> madd(const std::vector<llvm::Value*> in1,
+ const std::vector<llvm::Value*> in2,
+ const std::vector<llvm::Value*> in3);
std::vector<llvm::Value*> mul(const std::vector<llvm::Value*> in1,
const std::vector<llvm::Value*> in2);
void end();
+ std::vector<llvm::Value*> extractVector(llvm::Value *vector);
private:
const char * name(const char *prefix) const;
+ llvm::Value *vectorFromVals(llvm::Value *x, llvm::Value *y,
+ llvm::Value *z, llvm::Value *w);
private:
llvm::LLVMFoldingBuilder m_builder;
-
+ StorageSoa *m_storage;
private:
mutable int m_idx;
mutable char m_name[32];
diff --git a/src/mesa/pipe/llvm/llvm_builtins.c b/src/gallium/aux/llvm/llvm_builtins.c
index 4f98d754ba..4f98d754ba 100644
--- a/src/mesa/pipe/llvm/llvm_builtins.c
+++ b/src/gallium/aux/llvm/llvm_builtins.c
diff --git a/src/mesa/pipe/llvm/loweringpass.cpp b/src/gallium/aux/llvm/loweringpass.cpp
index 556dbec366..556dbec366 100644
--- a/src/mesa/pipe/llvm/loweringpass.cpp
+++ b/src/gallium/aux/llvm/loweringpass.cpp
diff --git a/src/mesa/pipe/llvm/loweringpass.h b/src/gallium/aux/llvm/loweringpass.h
index f62dcf6ba7..f62dcf6ba7 100644
--- a/src/mesa/pipe/llvm/loweringpass.h
+++ b/src/gallium/aux/llvm/loweringpass.h
diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/gallium/aux/llvm/storage.cpp
index c4326de8c5..c4326de8c5 100644
--- a/src/mesa/pipe/llvm/storage.cpp
+++ b/src/gallium/aux/llvm/storage.cpp
diff --git a/src/mesa/pipe/llvm/storage.h b/src/gallium/aux/llvm/storage.h
index 8574f7554e..8574f7554e 100644
--- a/src/mesa/pipe/llvm/storage.h
+++ b/src/gallium/aux/llvm/storage.h
diff --git a/src/gallium/aux/llvm/storagesoa.cpp b/src/gallium/aux/llvm/storagesoa.cpp
new file mode 100644
index 0000000000..ed0674a96f
--- /dev/null
+++ b/src/gallium/aux/llvm/storagesoa.cpp
@@ -0,0 +1,389 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "storagesoa.h"
+
+#include "gallivm_p.h"
+
+#include "pipe/p_shader_tokens.h"
+#include "pipe/p_debug.h"
+
+#include <llvm/BasicBlock.h>
+#include <llvm/Module.h>
+#include <llvm/Value.h>
+
+#include <llvm/CallingConv.h>
+#include <llvm/Constants.h>
+#include <llvm/DerivedTypes.h>
+#include <llvm/InstrTypes.h>
+#include <llvm/Instructions.h>
+
+using namespace llvm;
+
+
+StorageSoa::StorageSoa(llvm::BasicBlock *block,
+ llvm::Value *input,
+ llvm::Value *output,
+ llvm::Value *consts,
+ llvm::Value *temps)
+ : m_block(block),
+ m_input(input),
+ m_output(output),
+ m_consts(consts),
+ m_temps(temps),
+ m_immediates(0),
+ m_idx(0)
+{
+}
+
+void StorageSoa::addImmediate(float *vec)
+{
+ std::vector<float> vals(4);
+ vals[0] = vec[0];
+ vals[1] = vec[1];
+ vals[2] = vec[2];
+ vals[3] = vec[3];
+ m_immediatesToFlush.push_back(vals);
+}
+
+void StorageSoa::declareImmediates()
+{
+ if (m_immediatesToFlush.empty())
+ return;
+
+ VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
+ ArrayType *vectorChannels = ArrayType::get(vectorType, 4);
+ ArrayType *arrayType = ArrayType::get(vectorChannels, m_immediatesToFlush.size());
+
+ m_immediates = new GlobalVariable(
+ /*Type=*/arrayType,
+ /*isConstant=*/false,
+ /*Linkage=*/GlobalValue::ExternalLinkage,
+ /*Initializer=*/0, // has initializer, specified below
+ /*Name=*/name("immediates"),
+ currentModule());
+
+ std::vector<Constant*> arrayVals;
+ for (unsigned int i = 0; i < m_immediatesToFlush.size(); ++i) {
+ std::vector<float> vec = m_immediatesToFlush[i];
+ std::vector<float> vals(4);
+ std::vector<Constant*> channelArray;
+
+ vals[0] = vec[0]; vals[1] = vec[0]; vals[2] = vec[0]; vals[3] = vec[0];
+ llvm::Constant *xChannel = createConstGlobalVector(vals);
+
+ vals[0] = vec[1]; vals[1] = vec[1]; vals[2] = vec[1]; vals[3] = vec[1];
+ llvm::Constant *yChannel = createConstGlobalVector(vals);
+
+ vals[0] = vec[2]; vals[1] = vec[2]; vals[2] = vec[2]; vals[3] = vec[2];
+ llvm::Constant *zChannel = createConstGlobalVector(vals);
+
+ vals[0] = vec[3]; vals[1] = vec[3]; vals[2] = vec[3]; vals[3] = vec[3];
+ llvm::Constant *wChannel = createConstGlobalVector(vals);
+ channelArray.push_back(xChannel);
+ channelArray.push_back(yChannel);
+ channelArray.push_back(zChannel);
+ channelArray.push_back(wChannel);
+ Constant *constChannels = ConstantArray::get(vectorChannels,
+ channelArray);
+ arrayVals.push_back(constChannels);
+ }
+ Constant *constArray = ConstantArray::get(arrayType, arrayVals);
+ m_immediates->setInitializer(constArray);
+
+ m_immediatesToFlush.clear();
+}
+
+llvm::Value *StorageSoa::addrElement(int idx) const
+{
+ std::map<int, llvm::Value*>::const_iterator itr = m_addresses.find(idx);
+ if (itr == m_addresses.end()) {
+ debug_printf("Trying to access invalid shader 'address'\n");
+ return 0;
+ }
+ llvm::Value * res = (*itr).second;
+
+ res = new LoadInst(res, name("addr"), false, m_block);
+
+ return res;
+}
+
+std::vector<llvm::Value*> StorageSoa::inputElement(llvm::Value *idx)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = element(m_input, idx, 0);
+ res[1] = element(m_input, idx, 1);
+ res[2] = element(m_input, idx, 2);
+ res[3] = element(m_input, idx, 3);
+
+ return res;
+}
+
+std::vector<llvm::Value*> StorageSoa::constElement(llvm::Value *idx)
+{
+ std::vector<llvm::Value*> res(4);
+ llvm::Value *xChannel, *yChannel, *zChannel, *wChannel;
+
+ xChannel = elementPointer(m_consts, idx, 0);
+ yChannel = elementPointer(m_consts, idx, 1);
+ zChannel = elementPointer(m_consts, idx, 2);
+ wChannel = elementPointer(m_consts, idx, 3);
+
+ res[0] = alignedArrayLoad(xChannel);
+ res[1] = alignedArrayLoad(yChannel);
+ res[2] = alignedArrayLoad(zChannel);
+ res[3] = alignedArrayLoad(wChannel);
+
+ return res;
+}
+
+std::vector<llvm::Value*> StorageSoa::outputElement(llvm::Value *idx)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = element(m_output, idx, 0);
+ res[1] = element(m_output, idx, 1);
+ res[2] = element(m_output, idx, 2);
+ res[3] = element(m_output, idx, 3);
+
+ return res;
+}
+
+std::vector<llvm::Value*> StorageSoa::tempElement(llvm::Value *idx)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = element(m_temps, idx, 0);
+ res[1] = element(m_temps, idx, 1);
+ res[2] = element(m_temps, idx, 2);
+ res[3] = element(m_temps, idx, 3);
+
+ return res;
+}
+
+std::vector<llvm::Value*> StorageSoa::immediateElement(llvm::Value *idx)
+{
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = element(m_immediates, idx, 0);
+ res[1] = element(m_immediates, idx, 1);
+ res[2] = element(m_immediates, idx, 2);
+ res[3] = element(m_immediates, idx, 3);
+
+ return res;
+}
+
+llvm::Value * StorageSoa::elementPointer(llvm::Value *ptr, llvm::Value *index,
+ int channel) const
+{
+ std::vector<Value*> indices;
+ if (m_immediates == ptr)
+ indices.push_back(constantInt(0));
+ indices.push_back(index);
+ indices.push_back(constantInt(channel));
+
+ GetElementPtrInst *getElem = new GetElementPtrInst(ptr,
+ indices.begin(),
+ indices.end(),
+ name("ptr"),
+ m_block);
+ return getElem;
+}
+
+llvm::Value * StorageSoa::element(llvm::Value *ptr, llvm::Value *index,
+ int channel) const
+{
+ llvm::Value *res = elementPointer(ptr, index, channel);
+ LoadInst *load = new LoadInst(res, name("element"), false, m_block);
+ //load->setAlignment(8);
+ return load;
+}
+
+const char * StorageSoa::name(const char *prefix) const
+{
+ ++m_idx;
+ snprintf(m_name, 32, "%s%d", prefix, m_idx);
+ return m_name;
+}
+
+llvm::ConstantInt * StorageSoa::constantInt(int idx) const
+{
+ if (m_constInts.find(idx) != m_constInts.end()) {
+ return m_constInts[idx];
+ }
+ ConstantInt *constInt = ConstantInt::get(APInt(32, idx));
+ m_constInts[idx] = constInt;
+ return constInt;
+}
+
+llvm::Value *StorageSoa::alignedArrayLoad(llvm::Value *val)
+{
+ VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
+ PointerType *vectorPtr = PointerType::get(vectorType, 0);
+
+ CastInst *cast = new BitCastInst(val, vectorPtr, name("toVector"), m_block);
+ LoadInst *load = new LoadInst(cast, name("alignLoad"), false, m_block);
+ load->setAlignment(8);
+ return load;
+}
+
+llvm::Module * StorageSoa::currentModule() const
+{
+ if (!m_block || !m_block->getParent())
+ return 0;
+
+ return m_block->getParent()->getParent();
+}
+
+llvm::Constant * StorageSoa::createConstGlobalVector(const std::vector<float> &vec)
+{
+ VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
+ std::vector<Constant*> immValues;
+ ConstantFP *constx = ConstantFP::get(Type::FloatTy, APFloat(vec[0]));
+ ConstantFP *consty = ConstantFP::get(Type::FloatTy, APFloat(vec[1]));
+ ConstantFP *constz = ConstantFP::get(Type::FloatTy, APFloat(vec[2]));
+ ConstantFP *constw = ConstantFP::get(Type::FloatTy, APFloat(vec[3]));
+ immValues.push_back(constx);
+ immValues.push_back(consty);
+ immValues.push_back(constz);
+ immValues.push_back(constw);
+ Constant *constVector = ConstantVector::get(vectorType, immValues);
+
+ return constVector;
+}
+
+std::vector<llvm::Value*> StorageSoa::load(Argument type, int idx, int swizzle,
+ llvm::Value *indIdx)
+{
+ std::vector<llvm::Value*> val(4);
+
+ //if we have an indirect index, always use that
+ // if not use the integer offset to create one
+ llvm::Value *realIndex = 0;
+ if (indIdx)
+ realIndex = indIdx;
+ else
+ realIndex = constantInt(idx);
+ debug_printf("XXXXXXXXX realIdx = %p, indIdx = %p\n", realIndex, indIdx);
+
+ switch(type) {
+ case Input:
+ val = inputElement(realIndex);
+ break;
+ case Output:
+ val = outputElement(realIndex);
+ break;
+ case Temp:
+ val = tempElement(realIndex);
+ break;
+ case Const:
+ val = constElement(realIndex);
+ break;
+ case Immediate:
+ val = immediateElement(realIndex);
+ break;
+ case Address:
+ debug_printf("Address not handled in the load phase!\n");
+ assert(0);
+ break;
+ }
+ if (!gallivm_is_swizzle(swizzle))
+ return val;
+
+ std::vector<llvm::Value*> res(4);
+
+ res[0] = val[gallivm_x_swizzle(swizzle)];
+ res[1] = val[gallivm_y_swizzle(swizzle)];
+ res[2] = val[gallivm_z_swizzle(swizzle)];
+ res[3] = val[gallivm_w_swizzle(swizzle)];
+ return res;
+}
+
+void StorageSoa::store(Argument type, int idx, const std::vector<llvm::Value*> &val,
+ int mask)
+{
+ llvm::Value *out = 0;
+ switch(type) {
+ case Output:
+ out = m_output;
+ break;
+ case Temp:
+ out = m_temps;
+ break;
+ case Input:
+ out = m_input;
+ break;
+ case Address: {
+ llvm::Value *addr = m_addresses[idx];
+ if (!addr) {
+ addAddress(idx);
+ addr = m_addresses[idx];
+ assert(addr);
+ }
+ new StoreInst(val[0], addr, false, m_block);
+ return;
+ break;
+ }
+ default:
+ debug_printf("Can't save output of this type: %d !\n", type);
+ assert(0);
+ break;
+ }
+ llvm::Value *realIndex = constantInt(idx);
+ if ((mask & TGSI_WRITEMASK_X)) {
+ llvm::Value *xChannel = elementPointer(out, realIndex, 0);
+ new StoreInst(val[0], xChannel, false, m_block);
+ }
+ if ((mask & TGSI_WRITEMASK_Y)) {
+ llvm::Value *yChannel = elementPointer(out, realIndex, 1);
+ new StoreInst(val[1], yChannel, false, m_block);
+ }
+ if ((mask & TGSI_WRITEMASK_Z)) {
+ llvm::Value *zChannel = elementPointer(out, realIndex, 2);
+ new StoreInst(val[2], zChannel, false, m_block);
+ }
+ if ((mask & TGSI_WRITEMASK_W)) {
+ llvm::Value *wChannel = elementPointer(out, realIndex, 3);
+ new StoreInst(val[3], wChannel, false, m_block);
+ }
+}
+
+void StorageSoa::addAddress(int idx)
+{
+ GlobalVariable *val = new GlobalVariable(
+ /*Type=*/IntegerType::get(32),
+ /*isConstant=*/false,
+ /*Linkage=*/GlobalValue::ExternalLinkage,
+ /*Initializer=*/0, // has initializer, specified below
+ /*Name=*/name("address"),
+ currentModule());
+ val->setInitializer(Constant::getNullValue(IntegerType::get(32)));
+
+ debug_printf("adding to %d\n", idx);
+ m_addresses[idx] = val;
+}
diff --git a/src/mesa/pipe/llvm/storagesoa.h b/src/gallium/aux/llvm/storagesoa.h
index 84db7726a7..6443351f27 100644
--- a/src/mesa/pipe/llvm/storagesoa.h
+++ b/src/gallium/aux/llvm/storagesoa.h
@@ -29,51 +29,67 @@
#define STORAGESOA_H
#include <vector>
+#include <list>
#include <map>
namespace llvm {
class BasicBlock;
class Constant;
class ConstantInt;
+ class GlobalVariable;
class LoadInst;
class Value;
class VectorType;
+ class Module;
}
class StorageSoa
{
public:
+ enum Argument {
+ Input,
+ Output,
+ Temp,
+ Const,
+ Immediate,
+ Address
+ };
+public:
StorageSoa(llvm::BasicBlock *block,
llvm::Value *input,
llvm::Value *output,
llvm::Value *consts,
llvm::Value *temps);
- void addImmediate(float *vec);
- llvm::Value * addrElement(int idx) const;
+ std::vector<llvm::Value*> load(Argument type, int idx, int swizzle,
+ llvm::Value *indIdx =0);
+ void store(Argument type, int idx, const std::vector<llvm::Value*> &val,
+ int mask);
- std::vector<llvm::Value*> inputElement(int idx, int swizzle, llvm::Value *indIdx =0);
- std::vector<llvm::Value*> constElement(int idx, int swizzle, llvm::Value *indIdx =0);
- std::vector<llvm::Value*> outputElement(int idx, int swizzle, llvm::Value *indIdx =0);
- std::vector<llvm::Value*> tempElement(int idx, int swizzle, llvm::Value *indIdx =0);
- std::vector<llvm::Value*> immediateElement(int idx, int swizzle);
+ void addImmediate(float *vec);
+ void declareImmediates();
+
+ void addAddress(int idx);
- llvm::Value *extractIndex(llvm::Value *vec);
+ llvm::Value * addrElement(int idx) const;
- void storeOutput(int dstIdx, const std::vector<llvm::Value*> &val,
- int mask);
- void storeTemp(int idx, const std::vector<llvm::Value*> &val,
- int mask);
- void storeAddress(int idx, const std::vector<llvm::Value*> &val,
- int mask);
+ llvm::ConstantInt *constantInt(int) const;
private:
- llvm::Value *elementPointer(llvm::Value *ptr, int index,
+ llvm::Value *elementPointer(llvm::Value *ptr, llvm::Value *indIdx,
int channel) const;
- llvm::Value *element(llvm::Value *ptr, int index,
+ llvm::Value *element(llvm::Value *ptr, llvm::Value *idx,
int channel) const;
const char *name(const char *prefix) const;
- llvm::ConstantInt *constantInt(int) const;
+ llvm::Value *alignedArrayLoad(llvm::Value *val);
+ llvm::Module *currentModule() const;
+ llvm::Constant *createConstGlobalVector(const std::vector<float> &vec);
+
+ std::vector<llvm::Value*> inputElement(llvm::Value *indIdx);
+ std::vector<llvm::Value*> constElement(llvm::Value *indIdx);
+ std::vector<llvm::Value*> outputElement(llvm::Value *indIdx);
+ std::vector<llvm::Value*> tempElement(llvm::Value *indIdx);
+ std::vector<llvm::Value*> immediateElement(llvm::Value *indIdx);
private:
llvm::BasicBlock *m_block;
@@ -81,6 +97,11 @@ private:
llvm::Value *m_output;
llvm::Value *m_consts;
llvm::Value *m_temps;
+ llvm::GlobalVariable *m_immediates;
+
+ std::map<int, llvm::Value*> m_addresses;
+
+ std::vector<std::vector<float> > m_immediatesToFlush;
mutable std::map<int, llvm::ConstantInt*> m_constInts;
mutable char m_name[32];
diff --git a/src/mesa/pipe/llvm/tgsitollvm.cpp b/src/gallium/aux/llvm/tgsitollvm.cpp
index 3497eebcd9..2cb4acce32 100644
--- a/src/mesa/pipe/llvm/tgsitollvm.cpp
+++ b/src/gallium/aux/llvm/tgsitollvm.cpp
@@ -10,11 +10,11 @@
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
-#include "pipe/tgsi/util/tgsi_util.h"
-#include "pipe/tgsi/util/tgsi_build.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_build.h"
+#include "tgsi/util/tgsi_dump.h"
#include <llvm/Module.h>
@@ -44,7 +44,6 @@
#include <iostream>
using namespace llvm;
-#include "llvm_base_shader.cpp"
static inline FunctionType *vertexShaderFunctionType()
{
@@ -149,10 +148,14 @@ translate_declaration(struct gallivm_ir *prog,
static void
translate_declarationir(struct gallivm_ir *,
llvm::Module *,
- StorageSoa *,
- struct tgsi_full_declaration *,
+ StorageSoa *storage,
+ struct tgsi_full_declaration *decl,
struct tgsi_full_declaration *)
{
+ if (decl->Declaration.File == TGSI_FILE_ADDRESS) {
+ int idx = decl->u.DeclarationRange.First;
+ storage->addAddress(idx);
+ }
}
static void
@@ -704,18 +707,22 @@ translate_instructionir(llvm::Module *module,
if (src->SrcRegister.Indirect) {
indIdx = storage->addrElement(src->SrcRegisterInd.Index);
- indIdx = storage->extractIndex(indIdx);
}
if (src->SrcRegister.File == TGSI_FILE_CONSTANT) {
- val = storage->constElement(src->SrcRegister.Index, swizzle, indIdx);
+ val = storage->load(StorageSoa::Const,
+ src->SrcRegister.Index, swizzle, indIdx);
} else if (src->SrcRegister.File == TGSI_FILE_INPUT) {
- val = storage->inputElement(src->SrcRegister.Index, swizzle, indIdx);
+ val = storage->load(StorageSoa::Input,
+ src->SrcRegister.Index, swizzle, indIdx);
} else if (src->SrcRegister.File == TGSI_FILE_TEMPORARY) {
- val = storage->tempElement(src->SrcRegister.Index, swizzle);
+ val = storage->load(StorageSoa::Temp,
+ src->SrcRegister.Index, swizzle, indIdx);
} else if (src->SrcRegister.File == TGSI_FILE_OUTPUT) {
- val = storage->outputElement(src->SrcRegister.Index, swizzle, indIdx);
+ val = storage->load(StorageSoa::Output,
+ src->SrcRegister.Index, swizzle, indIdx);
} else if (src->SrcRegister.File == TGSI_FILE_IMMEDIATE) {
- val = storage->immediateElement(src->SrcRegister.Index, swizzle);
+ val = storage->load(StorageSoa::Immediate,
+ src->SrcRegister.Index, swizzle, indIdx);
} else {
fprintf(stderr, "ERROR: not supported llvm source %d\n", src->SrcRegister.File);
return;
@@ -727,6 +734,7 @@ translate_instructionir(llvm::Module *module,
std::vector<llvm::Value*> out(4);
switch (inst->Instruction.Opcode) {
case TGSI_OPCODE_ARL: {
+ out = instr->arl(inputs[0]);
}
break;
case TGSI_OPCODE_MOV: {
@@ -776,6 +784,7 @@ translate_instructionir(llvm::Module *module,
}
break;
case TGSI_OPCODE_MAD: {
+ out = instr->madd(inputs[0], inputs[1], inputs[2]);
}
break;
case TGSI_OPCODE_SUB: {
@@ -1059,11 +1068,14 @@ translate_instructionir(llvm::Module *module,
struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i];
if (dst->DstRegister.File == TGSI_FILE_OUTPUT) {
- storage->storeOutput(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
+ storage->store(StorageSoa::Output,
+ dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
} else if (dst->DstRegister.File == TGSI_FILE_TEMPORARY) {
- storage->storeTemp(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
+ storage->store(StorageSoa::Temp,
+ dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
} else if (dst->DstRegister.File == TGSI_FILE_ADDRESS) {
- storage->storeAddress(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
+ storage->store(StorageSoa::Address,
+ dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
} else {
fprintf(stderr, "ERROR: unsupported LLVM destination!");
assert(!"wrong destination");
@@ -1074,7 +1086,7 @@ translate_instructionir(llvm::Module *module,
llvm::Module *
tgsi_to_llvm(struct gallivm_ir *ir, const struct tgsi_token *tokens)
{
- llvm::Module *mod = createBaseShader();
+ llvm::Module *mod = new Module("shader");
struct tgsi_parse_context parse;
struct tgsi_full_instruction fi;
struct tgsi_full_declaration fd;
@@ -1191,6 +1203,7 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
+ storage.declareImmediates();
translate_instructionir(mod, &storage, &instr,
&parse.FullToken.FullInstruction,
&fi, instno);
diff --git a/src/mesa/pipe/llvm/tgsitollvm.h b/src/gallium/aux/llvm/tgsitollvm.h
index 7ada04d629..7ada04d629 100644
--- a/src/mesa/pipe/llvm/tgsitollvm.h
+++ b/src/gallium/aux/llvm/tgsitollvm.h
diff --git a/src/mesa/pipe/pipebuffer/Makefile b/src/gallium/aux/pipebuffer/Makefile
index 75764a9a18..588629e870 100644
--- a/src/mesa/pipe/pipebuffer/Makefile
+++ b/src/gallium/aux/pipebuffer/Makefile
@@ -17,7 +17,7 @@ C_SOURCES = \
ASM_SOURCES =
-include ../Makefile.template
+include ../../Makefile.template
symlinks:
diff --git a/src/mesa/pipe/pipebuffer/linked_list.h b/src/gallium/aux/pipebuffer/linked_list.h
index e99817fb13..e99817fb13 100644
--- a/src/mesa/pipe/pipebuffer/linked_list.h
+++ b/src/gallium/aux/pipebuffer/linked_list.h
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer.h b/src/gallium/aux/pipebuffer/pb_buffer.h
index 97beb5f72a..97beb5f72a 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer.h
+++ b/src/gallium/aux/pipebuffer/pb_buffer.h
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c b/src/gallium/aux/pipebuffer/pb_buffer_fenced.c
index f4fc3f6d71..f4fc3f6d71 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/aux/pipebuffer/pb_buffer_fenced.c
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h b/src/gallium/aux/pipebuffer/pb_buffer_fenced.h
index c40b9c75e1..c40b9c75e1 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.h
+++ b/src/gallium/aux/pipebuffer/pb_buffer_fenced.h
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c b/src/gallium/aux/pipebuffer/pb_buffer_malloc.c
index c1b7759874..9e8244f909 100644
--- a/src/mesa/pipe/pipebuffer/pb_buffer_malloc.c
+++ b/src/gallium/aux/pipebuffer/pb_buffer_malloc.c
@@ -110,7 +110,7 @@ pb_malloc_buffer_create(size_t size,
buf = CALLOC_STRUCT(malloc_buffer);
if(!buf)
return NULL;
-
+
buf->base.base.refcount = 1;
buf->base.base.alignment = desc->alignment;
buf->base.base.usage = desc->usage;
@@ -119,7 +119,7 @@ pb_malloc_buffer_create(size_t size,
buf->data = align_malloc(size, desc->alignment < sizeof(void*) ? sizeof(void*) : desc->alignment);
if(!buf->data) {
- FREE(buf);
+ align_free(buf);
return NULL;
}
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr.h b/src/gallium/aux/pipebuffer/pb_bufmgr.h
index 1ddf784c97..1ddf784c97 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr.h
+++ b/src/gallium/aux/pipebuffer/pb_bufmgr.h
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c b/src/gallium/aux/pipebuffer/pb_bufmgr_fenced.c
index c535d3276c..c535d3276c 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_fenced.c
+++ b/src/gallium/aux/pipebuffer/pb_bufmgr_fenced.c
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c b/src/gallium/aux/pipebuffer/pb_bufmgr_mm.c
index 8b1b51c0e2..8b1b51c0e2 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_mm.c
+++ b/src/gallium/aux/pipebuffer/pb_bufmgr_mm.c
diff --git a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c b/src/gallium/aux/pipebuffer/pb_bufmgr_pool.c
index 04477a865a..04477a865a 100644
--- a/src/mesa/pipe/pipebuffer/pb_bufmgr_pool.c
+++ b/src/gallium/aux/pipebuffer/pb_bufmgr_pool.c
diff --git a/src/mesa/pipe/pipebuffer/pb_winsys.c b/src/gallium/aux/pipebuffer/pb_winsys.c
index 978944091f..978944091f 100644
--- a/src/mesa/pipe/pipebuffer/pb_winsys.c
+++ b/src/gallium/aux/pipebuffer/pb_winsys.c
diff --git a/src/mesa/pipe/tgsi/Makefile b/src/gallium/aux/tgsi/Makefile
index 12a8bd0409..12a8bd0409 100644
--- a/src/mesa/pipe/tgsi/Makefile
+++ b/src/gallium/aux/tgsi/Makefile
diff --git a/src/mesa/pipe/tgsi/exec/Makefile b/src/gallium/aux/tgsi/exec/Makefile
index eb8b14e0e8..eb8b14e0e8 100644
--- a/src/mesa/pipe/tgsi/exec/Makefile
+++ b/src/gallium/aux/tgsi/exec/Makefile
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/gallium/aux/tgsi/exec/tgsi_exec.c
index 92a6fd4d62..d7b18dc9c5 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c
+++ b/src/gallium/aux/tgsi/exec/tgsi_exec.c
@@ -54,8 +54,8 @@
#include "pipe/p_state.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
-#include "pipe/tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_util.h"
#include "tgsi_exec.h"
#define TILE_TOP_LEFT 0
@@ -176,13 +176,13 @@ tgsi_exec_machine_bind_shader(
if (numDeclarations == maxDeclarations) {
declarations = REALLOC(declarations,
maxDeclarations
- * sizeof(struct tgsi_full_instruction),
+ * sizeof(struct tgsi_full_declaration),
(maxDeclarations + 10)
- * sizeof(struct tgsi_full_instruction));
+ * sizeof(struct tgsi_full_declaration));
maxDeclarations += 10;
}
memcpy(declarations + numDeclarations,
- &parse.FullToken.FullInstruction,
+ &parse.FullToken.FullDeclaration,
sizeof(declarations[0]));
numDeclarations++;
break;
@@ -1337,9 +1337,12 @@ exec_tex(struct tgsi_exec_machine *mach,
}
-
+/**
+ * Evaluate a constant-valued coefficient at the position of the
+ * current quad.
+ */
static void
-constant_interpolation(
+eval_constant_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
@@ -1351,8 +1354,12 @@ constant_interpolation(
}
}
+/**
+ * Evaluate a linear-valued coefficient at the position of the
+ * current quad.
+ */
static void
-linear_interpolation(
+eval_linear_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
@@ -1368,8 +1375,12 @@ linear_interpolation(
mach->Inputs[attrib].xyzw[chan].f[3] = a0 + dadx + dady;
}
+/**
+ * Evaluate a perspective-valued coefficient at the position of the
+ * current quad.
+ */
static void
-perspective_interpolation(
+eval_perspective_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
@@ -1388,7 +1399,7 @@ perspective_interpolation(
}
-typedef void (* interpolation_func)(
+typedef void (* eval_coef_func)(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan );
@@ -1401,7 +1412,7 @@ exec_declaration(
if( mach->Processor == TGSI_PROCESSOR_FRAGMENT ) {
if( decl->Declaration.File == TGSI_FILE_INPUT ) {
unsigned first, last, mask;
- interpolation_func interp;
+ eval_coef_func eval;
assert( decl->Declaration.Declare == TGSI_DECLARE_RANGE );
@@ -1411,15 +1422,15 @@ exec_declaration(
switch( decl->Interpolation.Interpolate ) {
case TGSI_INTERPOLATE_CONSTANT:
- interp = constant_interpolation;
+ eval = eval_constant_coef;
break;
case TGSI_INTERPOLATE_LINEAR:
- interp = linear_interpolation;
+ eval = eval_linear_coef;
break;
case TGSI_INTERPOLATE_PERSPECTIVE:
- interp = perspective_interpolation;
+ eval = eval_perspective_coef;
break;
default:
@@ -1431,7 +1442,7 @@ exec_declaration(
for( i = first; i <= last; i++ ) {
for( j = 0; j < NUM_CHANNELS; j++ ) {
- interp( mach, i, j );
+ eval( mach, i, j );
}
}
}
@@ -1441,7 +1452,7 @@ exec_declaration(
for( j = 0; j < NUM_CHANNELS; j++ ) {
if( mask & (1 << j) ) {
for( i = first; i <= last; i++ ) {
- interp( mach, i, j );
+ eval( mach, i, j );
}
}
}
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.h b/src/gallium/aux/tgsi/exec/tgsi_exec.h
index 45c49dd007..45c49dd007 100644
--- a/src/mesa/pipe/tgsi/exec/tgsi_exec.h
+++ b/src/gallium/aux/tgsi/exec/tgsi_exec.h
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_sse2.c b/src/gallium/aux/tgsi/exec/tgsi_sse2.c
index 9bc9483e3b..79209575bc 100755
--- a/src/mesa/pipe/tgsi/exec/tgsi_sse2.c
+++ b/src/gallium/aux/tgsi/exec/tgsi_sse2.c
@@ -27,8 +27,8 @@
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
-#include "pipe/tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_util.h"
#include "tgsi_exec.h"
#include "tgsi_sse2.h"
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_sse2.h b/src/gallium/aux/tgsi/exec/tgsi_sse2.h
index 9bee371766..9bee371766 100755
--- a/src/mesa/pipe/tgsi/exec/tgsi_sse2.h
+++ b/src/gallium/aux/tgsi/exec/tgsi_sse2.h
diff --git a/src/mesa/pipe/tgsi/util/tgsi_build.c b/src/gallium/aux/tgsi/util/tgsi_build.c
index a00ff1c2a5..a00ff1c2a5 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_build.c
+++ b/src/gallium/aux/tgsi/util/tgsi_build.c
diff --git a/src/mesa/pipe/tgsi/util/tgsi_build.h b/src/gallium/aux/tgsi/util/tgsi_build.h
index 116c78abf3..116c78abf3 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_build.h
+++ b/src/gallium/aux/tgsi/util/tgsi_build.h
diff --git a/src/mesa/pipe/tgsi/util/tgsi_dump.c b/src/gallium/aux/tgsi/util/tgsi_dump.c
index b5c54847e0..b5c54847e0 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_dump.c
+++ b/src/gallium/aux/tgsi/util/tgsi_dump.c
diff --git a/src/mesa/pipe/tgsi/util/tgsi_dump.h b/src/gallium/aux/tgsi/util/tgsi_dump.h
index 1adc9db251..1adc9db251 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_dump.h
+++ b/src/gallium/aux/tgsi/util/tgsi_dump.h
diff --git a/src/mesa/pipe/tgsi/util/tgsi_parse.c b/src/gallium/aux/tgsi/util/tgsi_parse.c
index bf6b89ce56..bf6b89ce56 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_parse.c
+++ b/src/gallium/aux/tgsi/util/tgsi_parse.c
diff --git a/src/mesa/pipe/tgsi/util/tgsi_parse.h b/src/gallium/aux/tgsi/util/tgsi_parse.h
index 9372da8d5d..9372da8d5d 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_parse.h
+++ b/src/gallium/aux/tgsi/util/tgsi_parse.h
diff --git a/src/gallium/aux/tgsi/util/tgsi_transform.c b/src/gallium/aux/tgsi/util/tgsi_transform.c
new file mode 100644
index 0000000000..357f77b05a
--- /dev/null
+++ b/src/gallium/aux/tgsi/util/tgsi_transform.c
@@ -0,0 +1,199 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/**
+ * TGSI program transformation utility.
+ *
+ * Authors: Brian Paul
+ */
+
+
+#include "tgsi_transform.h"
+
+
+
+static void
+emit_instruction(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_instruction *inst)
+{
+ uint ti = ctx->ti;
+
+ ti += tgsi_build_full_instruction(inst,
+ ctx->tokens_out + ti,
+ ctx->header,
+ ctx->max_tokens_out - ti);
+ ctx->ti = ti;
+}
+
+
+static void
+emit_declaration(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_declaration *decl)
+{
+ uint ti = ctx->ti;
+
+ ti += tgsi_build_full_declaration(decl,
+ ctx->tokens_out + ti,
+ ctx->header,
+ ctx->max_tokens_out - ti);
+ ctx->ti = ti;
+}
+
+
+static void
+emit_immediate(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_immediate *imm)
+{
+ uint ti = ctx->ti;
+
+ ti += tgsi_build_full_immediate(imm,
+ ctx->tokens_out + ti,
+ ctx->header,
+ ctx->max_tokens_out - ti);
+ ctx->ti = ti;
+}
+
+
+
+/**
+ * Apply user-defined transformations to the input shader to produce
+ * the output shader.
+ * For example, a register search-and-replace operation could be applied
+ * by defining a transform_instruction() callback that examined and changed
+ * the instruction src/dest regs.
+ *
+ * \return number of tokens emitted
+ */
+int
+tgsi_transform_shader(const struct tgsi_token *tokens_in,
+ struct tgsi_token *tokens_out,
+ uint max_tokens_out,
+ struct tgsi_transform_context *ctx)
+{
+ uint procType;
+
+ /* input shader */
+ struct tgsi_parse_context parse;
+
+ /* output shader */
+ struct tgsi_processor *processor;
+
+
+ /**
+ ** callback context init
+ **/
+ ctx->emit_instruction = emit_instruction;
+ ctx->emit_declaration = emit_declaration;
+ ctx->emit_immediate = emit_immediate;
+ ctx->tokens_out = tokens_out;
+ ctx->max_tokens_out = max_tokens_out;
+
+
+ /**
+ ** Setup to begin parsing input shader
+ **/
+ if (tgsi_parse_init( &parse, tokens_in ) != TGSI_PARSE_OK) {
+ debug_printf("tgsi_parse_init() failed in tgsi_transform_shader()!\n");
+ return -1;
+ }
+ procType = parse.FullHeader.Processor.Processor;
+ assert(procType == TGSI_PROCESSOR_FRAGMENT ||
+ procType == TGSI_PROCESSOR_VERTEX ||
+ procType == TGSI_PROCESSOR_GEOMETRY);
+
+
+ /**
+ ** Setup output shader
+ **/
+ *(struct tgsi_version *) &tokens_out[0] = tgsi_build_version();
+
+ ctx->header = (struct tgsi_header *) (tokens_out + 1);
+ *ctx->header = tgsi_build_header();
+
+ processor = (struct tgsi_processor *) (tokens_out + 2);
+ *processor = tgsi_build_processor( procType, ctx->header );
+
+ ctx->ti = 3;
+
+
+ /**
+ ** Loop over incoming program tokens/instructions
+ */
+ while( !tgsi_parse_end_of_tokens( &parse ) ) {
+
+ tgsi_parse_token( &parse );
+
+ switch( parse.FullToken.Token.Type ) {
+ case TGSI_TOKEN_TYPE_INSTRUCTION:
+ {
+ struct tgsi_full_instruction *fullinst
+ = &parse.FullToken.FullInstruction;
+
+ if (ctx->transform_instruction)
+ ctx->transform_instruction(ctx, fullinst);
+ else
+ ctx->emit_instruction(ctx, fullinst);
+ }
+ break;
+
+ case TGSI_TOKEN_TYPE_DECLARATION:
+ {
+ struct tgsi_full_declaration *fulldecl
+ = &parse.FullToken.FullDeclaration;
+
+ if (ctx->transform_declaration)
+ ctx->transform_declaration(ctx, fulldecl);
+ else
+ ctx->emit_declaration(ctx, fulldecl);
+ }
+ break;
+
+ case TGSI_TOKEN_TYPE_IMMEDIATE:
+ {
+ struct tgsi_full_immediate *fullimm
+ = &parse.FullToken.FullImmediate;
+
+ if (ctx->transform_immediate)
+ ctx->transform_immediate(ctx, fullimm);
+ else
+ ctx->emit_immediate(ctx, fullimm);
+ }
+ break;
+
+ default:
+ assert( 0 );
+ }
+ }
+
+ if (ctx->epilog) {
+ ctx->epilog(ctx);
+ }
+
+ tgsi_parse_free (&parse);
+
+ return ctx->ti;
+}
diff --git a/src/gallium/aux/tgsi/util/tgsi_transform.h b/src/gallium/aux/tgsi/util/tgsi_transform.h
new file mode 100644
index 0000000000..fcf85d603b
--- /dev/null
+++ b/src/gallium/aux/tgsi/util/tgsi_transform.h
@@ -0,0 +1,93 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef TGSI_TRANSFORM_H
+#define TGSI_TRANSFORM_H
+
+
+#include "pipe/p_util.h"
+#include "pipe/p_shader_tokens.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_build.h"
+
+
+
+/**
+ * Subclass this to add caller-specific data
+ */
+struct tgsi_transform_context
+{
+/**** PUBLIC ***/
+
+ /**
+ * User-defined callbacks invoked per instruction.
+ */
+ void (*transform_instruction)(struct tgsi_transform_context *ctx,
+ struct tgsi_full_instruction *inst);
+
+ void (*transform_declaration)(struct tgsi_transform_context *ctx,
+ struct tgsi_full_declaration *decl);
+
+ void (*transform_immediate)(struct tgsi_transform_context *ctx,
+ struct tgsi_full_immediate *imm);
+
+ /**
+ * Called at end of input program to allow caller to append extra
+ * instructions. Return number of tokens emitted.
+ */
+ void (*epilog)(struct tgsi_transform_context *ctx);
+
+
+/*** PRIVATE ***/
+
+ /**
+ * These are setup by tgsi_transform_shader() and cannot be overridden.
+ * Meant to be called from in the above user callback functions.
+ */
+ void (*emit_instruction)(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_instruction *inst);
+ void (*emit_declaration)(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_declaration *decl);
+ void (*emit_immediate)(struct tgsi_transform_context *ctx,
+ const struct tgsi_full_immediate *imm);
+
+ struct tgsi_header *header;
+ uint max_tokens_out;
+ struct tgsi_token *tokens_out;
+ uint ti;
+};
+
+
+
+extern int
+tgsi_transform_shader(const struct tgsi_token *tokens_in,
+ struct tgsi_token *tokens_out,
+ uint max_tokens_out,
+ struct tgsi_transform_context *ctx);
+
+
+#endif /* TGSI_TRANSFORM_H */
diff --git a/src/mesa/pipe/tgsi/util/tgsi_util.c b/src/gallium/aux/tgsi/util/tgsi_util.c
index 4cdd89182a..4cdd89182a 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_util.c
+++ b/src/gallium/aux/tgsi/util/tgsi_util.c
diff --git a/src/mesa/pipe/tgsi/util/tgsi_util.h b/src/gallium/aux/tgsi/util/tgsi_util.h
index ef14446f0e..ef14446f0e 100644
--- a/src/mesa/pipe/tgsi/util/tgsi_util.h
+++ b/src/gallium/aux/tgsi/util/tgsi_util.h
diff --git a/src/mesa/pipe/util/p_debug.c b/src/gallium/aux/util/p_debug.c
index b9607a6ba7..b9607a6ba7 100644
--- a/src/mesa/pipe/util/p_debug.c
+++ b/src/gallium/aux/util/p_debug.c
diff --git a/src/mesa/pipe/util/p_tile.c b/src/gallium/aux/util/p_tile.c
index 3f795a3898..3f795a3898 100644
--- a/src/mesa/pipe/util/p_tile.c
+++ b/src/gallium/aux/util/p_tile.c
diff --git a/src/mesa/pipe/util/p_tile.h b/src/gallium/aux/util/p_tile.h
index cd8124bf11..cd8124bf11 100644
--- a/src/mesa/pipe/util/p_tile.h
+++ b/src/gallium/aux/util/p_tile.h
diff --git a/src/mesa/pipe/util/p_util.c b/src/gallium/aux/util/p_util.c
index 2a92f8e408..2a92f8e408 100644
--- a/src/mesa/pipe/util/p_util.c
+++ b/src/gallium/aux/util/p_util.c
diff --git a/src/mesa/pipe/Makefile b/src/gallium/drivers/Makefile
index d880d090c1..c0345a9cb5 100644
--- a/src/mesa/pipe/Makefile
+++ b/src/gallium/drivers/Makefile
@@ -6,11 +6,7 @@ ifeq ($(CONFIG_NAME), linux-cell)
CELL_DIR = cell
endif
-ifeq ($(CONFIG_NAME), linux-llvm)
-LLVM_DIR = llvm
-endif
-
-SUBDIRS = softpipe i915simple i965simple failover pipebuffer $(CELL_DIR) $(LLVM_DIR)
+SUBDIRS = softpipe i915simple i965simple failover pipebuffer $(CELL_DIR)
default: subdirs
diff --git a/src/mesa/pipe/cell/Makefile b/src/gallium/drivers/cell/Makefile
index 47aef7b05f..47aef7b05f 100644
--- a/src/mesa/pipe/cell/Makefile
+++ b/src/gallium/drivers/cell/Makefile
diff --git a/src/mesa/pipe/cell/common.h b/src/gallium/drivers/cell/common.h
index 4de514c358..4de514c358 100644
--- a/src/mesa/pipe/cell/common.h
+++ b/src/gallium/drivers/cell/common.h
diff --git a/src/mesa/pipe/cell/ppu/Makefile b/src/gallium/drivers/cell/ppu/Makefile
index 50060f5cd3..011863c11e 100644
--- a/src/mesa/pipe/cell/ppu/Makefile
+++ b/src/gallium/drivers/cell/ppu/Makefile
@@ -40,8 +40,11 @@ SOURCES = \
OBJECTS = $(SOURCES:.c=.o) \
-INCLUDE_DIRS = -I$(TOP)/src/mesa
-
+INCLUDE_DIRS = \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/aux \
+ -I$(TOP)/src/gallium/drivers
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
diff --git a/src/mesa/pipe/cell/ppu/cell_batch.c b/src/gallium/drivers/cell/ppu/cell_batch.c
index f45e5f25b6..f45e5f25b6 100644
--- a/src/mesa/pipe/cell/ppu/cell_batch.c
+++ b/src/gallium/drivers/cell/ppu/cell_batch.c
diff --git a/src/mesa/pipe/cell/ppu/cell_batch.h b/src/gallium/drivers/cell/ppu/cell_batch.h
index a6eee0a8b1..a6eee0a8b1 100644
--- a/src/mesa/pipe/cell/ppu/cell_batch.h
+++ b/src/gallium/drivers/cell/ppu/cell_batch.h
diff --git a/src/mesa/pipe/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c
index 07b908eec5..e588a30d5b 100644
--- a/src/mesa/pipe/cell/ppu/cell_clear.c
+++ b/src/gallium/drivers/cell/ppu/cell_clear.c
@@ -35,7 +35,7 @@
#include <stdint.h>
#include "pipe/p_inlines.h"
#include "pipe/p_util.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
#include "cell_clear.h"
#include "cell_context.h"
#include "cell_batch.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_clear.h b/src/gallium/drivers/cell/ppu/cell_clear.h
index ff47d43f4c..ff47d43f4c 100644
--- a/src/mesa/pipe/cell/ppu/cell_clear.h
+++ b/src/gallium/drivers/cell/ppu/cell_clear.h
diff --git a/src/mesa/pipe/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c
index bbe1fd7a11..e1eb22f468 100644
--- a/src/mesa/pipe/cell/ppu/cell_context.c
+++ b/src/gallium/drivers/cell/ppu/cell_context.c
@@ -37,9 +37,9 @@
#include "pipe/p_format.h"
#include "pipe/p_util.h"
#include "pipe/p_winsys.h"
-#include "pipe/cell/common.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_private.h"
+#include "cell/common.h"
+#include "draw/draw_context.h"
+#include "draw/draw_private.h"
#include "cell_clear.h"
#include "cell_context.h"
#include "cell_draw_arrays.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h
index 3b63419b5e..6196c0c72f 100644
--- a/src/mesa/pipe/cell/ppu/cell_context.h
+++ b/src/gallium/drivers/cell/ppu/cell_context.h
@@ -32,10 +32,10 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
-#include "pipe/draw/draw_vertex.h"
-#include "pipe/draw/draw_vbuf.h"
+#include "draw/draw_vertex.h"
+#include "draw/draw_vbuf.h"
#include "cell_winsys.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
struct cell_vbuf_render;
diff --git a/src/mesa/pipe/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
index 717cd8370f..f12613649b 100644
--- a/src/mesa/pipe/cell/ppu/cell_draw_arrays.c
+++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
@@ -39,7 +39,7 @@
#include "cell_draw_arrays.h"
#include "cell_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_draw_arrays.h b/src/gallium/drivers/cell/ppu/cell_draw_arrays.h
index d5df4aa05f..d5df4aa05f 100644
--- a/src/mesa/pipe/cell/ppu/cell_draw_arrays.h
+++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.h
diff --git a/src/mesa/pipe/cell/ppu/cell_flush.c b/src/gallium/drivers/cell/ppu/cell_flush.c
index f62bc4650c..20f27531fc 100644
--- a/src/mesa/pipe/cell/ppu/cell_flush.c
+++ b/src/gallium/drivers/cell/ppu/cell_flush.c
@@ -31,7 +31,7 @@
#include "cell_flush.h"
#include "cell_spu.h"
#include "cell_render.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
void
diff --git a/src/mesa/pipe/cell/ppu/cell_flush.h b/src/gallium/drivers/cell/ppu/cell_flush.h
index eda351b1cb..eda351b1cb 100644
--- a/src/mesa/pipe/cell/ppu/cell_flush.h
+++ b/src/gallium/drivers/cell/ppu/cell_flush.h
diff --git a/src/mesa/pipe/cell/ppu/cell_render.c b/src/gallium/drivers/cell/ppu/cell_render.c
index 4ab277a4b2..b663b37622 100644
--- a/src/mesa/pipe/cell/ppu/cell_render.c
+++ b/src/gallium/drivers/cell/ppu/cell_render.c
@@ -34,7 +34,7 @@
#include "cell_render.h"
#include "cell_spu.h"
#include "pipe/p_util.h"
-#include "pipe/draw/draw_private.h"
+#include "draw/draw_private.h"
struct render_stage {
diff --git a/src/mesa/pipe/cell/ppu/cell_render.h b/src/gallium/drivers/cell/ppu/cell_render.h
index 826dcbafeb..826dcbafeb 100644
--- a/src/mesa/pipe/cell/ppu/cell_render.h
+++ b/src/gallium/drivers/cell/ppu/cell_render.h
diff --git a/src/mesa/pipe/cell/ppu/cell_spu.c b/src/gallium/drivers/cell/ppu/cell_spu.c
index 7c83a47e57..419e74dc40 100644
--- a/src/mesa/pipe/cell/ppu/cell_spu.c
+++ b/src/gallium/drivers/cell/ppu/cell_spu.c
@@ -31,7 +31,7 @@
#include "cell_spu.h"
#include "pipe/p_format.h"
#include "pipe/p_state.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
/*
diff --git a/src/mesa/pipe/cell/ppu/cell_spu.h b/src/gallium/drivers/cell/ppu/cell_spu.h
index 19eff94f96..137f26612e 100644
--- a/src/mesa/pipe/cell/ppu/cell_spu.h
+++ b/src/gallium/drivers/cell/ppu/cell_spu.h
@@ -31,7 +31,7 @@
#include <libspe2.h>
#include <libmisc.h>
-#include "pipe/cell/common.h"
+#include "cell/common.h"
#include "cell_context.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state.h b/src/gallium/drivers/cell/ppu/cell_state.h
index 3a71ba14fa..3a71ba14fa 100644
--- a/src/mesa/pipe/cell/ppu/cell_state.h
+++ b/src/gallium/drivers/cell/ppu/cell_state.h
diff --git a/src/mesa/pipe/cell/ppu/cell_state_blend.c b/src/gallium/drivers/cell/ppu/cell_state_blend.c
index 4fc60548c8..b6d6d71f0c 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_blend.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_blend.c
@@ -29,7 +29,7 @@
*/
#include "pipe/p_util.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "cell_context.h"
#include "cell_state.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state_clip.c b/src/gallium/drivers/cell/ppu/cell_state_clip.c
index 4f43665941..0482f87e88 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_clip.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_clip.c
@@ -30,7 +30,7 @@
#include "cell_context.h"
#include "cell_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
void cell_set_clip_state( struct pipe_context *pipe,
diff --git a/src/mesa/pipe/cell/ppu/cell_state_derived.c b/src/gallium/drivers/cell/ppu/cell_state_derived.c
index 56daf5dfde..0c46829258 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_derived.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_derived.c
@@ -27,8 +27,8 @@
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_context.h"
+#include "draw/draw_vertex.h"
#include "cell_context.h"
#include "cell_batch.h"
#include "cell_state.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c
index 5d2a786449..5d2a786449 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.h b/src/gallium/drivers/cell/ppu/cell_state_emit.h
index 59f8affe8d..59f8affe8d 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.h
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.h
diff --git a/src/mesa/pipe/cell/ppu/cell_state_fs.c b/src/gallium/drivers/cell/ppu/cell_state_fs.c
index 3f46a87d18..b2ed699a5b 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_fs.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_fs.c
@@ -29,12 +29,12 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#if 0
#include "pipe/p_shader_tokens.h"
-#include "pipe/llvm/gallivm.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
-#include "pipe/tgsi/exec/tgsi_sse2.h"
+#include "llvm/gallivm.h"
+#include "tgsi/util/tgsi_dump.h"
+#include "tgsi/exec/tgsi_sse2.h"
#endif
#include "cell_context.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state_rasterizer.c b/src/gallium/drivers/cell/ppu/cell_state_rasterizer.c
index d8128ece54..7eca5b5765 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_rasterizer.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_rasterizer.c
@@ -27,7 +27,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "cell_context.h"
#include "cell_state.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state_sampler.c b/src/gallium/drivers/cell/ppu/cell_state_sampler.c
index ade6cc8338..a33421a4ad 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_sampler.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_sampler.c
@@ -30,7 +30,7 @@
*/
#include "pipe/p_util.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "cell_context.h"
#include "cell_state.h"
#include "cell_texture.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_state_surface.c b/src/gallium/drivers/cell/ppu/cell_state_surface.c
index 287610b76b..287610b76b 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_surface.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_surface.c
diff --git a/src/mesa/pipe/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c
index 0f01e920f9..563831b62d 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_vertex.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c
@@ -32,7 +32,7 @@
#include "cell_context.h"
#include "cell_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
void
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/gallium/drivers/cell/ppu/cell_surface.c
index fca93e4742..a35db0ef99 100644
--- a/src/mesa/pipe/cell/ppu/cell_surface.c
+++ b/src/gallium/drivers/cell/ppu/cell_surface.c
@@ -29,7 +29,7 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#include "cell_context.h"
#include "cell_surface.h"
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.h b/src/gallium/drivers/cell/ppu/cell_surface.h
index 9e58f32944..9e58f32944 100644
--- a/src/mesa/pipe/cell/ppu/cell_surface.h
+++ b/src/gallium/drivers/cell/ppu/cell_surface.h
diff --git a/src/mesa/pipe/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index df178d9ca2..c8ef36002f 100644
--- a/src/mesa/pipe/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -61,7 +61,7 @@ cell_texture_layout(struct cell_texture * spt)
spt->buffer_size = 0;
- for ( level = pt->first_level ; level <= pt->last_level ; level++ ) {
+ for ( level = 0 ; level <= pt->last_level ; level++ ) {
pt->width[level] = width;
pt->height[level] = height;
pt->depth[level] = depth;
diff --git a/src/mesa/pipe/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h
index 0264fed88e..0264fed88e 100644
--- a/src/mesa/pipe/cell/ppu/cell_texture.h
+++ b/src/gallium/drivers/cell/ppu/cell_texture.h
diff --git a/src/mesa/pipe/cell/ppu/cell_vbuf.c b/src/gallium/drivers/cell/ppu/cell_vbuf.c
index e9fafe492e..cc727ff4ed 100644
--- a/src/mesa/pipe/cell/ppu/cell_vbuf.c
+++ b/src/gallium/drivers/cell/ppu/cell_vbuf.c
@@ -36,7 +36,7 @@
#include "cell_flush.h"
#include "cell_spu.h"
#include "cell_vbuf.h"
-#include "pipe/draw/draw_vbuf.h"
+#include "draw/draw_vbuf.h"
/** Allow vertex data to be inlined after RENDER command */
diff --git a/src/mesa/pipe/cell/ppu/cell_vbuf.h b/src/gallium/drivers/cell/ppu/cell_vbuf.h
index d265cbf770..d265cbf770 100644
--- a/src/mesa/pipe/cell/ppu/cell_vbuf.h
+++ b/src/gallium/drivers/cell/ppu/cell_vbuf.h
diff --git a/src/mesa/pipe/cell/ppu/cell_vertex_shader.c b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c
index 80dd500b34..0ba4506505 100644
--- a/src/mesa/pipe/cell/ppu/cell_vertex_shader.c
+++ b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c
@@ -38,9 +38,9 @@
#include "cell_spu.h"
#include "cell_batch.h"
-#include "pipe/cell/common.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_private.h"
+#include "cell/common.h"
+#include "draw/draw_context.h"
+#include "draw/draw_private.h"
/**
* Run the vertex shader on all vertices in the vertex queue.
diff --git a/src/mesa/pipe/cell/ppu/cell_winsys.c b/src/gallium/drivers/cell/ppu/cell_winsys.c
index ebabce3c8f..ebabce3c8f 100644
--- a/src/mesa/pipe/cell/ppu/cell_winsys.c
+++ b/src/gallium/drivers/cell/ppu/cell_winsys.c
diff --git a/src/mesa/pipe/cell/ppu/cell_winsys.h b/src/gallium/drivers/cell/ppu/cell_winsys.h
index ae2af5696b..ae2af5696b 100644
--- a/src/mesa/pipe/cell/ppu/cell_winsys.h
+++ b/src/gallium/drivers/cell/ppu/cell_winsys.h
diff --git a/src/mesa/pipe/cell/spu/Makefile b/src/gallium/drivers/cell/spu/Makefile
index f202971d73..7aa947299e 100644
--- a/src/mesa/pipe/cell/spu/Makefile
+++ b/src/gallium/drivers/cell/spu/Makefile
@@ -31,7 +31,11 @@ SPU_OBJECTS = $(SOURCES:.c=.o) \
SPU_ASM_OUT = $(SOURCES:.c=.s) \
-INCLUDE_DIRS = -I$(TOP)/src/mesa
+INCLUDE_DIRS = \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/aux \
+ -I$(TOP)/src/gallium/drivers
.c.o:
diff --git a/src/mesa/pipe/cell/spu/spu_blend.c b/src/gallium/drivers/cell/spu/spu_blend.c
index 23ec0eeb45..23ec0eeb45 100644
--- a/src/mesa/pipe/cell/spu/spu_blend.c
+++ b/src/gallium/drivers/cell/spu/spu_blend.c
diff --git a/src/mesa/pipe/cell/spu/spu_blend.h b/src/gallium/drivers/cell/spu/spu_blend.h
index 2b594b578b..2b594b578b 100644
--- a/src/mesa/pipe/cell/spu/spu_blend.h
+++ b/src/gallium/drivers/cell/spu/spu_blend.h
diff --git a/src/mesa/pipe/cell/spu/spu_colorpack.h b/src/gallium/drivers/cell/spu/spu_colorpack.h
index e9fee8a3a6..e9fee8a3a6 100644
--- a/src/mesa/pipe/cell/spu/spu_colorpack.h
+++ b/src/gallium/drivers/cell/spu/spu_colorpack.h
diff --git a/src/mesa/pipe/cell/spu/spu_exec.c b/src/gallium/drivers/cell/spu/spu_exec.c
index e51008b9b3..109540b1f7 100644
--- a/src/mesa/pipe/cell/spu/spu_exec.c
+++ b/src/gallium/drivers/cell/spu/spu_exec.c
@@ -67,8 +67,8 @@
#include "pipe/p_state.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
-#include "pipe/tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_util.h"
#include "spu_exec.h"
#include "spu_main.h"
#include "spu_vertex_shader.h"
diff --git a/src/mesa/pipe/cell/spu/spu_exec.h b/src/gallium/drivers/cell/spu/spu_exec.h
index b4c7661ef6..3e17c490d2 100644
--- a/src/mesa/pipe/cell/spu/spu_exec.h
+++ b/src/gallium/drivers/cell/spu/spu_exec.h
@@ -29,7 +29,7 @@
#define SPU_EXEC_H
#include "pipe/p_compiler.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_exec.h"
#if defined __cplusplus
extern "C" {
diff --git a/src/mesa/pipe/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c
index e375197fe6..1e7243b863 100644
--- a/src/mesa/pipe/cell/spu/spu_main.c
+++ b/src/gallium/drivers/cell/spu/spu_main.c
@@ -38,7 +38,7 @@
#include "spu_tile.h"
//#include "spu_test.h"
#include "spu_vertex_shader.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
#include "pipe/p_defines.h"
diff --git a/src/mesa/pipe/cell/spu/spu_main.h b/src/gallium/drivers/cell/spu/spu_main.h
index 1710a17512..5c95d112ac 100644
--- a/src/mesa/pipe/cell/spu/spu_main.h
+++ b/src/gallium/drivers/cell/spu/spu_main.h
@@ -31,8 +31,8 @@
#include <spu_mfcio.h>
-#include "pipe/cell/common.h"
-#include "pipe/draw/draw_vertex.h"
+#include "cell/common.h"
+#include "draw/draw_vertex.h"
#include "pipe/p_state.h"
diff --git a/src/mesa/pipe/cell/spu/spu_render.c b/src/gallium/drivers/cell/spu/spu_render.c
index 932fb500b3..20e77aa2e6 100644
--- a/src/mesa/pipe/cell/spu/spu_render.c
+++ b/src/gallium/drivers/cell/spu/spu_render.c
@@ -34,7 +34,7 @@
#include "spu_render.h"
#include "spu_tri.h"
#include "spu_tile.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
diff --git a/src/mesa/pipe/cell/spu/spu_render.h b/src/gallium/drivers/cell/spu/spu_render.h
index fbcdc5ec31..493434f087 100644
--- a/src/mesa/pipe/cell/spu/spu_render.h
+++ b/src/gallium/drivers/cell/spu/spu_render.h
@@ -29,7 +29,7 @@
#ifndef SPU_RENDER_H
#define SPU_RENDER_H
-#include "pipe/cell/common.h"
+#include "cell/common.h"
extern void
cmd_render(const struct cell_command_render *render, uint *pos_incr);
diff --git a/src/mesa/pipe/cell/spu/spu_texture.c b/src/gallium/drivers/cell/spu/spu_texture.c
index 3962aaa4a9..3962aaa4a9 100644
--- a/src/mesa/pipe/cell/spu/spu_texture.c
+++ b/src/gallium/drivers/cell/spu/spu_texture.c
diff --git a/src/mesa/pipe/cell/spu/spu_texture.h b/src/gallium/drivers/cell/spu/spu_texture.h
index 95eb87080f..95eb87080f 100644
--- a/src/mesa/pipe/cell/spu/spu_texture.h
+++ b/src/gallium/drivers/cell/spu/spu_texture.h
diff --git a/src/mesa/pipe/cell/spu/spu_tile.c b/src/gallium/drivers/cell/spu/spu_tile.c
index 12dc246328..12dc246328 100644
--- a/src/mesa/pipe/cell/spu/spu_tile.c
+++ b/src/gallium/drivers/cell/spu/spu_tile.c
diff --git a/src/mesa/pipe/cell/spu/spu_tile.h b/src/gallium/drivers/cell/spu/spu_tile.h
index e53340a55a..3105b848fd 100644
--- a/src/mesa/pipe/cell/spu/spu_tile.h
+++ b/src/gallium/drivers/cell/spu/spu_tile.h
@@ -32,7 +32,7 @@
#include <libmisc.h>
#include <spu_mfcio.h>
#include "spu_main.h"
-#include "pipe/cell/common.h"
+#include "cell/common.h"
diff --git a/src/mesa/pipe/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c
index be9624cf7d..be9624cf7d 100644
--- a/src/mesa/pipe/cell/spu/spu_tri.c
+++ b/src/gallium/drivers/cell/spu/spu_tri.c
diff --git a/src/mesa/pipe/cell/spu/spu_tri.h b/src/gallium/drivers/cell/spu/spu_tri.h
index aa694dd7c9..aa694dd7c9 100644
--- a/src/mesa/pipe/cell/spu/spu_tri.h
+++ b/src/gallium/drivers/cell/spu/spu_tri.h
diff --git a/src/mesa/pipe/cell/spu/spu_util.c b/src/gallium/drivers/cell/spu/spu_util.c
index ac373240c1..ea4274a0a7 100644
--- a/src/mesa/pipe/cell/spu/spu_util.c
+++ b/src/gallium/drivers/cell/spu/spu_util.c
@@ -1,8 +1,8 @@
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
//#include "tgsi_build.h"
-#include "pipe/tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_util.h"
unsigned
tgsi_util_get_src_register_swizzle(
diff --git a/src/gallium/drivers/cell/spu/spu_vertex_fetch.c b/src/gallium/drivers/cell/spu/spu_vertex_fetch.c
new file mode 100644
index 0000000000..45e3c26c00
--- /dev/null
+++ b/src/gallium/drivers/cell/spu/spu_vertex_fetch.c
@@ -0,0 +1,673 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include <spu_mfcio.h>
+#include <transpose_matrix4x4.h>
+
+#include "pipe/p_util.h"
+#include "pipe/p_state.h"
+#include "pipe/p_shader_tokens.h"
+#include "spu_exec.h"
+#include "spu_vertex_shader.h"
+#include "spu_main.h"
+
+#define CACHE_NAME attribute
+#define CACHED_TYPE qword
+#define CACHE_TYPE CACHE_TYPE_RO
+#define CACHE_SET_TAGID(set) TAG_VERTEX_BUFFER
+#define CACHE_LOG2NNWAY 2
+#define CACHE_LOG2NSETS 6
+#include <cache-api.h>
+
+/* Yes folks, this is ugly.
+ */
+#undef CACHE_NWAY
+#undef CACHE_NSETS
+#define CACHE_NAME attribute
+#define CACHE_NWAY 4
+#define CACHE_NSETS (1U << 6)
+
+
+#define DRAW_DBG 0
+
+static const qword fetch_shuffle_data[] = {
+ /* Shuffle used by CVT_64_FLOAT
+ */
+ {
+ 0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+ },
+
+ /* Shuffle used by CVT_8_USCALED and CVT_8_SSCALED
+ */
+ {
+ 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80,
+ 0x02, 0x80, 0x80, 0x80, 0x03, 0x80, 0x80, 0x80,
+ },
+
+ /* Shuffle used by CVT_16_USCALED and CVT_16_SSCALED
+ */
+ {
+ 0x00, 0x01, 0x80, 0x80, 0x02, 0x03, 0x80, 0x80,
+ 0x04, 0x05, 0x80, 0x80, 0x06, 0x07, 0x80, 0x80,
+ },
+
+ /* High value shuffle used by trans4x4.
+ */
+ {
+ 0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17
+ },
+
+ /* Low value shuffle used by trans4x4.
+ */
+ {
+ 0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F
+ }
+};
+
+
+static INLINE void
+trans4x4(qword row0, qword row1, qword row2, qword row3, qword *out,
+ const qword *shuffle)
+{
+ qword t1 = si_shufb(row0, row2, shuffle[3]);
+ qword t2 = si_shufb(row0, row2, shuffle[4]);
+ qword t3 = si_shufb(row1, row3, shuffle[3]);
+ qword t4 = si_shufb(row1, row3, shuffle[4]);
+
+ out[0] = si_shufb(t1, t3, shuffle[3]);
+ out[1] = si_shufb(t1, t3, shuffle[4]);
+ out[2] = si_shufb(t2, t4, shuffle[3]);
+ out[3] = si_shufb(t2, t4, shuffle[4]);
+}
+
+
+/**
+ * Fetch between 1 and 32 bytes from an unaligned address
+ */
+static INLINE void
+fetch_unaligned(qword *dst, unsigned ea, unsigned size)
+{
+ qword tmp[4];
+ const int shift = ea & 0x0f;
+ const unsigned aligned_start_ea = ea & ~0x0f;
+ const unsigned aligned_end_ea = (ea + size) & ~0x0f;
+ const unsigned num_entries = ((aligned_end_ea - aligned_start_ea) / 16) + 1;
+ unsigned i;
+
+
+ if (shift == 0) {
+ /* Data is already aligned. Fetch directly into the destination buffer.
+ */
+ for (i = 0; i < num_entries; i++) {
+ dst[i] = cache_rd(attribute, (ea & ~0x0f) + (i * 16));
+ }
+ } else {
+ /* Fetch data from the cache to the local buffer.
+ */
+ for (i = 0; i < num_entries; i++) {
+ tmp[i] = cache_rd(attribute, (ea & ~0x0f) + (i * 16));
+ }
+
+
+ /* Fix the alignment of the data and write to the destination buffer.
+ */
+ for (i = 0; i < ((size + 15) / 16); i++) {
+ dst[i] = si_or((qword) spu_slqwbyte(tmp[i], shift),
+ (qword) spu_rlmaskqwbyte(tmp[i + 1], shift - 16));
+ }
+ }
+}
+
+
+#define CVT_32_FLOAT(q, s) (*(q))
+
+static INLINE qword
+CVT_64_FLOAT(const qword *qw, const qword *shuffle)
+{
+ qword a = si_frds(qw[0]);
+ qword b = si_frds(si_rotqbyi(qw[0], 8));
+ qword c = si_frds(qw[1]);
+ qword d = si_frds(si_rotqbyi(qw[1], 8));
+
+ qword ab = si_shufb(a, b, shuffle[0]);
+ qword cd = si_shufb(c, d, si_rotqbyi(shuffle[0], 8));
+
+ return si_or(ab, cd);
+}
+
+
+static INLINE qword
+CVT_8_USCALED(const qword *qw, const qword *shuffle)
+{
+ return si_cuflt(si_shufb(*qw, *qw, shuffle[1]), 0);
+}
+
+
+static INLINE qword
+CVT_16_USCALED(const qword *qw, const qword *shuffle)
+{
+ return si_cuflt(si_shufb(*qw, *qw, shuffle[2]), 0);
+}
+
+
+static INLINE qword
+CVT_32_USCALED(const qword *qw, const qword *shuffle)
+{
+ (void) shuffle;
+ return si_cuflt(*qw, 0);
+}
+
+static INLINE qword
+CVT_8_SSCALED(const qword *qw, const qword *shuffle)
+{
+ return si_csflt(si_shufb(*qw, *qw, shuffle[1]), 0);
+}
+
+
+static INLINE qword
+CVT_16_SSCALED(const qword *qw, const qword *shuffle)
+{
+ return si_csflt(si_shufb(*qw, *qw, shuffle[2]), 0);
+}
+
+
+static INLINE qword
+CVT_32_SSCALED(const qword *qw, const qword *shuffle)
+{
+ (void) shuffle;
+ return si_csflt(*qw, 0);
+}
+
+
+static INLINE qword
+CVT_8_UNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 255.0f);
+ return si_fm(CVT_8_USCALED(qw, shuffle), scale);
+}
+
+
+static INLINE qword
+CVT_16_UNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 65535.0f);
+ return si_fm(CVT_16_USCALED(qw, shuffle), scale);
+}
+
+
+static INLINE qword
+CVT_32_UNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 4294967295.0f);
+ return si_fm(CVT_32_USCALED(qw, shuffle), scale);
+}
+
+
+static INLINE qword
+CVT_8_SNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 127.0f);
+ return si_fm(CVT_8_SSCALED(qw, shuffle), scale);
+}
+
+
+static INLINE qword
+CVT_16_SNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 32767.0f);
+ return si_fm(CVT_16_SSCALED(qw, shuffle), scale);
+}
+
+
+static INLINE qword
+CVT_32_SNORM(const qword *qw, const qword *shuffle)
+{
+ const qword scale = (qword) spu_splats(1.0f / 2147483647.0f);
+ return si_fm(CVT_32_SSCALED(qw, shuffle), scale);
+}
+
+#define SZ_4 si_il(0U)
+#define SZ_3 si_fsmbi(0x000f)
+#define SZ_2 si_fsmbi(0x00ff)
+#define SZ_1 si_fsmbi(0x0fff)
+
+/**
+ * Fetch a float[4] vertex attribute from memory, doing format/type
+ * conversion as needed.
+ *
+ * This is probably needed/dupliocated elsewhere, eg format
+ * conversion, texture sampling etc.
+ */
+#define FETCH_ATTRIB( NAME, SZ, CVT, N ) \
+static void \
+fetch_##NAME(qword *out, const qword *in, qword defaults, \
+ const qword *shuffle) \
+{ \
+ qword tmp[4]; \
+ \
+ tmp[0] = si_selb(CVT(in + (0 * N), shuffle), defaults, SZ); \
+ tmp[1] = si_selb(CVT(in + (1 * N), shuffle), defaults, SZ); \
+ tmp[2] = si_selb(CVT(in + (2 * N), shuffle), defaults, SZ); \
+ tmp[3] = si_selb(CVT(in + (3 * N), shuffle), defaults, SZ); \
+ trans4x4(tmp[0], tmp[1], tmp[2], tmp[3], out, shuffle); \
+}
+
+
+FETCH_ATTRIB( R64G64B64A64_FLOAT, SZ_4, CVT_64_FLOAT, 2 )
+FETCH_ATTRIB( R64G64B64_FLOAT, SZ_3, CVT_64_FLOAT, 2 )
+FETCH_ATTRIB( R64G64_FLOAT, SZ_2, CVT_64_FLOAT, 2 )
+FETCH_ATTRIB( R64_FLOAT, SZ_1, CVT_64_FLOAT, 2 )
+
+FETCH_ATTRIB( R32G32B32A32_FLOAT, SZ_4, CVT_32_FLOAT, 1 )
+FETCH_ATTRIB( R32G32B32_FLOAT, SZ_3, CVT_32_FLOAT, 1 )
+FETCH_ATTRIB( R32G32_FLOAT, SZ_2, CVT_32_FLOAT, 1 )
+FETCH_ATTRIB( R32_FLOAT, SZ_1, CVT_32_FLOAT, 1 )
+
+FETCH_ATTRIB( R32G32B32A32_USCALED, SZ_4, CVT_32_USCALED, 1 )
+FETCH_ATTRIB( R32G32B32_USCALED, SZ_3, CVT_32_USCALED, 1 )
+FETCH_ATTRIB( R32G32_USCALED, SZ_2, CVT_32_USCALED, 1 )
+FETCH_ATTRIB( R32_USCALED, SZ_1, CVT_32_USCALED, 1 )
+
+FETCH_ATTRIB( R32G32B32A32_SSCALED, SZ_4, CVT_32_SSCALED, 1 )
+FETCH_ATTRIB( R32G32B32_SSCALED, SZ_3, CVT_32_SSCALED, 1 )
+FETCH_ATTRIB( R32G32_SSCALED, SZ_2, CVT_32_SSCALED, 1 )
+FETCH_ATTRIB( R32_SSCALED, SZ_1, CVT_32_SSCALED, 1 )
+
+FETCH_ATTRIB( R32G32B32A32_UNORM, SZ_4, CVT_32_UNORM, 1 )
+FETCH_ATTRIB( R32G32B32_UNORM, SZ_3, CVT_32_UNORM, 1 )
+FETCH_ATTRIB( R32G32_UNORM, SZ_2, CVT_32_UNORM, 1 )
+FETCH_ATTRIB( R32_UNORM, SZ_1, CVT_32_UNORM, 1 )
+
+FETCH_ATTRIB( R32G32B32A32_SNORM, SZ_4, CVT_32_SNORM, 1 )
+FETCH_ATTRIB( R32G32B32_SNORM, SZ_3, CVT_32_SNORM, 1 )
+FETCH_ATTRIB( R32G32_SNORM, SZ_2, CVT_32_SNORM, 1 )
+FETCH_ATTRIB( R32_SNORM, SZ_1, CVT_32_SNORM, 1 )
+
+FETCH_ATTRIB( R16G16B16A16_USCALED, SZ_4, CVT_16_USCALED, 1 )
+FETCH_ATTRIB( R16G16B16_USCALED, SZ_3, CVT_16_USCALED, 1 )
+FETCH_ATTRIB( R16G16_USCALED, SZ_2, CVT_16_USCALED, 1 )
+FETCH_ATTRIB( R16_USCALED, SZ_1, CVT_16_USCALED, 1 )
+
+FETCH_ATTRIB( R16G16B16A16_SSCALED, SZ_4, CVT_16_SSCALED, 1 )
+FETCH_ATTRIB( R16G16B16_SSCALED, SZ_3, CVT_16_SSCALED, 1 )
+FETCH_ATTRIB( R16G16_SSCALED, SZ_2, CVT_16_SSCALED, 1 )
+FETCH_ATTRIB( R16_SSCALED, SZ_1, CVT_16_SSCALED, 1 )
+
+FETCH_ATTRIB( R16G16B16A16_UNORM, SZ_4, CVT_16_UNORM, 1 )
+FETCH_ATTRIB( R16G16B16_UNORM, SZ_3, CVT_16_UNORM, 1 )
+FETCH_ATTRIB( R16G16_UNORM, SZ_2, CVT_16_UNORM, 1 )
+FETCH_ATTRIB( R16_UNORM, SZ_1, CVT_16_UNORM, 1 )
+
+FETCH_ATTRIB( R16G16B16A16_SNORM, SZ_4, CVT_16_SNORM, 1 )
+FETCH_ATTRIB( R16G16B16_SNORM, SZ_3, CVT_16_SNORM, 1 )
+FETCH_ATTRIB( R16G16_SNORM, SZ_2, CVT_16_SNORM, 1 )
+FETCH_ATTRIB( R16_SNORM, SZ_1, CVT_16_SNORM, 1 )
+
+FETCH_ATTRIB( R8G8B8A8_USCALED, SZ_4, CVT_8_USCALED, 1 )
+FETCH_ATTRIB( R8G8B8_USCALED, SZ_3, CVT_8_USCALED, 1 )
+FETCH_ATTRIB( R8G8_USCALED, SZ_2, CVT_8_USCALED, 1 )
+FETCH_ATTRIB( R8_USCALED, SZ_1, CVT_8_USCALED, 1 )
+
+FETCH_ATTRIB( R8G8B8A8_SSCALED, SZ_4, CVT_8_SSCALED, 1 )
+FETCH_ATTRIB( R8G8B8_SSCALED, SZ_3, CVT_8_SSCALED, 1 )
+FETCH_ATTRIB( R8G8_SSCALED, SZ_2, CVT_8_SSCALED, 1 )
+FETCH_ATTRIB( R8_SSCALED, SZ_1, CVT_8_SSCALED, 1 )
+
+FETCH_ATTRIB( R8G8B8A8_UNORM, SZ_4, CVT_8_UNORM, 1 )
+FETCH_ATTRIB( R8G8B8_UNORM, SZ_3, CVT_8_UNORM, 1 )
+FETCH_ATTRIB( R8G8_UNORM, SZ_2, CVT_8_UNORM, 1 )
+FETCH_ATTRIB( R8_UNORM, SZ_1, CVT_8_UNORM, 1 )
+
+FETCH_ATTRIB( R8G8B8A8_SNORM, SZ_4, CVT_8_SNORM, 1 )
+FETCH_ATTRIB( R8G8B8_SNORM, SZ_3, CVT_8_SNORM, 1 )
+FETCH_ATTRIB( R8G8_SNORM, SZ_2, CVT_8_SNORM, 1 )
+FETCH_ATTRIB( R8_SNORM, SZ_1, CVT_8_SNORM, 1 )
+
+FETCH_ATTRIB( A8R8G8B8_UNORM, SZ_4, CVT_8_UNORM, 1 )
+
+
+
+static spu_fetch_func get_fetch_func( enum pipe_format format )
+{
+ switch (format) {
+ case PIPE_FORMAT_R64_FLOAT:
+ return fetch_R64_FLOAT;
+ case PIPE_FORMAT_R64G64_FLOAT:
+ return fetch_R64G64_FLOAT;
+ case PIPE_FORMAT_R64G64B64_FLOAT:
+ return fetch_R64G64B64_FLOAT;
+ case PIPE_FORMAT_R64G64B64A64_FLOAT:
+ return fetch_R64G64B64A64_FLOAT;
+
+ case PIPE_FORMAT_R32_FLOAT:
+ return fetch_R32_FLOAT;
+ case PIPE_FORMAT_R32G32_FLOAT:
+ return fetch_R32G32_FLOAT;
+ case PIPE_FORMAT_R32G32B32_FLOAT:
+ return fetch_R32G32B32_FLOAT;
+ case PIPE_FORMAT_R32G32B32A32_FLOAT:
+ return fetch_R32G32B32A32_FLOAT;
+
+ case PIPE_FORMAT_R32_UNORM:
+ return fetch_R32_UNORM;
+ case PIPE_FORMAT_R32G32_UNORM:
+ return fetch_R32G32_UNORM;
+ case PIPE_FORMAT_R32G32B32_UNORM:
+ return fetch_R32G32B32_UNORM;
+ case PIPE_FORMAT_R32G32B32A32_UNORM:
+ return fetch_R32G32B32A32_UNORM;
+
+ case PIPE_FORMAT_R32_USCALED:
+ return fetch_R32_USCALED;
+ case PIPE_FORMAT_R32G32_USCALED:
+ return fetch_R32G32_USCALED;
+ case PIPE_FORMAT_R32G32B32_USCALED:
+ return fetch_R32G32B32_USCALED;
+ case PIPE_FORMAT_R32G32B32A32_USCALED:
+ return fetch_R32G32B32A32_USCALED;
+
+ case PIPE_FORMAT_R32_SNORM:
+ return fetch_R32_SNORM;
+ case PIPE_FORMAT_R32G32_SNORM:
+ return fetch_R32G32_SNORM;
+ case PIPE_FORMAT_R32G32B32_SNORM:
+ return fetch_R32G32B32_SNORM;
+ case PIPE_FORMAT_R32G32B32A32_SNORM:
+ return fetch_R32G32B32A32_SNORM;
+
+ case PIPE_FORMAT_R32_SSCALED:
+ return fetch_R32_SSCALED;
+ case PIPE_FORMAT_R32G32_SSCALED:
+ return fetch_R32G32_SSCALED;
+ case PIPE_FORMAT_R32G32B32_SSCALED:
+ return fetch_R32G32B32_SSCALED;
+ case PIPE_FORMAT_R32G32B32A32_SSCALED:
+ return fetch_R32G32B32A32_SSCALED;
+
+ case PIPE_FORMAT_R16_UNORM:
+ return fetch_R16_UNORM;
+ case PIPE_FORMAT_R16G16_UNORM:
+ return fetch_R16G16_UNORM;
+ case PIPE_FORMAT_R16G16B16_UNORM:
+ return fetch_R16G16B16_UNORM;
+ case PIPE_FORMAT_R16G16B16A16_UNORM:
+ return fetch_R16G16B16A16_UNORM;
+
+ case PIPE_FORMAT_R16_USCALED:
+ return fetch_R16_USCALED;
+ case PIPE_FORMAT_R16G16_USCALED:
+ return fetch_R16G16_USCALED;
+ case PIPE_FORMAT_R16G16B16_USCALED:
+ return fetch_R16G16B16_USCALED;
+ case PIPE_FORMAT_R16G16B16A16_USCALED:
+ return fetch_R16G16B16A16_USCALED;
+
+ case PIPE_FORMAT_R16_SNORM:
+ return fetch_R16_SNORM;
+ case PIPE_FORMAT_R16G16_SNORM:
+ return fetch_R16G16_SNORM;
+ case PIPE_FORMAT_R16G16B16_SNORM:
+ return fetch_R16G16B16_SNORM;
+ case PIPE_FORMAT_R16G16B16A16_SNORM:
+ return fetch_R16G16B16A16_SNORM;
+
+ case PIPE_FORMAT_R16_SSCALED:
+ return fetch_R16_SSCALED;
+ case PIPE_FORMAT_R16G16_SSCALED:
+ return fetch_R16G16_SSCALED;
+ case PIPE_FORMAT_R16G16B16_SSCALED:
+ return fetch_R16G16B16_SSCALED;
+ case PIPE_FORMAT_R16G16B16A16_SSCALED:
+ return fetch_R16G16B16A16_SSCALED;
+
+ case PIPE_FORMAT_R8_UNORM:
+ return fetch_R8_UNORM;
+ case PIPE_FORMAT_R8G8_UNORM:
+ return fetch_R8G8_UNORM;
+ case PIPE_FORMAT_R8G8B8_UNORM:
+ return fetch_R8G8B8_UNORM;
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ return fetch_R8G8B8A8_UNORM;
+
+ case PIPE_FORMAT_R8_USCALED:
+ return fetch_R8_USCALED;
+ case PIPE_FORMAT_R8G8_USCALED:
+ return fetch_R8G8_USCALED;
+ case PIPE_FORMAT_R8G8B8_USCALED:
+ return fetch_R8G8B8_USCALED;
+ case PIPE_FORMAT_R8G8B8A8_USCALED:
+ return fetch_R8G8B8A8_USCALED;
+
+ case PIPE_FORMAT_R8_SNORM:
+ return fetch_R8_SNORM;
+ case PIPE_FORMAT_R8G8_SNORM:
+ return fetch_R8G8_SNORM;
+ case PIPE_FORMAT_R8G8B8_SNORM:
+ return fetch_R8G8B8_SNORM;
+ case PIPE_FORMAT_R8G8B8A8_SNORM:
+ return fetch_R8G8B8A8_SNORM;
+
+ case PIPE_FORMAT_R8_SSCALED:
+ return fetch_R8_SSCALED;
+ case PIPE_FORMAT_R8G8_SSCALED:
+ return fetch_R8G8_SSCALED;
+ case PIPE_FORMAT_R8G8B8_SSCALED:
+ return fetch_R8G8B8_SSCALED;
+ case PIPE_FORMAT_R8G8B8A8_SSCALED:
+ return fetch_R8G8B8A8_SSCALED;
+
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return fetch_A8R8G8B8_UNORM;
+
+ case 0:
+ return NULL; /* not sure why this is needed */
+
+ default:
+ assert(0);
+ return NULL;
+ }
+}
+
+
+static unsigned get_vertex_size( enum pipe_format format )
+{
+ switch (format) {
+ case PIPE_FORMAT_R64_FLOAT:
+ return 8;
+ case PIPE_FORMAT_R64G64_FLOAT:
+ return 2 * 8;
+ case PIPE_FORMAT_R64G64B64_FLOAT:
+ return 3 * 8;
+ case PIPE_FORMAT_R64G64B64A64_FLOAT:
+ return 4 * 8;
+
+ case PIPE_FORMAT_R32_SSCALED:
+ case PIPE_FORMAT_R32_SNORM:
+ case PIPE_FORMAT_R32_USCALED:
+ case PIPE_FORMAT_R32_UNORM:
+ case PIPE_FORMAT_R32_FLOAT:
+ return 4;
+ case PIPE_FORMAT_R32G32_SSCALED:
+ case PIPE_FORMAT_R32G32_SNORM:
+ case PIPE_FORMAT_R32G32_USCALED:
+ case PIPE_FORMAT_R32G32_UNORM:
+ case PIPE_FORMAT_R32G32_FLOAT:
+ return 2 * 4;
+ case PIPE_FORMAT_R32G32B32_SSCALED:
+ case PIPE_FORMAT_R32G32B32_SNORM:
+ case PIPE_FORMAT_R32G32B32_USCALED:
+ case PIPE_FORMAT_R32G32B32_UNORM:
+ case PIPE_FORMAT_R32G32B32_FLOAT:
+ return 3 * 4;
+ case PIPE_FORMAT_R32G32B32A32_SSCALED:
+ case PIPE_FORMAT_R32G32B32A32_SNORM:
+ case PIPE_FORMAT_R32G32B32A32_USCALED:
+ case PIPE_FORMAT_R32G32B32A32_UNORM:
+ case PIPE_FORMAT_R32G32B32A32_FLOAT:
+ return 4 * 4;
+
+ case PIPE_FORMAT_R16_SSCALED:
+ case PIPE_FORMAT_R16_SNORM:
+ case PIPE_FORMAT_R16_UNORM:
+ case PIPE_FORMAT_R16_USCALED:
+ return 2;
+ case PIPE_FORMAT_R16G16_SSCALED:
+ case PIPE_FORMAT_R16G16_SNORM:
+ case PIPE_FORMAT_R16G16_USCALED:
+ case PIPE_FORMAT_R16G16_UNORM:
+ return 2 * 2;
+ case PIPE_FORMAT_R16G16B16_SSCALED:
+ case PIPE_FORMAT_R16G16B16_SNORM:
+ case PIPE_FORMAT_R16G16B16_USCALED:
+ case PIPE_FORMAT_R16G16B16_UNORM:
+ return 3 * 2;
+ case PIPE_FORMAT_R16G16B16A16_SSCALED:
+ case PIPE_FORMAT_R16G16B16A16_SNORM:
+ case PIPE_FORMAT_R16G16B16A16_USCALED:
+ case PIPE_FORMAT_R16G16B16A16_UNORM:
+ return 4 * 2;
+
+ case PIPE_FORMAT_R8_SSCALED:
+ case PIPE_FORMAT_R8_SNORM:
+ case PIPE_FORMAT_R8_USCALED:
+ case PIPE_FORMAT_R8_UNORM:
+ return 1;
+ case PIPE_FORMAT_R8G8_SSCALED:
+ case PIPE_FORMAT_R8G8_SNORM:
+ case PIPE_FORMAT_R8G8_USCALED:
+ case PIPE_FORMAT_R8G8_UNORM:
+ return 2 * 1;
+ case PIPE_FORMAT_R8G8B8_SSCALED:
+ case PIPE_FORMAT_R8G8B8_SNORM:
+ case PIPE_FORMAT_R8G8B8_USCALED:
+ case PIPE_FORMAT_R8G8B8_UNORM:
+ return 3 * 1;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_R8G8B8A8_SSCALED:
+ case PIPE_FORMAT_R8G8B8A8_SNORM:
+ case PIPE_FORMAT_R8G8B8A8_USCALED:
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ return 4 * 1;
+
+ case 0:
+ return 0; /* not sure why this is needed */
+
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+/**
+ * Fetch vertex attributes for 'count' vertices.
+ */
+static void generic_vertex_fetch(struct spu_vs_context *draw,
+ struct spu_exec_machine *machine,
+ const unsigned *elts,
+ unsigned count)
+{
+ unsigned nr_attrs = draw->vertex_fetch.nr_attrs;
+ unsigned attr;
+
+ assert(count <= 4);
+
+#if DRAW_DBG
+ printf("SPU: %s count = %u, nr_attrs = %u\n",
+ __FUNCTION__, count, nr_attrs);
+#endif
+
+ /* loop over vertex attributes (vertex shader inputs)
+ */
+ for (attr = 0; attr < nr_attrs; attr++) {
+ const qword default_values = (qword)(vec_float4){ 0.0, 0.0, 0.0, 1.0 };
+ const unsigned pitch = draw->vertex_fetch.pitch[attr];
+ const uint64_t src = draw->vertex_fetch.src_ptr[attr];
+ const spu_fetch_func fetch = draw->vertex_fetch.fetch[attr];
+ unsigned i;
+ unsigned idx;
+ const unsigned bytes_per_entry = draw->vertex_fetch.size[attr];
+ const unsigned quads_per_entry = (bytes_per_entry + 15) / 16;
+ qword in[2 * 4];
+
+
+ /* Fetch four attributes for four vertices.
+ */
+ idx = 0;
+ for (i = 0; i < count; i++) {
+ const uint64_t addr = src + (elts[i] * pitch);
+
+#if DRAW_DBG
+ printf("SPU: fetching = 0x%llx\n", addr);
+#endif
+
+ fetch_unaligned(& in[idx], addr, bytes_per_entry);
+ idx += quads_per_entry;
+ }
+
+ /* Be nice and zero out any missing vertices.
+ */
+ (void) memset(& in[idx], 0, (8 - idx) * sizeof(qword));
+
+
+ /* Convert all 4 vertices to vectors of float.
+ */
+ (*fetch)(&machine->Inputs[attr].xyzw[0].q, in, default_values,
+ fetch_shuffle_data);
+ }
+}
+
+
+void spu_update_vertex_fetch( struct spu_vs_context *draw )
+{
+ unsigned i;
+
+
+ /* Invalidate the vertex cache.
+ */
+ for (i = 0; i < (CACHE_NWAY * CACHE_NSETS); i++) {
+ CACHELINE_CLEARVALID(i);
+ }
+
+
+ for (i = 0; i < draw->vertex_fetch.nr_attrs; i++) {
+ draw->vertex_fetch.fetch[i] =
+ get_fetch_func(draw->vertex_fetch.format[i]);
+ draw->vertex_fetch.size[i] =
+ get_vertex_size(draw->vertex_fetch.format[i]);
+ }
+
+ draw->vertex_fetch.fetch_func = generic_vertex_fetch;
+}
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_shader.c b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
index c1cbbb6d1e..3f5bf41aa2 100644
--- a/src/mesa/pipe/cell/spu/spu_vertex_shader.c
+++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
@@ -39,9 +39,9 @@
#include "pipe/p_shader_tokens.h"
#include "spu_vertex_shader.h"
#include "spu_exec.h"
-#include "pipe/draw/draw_private.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/cell/common.h"
+#include "draw/draw_private.h"
+#include "draw/draw_context.h"
+#include "cell/common.h"
#include "spu_main.h"
static INLINE unsigned
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_shader.h b/src/gallium/drivers/cell/spu/spu_vertex_shader.h
index c96b93ff0a..b5bf31e67d 100644
--- a/src/mesa/pipe/cell/spu/spu_vertex_shader.h
+++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.h
@@ -6,7 +6,8 @@
struct spu_vs_context;
-typedef qword (*spu_fetch_func)(const void *ptr);
+typedef void (*spu_fetch_func)(qword *out, const qword *in, qword defaults,
+ const qword *shuffle_data);
typedef void (*spu_full_fetch_func)( struct spu_vs_context *draw,
struct spu_exec_machine *machine,
const unsigned *elts,
@@ -18,6 +19,7 @@ struct spu_vs_context {
struct {
uint64_t src_ptr[PIPE_ATTRIB_MAX];
unsigned pitch[PIPE_ATTRIB_MAX];
+ unsigned size[PIPE_ATTRIB_MAX];
enum pipe_format format[PIPE_ATTRIB_MAX];
unsigned nr_attrs;
boolean dirty;
diff --git a/src/mesa/pipe/cell/spu/spu_ztest.h b/src/gallium/drivers/cell/spu/spu_ztest.h
index ce8ad00339..ce8ad00339 100644
--- a/src/mesa/pipe/cell/spu/spu_ztest.h
+++ b/src/gallium/drivers/cell/spu/spu_ztest.h
diff --git a/src/mesa/pipe/failover/Makefile b/src/gallium/drivers/failover/Makefile
index 72d0895c74..14389bd055 100644
--- a/src/mesa/pipe/failover/Makefile
+++ b/src/gallium/drivers/failover/Makefile
@@ -15,7 +15,7 @@ C_SOURCES = \
ASM_SOURCES =
-include ../Makefile.template
+include ../../Makefile.template
symlinks:
diff --git a/src/mesa/pipe/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c
index 7ce4a7df17..7ce4a7df17 100644
--- a/src/mesa/pipe/failover/fo_context.c
+++ b/src/gallium/drivers/failover/fo_context.c
diff --git a/src/mesa/pipe/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h
index 1dc87291c9..1dc87291c9 100644
--- a/src/mesa/pipe/failover/fo_context.h
+++ b/src/gallium/drivers/failover/fo_context.h
diff --git a/src/mesa/pipe/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c
index 0fc5568da1..0fc5568da1 100644
--- a/src/mesa/pipe/failover/fo_state.c
+++ b/src/gallium/drivers/failover/fo_state.c
diff --git a/src/mesa/pipe/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c
index c663dd4947..c663dd4947 100644
--- a/src/mesa/pipe/failover/fo_state_emit.c
+++ b/src/gallium/drivers/failover/fo_state_emit.c
diff --git a/src/mesa/pipe/failover/fo_winsys.h b/src/gallium/drivers/failover/fo_winsys.h
index a8ce997a1f..a8ce997a1f 100644
--- a/src/mesa/pipe/failover/fo_winsys.h
+++ b/src/gallium/drivers/failover/fo_winsys.h
diff --git a/src/mesa/pipe/i915simple/Makefile b/src/gallium/drivers/i915simple/Makefile
index 2f91de3afc..ee22ba86f9 100644
--- a/src/mesa/pipe/i915simple/Makefile
+++ b/src/gallium/drivers/i915simple/Makefile
@@ -32,7 +32,7 @@ C_SOURCES = \
ASM_SOURCES =
-include ../Makefile.template
+include ../../Makefile.template
symlinks:
diff --git a/src/mesa/pipe/i915simple/SConscript b/src/gallium/drivers/i915simple/SConscript
index f5fb96b995..f5fb96b995 100644
--- a/src/mesa/pipe/i915simple/SConscript
+++ b/src/gallium/drivers/i915simple/SConscript
diff --git a/src/mesa/pipe/i915simple/i915_batch.h b/src/gallium/drivers/i915simple/i915_batch.h
index fb88cd6db0..fb88cd6db0 100644
--- a/src/mesa/pipe/i915simple/i915_batch.h
+++ b/src/gallium/drivers/i915simple/i915_batch.h
diff --git a/src/mesa/pipe/i915simple/i915_blit.c b/src/gallium/drivers/i915simple/i915_blit.c
index db4671ff55..db4671ff55 100644
--- a/src/mesa/pipe/i915simple/i915_blit.c
+++ b/src/gallium/drivers/i915simple/i915_blit.c
diff --git a/src/mesa/pipe/i915simple/i915_blit.h b/src/gallium/drivers/i915simple/i915_blit.h
index 6e5b44e124..6e5b44e124 100644
--- a/src/mesa/pipe/i915simple/i915_blit.h
+++ b/src/gallium/drivers/i915simple/i915_blit.h
diff --git a/src/mesa/pipe/i915simple/i915_clear.c b/src/gallium/drivers/i915simple/i915_clear.c
index cde69daacc..cde69daacc 100644
--- a/src/mesa/pipe/i915simple/i915_clear.c
+++ b/src/gallium/drivers/i915simple/i915_clear.c
diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c
index 497623a700..7f71f8fd4f 100644
--- a/src/mesa/pipe/i915simple/i915_context.c
+++ b/src/gallium/drivers/i915simple/i915_context.c
@@ -32,7 +32,7 @@
#include "i915_texture.h"
#include "i915_reg.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_util.h"
diff --git a/src/mesa/pipe/i915simple/i915_context.h b/src/gallium/drivers/i915simple/i915_context.h
index b4ea63c3e7..2d876925b2 100644
--- a/src/mesa/pipe/i915simple/i915_context.h
+++ b/src/gallium/drivers/i915simple/i915_context.h
@@ -33,7 +33,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_vertex.h"
#define I915_TEX_UNITS 8
diff --git a/src/mesa/pipe/i915simple/i915_debug.c b/src/gallium/drivers/i915simple/i915_debug.c
index 94db44e1aa..94db44e1aa 100644
--- a/src/mesa/pipe/i915simple/i915_debug.c
+++ b/src/gallium/drivers/i915simple/i915_debug.c
diff --git a/src/mesa/pipe/i915simple/i915_debug.h b/src/gallium/drivers/i915simple/i915_debug.h
index 0bcd094233..0bcd094233 100644
--- a/src/mesa/pipe/i915simple/i915_debug.h
+++ b/src/gallium/drivers/i915simple/i915_debug.h
diff --git a/src/mesa/pipe/i915simple/i915_debug_fp.c b/src/gallium/drivers/i915simple/i915_debug_fp.c
index ebfdb3d93c..ebfdb3d93c 100644
--- a/src/mesa/pipe/i915simple/i915_debug_fp.c
+++ b/src/gallium/drivers/i915simple/i915_debug_fp.c
diff --git a/src/mesa/pipe/i915simple/i915_flush.c b/src/gallium/drivers/i915simple/i915_flush.c
index 3c2069b827..3c2069b827 100644
--- a/src/mesa/pipe/i915simple/i915_flush.c
+++ b/src/gallium/drivers/i915simple/i915_flush.c
diff --git a/src/mesa/pipe/i915simple/i915_fpc.h b/src/gallium/drivers/i915simple/i915_fpc.h
index 8c7b68aefb..8c7b68aefb 100644
--- a/src/mesa/pipe/i915simple/i915_fpc.h
+++ b/src/gallium/drivers/i915simple/i915_fpc.h
diff --git a/src/mesa/pipe/i915simple/i915_fpc_emit.c b/src/gallium/drivers/i915simple/i915_fpc_emit.c
index 74924ff0a1..74924ff0a1 100644
--- a/src/mesa/pipe/i915simple/i915_fpc_emit.c
+++ b/src/gallium/drivers/i915simple/i915_fpc_emit.c
diff --git a/src/mesa/pipe/i915simple/i915_fpc_translate.c b/src/gallium/drivers/i915simple/i915_fpc_translate.c
index 868f0c7e04..6c1524c768 100644
--- a/src/mesa/pipe/i915simple/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915simple/i915_fpc_translate.c
@@ -33,9 +33,9 @@
#include "i915_fpc.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_vertex.h"
/**
diff --git a/src/mesa/pipe/i915simple/i915_prim_emit.c b/src/gallium/drivers/i915simple/i915_prim_emit.c
index c4a706c37d..44c4325936 100644
--- a/src/mesa/pipe/i915simple/i915_prim_emit.c
+++ b/src/gallium/drivers/i915simple/i915_prim_emit.c
@@ -26,7 +26,7 @@
**************************************************************************/
-#include "pipe/draw/draw_private.h"
+#include "draw/draw_private.h"
#include "pipe/p_util.h"
#include "i915_context.h"
diff --git a/src/mesa/pipe/i915simple/i915_prim_vbuf.c b/src/gallium/drivers/i915simple/i915_prim_vbuf.c
index e069773fd4..c5bf6174f6 100644
--- a/src/mesa/pipe/i915simple/i915_prim_vbuf.c
+++ b/src/gallium/drivers/i915simple/i915_prim_vbuf.c
@@ -38,7 +38,7 @@
*/
-#include "pipe/draw/draw_vbuf.h"
+#include "draw/draw_vbuf.h"
#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
diff --git a/src/mesa/pipe/i915simple/i915_reg.h b/src/gallium/drivers/i915simple/i915_reg.h
index 04620fec68..04620fec68 100644
--- a/src/mesa/pipe/i915simple/i915_reg.h
+++ b/src/gallium/drivers/i915simple/i915_reg.h
diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/gallium/drivers/i915simple/i915_state.c
index abd5571b88..294e6fad03 100644
--- a/src/mesa/pipe/i915simple/i915_state.c
+++ b/src/gallium/drivers/i915simple/i915_state.c
@@ -29,7 +29,7 @@
*/
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "pipe/p_winsys.h"
#include "pipe/p_util.h"
diff --git a/src/mesa/pipe/i915simple/i915_state.h b/src/gallium/drivers/i915simple/i915_state.h
index 86c6b0027d..86c6b0027d 100644
--- a/src/mesa/pipe/i915simple/i915_state.h
+++ b/src/gallium/drivers/i915simple/i915_state.h
diff --git a/src/mesa/pipe/i915simple/i915_state_derived.c b/src/gallium/drivers/i915simple/i915_state_derived.c
index 653983e4a9..4767584fc6 100644
--- a/src/mesa/pipe/i915simple/i915_state_derived.c
+++ b/src/gallium/drivers/i915simple/i915_state_derived.c
@@ -27,8 +27,8 @@
#include "pipe/p_util.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_context.h"
+#include "draw/draw_vertex.h"
#include "i915_context.h"
#include "i915_state.h"
#include "i915_reg.h"
diff --git a/src/mesa/pipe/i915simple/i915_state_dynamic.c b/src/gallium/drivers/i915simple/i915_state_dynamic.c
index 8cfbdddd19..8cfbdddd19 100644
--- a/src/mesa/pipe/i915simple/i915_state_dynamic.c
+++ b/src/gallium/drivers/i915simple/i915_state_dynamic.c
diff --git a/src/mesa/pipe/i915simple/i915_state_emit.c b/src/gallium/drivers/i915simple/i915_state_emit.c
index 3339287f49..3339287f49 100644
--- a/src/mesa/pipe/i915simple/i915_state_emit.c
+++ b/src/gallium/drivers/i915simple/i915_state_emit.c
diff --git a/src/mesa/pipe/i915simple/i915_state_immediate.c b/src/gallium/drivers/i915simple/i915_state_immediate.c
index 07031fc6c5..07031fc6c5 100644
--- a/src/mesa/pipe/i915simple/i915_state_immediate.c
+++ b/src/gallium/drivers/i915simple/i915_state_immediate.c
diff --git a/src/mesa/pipe/i915simple/i915_state_inlines.h b/src/gallium/drivers/i915simple/i915_state_inlines.h
index 0934ac79a4..0934ac79a4 100644
--- a/src/mesa/pipe/i915simple/i915_state_inlines.h
+++ b/src/gallium/drivers/i915simple/i915_state_inlines.h
diff --git a/src/mesa/pipe/i915simple/i915_state_sampler.c b/src/gallium/drivers/i915simple/i915_state_sampler.c
index 9c1a5bbbd6..9c1a5bbbd6 100644
--- a/src/mesa/pipe/i915simple/i915_state_sampler.c
+++ b/src/gallium/drivers/i915simple/i915_state_sampler.c
diff --git a/src/mesa/pipe/i915simple/i915_strings.c b/src/gallium/drivers/i915simple/i915_strings.c
index c713bf7208..301fedea19 100644
--- a/src/mesa/pipe/i915simple/i915_strings.c
+++ b/src/gallium/drivers/i915simple/i915_strings.c
@@ -70,7 +70,7 @@ static const char *i915_get_name( struct pipe_context *pipe )
break;
}
- sprintf(buffer, "pipe/i915 (chipset: %s)", chipset);
+ sprintf(buffer, "i915 (chipset: %s)", chipset);
return buffer;
}
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/gallium/drivers/i915simple/i915_surface.c
index 6d4b8a0aa9..17fd27895a 100644
--- a/src/mesa/pipe/i915simple/i915_surface.c
+++ b/src/gallium/drivers/i915simple/i915_surface.c
@@ -33,7 +33,7 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
/*
@@ -99,7 +99,7 @@ i915_surface_copy(struct pipe_context *pipe,
dstx, dsty,
width, height,
pipe_surface_map(src),
- do_flip ? -src->pitch : src->pitch,
+ do_flip ? -(int) src->pitch : src->pitch,
srcx, do_flip ? 1 - srcy - height : srcy);
pipe_surface_unmap(src);
diff --git a/src/mesa/pipe/i915simple/i915_texture.c b/src/gallium/drivers/i915simple/i915_texture.c
index 6d37ae3d74..6d37ae3d74 100644
--- a/src/mesa/pipe/i915simple/i915_texture.c
+++ b/src/gallium/drivers/i915simple/i915_texture.c
diff --git a/src/mesa/pipe/i915simple/i915_texture.h b/src/gallium/drivers/i915simple/i915_texture.h
index 330d111dc7..330d111dc7 100644
--- a/src/mesa/pipe/i915simple/i915_texture.h
+++ b/src/gallium/drivers/i915simple/i915_texture.h
diff --git a/src/mesa/pipe/i915simple/i915_winsys.h b/src/gallium/drivers/i915simple/i915_winsys.h
index fe49710852..fe49710852 100644
--- a/src/mesa/pipe/i915simple/i915_winsys.h
+++ b/src/gallium/drivers/i915simple/i915_winsys.h
diff --git a/src/mesa/pipe/i965simple/Makefile b/src/gallium/drivers/i965simple/Makefile
index 48c00ab50b..1dec1f9749 100644
--- a/src/mesa/pipe/i965simple/Makefile
+++ b/src/gallium/drivers/i965simple/Makefile
@@ -61,6 +61,6 @@ ASM_SOURCES =
DRIVER_DEFINES = -I.
-include ../Makefile.template
+include ../../Makefile.template
symlinks:
diff --git a/src/mesa/pipe/i965simple/SConscript b/src/gallium/drivers/i965simple/SConscript
index 74621de84c..74621de84c 100644
--- a/src/mesa/pipe/i965simple/SConscript
+++ b/src/gallium/drivers/i965simple/SConscript
diff --git a/src/mesa/pipe/i965simple/brw_batch.h b/src/gallium/drivers/i965simple/brw_batch.h
index 5f5932a488..5f5932a488 100644
--- a/src/mesa/pipe/i965simple/brw_batch.h
+++ b/src/gallium/drivers/i965simple/brw_batch.h
diff --git a/src/mesa/pipe/i965simple/brw_blit.c b/src/gallium/drivers/i965simple/brw_blit.c
index 8494f70493..8494f70493 100644
--- a/src/mesa/pipe/i965simple/brw_blit.c
+++ b/src/gallium/drivers/i965simple/brw_blit.c
diff --git a/src/mesa/pipe/i965simple/brw_blit.h b/src/gallium/drivers/i965simple/brw_blit.h
index 111c5d91d3..111c5d91d3 100644
--- a/src/mesa/pipe/i965simple/brw_blit.h
+++ b/src/gallium/drivers/i965simple/brw_blit.h
diff --git a/src/mesa/pipe/i965simple/brw_cc.c b/src/gallium/drivers/i965simple/brw_cc.c
index 337e4f95f6..337e4f95f6 100644
--- a/src/mesa/pipe/i965simple/brw_cc.c
+++ b/src/gallium/drivers/i965simple/brw_cc.c
diff --git a/src/mesa/pipe/i965simple/brw_clip.c b/src/gallium/drivers/i965simple/brw_clip.c
index 268124cc53..268124cc53 100644
--- a/src/mesa/pipe/i965simple/brw_clip.c
+++ b/src/gallium/drivers/i965simple/brw_clip.c
diff --git a/src/mesa/pipe/i965simple/brw_clip.h b/src/gallium/drivers/i965simple/brw_clip.h
index a89d08b791..a89d08b791 100644
--- a/src/mesa/pipe/i965simple/brw_clip.h
+++ b/src/gallium/drivers/i965simple/brw_clip.h
diff --git a/src/mesa/pipe/i965simple/brw_clip_line.c b/src/gallium/drivers/i965simple/brw_clip_line.c
index 75d9e5fcda..75d9e5fcda 100644
--- a/src/mesa/pipe/i965simple/brw_clip_line.c
+++ b/src/gallium/drivers/i965simple/brw_clip_line.c
diff --git a/src/mesa/pipe/i965simple/brw_clip_point.c b/src/gallium/drivers/i965simple/brw_clip_point.c
index 6fce7210d1..6fce7210d1 100644
--- a/src/mesa/pipe/i965simple/brw_clip_point.c
+++ b/src/gallium/drivers/i965simple/brw_clip_point.c
diff --git a/src/mesa/pipe/i965simple/brw_clip_state.c b/src/gallium/drivers/i965simple/brw_clip_state.c
index ea5c05a279..ea5c05a279 100644
--- a/src/mesa/pipe/i965simple/brw_clip_state.c
+++ b/src/gallium/drivers/i965simple/brw_clip_state.c
diff --git a/src/mesa/pipe/i965simple/brw_clip_tri.c b/src/gallium/drivers/i965simple/brw_clip_tri.c
index c5da7b825e..c5da7b825e 100644
--- a/src/mesa/pipe/i965simple/brw_clip_tri.c
+++ b/src/gallium/drivers/i965simple/brw_clip_tri.c
diff --git a/src/mesa/pipe/i965simple/brw_clip_unfilled.c b/src/gallium/drivers/i965simple/brw_clip_unfilled.c
index b774a76dd6..b774a76dd6 100644
--- a/src/mesa/pipe/i965simple/brw_clip_unfilled.c
+++ b/src/gallium/drivers/i965simple/brw_clip_unfilled.c
diff --git a/src/mesa/pipe/i965simple/brw_clip_util.c b/src/gallium/drivers/i965simple/brw_clip_util.c
index 6d58ceafff..6d58ceafff 100644
--- a/src/mesa/pipe/i965simple/brw_clip_util.c
+++ b/src/gallium/drivers/i965simple/brw_clip_util.c
diff --git a/src/mesa/pipe/i965simple/brw_context.c b/src/gallium/drivers/i965simple/brw_context.c
index 5e58701e91..5e58701e91 100644
--- a/src/mesa/pipe/i965simple/brw_context.c
+++ b/src/gallium/drivers/i965simple/brw_context.c
diff --git a/src/mesa/pipe/i965simple/brw_context.h b/src/gallium/drivers/i965simple/brw_context.h
index 65664d853d..65664d853d 100644
--- a/src/mesa/pipe/i965simple/brw_context.h
+++ b/src/gallium/drivers/i965simple/brw_context.h
diff --git a/src/mesa/pipe/i965simple/brw_curbe.c b/src/gallium/drivers/i965simple/brw_curbe.c
index 52bbd525c1..52bbd525c1 100644
--- a/src/mesa/pipe/i965simple/brw_curbe.c
+++ b/src/gallium/drivers/i965simple/brw_curbe.c
diff --git a/src/mesa/pipe/i965simple/brw_defines.h b/src/gallium/drivers/i965simple/brw_defines.h
index 9379a397f6..9379a397f6 100644
--- a/src/mesa/pipe/i965simple/brw_defines.h
+++ b/src/gallium/drivers/i965simple/brw_defines.h
diff --git a/src/mesa/pipe/i965simple/brw_draw.c b/src/gallium/drivers/i965simple/brw_draw.c
index 7598e3dc8a..7598e3dc8a 100644
--- a/src/mesa/pipe/i965simple/brw_draw.c
+++ b/src/gallium/drivers/i965simple/brw_draw.c
diff --git a/src/mesa/pipe/i965simple/brw_draw.h b/src/gallium/drivers/i965simple/brw_draw.h
index 62fe0d5d0e..62fe0d5d0e 100644
--- a/src/mesa/pipe/i965simple/brw_draw.h
+++ b/src/gallium/drivers/i965simple/brw_draw.h
diff --git a/src/mesa/pipe/i965simple/brw_draw_upload.c b/src/gallium/drivers/i965simple/brw_draw_upload.c
index aa85d93866..aa85d93866 100644
--- a/src/mesa/pipe/i965simple/brw_draw_upload.c
+++ b/src/gallium/drivers/i965simple/brw_draw_upload.c
diff --git a/src/mesa/pipe/i965simple/brw_eu.c b/src/gallium/drivers/i965simple/brw_eu.c
index e2002d1821..e2002d1821 100644
--- a/src/mesa/pipe/i965simple/brw_eu.c
+++ b/src/gallium/drivers/i965simple/brw_eu.c
diff --git a/src/mesa/pipe/i965simple/brw_eu.h b/src/gallium/drivers/i965simple/brw_eu.h
index 23151ae9ed..23151ae9ed 100644
--- a/src/mesa/pipe/i965simple/brw_eu.h
+++ b/src/gallium/drivers/i965simple/brw_eu.h
diff --git a/src/mesa/pipe/i965simple/brw_eu_debug.c b/src/gallium/drivers/i965simple/brw_eu_debug.c
index 4a94ddefa6..4a94ddefa6 100644
--- a/src/mesa/pipe/i965simple/brw_eu_debug.c
+++ b/src/gallium/drivers/i965simple/brw_eu_debug.c
diff --git a/src/mesa/pipe/i965simple/brw_eu_emit.c b/src/gallium/drivers/i965simple/brw_eu_emit.c
index 400a80b6fb..400a80b6fb 100644
--- a/src/mesa/pipe/i965simple/brw_eu_emit.c
+++ b/src/gallium/drivers/i965simple/brw_eu_emit.c
diff --git a/src/mesa/pipe/i965simple/brw_eu_util.c b/src/gallium/drivers/i965simple/brw_eu_util.c
index 3a65b141f0..3a65b141f0 100644
--- a/src/mesa/pipe/i965simple/brw_eu_util.c
+++ b/src/gallium/drivers/i965simple/brw_eu_util.c
diff --git a/src/mesa/pipe/i965simple/brw_flush.c b/src/gallium/drivers/i965simple/brw_flush.c
index 5216c680cf..5216c680cf 100644
--- a/src/mesa/pipe/i965simple/brw_flush.c
+++ b/src/gallium/drivers/i965simple/brw_flush.c
diff --git a/src/mesa/pipe/i965simple/brw_gs.c b/src/gallium/drivers/i965simple/brw_gs.c
index de60868ccc..de60868ccc 100644
--- a/src/mesa/pipe/i965simple/brw_gs.c
+++ b/src/gallium/drivers/i965simple/brw_gs.c
diff --git a/src/mesa/pipe/i965simple/brw_gs.h b/src/gallium/drivers/i965simple/brw_gs.h
index f09141c6aa..f09141c6aa 100644
--- a/src/mesa/pipe/i965simple/brw_gs.h
+++ b/src/gallium/drivers/i965simple/brw_gs.h
diff --git a/src/mesa/pipe/i965simple/brw_gs_emit.c b/src/gallium/drivers/i965simple/brw_gs_emit.c
index c3cc90b10f..c3cc90b10f 100644
--- a/src/mesa/pipe/i965simple/brw_gs_emit.c
+++ b/src/gallium/drivers/i965simple/brw_gs_emit.c
diff --git a/src/mesa/pipe/i965simple/brw_gs_state.c b/src/gallium/drivers/i965simple/brw_gs_state.c
index 3932e9e939..3932e9e939 100644
--- a/src/mesa/pipe/i965simple/brw_gs_state.c
+++ b/src/gallium/drivers/i965simple/brw_gs_state.c
diff --git a/src/mesa/pipe/i965simple/brw_misc_state.c b/src/gallium/drivers/i965simple/brw_misc_state.c
index 925049ecc1..925049ecc1 100644
--- a/src/mesa/pipe/i965simple/brw_misc_state.c
+++ b/src/gallium/drivers/i965simple/brw_misc_state.c
diff --git a/src/mesa/pipe/i965simple/brw_reg.h b/src/gallium/drivers/i965simple/brw_reg.h
index 9e885c3b3b..9e885c3b3b 100644
--- a/src/mesa/pipe/i965simple/brw_reg.h
+++ b/src/gallium/drivers/i965simple/brw_reg.h
diff --git a/src/mesa/pipe/i965simple/brw_sf.c b/src/gallium/drivers/i965simple/brw_sf.c
index 7c83b81c85..7c83b81c85 100644
--- a/src/mesa/pipe/i965simple/brw_sf.c
+++ b/src/gallium/drivers/i965simple/brw_sf.c
diff --git a/src/mesa/pipe/i965simple/brw_sf.h b/src/gallium/drivers/i965simple/brw_sf.h
index b7ada47560..b7ada47560 100644
--- a/src/mesa/pipe/i965simple/brw_sf.h
+++ b/src/gallium/drivers/i965simple/brw_sf.h
diff --git a/src/mesa/pipe/i965simple/brw_sf_emit.c b/src/gallium/drivers/i965simple/brw_sf_emit.c
index 78d6fa5e9e..78d6fa5e9e 100644
--- a/src/mesa/pipe/i965simple/brw_sf_emit.c
+++ b/src/gallium/drivers/i965simple/brw_sf_emit.c
diff --git a/src/mesa/pipe/i965simple/brw_sf_state.c b/src/gallium/drivers/i965simple/brw_sf_state.c
index 9acd3ea61b..9acd3ea61b 100644
--- a/src/mesa/pipe/i965simple/brw_sf_state.c
+++ b/src/gallium/drivers/i965simple/brw_sf_state.c
diff --git a/src/mesa/pipe/i965simple/brw_shader_info.c b/src/gallium/drivers/i965simple/brw_shader_info.c
index 431b45466a..a762a870fe 100644
--- a/src/mesa/pipe/i965simple/brw_shader_info.c
+++ b/src/gallium/drivers/i965simple/brw_shader_info.c
@@ -3,7 +3,7 @@
#include "brw_state.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
diff --git a/src/mesa/pipe/i965simple/brw_state.c b/src/gallium/drivers/i965simple/brw_state.c
index 95dfce88e4..f746d1cc57 100644
--- a/src/mesa/pipe/i965simple/brw_state.c
+++ b/src/gallium/drivers/i965simple/brw_state.c
@@ -33,7 +33,7 @@
#include "pipe/p_winsys.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "tgsi/util/tgsi_dump.h"
#include "brw_context.h"
#include "brw_defines.h"
diff --git a/src/mesa/pipe/i965simple/brw_state.h b/src/gallium/drivers/i965simple/brw_state.h
index 258e9a556e..258e9a556e 100644
--- a/src/mesa/pipe/i965simple/brw_state.h
+++ b/src/gallium/drivers/i965simple/brw_state.h
diff --git a/src/mesa/pipe/i965simple/brw_state_batch.c b/src/gallium/drivers/i965simple/brw_state_batch.c
index 35db76b594..35db76b594 100644
--- a/src/mesa/pipe/i965simple/brw_state_batch.c
+++ b/src/gallium/drivers/i965simple/brw_state_batch.c
diff --git a/src/mesa/pipe/i965simple/brw_state_cache.c b/src/gallium/drivers/i965simple/brw_state_cache.c
index b3a5124461..b3a5124461 100644
--- a/src/mesa/pipe/i965simple/brw_state_cache.c
+++ b/src/gallium/drivers/i965simple/brw_state_cache.c
diff --git a/src/mesa/pipe/i965simple/brw_state_pool.c b/src/gallium/drivers/i965simple/brw_state_pool.c
index f3174bfe0a..f3174bfe0a 100644
--- a/src/mesa/pipe/i965simple/brw_state_pool.c
+++ b/src/gallium/drivers/i965simple/brw_state_pool.c
diff --git a/src/mesa/pipe/i965simple/brw_state_upload.c b/src/gallium/drivers/i965simple/brw_state_upload.c
index e727601e1e..e727601e1e 100644
--- a/src/mesa/pipe/i965simple/brw_state_upload.c
+++ b/src/gallium/drivers/i965simple/brw_state_upload.c
diff --git a/src/mesa/pipe/i965simple/brw_strings.c b/src/gallium/drivers/i965simple/brw_strings.c
index 29a41ed1e9..3d9c50961f 100644
--- a/src/mesa/pipe/i965simple/brw_strings.c
+++ b/src/gallium/drivers/i965simple/brw_strings.c
@@ -59,7 +59,7 @@ static const char *brw_get_name( struct pipe_context *pipe )
break;
}
- sprintf(buffer, "pipe/i965 (chipset: %s)", chipset);
+ sprintf(buffer, "i965 (chipset: %s)", chipset);
return buffer;
}
diff --git a/src/mesa/pipe/i965simple/brw_structs.h b/src/gallium/drivers/i965simple/brw_structs.h
index bbb087e95d..bbb087e95d 100644
--- a/src/mesa/pipe/i965simple/brw_structs.h
+++ b/src/gallium/drivers/i965simple/brw_structs.h
diff --git a/src/mesa/pipe/i965simple/brw_surface.c b/src/gallium/drivers/i965simple/brw_surface.c
index 518845e4b2..376a42b1a6 100644
--- a/src/mesa/pipe/i965simple/brw_surface.c
+++ b/src/gallium/drivers/i965simple/brw_surface.c
@@ -32,7 +32,7 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
/*
diff --git a/src/mesa/pipe/i965simple/brw_tex_layout.c b/src/gallium/drivers/i965simple/brw_tex_layout.c
index 90561f1307..90561f1307 100644
--- a/src/mesa/pipe/i965simple/brw_tex_layout.c
+++ b/src/gallium/drivers/i965simple/brw_tex_layout.c
diff --git a/src/mesa/pipe/i965simple/brw_tex_layout.h b/src/gallium/drivers/i965simple/brw_tex_layout.h
index cfd6b1ef3a..cfd6b1ef3a 100644
--- a/src/mesa/pipe/i965simple/brw_tex_layout.h
+++ b/src/gallium/drivers/i965simple/brw_tex_layout.h
diff --git a/src/mesa/pipe/i965simple/brw_urb.c b/src/gallium/drivers/i965simple/brw_urb.c
index 101a4367b9..101a4367b9 100644
--- a/src/mesa/pipe/i965simple/brw_urb.c
+++ b/src/gallium/drivers/i965simple/brw_urb.c
diff --git a/src/mesa/pipe/i965simple/brw_util.c b/src/gallium/drivers/i965simple/brw_util.c
index 42391d7c8c..42391d7c8c 100644
--- a/src/mesa/pipe/i965simple/brw_util.c
+++ b/src/gallium/drivers/i965simple/brw_util.c
diff --git a/src/mesa/pipe/i965simple/brw_util.h b/src/gallium/drivers/i965simple/brw_util.h
index d60e5934db..d60e5934db 100644
--- a/src/mesa/pipe/i965simple/brw_util.h
+++ b/src/gallium/drivers/i965simple/brw_util.h
diff --git a/src/mesa/pipe/i965simple/brw_vs.c b/src/gallium/drivers/i965simple/brw_vs.c
index 738c6346d5..738c6346d5 100644
--- a/src/mesa/pipe/i965simple/brw_vs.c
+++ b/src/gallium/drivers/i965simple/brw_vs.c
diff --git a/src/mesa/pipe/i965simple/brw_vs.h b/src/gallium/drivers/i965simple/brw_vs.h
index 0e58f043b0..0e58f043b0 100644
--- a/src/mesa/pipe/i965simple/brw_vs.h
+++ b/src/gallium/drivers/i965simple/brw_vs.h
diff --git a/src/mesa/pipe/i965simple/brw_vs_emit.c b/src/gallium/drivers/i965simple/brw_vs_emit.c
index 98915ba101..05df4860ed 100644
--- a/src/mesa/pipe/i965simple/brw_vs_emit.c
+++ b/src/gallium/drivers/i965simple/brw_vs_emit.c
@@ -33,7 +33,7 @@
#include "brw_vs.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
struct brw_prog_info {
unsigned num_temps;
diff --git a/src/mesa/pipe/i965simple/brw_vs_state.c b/src/gallium/drivers/i965simple/brw_vs_state.c
index c73469929c..c73469929c 100644
--- a/src/mesa/pipe/i965simple/brw_vs_state.c
+++ b/src/gallium/drivers/i965simple/brw_vs_state.c
diff --git a/src/mesa/pipe/i965simple/brw_winsys.h b/src/gallium/drivers/i965simple/brw_winsys.h
index 3523a58614..3523a58614 100644
--- a/src/mesa/pipe/i965simple/brw_winsys.h
+++ b/src/gallium/drivers/i965simple/brw_winsys.h
diff --git a/src/mesa/pipe/i965simple/brw_wm.c b/src/gallium/drivers/i965simple/brw_wm.c
index 539b170744..539b170744 100644
--- a/src/mesa/pipe/i965simple/brw_wm.c
+++ b/src/gallium/drivers/i965simple/brw_wm.c
diff --git a/src/mesa/pipe/i965simple/brw_wm.h b/src/gallium/drivers/i965simple/brw_wm.h
index a1ac0f504a..a1ac0f504a 100644
--- a/src/mesa/pipe/i965simple/brw_wm.h
+++ b/src/gallium/drivers/i965simple/brw_wm.h
diff --git a/src/mesa/pipe/i965simple/brw_wm_decl.c b/src/gallium/drivers/i965simple/brw_wm_decl.c
index b45a333a2e..97418a52e7 100644
--- a/src/mesa/pipe/i965simple/brw_wm_decl.c
+++ b/src/gallium/drivers/i965simple/brw_wm_decl.c
@@ -4,7 +4,7 @@
#include "brw_wm.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
static struct brw_reg alloc_tmp(struct brw_wm_compile *c)
{
diff --git a/src/mesa/pipe/i965simple/brw_wm_glsl.c b/src/gallium/drivers/i965simple/brw_wm_glsl.c
index d95645d108..44f946ea74 100644
--- a/src/mesa/pipe/i965simple/brw_wm_glsl.c
+++ b/src/gallium/drivers/i965simple/brw_wm_glsl.c
@@ -4,7 +4,7 @@
#include "brw_wm.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_parse.h"
diff --git a/src/mesa/pipe/i965simple/brw_wm_iz.c b/src/gallium/drivers/i965simple/brw_wm_iz.c
index 6c5f25bf39..6c5f25bf39 100644
--- a/src/mesa/pipe/i965simple/brw_wm_iz.c
+++ b/src/gallium/drivers/i965simple/brw_wm_iz.c
diff --git a/src/mesa/pipe/i965simple/brw_wm_sampler_state.c b/src/gallium/drivers/i965simple/brw_wm_sampler_state.c
index de42ffc5b1..de42ffc5b1 100644
--- a/src/mesa/pipe/i965simple/brw_wm_sampler_state.c
+++ b/src/gallium/drivers/i965simple/brw_wm_sampler_state.c
diff --git a/src/mesa/pipe/i965simple/brw_wm_state.c b/src/gallium/drivers/i965simple/brw_wm_state.c
index 5ccd488842..5ccd488842 100644
--- a/src/mesa/pipe/i965simple/brw_wm_state.c
+++ b/src/gallium/drivers/i965simple/brw_wm_state.c
diff --git a/src/mesa/pipe/i965simple/brw_wm_surface_state.c b/src/gallium/drivers/i965simple/brw_wm_surface_state.c
index d16d919bce..d16d919bce 100644
--- a/src/mesa/pipe/i965simple/brw_wm_surface_state.c
+++ b/src/gallium/drivers/i965simple/brw_wm_surface_state.c
diff --git a/src/mesa/pipe/softpipe/Makefile b/src/gallium/drivers/softpipe/Makefile
index 304632abb2..5479daf8ea 100644
--- a/src/mesa/pipe/softpipe/Makefile
+++ b/src/gallium/drivers/softpipe/Makefile
@@ -47,7 +47,7 @@ C_SOURCES = \
ASM_SOURCES =
-include ../Makefile.template
+include ../../Makefile.template
symlinks:
diff --git a/src/mesa/pipe/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript
index d581ee8d3c..d581ee8d3c 100644
--- a/src/mesa/pipe/softpipe/SConscript
+++ b/src/gallium/drivers/softpipe/SConscript
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c
index 8d295a30ca..8d295a30ca 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/gallium/drivers/softpipe/sp_clear.c
diff --git a/src/mesa/pipe/softpipe/sp_clear.h b/src/gallium/drivers/softpipe/sp_clear.h
index a8ed1c4ecc..a8ed1c4ecc 100644
--- a/src/mesa/pipe/softpipe/sp_clear.h
+++ b/src/gallium/drivers/softpipe/sp_clear.h
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index cea6b90104..5e98f190bb 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -29,7 +29,7 @@
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_util.h"
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 5e24baf938..b70d4fea85 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -34,7 +34,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_vertex.h"
#include "sp_quad.h"
diff --git a/src/mesa/pipe/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 71a303a8b5..2049afda34 100644
--- a/src/mesa/pipe/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -38,7 +38,7 @@
#include "sp_context.h"
#include "sp_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
diff --git a/src/mesa/pipe/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c
index ec6bb4a0dc..2cbd0d7cab 100644
--- a/src/mesa/pipe/softpipe/sp_flush.c
+++ b/src/gallium/drivers/softpipe/sp_flush.c
@@ -31,6 +31,7 @@
#include "pipe/p_defines.h"
+#include "draw/draw_context.h"
#include "sp_flush.h"
#include "sp_context.h"
#include "sp_surface.h"
@@ -50,6 +51,8 @@ softpipe_flush( struct pipe_context *pipe,
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i;
+ draw_flush(softpipe->draw);
+
/* - flush the quad pipeline
* - flush the texture cache
* - flush the render cache
diff --git a/src/mesa/pipe/softpipe/sp_flush.h b/src/gallium/drivers/softpipe/sp_flush.h
index 34ec617866..34ec617866 100644
--- a/src/mesa/pipe/softpipe/sp_flush.h
+++ b/src/gallium/drivers/softpipe/sp_flush.h
diff --git a/src/gallium/drivers/softpipe/sp_fs.h b/src/gallium/drivers/softpipe/sp_fs.h
new file mode 100644
index 0000000000..4792ace3a3
--- /dev/null
+++ b/src/gallium/drivers/softpipe/sp_fs.h
@@ -0,0 +1,54 @@
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/* Authors: Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef SP_FS_H
+#define SP_FS_H
+
+struct sp_fragment_shader *
+softpipe_create_fs_exec(struct softpipe_context *softpipe,
+ const struct pipe_shader_state *templ);
+
+struct sp_fragment_shader *
+softpipe_create_fs_sse(struct softpipe_context *softpipe,
+ const struct pipe_shader_state *templ);
+
+struct sp_fragment_shader *
+softpipe_create_fs_llvm(struct softpipe_context *softpipe,
+ const struct pipe_shader_state *templ);
+
+struct tgsi_interp_coef;
+struct tgsi_exec_vector;
+
+void sp_setup_pos_vector(const struct tgsi_interp_coef *coef,
+ float x, float y,
+ struct tgsi_exec_vector *quadpos);
+
+
+#endif
diff --git a/src/mesa/pipe/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c
index b949492e09..9ad30a7681 100644
--- a/src/mesa/pipe/softpipe/sp_fs_exec.c
+++ b/src/gallium/drivers/softpipe/sp_fs_exec.c
@@ -36,7 +36,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_exec.h"
struct sp_exec_fragment_shader {
struct sp_fragment_shader base;
diff --git a/src/mesa/pipe/softpipe/sp_fs_llvm.c b/src/gallium/drivers/softpipe/sp_fs_llvm.c
index 9237c1fbda..22da471453 100644
--- a/src/mesa/pipe/softpipe/sp_fs_llvm.c
+++ b/src/gallium/drivers/softpipe/sp_fs_llvm.c
@@ -38,7 +38,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/tgsi/exec/tgsi_sse2.h"
+#include "tgsi/exec/tgsi_sse2.h"
#if 0
diff --git a/src/mesa/pipe/softpipe/sp_fs_sse.c b/src/gallium/drivers/softpipe/sp_fs_sse.c
index 713ece369e..28c5d8c556 100644
--- a/src/mesa/pipe/softpipe/sp_fs_sse.c
+++ b/src/gallium/drivers/softpipe/sp_fs_sse.c
@@ -36,8 +36,8 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
-#include "pipe/tgsi/exec/tgsi_sse2.h"
+#include "tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_sse2.h"
#if defined(__i386__) || defined(__386__)
diff --git a/src/mesa/pipe/softpipe/sp_headers.h b/src/gallium/drivers/softpipe/sp_headers.h
index 0ae31d8796..9cf8222133 100644
--- a/src/mesa/pipe/softpipe/sp_headers.h
+++ b/src/gallium/drivers/softpipe/sp_headers.h
@@ -31,7 +31,7 @@
#ifndef SP_HEADERS_H
#define SP_HEADERS_H
-#include "pipe/tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_exec.h"
#define PRIM_POINT 1
#define PRIM_LINE 2
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/gallium/drivers/softpipe/sp_prim_setup.c
index 7478b2336b..d73521ccbe 100644
--- a/src/mesa/pipe/softpipe/sp_prim_setup.c
+++ b/src/gallium/drivers/softpipe/sp_prim_setup.c
@@ -38,8 +38,8 @@
#include "sp_quad.h"
#include "sp_state.h"
#include "sp_prim_setup.h"
-#include "pipe/draw/draw_private.h"
-#include "pipe/draw/draw_vertex.h"
+#include "draw/draw_private.h"
+#include "draw/draw_vertex.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
@@ -499,7 +499,7 @@ setup_fragcoord_coeff(struct setup_stage *setup)
setup->coef[0].a0[2] = setup->posCoef.a0[2];
setup->coef[0].dadx[2] = setup->posCoef.dadx[2];
setup->coef[0].dady[2] = setup->posCoef.dady[2];
- /*w*/
+ /*W*/
setup->coef[0].a0[3] = setup->posCoef.a0[3];
setup->coef[0].dadx[3] = setup->posCoef.dadx[3];
setup->coef[0].dady[3] = setup->posCoef.dady[3];
@@ -513,8 +513,9 @@ setup_fragcoord_coeff(struct setup_stage *setup)
*/
static void setup_tri_coefficients( struct setup_stage *setup )
{
- const struct softpipe_context *softpipe = setup->softpipe;
+ struct softpipe_context *softpipe = setup->softpipe;
const struct pipe_shader_state *fs = &softpipe->fs->shader;
+ const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
uint fragSlot;
/* z and w are done by linear interpolation:
@@ -525,10 +526,10 @@ static void setup_tri_coefficients( struct setup_stage *setup )
/* setup interpolation for all the remaining attributes:
*/
for (fragSlot = 0; fragSlot < fs->num_inputs; fragSlot++) {
- const uint vertSlot = softpipe->vertex_info.src_index[fragSlot];
+ const uint vertSlot = vinfo->src_index[fragSlot];
uint j;
- switch (softpipe->vertex_info.interp_mode[fragSlot]) {
+ switch (vinfo->interp_mode[fragSlot]) {
case INTERP_CONSTANT:
for (j = 0; j < NUM_CHANNELS; j++)
const_coeff(setup, &setup->coef[fragSlot], vertSlot, j);
@@ -756,8 +757,9 @@ line_persp_coeff(struct setup_stage *setup,
static INLINE void
setup_line_coefficients(struct setup_stage *setup, struct prim_header *prim)
{
- const struct softpipe_context *softpipe = setup->softpipe;
+ struct softpipe_context *softpipe = setup->softpipe;
const struct pipe_shader_state *fs = &setup->softpipe->fs->shader;
+ const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
uint fragSlot;
/* use setup->vmin, vmax to point to vertices */
@@ -779,10 +781,10 @@ setup_line_coefficients(struct setup_stage *setup, struct prim_header *prim)
/* setup interpolation for all the remaining attributes:
*/
for (fragSlot = 0; fragSlot < fs->num_inputs; fragSlot++) {
- const uint vertSlot = softpipe->vertex_info.src_index[fragSlot];
+ const uint vertSlot = vinfo->src_index[fragSlot];
uint j;
- switch (softpipe->vertex_info.interp_mode[fragSlot]) {
+ switch (vinfo->interp_mode[fragSlot]) {
case INTERP_CONSTANT:
for (j = 0; j < NUM_CHANNELS; j++)
const_coeff(setup, &setup->coef[fragSlot], vertSlot, j);
@@ -978,6 +980,7 @@ setup_point(struct draw_stage *stage, struct prim_header *prim)
const boolean round = (boolean) setup->softpipe->rasterizer->point_smooth;
const float x = v0->data[0][0]; /* Note: data[0] is always position */
const float y = v0->data[0][1];
+ const struct vertex_info *vinfo = softpipe_get_vertex_info(softpipe);
uint fragSlot;
/* For points, all interpolants are constant-valued.
@@ -1003,10 +1006,10 @@ setup_point(struct draw_stage *stage, struct prim_header *prim)
const_coeff(setup, &setup->posCoef, 0, 3);
for (fragSlot = 0; fragSlot < fs->num_inputs; fragSlot++) {
- const uint vertSlot = softpipe->vertex_info.src_index[fragSlot];
+ const uint vertSlot = vinfo->src_index[fragSlot];
uint j;
- switch (softpipe->vertex_info.interp_mode[fragSlot]) {
+ switch (vinfo->interp_mode[fragSlot]) {
case INTERP_CONSTANT:
/* fall-through */
case INTERP_LINEAR:
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.h b/src/gallium/drivers/softpipe/sp_prim_setup.h
index f3e8a79dd9..f3e8a79dd9 100644
--- a/src/mesa/pipe/softpipe/sp_prim_setup.h
+++ b/src/gallium/drivers/softpipe/sp_prim_setup.h
diff --git a/src/mesa/pipe/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index c9089e7eb2..69bea8a8f5 100644
--- a/src/mesa/pipe/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -37,10 +37,11 @@
#include "sp_context.h"
+#include "sp_state.h"
#include "sp_prim_vbuf.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_private.h"
-#include "pipe/draw/draw_vbuf.h"
+#include "draw/draw_context.h"
+#include "draw/draw_private.h"
+#include "draw/draw_vbuf.h"
#define SP_MAX_VBUF_INDEXES 1024
@@ -73,9 +74,7 @@ static const struct vertex_info *
sp_vbuf_get_vertex_info(struct vbuf_render *vbr)
{
struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
- /* XXX check for state changes? */
- assert(!cvbr->softpipe->dirty );
- return &cvbr->softpipe->vertex_info_vbuf;
+ return softpipe_get_vbuf_vertex_info(cvbr->softpipe);
}
diff --git a/src/mesa/pipe/softpipe/sp_prim_vbuf.h b/src/gallium/drivers/softpipe/sp_prim_vbuf.h
index 1de9cc2a89..1de9cc2a89 100644
--- a/src/mesa/pipe/softpipe/sp_prim_vbuf.h
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.h
diff --git a/src/mesa/pipe/softpipe/sp_quad.c b/src/gallium/drivers/softpipe/sp_quad.c
index 6bd468a51c..6bd468a51c 100644
--- a/src/mesa/pipe/softpipe/sp_quad.c
+++ b/src/gallium/drivers/softpipe/sp_quad.c
diff --git a/src/mesa/pipe/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h
index f1e0281764..f1e0281764 100644
--- a/src/mesa/pipe/softpipe/sp_quad.h
+++ b/src/gallium/drivers/softpipe/sp_quad.h
diff --git a/src/mesa/pipe/softpipe/sp_quad_alpha_test.c b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c
index 4ffeac35e1..4ffeac35e1 100644
--- a/src/mesa/pipe/softpipe/sp_quad_alpha_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_alpha_test.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index 17f3ecd0b8..17f3ecd0b8 100644
--- a/src/mesa/pipe/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_bufloop.c b/src/gallium/drivers/softpipe/sp_quad_bufloop.c
index 2ae4e22a7d..2ae4e22a7d 100644
--- a/src/mesa/pipe/softpipe/sp_quad_bufloop.c
+++ b/src/gallium/drivers/softpipe/sp_quad_bufloop.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_colormask.c b/src/gallium/drivers/softpipe/sp_quad_colormask.c
index 1f09d900ca..1f09d900ca 100644
--- a/src/mesa/pipe/softpipe/sp_quad_colormask.c
+++ b/src/gallium/drivers/softpipe/sp_quad_colormask.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_coverage.c b/src/gallium/drivers/softpipe/sp_quad_coverage.c
index b3d3fae22f..b3d3fae22f 100644
--- a/src/mesa/pipe/softpipe/sp_quad_coverage.c
+++ b/src/gallium/drivers/softpipe/sp_quad_coverage.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index a9a0754f27..a9a0754f27 100644
--- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_earlyz.c b/src/gallium/drivers/softpipe/sp_quad_earlyz.c
index 22ea99049f..22ea99049f 100644
--- a/src/mesa/pipe/softpipe/sp_quad_earlyz.c
+++ b/src/gallium/drivers/softpipe/sp_quad_earlyz.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index cf1b1eff75..cf1b1eff75 100644
--- a/src/mesa/pipe/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_occlusion.c b/src/gallium/drivers/softpipe/sp_quad_occlusion.c
index 54254df1f1..54254df1f1 100644
--- a/src/mesa/pipe/softpipe/sp_quad_occlusion.c
+++ b/src/gallium/drivers/softpipe/sp_quad_occlusion.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_output.c b/src/gallium/drivers/softpipe/sp_quad_output.c
index cfe8f11808..cfe8f11808 100644
--- a/src/mesa/pipe/softpipe/sp_quad_output.c
+++ b/src/gallium/drivers/softpipe/sp_quad_output.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/gallium/drivers/softpipe/sp_quad_stencil.c
index 92a0da0083..92a0da0083 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/gallium/drivers/softpipe/sp_quad_stencil.c
diff --git a/src/mesa/pipe/softpipe/sp_quad_stipple.c b/src/gallium/drivers/softpipe/sp_quad_stipple.c
index 8660432259..8660432259 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stipple.c
+++ b/src/gallium/drivers/softpipe/sp_quad_stipple.c
diff --git a/src/mesa/pipe/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index 6a8a43aeda..adf9ccf64c 100644
--- a/src/mesa/pipe/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
@@ -29,7 +29,7 @@
* Keith Whitwell <keith@tungstengraphics.com>
*/
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_util.h"
diff --git a/src/mesa/pipe/softpipe/sp_query.h b/src/gallium/drivers/softpipe/sp_query.h
index 05060a4575..05060a4575 100644
--- a/src/mesa/pipe/softpipe/sp_query.h
+++ b/src/gallium/drivers/softpipe/sp_query.h
diff --git a/src/mesa/pipe/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h
index 431952f1aa..ef8cf67d4c 100644
--- a/src/mesa/pipe/softpipe/sp_state.h
+++ b/src/gallium/drivers/softpipe/sp_state.h
@@ -78,6 +78,7 @@ struct sp_fragment_shader {
void (*delete)( struct sp_fragment_shader * );
};
+struct vertex_info;
/** Subclass of pipe_shader_state */
struct sp_vertex_shader {
@@ -181,4 +182,12 @@ softpipe_map_texture_surfaces(struct softpipe_context *sp);
void
softpipe_unmap_texture_surfaces(struct softpipe_context *sp);
+
+struct vertex_info *
+softpipe_get_vertex_info(struct softpipe_context *softpipe);
+
+struct vertex_info *
+softpipe_get_vbuf_vertex_info(struct softpipe_context *softpipe);
+
+
#endif
diff --git a/src/mesa/pipe/softpipe/sp_state_blend.c b/src/gallium/drivers/softpipe/sp_state_blend.c
index 2d40d6bd8f..2d40d6bd8f 100644
--- a/src/mesa/pipe/softpipe/sp_state_blend.c
+++ b/src/gallium/drivers/softpipe/sp_state_blend.c
diff --git a/src/mesa/pipe/softpipe/sp_state_clip.c b/src/gallium/drivers/softpipe/sp_state_clip.c
index 08c5f06d05..c797c0dd3b 100644
--- a/src/mesa/pipe/softpipe/sp_state_clip.c
+++ b/src/gallium/drivers/softpipe/sp_state_clip.c
@@ -29,7 +29,7 @@
*/
#include "sp_context.h"
#include "sp_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
void softpipe_set_clip_state( struct pipe_context *pipe,
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c
new file mode 100644
index 0000000000..9d8fd8b750
--- /dev/null
+++ b/src/gallium/drivers/softpipe/sp_state_derived.c
@@ -0,0 +1,235 @@
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "pipe/p_util.h"
+#include "pipe/p_shader_tokens.h"
+#include "draw/draw_context.h"
+#include "draw/draw_vertex.h"
+#include "draw/draw_private.h"
+#include "sp_context.h"
+#include "sp_state.h"
+
+
+/**
+ * Search vertex program's outputs to find a match for the given
+ * semantic name/index. Return the index of the output slot.
+ *
+ * Return 0 if not found. This will cause the fragment program to use
+ * vertex attrib 0 (position) in the cases where the fragment program
+ * attempts to use a missing vertex program output. This is an undefined
+ * condition that users shouldn't hit anyway.
+ */
+static int
+find_vs_output(const struct pipe_shader_state *vs,
+ uint semantic_name,
+ uint semantic_index)
+{
+ uint i;
+ for (i = 0; i < vs->num_outputs; i++) {
+ if (vs->output_semantic_name[i] == semantic_name &&
+ vs->output_semantic_index[i] == semantic_index)
+ return i;
+ }
+ return 0;
+}
+
+
+/**
+ * Mark the current vertex layout as "invalid".
+ * We'll validate the vertex layout later, when we start to actually
+ * render a point or line or tri.
+ */
+static void
+invalidate_vertex_layout(struct softpipe_context *softpipe)
+{
+ softpipe->vertex_info.num_attribs = 0;
+}
+
+
+/**
+ * The vertex info describes how to convert the post-transformed vertices
+ * (simple float[][4]) used by the 'draw' module into vertices for
+ * rasterization.
+ *
+ * This function validates the vertex layout and returns a pointer to a
+ * vertex_info object.
+ */
+struct vertex_info *
+softpipe_get_vertex_info(struct softpipe_context *softpipe)
+{
+ struct vertex_info *vinfo = &softpipe->vertex_info;
+
+ if (vinfo->num_attribs == 0) {
+ /* compute vertex layout now */
+ const struct pipe_shader_state *vs = &softpipe->vs->shader;
+ const struct pipe_shader_state *fs = &softpipe->fs->shader;
+ const enum interp_mode colorInterp
+ = softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR;
+ uint i;
+
+ if (softpipe->vbuf) {
+ /* if using the post-transform vertex buffer, tell draw_vbuf to
+ * simply emit the whole post-xform vertex as-is:
+ */
+ struct vertex_info *vinfo_vbuf = &softpipe->vertex_info_vbuf;
+ vinfo_vbuf->num_attribs = 0;
+ draw_emit_vertex_attr(vinfo_vbuf, EMIT_ALL, INTERP_NONE, 0);
+ vinfo_vbuf->size = 4 * vs->num_outputs
+ + sizeof(struct vertex_header) / 4;
+ }
+
+ /*
+ * Loop over fragment shader inputs, searching for the matching output
+ * from the vertex shader.
+ */
+ vinfo->num_attribs = 0;
+ for (i = 0; i < fs->num_inputs; i++) {
+ int src;
+ switch (fs->input_semantic_name[i]) {
+ case TGSI_SEMANTIC_POSITION:
+ src = find_vs_output(vs, TGSI_SEMANTIC_POSITION, 0);
+ draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_POS, src);
+ break;
+
+ case TGSI_SEMANTIC_COLOR:
+ src = find_vs_output(vs, TGSI_SEMANTIC_COLOR,
+ fs->input_semantic_index[i]);
+ draw_emit_vertex_attr(vinfo, EMIT_4F, colorInterp, src);
+ break;
+
+ case TGSI_SEMANTIC_FOG:
+ src = find_vs_output(vs, TGSI_SEMANTIC_FOG, 0);
+ draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
+ break;
+
+ case TGSI_SEMANTIC_GENERIC:
+ /* this includes texcoords and varying vars */
+ src = find_vs_output(vs, TGSI_SEMANTIC_GENERIC,
+ fs->input_semantic_index[i]);
+ draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
+ break;
+
+ default:
+ assert(0);
+ }
+ }
+
+ softpipe->psize_slot = find_vs_output(vs, TGSI_SEMANTIC_PSIZE, 0);
+ if (softpipe->psize_slot > 0) {
+ draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT,
+ softpipe->psize_slot);
+ }
+
+ draw_compute_vertex_size(vinfo);
+ }
+
+ return vinfo;
+}
+
+
+/**
+ * Called from vbuf module.
+ *
+ * Note that there's actually two different vertex layouts in softpipe.
+ *
+ * The normal one is computed in softpipe_get_vertex_info() above and is
+ * used by the point/line/tri "setup" code.
+ *
+ * The other one (this one) is only used by the vbuf module (which is
+ * not normally used by default but used in testing). For the vbuf module,
+ * we basically want to pass-through the draw module's vertex layout as-is.
+ * When the softpipe vbuf code begins drawing, the normal vertex layout
+ * will come into play again.
+ */
+struct vertex_info *
+softpipe_get_vbuf_vertex_info(struct softpipe_context *softpipe)
+{
+ (void) softpipe_get_vertex_info(softpipe);
+ return &softpipe->vertex_info_vbuf;
+}
+
+
+/**
+ * Recompute cliprect from scissor bounds, scissor enable and surface size.
+ */
+static void
+compute_cliprect(struct softpipe_context *sp)
+{
+ unsigned surfWidth, surfHeight;
+
+ if (sp->framebuffer.num_cbufs > 0) {
+ surfWidth = sp->framebuffer.cbufs[0]->width;
+ surfHeight = sp->framebuffer.cbufs[0]->height;
+ }
+ else {
+ /* no surface? */
+ surfWidth = sp->scissor.maxx;
+ surfHeight = sp->scissor.maxy;
+ }
+
+ if (sp->rasterizer->scissor) {
+ /* clip to scissor rect */
+ sp->cliprect.minx = MAX2(sp->scissor.minx, 0);
+ sp->cliprect.miny = MAX2(sp->scissor.miny, 0);
+ sp->cliprect.maxx = MIN2(sp->scissor.maxx, surfWidth);
+ sp->cliprect.maxy = MIN2(sp->scissor.maxy, surfHeight);
+ }
+ else {
+ /* clip to surface bounds */
+ sp->cliprect.minx = 0;
+ sp->cliprect.miny = 0;
+ sp->cliprect.maxx = surfWidth;
+ sp->cliprect.maxy = surfHeight;
+ }
+}
+
+
+/* Hopefully this will remain quite simple, otherwise need to pull in
+ * something like the state tracker mechanism.
+ */
+void softpipe_update_derived( struct softpipe_context *softpipe )
+{
+ if (softpipe->dirty & (SP_NEW_RASTERIZER |
+ SP_NEW_FS |
+ SP_NEW_VS))
+ invalidate_vertex_layout( softpipe );
+
+ if (softpipe->dirty & (SP_NEW_SCISSOR |
+ SP_NEW_DEPTH_STENCIL_ALPHA |
+ SP_NEW_FRAMEBUFFER))
+ compute_cliprect(softpipe);
+
+ if (softpipe->dirty & (SP_NEW_BLEND |
+ SP_NEW_DEPTH_STENCIL_ALPHA |
+ SP_NEW_FRAMEBUFFER |
+ SP_NEW_RASTERIZER |
+ SP_NEW_FS |
+ SP_NEW_QUERY))
+ sp_build_quad_pipeline(softpipe);
+
+ softpipe->dirty = 0;
+}
diff --git a/src/mesa/pipe/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index c43f28583e..b0238f8173 100644
--- a/src/mesa/pipe/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -34,8 +34,8 @@
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "draw/draw_context.h"
+#include "tgsi/util/tgsi_dump.h"
void *
diff --git a/src/mesa/pipe/softpipe/sp_state_rasterizer.c b/src/gallium/drivers/softpipe/sp_state_rasterizer.c
index 53755099dd..98e04352db 100644
--- a/src/mesa/pipe/softpipe/sp_state_rasterizer.c
+++ b/src/gallium/drivers/softpipe/sp_state_rasterizer.c
@@ -29,7 +29,7 @@
#include "pipe/p_util.h"
#include "sp_context.h"
#include "sp_state.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
diff --git a/src/mesa/pipe/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c
index 6a5a643c89..460adccec4 100644
--- a/src/mesa/pipe/softpipe/sp_state_sampler.c
+++ b/src/gallium/drivers/softpipe/sp_state_sampler.c
@@ -30,11 +30,15 @@
*/
#include "pipe/p_util.h"
+
+#include "draw/draw_context.h"
+
+#include "sp_context.h"
#include "sp_context.h"
#include "sp_state.h"
#include "sp_texture.h"
#include "sp_tile_cache.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
diff --git a/src/mesa/pipe/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c
index e2c6893e9f..e2c6893e9f 100644
--- a/src/mesa/pipe/softpipe/sp_state_surface.c
+++ b/src/gallium/drivers/softpipe/sp_state_surface.c
diff --git a/src/mesa/pipe/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c
index 09ff540ccf..f01a10de3b 100644
--- a/src/mesa/pipe/softpipe/sp_state_vertex.c
+++ b/src/gallium/drivers/softpipe/sp_state_vertex.c
@@ -33,7 +33,7 @@
#include "sp_state.h"
#include "sp_surface.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_context.h"
void
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c
index 5c6ed3b8d9..653449c4f1 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/gallium/drivers/softpipe/sp_surface.c
@@ -29,7 +29,7 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#include "sp_context.h"
#include "sp_surface.h"
@@ -54,7 +54,7 @@ sp_surface_copy(struct pipe_context *pipe,
dstx, dsty,
width, height,
pipe_surface_map(src),
- do_flip ? -src->pitch : src->pitch,
+ do_flip ? -(int) src->pitch : src->pitch,
srcx, do_flip ? 1 - srcy - height : srcy);
pipe_surface_unmap(src);
diff --git a/src/mesa/pipe/softpipe/sp_surface.h b/src/gallium/drivers/softpipe/sp_surface.h
index 22de3ba43f..22de3ba43f 100644
--- a/src/mesa/pipe/softpipe/sp_surface.h
+++ b/src/gallium/drivers/softpipe/sp_surface.h
diff --git a/src/mesa/pipe/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 325bdb86da..2f82fd6abe 100644
--- a/src/mesa/pipe/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -40,7 +40,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
-#include "pipe/tgsi/exec/tgsi_exec.h"
+#include "tgsi/exec/tgsi_exec.h"
/*
diff --git a/src/mesa/pipe/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h
index 404bfd0c36..404bfd0c36 100644
--- a/src/mesa/pipe/softpipe/sp_tex_sample.h
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.h
diff --git a/src/mesa/pipe/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 6de7a9b543..6de7a9b543 100644
--- a/src/mesa/pipe/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
diff --git a/src/mesa/pipe/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h
index fa646c0de9..fa646c0de9 100644
--- a/src/mesa/pipe/softpipe/sp_texture.h
+++ b/src/gallium/drivers/softpipe/sp_texture.h
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 1597361b82..dde3fabc81 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -34,7 +34,7 @@
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#include "sp_context.h"
#include "sp_surface.h"
#include "sp_tile_cache.h"
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h
index 7fd1081286..7fd1081286 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.h
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.h
diff --git a/src/mesa/pipe/softpipe/sp_winsys.h b/src/gallium/drivers/softpipe/sp_winsys.h
index d6b379f58c..d6b379f58c 100644
--- a/src/mesa/pipe/softpipe/sp_winsys.h
+++ b/src/gallium/drivers/softpipe/sp_winsys.h
diff --git a/src/mesa/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 30cd729c56..30cd729c56 100644
--- a/src/mesa/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
diff --git a/src/mesa/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 39f95695fb..39f95695fb 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
diff --git a/src/mesa/pipe/p_debug.h b/src/gallium/include/pipe/p_debug.h
index 2a11627b36..2a11627b36 100644
--- a/src/mesa/pipe/p_debug.h
+++ b/src/gallium/include/pipe/p_debug.h
diff --git a/src/mesa/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 0bf53ecb79..0bf53ecb79 100644
--- a/src/mesa/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
diff --git a/src/mesa/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index c9ad324315..c9ad324315 100644
--- a/src/mesa/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
diff --git a/src/mesa/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index ebf6ed86bc..ebf6ed86bc 100644
--- a/src/mesa/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
diff --git a/src/mesa/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 3ce35310f6..3ce35310f6 100644
--- a/src/mesa/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
diff --git a/src/mesa/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 1082343e2f..1082343e2f 100644
--- a/src/mesa/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
diff --git a/src/mesa/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index cd432c547c..cd432c547c 100644
--- a/src/mesa/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
diff --git a/src/mesa/pipe/p_util.h b/src/gallium/include/pipe/p_util.h
index a8938a7e43..d7da2801c9 100644
--- a/src/mesa/pipe/p_util.h
+++ b/src/gallium/include/pipe/p_util.h
@@ -185,12 +185,12 @@ align_free(void *ptr)
/**
- * Duplicate of a block of memory
+ * Duplicate a block of memory.
*/
static INLINE void *
mem_dup(const void *src, uint size)
{
- void *dup = malloc(size);
+ void *dup = MALLOC(size);
if (dup)
memcpy(dup, src, size);
return dup;
diff --git a/src/mesa/pipe/p_winsys.h b/src/gallium/include/pipe/p_winsys.h
index 1e81eebd78..1e81eebd78 100644
--- a/src/mesa/pipe/p_winsys.h
+++ b/src/gallium/include/pipe/p_winsys.h
diff --git a/src/gallium/state_trackers/README b/src/gallium/state_trackers/README
new file mode 100644
index 0000000000..28dd27bbd5
--- /dev/null
+++ b/src/gallium/state_trackers/README
@@ -0,0 +1,2 @@
+This directory is a placeholder for incubating state-trackers. Mesa's
+state-tracker is in src/mesa.
diff --git a/src/gallium/winsys/dri/Makefile b/src/gallium/winsys/dri/Makefile
new file mode 100644
index 0000000000..f466ce6c3c
--- /dev/null
+++ b/src/gallium/winsys/dri/Makefile
@@ -0,0 +1,38 @@
+# src/mesa/drivers/dri/Makefile
+
+TOP = ../../../..
+
+include $(TOP)/configs/current
+
+
+
+default: $(TOP)/$(LIB_DIR) subdirs
+
+
+$(TOP)/$(LIB_DIR):
+ -mkdir $(TOP)/$(LIB_DIR)
+
+
+subdirs:
+ @for dir in $(DRI_DIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE)) || exit 1 ; \
+ fi \
+ done
+
+
+install:
+ @for dir in $(DRI_DIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE) install) || exit 1 ; \
+ fi \
+ done
+
+
+clean:
+ @for dir in $(DRI_DIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE) clean) ; \
+ fi \
+ done
+ -rm -f common/*.o
diff --git a/src/gallium/winsys/dri/Makefile.template b/src/gallium/winsys/dri/Makefile.template
new file mode 100644
index 0000000000..b96305c094
--- /dev/null
+++ b/src/gallium/winsys/dri/Makefile.template
@@ -0,0 +1,113 @@
+# -*-makefile-*-
+
+MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+
+COMMON_GALLIUM_SOURCES = \
+ $(TOP)/src/mesa/drivers/dri/common/utils.c \
+ $(TOP)/src/mesa/drivers/dri/common/vblank.c \
+ $(TOP)/src/mesa/drivers/dri/common/dri_util.c \
+ $(TOP)/src/mesa/drivers/dri/common/xmlconfig.c
+
+COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
+ $(TOP)/src/mesa/drivers/common/driverfuncs.c \
+ $(TOP)/src/mesa/drivers/dri/common/texmem.c \
+ $(TOP)/src/mesa/drivers/dri/common/drirenderbuffer.c
+
+COMMON_BM_SOURCES = \
+ $(TOP)/src/mesa/drivers/dri/common/dri_bufmgr.c \
+ $(TOP)/src/mesa/drivers/dri/common/dri_drmpool.c
+
+
+ifeq ($(WINDOW_SYSTEM),dri)
+WINOBJ=
+WINLIB=
+INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+ $(ASM_SOURCES:.S=.o)
+
+else
+# miniglx
+WINOBJ=
+WINLIB=-L$(MESA)/src/glx/mini
+MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+INCLUDES = $(MINIGLX_INCLUDES) \
+ $(SHARED_INCLUDES) \
+ $(PCIACCESS_CFLAGS)
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+ $(MINIGLX_SOURCES:.c=.o) \
+ $(ASM_SOURCES:.S=.o)
+endif
+
+
+### Include directories
+SHARED_INCLUDES = \
+ -I. \
+ -I$(TOP)/src/mesa/drivers/dri/common \
+ -Iserver \
+ -I$(TOP)/include \
+ -I$(TOP)/include/GL/internal \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/aux \
+ -I$(TOP)/src/gallium/drivers \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/mesa/main \
+ -I$(TOP)/src/mesa/glapi \
+ -I$(TOP)/src/mesa/math \
+ -I$(TOP)/src/mesa/transform \
+ -I$(TOP)/src/mesa/shader \
+ -I$(TOP)/src/mesa/swrast \
+ -I$(TOP)/src/mesa/swrast_setup \
+ -I$(TOP)/src/egl/main \
+ -I$(TOP)/src/egl/drivers/dri \
+ $(LIBDRM_CFLAGS)
+
+
+##### RULES #####
+
+.c.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+.S.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+
+##### TARGETS #####
+
+default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
+
+
+$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
+ $(TOP)/bin/mklib -noprefix -o $@ \
+ $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
+
+
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
+
+
+depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
+ rm -f depend
+ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
+ $(ASM_SOURCES) 2> /dev/null
+
+
+# Emacs tags
+tags:
+ etags `find . -name \*.[ch]` `find ../include`
+
+
+# Remove .o and backup files
+clean:
+ -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
+ -rm -f depend depend.bak
+
+
+install: $(LIBNAME)
+ $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
+ $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
+
+
+include depend
diff --git a/src/mesa/drivers/dri/intel_winsys/Makefile b/src/gallium/winsys/dri/intel/Makefile
index 9ae0f01325..40654bb2ac 100644
--- a/src/mesa/drivers/dri/intel_winsys/Makefile
+++ b/src/gallium/winsys/dri/intel/Makefile
@@ -7,8 +7,8 @@ LIBNAME = i915tex_dri.so
MINIGLX_SOURCES = server/intel_dri.c
PIPE_DRIVERS = \
- $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a \
- $(TOP)/src/mesa/pipe/i915simple/libi915simple.a
+ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/i915simple/libi915simple.a
DRIVER_SOURCES = \
intel_winsys_pipe.c \
@@ -28,11 +28,11 @@ C_SOURCES = \
ASM_SOURCES =
-DRIVER_DEFINES = -I../intel $(shell pkg-config libdrm --atleast-version=2.3.1 \
+DRIVER_DEFINES = -I$(TOP)/src/mesa/drivers/dri/intel $(shell pkg-config libdrm --atleast-version=2.3.1 \
&& echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
include ../Makefile.template
-intel_tex_layout.o: ../intel/intel_tex_layout.c
+intel_tex_layout.o: $(TOP)/src/mesa/drivers/dri/intel/intel_tex_layout.c
symlinks:
diff --git a/src/mesa/drivers/dri/intel_winsys/SConscript b/src/gallium/winsys/dri/intel/SConscript
index a7cc10450e..a7cc10450e 100644
--- a/src/mesa/drivers/dri/intel_winsys/SConscript
+++ b/src/gallium/winsys/dri/intel/SConscript
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c b/src/gallium/winsys/dri/intel/intel_batchbuffer.c
index 49e04d81ec..49e04d81ec 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c
+++ b/src/gallium/winsys/dri/intel/intel_batchbuffer.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.h b/src/gallium/winsys/dri/intel/intel_batchbuffer.h
index 82feafa21f..82feafa21f 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.h
+++ b/src/gallium/winsys/dri/intel/intel_batchbuffer.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchpool.c b/src/gallium/winsys/dri/intel/intel_batchpool.c
index 33b56817f6..33b56817f6 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_batchpool.c
+++ b/src/gallium/winsys/dri/intel/intel_batchpool.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchpool.h b/src/gallium/winsys/dri/intel/intel_batchpool.h
index f6a95723bc..f6a95723bc 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_batchpool.h
+++ b/src/gallium/winsys/dri/intel/intel_batchpool.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/gallium/winsys/dri/intel/intel_context.c
index c033f2a592..c033f2a592 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_context.c
+++ b/src/gallium/winsys/dri/intel/intel_context.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.h b/src/gallium/winsys/dri/intel/intel_context.h
index b01370c049..b01370c049 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_context.h
+++ b/src/gallium/winsys/dri/intel/intel_context.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_lock.c b/src/gallium/winsys/dri/intel/intel_lock.c
index 70aa7ea5f4..70aa7ea5f4 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_lock.c
+++ b/src/gallium/winsys/dri/intel/intel_lock.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_reg.h b/src/gallium/winsys/dri/intel/intel_reg.h
index f37c24fda9..f37c24fda9 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_reg.h
+++ b/src/gallium/winsys/dri/intel/intel_reg.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.c b/src/gallium/winsys/dri/intel/intel_screen.c
index 9e31c013a9..9e31c013a9 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_screen.c
+++ b/src/gallium/winsys/dri/intel/intel_screen.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.h b/src/gallium/winsys/dri/intel/intel_screen.h
index 3396f9e564..3396f9e564 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_screen.h
+++ b/src/gallium/winsys/dri/intel/intel_screen.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/gallium/winsys/dri/intel/intel_swapbuffers.c
index 454cd71f6c..56b86d6a63 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
+++ b/src/gallium/winsys/dri/intel/intel_swapbuffers.c
@@ -220,6 +220,7 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv)
if (back_surf) {
st_notify_swapbuffers(intel_fb->stfb);
intelDisplaySurface(dPriv, back_surf, NULL);
+ st_notify_swapbuffers_complete(intel_fb->stfb);
}
}
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h b/src/gallium/winsys/dri/intel/intel_swapbuffers.h
index 7ae5fd15a5..7ae5fd15a5 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h
+++ b/src/gallium/winsys/dri/intel/intel_swapbuffers.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys.h b/src/gallium/winsys/dri/intel/intel_winsys.h
index ffc40782be..ffc40782be 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys.h
+++ b/src/gallium/winsys/dri/intel/intel_winsys.h
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c b/src/gallium/winsys/dri/intel/intel_winsys_i915.c
index 1ba6a9e1b2..0ed3890e93 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c
+++ b/src/gallium/winsys/dri/intel/intel_winsys_i915.c
@@ -39,7 +39,7 @@
#include "intel_winsys.h"
#include "pipe/p_util.h"
-#include "pipe/i915simple/i915_winsys.h"
+#include "i915simple/i915_winsys.h"
struct intel_i915_winsys {
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
index 789a386500..789a386500 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
+++ b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c b/src/gallium/winsys/dri/intel/intel_winsys_softpipe.c
index cec3437831..9e483bdc9f 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c
+++ b/src/gallium/winsys/dri/intel/intel_winsys_softpipe.c
@@ -34,7 +34,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
#include "pipe/p_format.h"
-#include "pipe/softpipe/sp_winsys.h"
+#include "softpipe/sp_winsys.h"
struct intel_softpipe_winsys {
diff --git a/src/mesa/drivers/dri/intel_winsys/server/i830_common.h b/src/gallium/winsys/dri/intel/server/i830_common.h
index d4d58886ce..d4d58886ce 100644
--- a/src/mesa/drivers/dri/intel_winsys/server/i830_common.h
+++ b/src/gallium/winsys/dri/intel/server/i830_common.h
diff --git a/src/mesa/drivers/dri/intel_winsys/server/i830_dri.h b/src/gallium/winsys/dri/intel/server/i830_dri.h
index c2a3af8cbf..c2a3af8cbf 100644
--- a/src/mesa/drivers/dri/intel_winsys/server/i830_dri.h
+++ b/src/gallium/winsys/dri/intel/server/i830_dri.h
diff --git a/src/mesa/drivers/dri/intel_winsys/server/intel.h b/src/gallium/winsys/dri/intel/server/intel.h
index 6ea72499c1..6ea72499c1 100644
--- a/src/mesa/drivers/dri/intel_winsys/server/intel.h
+++ b/src/gallium/winsys/dri/intel/server/intel.h
diff --git a/src/mesa/drivers/dri/intel_winsys/server/intel_dri.c b/src/gallium/winsys/dri/intel/server/intel_dri.c
index e49c4214ad..e49c4214ad 100644
--- a/src/mesa/drivers/dri/intel_winsys/server/intel_dri.c
+++ b/src/gallium/winsys/dri/intel/server/intel_dri.c
diff --git a/src/mesa/pipe/xlib/brw_aub.c b/src/gallium/winsys/xlib/brw_aub.c
index 541d50c6e4..541d50c6e4 100644
--- a/src/mesa/pipe/xlib/brw_aub.c
+++ b/src/gallium/winsys/xlib/brw_aub.c
diff --git a/src/mesa/pipe/xlib/brw_aub.h b/src/gallium/winsys/xlib/brw_aub.h
index f5c60c7be2..f5c60c7be2 100644
--- a/src/mesa/pipe/xlib/brw_aub.h
+++ b/src/gallium/winsys/xlib/brw_aub.h
diff --git a/src/mesa/pipe/xlib/fakeglx.c b/src/gallium/winsys/xlib/fakeglx.c
index 902a755075..902a755075 100644
--- a/src/mesa/pipe/xlib/fakeglx.c
+++ b/src/gallium/winsys/xlib/fakeglx.c
diff --git a/src/mesa/pipe/xlib/glxapi.c b/src/gallium/winsys/xlib/glxapi.c
index c2ccce6f52..c2ccce6f52 100644
--- a/src/mesa/pipe/xlib/glxapi.c
+++ b/src/gallium/winsys/xlib/glxapi.c
diff --git a/src/mesa/pipe/xlib/glxapi.h b/src/gallium/winsys/xlib/glxapi.h
index 37de81e55a..37de81e55a 100644
--- a/src/mesa/pipe/xlib/glxapi.h
+++ b/src/gallium/winsys/xlib/glxapi.h
diff --git a/src/mesa/pipe/xlib/glxheader.h b/src/gallium/winsys/xlib/glxheader.h
index a402191f13..a402191f13 100644
--- a/src/mesa/pipe/xlib/glxheader.h
+++ b/src/gallium/winsys/xlib/glxheader.h
diff --git a/src/mesa/pipe/xlib/realglx.c b/src/gallium/winsys/xlib/realglx.c
index 30adb7465b..30adb7465b 100644
--- a/src/mesa/pipe/xlib/realglx.c
+++ b/src/gallium/winsys/xlib/realglx.c
diff --git a/src/mesa/pipe/xlib/realglx.h b/src/gallium/winsys/xlib/realglx.h
index 150129db68..150129db68 100644
--- a/src/mesa/pipe/xlib/realglx.h
+++ b/src/gallium/winsys/xlib/realglx.h
diff --git a/src/mesa/pipe/xlib/xfonts.c b/src/gallium/winsys/xlib/xfonts.c
index d72c600bd1..d72c600bd1 100644
--- a/src/mesa/pipe/xlib/xfonts.c
+++ b/src/gallium/winsys/xlib/xfonts.c
diff --git a/src/mesa/pipe/xlib/xfonts.h b/src/gallium/winsys/xlib/xfonts.h
index e36f42f817..e36f42f817 100644
--- a/src/mesa/pipe/xlib/xfonts.h
+++ b/src/gallium/winsys/xlib/xfonts.h
diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/gallium/winsys/xlib/xm_api.c
index e5fef1d7a8..e5fef1d7a8 100644
--- a/src/mesa/pipe/xlib/xm_api.c
+++ b/src/gallium/winsys/xlib/xm_api.c
diff --git a/src/mesa/pipe/xlib/xm_image.c b/src/gallium/winsys/xlib/xm_image.c
index 087b4e4c3a..087b4e4c3a 100644
--- a/src/mesa/pipe/xlib/xm_image.c
+++ b/src/gallium/winsys/xlib/xm_image.c
diff --git a/src/mesa/pipe/xlib/xm_image.h b/src/gallium/winsys/xlib/xm_image.h
index 2a5e0f3777..2a5e0f3777 100644
--- a/src/mesa/pipe/xlib/xm_image.h
+++ b/src/gallium/winsys/xlib/xm_image.h
diff --git a/src/mesa/pipe/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index c3cd22eea3..8da596d419 100644
--- a/src/mesa/pipe/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -41,11 +41,11 @@
#include "pipe/p_context.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/softpipe/sp_winsys.h"
+#include "softpipe/sp_winsys.h"
#ifdef GALLIUM_CELL
-#include "pipe/cell/ppu/cell_context.h"
-#include "pipe/cell/ppu/cell_winsys.h"
+#include "cell/ppu/cell_context.h"
+#include "cell/ppu/cell_winsys.h"
#else
#define TILE_SIZE 32 /* avoid compilation errors */
#endif
diff --git a/src/mesa/pipe/xlib/xm_winsys_aub.c b/src/gallium/winsys/xlib/xm_winsys_aub.c
index bf41570257..dbfd37bda2 100644
--- a/src/mesa/pipe/xlib/xm_winsys_aub.c
+++ b/src/gallium/winsys/xlib/xm_winsys_aub.c
@@ -39,7 +39,7 @@
#include "pipe/p_winsys.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
-#include "pipe/i965simple/brw_winsys.h"
+#include "i965simple/brw_winsys.h"
#include "brw_aub.h"
#include "xm_winsys_aub.h"
diff --git a/src/mesa/pipe/xlib/xm_winsys_aub.h b/src/gallium/winsys/xlib/xm_winsys_aub.h
index 7bee199116..7bee199116 100644
--- a/src/mesa/pipe/xlib/xm_winsys_aub.h
+++ b/src/gallium/winsys/xlib/xm_winsys_aub.h
diff --git a/src/mesa/pipe/xlib/xmesaP.h b/src/gallium/winsys/xlib/xmesaP.h
index fa8d1f14b9..fa8d1f14b9 100644
--- a/src/mesa/pipe/xlib/xmesaP.h
+++ b/src/gallium/winsys/xlib/xmesaP.h
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 720f1b2e02..561608fedd 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -12,16 +12,16 @@ GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
PIPE_LIB = \
- $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a \
- $(TOP)/src/mesa/pipe/i965simple/libi965simple.a
+ $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
+ $(TOP)/src/gallium/drivers/i965simple/libi965simple.a
ifeq ($(CONFIG_NAME), linux-cell)
-CELL_LIB = $(TOP)/src/mesa/pipe/cell/ppu/libcell.a
-CELL_LIB_SPU = $(TOP)/src/mesa/pipe/cell/spu/g3d_spu.a
+CELL_LIB = $(TOP)/src/gallium/drivers/cell/ppu/libcell.a
+CELL_LIB_SPU = $(TOP)/src/gallium/drivers/cell/spu/g3d_spu.a
endif
ifeq ($(CONFIG_NAME), linux-llvm)
-LLVM_LIB = $(TOP)/src/mesa/pipe/llvm/libgallivm.a
+LLVM_LIB = $(TOP)/src/gallium/aux/llvm/libgallivm.a
endif
.SUFFIXES : .cpp
@@ -71,7 +71,7 @@ libmesa.a: $(SOLO_OBJECTS)
fi
linux-solo: depend subdirs libmesa.a
- cd drivers/dri ; $(MAKE)
+ cd $(TOP)/src/gallium/winsys/dri ; $(MAKE)
#####################################################################
@@ -165,7 +165,6 @@ depend: $(ALL_SOURCES)
subdirs:
@ (cd x86 ; $(MAKE))
@ (cd x86-64 ; $(MAKE))
- (cd pipe ; $(MAKE))
install: default
$(INSTALL) -d $(INSTALL_DIR)/include/GL
@@ -178,7 +177,7 @@ install: default
$(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \
fi
@if [ "${DRIVER_DIRS}" = "dri" ] ; then \
- cd drivers/dri ; $(MAKE) install ; \
+ cd $(TOP)/gallium/winsys/dri ; $(MAKE) install ; \
fi
## NOT INSTALLED YET:
@@ -198,7 +197,6 @@ clean:
(cd drivers/dri && $(MAKE) clean)
(cd x86 && $(MAKE) clean)
(cd x86-64 && $(MAKE) clean)
- (cd pipe ; $(MAKE) clean )
include depend
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 08c98eab48..18b033666f 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -85,7 +85,7 @@
#include "state_tracker/st_public.h"
#include "state_tracker/st_context.h"
-#include "pipe/softpipe/sp_context.h"
+#include "softpipe/sp_context.h"
#include "pipe/p_defines.h"
/**
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 8ae243ae66..34287effe1 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -53,7 +53,7 @@
#include "tnl/tnl.h"
#include "tnl/t_context.h"
-#include "pipe/softpipe/sp_context.h"
+#include "softpipe/sp_context.h"
#include "state_tracker/st_public.h"
#include "state_tracker/st_context.h"
#include "state_tracker/st_draw.h"
diff --git a/src/mesa/drivers/x11/xm_surface.c b/src/mesa/drivers/x11/xm_surface.c
index 5533158ece..81616b92d9 100644
--- a/src/mesa/drivers/x11/xm_surface.c
+++ b/src/mesa/drivers/x11/xm_surface.c
@@ -45,10 +45,10 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
-#include "pipe/softpipe/sp_context.h"
-#include "pipe/softpipe/sp_clear.h"
-#include "pipe/softpipe/sp_tile_cache.h"
-#include "pipe/softpipe/sp_surface.h"
+#include "softpipe/sp_context.h"
+#include "softpipe/sp_clear.h"
+#include "softpipe/sp_tile_cache.h"
+#include "softpipe/sp_surface.h"
#include "state_tracker/st_context.h"
diff --git a/src/mesa/drivers/x11/xm_winsys.c b/src/mesa/drivers/x11/xm_winsys.c
index a690df2772..2edc697693 100644
--- a/src/mesa/drivers/x11/xm_winsys.c
+++ b/src/mesa/drivers/x11/xm_winsys.c
@@ -38,7 +38,7 @@
#include "main/macros.h"
#include "pipe/p_winsys.h"
-#include "pipe/softpipe/sp_winsys.h"
+#include "softpipe/sp_winsys.h"
/**
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 4709d63394..fd2dfcd79a 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -37,8 +37,8 @@
#include "xm_image.h"
#endif
#include "state_tracker/st_cb_fbo.h"
-#include "pipe/softpipe/sp_context.h"
-#include "pipe/softpipe/sp_surface.h"
+#include "softpipe/sp_context.h"
+#include "softpipe/sp_surface.h"
extern _glthread_Mutex _xmesa_lock;
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_fetch.c b/src/mesa/pipe/cell/spu/spu_vertex_fetch.c
deleted file mode 100644
index 6e86a919ce..0000000000
--- a/src/mesa/pipe/cell/spu/spu_vertex_fetch.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include <spu_mfcio.h>
-#include <transpose_matrix4x4.h>
-
-#include "pipe/p_util.h"
-#include "pipe/p_state.h"
-#include "pipe/p_shader_tokens.h"
-#include "spu_exec.h"
-#include "spu_vertex_shader.h"
-#include "spu_main.h"
-
-
-#define DRAW_DBG 0
-
-
-static const vec_float4 defaults = { 0.0, 0.0, 0.0, 1.0 };
-
-/**
- * Fetch a float[4] vertex attribute from memory, doing format/type
- * conversion as needed.
- *
- * This is probably needed/dupliocated elsewhere, eg format
- * conversion, texture sampling etc.
- */
-#define FETCH_ATTRIB( NAME, SZ, CVT ) \
-static qword \
-fetch_##NAME(const void *ptr) \
-{ \
- vec_float4 attrib = defaults; \
- int i; \
- \
- for (i = 0; i < SZ; i++) { \
- attrib = spu_insert(CVT, attrib, i); \
- } \
- return (qword) attrib; \
-}
-
-#define CVT_64_FLOAT (float) ((double *) ptr)[i]
-#define CVT_32_FLOAT ((float *) ptr)[i]
-
-#define CVT_8_USCALED (float) ((unsigned char *) ptr)[i]
-#define CVT_16_USCALED (float) ((unsigned short *) ptr)[i]
-#define CVT_32_USCALED (float) ((unsigned int *) ptr)[i]
-
-#define CVT_8_SSCALED (float) ((char *) ptr)[i]
-#define CVT_16_SSCALED (float) ((short *) ptr)[i]
-#define CVT_32_SSCALED (float) ((int *) ptr)[i]
-
-#define CVT_8_UNORM (float) ((unsigned char *) ptr)[i] / 255.0f
-#define CVT_16_UNORM (float) ((unsigned short *) ptr)[i] / 65535.0f
-#define CVT_32_UNORM (float) ((unsigned int *) ptr)[i] / 4294967295.0f
-
-#define CVT_8_SNORM (float) ((char *) ptr)[i] / 127.0f
-#define CVT_16_SNORM (float) ((short *) ptr)[i] / 32767.0f
-#define CVT_32_SNORM (float) ((int *) ptr)[i] / 2147483647.0f
-
-FETCH_ATTRIB( R64G64B64A64_FLOAT, 4, CVT_64_FLOAT )
-FETCH_ATTRIB( R64G64B64_FLOAT, 3, CVT_64_FLOAT )
-FETCH_ATTRIB( R64G64_FLOAT, 2, CVT_64_FLOAT )
-FETCH_ATTRIB( R64_FLOAT, 1, CVT_64_FLOAT )
-
-FETCH_ATTRIB( R32G32B32A32_FLOAT, 4, CVT_32_FLOAT )
-FETCH_ATTRIB( R32G32B32_FLOAT, 3, CVT_32_FLOAT )
-FETCH_ATTRIB( R32G32_FLOAT, 2, CVT_32_FLOAT )
-FETCH_ATTRIB( R32_FLOAT, 1, CVT_32_FLOAT )
-
-FETCH_ATTRIB( R32G32B32A32_USCALED, 4, CVT_32_USCALED )
-FETCH_ATTRIB( R32G32B32_USCALED, 3, CVT_32_USCALED )
-FETCH_ATTRIB( R32G32_USCALED, 2, CVT_32_USCALED )
-FETCH_ATTRIB( R32_USCALED, 1, CVT_32_USCALED )
-
-FETCH_ATTRIB( R32G32B32A32_SSCALED, 4, CVT_32_SSCALED )
-FETCH_ATTRIB( R32G32B32_SSCALED, 3, CVT_32_SSCALED )
-FETCH_ATTRIB( R32G32_SSCALED, 2, CVT_32_SSCALED )
-FETCH_ATTRIB( R32_SSCALED, 1, CVT_32_SSCALED )
-
-FETCH_ATTRIB( R32G32B32A32_UNORM, 4, CVT_32_UNORM )
-FETCH_ATTRIB( R32G32B32_UNORM, 3, CVT_32_UNORM )
-FETCH_ATTRIB( R32G32_UNORM, 2, CVT_32_UNORM )
-FETCH_ATTRIB( R32_UNORM, 1, CVT_32_UNORM )
-
-FETCH_ATTRIB( R32G32B32A32_SNORM, 4, CVT_32_SNORM )
-FETCH_ATTRIB( R32G32B32_SNORM, 3, CVT_32_SNORM )
-FETCH_ATTRIB( R32G32_SNORM, 2, CVT_32_SNORM )
-FETCH_ATTRIB( R32_SNORM, 1, CVT_32_SNORM )
-
-FETCH_ATTRIB( R16G16B16A16_USCALED, 4, CVT_16_USCALED )
-FETCH_ATTRIB( R16G16B16_USCALED, 3, CVT_16_USCALED )
-FETCH_ATTRIB( R16G16_USCALED, 2, CVT_16_USCALED )
-FETCH_ATTRIB( R16_USCALED, 1, CVT_16_USCALED )
-
-FETCH_ATTRIB( R16G16B16A16_SSCALED, 4, CVT_16_SSCALED )
-FETCH_ATTRIB( R16G16B16_SSCALED, 3, CVT_16_SSCALED )
-FETCH_ATTRIB( R16G16_SSCALED, 2, CVT_16_SSCALED )
-FETCH_ATTRIB( R16_SSCALED, 1, CVT_16_SSCALED )
-
-FETCH_ATTRIB( R16G16B16A16_UNORM, 4, CVT_16_UNORM )
-FETCH_ATTRIB( R16G16B16_UNORM, 3, CVT_16_UNORM )
-FETCH_ATTRIB( R16G16_UNORM, 2, CVT_16_UNORM )
-FETCH_ATTRIB( R16_UNORM, 1, CVT_16_UNORM )
-
-FETCH_ATTRIB( R16G16B16A16_SNORM, 4, CVT_16_SNORM )
-FETCH_ATTRIB( R16G16B16_SNORM, 3, CVT_16_SNORM )
-FETCH_ATTRIB( R16G16_SNORM, 2, CVT_16_SNORM )
-FETCH_ATTRIB( R16_SNORM, 1, CVT_16_SNORM )
-
-FETCH_ATTRIB( R8G8B8A8_USCALED, 4, CVT_8_USCALED )
-FETCH_ATTRIB( R8G8B8_USCALED, 3, CVT_8_USCALED )
-FETCH_ATTRIB( R8G8_USCALED, 2, CVT_8_USCALED )
-FETCH_ATTRIB( R8_USCALED, 1, CVT_8_USCALED )
-
-FETCH_ATTRIB( R8G8B8A8_SSCALED, 4, CVT_8_SSCALED )
-FETCH_ATTRIB( R8G8B8_SSCALED, 3, CVT_8_SSCALED )
-FETCH_ATTRIB( R8G8_SSCALED, 2, CVT_8_SSCALED )
-FETCH_ATTRIB( R8_SSCALED, 1, CVT_8_SSCALED )
-
-FETCH_ATTRIB( R8G8B8A8_UNORM, 4, CVT_8_UNORM )
-FETCH_ATTRIB( R8G8B8_UNORM, 3, CVT_8_UNORM )
-FETCH_ATTRIB( R8G8_UNORM, 2, CVT_8_UNORM )
-FETCH_ATTRIB( R8_UNORM, 1, CVT_8_UNORM )
-
-FETCH_ATTRIB( R8G8B8A8_SNORM, 4, CVT_8_SNORM )
-FETCH_ATTRIB( R8G8B8_SNORM, 3, CVT_8_SNORM )
-FETCH_ATTRIB( R8G8_SNORM, 2, CVT_8_SNORM )
-FETCH_ATTRIB( R8_SNORM, 1, CVT_8_SNORM )
-
-FETCH_ATTRIB( A8R8G8B8_UNORM, 4, CVT_8_UNORM )
-//FETCH_ATTRIB( R8G8B8A8_UNORM, 4, CVT_8_UNORM )
-
-
-
-static spu_fetch_func get_fetch_func( enum pipe_format format )
-{
-#if 0
- {
- char tmp[80];
- pf_sprint_name(tmp, format);
- _mesa_printf("%s: %s\n", __FUNCTION__, tmp);
- }
-#endif
-
- switch (format) {
- case PIPE_FORMAT_R64_FLOAT:
- return fetch_R64_FLOAT;
- case PIPE_FORMAT_R64G64_FLOAT:
- return fetch_R64G64_FLOAT;
- case PIPE_FORMAT_R64G64B64_FLOAT:
- return fetch_R64G64B64_FLOAT;
- case PIPE_FORMAT_R64G64B64A64_FLOAT:
- return fetch_R64G64B64A64_FLOAT;
-
- case PIPE_FORMAT_R32_FLOAT:
- return fetch_R32_FLOAT;
- case PIPE_FORMAT_R32G32_FLOAT:
- return fetch_R32G32_FLOAT;
- case PIPE_FORMAT_R32G32B32_FLOAT:
- return fetch_R32G32B32_FLOAT;
- case PIPE_FORMAT_R32G32B32A32_FLOAT:
- return fetch_R32G32B32A32_FLOAT;
-
- case PIPE_FORMAT_R32_UNORM:
- return fetch_R32_UNORM;
- case PIPE_FORMAT_R32G32_UNORM:
- return fetch_R32G32_UNORM;
- case PIPE_FORMAT_R32G32B32_UNORM:
- return fetch_R32G32B32_UNORM;
- case PIPE_FORMAT_R32G32B32A32_UNORM:
- return fetch_R32G32B32A32_UNORM;
-
- case PIPE_FORMAT_R32_USCALED:
- return fetch_R32_USCALED;
- case PIPE_FORMAT_R32G32_USCALED:
- return fetch_R32G32_USCALED;
- case PIPE_FORMAT_R32G32B32_USCALED:
- return fetch_R32G32B32_USCALED;
- case PIPE_FORMAT_R32G32B32A32_USCALED:
- return fetch_R32G32B32A32_USCALED;
-
- case PIPE_FORMAT_R32_SNORM:
- return fetch_R32_SNORM;
- case PIPE_FORMAT_R32G32_SNORM:
- return fetch_R32G32_SNORM;
- case PIPE_FORMAT_R32G32B32_SNORM:
- return fetch_R32G32B32_SNORM;
- case PIPE_FORMAT_R32G32B32A32_SNORM:
- return fetch_R32G32B32A32_SNORM;
-
- case PIPE_FORMAT_R32_SSCALED:
- return fetch_R32_SSCALED;
- case PIPE_FORMAT_R32G32_SSCALED:
- return fetch_R32G32_SSCALED;
- case PIPE_FORMAT_R32G32B32_SSCALED:
- return fetch_R32G32B32_SSCALED;
- case PIPE_FORMAT_R32G32B32A32_SSCALED:
- return fetch_R32G32B32A32_SSCALED;
-
- case PIPE_FORMAT_R16_UNORM:
- return fetch_R16_UNORM;
- case PIPE_FORMAT_R16G16_UNORM:
- return fetch_R16G16_UNORM;
- case PIPE_FORMAT_R16G16B16_UNORM:
- return fetch_R16G16B16_UNORM;
- case PIPE_FORMAT_R16G16B16A16_UNORM:
- return fetch_R16G16B16A16_UNORM;
-
- case PIPE_FORMAT_R16_USCALED:
- return fetch_R16_USCALED;
- case PIPE_FORMAT_R16G16_USCALED:
- return fetch_R16G16_USCALED;
- case PIPE_FORMAT_R16G16B16_USCALED:
- return fetch_R16G16B16_USCALED;
- case PIPE_FORMAT_R16G16B16A16_USCALED:
- return fetch_R16G16B16A16_USCALED;
-
- case PIPE_FORMAT_R16_SNORM:
- return fetch_R16_SNORM;
- case PIPE_FORMAT_R16G16_SNORM:
- return fetch_R16G16_SNORM;
- case PIPE_FORMAT_R16G16B16_SNORM:
- return fetch_R16G16B16_SNORM;
- case PIPE_FORMAT_R16G16B16A16_SNORM:
- return fetch_R16G16B16A16_SNORM;
-
- case PIPE_FORMAT_R16_SSCALED:
- return fetch_R16_SSCALED;
- case PIPE_FORMAT_R16G16_SSCALED:
- return fetch_R16G16_SSCALED;
- case PIPE_FORMAT_R16G16B16_SSCALED:
- return fetch_R16G16B16_SSCALED;
- case PIPE_FORMAT_R16G16B16A16_SSCALED:
- return fetch_R16G16B16A16_SSCALED;
-
- case PIPE_FORMAT_R8_UNORM:
- return fetch_R8_UNORM;
- case PIPE_FORMAT_R8G8_UNORM:
- return fetch_R8G8_UNORM;
- case PIPE_FORMAT_R8G8B8_UNORM:
- return fetch_R8G8B8_UNORM;
- case PIPE_FORMAT_R8G8B8A8_UNORM:
- return fetch_R8G8B8A8_UNORM;
-
- case PIPE_FORMAT_R8_USCALED:
- return fetch_R8_USCALED;
- case PIPE_FORMAT_R8G8_USCALED:
- return fetch_R8G8_USCALED;
- case PIPE_FORMAT_R8G8B8_USCALED:
- return fetch_R8G8B8_USCALED;
- case PIPE_FORMAT_R8G8B8A8_USCALED:
- return fetch_R8G8B8A8_USCALED;
-
- case PIPE_FORMAT_R8_SNORM:
- return fetch_R8_SNORM;
- case PIPE_FORMAT_R8G8_SNORM:
- return fetch_R8G8_SNORM;
- case PIPE_FORMAT_R8G8B8_SNORM:
- return fetch_R8G8B8_SNORM;
- case PIPE_FORMAT_R8G8B8A8_SNORM:
- return fetch_R8G8B8A8_SNORM;
-
- case PIPE_FORMAT_R8_SSCALED:
- return fetch_R8_SSCALED;
- case PIPE_FORMAT_R8G8_SSCALED:
- return fetch_R8G8_SSCALED;
- case PIPE_FORMAT_R8G8B8_SSCALED:
- return fetch_R8G8B8_SSCALED;
- case PIPE_FORMAT_R8G8B8A8_SSCALED:
- return fetch_R8G8B8A8_SSCALED;
-
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- return fetch_A8R8G8B8_UNORM;
-
- case 0:
- return NULL; /* not sure why this is needed */
-
- default:
- assert(0);
- return NULL;
- }
-}
-
-
-/**
- * Fetch vertex attributes for 'count' vertices.
- */
-static void generic_vertex_fetch(struct spu_vs_context *draw,
- struct spu_exec_machine *machine,
- const unsigned *elts,
- unsigned count)
-{
- unsigned nr_attrs = draw->vertex_fetch.nr_attrs;
- unsigned attr;
-
- assert(count <= 4);
-
- wait_on_mask(1 << TAG_VERTEX_BUFFER);
-
-#if DRAW_DBG
- printf("SPU: %s count = %u, nr_attrs = %u\n",
- __FUNCTION__, count, nr_attrs);
-#endif
-
- /* loop over vertex attributes (vertex shader inputs)
- */
- for (attr = 0; attr < nr_attrs; attr++) {
- const unsigned pitch = draw->vertex_fetch.pitch[attr];
- const uint64_t src = draw->vertex_fetch.src_ptr[attr];
- const spu_fetch_func fetch = draw->vertex_fetch.fetch[attr];
- unsigned i;
- qword p[4];
-
-
- /* Fetch four attributes for four vertices.
- *
- * Could fetch directly into AOS format, but this is meant to be
- * a prototype for an sse implementation, which would have
- * difficulties doing that.
- */
- for (i = 0; i < count; i++) {
- uint8_t buffer[32] ALIGN16_ATTRIB;
- const uint64_t addr = src + (elts[i] * pitch);
- const unsigned size = ((addr & 0x0f) == 0) ? 16 : 32;
-
-#if DRAW_DBG
- printf("SPU: fetching = 0x%llx\n", addr);
-#endif
- mfc_get(buffer, addr & ~0x0f, size, TAG_VERTEX_BUFFER, 0, 0);
- wait_on_mask(1 << TAG_VERTEX_BUFFER);
-
- p[i] = (*fetch)(buffer + (addr & 0x0f));
- }
-
- /* Be nice and zero out any missing vertices:
- */
- for (/* empty */; i < 4; i++)
- p[i] = si_xor(p[i], p[i]);
-
- /* Transpose/swizzle into vector-friendly format. Currently
- * assuming that all vertex shader inputs are float[4], but this
- * isn't true -- if the vertex shader only wants tex0.xy, we
- * could optimize for that.
- *
- * To do so fully without codegen would probably require an
- * excessive number of fetch functions, but we could at least
- * minimize the transpose step:
- */
- _transpose_matrix4x4(&machine->Inputs[attr].xyzw[0].q, p);
- }
-}
-
-
-void spu_update_vertex_fetch( struct spu_vs_context *draw )
-{
- unsigned i;
-
-
- for (i = 0; i < draw->vertex_fetch.nr_attrs; i++) {
- draw->vertex_fetch.fetch[i] =
- get_fetch_func(draw->vertex_fetch.format[i]);
- }
-
- draw->vertex_fetch.fetch_func = generic_vertex_fetch;
-}
diff --git a/src/mesa/pipe/llvm/instructionssoa.cpp b/src/mesa/pipe/llvm/instructionssoa.cpp
deleted file mode 100644
index 0c2032e56f..0000000000
--- a/src/mesa/pipe/llvm/instructionssoa.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "instructionssoa.h"
-
-InstructionsSoa::InstructionsSoa(llvm::Module *mod, llvm::Function *func,
- llvm::BasicBlock *block, StorageSoa *storage)
- : m_builder(block),
- m_idx(0)
-{
-}
-
-std::vector<llvm::Value*> InstructionsSoa::add(const std::vector<llvm::Value*> in1,
- const std::vector<llvm::Value*> in2)
-{
- std::vector<llvm::Value*> res(4);
-
- res[0] = m_builder.CreateAdd(in1[0], in2[0], name("addx"));
- res[1] = m_builder.CreateAdd(in1[1], in2[1], name("addy"));
- res[2] = m_builder.CreateAdd(in1[2], in2[2], name("addz"));
- res[3] = m_builder.CreateAdd(in1[3], in2[3], name("addw"));
-
- return res;
-}
-
-std::vector<llvm::Value*> InstructionsSoa::mul(const std::vector<llvm::Value*> in1,
- const std::vector<llvm::Value*> in2)
-{
- std::vector<llvm::Value*> res(4);
-
- res[0] = m_builder.CreateMul(in1[0], in2[0], name("mulx"));
- res[1] = m_builder.CreateMul(in1[1], in2[1], name("muly"));
- res[2] = m_builder.CreateMul(in1[2], in2[2], name("mulz"));
- res[3] = m_builder.CreateMul(in1[3], in2[3], name("mulw"));
-
- return res;
-}
-
-void InstructionsSoa::end()
-{
- m_builder.CreateRetVoid();
-}
-
-const char * InstructionsSoa::name(const char *prefix) const
-{
- ++m_idx;
- snprintf(m_name, 32, "%s%d", prefix, m_idx);
- return m_name;
-}
diff --git a/src/mesa/pipe/llvm/llvm_base_shader.cpp b/src/mesa/pipe/llvm/llvm_base_shader.cpp
deleted file mode 100644
index 90a25a440a..0000000000
--- a/src/mesa/pipe/llvm/llvm_base_shader.cpp
+++ /dev/null
@@ -1,833 +0,0 @@
-// Generated by llvm2cpp - DO NOT MODIFY!
-
-
-Module* createBaseShader() {
- // Module Construction
- Module* mod = new Module("Shader");
- mod->setDataLayout("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128");
- mod->setTargetTriple("i686-pc-linux-gnu");
-
- // Type Definitions
- std::vector<const Type*>StructTy_struct_ShaderInput_fields;
- VectorType* VectorTy_1 = VectorType::get(Type::FloatTy, 4);
-
- PointerType* PointerTy_0 = PointerType::get(VectorTy_1, 0);
-
- StructTy_struct_ShaderInput_fields.push_back(PointerTy_0);
- StructTy_struct_ShaderInput_fields.push_back(PointerTy_0);
- StructTy_struct_ShaderInput_fields.push_back(PointerTy_0);
- StructTy_struct_ShaderInput_fields.push_back(PointerTy_0);
- StructTy_struct_ShaderInput_fields.push_back(IntegerType::get(32));
- StructType* StructTy_struct_ShaderInput = StructType::get(StructTy_struct_ShaderInput_fields, /*isPacked=*/false);
- mod->addTypeName("struct.ShaderInput", StructTy_struct_ShaderInput);
-
- OpaqueType* OpaqueTy_struct_pipe_sampler_state = OpaqueType::get();
- mod->addTypeName("struct.pipe_sampler_state", OpaqueTy_struct_pipe_sampler_state);
-
- OpaqueType* OpaqueTy_struct_softpipe_tile_cache = OpaqueType::get();
- mod->addTypeName("struct.softpipe_tile_cache", OpaqueTy_struct_softpipe_tile_cache);
-
- std::vector<const Type*>StructTy_struct_tgsi_sampler_fields;
- PointerType* PointerTy_2 = PointerType::get(OpaqueTy_struct_pipe_sampler_state, 0);
-
- StructTy_struct_tgsi_sampler_fields.push_back(PointerTy_2);
- std::vector<const Type*>FuncTy_4_args;
- PATypeHolder StructTy_struct_tgsi_sampler_fwd = OpaqueType::get();
- PointerType* PointerTy_5 = PointerType::get(StructTy_struct_tgsi_sampler_fwd, 0);
-
- FuncTy_4_args.push_back(PointerTy_5);
- PointerType* PointerTy_6 = PointerType::get(Type::FloatTy, 0);
-
- FuncTy_4_args.push_back(PointerTy_6);
- FuncTy_4_args.push_back(PointerTy_6);
- FuncTy_4_args.push_back(PointerTy_6);
- FuncTy_4_args.push_back(Type::FloatTy);
- ArrayType* ArrayTy_8 = ArrayType::get(Type::FloatTy, 4);
-
- PointerType* PointerTy_7 = PointerType::get(ArrayTy_8, 0);
-
- FuncTy_4_args.push_back(PointerTy_7);
- FunctionType* FuncTy_4 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_4_args,
- /*isVarArg=*/false);
-
- PointerType* PointerTy_3 = PointerType::get(FuncTy_4, 0);
-
- StructTy_struct_tgsi_sampler_fields.push_back(PointerTy_3);
- PointerType* PointerTy_9 = PointerType::get(IntegerType::get(8), 0);
-
- StructTy_struct_tgsi_sampler_fields.push_back(PointerTy_9);
- PointerType* PointerTy_10 = PointerType::get(OpaqueTy_struct_softpipe_tile_cache, 0);
-
- StructTy_struct_tgsi_sampler_fields.push_back(PointerTy_10);
- StructType* StructTy_struct_tgsi_sampler = StructType::get(StructTy_struct_tgsi_sampler_fields, /*isPacked=*/false);
- mod->addTypeName("struct.tgsi_sampler", StructTy_struct_tgsi_sampler);
- cast<OpaqueType>(StructTy_struct_tgsi_sampler_fwd.get())->refineAbstractTypeTo(StructTy_struct_tgsi_sampler);
- StructTy_struct_tgsi_sampler = cast<StructType>(StructTy_struct_tgsi_sampler_fwd.get());
-
-
- std::vector<const Type*>FuncTy_11_args;
- ArrayType* ArrayTy_13 = ArrayType::get(VectorTy_1, 16);
-
- PointerType* PointerTy_12 = PointerType::get(ArrayTy_13, 0);
-
- FuncTy_11_args.push_back(PointerTy_12);
- ArrayType* ArrayTy_15 = ArrayType::get(ArrayTy_8, 16);
-
- PointerType* PointerTy_14 = PointerType::get(ArrayTy_15, 0);
-
- FuncTy_11_args.push_back(PointerTy_14);
- FuncTy_11_args.push_back(IntegerType::get(32));
- FuncTy_11_args.push_back(IntegerType::get(32));
- FunctionType* FuncTy_11 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_11_args,
- /*isVarArg=*/false);
-
- std::vector<const Type*>FuncTy_16_args;
- FuncTy_16_args.push_back(PointerTy_0);
- FuncTy_16_args.push_back(PointerTy_7);
- FuncTy_16_args.push_back(IntegerType::get(32));
- FunctionType* FuncTy_16 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_16_args,
- /*isVarArg=*/false);
-
- std::vector<const Type*>FuncTy_17_args;
- FuncTy_17_args.push_back(PointerTy_7);
- FuncTy_17_args.push_back(PointerTy_0);
- FuncTy_17_args.push_back(IntegerType::get(32));
- FunctionType* FuncTy_17 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_17_args,
- /*isVarArg=*/false);
-
- std::vector<const Type*>FuncTy_18_args;
- FuncTy_18_args.push_back(PointerTy_9);
- FuncTy_18_args.push_back(PointerTy_9);
- FuncTy_18_args.push_back(PointerTy_7);
- FuncTy_18_args.push_back(IntegerType::get(32));
- FuncTy_18_args.push_back(IntegerType::get(32));
- FuncTy_18_args.push_back(IntegerType::get(32));
- FuncTy_18_args.push_back(IntegerType::get(32));
- FunctionType* FuncTy_18 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_18_args,
- /*isVarArg=*/false);
-
- ArrayType* ArrayTy_20 = ArrayType::get(VectorTy_1, 32);
-
- PointerType* PointerTy_19 = PointerType::get(ArrayTy_20, 0);
-
- ArrayType* ArrayTy_22 = ArrayType::get(VectorTy_1, 128);
-
- PointerType* PointerTy_21 = PointerType::get(ArrayTy_22, 0);
-
- PointerType* PointerTy_23 = PointerType::get(StructTy_struct_ShaderInput, 0);
-
- PointerType* PointerTy_24 = PointerType::get(PointerTy_0, 0);
-
- std::vector<const Type*>FuncTy_26_args;
- FuncTy_26_args.push_back(PointerTy_23);
- FunctionType* FuncTy_26 = FunctionType::get(
- /*Result=*/Type::VoidTy,
- /*Params=*/FuncTy_26_args,
- /*isVarArg=*/false);
-
- PointerType* PointerTy_25 = PointerType::get(FuncTy_26, 0);
-
- std::vector<const Type*>FuncTy_27_args;
- FuncTy_27_args.push_back(Type::FloatTy);
- FuncTy_27_args.push_back(Type::FloatTy);
- FuncTy_27_args.push_back(PointerTy_12);
- FuncTy_27_args.push_back(PointerTy_12);
- FuncTy_27_args.push_back(IntegerType::get(32));
- FuncTy_27_args.push_back(PointerTy_7);
- FuncTy_27_args.push_back(IntegerType::get(32));
- FuncTy_27_args.push_back(PointerTy_5);
- FunctionType* FuncTy_27 = FunctionType::get(
- /*Result=*/IntegerType::get(32),
- /*Params=*/FuncTy_27_args,
- /*isVarArg=*/false);
-
- PointerType* PointerTy_28 = PointerType::get(IntegerType::get(32), 0);
-
-
- // Function Declarations
-
- Function* func_from_array = new Function(
- /*Type=*/FuncTy_11,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"from_array", mod);
- func_from_array->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_from_array_PAL = 0;
- {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0; PAWI.attrs = 0 | ParamAttr::NoUnwind;
- Attrs.push_back(PAWI);
- func_from_array_PAL = ParamAttrsList::get(Attrs);
-
- }
- func_from_array->setParamAttrs(func_from_array_PAL);
-
- Function* func_from_consts = new Function(
- /*Type=*/FuncTy_16,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"from_consts", mod);
- func_from_consts->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_from_consts_PAL = 0;
- {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0; PAWI.attrs = 0 | ParamAttr::NoUnwind;
- Attrs.push_back(PAWI);
- func_from_consts_PAL = ParamAttrsList::get(Attrs);
-
- }
- func_from_consts->setParamAttrs(func_from_consts_PAL);
-
- Function* func_to_array = new Function(
- /*Type=*/FuncTy_17,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"to_array", mod);
- func_to_array->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_to_array_PAL = 0;
- {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0; PAWI.attrs = 0 | ParamAttr::NoUnwind;
- Attrs.push_back(PAWI);
- func_to_array_PAL = ParamAttrsList::get(Attrs);
-
- }
- func_to_array->setParamAttrs(func_to_array_PAL);
-
- Function* func_run_vertex_shader = new Function(
- /*Type=*/FuncTy_18,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"run_vertex_shader", mod);
- func_run_vertex_shader->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_run_vertex_shader_PAL = 0;
- func_run_vertex_shader->setParamAttrs(func_run_vertex_shader_PAL);
-
- Function* func_execute_shader = new Function(
- /*Type=*/FuncTy_26,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"execute_shader", mod); // (external, no body)
- func_execute_shader->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_execute_shader_PAL = 0;
- func_execute_shader->setParamAttrs(func_execute_shader_PAL);
-
- Function* func_run_fragment_shader = new Function(
- /*Type=*/FuncTy_27,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"run_fragment_shader", mod);
- func_run_fragment_shader->setCallingConv(CallingConv::C);
- const ParamAttrsList *func_run_fragment_shader_PAL = 0;
- func_run_fragment_shader->setParamAttrs(func_run_fragment_shader_PAL);
-
- // Global Variable Declarations
-
-
- // Constant Definitions
- Constant* const_int32_29 = Constant::getNullValue(IntegerType::get(32));
- ConstantInt* const_int32_30 = ConstantInt::get(APInt(32, "-1", 10));
- ConstantInt* const_int32_31 = ConstantInt::get(APInt(32, "1", 10));
- UndefValue* const_packed_32 = UndefValue::get(VectorTy_1);
- ConstantInt* const_int32_33 = ConstantInt::get(APInt(32, "2", 10));
- ConstantInt* const_int32_34 = ConstantInt::get(APInt(32, "3", 10));
- ConstantInt* const_int32_35 = ConstantInt::get(APInt(32, "4", 10));
-
- // Global Variable Definitions
-
- // Function Definitions
-
- // Function: from_array (func_from_array)
- {
- Function::arg_iterator args = func_from_array->arg_begin();
- Value* ptr_res = args++;
- ptr_res->setName("res");
- Value* ptr_ainputs = args++;
- ptr_ainputs->setName("ainputs");
- Value* int32_count = args++;
- int32_count->setName("count");
- Value* int32_num_attribs = args++;
- int32_num_attribs->setName("num_attribs");
-
- BasicBlock* label_entry = new BasicBlock("entry",func_from_array,0);
- BasicBlock* label_forcond2_preheader_split = new BasicBlock("forcond2.preheader.split",func_from_array,0);
- BasicBlock* label_forcond2 = new BasicBlock("forcond2",func_from_array,0);
- BasicBlock* label_forbody6 = new BasicBlock("forbody6",func_from_array,0);
- BasicBlock* label_forinc57 = new BasicBlock("forinc57",func_from_array,0);
- BasicBlock* label_afterfor60 = new BasicBlock("afterfor60",func_from_array,0);
-
- // Block entry (label_entry)
- ICmpInst* int1_cmp = new ICmpInst(ICmpInst::ICMP_SGT, int32_count, const_int32_29, "cmp", label_entry);
- ICmpInst* int1_cmp5 = new ICmpInst(ICmpInst::ICMP_SGT, int32_num_attribs, const_int32_29, "cmp5", label_entry);
- BinaryOperator* int1_bothcond = BinaryOperator::create(Instruction::And, int1_cmp, int1_cmp5, "bothcond", label_entry);
- new BranchInst(label_forcond2_preheader_split, label_afterfor60, int1_bothcond, label_entry);
-
- // Block forcond2.preheader.split (label_forcond2_preheader_split)
- BinaryOperator* int32_tmp21 = BinaryOperator::create(Instruction::Add, int32_count, const_int32_30, "tmp21", label_forcond2_preheader_split);
- ICmpInst* int1_tmp22 = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp21, const_int32_29, "tmp22", label_forcond2_preheader_split);
- SelectInst* int32_tmp25 = new SelectInst(int1_tmp22, const_int32_31, int32_count, "tmp25", label_forcond2_preheader_split);
- new BranchInst(label_forcond2, label_forcond2_preheader_split);
-
- // Block forcond2 (label_forcond2)
- Argument* fwdref_38 = new Argument(IntegerType::get(32));
- PHINode* int32_i_0_reg2mem_0 = new PHINode(IntegerType::get(32), "i.0.reg2mem.0", label_forcond2);
- int32_i_0_reg2mem_0->reserveOperandSpace(2);
- int32_i_0_reg2mem_0->addIncoming(const_int32_29, label_forcond2_preheader_split);
- int32_i_0_reg2mem_0->addIncoming(fwdref_38, label_forinc57);
-
- Argument* fwdref_39 = new Argument(VectorTy_1);
- PHINode* packed_vec_1_reg2mem_0 = new PHINode(VectorTy_1, "vec.1.reg2mem.0", label_forcond2);
- packed_vec_1_reg2mem_0->reserveOperandSpace(2);
- packed_vec_1_reg2mem_0->addIncoming(const_packed_32, label_forcond2_preheader_split);
- packed_vec_1_reg2mem_0->addIncoming(fwdref_39, label_forinc57);
-
- BinaryOperator* int32_tmp = BinaryOperator::create(Instruction::Add, int32_num_attribs, const_int32_30, "tmp", label_forcond2);
- ICmpInst* int1_tmp18 = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp, const_int32_29, "tmp18", label_forcond2);
- SelectInst* int32_tmp19 = new SelectInst(int1_tmp18, const_int32_31, int32_num_attribs, "tmp19", label_forcond2);
- new BranchInst(label_forbody6, label_forcond2);
-
- // Block forbody6 (label_forbody6)
- Argument* fwdref_41 = new Argument(IntegerType::get(32));
- PHINode* int32_j_0_reg2mem_0 = new PHINode(IntegerType::get(32), "j.0.reg2mem.0", label_forbody6);
- int32_j_0_reg2mem_0->reserveOperandSpace(2);
- int32_j_0_reg2mem_0->addIncoming(const_int32_29, label_forcond2);
- int32_j_0_reg2mem_0->addIncoming(fwdref_41, label_forbody6);
-
- PHINode* packed_vec_0_reg2mem_0 = new PHINode(VectorTy_1, "vec.0.reg2mem.0", label_forbody6);
- packed_vec_0_reg2mem_0->reserveOperandSpace(2);
- packed_vec_0_reg2mem_0->addIncoming(packed_vec_1_reg2mem_0, label_forcond2);
- packed_vec_0_reg2mem_0->addIncoming(fwdref_39, label_forbody6);
-
- std::vector<Value*> ptr_arraydecay11_indices;
- ptr_arraydecay11_indices.push_back(int32_i_0_reg2mem_0);
- ptr_arraydecay11_indices.push_back(int32_j_0_reg2mem_0);
- ptr_arraydecay11_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay11 = new GetElementPtrInst(ptr_ainputs, ptr_arraydecay11_indices.begin(), ptr_arraydecay11_indices.end(), "arraydecay11", label_forbody6);
- LoadInst* float_tmp13 = new LoadInst(ptr_arraydecay11, "tmp13", false, label_forbody6);
- InsertElementInst* packed_tmp15 = new InsertElementInst(packed_vec_0_reg2mem_0, float_tmp13, const_int32_29, "tmp15", label_forbody6);
- std::vector<Value*> ptr_arrayidx23_indices;
- ptr_arrayidx23_indices.push_back(int32_i_0_reg2mem_0);
- ptr_arrayidx23_indices.push_back(int32_j_0_reg2mem_0);
- ptr_arrayidx23_indices.push_back(const_int32_31);
- Instruction* ptr_arrayidx23 = new GetElementPtrInst(ptr_ainputs, ptr_arrayidx23_indices.begin(), ptr_arrayidx23_indices.end(), "arrayidx23", label_forbody6);
- LoadInst* float_tmp24 = new LoadInst(ptr_arrayidx23, "tmp24", false, label_forbody6);
- InsertElementInst* packed_tmp26 = new InsertElementInst(packed_tmp15, float_tmp24, const_int32_31, "tmp26", label_forbody6);
- std::vector<Value*> ptr_arrayidx34_indices;
- ptr_arrayidx34_indices.push_back(int32_i_0_reg2mem_0);
- ptr_arrayidx34_indices.push_back(int32_j_0_reg2mem_0);
- ptr_arrayidx34_indices.push_back(const_int32_33);
- Instruction* ptr_arrayidx34 = new GetElementPtrInst(ptr_ainputs, ptr_arrayidx34_indices.begin(), ptr_arrayidx34_indices.end(), "arrayidx34", label_forbody6);
- LoadInst* float_tmp35 = new LoadInst(ptr_arrayidx34, "tmp35", false, label_forbody6);
- InsertElementInst* packed_tmp37 = new InsertElementInst(packed_tmp26, float_tmp35, const_int32_33, "tmp37", label_forbody6);
- std::vector<Value*> ptr_arrayidx45_indices;
- ptr_arrayidx45_indices.push_back(int32_i_0_reg2mem_0);
- ptr_arrayidx45_indices.push_back(int32_j_0_reg2mem_0);
- ptr_arrayidx45_indices.push_back(const_int32_34);
- Instruction* ptr_arrayidx45 = new GetElementPtrInst(ptr_ainputs, ptr_arrayidx45_indices.begin(), ptr_arrayidx45_indices.end(), "arrayidx45", label_forbody6);
- LoadInst* float_tmp46 = new LoadInst(ptr_arrayidx45, "tmp46", false, label_forbody6);
- InsertElementInst* packed_tmp48 = new InsertElementInst(packed_tmp37, float_tmp46, const_int32_34, "tmp48", label_forbody6);
- std::vector<Value*> ptr_arrayidx54_indices;
- ptr_arrayidx54_indices.push_back(int32_i_0_reg2mem_0);
- ptr_arrayidx54_indices.push_back(int32_j_0_reg2mem_0);
- Instruction* ptr_arrayidx54 = new GetElementPtrInst(ptr_res, ptr_arrayidx54_indices.begin(), ptr_arrayidx54_indices.end(), "arrayidx54", label_forbody6);
- StoreInst* void_42 = new StoreInst(packed_tmp48, ptr_arrayidx54, false, label_forbody6);
- BinaryOperator* int32_indvar_next = BinaryOperator::create(Instruction::Add, int32_j_0_reg2mem_0, const_int32_31, "indvar.next", label_forbody6);
- ICmpInst* int1_exitcond = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next, int32_tmp19, "exitcond", label_forbody6);
- new BranchInst(label_forinc57, label_forbody6, int1_exitcond, label_forbody6);
-
- // Block forinc57 (label_forinc57)
- BinaryOperator* int32_indvar_next20 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0, const_int32_31, "indvar.next20", label_forinc57);
- ICmpInst* int1_exitcond26 = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next20, int32_tmp25, "exitcond26", label_forinc57);
- new BranchInst(label_afterfor60, label_forcond2, int1_exitcond26, label_forinc57);
-
- // Block afterfor60 (label_afterfor60)
- new ReturnInst(label_afterfor60);
-
- // Resolve Forward References
- fwdref_39->replaceAllUsesWith(packed_tmp48); delete fwdref_39;
- fwdref_41->replaceAllUsesWith(int32_indvar_next); delete fwdref_41;
- fwdref_38->replaceAllUsesWith(int32_indvar_next20); delete fwdref_38;
-
- }
-
- // Function: from_consts (func_from_consts)
- {
- Function::arg_iterator args = func_from_consts->arg_begin();
- Value* ptr_res_46 = args++;
- ptr_res_46->setName("res");
- Value* ptr_ainputs_47 = args++;
- ptr_ainputs_47->setName("ainputs");
- Value* int32_count_48 = args++;
- int32_count_48->setName("count");
-
- BasicBlock* label_entry_49 = new BasicBlock("entry",func_from_consts,0);
- BasicBlock* label_forbody_preheader = new BasicBlock("forbody.preheader",func_from_consts,0);
- BasicBlock* label_forbody = new BasicBlock("forbody",func_from_consts,0);
- BasicBlock* label_afterfor = new BasicBlock("afterfor",func_from_consts,0);
-
- // Block entry (label_entry_49)
- ICmpInst* int1_cmp_50 = new ICmpInst(ICmpInst::ICMP_SGT, int32_count_48, const_int32_29, "cmp", label_entry_49);
- new BranchInst(label_forbody_preheader, label_afterfor, int1_cmp_50, label_entry_49);
-
- // Block forbody.preheader (label_forbody_preheader)
- BinaryOperator* int32_tmp_52 = BinaryOperator::create(Instruction::Add, int32_count_48, const_int32_30, "tmp", label_forbody_preheader);
- ICmpInst* int1_tmp9 = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp_52, const_int32_29, "tmp9", label_forbody_preheader);
- SelectInst* int32_tmp10 = new SelectInst(int1_tmp9, const_int32_31, int32_count_48, "tmp10", label_forbody_preheader);
- new BranchInst(label_forbody, label_forbody_preheader);
-
- // Block forbody (label_forbody)
- Argument* fwdref_55 = new Argument(IntegerType::get(32));
- PHINode* int32_i_0_reg2mem_0_54 = new PHINode(IntegerType::get(32), "i.0.reg2mem.0", label_forbody);
- int32_i_0_reg2mem_0_54->reserveOperandSpace(2);
- int32_i_0_reg2mem_0_54->addIncoming(const_int32_29, label_forbody_preheader);
- int32_i_0_reg2mem_0_54->addIncoming(fwdref_55, label_forbody);
-
- Argument* fwdref_57 = new Argument(VectorTy_1);
- PHINode* packed_vec_0_reg2mem_0_56 = new PHINode(VectorTy_1, "vec.0.reg2mem.0", label_forbody);
- packed_vec_0_reg2mem_0_56->reserveOperandSpace(2);
- packed_vec_0_reg2mem_0_56->addIncoming(const_packed_32, label_forbody_preheader);
- packed_vec_0_reg2mem_0_56->addIncoming(fwdref_57, label_forbody);
-
- std::vector<Value*> ptr_arraydecay_indices;
- ptr_arraydecay_indices.push_back(int32_i_0_reg2mem_0_54);
- ptr_arraydecay_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay = new GetElementPtrInst(ptr_ainputs_47, ptr_arraydecay_indices.begin(), ptr_arraydecay_indices.end(), "arraydecay", label_forbody);
- LoadInst* float_tmp5 = new LoadInst(ptr_arraydecay, "tmp5", false, label_forbody);
- InsertElementInst* packed_tmp7 = new InsertElementInst(packed_vec_0_reg2mem_0_56, float_tmp5, const_int32_29, "tmp7", label_forbody);
- std::vector<Value*> ptr_arrayidx12_indices;
- ptr_arrayidx12_indices.push_back(int32_i_0_reg2mem_0_54);
- ptr_arrayidx12_indices.push_back(const_int32_31);
- Instruction* ptr_arrayidx12 = new GetElementPtrInst(ptr_ainputs_47, ptr_arrayidx12_indices.begin(), ptr_arrayidx12_indices.end(), "arrayidx12", label_forbody);
- LoadInst* float_tmp13_58 = new LoadInst(ptr_arrayidx12, "tmp13", false, label_forbody);
- InsertElementInst* packed_tmp15_59 = new InsertElementInst(packed_tmp7, float_tmp13_58, const_int32_31, "tmp15", label_forbody);
- std::vector<Value*> ptr_arrayidx20_indices;
- ptr_arrayidx20_indices.push_back(int32_i_0_reg2mem_0_54);
- ptr_arrayidx20_indices.push_back(const_int32_33);
- Instruction* ptr_arrayidx20 = new GetElementPtrInst(ptr_ainputs_47, ptr_arrayidx20_indices.begin(), ptr_arrayidx20_indices.end(), "arrayidx20", label_forbody);
- LoadInst* float_tmp21 = new LoadInst(ptr_arrayidx20, "tmp21", false, label_forbody);
- InsertElementInst* packed_tmp23 = new InsertElementInst(packed_tmp15_59, float_tmp21, const_int32_33, "tmp23", label_forbody);
- std::vector<Value*> ptr_arrayidx28_indices;
- ptr_arrayidx28_indices.push_back(int32_i_0_reg2mem_0_54);
- ptr_arrayidx28_indices.push_back(const_int32_34);
- Instruction* ptr_arrayidx28 = new GetElementPtrInst(ptr_ainputs_47, ptr_arrayidx28_indices.begin(), ptr_arrayidx28_indices.end(), "arrayidx28", label_forbody);
- LoadInst* float_tmp29 = new LoadInst(ptr_arrayidx28, "tmp29", false, label_forbody);
- InsertElementInst* packed_tmp31 = new InsertElementInst(packed_tmp23, float_tmp29, const_int32_34, "tmp31", label_forbody);
- GetElementPtrInst* ptr_arrayidx34_60 = new GetElementPtrInst(ptr_res_46, int32_i_0_reg2mem_0_54, "arrayidx34", label_forbody);
- StoreInst* void_61 = new StoreInst(packed_tmp31, ptr_arrayidx34_60, false, label_forbody);
- BinaryOperator* int32_indvar_next_62 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0_54, const_int32_31, "indvar.next", label_forbody);
- ICmpInst* int1_exitcond_63 = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next_62, int32_tmp10, "exitcond", label_forbody);
- new BranchInst(label_afterfor, label_forbody, int1_exitcond_63, label_forbody);
-
- // Block afterfor (label_afterfor)
- new ReturnInst(label_afterfor);
-
- // Resolve Forward References
- fwdref_57->replaceAllUsesWith(packed_tmp31); delete fwdref_57;
- fwdref_55->replaceAllUsesWith(int32_indvar_next_62); delete fwdref_55;
-
- }
-
- // Function: to_array (func_to_array)
- {
- Function::arg_iterator args = func_to_array->arg_begin();
- Value* ptr_dests = args++;
- ptr_dests->setName("dests");
- Value* ptr_in = args++;
- ptr_in->setName("in");
- Value* int32_num_attribs_66 = args++;
- int32_num_attribs_66->setName("num_attribs");
-
- BasicBlock* label_entry_67 = new BasicBlock("entry",func_to_array,0);
- BasicBlock* label_forbody_preheader_68 = new BasicBlock("forbody.preheader",func_to_array,0);
- BasicBlock* label_forbody_69 = new BasicBlock("forbody",func_to_array,0);
- BasicBlock* label_afterfor_70 = new BasicBlock("afterfor",func_to_array,0);
-
- // Block entry (label_entry_67)
- ICmpInst* int1_cmp_71 = new ICmpInst(ICmpInst::ICMP_SGT, int32_num_attribs_66, const_int32_29, "cmp", label_entry_67);
- new BranchInst(label_forbody_preheader_68, label_afterfor_70, int1_cmp_71, label_entry_67);
-
- // Block forbody.preheader (label_forbody_preheader_68)
- BinaryOperator* int32_tmp_73 = BinaryOperator::create(Instruction::Add, int32_num_attribs_66, const_int32_30, "tmp", label_forbody_preheader_68);
- ICmpInst* int1_tmp9_74 = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp_73, const_int32_29, "tmp9", label_forbody_preheader_68);
- SelectInst* int32_tmp10_75 = new SelectInst(int1_tmp9_74, const_int32_31, int32_num_attribs_66, "tmp10", label_forbody_preheader_68);
- new BranchInst(label_forbody_69, label_forbody_preheader_68);
-
- // Block forbody (label_forbody_69)
- Argument* fwdref_78 = new Argument(IntegerType::get(32));
- PHINode* int32_i_0_reg2mem_0_77 = new PHINode(IntegerType::get(32), "i.0.reg2mem.0", label_forbody_69);
- int32_i_0_reg2mem_0_77->reserveOperandSpace(2);
- int32_i_0_reg2mem_0_77->addIncoming(const_int32_29, label_forbody_preheader_68);
- int32_i_0_reg2mem_0_77->addIncoming(fwdref_78, label_forbody_69);
-
- std::vector<Value*> ptr_arraydecay_79_indices;
- ptr_arraydecay_79_indices.push_back(int32_i_0_reg2mem_0_77);
- ptr_arraydecay_79_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay_79 = new GetElementPtrInst(ptr_dests, ptr_arraydecay_79_indices.begin(), ptr_arraydecay_79_indices.end(), "arraydecay", label_forbody_69);
- GetElementPtrInst* ptr_arrayidx6 = new GetElementPtrInst(ptr_in, int32_i_0_reg2mem_0_77, "arrayidx6", label_forbody_69);
- LoadInst* packed_tmp7_80 = new LoadInst(ptr_arrayidx6, "tmp7", false, label_forbody_69);
- ExtractElementInst* float_tmp11 = new ExtractElementInst(packed_tmp7_80, const_int32_29, "tmp11", label_forbody_69);
- StoreInst* void_81 = new StoreInst(float_tmp11, ptr_arraydecay_79, false, label_forbody_69);
- std::vector<Value*> ptr_arrayidx13_indices;
- ptr_arrayidx13_indices.push_back(int32_i_0_reg2mem_0_77);
- ptr_arrayidx13_indices.push_back(const_int32_31);
- Instruction* ptr_arrayidx13 = new GetElementPtrInst(ptr_dests, ptr_arrayidx13_indices.begin(), ptr_arrayidx13_indices.end(), "arrayidx13", label_forbody_69);
- ExtractElementInst* float_tmp15 = new ExtractElementInst(packed_tmp7_80, const_int32_31, "tmp15", label_forbody_69);
- StoreInst* void_82 = new StoreInst(float_tmp15, ptr_arrayidx13, false, label_forbody_69);
- std::vector<Value*> ptr_arrayidx17_indices;
- ptr_arrayidx17_indices.push_back(int32_i_0_reg2mem_0_77);
- ptr_arrayidx17_indices.push_back(const_int32_33);
- Instruction* ptr_arrayidx17 = new GetElementPtrInst(ptr_dests, ptr_arrayidx17_indices.begin(), ptr_arrayidx17_indices.end(), "arrayidx17", label_forbody_69);
- ExtractElementInst* float_tmp19 = new ExtractElementInst(packed_tmp7_80, const_int32_33, "tmp19", label_forbody_69);
- StoreInst* void_83 = new StoreInst(float_tmp19, ptr_arrayidx17, false, label_forbody_69);
- std::vector<Value*> ptr_arrayidx21_indices;
- ptr_arrayidx21_indices.push_back(int32_i_0_reg2mem_0_77);
- ptr_arrayidx21_indices.push_back(const_int32_34);
- Instruction* ptr_arrayidx21 = new GetElementPtrInst(ptr_dests, ptr_arrayidx21_indices.begin(), ptr_arrayidx21_indices.end(), "arrayidx21", label_forbody_69);
- ExtractElementInst* float_tmp23 = new ExtractElementInst(packed_tmp7_80, const_int32_34, "tmp23", label_forbody_69);
- StoreInst* void_84 = new StoreInst(float_tmp23, ptr_arrayidx21, false, label_forbody_69);
- BinaryOperator* int32_indvar_next_85 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0_77, const_int32_31, "indvar.next", label_forbody_69);
- ICmpInst* int1_exitcond_86 = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next_85, int32_tmp10_75, "exitcond", label_forbody_69);
- new BranchInst(label_afterfor_70, label_forbody_69, int1_exitcond_86, label_forbody_69);
-
- // Block afterfor (label_afterfor_70)
- new ReturnInst(label_afterfor_70);
-
- // Resolve Forward References
- fwdref_78->replaceAllUsesWith(int32_indvar_next_85); delete fwdref_78;
-
- }
-
- // Function: run_vertex_shader (func_run_vertex_shader)
- {
- Function::arg_iterator args = func_run_vertex_shader->arg_begin();
- Value* ptr_inputs = args++;
- ptr_inputs->setName("inputs");
- Value* ptr_results = args++;
- ptr_results->setName("results");
- Value* ptr_aconsts = args++;
- ptr_aconsts->setName("aconsts");
- Value* int32_num_vertices = args++;
- int32_num_vertices->setName("num_vertices");
- Value* int32_num_inputs = args++;
- int32_num_inputs->setName("num_inputs");
- Value* int32_num_attribs_89 = args++;
- int32_num_attribs_89->setName("num_attribs");
- Value* int32_num_consts = args++;
- int32_num_consts->setName("num_consts");
-
- BasicBlock* label_entry_90 = new BasicBlock("entry",func_run_vertex_shader,0);
- BasicBlock* label_forbody_preheader_i = new BasicBlock("forbody.preheader.i",func_run_vertex_shader,0);
- BasicBlock* label_forbody_i = new BasicBlock("forbody.i",func_run_vertex_shader,0);
- BasicBlock* label_from_consts_exit = new BasicBlock("from_consts.exit",func_run_vertex_shader,0);
-
- // Block entry (label_entry_90)
- AllocaInst* ptr_consts = new AllocaInst(ArrayTy_20, "consts", label_entry_90);
- AllocaInst* ptr_temps = new AllocaInst(ArrayTy_22, "temps", label_entry_90);
- AllocaInst* ptr_args = new AllocaInst(StructTy_struct_ShaderInput, "args", label_entry_90);
- std::vector<Value*> ptr_tmp_indices;
- ptr_tmp_indices.push_back(const_int32_29);
- ptr_tmp_indices.push_back(const_int32_29);
- Instruction* ptr_tmp = new GetElementPtrInst(ptr_args, ptr_tmp_indices.begin(), ptr_tmp_indices.end(), "tmp", label_entry_90);
- CastInst* ptr_conv = new BitCastInst(ptr_results, PointerTy_0, "conv", label_entry_90);
- StoreInst* void_91 = new StoreInst(ptr_conv, ptr_tmp, false, label_entry_90);
- std::vector<Value*> ptr_tmp2_indices;
- ptr_tmp2_indices.push_back(const_int32_29);
- ptr_tmp2_indices.push_back(const_int32_31);
- Instruction* ptr_tmp2 = new GetElementPtrInst(ptr_args, ptr_tmp2_indices.begin(), ptr_tmp2_indices.end(), "tmp2", label_entry_90);
- CastInst* ptr_conv4 = new BitCastInst(ptr_inputs, PointerTy_0, "conv4", label_entry_90);
- StoreInst* void_92 = new StoreInst(ptr_conv4, ptr_tmp2, false, label_entry_90);
- ICmpInst* int1_cmp_i = new ICmpInst(ICmpInst::ICMP_SGT, int32_num_consts, const_int32_29, "cmp.i", label_entry_90);
- new BranchInst(label_forbody_preheader_i, label_from_consts_exit, int1_cmp_i, label_entry_90);
-
- // Block forbody.preheader.i (label_forbody_preheader_i)
- BinaryOperator* int32_tmp_i = BinaryOperator::create(Instruction::Add, int32_num_consts, const_int32_30, "tmp.i", label_forbody_preheader_i);
- ICmpInst* int1_tmp9_i = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp_i, const_int32_29, "tmp9.i", label_forbody_preheader_i);
- SelectInst* int32_tmp10_i = new SelectInst(int1_tmp9_i, const_int32_31, int32_num_consts, "tmp10.i", label_forbody_preheader_i);
- new BranchInst(label_forbody_i, label_forbody_preheader_i);
-
- // Block forbody.i (label_forbody_i)
- Argument* fwdref_95 = new Argument(IntegerType::get(32));
- PHINode* int32_i_0_reg2mem_0_i = new PHINode(IntegerType::get(32), "i.0.reg2mem.0.i", label_forbody_i);
- int32_i_0_reg2mem_0_i->reserveOperandSpace(2);
- int32_i_0_reg2mem_0_i->addIncoming(const_int32_29, label_forbody_preheader_i);
- int32_i_0_reg2mem_0_i->addIncoming(fwdref_95, label_forbody_i);
-
- Argument* fwdref_96 = new Argument(VectorTy_1);
- PHINode* packed_vec_0_reg2mem_0_i = new PHINode(VectorTy_1, "vec.0.reg2mem.0.i", label_forbody_i);
- packed_vec_0_reg2mem_0_i->reserveOperandSpace(2);
- packed_vec_0_reg2mem_0_i->addIncoming(const_packed_32, label_forbody_preheader_i);
- packed_vec_0_reg2mem_0_i->addIncoming(fwdref_96, label_forbody_i);
-
- std::vector<Value*> ptr_arraydecay_i_indices;
- ptr_arraydecay_i_indices.push_back(int32_i_0_reg2mem_0_i);
- ptr_arraydecay_i_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay_i = new GetElementPtrInst(ptr_aconsts, ptr_arraydecay_i_indices.begin(), ptr_arraydecay_i_indices.end(), "arraydecay.i", label_forbody_i);
- LoadInst* float_tmp5_i = new LoadInst(ptr_arraydecay_i, "tmp5.i", false, label_forbody_i);
- InsertElementInst* packed_tmp7_i = new InsertElementInst(packed_vec_0_reg2mem_0_i, float_tmp5_i, const_int32_29, "tmp7.i", label_forbody_i);
- std::vector<Value*> ptr_arrayidx12_i_indices;
- ptr_arrayidx12_i_indices.push_back(int32_i_0_reg2mem_0_i);
- ptr_arrayidx12_i_indices.push_back(const_int32_31);
- Instruction* ptr_arrayidx12_i = new GetElementPtrInst(ptr_aconsts, ptr_arrayidx12_i_indices.begin(), ptr_arrayidx12_i_indices.end(), "arrayidx12.i", label_forbody_i);
- LoadInst* float_tmp13_i = new LoadInst(ptr_arrayidx12_i, "tmp13.i", false, label_forbody_i);
- InsertElementInst* packed_tmp15_i = new InsertElementInst(packed_tmp7_i, float_tmp13_i, const_int32_31, "tmp15.i", label_forbody_i);
- std::vector<Value*> ptr_arrayidx20_i_indices;
- ptr_arrayidx20_i_indices.push_back(int32_i_0_reg2mem_0_i);
- ptr_arrayidx20_i_indices.push_back(const_int32_33);
- Instruction* ptr_arrayidx20_i = new GetElementPtrInst(ptr_aconsts, ptr_arrayidx20_i_indices.begin(), ptr_arrayidx20_i_indices.end(), "arrayidx20.i", label_forbody_i);
- LoadInst* float_tmp21_i = new LoadInst(ptr_arrayidx20_i, "tmp21.i", false, label_forbody_i);
- InsertElementInst* packed_tmp23_i = new InsertElementInst(packed_tmp15_i, float_tmp21_i, const_int32_33, "tmp23.i", label_forbody_i);
- std::vector<Value*> ptr_arrayidx28_i_indices;
- ptr_arrayidx28_i_indices.push_back(int32_i_0_reg2mem_0_i);
- ptr_arrayidx28_i_indices.push_back(const_int32_34);
- Instruction* ptr_arrayidx28_i = new GetElementPtrInst(ptr_aconsts, ptr_arrayidx28_i_indices.begin(), ptr_arrayidx28_i_indices.end(), "arrayidx28.i", label_forbody_i);
- LoadInst* float_tmp29_i = new LoadInst(ptr_arrayidx28_i, "tmp29.i", false, label_forbody_i);
- InsertElementInst* packed_tmp31_i = new InsertElementInst(packed_tmp23_i, float_tmp29_i, const_int32_34, "tmp31.i", label_forbody_i);
- std::vector<Value*> ptr_arrayidx34_i_indices;
- ptr_arrayidx34_i_indices.push_back(const_int32_29);
- ptr_arrayidx34_i_indices.push_back(int32_i_0_reg2mem_0_i);
- Instruction* ptr_arrayidx34_i = new GetElementPtrInst(ptr_consts, ptr_arrayidx34_i_indices.begin(), ptr_arrayidx34_i_indices.end(), "arrayidx34.i", label_forbody_i);
- StoreInst* void_97 = new StoreInst(packed_tmp31_i, ptr_arrayidx34_i, false, label_forbody_i);
- BinaryOperator* int32_indvar_next_98 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0_i, const_int32_31, "indvar.next", label_forbody_i);
- ICmpInst* int1_exitcond_99 = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next_98, int32_tmp10_i, "exitcond", label_forbody_i);
- new BranchInst(label_from_consts_exit, label_forbody_i, int1_exitcond_99, label_forbody_i);
-
- // Block from_consts.exit (label_from_consts_exit)
- std::vector<Value*> ptr_tmp7_indices;
- ptr_tmp7_indices.push_back(const_int32_29);
- ptr_tmp7_indices.push_back(const_int32_34);
- Instruction* ptr_tmp7 = new GetElementPtrInst(ptr_args, ptr_tmp7_indices.begin(), ptr_tmp7_indices.end(), "tmp7", label_from_consts_exit);
- std::vector<Value*> ptr_arraydecay8_indices;
- ptr_arraydecay8_indices.push_back(const_int32_29);
- ptr_arraydecay8_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay8 = new GetElementPtrInst(ptr_consts, ptr_arraydecay8_indices.begin(), ptr_arraydecay8_indices.end(), "arraydecay8", label_from_consts_exit);
- StoreInst* void_101 = new StoreInst(ptr_arraydecay8, ptr_tmp7, false, label_from_consts_exit);
- std::vector<Value*> ptr_tmp9_indices;
- ptr_tmp9_indices.push_back(const_int32_29);
- ptr_tmp9_indices.push_back(const_int32_33);
- Instruction* ptr_tmp9 = new GetElementPtrInst(ptr_args, ptr_tmp9_indices.begin(), ptr_tmp9_indices.end(), "tmp9", label_from_consts_exit);
- std::vector<Value*> ptr_arraydecay10_indices;
- ptr_arraydecay10_indices.push_back(const_int32_29);
- ptr_arraydecay10_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay10 = new GetElementPtrInst(ptr_temps, ptr_arraydecay10_indices.begin(), ptr_arraydecay10_indices.end(), "arraydecay10", label_from_consts_exit);
- StoreInst* void_102 = new StoreInst(ptr_arraydecay10, ptr_tmp9, false, label_from_consts_exit);
- CallInst* void_103 = new CallInst(func_execute_shader, ptr_args, "", label_from_consts_exit);
- void_103->setCallingConv(CallingConv::C);
- void_103->setTailCall(false);const ParamAttrsList *void_103_PAL = 0;
- void_103->setParamAttrs(void_103_PAL);
-
- new ReturnInst(label_from_consts_exit);
-
- // Resolve Forward References
- fwdref_96->replaceAllUsesWith(packed_tmp31_i); delete fwdref_96;
- fwdref_95->replaceAllUsesWith(int32_indvar_next_98); delete fwdref_95;
-
- }
-
- // Function: run_fragment_shader (func_run_fragment_shader)
- {
- Function::arg_iterator args = func_run_fragment_shader->arg_begin();
- Value* float_x = args++;
- float_x->setName("x");
- Value* float_y = args++;
- float_y->setName("y");
- Value* ptr_results_105 = args++;
- ptr_results_105->setName("results");
- Value* ptr_inputs_106 = args++;
- ptr_inputs_106->setName("inputs");
- Value* int32_num_inputs_107 = args++;
- int32_num_inputs_107->setName("num_inputs");
- Value* ptr_aconsts_108 = args++;
- ptr_aconsts_108->setName("aconsts");
- Value* int32_num_consts_109 = args++;
- int32_num_consts_109->setName("num_consts");
- Value* ptr_samplers = args++;
- ptr_samplers->setName("samplers");
-
- BasicBlock* label_entry_110 = new BasicBlock("entry",func_run_fragment_shader,0);
- BasicBlock* label_forbody_preheader_i_111 = new BasicBlock("forbody.preheader.i",func_run_fragment_shader,0);
- BasicBlock* label_forbody_i_112 = new BasicBlock("forbody.i",func_run_fragment_shader,0);
- BasicBlock* label_from_consts_exit_113 = new BasicBlock("from_consts.exit",func_run_fragment_shader,0);
-
- // Block entry (label_entry_110)
- AllocaInst* ptr_consts_114 = new AllocaInst(ArrayTy_20, "consts", label_entry_110);
- AllocaInst* ptr_temps_115 = new AllocaInst(ArrayTy_22, "temps", label_entry_110);
- AllocaInst* ptr_args_116 = new AllocaInst(StructTy_struct_ShaderInput, "args", label_entry_110);
- std::vector<Value*> ptr_tmp_117_indices;
- ptr_tmp_117_indices.push_back(const_int32_29);
- ptr_tmp_117_indices.push_back(const_int32_35);
- Instruction* ptr_tmp_117 = new GetElementPtrInst(ptr_args_116, ptr_tmp_117_indices.begin(), ptr_tmp_117_indices.end(), "tmp", label_entry_110);
- StoreInst* void_118 = new StoreInst(const_int32_29, ptr_tmp_117, false, label_entry_110);
- ICmpInst* int1_cmp_i_119 = new ICmpInst(ICmpInst::ICMP_SGT, int32_num_consts_109, const_int32_29, "cmp.i", label_entry_110);
- new BranchInst(label_forbody_preheader_i_111, label_from_consts_exit_113, int1_cmp_i_119, label_entry_110);
-
- // Block forbody.preheader.i (label_forbody_preheader_i_111)
- BinaryOperator* int32_tmp_i_121 = BinaryOperator::create(Instruction::Add, int32_num_consts_109, const_int32_30, "tmp.i", label_forbody_preheader_i_111);
- ICmpInst* int1_tmp9_i_122 = new ICmpInst(ICmpInst::ICMP_SLT, int32_tmp_i_121, const_int32_29, "tmp9.i", label_forbody_preheader_i_111);
- SelectInst* int32_tmp10_i_123 = new SelectInst(int1_tmp9_i_122, const_int32_31, int32_num_consts_109, "tmp10.i", label_forbody_preheader_i_111);
- new BranchInst(label_forbody_i_112, label_forbody_preheader_i_111);
-
- // Block forbody.i (label_forbody_i_112)
- Argument* fwdref_126 = new Argument(IntegerType::get(32));
- PHINode* int32_i_0_reg2mem_0_i_125 = new PHINode(IntegerType::get(32), "i.0.reg2mem.0.i", label_forbody_i_112);
- int32_i_0_reg2mem_0_i_125->reserveOperandSpace(2);
- int32_i_0_reg2mem_0_i_125->addIncoming(const_int32_29, label_forbody_preheader_i_111);
- int32_i_0_reg2mem_0_i_125->addIncoming(fwdref_126, label_forbody_i_112);
-
- Argument* fwdref_128 = new Argument(VectorTy_1);
- PHINode* packed_vec_0_reg2mem_0_i_127 = new PHINode(VectorTy_1, "vec.0.reg2mem.0.i", label_forbody_i_112);
- packed_vec_0_reg2mem_0_i_127->reserveOperandSpace(2);
- packed_vec_0_reg2mem_0_i_127->addIncoming(const_packed_32, label_forbody_preheader_i_111);
- packed_vec_0_reg2mem_0_i_127->addIncoming(fwdref_128, label_forbody_i_112);
-
- std::vector<Value*> ptr_arraydecay_i_129_indices;
- ptr_arraydecay_i_129_indices.push_back(int32_i_0_reg2mem_0_i_125);
- ptr_arraydecay_i_129_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay_i_129 = new GetElementPtrInst(ptr_aconsts_108, ptr_arraydecay_i_129_indices.begin(), ptr_arraydecay_i_129_indices.end(), "arraydecay.i", label_forbody_i_112);
- LoadInst* float_tmp5_i_130 = new LoadInst(ptr_arraydecay_i_129, "tmp5.i", false, label_forbody_i_112);
- InsertElementInst* packed_tmp7_i_131 = new InsertElementInst(packed_vec_0_reg2mem_0_i_127, float_tmp5_i_130, const_int32_29, "tmp7.i", label_forbody_i_112);
- std::vector<Value*> ptr_arrayidx12_i_132_indices;
- ptr_arrayidx12_i_132_indices.push_back(int32_i_0_reg2mem_0_i_125);
- ptr_arrayidx12_i_132_indices.push_back(const_int32_31);
- Instruction* ptr_arrayidx12_i_132 = new GetElementPtrInst(ptr_aconsts_108, ptr_arrayidx12_i_132_indices.begin(), ptr_arrayidx12_i_132_indices.end(), "arrayidx12.i", label_forbody_i_112);
- LoadInst* float_tmp13_i_133 = new LoadInst(ptr_arrayidx12_i_132, "tmp13.i", false, label_forbody_i_112);
- InsertElementInst* packed_tmp15_i_134 = new InsertElementInst(packed_tmp7_i_131, float_tmp13_i_133, const_int32_31, "tmp15.i", label_forbody_i_112);
- std::vector<Value*> ptr_arrayidx20_i_135_indices;
- ptr_arrayidx20_i_135_indices.push_back(int32_i_0_reg2mem_0_i_125);
- ptr_arrayidx20_i_135_indices.push_back(const_int32_33);
- Instruction* ptr_arrayidx20_i_135 = new GetElementPtrInst(ptr_aconsts_108, ptr_arrayidx20_i_135_indices.begin(), ptr_arrayidx20_i_135_indices.end(), "arrayidx20.i", label_forbody_i_112);
- LoadInst* float_tmp21_i_136 = new LoadInst(ptr_arrayidx20_i_135, "tmp21.i", false, label_forbody_i_112);
- InsertElementInst* packed_tmp23_i_137 = new InsertElementInst(packed_tmp15_i_134, float_tmp21_i_136, const_int32_33, "tmp23.i", label_forbody_i_112);
- std::vector<Value*> ptr_arrayidx28_i_138_indices;
- ptr_arrayidx28_i_138_indices.push_back(int32_i_0_reg2mem_0_i_125);
- ptr_arrayidx28_i_138_indices.push_back(const_int32_34);
- Instruction* ptr_arrayidx28_i_138 = new GetElementPtrInst(ptr_aconsts_108, ptr_arrayidx28_i_138_indices.begin(), ptr_arrayidx28_i_138_indices.end(), "arrayidx28.i", label_forbody_i_112);
- LoadInst* float_tmp29_i_139 = new LoadInst(ptr_arrayidx28_i_138, "tmp29.i", false, label_forbody_i_112);
- InsertElementInst* packed_tmp31_i_140 = new InsertElementInst(packed_tmp23_i_137, float_tmp29_i_139, const_int32_34, "tmp31.i", label_forbody_i_112);
- std::vector<Value*> ptr_arrayidx34_i_141_indices;
- ptr_arrayidx34_i_141_indices.push_back(const_int32_29);
- ptr_arrayidx34_i_141_indices.push_back(int32_i_0_reg2mem_0_i_125);
- Instruction* ptr_arrayidx34_i_141 = new GetElementPtrInst(ptr_consts_114, ptr_arrayidx34_i_141_indices.begin(), ptr_arrayidx34_i_141_indices.end(), "arrayidx34.i", label_forbody_i_112);
- StoreInst* void_142 = new StoreInst(packed_tmp31_i_140, ptr_arrayidx34_i_141, false, label_forbody_i_112);
- BinaryOperator* int32_indvar_next7 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0_i_125, const_int32_31, "indvar.next7", label_forbody_i_112);
- ICmpInst* int1_exitcond8 = new ICmpInst(ICmpInst::ICMP_EQ, int32_indvar_next7, int32_tmp10_i_123, "exitcond8", label_forbody_i_112);
- new BranchInst(label_from_consts_exit_113, label_forbody_i_112, int1_exitcond8, label_forbody_i_112);
-
- // Block from_consts.exit (label_from_consts_exit_113)
- std::vector<Value*> ptr_tmp3_indices;
- ptr_tmp3_indices.push_back(const_int32_29);
- ptr_tmp3_indices.push_back(const_int32_34);
- Instruction* ptr_tmp3 = new GetElementPtrInst(ptr_args_116, ptr_tmp3_indices.begin(), ptr_tmp3_indices.end(), "tmp3", label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay4_indices;
- ptr_arraydecay4_indices.push_back(const_int32_29);
- ptr_arraydecay4_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay4 = new GetElementPtrInst(ptr_consts_114, ptr_arraydecay4_indices.begin(), ptr_arraydecay4_indices.end(), "arraydecay4", label_from_consts_exit_113);
- StoreInst* void_144 = new StoreInst(ptr_arraydecay4, ptr_tmp3, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_tmp5_indices;
- ptr_tmp5_indices.push_back(const_int32_29);
- ptr_tmp5_indices.push_back(const_int32_33);
- Instruction* ptr_tmp5 = new GetElementPtrInst(ptr_args_116, ptr_tmp5_indices.begin(), ptr_tmp5_indices.end(), "tmp5", label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay6_indices;
- ptr_arraydecay6_indices.push_back(const_int32_29);
- ptr_arraydecay6_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay6 = new GetElementPtrInst(ptr_temps_115, ptr_arraydecay6_indices.begin(), ptr_arraydecay6_indices.end(), "arraydecay6", label_from_consts_exit_113);
- StoreInst* void_145 = new StoreInst(ptr_arraydecay6, ptr_tmp5, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_tmp8_indices;
- ptr_tmp8_indices.push_back(const_int32_29);
- ptr_tmp8_indices.push_back(const_int32_31);
- Instruction* ptr_tmp8 = new GetElementPtrInst(ptr_args_116, ptr_tmp8_indices.begin(), ptr_tmp8_indices.end(), "tmp8", label_from_consts_exit_113);
- std::vector<Value*> ptr_tmp12_indices;
- ptr_tmp12_indices.push_back(const_int32_29);
- ptr_tmp12_indices.push_back(const_int32_29);
- Instruction* ptr_tmp12 = new GetElementPtrInst(ptr_args_116, ptr_tmp12_indices.begin(), ptr_tmp12_indices.end(), "tmp12", label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay11_146_indices;
- ptr_arraydecay11_146_indices.push_back(const_int32_29);
- ptr_arraydecay11_146_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay11_146 = new GetElementPtrInst(ptr_inputs_106, ptr_arraydecay11_146_indices.begin(), ptr_arraydecay11_146_indices.end(), "arraydecay11", label_from_consts_exit_113);
- StoreInst* void_147 = new StoreInst(ptr_arraydecay11_146, ptr_tmp8, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay16_indices;
- ptr_arraydecay16_indices.push_back(const_int32_29);
- ptr_arraydecay16_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay16 = new GetElementPtrInst(ptr_results_105, ptr_arraydecay16_indices.begin(), ptr_arraydecay16_indices.end(), "arraydecay16", label_from_consts_exit_113);
- StoreInst* void_148 = new StoreInst(ptr_arraydecay16, ptr_tmp12, false, label_from_consts_exit_113);
- StoreInst* void_149 = new StoreInst(const_int32_29, ptr_tmp_117, false, label_from_consts_exit_113);
- CallInst* void_150 = new CallInst(func_execute_shader, ptr_args_116, "", label_from_consts_exit_113);
- void_150->setCallingConv(CallingConv::C);
- void_150->setTailCall(false);const ParamAttrsList *void_150_PAL = 0;
- void_150->setParamAttrs(void_150_PAL);
-
- LoadInst* int32_tmp23 = new LoadInst(ptr_tmp_117, "tmp23", false, label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay11_1_indices;
- ptr_arraydecay11_1_indices.push_back(const_int32_31);
- ptr_arraydecay11_1_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay11_1 = new GetElementPtrInst(ptr_inputs_106, ptr_arraydecay11_1_indices.begin(), ptr_arraydecay11_1_indices.end(), "arraydecay11.1", label_from_consts_exit_113);
- StoreInst* void_151 = new StoreInst(ptr_arraydecay11_1, ptr_tmp8, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay16_1_indices;
- ptr_arraydecay16_1_indices.push_back(const_int32_31);
- ptr_arraydecay16_1_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay16_1 = new GetElementPtrInst(ptr_results_105, ptr_arraydecay16_1_indices.begin(), ptr_arraydecay16_1_indices.end(), "arraydecay16.1", label_from_consts_exit_113);
- StoreInst* void_152 = new StoreInst(ptr_arraydecay16_1, ptr_tmp12, false, label_from_consts_exit_113);
- StoreInst* void_153 = new StoreInst(const_int32_29, ptr_tmp_117, false, label_from_consts_exit_113);
- CallInst* void_154 = new CallInst(func_execute_shader, ptr_args_116, "", label_from_consts_exit_113);
- void_154->setCallingConv(CallingConv::C);
- void_154->setTailCall(false);const ParamAttrsList *void_154_PAL = 0;
- void_154->setParamAttrs(void_154_PAL);
-
- LoadInst* int32_tmp23_1 = new LoadInst(ptr_tmp_117, "tmp23.1", false, label_from_consts_exit_113);
- BinaryOperator* int32_shl_1 = BinaryOperator::create(Instruction::Shl, int32_tmp23_1, const_int32_31, "shl.1", label_from_consts_exit_113);
- BinaryOperator* int32_or_1 = BinaryOperator::create(Instruction::Or, int32_shl_1, int32_tmp23, "or.1", label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay11_2_indices;
- ptr_arraydecay11_2_indices.push_back(const_int32_33);
- ptr_arraydecay11_2_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay11_2 = new GetElementPtrInst(ptr_inputs_106, ptr_arraydecay11_2_indices.begin(), ptr_arraydecay11_2_indices.end(), "arraydecay11.2", label_from_consts_exit_113);
- StoreInst* void_155 = new StoreInst(ptr_arraydecay11_2, ptr_tmp8, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay16_2_indices;
- ptr_arraydecay16_2_indices.push_back(const_int32_33);
- ptr_arraydecay16_2_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay16_2 = new GetElementPtrInst(ptr_results_105, ptr_arraydecay16_2_indices.begin(), ptr_arraydecay16_2_indices.end(), "arraydecay16.2", label_from_consts_exit_113);
- StoreInst* void_156 = new StoreInst(ptr_arraydecay16_2, ptr_tmp12, false, label_from_consts_exit_113);
- StoreInst* void_157 = new StoreInst(const_int32_29, ptr_tmp_117, false, label_from_consts_exit_113);
- CallInst* void_158 = new CallInst(func_execute_shader, ptr_args_116, "", label_from_consts_exit_113);
- void_158->setCallingConv(CallingConv::C);
- void_158->setTailCall(false);const ParamAttrsList *void_158_PAL = 0;
- void_158->setParamAttrs(void_158_PAL);
-
- LoadInst* int32_tmp23_2 = new LoadInst(ptr_tmp_117, "tmp23.2", false, label_from_consts_exit_113);
- BinaryOperator* int32_shl_2 = BinaryOperator::create(Instruction::Shl, int32_tmp23_2, const_int32_33, "shl.2", label_from_consts_exit_113);
- BinaryOperator* int32_or_2 = BinaryOperator::create(Instruction::Or, int32_shl_2, int32_or_1, "or.2", label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay11_3_indices;
- ptr_arraydecay11_3_indices.push_back(const_int32_34);
- ptr_arraydecay11_3_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay11_3 = new GetElementPtrInst(ptr_inputs_106, ptr_arraydecay11_3_indices.begin(), ptr_arraydecay11_3_indices.end(), "arraydecay11.3", label_from_consts_exit_113);
- StoreInst* void_159 = new StoreInst(ptr_arraydecay11_3, ptr_tmp8, false, label_from_consts_exit_113);
- std::vector<Value*> ptr_arraydecay16_3_indices;
- ptr_arraydecay16_3_indices.push_back(const_int32_34);
- ptr_arraydecay16_3_indices.push_back(const_int32_29);
- Instruction* ptr_arraydecay16_3 = new GetElementPtrInst(ptr_results_105, ptr_arraydecay16_3_indices.begin(), ptr_arraydecay16_3_indices.end(), "arraydecay16.3", label_from_consts_exit_113);
- StoreInst* void_160 = new StoreInst(ptr_arraydecay16_3, ptr_tmp12, false, label_from_consts_exit_113);
- StoreInst* void_161 = new StoreInst(const_int32_29, ptr_tmp_117, false, label_from_consts_exit_113);
- CallInst* void_162 = new CallInst(func_execute_shader, ptr_args_116, "", label_from_consts_exit_113);
- void_162->setCallingConv(CallingConv::C);
- void_162->setTailCall(false);const ParamAttrsList *void_162_PAL = 0;
- void_162->setParamAttrs(void_162_PAL);
-
- LoadInst* int32_tmp23_3 = new LoadInst(ptr_tmp_117, "tmp23.3", false, label_from_consts_exit_113);
- BinaryOperator* int32_shl_3 = BinaryOperator::create(Instruction::Shl, int32_tmp23_3, const_int32_34, "shl.3", label_from_consts_exit_113);
- BinaryOperator* int32_or_3 = BinaryOperator::create(Instruction::Or, int32_shl_3, int32_or_2, "or.3", label_from_consts_exit_113);
- BinaryOperator* int32_neg = BinaryOperator::create(Instruction::Xor, int32_or_3, const_int32_30, "neg", label_from_consts_exit_113);
- new ReturnInst(int32_neg, label_from_consts_exit_113);
-
- // Resolve Forward References
- fwdref_128->replaceAllUsesWith(packed_tmp31_i_140); delete fwdref_128;
- fwdref_126->replaceAllUsesWith(int32_indvar_next7); delete fwdref_126;
-
- }
-
- return mod;
-}
diff --git a/src/mesa/pipe/llvm/llvm_entry.c b/src/mesa/pipe/llvm/llvm_entry.c
deleted file mode 100644
index fa50b60e66..0000000000
--- a/src/mesa/pipe/llvm/llvm_entry.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* clang --emit-llvm llvm_entry.c |llvm-as |opt -std-compile-opts |llvm2cpp -for=Shader -gen-module -funcname=createBaseShader */
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Zack Rusin zack@tungstengraphics.com
- */
-
-/* clang --emit-llvm llvm_builtins.c |llvm-as |opt -std-compile-opts |llvm-dis */
-typedef __attribute__(( ocu_vector_type(4) )) float float4;
-
-void from_array(float4 (*res)[16], float (*ainputs)[16][4],
- int count, int num_attribs)
-{
- for (int i = 0; i < count; ++i) {
- for (int j = 0; j < num_attribs; ++j) {
- float4 vec;
- vec.x = ainputs[i][j][0];
- vec.y = ainputs[i][j][1];
- vec.z = ainputs[i][j][2];
- vec.w = ainputs[i][j][3];
- res[i][j] = vec;
- }
- }
-}
-
-void from_consts(float4 *res, float (*ainputs)[4],
- int count)
-{
- for (int i = 0; i < count; ++i) {
- float4 vec;
- vec.x = ainputs[i][0];
- vec.y = ainputs[i][1];
- vec.z = ainputs[i][2];
- vec.w = ainputs[i][3];
- res[i] = vec;
- }
-}
-
-void to_array(float (*dests)[4], float4 *in, int num_attribs)
-{
- for (int i = 0; i < num_attribs; ++i) {
- float *rd = dests[i];
- float4 ri = in[i];
- rd[0] = ri.x;
- rd[1] = ri.y;
- rd[2] = ri.z;
- rd[3] = ri.w;
- }
-}
-
-
-struct ShaderInput
-{
- float4 *dests;
- float4 *inputs;
- float4 *temps;
- float4 *consts;
- int kilmask;
-};
-
-extern void execute_shader(struct ShaderInput *input);
-
-void run_vertex_shader(void *inputs,
- void *results,
- float (*aconsts)[4],
- int num_vertices,
- int num_inputs,
- int num_attribs,
- int num_consts)
-{
- float4 consts[32];
- float4 temps[128];//MAX_PROGRAM_TEMPS
-
- struct ShaderInput args;
- args.dests = results;
- args.inputs = inputs;
-
- /*printf("XXX LLVM run_vertex_shader vertices = %d, inputs = %d, attribs = %d, consts = %d\n",
- num_vertices, num_inputs, num_attribs, num_consts);*/
- from_consts(consts, aconsts, num_consts);
- args.consts = consts;
- args.temps = temps;
-
- execute_shader(&args);
-}
-
-
-struct pipe_sampler_state;
-struct softpipe_tile_cache;
-
-#define NUM_CHANNELS 4 /* R,G,B,A */
-#define QUAD_SIZE 4 /* 4 pixel/quad */
-
-struct tgsi_sampler
-{
- const struct pipe_sampler_state *state;
- /** Get samples for four fragments in a quad */
- void (*get_samples)(struct tgsi_sampler *sampler,
- const float s[QUAD_SIZE],
- const float t[QUAD_SIZE],
- const float p[QUAD_SIZE],
- float lodbias,
- float rgba[NUM_CHANNELS][QUAD_SIZE]);
- void *pipe; /*XXX temporary*/
- struct softpipe_tile_cache *cache;
-};
-
-
-int run_fragment_shader(float x, float y,
- float4 (*results)[16],
- float4 (*inputs)[16],
- int num_inputs,
- float (*aconsts)[4],
- int num_consts,
- struct tgsi_sampler *samplers)
-{
- float4 consts[32];
- float4 temps[128];//MAX_PROGRAM_TEMPS
- struct ShaderInput args;
- int mask = 0;
- args.kilmask = 0;
-
- from_consts(consts, aconsts, num_consts);
- args.consts = consts;
- args.temps = temps;
- //printf("AAAAAAAAAAAAAAAAAAAAAAA FRAGMENT SHADER %f %f\n", x, y);
- for (int i = 0; i < 4; ++i) {
- args.inputs = inputs[i];
- args.dests = results[i];
- mask = args.kilmask;
- args.kilmask = 0;
- execute_shader(&args);
- args.kilmask = mask | (args.kilmask << i);
- }
- return ~args.kilmask;
-}
-
diff --git a/src/mesa/pipe/llvm/storagesoa.cpp b/src/mesa/pipe/llvm/storagesoa.cpp
deleted file mode 100644
index e09e9e8fe7..0000000000
--- a/src/mesa/pipe/llvm/storagesoa.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "storagesoa.h"
-
-
-#include "pipe/p_shader_tokens.h"
-#include <llvm/BasicBlock.h>
-#include <llvm/Module.h>
-#include <llvm/Value.h>
-
-#include <llvm/CallingConv.h>
-#include <llvm/Constants.h>
-#include <llvm/DerivedTypes.h>
-#include <llvm/InstrTypes.h>
-#include <llvm/Instructions.h>
-
-using namespace llvm;
-
-StorageSoa::StorageSoa(llvm::BasicBlock *block,
- llvm::Value *input,
- llvm::Value *output,
- llvm::Value *consts,
- llvm::Value *temps)
- : m_block(block),
- m_input(input),
- m_output(output),
- m_consts(consts),
- m_temps(temps),
- m_idx(0)
-{
-}
-
-void StorageSoa::addImmediate(float *vec)
-{
-}
-
-llvm::Value *StorageSoa::addrElement(int idx) const
-{
- return 0;
-}
-
-std::vector<llvm::Value*> StorageSoa::inputElement(int idx, int swizzle,
- llvm::Value *indIdx)
-{
- std::vector<llvm::Value*> res(4);
-
- res[0] = element(m_input, idx, 0);
- res[1] = element(m_input, idx, 1);
- res[2] = element(m_input, idx, 2);
- res[3] = element(m_input, idx, 3);
-
- return res;
-}
-
-std::vector<llvm::Value*> StorageSoa::constElement(int idx, int swizzle,
- llvm::Value *indIdx)
-{
- std::vector<llvm::Value*> res(4);
-
- return res;
-}
-
-std::vector<llvm::Value*> StorageSoa::outputElement(int idx, int swizzle,
- llvm::Value *indIdx)
-{
- std::vector<llvm::Value*> res(4);
-
- res[0] = element(m_output, idx, 0);
- res[1] = element(m_output, idx, 1);
- res[2] = element(m_output, idx, 2);
- res[3] = element(m_output, idx, 3);
-
- return res;
-}
-
-std::vector<llvm::Value*> StorageSoa::tempElement(int idx, int swizzle,
- llvm::Value *indIdx)
-{
- std::vector<llvm::Value*> res(4);
-
- res[0] = element(m_temps, idx, 0);
- res[1] = element(m_temps, idx, 1);
- res[2] = element(m_temps, idx, 2);
- res[3] = element(m_temps, idx, 3);
-
- return res;
-}
-
-std::vector<llvm::Value*> StorageSoa::immediateElement(int idx, int swizzle)
-{
- std::vector<llvm::Value*> res(4);
-
- return res;
-}
-
-llvm::Value * StorageSoa::extractIndex(llvm::Value *vec)
-{
- return 0;
-}
-
-void StorageSoa::storeOutput(int dstIdx, const std::vector<llvm::Value*> &val,
- int mask)
-{
- if (mask != TGSI_WRITEMASK_XYZW) {
- fprintf(stderr, "requires swizzle!!\n");
- assert(0);
- } else {
- llvm::Value *xChannel = elementPointer(m_output, dstIdx, 0);
- llvm::Value *yChannel = elementPointer(m_output, dstIdx, 1);
- llvm::Value *zChannel = elementPointer(m_output, dstIdx, 2);
- llvm::Value *wChannel = elementPointer(m_output, dstIdx, 3);
-
- StoreInst *st = new StoreInst(val[0], xChannel, false, m_block);
- st = new StoreInst(val[1], yChannel, false, m_block);
- st = new StoreInst(val[2], zChannel, false, m_block);
- st = new StoreInst(val[3], wChannel, false, m_block);
- }
-}
-
-void StorageSoa::storeTemp(int idx, const std::vector<llvm::Value*> &val,
- int mask)
-{
- if (mask != TGSI_WRITEMASK_XYZW) {
- fprintf(stderr, "requires swizzle!!\n");
- assert(0);
- } else {
- llvm::Value *xChannel = elementPointer(m_temps, idx, 0);
- llvm::Value *yChannel = elementPointer(m_temps, idx, 1);
- llvm::Value *zChannel = elementPointer(m_temps, idx, 2);
- llvm::Value *wChannel = elementPointer(m_temps, idx, 3);
-
- StoreInst *st = new StoreInst(val[0], xChannel, false, m_block);
- st = new StoreInst(val[1], yChannel, false, m_block);
- st = new StoreInst(val[2], zChannel, false, m_block);
- st = new StoreInst(val[3], wChannel, false, m_block);
- }
-}
-
-void StorageSoa::storeAddress(int idx, const std::vector<llvm::Value*> &val,
- int mask)
-{
-}
-
-llvm::Value * StorageSoa::elementPointer(llvm::Value *ptr, int index,
- int channel) const
-{
- std::vector<Value*> indices;
- indices.push_back(constantInt(index));
- indices.push_back(constantInt(channel));
-
- GetElementPtrInst *getElem = new GetElementPtrInst(ptr,
- indices.begin(),
- indices.end(),
- name("ptr"),
- m_block);
- return getElem;
-}
-
-llvm::Value * StorageSoa::element(llvm::Value *ptr, int index,
- int channel) const
-{
- llvm::Value *res = elementPointer(ptr, index, channel);
- LoadInst *load = new LoadInst(res, name("element"), false, m_block);
- //load->setAlignment(8);
- return load;
-}
-
-const char * StorageSoa::name(const char *prefix) const
-{
- ++m_idx;
- snprintf(m_name, 32, "%s%d", prefix, m_idx);
- return m_name;
-}
-
-llvm::ConstantInt * StorageSoa::constantInt(int idx) const
-{
- if (m_constInts.find(idx) != m_constInts.end()) {
- return m_constInts[idx];
- }
- ConstantInt *constInt = ConstantInt::get(APInt(32, idx));
- m_constInts[idx] = constInt;
- return constInt;
-}
diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c
deleted file mode 100644
index 39c3e1afe1..0000000000
--- a/src/mesa/pipe/softpipe/sp_state_derived.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "pipe/p_util.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_vertex.h"
-#include "pipe/draw/draw_private.h"
-#include "sp_context.h"
-#include "sp_state.h"
-
-
-static int
-find_vs_output(const struct pipe_shader_state *vs,
- uint semantic_name,
- uint semantic_index)
-{
- uint i;
- for (i = 0; i < vs->num_outputs; i++) {
- if (vs->output_semantic_name[i] == semantic_name &&
- vs->output_semantic_index[i] == semantic_index)
- return i;
- }
- return -1;
-}
-
-
-
-/**
- * Determine how to map vertex program outputs to fragment program inputs.
- * Basically, this will be used when computing the triangle interpolation
- * coefficients from the post-transform vertex attributes.
- */
-static void calculate_vertex_layout( struct softpipe_context *softpipe )
-{
- const struct pipe_shader_state *vs = &softpipe->vs->shader;
- const struct pipe_shader_state *fs = &softpipe->fs->shader;
- const enum interp_mode colorInterp
- = softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR;
- struct vertex_info *vinfo = &softpipe->vertex_info;
- uint i;
-
- if (softpipe->vbuf) {
- /* if using the post-transform vertex buffer, tell draw_vbuf to
- * simply emit the whole post-xform vertex as-is:
- */
- struct vertex_info *vinfo_vbuf = &softpipe->vertex_info_vbuf;
- vinfo_vbuf->num_attribs = 0;
- draw_emit_vertex_attr(vinfo_vbuf, EMIT_ALL, INTERP_NONE, 0);
- vinfo_vbuf->size = 4 * vs->num_outputs + sizeof(struct vertex_header)/4;
- }
-
- /*
- * Loop over fragment shader inputs, searching for the matching output
- * from the vertex shader.
- */
- vinfo->num_attribs = 0;
- for (i = 0; i < fs->num_inputs; i++) {
- int src;
- switch (fs->input_semantic_name[i]) {
- case TGSI_SEMANTIC_POSITION:
- src = find_vs_output(vs, TGSI_SEMANTIC_POSITION, 0);
- assert(src >= 0);
- draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_POS, src);
- break;
-
- case TGSI_SEMANTIC_COLOR:
- src = find_vs_output(vs, TGSI_SEMANTIC_COLOR,
- fs->input_semantic_index[i]);
- assert(src >= 0);
- draw_emit_vertex_attr(vinfo, EMIT_4F, colorInterp, src);
- break;
-
- case TGSI_SEMANTIC_FOG:
- src = find_vs_output(vs, TGSI_SEMANTIC_FOG, 0);
-#if 1
- if (src < 0) /* XXX temp hack, try demos/fogcoord.c with this */
- src = 0;
-#endif
- assert(src >= 0);
- draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
- break;
-
- case TGSI_SEMANTIC_GENERIC:
- /* this includes texcoords and varying vars */
- src = find_vs_output(vs, TGSI_SEMANTIC_GENERIC,
- fs->input_semantic_index[i]);
- assert(src >= 0);
- draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_PERSPECTIVE, src);
- break;
-
- default:
- assert(0);
- }
- }
-
- softpipe->psize_slot = find_vs_output(vs, TGSI_SEMANTIC_PSIZE, 0);
- if (softpipe->psize_slot >= 0) {
- draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_CONSTANT,
- softpipe->psize_slot);
- }
-
- draw_compute_vertex_size(vinfo);
-}
-
-
-/**
- * Recompute cliprect from scissor bounds, scissor enable and surface size.
- */
-static void
-compute_cliprect(struct softpipe_context *sp)
-{
- unsigned surfWidth, surfHeight;
-
- if (sp->framebuffer.num_cbufs > 0) {
- surfWidth = sp->framebuffer.cbufs[0]->width;
- surfHeight = sp->framebuffer.cbufs[0]->height;
- }
- else {
- /* no surface? */
- surfWidth = sp->scissor.maxx;
- surfHeight = sp->scissor.maxy;
- }
-
- if (sp->rasterizer->scissor) {
- /* clip to scissor rect */
- sp->cliprect.minx = MAX2(sp->scissor.minx, 0);
- sp->cliprect.miny = MAX2(sp->scissor.miny, 0);
- sp->cliprect.maxx = MIN2(sp->scissor.maxx, surfWidth);
- sp->cliprect.maxy = MIN2(sp->scissor.maxy, surfHeight);
- }
- else {
- /* clip to surface bounds */
- sp->cliprect.minx = 0;
- sp->cliprect.miny = 0;
- sp->cliprect.maxx = surfWidth;
- sp->cliprect.maxy = surfHeight;
- }
-}
-
-
-/* Hopefully this will remain quite simple, otherwise need to pull in
- * something like the state tracker mechanism.
- */
-void softpipe_update_derived( struct softpipe_context *softpipe )
-{
- if (softpipe->dirty & (SP_NEW_RASTERIZER |
- SP_NEW_FS |
- SP_NEW_VS))
- calculate_vertex_layout( softpipe );
-
- if (softpipe->dirty & (SP_NEW_SCISSOR |
- SP_NEW_DEPTH_STENCIL_ALPHA |
- SP_NEW_FRAMEBUFFER))
- compute_cliprect(softpipe);
-
- if (softpipe->dirty & (SP_NEW_BLEND |
- SP_NEW_DEPTH_STENCIL_ALPHA |
- SP_NEW_FRAMEBUFFER |
- SP_NEW_RASTERIZER |
- SP_NEW_FS |
- SP_NEW_QUERY))
- sp_build_quad_pipeline(softpipe);
-
- softpipe->dirty = 0;
-}
diff --git a/src/mesa/ppc/rtasm/spe_asm.c b/src/mesa/ppc/rtasm/spe_asm.c
new file mode 100644
index 0000000000..f8aff9050b
--- /dev/null
+++ b/src/mesa/ppc/rtasm/spe_asm.c
@@ -0,0 +1,351 @@
+/*
+ * (C) Copyright IBM Corporation 2008
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file spe_asm.c
+ * Real-time assembly generation interface for Cell B.E. SPEs.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+#ifdef GALLIUM_CELL
+#include <inttypes.h>
+#include <imports.h>
+#include "spe_asm.h"
+
+/**
+ * SPE instruction types
+ *
+ * There are 6 primary instruction encodings used on the Cell's SPEs. Each of
+ * the following unions encodes one type.
+ *
+ * \bug
+ * If, at some point, we start generating SPE code from a little-endian host
+ * these unions will not work.
+ */
+/*@{*/
+/**
+ * Encode one output register with two input registers
+ */
+union spe_inst_RR {
+ uint32_t bits;
+ struct {
+ unsigned op:11;
+ unsigned rB:7;
+ unsigned rA:7;
+ unsigned rT:7;
+ } inst;
+};
+
+
+/**
+ * Encode one output register with three input registers
+ */
+union spe_inst_RRR {
+ uint32_t bits;
+ struct {
+ unsigned op:4;
+ unsigned rT:7;
+ unsigned rB:7;
+ unsigned rA:7;
+ unsigned rC:7;
+ } inst;
+};
+
+
+/**
+ * Encode one output register with one input reg. and a 7-bit signed immed
+ */
+union spe_inst_RI7 {
+ uint32_t bits;
+ struct {
+ unsigned op:11;
+ unsigned i7:7;
+ unsigned rA:7;
+ unsigned rT:7;
+ } inst;
+};
+
+
+/**
+ * Encode one output register with one input reg. and a 10-bit signed immed
+ */
+union spe_inst_RI10 {
+ uint32_t bits;
+ struct {
+ unsigned op:8;
+ unsigned i10:10;
+ unsigned rA:7;
+ unsigned rT:7;
+ } inst;
+};
+
+
+/**
+ * Encode one output register with a 16-bit signed immediate
+ */
+union spe_inst_RI16 {
+ uint32_t bits;
+ struct {
+ unsigned op:9;
+ unsigned i16:16;
+ unsigned rT:7;
+ } inst;
+};
+
+
+/**
+ * Encode one output register with a 18-bit signed immediate
+ */
+union spe_inst_RI18 {
+ uint32_t bits;
+ struct {
+ unsigned op:7;
+ unsigned i18:18;
+ unsigned rT:7;
+ } inst;
+};
+/*@}*/
+
+
+static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
+ unsigned rA, unsigned rB)
+{
+ union spe_inst_RR inst;
+ inst.inst.op = op;
+ inst.inst.rB = rB;
+ inst.inst.rA = rA;
+ inst.inst.rT = rT;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
+ unsigned rA, unsigned rB, unsigned rC)
+{
+ union spe_inst_RRR inst;
+ inst.inst.op = op;
+ inst.inst.rT = rT;
+ inst.inst.rB = rB;
+ inst.inst.rA = rA;
+ inst.inst.rC = rC;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+static void emit_RI7(struct spe_function *p, unsigned op, unsigned rT,
+ unsigned rA, int imm)
+{
+ union spe_inst_RI7 inst;
+ inst.inst.op = op;
+ inst.inst.i7 = imm;
+ inst.inst.rA = rA;
+ inst.inst.rT = rT;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+
+static void emit_RI10(struct spe_function *p, unsigned op, unsigned rT,
+ unsigned rA, int imm)
+{
+ union spe_inst_RI10 inst;
+ inst.inst.op = op;
+ inst.inst.i10 = imm;
+ inst.inst.rA = rA;
+ inst.inst.rT = rT;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+static void emit_RI16(struct spe_function *p, unsigned op, unsigned rT,
+ int imm)
+{
+ union spe_inst_RI16 inst;
+ inst.inst.op = op;
+ inst.inst.i16 = imm;
+ inst.inst.rT = rT;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
+ int imm)
+{
+ union spe_inst_RI18 inst;
+ inst.inst.op = op;
+ inst.inst.i18 = imm;
+ inst.inst.rT = rT;
+ *p->csr = inst.bits;
+ p->csr++;
+}
+
+
+
+
+#define EMIT_(_name, _op) \
+void _name (struct spe_function *p, unsigned rT) \
+{ \
+ emit_RR(p, _op, rT, 0, 0); \
+}
+
+#define EMIT_R(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, unsigned rA) \
+{ \
+ emit_RR(p, _op, rT, rA, 0); \
+}
+
+#define EMIT_RR(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, unsigned rA, unsigned rB) \
+{ \
+ emit_RR(p, _op, rT, rA, rB); \
+}
+
+#define EMIT_RRR(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, unsigned rA, unsigned rB, unsigned rC) \
+{ \
+ emit_RRR(p, _op, rT, rA, rB, rC); \
+}
+
+#define EMIT_RI7(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, unsigned rA, int imm) \
+{ \
+ emit_RI7(p, _op, rT, rA, imm); \
+}
+
+#define EMIT_RI10(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, unsigned rA, int imm) \
+{ \
+ emit_RI10(p, _op, rT, rA, imm); \
+}
+
+#define EMIT_RI16(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, int imm) \
+{ \
+ emit_RI16(p, _op, rT, imm); \
+}
+
+#define EMIT_RI18(_name, _op) \
+void _name (struct spe_function *p, unsigned rT, int imm) \
+{ \
+ emit_RI18(p, _op, rT, imm); \
+}
+
+#define EMIT_I16(_name, _op) \
+void _name (struct spe_function *p, int imm) \
+{ \
+ emit_RI16(p, _op, 0, imm); \
+}
+
+#include "spe_asm.h"
+
+
+/*
+ */
+void spe_init_func(struct spe_function *p, unsigned code_size)
+{
+ p->store = _mesa_align_malloc(code_size, 16);
+ p->csr = p->store;
+}
+
+
+void spe_release_func(struct spe_function *p)
+{
+ _mesa_align_free(p->store);
+ p->store = NULL;
+ p->csr = NULL;
+}
+
+
+void spe_bi(struct spe_function *p, unsigned rA, int d, int e)
+{
+ emit_RI7(p, 0x1a8, 0, rA, (d << 5) | (e << 4));
+}
+
+void spe_iret(struct spe_function *p, unsigned rA, int d, int e)
+{
+ emit_RI7(p, 0x1aa, 0, rA, (d << 5) | (e << 4));
+}
+
+void spe_bisled(struct spe_function *p, unsigned rT, unsigned rA, int d,
+ int e)
+{
+ emit_RI7(p, 0x1ab, rT, rA, (d << 5) | (e << 4));
+}
+
+void spe_bisl(struct spe_function *p, unsigned rT, unsigned rA, int d,
+ int e)
+{
+ emit_RI7(p, 0x1a9, rT, rA, (d << 5) | (e << 4));
+}
+
+void spe_biz(struct spe_function *p, unsigned rT, unsigned rA, int d,
+ int e)
+{
+ emit_RI7(p, 0x128, rT, rA, (d << 5) | (e << 4));
+}
+
+void spe_binz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
+{
+ emit_RI7(p, 0x129, rT, rA, (d << 5) | (e << 4));
+}
+
+void spe_bihz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
+{
+ emit_RI7(p, 0x12a, rT, rA, (d << 5) | (e << 4));
+}
+
+void spe_bihnz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
+{
+ emit_RI7(p, 0x12b, rT, rA, (d << 5) | (e << 4));
+}
+
+
+/* Hint-for-branch instructions
+ */
+#if 0
+hbr;
+hbra;
+hbrr;
+#endif
+
+
+/* Control instructions
+ */
+#if 0
+stop;
+EMIT_RR (spe_stopd, 0x140);
+EMIT_ (spe_lnop, 0x001);
+EMIT_ (spe_nop, 0x201);
+sync;
+EMIT_ (spe_dsync, 0x003);
+EMIT_R (spe_mfspr, 0x00c);
+EMIT_R (spe_mtspr, 0x10c);
+#endif
+
+#endif /* GALLIUM_CELL */
diff --git a/src/mesa/ppc/rtasm/spe_asm.h b/src/mesa/ppc/rtasm/spe_asm.h
new file mode 100644
index 0000000000..9532669b8c
--- /dev/null
+++ b/src/mesa/ppc/rtasm/spe_asm.h
@@ -0,0 +1,310 @@
+/*
+ * (C) Copyright IBM Corporation 2008
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file spe_asm.h
+ * Real-time assembly generation interface for Cell B.E. SPEs.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#ifndef SPE_ASM_H
+#define SPE_ASM_H
+
+struct spe_function {
+ /**
+ *
+ */
+ uint32_t *store;
+ uint32_t *csr;
+ const char *fn;
+};
+
+extern void spe_init_func(struct spe_function *p, unsigned code_size);
+extern void spe_release_func(struct spe_function *p);
+
+#endif /* SPE_ASM_H */
+
+#ifndef EMIT_
+#define EMIT_(name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT)
+#define EMIT_R(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, unsigned rA)
+#define EMIT_RR(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, unsigned rA, \
+ unsigned rB)
+#define EMIT_RRR(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, unsigned rA, \
+ unsigned rB, unsigned rC)
+#define EMIT_RI7(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, unsigned rA, \
+ int imm)
+#define EMIT_RI10(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, unsigned rA, \
+ int imm)
+#define EMIT_RI16(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, int imm)
+#define EMIT_RI18(_name, _op) \
+ extern void _name (struct spe_function *p, unsigned rT, int imm)
+#define EMIT_I16(_name, _op) \
+ extern void _name (struct spe_function *p, int imm)
+#define UNDEF_EMIT_MACROS
+#endif /* EMIT_ */
+
+
+/* Memory load / store instructions
+ */
+EMIT_RI10(spe_lqd, 0x034);
+EMIT_RR (spe_lqx, 0x1c4);
+EMIT_RI16(spe_lqa, 0x061);
+EMIT_RI16(spe_lqr, 0x067);
+EMIT_RI10(spe_stqd, 0x024);
+EMIT_RR (spe_stqx, 0x144);
+EMIT_RI16(spe_stqa, 0x041);
+EMIT_RI16(spe_stqr, 0x047);
+EMIT_RI7 (spe_cbd, 0x1f4);
+EMIT_RR (spe_cbx, 0x1d4);
+EMIT_RI7 (spe_chd, 0x1f5);
+EMIT_RI7 (spe_chx, 0x1d5);
+EMIT_RI7 (spe_cwd, 0x1f6);
+EMIT_RI7 (spe_cwx, 0x1d6);
+EMIT_RI7 (spe_cdd, 0x1f7);
+EMIT_RI7 (spe_cdx, 0x1d7);
+
+
+/* Constant formation instructions
+ */
+EMIT_RI16(spe_ilh, 0x083);
+EMIT_RI16(spe_ilhu, 0x082);
+EMIT_RI16(spe_il, 0x081);
+EMIT_RI18(spe_ila, 0x021);
+EMIT_RI16(spe_iohl, 0x0c1);
+EMIT_RI16(spe_fsmbi, 0x0c5);
+
+
+/* Integer and logical instructions
+ */
+EMIT_RR (spe_ah, 0x0c8);
+EMIT_RI10(spe_ahi, 0x01d);
+EMIT_RR (spe_a, 0x0c0);
+EMIT_RI10(spe_ai, 0x01c);
+EMIT_RR (spe_sfh, 0x048);
+EMIT_RI10(spe_sfhi, 0x00d);
+EMIT_RR (spe_sf, 0x040);
+EMIT_RI10(spe_sfi, 0x00c);
+EMIT_RR (spe_addx, 0x340);
+EMIT_RR (spe_cg, 0x0c2);
+EMIT_RR (spe_cgx, 0x342);
+EMIT_RR (spe_sfx, 0x341);
+EMIT_RR (spe_bg, 0x042);
+EMIT_RR (spe_bgx, 0x343);
+EMIT_RR (spe_mpy, 0x3c4);
+EMIT_RR (spe_mpyu, 0x3cc);
+EMIT_RI10(spe_mpyi, 0x074);
+EMIT_RI10(spe_mpyui, 0x075);
+EMIT_RRR (spe_mpya, 0x00c);
+EMIT_RR (spe_mpyh, 0x3c5);
+EMIT_RR (spe_mpys, 0x3c7);
+EMIT_RR (spe_mpyhh, 0x3c6);
+EMIT_RR (spe_mpyhha, 0x346);
+EMIT_RR (spe_mpyhhu, 0x3ce);
+EMIT_RR (spe_mpyhhau, 0x34e);
+EMIT_R (spe_clz, 0x2a5);
+EMIT_R (spe_cntb, 0x2b4);
+EMIT_R (spe_fsmb, 0x1b6);
+EMIT_R (spe_fsmh, 0x1b5);
+EMIT_R (spe_fsm, 0x1b4);
+EMIT_R (spe_gbb, 0x1b2);
+EMIT_R (spe_gbh, 0x1b1);
+EMIT_R (spe_gb, 0x1b0);
+EMIT_RR (spe_avgb, 0x0d3);
+EMIT_RR (spe_absdb, 0x053);
+EMIT_RR (spe_sumb, 0x253);
+EMIT_R (spe_xsbh, 0x2b6);
+EMIT_R (spe_xshw, 0x2ae);
+EMIT_R (spe_xswd, 0x2a6);
+EMIT_RR (spe_and, 0x0c1);
+EMIT_RR (spe_andc, 0x2c1);
+EMIT_RI10(spe_andbi, 0x016);
+EMIT_RI10(spe_andhi, 0x015);
+EMIT_RI10(spe_andi, 0x014);
+EMIT_RR (spe_or, 0x041);
+EMIT_RR (spe_orc, 0x2c9);
+EMIT_RI10(spe_orbi, 0x006);
+EMIT_RI10(spe_orhi, 0x005);
+EMIT_RI10(spe_ori, 0x004);
+EMIT_R (spe_orx, 0x1f0);
+EMIT_RR (spe_xor, 0x241);
+EMIT_RI10(spe_xorbi, 0x026);
+EMIT_RI10(spe_xorhi, 0x025);
+EMIT_RI10(spe_xori, 0x024);
+EMIT_RR (spe_nand, 0x0c9);
+EMIT_RR (spe_nor, 0x049);
+EMIT_RR (spe_eqv, 0x249);
+EMIT_RRR (spe_selb, 0x008);
+EMIT_RRR (spe_shufb, 0x00b);
+
+
+/* Shift and rotate instructions
+ */
+EMIT_RR (spe_shlh, 0x05f);
+EMIT_RI7 (spe_shlhi, 0x07f);
+EMIT_RR (spe_shl, 0x05b);
+EMIT_RI7 (spe_shli, 0x07b);
+EMIT_RR (spe_shlqbi, 0x1db);
+EMIT_RI7 (spe_shlqbii, 0x1fb);
+EMIT_RR (spe_shlqby, 0x1df);
+EMIT_RI7 (spe_shlqbyi, 0x1ff);
+EMIT_RR (spe_shlqbybi, 0x1cf);
+EMIT_RR (spe_roth, 0x05c);
+EMIT_RI7 (spe_rothi, 0x07c);
+EMIT_RR (spe_rot, 0x058);
+EMIT_RI7 (spe_roti, 0x078);
+EMIT_RR (spe_rotqby, 0x1dc);
+EMIT_RI7 (spe_rotqbyi, 0x1fc);
+EMIT_RR (spe_rotqbybi, 0x1cc);
+EMIT_RR (spe_rotqbi, 0x1d8);
+EMIT_RI7 (spe_rotqbii, 0x1f8);
+EMIT_RR (spe_rothm, 0x05d);
+EMIT_RI7 (spe_rothmi, 0x07d);
+EMIT_RR (spe_rotm, 0x059);
+EMIT_RI7 (spe_rotmi, 0x079);
+EMIT_RR (spe_rotqmby, 0x1dd);
+EMIT_RI7 (spe_rotqmbyi, 0x1fd);
+EMIT_RR (spe_rotqmbybi, 0x1cd);
+EMIT_RR (spe_rotqmbi, 0x1c9);
+EMIT_RI7 (spe_rotqmbii, 0x1f9);
+EMIT_RR (spe_rotmah, 0x05e);
+EMIT_RI7 (spe_rotmahi, 0x07e);
+EMIT_RR (spe_rotma, 0x05a);
+EMIT_RI7 (spe_rotmai, 0x07a);
+
+
+/* Compare, branch, and halt instructions
+ */
+EMIT_RR (spe_heq, 0x3d8);
+EMIT_RI10(spe_heqi, 0x07f);
+EMIT_RR (spe_hgt, 0x258);
+EMIT_RI10(spe_hgti, 0x04f);
+EMIT_RR (spe_hlgt, 0x2d8);
+EMIT_RI10(spe_hlgti, 0x05f);
+EMIT_RR (spe_ceqb, 0x3d0);
+EMIT_RI10(spe_ceqbi, 0x07e);
+EMIT_RR (spe_ceqh, 0x3c8);
+EMIT_RI10(spe_ceqhi, 0x07d);
+EMIT_RR (spe_ceq, 0x3c0);
+EMIT_RI10(spe_ceqi, 0x07c);
+EMIT_RR (spe_cgtb, 0x250);
+EMIT_RI10(spe_cgtbi, 0x04e);
+EMIT_RR (spe_cgth, 0x248);
+EMIT_RI10(spe_cgthi, 0x04d);
+EMIT_RR (spe_cgt, 0x240);
+EMIT_RI10(spe_cgti, 0x04c);
+EMIT_RR (spe_clgtb, 0x2d0);
+EMIT_RI10(spe_clgtbi, 0x05e);
+EMIT_RR (spe_clgth, 0x2c8);
+EMIT_RI10(spe_clgthi, 0x05d);
+EMIT_RR (spe_clgt, 0x2c0);
+EMIT_RI10(spe_clgti, 0x05c);
+EMIT_I16 (spe_br, 0x064);
+EMIT_I16 (spe_bra, 0x060);
+EMIT_RI16(spe_brsl, 0x066);
+EMIT_RI16(spe_brasl, 0x062);
+EMIT_RI16(spe_brnz, 0x042);
+EMIT_RI16(spe_brz, 0x040);
+EMIT_RI16(spe_brhnz, 0x046);
+EMIT_RI16(spe_brhz, 0x044);
+
+extern void spe_bi(struct spe_function *p, unsigned rA, int d, int e);
+extern void spe_iret(struct spe_function *p, unsigned rA, int d, int e);
+extern void spe_bisled(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+extern void spe_bisl(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+extern void spe_biz(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+extern void spe_binz(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+extern void spe_bihz(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+extern void spe_bihnz(struct spe_function *p, unsigned rT, unsigned rA,
+ int d, int e);
+
+
+/* Floating-point instructions
+ */
+EMIT_RR (spe_fa, 0x2c4);
+EMIT_RR (spe_dfa, 0x2cc);
+EMIT_RR (spe_fs, 0x2c5);
+EMIT_RR (spe_dfs, 0x2cd);
+EMIT_RR (spe_fm, 0x2c6);
+EMIT_RR (spe_dfm, 0x2ce);
+EMIT_RRR (spe_fma, 0x00e);
+EMIT_RR (spe_dfma, 0x35c);
+EMIT_RRR (spe_fnms, 0x00d);
+EMIT_RR (spe_dfnms, 0x35e);
+EMIT_RRR (spe_fms, 0x00f);
+EMIT_RR (spe_dfms, 0x35d);
+EMIT_RR (spe_dfnma, 0x35f);
+EMIT_R (spe_frest, 0x1b8);
+EMIT_R (spe_frsqest, 0x1b9);
+EMIT_RR (spe_fi, 0x3d4);
+EMIT_RI7 (spe_csflt, 0x3da);
+EMIT_RI7 (spe_cflts, 0x3d8);
+EMIT_RI7 (spe_cuflt, 0x3db);
+EMIT_RI7 (spe_cfltu, 0x3d9);
+EMIT_R (spe_frds, 0x3b9);
+EMIT_R (spe_fesd, 0x3b8);
+EMIT_RR (spe_dfceq, 0x3c3);
+EMIT_RR (spe_dfcmeq, 0x3cb);
+EMIT_RR (spe_dfcgt, 0x2c3);
+EMIT_RR (spe_dfcmgt, 0x2cb);
+EMIT_RI7 (spe_dftsv, 0x3bf);
+EMIT_RR (spe_fceq, 0x3c2);
+EMIT_RR (spe_fcmeq, 0x3ca);
+EMIT_RR (spe_fcgt, 0x2c2);
+EMIT_RR (spe_fcmgt, 0x2ca);
+EMIT_R (spe_fscrwr, 0x3ba);
+EMIT_ (spe_fscrrd, 0x398);
+
+
+/* Channel instructions
+ */
+EMIT_R (spe_rdch, 0x00d);
+EMIT_R (spe_rdchcnt, 0x00f);
+EMIT_R (spe_wrch, 0x10d);
+
+
+#ifdef UNDEF_EMIT_MACROS
+#undef EMIT_
+#undef EMIT_R
+#undef EMIT_RR
+#undef EMIT_RRR
+#undef EMIT_RI7
+#undef EMIT_RI10
+#undef EMIT_RI16
+#undef EMIT_RI18
+#undef EMIT_I16
+#undef UNDEF_EMIT_MACROS
+#endif /* EMIT_ */
diff --git a/src/mesa/sources b/src/mesa/sources
index 96ae3dbca0..2d07738210 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -158,45 +158,45 @@ VF_SOURCES = \
DRAW_SOURCES = \
- pipe/draw/draw_clip.c \
- pipe/draw/draw_context.c\
- pipe/draw/draw_cull.c \
- pipe/draw/draw_debug.c \
- pipe/draw/draw_flatshade.c \
- pipe/draw/draw_offset.c \
- pipe/draw/draw_prim.c \
- pipe/draw/draw_stipple.c \
- pipe/draw/draw_twoside.c \
- pipe/draw/draw_unfilled.c \
- pipe/draw/draw_validate.c \
- pipe/draw/draw_vbuf.c \
- pipe/draw/draw_vertex.c \
- pipe/draw/draw_vertex_cache.c \
- pipe/draw/draw_vertex_fetch.c \
- pipe/draw/draw_vertex_shader.c \
- pipe/draw/draw_vf.c \
- pipe/draw/draw_vf_generic.c \
- pipe/draw/draw_vf_sse.c \
- pipe/draw/draw_wide_prims.c
+ $(TOP)/src/gallium/aux/draw/draw_clip.c \
+ $(TOP)/src/gallium/aux/draw/draw_context.c\
+ $(TOP)/src/gallium/aux/draw/draw_cull.c \
+ $(TOP)/src/gallium/aux/draw/draw_debug.c \
+ $(TOP)/src/gallium/aux/draw/draw_flatshade.c \
+ $(TOP)/src/gallium/aux/draw/draw_offset.c \
+ $(TOP)/src/gallium/aux/draw/draw_prim.c \
+ $(TOP)/src/gallium/aux/draw/draw_stipple.c \
+ $(TOP)/src/gallium/aux/draw/draw_twoside.c \
+ $(TOP)/src/gallium/aux/draw/draw_unfilled.c \
+ $(TOP)/src/gallium/aux/draw/draw_validate.c \
+ $(TOP)/src/gallium/aux/draw/draw_vbuf.c \
+ $(TOP)/src/gallium/aux/draw/draw_vertex.c \
+ $(TOP)/src/gallium/aux/draw/draw_vertex_cache.c \
+ $(TOP)/src/gallium/aux/draw/draw_vertex_fetch.c \
+ $(TOP)/src/gallium/aux/draw/draw_vertex_shader.c \
+ $(TOP)/src/gallium/aux/draw/draw_vf.c \
+ $(TOP)/src/gallium/aux/draw/draw_vf_generic.c \
+ $(TOP)/src/gallium/aux/draw/draw_vf_sse.c \
+ $(TOP)/src/gallium/aux/draw/draw_wide_prims.c
TGSIEXEC_SOURCES = \
- pipe/tgsi/exec/tgsi_exec.c \
- pipe/tgsi/exec/tgsi_sse2.c
+ $(TOP)/src/gallium/aux/tgsi/exec/tgsi_exec.c \
+ $(TOP)/src/gallium/aux/tgsi/exec/tgsi_sse2.c
TGSIUTIL_SOURCES = \
- pipe/tgsi/util/tgsi_build.c \
- pipe/tgsi/util/tgsi_dump.c \
- pipe/tgsi/util/tgsi_parse.c \
- pipe/tgsi/util/tgsi_util.c
+ $(TOP)/src/gallium/aux/tgsi/util/tgsi_build.c \
+ $(TOP)/src/gallium/aux/tgsi/util/tgsi_dump.c \
+ $(TOP)/src/gallium/aux/tgsi/util/tgsi_parse.c \
+ $(TOP)/src/gallium/aux/tgsi/util/tgsi_util.c
STATECACHE_SOURCES = \
- pipe/cso_cache/cso_hash.c \
- pipe/cso_cache/cso_cache.c
+ $(TOP)/src/gallium/aux/cso_cache/cso_hash.c \
+ $(TOP)/src/gallium/aux/cso_cache/cso_cache.c
PIPEUTIL_SOURCES = \
- pipe/util/p_debug.c \
- pipe/util/p_tile.c \
- pipe/util/p_util.c
+ $(TOP)/src/gallium/aux/util/p_debug.c \
+ $(TOP)/src/gallium/aux/util/p_tile.c \
+ $(TOP)/src/gallium/aux/util/p_util.c
STATETRACKER_SOURCES = \
state_tracker/st_atom.c \
@@ -288,6 +288,7 @@ ASM_C_SOURCES = \
x86/rtasm/x86sse.c \
sparc/sparc.c \
ppc/common_ppc.c \
+ ppc/rtasm/spe_asm.c \
x86-64/x86-64.c
X86_SOURCES = \
@@ -330,13 +331,13 @@ __COMMON_DRIVER_SOURCES = \
drivers/common/driverfuncs.c
X11_DRIVER_SOURCES = \
- pipe/xlib/glxapi.c \
- pipe/xlib/fakeglx.c \
- pipe/xlib/xfonts.c \
- pipe/xlib/xm_api.c \
- pipe/xlib/xm_winsys.c \
- pipe/xlib/xm_winsys_aub.c \
- pipe/xlib/brw_aub.c
+ $(TOP)/src/gallium/winsys/xlib/glxapi.c \
+ $(TOP)/src/gallium/winsys/xlib/fakeglx.c \
+ $(TOP)/src/gallium/winsys/xlib/xfonts.c \
+ $(TOP)/src/gallium/winsys/xlib/xm_api.c \
+ $(TOP)/src/gallium/winsys/xlib/xm_winsys.c \
+ $(TOP)/src/gallium/winsys/xlib/xm_winsys_aub.c \
+ $(TOP)/src/gallium/winsys/xlib/brw_aub.c
OSMESA_DRIVER_SOURCES = \
drivers/osmesa/osmesa.c
@@ -424,7 +425,10 @@ FBDEV_DRIVER_OBJECTS = $(FBDEV_DRIVER_SOURCES:.c=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main
+ -I$(TOP)/src/mesa/main \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/drivers \
+ -I$(TOP)/src/gallium/aux
OLD_INCLUDE_DIRS = \
-I$(TOP)/src/mesa/tnl \
@@ -434,4 +438,4 @@ OLD_INCLUDE_DIRS = \
-I$(TOP)/src/mesa/shader \
-I$(TOP)/src/mesa/shader/grammar \
-I$(TOP)/src/mesa/shader/slang \
- -I$(TOP)/src/mesa/pipe/tgsi
+ -I$(TOP)/s$(TOP)/src/gallium/aux/tgsi
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index 2c6ec8421b..b67b620eaa 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -43,7 +43,7 @@
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/cso_cache/cso_cache.h"
+#include "cso_cache/cso_cache.h"
#include "st_context.h"
#include "st_cache.h"
diff --git a/src/mesa/state_tracker/st_cache.c b/src/mesa/state_tracker/st_cache.c
index e0965b217a..2979e7fae5 100644
--- a/src/mesa/state_tracker/st_cache.c
+++ b/src/mesa/state_tracker/st_cache.c
@@ -36,8 +36,8 @@
#include "pipe/p_state.h"
-#include "pipe/cso_cache/cso_cache.h"
-#include "pipe/cso_cache/cso_hash.h"
+#include "cso_cache/cso_cache.h"
+#include "cso_cache/cso_hash.h"
/* Those function will either find the state of the given template
diff --git a/src/mesa/state_tracker/st_cache.h b/src/mesa/state_tracker/st_cache.h
index e0c176b0ff..b81de316ec 100644
--- a/src/mesa/state_tracker/st_cache.h
+++ b/src/mesa/state_tracker/st_cache.h
@@ -33,7 +33,7 @@
#ifndef ST_CACHE_H
#define ST_CACHE_H
-#include "pipe/cso_cache/cso_cache.h"
+#include "cso_cache/cso_cache.h"
struct pipe_blend_state;
struct pipe_sampler_state;
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index 3a3bf9016d..663c4f205d 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -43,7 +43,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#define UNCLAMPED_FLOAT_TO_SHORT(us, f) \
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 410062e1e8..78baf772f4 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -272,6 +272,14 @@ clear_with_quad(GLcontext *ctx,
const GLfloat x1 = ctx->DrawBuffer->_Xmax;
const GLfloat y1 = ctx->DrawBuffer->_Ymax;
+ /*
+ printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__,
+ color ? "color, " : "",
+ depth ? "depth, " : "",
+ stencil ? "stencil" : "",
+ x0, y0,
+ x1, y1);
+ */
/* blend state: RGBA masking */
{
@@ -389,13 +397,44 @@ clear_with_quad(GLcontext *ctx,
* Determine if we need to clear the depth buffer by drawing a quad.
*/
static INLINE GLboolean
-check_clear_color_with_quad(GLcontext *ctx)
+check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
+{
+ const struct st_renderbuffer *strb = st_renderbuffer(rb);
+
+ if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
+ return FALSE;
+
+ if (ctx->Scissor.Enabled)
+ return TRUE;
+
+ if (!ctx->Color.ColorMask[0] ||
+ !ctx->Color.ColorMask[1] ||
+ !ctx->Color.ColorMask[2] ||
+ !ctx->Color.ColorMask[3])
+ return TRUE;
+
+ return FALSE;
+}
+
+
+static INLINE GLboolean
+check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
{
- return !(ctx->Color.ColorMask[0] &&
- ctx->Color.ColorMask[1] &&
- ctx->Color.ColorMask[2] &&
- ctx->Color.ColorMask[3] &&
- !ctx->Scissor.Enabled);
+ const struct st_renderbuffer *strb = st_renderbuffer(rb);
+ const GLuint stencilMax = (1 << rb->StencilBits) - 1;
+ GLboolean maskStencil
+ = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
+
+ if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
+ return FALSE;
+
+ if (ctx->Scissor.Enabled)
+ return TRUE;
+
+ if (maskStencil)
+ return TRUE;
+
+ return FALSE;
}
@@ -407,10 +446,19 @@ check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
{
const struct st_renderbuffer *strb = st_renderbuffer(rb);
const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
- return ctx->Scissor.Enabled
- || (isDS &&
- strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
- ctx->DrawBuffer->Visual.stencilBits > 0);
+
+ if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
+ return FALSE;
+
+ if (ctx->Scissor.Enabled)
+ return TRUE;
+
+ if (isDS &&
+ strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
+ ctx->DrawBuffer->Visual.stencilBits > 0)
+ return TRUE;
+
+ return FALSE;
}
@@ -425,9 +473,27 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
const GLuint stencilMax = (1 << rb->StencilBits) - 1;
const GLboolean maskStencil
= (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
- return maskStencil
- || ctx->Scissor.Enabled
- || (isDS && ctx->DrawBuffer->Visual.depthBits > 0);
+
+ if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
+ return FALSE;
+
+ if (maskStencil)
+ return TRUE;
+
+ if (ctx->Scissor.Enabled)
+ return TRUE;
+
+ /* This is correct, but it is necessary to look at the depth clear
+ * value held in the surface when it comes time to issue the clear,
+ * rather than taking depth and stencil clear values from the
+ * current state.
+ */
+ if (isDS &&
+ strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
+ ctx->DrawBuffer->Visual.depthBits > 0)
+ return TRUE;
+
+ return FALSE;
}
@@ -436,14 +502,10 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
static void
clear_color_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
{
- struct st_renderbuffer *strb = st_renderbuffer(rb);
-
- if (ctx->Color.ColorMask[0] &&
- ctx->Color.ColorMask[1] &&
- ctx->Color.ColorMask[2] &&
- ctx->Color.ColorMask[3] &&
- !ctx->Scissor.Enabled)
+ if (!check_clear_color_with_quad( ctx, rb ))
{
+ struct st_renderbuffer *strb = st_renderbuffer(rb);
+
/* clear whole buffer w/out masking */
GLuint clearValue
= color_value(strb->surface->format, ctx->Color.ClearColor);
@@ -482,14 +544,8 @@ static void
clear_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
{
struct st_renderbuffer *strb = st_renderbuffer(rb);
- const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
- const GLuint stencilMax = (1 << rb->StencilBits) - 1;
- GLboolean maskStencil
- = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
- if (maskStencil ||
- ctx->Scissor.Enabled ||
- (isDS && ctx->DrawBuffer->Visual.depthBits > 0)) {
+ if (check_clear_stencil_with_quad(ctx, rb)) {
/* masking or scissoring or combined depth/stencil buffer */
clear_with_quad(ctx, GL_FALSE, GL_FALSE, GL_TRUE);
}
@@ -505,13 +561,10 @@ static void
clear_depth_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
{
struct st_renderbuffer *strb = st_renderbuffer(rb);
- const GLuint stencilMax = (1 << rb->StencilBits) - 1;
- GLboolean maskStencil
- = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
assert(is_depth_stencil_format(strb->surface->format));
- if (!maskStencil && !ctx->Scissor.Enabled) {
+ if (check_clear_depth_stencil_with_quad(ctx, rb)) {
/* clear whole buffer w/out masking */
GLuint clearValue = depth_value(strb->surface->format, ctx->Depth.Clear);
@@ -520,7 +573,7 @@ clear_depth_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
clearValue |= ctx->Stencil.Clear << 24;
break;
case PIPE_FORMAT_Z24S8_UNORM:
- clearValue |= clearValue | ctx->Stencil.Clear;
+ clearValue |= ctx->Stencil.Clear;
break;
default:
assert(0);
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index f13199a3c0..e2d4e06da1 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -56,7 +56,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#include "shader/prog_instruction.h"
diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c
index 31744151f1..5315294c07 100644
--- a/src/mesa/state_tracker/st_cb_feedback.c
+++ b/src/mesa/state_tracker/st_cb_feedback.c
@@ -53,10 +53,10 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
-#include "pipe/cso_cache/cso_cache.h"
+#include "cso_cache/cso_cache.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_private.h"
+#include "draw/draw_context.h"
+#include "draw/draw_private.h"
/**
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index af3ee65504..61d4f4c41c 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -39,8 +39,8 @@
#include "shader/programopt.h"
#include "shader/shader_api.h"
-#include "pipe/cso_cache/cso_cache.h"
-#include "pipe/draw/draw_context.h"
+#include "cso_cache/cso_cache.h"
+#include "draw/draw_context.h"
#include "st_context.h"
#include "st_program.h"
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 7e347c4893..5b0eb6022b 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -44,8 +44,8 @@
#include "st_draw.h"
#include "st_cb_rasterpos.h"
#include "st_draw.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/draw/draw_private.h"
+#include "draw/draw_context.h"
+#include "draw/draw_private.h"
#include "shader/prog_instruction.h"
#include "vbo/vbo.h"
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 868c5f3c5f..c89c74229e 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -40,7 +40,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#include "st_context.h"
#include "st_cb_readpixels.h"
#include "st_cb_fbo.h"
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 91a40288cc..03dbb30b0f 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -47,7 +47,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
-#include "pipe/util/p_tile.h"
+#include "util/p_tile.h"
#define DBG if (0) printf
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index bf4618bed8..09e389f9dc 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -54,8 +54,8 @@
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/p_inlines.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/cso_cache/cso_cache.h"
+#include "draw/draw_context.h"
+#include "cso_cache/cso_cache.h"
/**
diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c
index 57450e52bf..5888bcb98a 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -31,9 +31,9 @@
#include "pipe/p_state.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "tgsi/util/tgsi_dump.h"
-#include "pipe/cso_cache/cso_cache.h"
+#include "cso_cache/cso_cache.h"
#include "st_context.h"
#include "st_debug.h"
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index ae9f5c8b11..1c0fa8c6aa 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -47,8 +47,8 @@
#include "pipe/p_winsys.h"
#include "pipe/p_inlines.h"
-#include "pipe/draw/draw_private.h"
-#include "pipe/draw/draw_context.h"
+#include "draw/draw_private.h"
+#include "draw/draw_context.h"
static GLuint double_types[4] = {
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 459941cca8..6c09b86033 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -37,7 +37,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
-#include "pipe/cso_cache/cso_cache.h"
+#include "cso_cache/cso_cache.h"
#include "st_context.h"
#include "st_draw.h"
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 325aa20173..97206752af 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -32,9 +32,9 @@
#include "pipe/p_compiler.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/tgsi/util/tgsi_parse.h"
-#include "pipe/tgsi/util/tgsi_build.h"
-#include "pipe/tgsi/util/tgsi_util.h"
+#include "tgsi/util/tgsi_parse.h"
+#include "tgsi/util/tgsi_build.h"
+#include "tgsi/util/tgsi_util.h"
#include "st_mesa_to_tgsi.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index c8297baded..dc992ee9c2 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -38,8 +38,8 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
-#include "pipe/draw/draw_context.h"
-#include "pipe/tgsi/util/tgsi_dump.h"
+#include "draw/draw_context.h"
+#include "tgsi/util/tgsi_dump.h"
#include "st_context.h"
#include "st_cache.h"