2008-11-02 07:58:06 -07:00
|
|
|
<HTML>
|
|
|
|
|
|
|
|
<TITLE>Cell Driver</TITLE>
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
|
|
|
|
|
|
|
<BODY>
|
|
|
|
|
|
|
|
<H1>Mesa/Gallium Cell Driver</H1>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The Mesa
|
|
|
|
<a href="http://en.wikipedia.org/wiki/Cell_%28microprocessor%29" target="_parent">Cell</a>
|
|
|
|
driver is part of the
|
2010-05-22 14:05:42 -06:00
|
|
|
<a href="http://wiki.freedesktop.org/wiki/Software/gallium" target="_parent">Gallium3D</a>
|
2008-11-02 07:58:06 -07:00
|
|
|
architecture.
|
2010-05-22 14:05:42 -06:00
|
|
|
Tungsten Graphics did the original implementation of the Cell driver.
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<H2>Source Code</H2>
|
|
|
|
|
|
|
|
<p>
|
2010-05-22 14:05:42 -06:00
|
|
|
The latest Cell driver source code is on the master branch of the Mesa
|
|
|
|
git repository.
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
To build the driver you'll need the IBM Cell SDK (version 2.1 or 3.0).
|
|
|
|
To use the driver you'll need a Cell system, such as a PS3 running Linux,
|
|
|
|
or the Cell Simulator (untested, though).
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
If using Cell SDK 2.1, see the configs/linux-cell file for some
|
|
|
|
special changes.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
To compile the code, run <code>make linux-cell</code>.
|
2010-05-22 14:05:42 -06:00
|
|
|
Or to build in debug mode, run <code>make linux-cell-debug</code>.
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2010-05-22 14:05:42 -06:00
|
|
|
To use the library, make sure your current directory is the top of the
|
|
|
|
Mesa tree, then set <code>LD_LIBRARY_PATH</code> like this:
|
|
|
|
<pre>
|
|
|
|
export LD_LIBRARY_PATH=$PWD/lib/gallium:$PWD/lib/
|
|
|
|
</pre>
|
2008-11-02 07:58:06 -07:00
|
|
|
|
|
|
|
<p>
|
2010-05-22 14:05:42 -06:00
|
|
|
Verify that the Cell driver is being used by running
|
|
|
|
<code>progs/xdemos/glxinfo</code> and looking for:
|
2008-11-02 07:58:06 -07:00
|
|
|
<pre>
|
2010-05-22 14:05:42 -06:00
|
|
|
OpenGL renderer string: Gallium 0.3, Cell on Xlib
|
2008-11-02 07:58:06 -07:00
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<H2>Driver Implementation Summary</H2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Rasterization is parallelized across the SPUs in a tiled-based manner.
|
|
|
|
Batches of transformed triangles are sent to the SPUs (actually, pulled by from
|
|
|
|
main memory by the SPUs).
|
|
|
|
Each SPU loops over a set of 32x32-pixel screen tiles, rendering the triangles
|
|
|
|
into each tile.
|
|
|
|
Because of the limited SPU memory, framebuffer tiles are paged in/out of
|
|
|
|
SPU local store as needed.
|
|
|
|
Similarly, textures are tiled and brought into local store as needed.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<H2>Status</H2>
|
|
|
|
|
|
|
|
<p>
|
2009-05-17 14:26:36 -06:00
|
|
|
As of October 2008, the driver runs quite a few OpenGL demos.
|
|
|
|
Features that work include:
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
2009-05-17 14:26:36 -06:00
|
|
|
<ul>
|
|
|
|
<li>Point/line/triangle rendering, glDrawPixels
|
|
|
|
<li>2D, NPOT and cube texture maps with nearest/linear/mipmap filtering
|
|
|
|
<li>Dynamic SPU code generation for fragment shaders, but not complete
|
|
|
|
<li>Dynamic SPU code generation for fragment ops (blend, Z-test, etc), but not complete
|
|
|
|
<li>Dynamic PPU/PPC code generation for vertex shaders, but not complete
|
|
|
|
</ul>
|
2008-11-02 07:58:06 -07:00
|
|
|
<p>
|
2009-05-17 14:26:36 -06:00
|
|
|
Performance has recently improved with the addition of PPC code generation
|
|
|
|
for vertex shaders, but the code quality isn't too great yet.
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
|
|
|
<p>
|
2009-05-17 14:26:36 -06:00
|
|
|
Another bottleneck is SwapBuffers. It may be the limiting factor for
|
|
|
|
many simple GL tests.
|
2008-11-02 07:58:06 -07:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<H2>Debug Options</H2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The CELL_DEBUG env var can be set to a comma-separated list of one or
|
|
|
|
more of the following debug options:
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li><b>checker</b> - use a different background clear color for each SPU.
|
|
|
|
This lets you see which SPU is rendering which screen tiles.
|
|
|
|
<li><b>sync</b> - wait/synchronize after each DMA transfer
|
2009-05-17 14:26:36 -06:00
|
|
|
<li><b>asm</b> - print generated SPU assembly code to stdout
|
|
|
|
<li><b>fragops</b> - emit fragment ops debug messages
|
|
|
|
<li><b>fragopfallback</b> - don't use codegen for fragment ops
|
|
|
|
<li><b>cmd</b> - print SPU commands as their received
|
|
|
|
<li><b>cache</b> - print texture cache statistics when program exits
|
2008-11-02 07:58:06 -07:00
|
|
|
</ul>
|
2009-05-17 14:26:36 -06:00
|
|
|
<p>
|
|
|
|
Note that some of these options may only work for linux-cell-debug builds.
|
|
|
|
</p>
|
2008-11-02 07:58:06 -07:00
|
|
|
|
2009-05-17 14:26:36 -06:00
|
|
|
<p>
|
|
|
|
If the GALLIUM_NOPPC env var is set, PPC code generation will not be used
|
|
|
|
and vertex shaders will be run with the TGSI interpreter.
|
|
|
|
</p>
|
2008-11-02 07:58:06 -07:00
|
|
|
<p>
|
|
|
|
If the GALLIUM_NOCELL env var is set, the softpipe driver will be used
|
|
|
|
intead of the Cell driver.
|
|
|
|
This is useful for comparison/validation.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<H2>Contributing</H2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
If you're interested in contributing to the effort, familiarize yourself
|
|
|
|
with the code, join the <a href="lists.html">mesa3d-dev mailing list</a>,
|
|
|
|
and describe what you'd like to do.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|