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 4.1KB

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