blob: 11b5d4325585815a9a22697182cbe3fa0fee6061 [file] [log] [blame]
Brian Paul0b27ace2003-03-08 17:38:57 +00001<html>
2
3<head><title>Mesa FAQ</title></head>
4
Brian Paul36da0452005-01-20 03:55:10 +00005<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
Brian Paul0b27ace2003-03-08 17:38:57 +00008
9
10<center>
11<h1>Mesa Frequently Asked Questions</h1>
Brian Pauld5299bf2006-08-21 14:26:06 +000012Last updated: 21 August 2006
Brian Paul0b27ace2003-03-08 17:38:57 +000013</center>
14
15<br>
16<br>
17<h2>Index</h2>
18<a href="#part1">1. High-level Questions and Answers</a>
19<br>
20<a href="#part2">2. Compilation and Installation Problems</a>
21<br>
22<a href="#part3">3. Runtime / Rendering Problems</a>
23<br>
24<a href="#part4">4. Developer Questions</a>
25<br>
26<br>
27<br>
28
29
30
31<a name="part1">
32</a><h1><a name="part1">1. High-level Questions and Answers</a></h1>
33
34<h2><a name="part1">1.1 What is Mesa?</a></h2>
35<p>
36<a name="part1">Mesa is an open-source implementation of the OpenGL specification.
Brian Paula376e332003-03-30 16:54:36 +000037OpenGL is a programming library for writing interactive 3D applications.
Brian Paul0b27ace2003-03-08 17:38:57 +000038See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more
39information.
40</p>
41<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000042Mesa 6.x supports the OpenGL 1.5 specification.
Brian Paul0b27ace2003-03-08 17:38:57 +000043</p>
44
45
46<h2>1.2 Does Mesa support/use graphics hardware?</h2>
47<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000048Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
Brian Pauld5299bf2006-08-21 14:26:06 +000049drivers for XFree86/X.org. See the <a href="http://dri.freedesktop.org/">DRI
Brian Paula376e332003-03-30 16:54:36 +000050website</a> for more information.
Brian Paul0b27ace2003-03-08 17:38:57 +000051</p>
52<p>
53There have been other hardware drivers for Mesa over the years (such as
54the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
55are the modern ones.
56</p>
57
Brian Paul65b79052004-11-22 17:49:15 +000058<h2>1.3 What purpose does Mesa serve today?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000059<p>
Brian Paula376e332003-03-30 16:54:36 +000060Hardware-accelerated OpenGL implementations are available for most popular
61operating systems today.
Brian Paul0b27ace2003-03-08 17:38:57 +000062Still, Mesa serves at least these purposes:
63</p>
64<ul>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000065<li>Mesa is used as the core of the open-source XFree86/X.org DRI
66 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000067</li>
68<li>Mesa is quite portable and allows OpenGL to be used on systems
69 that have no other OpenGL solution.
70</li>
71<li>Software rendering with Mesa serves as a reference for validating the
Brian Paul0b27ace2003-03-08 17:38:57 +000072 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000073</li>
74<li>A software implementation of OpenGL is useful for experimentation,
75 such as testing new rendering techniques.
76</li>
77<li>Mesa can render images with deep color channels: 16-bit integer
78 and 32-bit floating point color channels are supported.
Brian Paul0b27ace2003-03-08 17:38:57 +000079 This capability is only now appearing in hardware.
Brian Paula376e332003-03-30 16:54:36 +000080</li>
81<li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
Brian Paul0b27ace2003-03-08 17:38:57 +000082 changed for special needs (hardware limits are hard to overcome).
Brian Paula376e332003-03-30 16:54:36 +000083</li>
84</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000085
Brian Paul65b79052004-11-22 17:49:15 +000086
87<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
88<p>
89<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
Brian Paul7e4cc1c2005-10-24 23:33:27 +000090On systems running the X Window System it does all its rendering through
91the Xlib API:
Brian Paul65b79052004-11-22 17:49:15 +000092<ul>
93<li>The GLX API is supported, but it's really just an emulation of the
94 real thing.
95<li>The GLX wire protocol is not supported and there's no OpenGL extension
96 loaded by the X server.
97<li>There is no hardware acceleration.
98<li>The OpenGL library, libGL.so, contains everything (the programming API,
99 the GLX functions and all the rendering code).
100</ul>
101</p>
102<p>
103Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
104within the DRI (Direct Rendering Infrastructure):
105<ul>
106<li>The libGL.so library provides the GL and GLX API functions, a GLX
107 protocol encoder, and a device driver loader.
108<li>The device driver modules (such as r200_dri.so) contain a built-in
109 copy of the core Mesa code.
110<li>The X server loads the GLX module.
111 The GLX module decodes incoming GLX protocol and dispatches the commands
112 to a rendering module.
113 For the DRI, this module is basically a software Mesa renderer.
114</ul>
115
116
117
118<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000119<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000120This wasn't easy in the past.
121Now, the DRI drivers are included in the Mesa tree and can be compiled
122separately from the X server.
123Just follow the Mesa <a href="install.html">compilation instructions</a>.
Brian Paul824a4fc2003-08-06 19:05:26 +0000124</p>
125
Brian Paul0b27ace2003-03-08 17:38:57 +0000126
Brian Paul65b79052004-11-22 17:49:15 +0000127<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000128<p>
Brian Paul7df4f952003-11-25 21:13:26 +0000129Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
130target="_parent">
Brian Paul0b27ace2003-03-08 17:38:57 +0000131OpenGL Sample Implemenation (SI)</a> is available.
132The SI was written during the time that OpenGL was originally designed.
133Unfortunately, development of the SI has stagnated.
134Mesa is much more up to date with modern features and extensions.
135</p>
Brian Paul186d4d82004-04-27 12:55:08 +0000136
137<p>
138<a href="http://ogl-es.sourceforge.net" target="_parent">Vincent</a> is
139an open-source implementation of OpenGL ES for mobile devices.
140
Brian Paul0b27ace2003-03-08 17:38:57 +0000141<p>
Brian Paul7df4f952003-11-25 21:13:26 +0000142<a href="http://www.dsbox.com/minigl.html" target="_parent">miniGL</a>
143is a subset of OpenGL for PalmOS devices.
Brian Paul0b27ace2003-03-08 17:38:57 +0000144
Brian Paul7df4f952003-11-25 21:13:26 +0000145<p>
146<a href="http://fabrice.bellard.free.fr/TinyGL/"
147target="_parent">TinyGL</a> is a subset of OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000148</p>
Brian Paul7df4f952003-11-25 21:13:26 +0000149
150<p>
151<a href="http://softgl.studierstube.org/" target="_parent">SoftGL</a>
152is an OpenGL subset for mobile devices.
153</p>
154
Brian Paul0b27ace2003-03-08 17:38:57 +0000155<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000156<a href="http://chromium.sourceforge.net/" target="_parent">Chromium</a>
157isn't a conventional OpenGL implementation (it's layered upon OpenGL),
158but it does export the OpenGL API. It allows tiled rendering, sort-last
159rendering, etc.
160</p>
161
Brian Paulacbc1e02003-11-26 18:10:31 +0000162<p>
Brian Paul0c656042006-06-08 19:59:41 +0000163<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html"
164target="_parent">ClosedGL</a> is an OpenGL subset library for TI
165graphing calculators.
166</p>
167
168<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000169There may be other open OpenGL implementations, but Mesa is the most
170popular and feature-complete.
Brian Paul0b27ace2003-03-08 17:38:57 +0000171</p>
172
Brian Paul65b79052004-11-22 17:49:15 +0000173
174
Brian Paul0b27ace2003-03-08 17:38:57 +0000175<br>
176<br>
177
178
179<a name="part2">
180</a><h1><a name="part2">2. Compilation and Installation Problems</a></h1>
181
182
183<h2><a name="part2">2.1 What's the easiest way to install Mesa?</a></h2>
184<p>
185<a name="part2">If you're using a Linux-based system, your distro CD most likely already
186has Mesa packages (like RPM or DEB) which you can easily install.
187</a></p>
188
189
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800190<h2><a name="part2">2.2 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000191<p>
192<a name="part2">You're application is written in IRIS GL, not OpenGL.
193IRIS GL was the predecessor to OpenGL and is a different thing (almost)
194entirely.
195Mesa's not the solution.
196</a></p>
197
198
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800199<h2><a name="part2">2.3 Where is the GLUT library?</a></h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000200<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000201<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file.
202If you don't already have GLUT installed, you should grab the MesaGLUT
203package and compile it with the rest of Mesa.
Brian Paul0b27ace2003-03-08 17:38:57 +0000204</a></p>
205
206
207
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800208<h2><a name="part2">2.4 What's the proper place for the libraries and headers?</a></h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000209<p>
210<a name="part2">On Linux-based systems you'll want to follow the
Brian Paulfc528e22003-12-31 20:59:51 +0000211</a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
212target="_parent">Linux ABI</a> standard.
Brian Paul0b27ace2003-03-08 17:38:57 +0000213Basically you'll want the following:
214</p>
215<ul>
216<li>/usr/include/GL/gl.h - the main OpenGL header
217</li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
218</li><li>/usr/include/GL/glx.h - the OpenGL GLX header
219</li><li>/usr/include/GL/glext.h - the OpenGL extensions header
220</li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
221</li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
222</li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
223</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
224</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
225Mesa version number.
226</li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
227</li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
228</li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
229version number.
230</li></ul>
231<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000232After installing XFree86/X.org and the DRI drivers, some of these files
Brian Paul0b27ace2003-03-08 17:38:57 +0000233may be symlinks into the /usr/X11R6/ tree.
234</p>
235<p>
236The old-style Makefile system doesn't install the Mesa libraries; it's
237up to you to copy them (and the headers) to the right place.
238</p>
239<p>
240The GLUT header and library should go in the same directories.
241</p>
242<br>
243<br>
244
245
246<a name="part3">
247</a><h1><a name="part3">3. Runtime / Rendering Problems</a></h1>
248
249<h2><a name="part3">3.1 Rendering is slow / why isn't my graphics hardware being used?</a></h2>
250<p>
251<a name="part3">Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
252support for hardware acceleration (with the exception of the 3DFX Voodoo
253driver).
254</a></p>
255<p>
256<a name="part3">What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
257for your particular hardware.
258</a></p>
259<p>
260<a name="part3">You can run the <code>glxinfo</code> program to learn about your OpenGL
261library.
262Look for the GL_VENDOR and GL_RENDERER values.
263That will identify who's OpenGL library you're using and what sort of
264hardware it has detected.
265</a></p>
266<p>
267<a name="part3">If your DRI-based driver isn't working, go to the
Brian Paulfc528e22003-12-31 20:59:51 +0000268</a><a href="http://dri.sf.net/" target="_parent">DRI website</a> for trouble-shooting information.
Brian Paul0b27ace2003-03-08 17:38:57 +0000269</p>
270
271
272<h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
273<p>
274Make sure the ratio of the far to near clipping planes isn't too great.
275Look
Brian Pauld5299bf2006-08-21 14:26:06 +0000276<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040"
277target="_parent"> here</a> for details.
Brian Paul0b27ace2003-03-08 17:38:57 +0000278</p>
279<p>
280Mesa uses a 16-bit depth buffer by default which is smaller and faster
281to clear than a 32-bit buffer but not as accurate.
282If you need a deeper you can modify the parameters to
283<code> glXChooseVisual</code> in your code.
284</p>
285
286
287<h2>3.3 Why Isn't depth buffering working at all?</h2>
288<p>
289Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
290environment variable it will warn you about trying to enable depth testing
291when you don't have a depth buffer.
292</p>
293<p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
294with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
295called with a non-zero value for GLX_DEPTH_SIZE.
296</p>
297<p>This discussion applies to stencil buffers, accumulation buffers and
298alpha channels too.
299</p>
300
301
302<h2>3.4 Why does glGetString() always return NULL?</h2>
303<p>
304Be sure you have an active/current OpenGL rendering context before
305calling glGetString.
306</p>
307
308
309<h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
310<p>
311If you're trying to draw a filled region by using GL_POINTS or GL_LINES
312and seeing holes or gaps it's because of a float-to-int rounding problem.
313But this is not a bug.
314See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
315Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
316will fix the problem.
317</p>
318
319<br>
320<br>
321
322
323<a name="part4">
324</a><h1><a name="part4">4. Developer Questions</a></h1>
325
Brian Pauld5299bf2006-08-21 14:26:06 +0000326<h2>4.1 How can I contribute?</a></h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000327<p>
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800328First, join the <a href="http://www.mesa3d.org/lists.html">Mesa3d-dev
Brian Pauld5299bf2006-08-21 14:26:06 +0000329mailing list</a>.
330That's where Mesa development is discussed.
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800331</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000332<p>
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800333The <a href="http://www.opengl.org/documentation" target="_parent">
Brian Paul0b27ace2003-03-08 17:38:57 +0000334OpenGL Specification</a> is the bible for OpenGL implemention work.
335You should read it.
336</p>
337<p>Most of the Mesa development work involves implementing new OpenGL
338extensions, writing hardware drivers (for the DRI), and code optimization.
339</p>
340
341<h2>4.2 How do I write a new device driver?</h2>
342<p>
343Unfortunately, writing a device driver isn't easy.
344It requires detailed understanding of OpenGL, the Mesa code, and your
345target hardware/operating system.
3463D graphics are not simple.
347</p>
348<p>
349The best way to get started is to use an existing driver as your starting
350point.
351For a software driver, the X11 and OSMesa drivers are good examples.
352For a hardware driver, the Radeon and R200 DRI drivers are good examples.
353</p>
354<p>The DRI website has more information about writing hardware drivers.
355The process isn't well document because the Mesa driver interface changes
356over time, and we seldome have spare time for writing documentation.
357That being said, many people have managed to figure out the process.
358</p>
359<p>
360Joining the appropriate mailing lists and asking questions (and searching
361the archives) is a good way to get information.
362</p>
363
364
Brian Paul0c656042006-06-08 19:59:41 +0000365<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
Brian Paulfc528e22003-12-31 20:59:51 +0000366<p>
367The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target="_parent">specification for the extension</a>
368indicates that there are intellectual property (IP) and/or patent issues
369to be dealt with.
370</p>
371<p>We've been unsucessful in getting a response from S3 (or whoever owns
372the IP nowadays) to indicate whether or not an open source project can
373implement the extension (specifically the compression/decompression
374algorithms).
375</p>
376<p>
Brian Paul0c656042006-06-08 19:59:41 +0000377In the mean time, a 3rd party <a href=
378"http://homepage.hispeed.ch/rscheidegger/dri_experimental/s3tc_index.html"
379target="_parent">plug-in library</a> is available.
Brian Paulfc528e22003-12-31 20:59:51 +0000380</p>
381
382
Brian Paul0b27ace2003-03-08 17:38:57 +0000383</body>
384</html>