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.

faq.html 13KB

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