Dave Cope's Homepage
   Main | Personal | Photo Gallery | Projects | Linux | Employment Info. | Links | Misc. | About e-mail  

PS3/Cell SPU Rendering System


Introduction

When the PS3 was released, I was really excited to be able to run Linux on it and write some SPU programs. Since Linux doesn't have access to the PS3's GPU, I thought it would be interesting to write a rendering system that ran on the SPU's. The SPU's are extremely powerful so it should be possible to write a software rasterizer that is much faster than one written for a standard PC.

Challenges

The SPU's can only directly access a small amount of memory. Each SPU has 256Kb of extremely fast local memory in which all data and code must be stored. However, DMA's can be used to transfer data to/from main memory.

The Cell is an asymmetric multiprocessing system. In order to run efficiently the rasterizer must run on multiple cores simultaneously. That makes concurrent access to a shared resource (e.g. a framebuffer) more difficult.

"Assets"

The SPU's are very fast. They are designed to execute SIMD programs very quickly. In fact, almost every instruction on the SPU is a vector instruction. They have also been designed with floating point operations in mind. In terms of raw floating point performance a single SPU will easily surpass a Pentium 4. Plus the PS3 has a total of 6 SPU's available to Linux.

In addition to computational power, the SPU's have extremely fast local memory. Local memory is on chip, so there is no chance of missing cache. This makes the SPU's extremely efficient assuming operations can operate on local memory.

Progress Reports

Aug. 12, 2007

This is my first progress report about the rendering system. I have actually spent quite a lot of time working on it, so a lot of features have been implemented. It currently has the following features:

  • "Programmable" vertex and fragment shaders.
  • All vertex and fragment computations can be done on the SPU (or PPU if desired).
  • Texturing with nearest neighbor or bilinear interpolation.

The vertex and fragment shaders are programmable, but is currently limited to a single shader of each type. i.e. there is one global vertex/fragment shader.

Here are some screenshots of the rasterizer running in a window on the PS3.
Rendering of the Stanford Bunny

This is a rasterization of the famous Stanford Bunny. The model has been lit by a point light, and its surface coloration is based on the surface normal.

Rendering of the Stanford Bunny

This is a rasterization of a simple textured cube. The current texture sampler being used performs a bilinear filter. However, a trilinear filter could be easily supported with reduced performance.



This site was designed and coded by Dave Cope - © 1998-2003