3 <TITLE>Cell Driver
</TITLE>
5 <link rel=
"stylesheet" type=
"text/css" href=
"mesa.css"></head>
9 <H1>Mesa/Gallium Cell Driver
</H1>
13 <a href=
"http://en.wikipedia.org/wiki/Cell_%28microprocessor%29" target=
"_parent">Cell
</a>
15 <a href=
"http://wiki.freedesktop.org/wiki/Software/gallium" target=
"_parent">Gallium3D
</a>
17 Tungsten Graphics did the original implementation of the Cell driver.
24 The latest Cell driver source code is on the master branch of the Mesa
28 To build the driver you'll need the IBM Cell SDK (version
2.1 or
3.0).
29 To use the driver you'll need a Cell system, such as a PS3 running Linux,
30 or the Cell Simulator (untested, though).
34 If using Cell SDK
2.1, see the configs/linux-cell file for some
39 To compile the code, run
<code>make linux-cell
</code>.
40 Or to build in debug mode, run
<code>make linux-cell-debug
</code>.
44 To use the library, make sure your current directory is the top of the
45 Mesa tree, then set
<code>LD_LIBRARY_PATH
</code> like this:
47 export LD_LIBRARY_PATH=$PWD/lib/gallium:$PWD/lib/
51 Verify that the Cell driver is being used by running
52 <code>progs/xdemos/glxinfo
</code> and looking for:
54 OpenGL renderer string: Gallium
0.3, Cell on Xlib
58 <H2>Driver Implementation Summary
</H2>
61 Rasterization is parallelized across the SPUs in a tiled-based manner.
62 Batches of transformed triangles are sent to the SPUs (actually, pulled by from
63 main memory by the SPUs).
64 Each SPU loops over a set of
32x32-pixel screen tiles, rendering the triangles
66 Because of the limited SPU memory, framebuffer tiles are paged in/out of
67 SPU local store as needed.
68 Similarly, textures are tiled and brought into local store as needed.
75 As of October
2008, the driver runs quite a few OpenGL demos.
76 Features that work include:
79 <li>Point/line/triangle rendering, glDrawPixels
80 <li>2D, NPOT and cube texture maps with nearest/linear/mipmap filtering
81 <li>Dynamic SPU code generation for fragment shaders, but not complete
82 <li>Dynamic SPU code generation for fragment ops (blend, Z-test, etc), but not complete
83 <li>Dynamic PPU/PPC code generation for vertex shaders, but not complete
86 Performance has recently improved with the addition of PPC code generation
87 for vertex shaders, but the code quality isn't too great yet.
90 Another bottleneck is SwapBuffers. It may be the limiting factor for
96 <H2>Debug Options
</H2>
99 The CELL_DEBUG env var can be set to a comma-separated list of one or
100 more of the following debug options:
103 <li><b>checker
</b> - use a different background clear color for each SPU.
104 This lets you see which SPU is rendering which screen tiles.
105 <li><b>sync
</b> - wait/synchronize after each DMA transfer
106 <li><b>asm
</b> - print generated SPU assembly code to stdout
107 <li><b>fragops
</b> - emit fragment ops debug messages
108 <li><b>fragopfallback
</b> - don't use codegen for fragment ops
109 <li><b>cmd
</b> - print SPU commands as their received
110 <li><b>cache
</b> - print texture cache statistics when program exits
113 Note that some of these options may only work for linux-cell-debug builds.
117 If the GALLIUM_NOPPC env var is set, PPC code generation will not be used
118 and vertex shaders will be run with the TGSI interpreter.
121 If the GALLIUM_NOCELL env var is set, the softpipe driver will be used
122 intead of the Cell driver.
123 This is useful for comparison/validation.
128 <H2>Contributing
</H2>
131 If you're interested in contributing to the effort, familiarize yourself
132 with the code, join the
<a href=
"lists.html">mesa3d-dev mailing list
</a>,
133 and describe what you'd like to do.