1 LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
9 - the whole fragment pipeline is code generated in a single function
15 - texture sampling (not all state/formats are supported)
17 - fragment shader TGSI translation
18 - same level of support as the TGSI SSE2 exec machine, with the exception
19 we don't fallback to TGSI interpretation when an unsupported opcode is
20 found, but just ignore it
22 - input interpolation also code generated
26 - blend (including logic ops)
27 - both in SoA and AoS layouts, but only the former used for now
30 - intermediates can be vectors of floats, ubytes, fixed point, etc, and of
32 - not all operations are implemented for these types yet though
34 Most mesa/progs/demos/* work.
36 To do (probably by this order):
38 - code generate stipple and stencil testing
40 - translate the remaining bits of texture sampling state
42 - translate TGSI control flow instructions, and all other remaining opcodes
44 - integrate with the draw module for VS code generation
46 - code generate the triangle setup and rasterization
54 - A x86 or amd64 processor. 64bit mode is preferred.
56 Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
57 yield the most efficient code. The less features the CPU has the more
58 likely is that you ran into underperforming, buggy, or incomplete code.
60 See /proc/cpuinfo to know what your CPU supports.
62 - LLVM 2.5 or greater. LLVM 2.6 is preferred.
64 On Debian based distributions do:
66 aptitude install llvm-dev
68 There is a typo in one of the llvm 2.5 headers, that may cause compilation
69 errors. To fix it apply the change:
71 --- /usr/include/llvm-c/Core.h.orig 2009-08-10 15:38:54.000000000 +0100
72 +++ /usr/include/llvm-c/Core.h 2009-08-10 15:38:25.000000000 +0100
75 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
77 - for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
78 + for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
81 return reinterpret_cast<T**>(Vals);
85 - udis86, http://udis86.sourceforge.net/ (optional):
87 git clone git://udis86.git.sourceforge.net/gitroot/udis86/udis86
90 ./configure --with-pic
98 To build everything invoke scons as:
100 scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false -k
102 Alternatively, you can build it with GNU make, if you prefer, by invoking it as
106 but the rest of these instructions assume that scons is used.
112 Building will create a drop-in alternative for libGL.so. To use it set the
113 environment variables:
115 export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH
119 export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH
121 For performance evaluation pass debug=no to scons, and use the corresponding
122 lib directory without the "-debug" suffix.
128 Building will also create several unit tests in
129 build/linux-???-debug/gallium/drivers/llvmpipe:
131 - lp_test_blend: blending
132 - lp_test_conv: SIMD vector conversion
133 - lp_test_format: pixel unpacking/packing
135 Some of this tests can output results and benchmarks to a tab-separated-file
136 for posterior analysis, e.g.:
138 build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
144 - When looking to this code by the first time start in lp_state_fs.c, and
145 then skim through the lp_bld_* functions called in there, and the comments
146 at the top of the lp_bld_*.c functions.
148 - All lp_bld_*.[ch] are isolated from the rest of the driver, and could/may be
149 put in a stand-alone Gallium state -> LLVM IR translation module.
151 - We use LLVM-C bindings for now. They are not documented, but follow the C++
152 interfaces very closely, and appear to be complete enough for code
154 http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
155 for a stand-alone example.