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://www.tungstengraphics.com/wiki/index.php/Gallium3D" target=
"_parent">Gallium3D
</a>
20 <a href=
"http://www.tungstengraphics.com/" target=
"_parent">Tungsten Graphics
</a>
21 is leading the project.
22 Two phases are planned.
23 First, to implement the framework for parallel rasterization using the Cell
24 SPEs, including texture mapping.
25 Second, to implement a full-featured OpenGL driver with support for GLSL, etc.
26 The second phase is now underway.
33 The latest Cell driver source code is on the
<code>gallium-
0.2</code> branch
34 of the Mesa git repository.
35 After you've cloned the repository, check out the branch with:
38 git-checkout -b gallium-
0.2 origin/gallium-
0.2
41 To build the driver you'll need the IBM Cell SDK (version
2.1 or
3.0).
42 To use the driver you'll need a Cell system, such as a PS3 running Linux,
43 or the Cell Simulator (untested, though).
47 If using Cell SDK
2.1, see the configs/linux-cell file for some
52 To compile the code, run
<code>make linux-cell
</code>.
53 To build in debug mode, run
<code>make linux-cell-debug
</code>.
57 To use the library, make sure
<code>LD_LIBRARY_PATH
</code> points the Mesa/lib/
58 directory that contains
<code>libGL.so
</code>.
62 Verify that the Cell driver is being used by running
<code>glxinfo
</code>
65 OpenGL renderer string: Gallium
0.2, Cell on Xlib
69 <H2>Driver Implementation Summary
</H2>
72 Rasterization is parallelized across the SPUs in a tiled-based manner.
73 Batches of transformed triangles are sent to the SPUs (actually, pulled by from
74 main memory by the SPUs).
75 Each SPU loops over a set of
32x32-pixel screen tiles, rendering the triangles
77 Because of the limited SPU memory, framebuffer tiles are paged in/out of
78 SPU local store as needed.
79 Similarly, textures are tiled and brought into local store as needed.
86 As of October
2008, the driver runs quite a few OpenGL demos.
87 Features that work include:
90 <li>Point/line/triangle rendering, glDrawPixels
91 <li>2D, NPOT and cube texture maps with nearest/linear/mipmap filtering
92 <li>Dynamic SPU code generation for fragment shaders, but not complete
93 <li>Dynamic SPU code generation for fragment ops (blend, Z-test, etc), but not complete
94 <li>Dynamic PPU/PPC code generation for vertex shaders, but not complete
97 Performance has recently improved with the addition of PPC code generation
98 for vertex shaders, but the code quality isn't too great yet.
101 Another bottleneck is SwapBuffers. It may be the limiting factor for
102 many simple GL tests.
107 <H2>Debug Options
</H2>
110 The CELL_DEBUG env var can be set to a comma-separated list of one or
111 more of the following debug options:
114 <li><b>checker
</b> - use a different background clear color for each SPU.
115 This lets you see which SPU is rendering which screen tiles.
116 <li><b>sync
</b> - wait/synchronize after each DMA transfer
117 <li><b>asm
</b> - print generated SPU assembly code to stdout
118 <li><b>fragops
</b> - emit fragment ops debug messages
119 <li><b>fragopfallback
</b> - don't use codegen for fragment ops
120 <li><b>cmd
</b> - print SPU commands as their received
121 <li><b>cache
</b> - print texture cache statistics when program exits
124 Note that some of these options may only work for linux-cell-debug builds.
128 If the GALLIUM_NOPPC env var is set, PPC code generation will not be used
129 and vertex shaders will be run with the TGSI interpreter.
132 If the GALLIUM_NOCELL env var is set, the softpipe driver will be used
133 intead of the Cell driver.
134 This is useful for comparison/validation.
139 <H2>Contributing
</H2>
142 If you're interested in contributing to the effort, familiarize yourself
143 with the code, join the
<a href=
"lists.html">mesa3d-dev mailing list
</a>,
144 and describe what you'd like to do.