2009-08-10 12:35:16 +01:00
|
|
|
LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
|
|
|
|
|
|
|
|
|
2009-08-18 17:36:13 +01:00
|
|
|
Status
|
|
|
|
======
|
|
|
|
|
|
|
|
Done so far is:
|
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
- the whole fragment pipeline is code generated in a single function
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
- input interpolation
|
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
- depth testing
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
- texture sampling (not all state/formats are supported)
|
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
- fragment shader TGSI translation
|
|
|
|
- same level of support as the TGSI SSE2 exec machine, with the exception
|
|
|
|
we don't fallback to TGSI interpretation when an unsupported opcode is
|
|
|
|
found, but just ignore it
|
|
|
|
- done in SoA layout
|
|
|
|
- input interpolation also code generated
|
|
|
|
|
|
|
|
- alpha testing
|
|
|
|
|
|
|
|
- blend (including logic ops)
|
|
|
|
- both in SoA and AoS layouts, but only the former used for now
|
|
|
|
|
|
|
|
- code is generic
|
|
|
|
- intermediates can be vectors of floats, ubytes, fixed point, etc, and of
|
|
|
|
any width and length
|
|
|
|
- not all operations are implemented for these types yet though
|
2009-08-18 17:36:13 +01:00
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
Most mesa/progs/demos/* work.
|
2009-08-18 17:36:13 +01:00
|
|
|
|
|
|
|
To do (probably by this order):
|
2009-08-22 22:26:55 +01:00
|
|
|
|
|
|
|
- code generate stipple and stencil testing
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
- translate the remaining bits of texture sampling state
|
2009-08-22 22:26:55 +01:00
|
|
|
|
|
|
|
- translate TGSI control flow instructions, and all other remaining opcodes
|
2009-09-11 11:24:00 +01:00
|
|
|
|
|
|
|
- integrate with the draw module for VS code generation
|
2009-08-22 22:26:55 +01:00
|
|
|
|
|
|
|
- code generate the triangle setup and rasterization
|
2009-08-18 17:36:13 +01:00
|
|
|
|
|
|
|
|
2009-08-10 12:35:16 +01:00
|
|
|
Requirements
|
|
|
|
============
|
|
|
|
|
2009-11-26 11:15:08 +00:00
|
|
|
- A x86 or amd64 processor. 64bit mode is preferred.
|
|
|
|
|
|
|
|
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
|
|
|
|
yield the most efficient code. The less features the CPU has the more
|
|
|
|
likely is that you ran into underperforming, buggy, or incomplete code.
|
|
|
|
|
|
|
|
See /proc/cpuinfo to know what your CPU supports.
|
2009-08-16 11:50:17 +01:00
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
- LLVM 2.6.
|
2009-08-16 11:50:17 +01:00
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
For Linux, on a recent Debian based distribution do:
|
2009-08-10 12:35:16 +01:00
|
|
|
|
|
|
|
aptitude install llvm-dev
|
2009-08-10 15:43:04 +01:00
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
For Windows download pre-built MSVC 9.0 or MinGW binaries from
|
|
|
|
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment
|
|
|
|
variable to the extracted path.
|
|
|
|
|
2009-11-24 16:01:01 +00:00
|
|
|
- scons (optional)
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2009-11-24 16:01:01 +00:00
|
|
|
- udis86, http://udis86.sourceforge.net/ (optional):
|
|
|
|
|
|
|
|
git clone git://udis86.git.sourceforge.net/gitroot/udis86/udis86
|
|
|
|
cd udis86
|
|
|
|
./autogen.sh
|
|
|
|
./configure --with-pic
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
2009-08-10 12:35:16 +01:00
|
|
|
|
|
|
|
Building
|
|
|
|
========
|
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
To build everything on Linux invoke scons as:
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2010-02-27 23:49:58 +00:00
|
|
|
scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
Alternatively, you can build it with GNU make, if you prefer, by invoking it as
|
|
|
|
|
|
|
|
make linux-llvm
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
but the rest of these instructions assume that scons is used.
|
2009-08-22 22:26:55 +01:00
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
For windows is everything the except except the winsys:
|
|
|
|
|
2010-02-27 23:49:58 +00:00
|
|
|
scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=gdi dri=false
|
2009-08-10 12:35:16 +01:00
|
|
|
|
|
|
|
Using
|
|
|
|
=====
|
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
On Linux, building will create a drop-in alternative for libGL.so. To use it
|
|
|
|
set the environment variables:
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2009-08-10 16:12:51 +01:00
|
|
|
export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
or
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
For performance evaluation pass debug=no to scons, and use the corresponding
|
|
|
|
lib directory without the "-debug" suffix.
|
|
|
|
|
2010-01-10 18:37:07 +00:00
|
|
|
On Windows, building will create a drop-in alternative for opengl32.dll. To use
|
|
|
|
it put it in the same directory as the application. It can also be used by
|
|
|
|
replacing the native ICD driver, but it's quite an advanced usage, so if you
|
|
|
|
need to ask, don't even try it.
|
|
|
|
|
2009-08-10 12:35:16 +01:00
|
|
|
|
|
|
|
Unit testing
|
|
|
|
============
|
|
|
|
|
|
|
|
Building will also create several unit tests in
|
|
|
|
build/linux-???-debug/gallium/drivers/llvmpipe:
|
|
|
|
|
|
|
|
- lp_test_blend: blending
|
|
|
|
- lp_test_conv: SIMD vector conversion
|
|
|
|
- lp_test_format: pixel unpacking/packing
|
|
|
|
|
2009-09-11 11:24:00 +01:00
|
|
|
Some of this tests can output results and benchmarks to a tab-separated-file
|
2009-08-20 10:21:49 +01:00
|
|
|
for posterior analysis, e.g.:
|
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
|
2009-08-10 12:35:16 +01:00
|
|
|
|
2009-08-21 10:57:48 +01:00
|
|
|
|
|
|
|
Development Notes
|
|
|
|
=================
|
|
|
|
|
2009-08-22 22:26:55 +01:00
|
|
|
- When looking to this code by the first time start in lp_state_fs.c, and
|
|
|
|
then skim through the lp_bld_* functions called in there, and the comments
|
|
|
|
at the top of the lp_bld_*.c functions.
|
|
|
|
|
|
|
|
- All lp_bld_*.[ch] are isolated from the rest of the driver, and could/may be
|
2009-09-11 11:24:00 +01:00
|
|
|
put in a stand-alone Gallium state -> LLVM IR translation module.
|
2009-08-22 22:26:55 +01:00
|
|
|
|
2009-08-21 10:57:48 +01:00
|
|
|
- We use LLVM-C bindings for now. They are not documented, but follow the C++
|
|
|
|
interfaces very closely, and appear to be complete enough for code
|
|
|
|
generation. See
|
|
|
|
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
|
2009-09-11 11:24:00 +01:00
|
|
|
for a stand-alone example.
|