Clone of mesa.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

faq.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <html>
  2. <head><title>Mesa FAQ</title></head>
  3. <BODY text="#000000" bgcolor="#55bbff" link="#111188">
  4. <center>
  5. <h1>Mesa Frequently Asked Questions</h1>
  6. Last updated: 31 December 2003
  7. </center>
  8. <br>
  9. <br>
  10. <h2>Index</h2>
  11. <a href="#part1">1. High-level Questions and Answers</a>
  12. <br>
  13. <a href="#part2">2. Compilation and Installation Problems</a>
  14. <br>
  15. <a href="#part3">3. Runtime / Rendering Problems</a>
  16. <br>
  17. <a href="#part4">4. Developer Questions</a>
  18. <br>
  19. <br>
  20. <br>
  21. <a name="part1">
  22. </a><h1><a name="part1">1. High-level Questions and Answers</a></h1>
  23. <h2><a name="part1">1.1 What is Mesa?</a></h2>
  24. <p>
  25. <a name="part1">Mesa is an open-source implementation of the OpenGL specification.
  26. OpenGL is a programming library for writing interactive 3D applications.
  27. See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more
  28. information.
  29. </p>
  30. <p>
  31. Mesa 5.x supports the OpenGL 1.4 specification.
  32. </p>
  33. <h2>1.2 Does Mesa support/use graphics hardware?</h2>
  34. <p>
  35. Yes. Specifically, Mesa serves as the OpenGL core for the open-source
  36. XFree86/DRI OpenGL drivers. See the <a href="http://dri.sf.net/">DRI
  37. website</a> for more information.
  38. </p>
  39. <p>
  40. There have been other hardware drivers for Mesa over the years (such as
  41. the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
  42. are the modern ones.
  43. </p>
  44. <h2>1.3 What purpose does Mesa (software-based rendering) serve today?</h2>
  45. <p>
  46. Hardware-accelerated OpenGL implementations are available for most popular
  47. operating systems today.
  48. Still, Mesa serves at least these purposes:
  49. </p>
  50. <ul>
  51. <li>Mesa is used as the core of the open-source XFree86/DRI hardware drivers.
  52. </li>
  53. <li>Mesa is quite portable and allows OpenGL to be used on systems
  54. that have no other OpenGL solution.
  55. </li>
  56. <li>Software rendering with Mesa serves as a reference for validating the
  57. hardware drivers.
  58. </li>
  59. <li>A software implementation of OpenGL is useful for experimentation,
  60. such as testing new rendering techniques.
  61. </li>
  62. <li>Mesa can render images with deep color channels: 16-bit integer
  63. and 32-bit floating point color channels are supported.
  64. This capability is only now appearing in hardware.
  65. </li>
  66. <li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
  67. changed for special needs (hardware limits are hard to overcome).
  68. </li>
  69. </ul>
  70. <h2>1.4 How do I upgrade my DRI installation to use a new Mesa release?</h2>
  71. <p>
  72. You don't! A copy of the Mesa source code lives inside the XFree86/DRI source
  73. tree and gets compiled into the individual DRI driver modules.
  74. If you try to install Mesa over an XFree86/DRI installation, you'll lose
  75. hardware rendering (because stand-alone Mesa's libGL.so is different than
  76. the XFree86 libGL.so).
  77. </p>
  78. <p>
  79. The DRI developers will incorporate the latest release of Mesa into the
  80. DRI drivers when the time is right.
  81. </p>
  82. <p>
  83. To upgrade, either look for a new release of <a href="http://www.xfree86.org"
  84. target="_parent">XFree86</a> or visit the
  85. <a href="http://dri.sf.net" target="_parent">DRI website</a> to see
  86. if there's newer drivers.
  87. </p>
  88. <h2>1.5 Are there other open-source implementations of OpenGL?</h2>
  89. <p>
  90. Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
  91. target="_parent">
  92. OpenGL Sample Implemenation (SI)</a> is available.
  93. The SI was written during the time that OpenGL was originally designed.
  94. Unfortunately, development of the SI has stagnated.
  95. Mesa is much more up to date with modern features and extensions.
  96. </p>
  97. <p>
  98. <a href="http://www.dsbox.com/minigl.html" target="_parent">miniGL</a>
  99. is a subset of OpenGL for PalmOS devices.
  100. <p>
  101. <a href="http://fabrice.bellard.free.fr/TinyGL/"
  102. target="_parent">TinyGL</a> is a subset of OpenGL.
  103. </p>
  104. <p>
  105. <a href="http://softgl.studierstube.org/" target="_parent">SoftGL</a>
  106. is an OpenGL subset for mobile devices.
  107. </p>
  108. <p>
  109. <a href="http://chromium.sourceforge.net/" target="_parent">Chromium</a>
  110. isn't a conventional OpenGL implementation (it's layered upon OpenGL),
  111. but it does export the OpenGL API. It allows tiled rendering, sort-last
  112. rendering, etc.
  113. </p>
  114. <p>
  115. There may be other open OpenGL implementations, but Mesa is the most
  116. popular and feature-complete.
  117. </p>
  118. <br>
  119. <br>
  120. <a name="part2">
  121. </a><h1><a name="part2">2. Compilation and Installation Problems</a></h1>
  122. <h2><a name="part2">2.1 What's the easiest way to install Mesa?</a></h2>
  123. <p>
  124. <a name="part2">If you're using a Linux-based system, your distro CD most likely already
  125. has Mesa packages (like RPM or DEB) which you can easily install.
  126. </a></p>
  127. <h2><a name="part2">2.2 Running <code>configure; make</code> Doesn't Work</a></h2>
  128. <p>
  129. <a name="part2">Unfortunately, the GNU autoconf/automake/libtool system doesn't seem to work
  130. too well on non GNU/Linux systems, even after installing gmake, gcc, etc.
  131. For that reason, Mesa's <b>old-style</b> makefile system is still included.
  132. The old-style system uses good old traditional Makefiles. Try the following:
  133. </a></p><pre><a name="part2"> cd Mesa-x.y.z
  134. cp Makefile.X11 Makefile
  135. make
  136. </a></pre>
  137. <a name="part2">You'll see a list of system configurations from which to choose.
  138. For example:
  139. </a><pre><a name="part2"> make linux-x86
  140. </a></pre>
  141. <p>
  142. <a name="part2">If you're experienced with GNU autoconf/automake/libtool and think you can help
  143. with maintence, contact the Mesa developers.
  144. FYI, the Mesa developers generally don't use the autoconf/automake system.
  145. We're especially annoyed with the fact that a +5000-line script (libtool)
  146. is needed to make shared libraries (ugh).
  147. </a></p>
  148. <h2><a name="part2">2.3 Mesa still doesn't compile</a></h2>
  149. <p>
  150. <a name="part2">If the old-style Makefile system doesn't work either, make sure you have
  151. the most recent version of Mesa.
  152. Otherwise, file a bug report or post to the Mesa3d-users mailing list.
  153. Give as much info as possible when describing your problem.
  154. </a></p>
  155. <h2><a name="part2">2.4 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
  156. <p>
  157. <a name="part2">You're application is written in IRIS GL, not OpenGL.
  158. IRIS GL was the predecessor to OpenGL and is a different thing (almost)
  159. entirely.
  160. Mesa's not the solution.
  161. </a></p>
  162. <h2><a name="part2">2.5 Where is the GLUT library?</a></h2>
  163. <p>
  164. <a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file.
  165. If you don't already have GLUT installed, you should grab the MesaDemos
  166. package and unpack it before compiling Mesa.
  167. </a></p>
  168. <h2><a name="part2">2.6 What's the proper place for the libraries and headers?</a></h2>
  169. <p>
  170. <a name="part2">On Linux-based systems you'll want to follow the
  171. </a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
  172. target="_parent">Linux ABI</a> standard.
  173. Basically you'll want the following:
  174. </p>
  175. <ul>
  176. <li>/usr/include/GL/gl.h - the main OpenGL header
  177. </li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
  178. </li><li>/usr/include/GL/glx.h - the OpenGL GLX header
  179. </li><li>/usr/include/GL/glext.h - the OpenGL extensions header
  180. </li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
  181. </li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
  182. </li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
  183. </li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
  184. </li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
  185. Mesa version number.
  186. </li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
  187. </li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
  188. </li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
  189. version number.
  190. </li></ul>
  191. <p>
  192. After installing XFree86 and the DRI drivers, some of these files
  193. may be symlinks into the /usr/X11R6/ tree.
  194. </p>
  195. <p>
  196. The old-style Makefile system doesn't install the Mesa libraries; it's
  197. up to you to copy them (and the headers) to the right place.
  198. </p>
  199. <p>
  200. The GLUT header and library should go in the same directories.
  201. </p>
  202. <br>
  203. <br>
  204. <a name="part3">
  205. </a><h1><a name="part3">3. Runtime / Rendering Problems</a></h1>
  206. <h2><a name="part3">3.1 Rendering is slow / why isn't my graphics hardware being used?</a></h2>
  207. <p>
  208. <a name="part3">Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
  209. support for hardware acceleration (with the exception of the 3DFX Voodoo
  210. driver).
  211. </a></p>
  212. <p>
  213. <a name="part3">What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
  214. for your particular hardware.
  215. </a></p>
  216. <p>
  217. <a name="part3">You can run the <code>glxinfo</code> program to learn about your OpenGL
  218. library.
  219. Look for the GL_VENDOR and GL_RENDERER values.
  220. That will identify who's OpenGL library you're using and what sort of
  221. hardware it has detected.
  222. </a></p>
  223. <p>
  224. <a name="part3">If your DRI-based driver isn't working, go to the
  225. </a><a href="http://dri.sf.net/" target="_parent">DRI website</a> for trouble-shooting information.
  226. </p>
  227. <h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
  228. <p>
  229. Make sure the ratio of the far to near clipping planes isn't too great.
  230. Look
  231. <a href="http://www.sgi.com/software/opengl/advanced97/notes/node18.html"
  232. target="_parent">
  233. here</a> for details.
  234. </p>
  235. <p>
  236. Mesa uses a 16-bit depth buffer by default which is smaller and faster
  237. to clear than a 32-bit buffer but not as accurate.
  238. If you need a deeper you can modify the parameters to
  239. <code> glXChooseVisual</code> in your code.
  240. </p>
  241. <h2>3.3 Why Isn't depth buffering working at all?</h2>
  242. <p>
  243. Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
  244. environment variable it will warn you about trying to enable depth testing
  245. when you don't have a depth buffer.
  246. </p>
  247. <p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
  248. with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
  249. called with a non-zero value for GLX_DEPTH_SIZE.
  250. </p>
  251. <p>This discussion applies to stencil buffers, accumulation buffers and
  252. alpha channels too.
  253. </p>
  254. <h2>3.4 Why does glGetString() always return NULL?</h2>
  255. <p>
  256. Be sure you have an active/current OpenGL rendering context before
  257. calling glGetString.
  258. </p>
  259. <h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
  260. <p>
  261. If you're trying to draw a filled region by using GL_POINTS or GL_LINES
  262. and seeing holes or gaps it's because of a float-to-int rounding problem.
  263. But this is not a bug.
  264. See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
  265. Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
  266. will fix the problem.
  267. </p>
  268. <br>
  269. <br>
  270. <a name="part4">
  271. </a><h1><a name="part4">4. Developer Questions</a></h1>
  272. <h2><a name="part4">4.1 How can I contribute?</a></h2>
  273. <p>
  274. <a name="part4">First, join the Mesa3d-dev mailing list. That's where Mesa development
  275. is discussed.
  276. </a></p>
  277. <p>
  278. <a name="part4">The </a><a href="http://www.opengl.org/developers/documentation/specs.html" target="_parent">
  279. OpenGL Specification</a> is the bible for OpenGL implemention work.
  280. You should read it.
  281. </p>
  282. <p>Most of the Mesa development work involves implementing new OpenGL
  283. extensions, writing hardware drivers (for the DRI), and code optimization.
  284. </p>
  285. <h2>4.2 How do I write a new device driver?</h2>
  286. <p>
  287. Unfortunately, writing a device driver isn't easy.
  288. It requires detailed understanding of OpenGL, the Mesa code, and your
  289. target hardware/operating system.
  290. 3D graphics are not simple.
  291. </p>
  292. <p>
  293. The best way to get started is to use an existing driver as your starting
  294. point.
  295. For a software driver, the X11 and OSMesa drivers are good examples.
  296. For a hardware driver, the Radeon and R200 DRI drivers are good examples.
  297. </p>
  298. <p>The DRI website has more information about writing hardware drivers.
  299. The process isn't well document because the Mesa driver interface changes
  300. over time, and we seldome have spare time for writing documentation.
  301. That being said, many people have managed to figure out the process.
  302. </p>
  303. <p>
  304. Joining the appropriate mailing lists and asking questions (and searching
  305. the archives) is a good way to get information.
  306. </p>
  307. <h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa and/or the DRI drivers?</h2>
  308. <p>
  309. The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target="_parent">specification for the extension</a>
  310. indicates that there are intellectual property (IP) and/or patent issues
  311. to be dealt with.
  312. </p>
  313. <p>We've been unsucessful in getting a response from S3 (or whoever owns
  314. the IP nowadays) to indicate whether or not an open source project can
  315. implement the extension (specifically the compression/decompression
  316. algorithms).
  317. </p>
  318. <p>
  319. Until we can get official permission to do so, this extension will not
  320. be implemented in Mesa.
  321. </p>
  322. </body>
  323. </html>