Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cell.html 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <HTML>
  2. <TITLE>Cell Driver</TITLE>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <BODY>
  5. <H1>Mesa/Gallium Cell Driver</H1>
  6. <p>
  7. The Mesa
  8. <a href="http://en.wikipedia.org/wiki/Cell_%28microprocessor%29" target="_parent">Cell</a>
  9. driver is part of the
  10. <a href="http://wiki.freedesktop.org/wiki/Software/gallium" target="_parent">Gallium3D</a>
  11. architecture.
  12. Tungsten Graphics did the original implementation of the Cell driver.
  13. </p>
  14. <H2>Source Code</H2>
  15. <p>
  16. The latest Cell driver source code is on the master branch of the Mesa
  17. git repository.
  18. </p>
  19. <p>
  20. To build the driver you'll need the IBM Cell SDK (version 2.1 or 3.0).
  21. To use the driver you'll need a Cell system, such as a PS3 running Linux,
  22. or the Cell Simulator (untested, though).
  23. </p>
  24. <p>
  25. If using Cell SDK 2.1, see the configs/linux-cell file for some
  26. special changes.
  27. </p>
  28. <p>
  29. To compile the code, run <code>make linux-cell</code>.
  30. Or to build in debug mode, run <code>make linux-cell-debug</code>.
  31. </p>
  32. <p>
  33. To use the library, make sure your current directory is the top of the
  34. Mesa tree, then set <code>LD_LIBRARY_PATH</code> like this:
  35. <pre>
  36. export LD_LIBRARY_PATH=$PWD/lib/gallium:$PWD/lib/
  37. </pre>
  38. <p>
  39. Verify that the Cell driver is being used by running
  40. <code>progs/xdemos/glxinfo</code> and looking for:
  41. <pre>
  42. OpenGL renderer string: Gallium 0.3, Cell on Xlib
  43. </pre>
  44. <H2>Driver Implementation Summary</H2>
  45. <p>
  46. Rasterization is parallelized across the SPUs in a tiled-based manner.
  47. Batches of transformed triangles are sent to the SPUs (actually, pulled by from
  48. main memory by the SPUs).
  49. Each SPU loops over a set of 32x32-pixel screen tiles, rendering the triangles
  50. into each tile.
  51. Because of the limited SPU memory, framebuffer tiles are paged in/out of
  52. SPU local store as needed.
  53. Similarly, textures are tiled and brought into local store as needed.
  54. </p>
  55. <H2>Status</H2>
  56. <p>
  57. As of October 2008, the driver runs quite a few OpenGL demos.
  58. Features that work include:
  59. </p>
  60. <ul>
  61. <li>Point/line/triangle rendering, glDrawPixels
  62. <li>2D, NPOT and cube texture maps with nearest/linear/mipmap filtering
  63. <li>Dynamic SPU code generation for fragment shaders, but not complete
  64. <li>Dynamic SPU code generation for fragment ops (blend, Z-test, etc), but not complete
  65. <li>Dynamic PPU/PPC code generation for vertex shaders, but not complete
  66. </ul>
  67. <p>
  68. Performance has recently improved with the addition of PPC code generation
  69. for vertex shaders, but the code quality isn't too great yet.
  70. </p>
  71. <p>
  72. Another bottleneck is SwapBuffers. It may be the limiting factor for
  73. many simple GL tests.
  74. </p>
  75. <H2>Debug Options</H2>
  76. <p>
  77. The CELL_DEBUG env var can be set to a comma-separated list of one or
  78. more of the following debug options:
  79. </p>
  80. <ul>
  81. <li><b>checker</b> - use a different background clear color for each SPU.
  82. This lets you see which SPU is rendering which screen tiles.
  83. <li><b>sync</b> - wait/synchronize after each DMA transfer
  84. <li><b>asm</b> - print generated SPU assembly code to stdout
  85. <li><b>fragops</b> - emit fragment ops debug messages
  86. <li><b>fragopfallback</b> - don't use codegen for fragment ops
  87. <li><b>cmd</b> - print SPU commands as their received
  88. <li><b>cache</b> - print texture cache statistics when program exits
  89. </ul>
  90. <p>
  91. Note that some of these options may only work for linux-cell-debug builds.
  92. </p>
  93. <p>
  94. If the GALLIUM_NOPPC env var is set, PPC code generation will not be used
  95. and vertex shaders will be run with the TGSI interpreter.
  96. </p>
  97. <p>
  98. If the GALLIUM_NOCELL env var is set, the softpipe driver will be used
  99. intead of the Cell driver.
  100. This is useful for comparison/validation.
  101. </p>
  102. <H2>Contributing</H2>
  103. <p>
  104. If you're interested in contributing to the effort, familiarize yourself
  105. with the code, join the <a href="lists.html">mesa3d-dev mailing list</a>,
  106. and describe what you'd like to do.
  107. </p>
  108. </BODY>
  109. </HTML>