Clone of mesa.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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