llvmpipe: Document that llvm 2.5 is expected.
[mesa.git] / src / gallium / drivers / llvmpipe / README
1 LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
2
3
4 Status
5 ======
6
7 Done so far is:
8
9 - TGSI -> LLVM fragment shader translation
10 - same level of support as the TGSI SSE2 exec machine
11 - texture sampling via an intrinsic call
12 - done in SoA
13 - input interpolation also code generated
14
15 - blend -> LLVM (including logic ops)
16 - SoA and AoS, but only the former used
17
18 - code is generic
19 - intermediates can be vectors of floats, ubytes, fixed point, etc, and of
20 any width and length
21 - not all operations are implemented for these types yet though
22
23 Most mesa/progs/demos/* work. Speed is on par with Keith's softpipe-opt branch,
24 which includes hand written fast implementations for common cases.
25
26 To do (probably by this order):
27 - code generate the rest of the fragment pipeline, namely the
28 depth/alpha/stencil state
29 - concatenate the fragment pipeline (shader + depth/stencil/alpha + blend) in a
30 single function
31 - code generate texture sampling
32 - translate TGSI control flow instructions
33 - code generate the triangle setup and rasterization
34
35
36 Requirements
37 ============
38
39 - Linux
40
41 - udis86, http://udis86.sourceforge.net/
42
43 git clone git://udis86.git.sourceforge.net/gitroot/udis86
44 cd udis86
45 ./configure --with-pic
46 make
47 sudo make install
48
49 - LLVM 2.5. On Debian based distributions do:
50
51 aptitude install llvm-dev
52
53 There is a typo in one of the llvm-dev 2.5 headers, that causes compilation
54 errors in the debug build:
55
56 --- /usr/include/llvm-c/Core.h.orig 2009-08-10 15:38:54.000000000 +0100
57 +++ /usr/include/llvm-c/Core.h 2009-08-10 15:38:25.000000000 +0100
58 @@ -831,7 +831,7 @@
59 template<typename T>
60 inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
61 #if DEBUG
62 - for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
63 + for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
64 cast<T>(*I);
65 #endif
66 return reinterpret_cast<T**>(Vals);
67
68 - A x86 or amd64 processor with support for sse2, sse3, and sse4.1 SIMD
69 instructions. This is necessary because we emit several SSE intrinsics for
70 convenience. See /proc/cpuinfo to know what your CPU supports.
71
72 - scons (although it should be straightforward to fix the Makefiles as well)
73
74
75 Building
76 ========
77
78 To build everything invoke scons as:
79
80 scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false -k
81
82
83 Using
84 =====
85
86 Building will create a drop-in alternative for libGL.so. To use it set the
87 environment variables:
88
89 export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH
90 export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH
91
92
93 Unit testing
94 ============
95
96 Building will also create several unit tests in
97 build/linux-???-debug/gallium/drivers/llvmpipe:
98
99 - lp_test_blend: blending
100 - lp_test_conv: SIMD vector conversion
101 - lp_test_format: pixel unpacking/packing
102
103