blob: dd4e7de0d42356bb9efb2ad7a866b440a14ca417 [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Mesa FAQ</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
Brian Paul0b27ace2003-03-08 17:38:57 +00009
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<div class="header">
11 <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
Brian Paul0b27ace2003-03-08 17:38:57 +000017<center>
18<h1>Mesa Frequently Asked Questions</h1>
Andreas Boll8504f182012-09-20 16:23:15 +020019Last updated: 20 September 2012
Brian Paul0b27ace2003-03-08 17:38:57 +000020</center>
21
22<br>
23<br>
24<h2>Index</h2>
25<a href="#part1">1. High-level Questions and Answers</a>
26<br>
27<a href="#part2">2. Compilation and Installation Problems</a>
28<br>
29<a href="#part3">3. Runtime / Rendering Problems</a>
30<br>
31<a href="#part4">4. Developer Questions</a>
32<br>
33<br>
34<br>
35
36
37
Andreas Bollcc418882012-06-12 09:05:33 +020038<h1 id="part1">1. High-level Questions and Answers</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +000039
Andreas Bollcc418882012-06-12 09:05:33 +020040<h2>1.1 What is Mesa?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000041<p>
Andreas Bollcc418882012-06-12 09:05:33 +020042Mesa is an open-source implementation of the OpenGL specification.
Brian Paula376e332003-03-30 16:54:36 +000043OpenGL is a programming library for writing interactive 3D applications.
Andreas Bollcc418882012-06-12 09:05:33 +020044See the <a href="http://www.opengl.org/">OpenGL website</a> for more
Brian Paul0b27ace2003-03-08 17:38:57 +000045information.
46</p>
47<p>
Andreas Boll5abb1f82012-09-19 18:22:37 +020048Mesa 9.x supports the OpenGL 3.1 specification.
Brian Paul0b27ace2003-03-08 17:38:57 +000049</p>
50
51
52<h2>1.2 Does Mesa support/use graphics hardware?</h2>
53<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000054Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
Andreas Boll8504f182012-09-20 16:23:15 +020055drivers for X.org.
Brian Paul0b27ace2003-03-08 17:38:57 +000056</p>
Andreas Boll8504f182012-09-20 16:23:15 +020057<ul>
58 <li>See the <a href="http://dri.freedesktop.org/">DRI website</a>
59 for more information.</li>
60 <li>See <a href="http://intellinuxgraphics.org">intellinuxgraphics.org</a>
61 for more information about Intel drivers.</li>
62 <li>See <a href="http://nouveau.freedesktop.org">nouveau.freedesktop.org</a>
63 for more information about Nouveau drivers.</li>
64 <li>See <a href="http://www.x.org/wiki/RadeonFeature">www.x.org/wiki/RadeonFeature</a>
65 for more information about Radeon drivers.</li>
66</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000067
Brian Paul65b79052004-11-22 17:49:15 +000068<h2>1.3 What purpose does Mesa serve today?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000069<p>
Brian Paula376e332003-03-30 16:54:36 +000070Hardware-accelerated OpenGL implementations are available for most popular
71operating systems today.
Brian Paul0b27ace2003-03-08 17:38:57 +000072Still, Mesa serves at least these purposes:
73</p>
74<ul>
Andreas Boll8504f182012-09-20 16:23:15 +020075<li>Mesa is used as the core of the open-source X.org DRI
Brian Paul7e4cc1c2005-10-24 23:33:27 +000076 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000077</li>
78<li>Mesa is quite portable and allows OpenGL to be used on systems
79 that have no other OpenGL solution.
80</li>
81<li>Software rendering with Mesa serves as a reference for validating the
Brian Paul0b27ace2003-03-08 17:38:57 +000082 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000083</li>
84<li>A software implementation of OpenGL is useful for experimentation,
85 such as testing new rendering techniques.
86</li>
87<li>Mesa can render images with deep color channels: 16-bit integer
88 and 32-bit floating point color channels are supported.
Brian Paul0b27ace2003-03-08 17:38:57 +000089 This capability is only now appearing in hardware.
Brian Paula376e332003-03-30 16:54:36 +000090</li>
91<li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
Brian Paul0b27ace2003-03-08 17:38:57 +000092 changed for special needs (hardware limits are hard to overcome).
Brian Paula376e332003-03-30 16:54:36 +000093</li>
94</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000095
Brian Paul65b79052004-11-22 17:49:15 +000096
Andreas Boll5abb1f82012-09-19 18:22:37 +020097<h2>1.4 What's the difference between "Stand-Alone" Mesa and the DRI drivers?</h2>
Brian Paul65b79052004-11-22 17:49:15 +000098<p>
99<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000100On systems running the X Window System it does all its rendering through
101the Xlib API:
Andreas Bolldf2be222012-06-12 09:05:22 +0200102</p>
Brian Paul65b79052004-11-22 17:49:15 +0000103<ul>
104<li>The GLX API is supported, but it's really just an emulation of the
105 real thing.
106<li>The GLX wire protocol is not supported and there's no OpenGL extension
107 loaded by the X server.
108<li>There is no hardware acceleration.
109<li>The OpenGL library, libGL.so, contains everything (the programming API,
110 the GLX functions and all the rendering code).
111</ul>
Brian Paul65b79052004-11-22 17:49:15 +0000112<p>
113Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
114within the DRI (Direct Rendering Infrastructure):
115<ul>
116<li>The libGL.so library provides the GL and GLX API functions, a GLX
117 protocol encoder, and a device driver loader.
118<li>The device driver modules (such as r200_dri.so) contain a built-in
119 copy of the core Mesa code.
120<li>The X server loads the GLX module.
121 The GLX module decodes incoming GLX protocol and dispatches the commands
122 to a rendering module.
123 For the DRI, this module is basically a software Mesa renderer.
124</ul>
125
126
127
128<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000129<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000130This wasn't easy in the past.
131Now, the DRI drivers are included in the Mesa tree and can be compiled
132separately from the X server.
133Just follow the Mesa <a href="install.html">compilation instructions</a>.
Brian Paul824a4fc2003-08-06 19:05:26 +0000134</p>
135
Brian Paul0b27ace2003-03-08 17:38:57 +0000136
Brian Paul65b79052004-11-22 17:49:15 +0000137<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000138<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200139Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
Brian Paul0b27ace2003-03-08 17:38:57 +0000140OpenGL Sample Implemenation (SI)</a> is available.
141The SI was written during the time that OpenGL was originally designed.
142Unfortunately, development of the SI has stagnated.
143Mesa is much more up to date with modern features and extensions.
144</p>
Brian Paul186d4d82004-04-27 12:55:08 +0000145
146<p>
Andreas Boll8504f182012-09-20 16:23:15 +0200147<a href="http://sourceforge.net/projects/ogl-es/">Vincent</a> is
Brian Paul186d4d82004-04-27 12:55:08 +0000148an open-source implementation of OpenGL ES for mobile devices.
149
Brian Paul0b27ace2003-03-08 17:38:57 +0000150<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200151<a href="http://www.dsbox.com/minigl.html">miniGL</a>
Brian Paul7df4f952003-11-25 21:13:26 +0000152is a subset of OpenGL for PalmOS devices.
Brian Paul0b27ace2003-03-08 17:38:57 +0000153
Brian Paul7df4f952003-11-25 21:13:26 +0000154<p>
Andreas Boll8504f182012-09-20 16:23:15 +0200155<a href="http://bellard.org/TinyGL/">TinyGL</a>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200156is a subset of OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000157</p>
Brian Paul7df4f952003-11-25 21:13:26 +0000158
159<p>
Andreas Boll8504f182012-09-20 16:23:15 +0200160<a href="http://sourceforge.net/projects/softgl/">SoftGL</a>
Brian Paul7df4f952003-11-25 21:13:26 +0000161is an OpenGL subset for mobile devices.
162</p>
163
Brian Paul0b27ace2003-03-08 17:38:57 +0000164<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200165<a href="http://chromium.sourceforge.net/">Chromium</a>
Brian Paulacbc1e02003-11-26 18:10:31 +0000166isn't a conventional OpenGL implementation (it's layered upon OpenGL),
167but it does export the OpenGL API. It allows tiled rendering, sort-last
168rendering, etc.
169</p>
170
Brian Paulacbc1e02003-11-26 18:10:31 +0000171<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200172<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html">ClosedGL</a>
173is an OpenGL subset library for TI graphing calculators.
Brian Paul0c656042006-06-08 19:59:41 +0000174</p>
175
176<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000177There may be other open OpenGL implementations, but Mesa is the most
178popular and feature-complete.
Brian Paul0b27ace2003-03-08 17:38:57 +0000179</p>
180
Brian Paul65b79052004-11-22 17:49:15 +0000181
182
Brian Paul0b27ace2003-03-08 17:38:57 +0000183<br>
184<br>
185
186
Andreas Bollcc418882012-06-12 09:05:33 +0200187<h1 id="part2">2. Compilation and Installation Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000188
189
Andreas Bollcc418882012-06-12 09:05:33 +0200190<h2>2.1 What's the easiest way to install Mesa?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000191<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200192If you're using a Linux-based system, your distro CD most likely already
Brian Paul0b27ace2003-03-08 17:38:57 +0000193has Mesa packages (like RPM or DEB) which you can easily install.
Andreas Bollcc418882012-06-12 09:05:33 +0200194</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000195
196
Andreas Bollcc418882012-06-12 09:05:33 +0200197<h2>2.2 I get undefined symbols such as bgnpolygon, v3f, etc...</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000198<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200199You're application is written in IRIS GL, not OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000200IRIS GL was the predecessor to OpenGL and is a different thing (almost)
201entirely.
202Mesa's not the solution.
Andreas Bollcc418882012-06-12 09:05:33 +0200203</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000204
205
Andreas Bollcc418882012-06-12 09:05:33 +0200206<h2>2.3 Where is the GLUT library?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000207<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200208GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
José Fonseca9a7f84d2011-07-14 17:28:52 +0100209If you don't already have GLUT installed, you should grab
210<a href="http://freeglut.sourceforge.net/">freeglut</a>.
Andreas Bollcc418882012-06-12 09:05:33 +0200211</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000212
213
Andreas Bollcc418882012-06-12 09:05:33 +0200214<h2>2.4 Where is the GLw library?</h2>
Kenneth Graunkec5481922011-08-05 16:59:04 -0700215<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200216GLw (OpenGL widget library) is now available from a separate <a href="http://cgit.freedesktop.org/mesa/glw/">git repository</a>. Unless you're using very old Xt/Motif applications with OpenGL, you shouldn't need it.
217</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000218
Kenneth Graunkec5481922011-08-05 16:59:04 -0700219
Andreas Bollcc418882012-06-12 09:05:33 +0200220<h2>2.5 What's the proper place for the libraries and headers?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000221<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200222On Linux-based systems you'll want to follow the
Andreas Bolla73c59b2012-09-18 19:31:28 +0200223<a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html">Linux ABI</a> standard.
Brian Paul0b27ace2003-03-08 17:38:57 +0000224Basically you'll want the following:
225</p>
226<ul>
227<li>/usr/include/GL/gl.h - the main OpenGL header
228</li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
229</li><li>/usr/include/GL/glx.h - the OpenGL GLX header
230</li><li>/usr/include/GL/glext.h - the OpenGL extensions header
231</li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
232</li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
233</li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
234</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
235</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
236Mesa version number.
Brian Paul0b27ace2003-03-08 17:38:57 +0000237</li></ul>
238<p>
Andreas Boll8504f182012-09-20 16:23:15 +0200239After installing X.org and the DRI drivers, some of these files
Brian Paul0b27ace2003-03-08 17:38:57 +0000240may be symlinks into the /usr/X11R6/ tree.
241</p>
242<p>
243The old-style Makefile system doesn't install the Mesa libraries; it's
244up to you to copy them (and the headers) to the right place.
245</p>
246<p>
247The GLUT header and library should go in the same directories.
248</p>
249<br>
250<br>
251
252
Andreas Bollcc418882012-06-12 09:05:33 +0200253<h1 id="part3">3. Runtime / Rendering Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000254
Andreas Bollcc418882012-06-12 09:05:33 +0200255<h2>3.1 Rendering is slow / why isn't my graphics hardware being used?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000256<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200257Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
Brian Paul0b27ace2003-03-08 17:38:57 +0000258support for hardware acceleration (with the exception of the 3DFX Voodoo
259driver).
Andreas Bollcc418882012-06-12 09:05:33 +0200260</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000261<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200262What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
Brian Paul0b27ace2003-03-08 17:38:57 +0000263for your particular hardware.
Andreas Bollcc418882012-06-12 09:05:33 +0200264</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000265<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200266You can run the <code>glxinfo</code> program to learn about your OpenGL
Brian Paul0b27ace2003-03-08 17:38:57 +0000267library.
268Look for the GL_VENDOR and GL_RENDERER values.
269That will identify who's OpenGL library you're using and what sort of
270hardware it has detected.
Andreas Bollcc418882012-06-12 09:05:33 +0200271</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000272<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200273If your DRI-based driver isn't working, go to the
Andreas Boll8504f182012-09-20 16:23:15 +0200274<a href="http://dri.freedesktop.org/">DRI website</a> for trouble-shooting information.
Brian Paul0b27ace2003-03-08 17:38:57 +0000275</p>
276
277
278<h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
279<p>
280Make sure the ratio of the far to near clipping planes isn't too great.
281Look
Andreas Bolla73c59b2012-09-18 19:31:28 +0200282<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040">here</a>
283for details.
Brian Paul0b27ace2003-03-08 17:38:57 +0000284</p>
285<p>
286Mesa uses a 16-bit depth buffer by default which is smaller and faster
287to clear than a 32-bit buffer but not as accurate.
288If you need a deeper you can modify the parameters to
289<code> glXChooseVisual</code> in your code.
290</p>
291
292
293<h2>3.3 Why Isn't depth buffering working at all?</h2>
294<p>
295Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
296environment variable it will warn you about trying to enable depth testing
297when you don't have a depth buffer.
298</p>
299<p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
300with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
301called with a non-zero value for GLX_DEPTH_SIZE.
302</p>
303<p>This discussion applies to stencil buffers, accumulation buffers and
304alpha channels too.
305</p>
306
307
308<h2>3.4 Why does glGetString() always return NULL?</h2>
309<p>
310Be sure you have an active/current OpenGL rendering context before
311calling glGetString.
312</p>
313
314
315<h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
316<p>
317If you're trying to draw a filled region by using GL_POINTS or GL_LINES
318and seeing holes or gaps it's because of a float-to-int rounding problem.
319But this is not a bug.
320See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
321Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
322will fix the problem.
323</p>
324
Tom Fogal9a8781b2009-08-13 19:51:57 -0600325<h2>3.6 How can I change the maximum framebuffer size in Mesa's
326<tt>swrast</tt> backend?</h2>
327<p>
328These can be overridden by using the <tt>--with-max-width</tt> and
329<tt>--with-max-height</tt> options. The two need not be equal.
330</p><p>
331Do note that Mesa uses these values to size some internal buffers,
332so increasing these sizes will cause Mesa to require additional
333memory. Furthermore, increasing these limits beyond <tt>4096</tt>
334may introduce rasterization artifacts; see the leading comments in
335<tt>src/mesa/swrast/s_tritemp.h</tt>.
336</p>
337
Brian Paul0b27ace2003-03-08 17:38:57 +0000338<br>
339<br>
340
341
Andreas Bollcc418882012-06-12 09:05:33 +0200342<h1 id="part4">4. Developer Questions</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000343
Andreas Bollcc418882012-06-12 09:05:33 +0200344<h2>4.1 How can I contribute?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000345<p>
Andreas Boll5abb1f82012-09-19 18:22:37 +0200346First, join the <a href="lists.html">mesa-dev mailing list</a>.
Brian Pauld5299bf2006-08-21 14:26:06 +0000347That's where Mesa development is discussed.
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800348</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000349<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200350The <a href="http://www.opengl.org/documentation">
Brian Paul0b27ace2003-03-08 17:38:57 +0000351OpenGL Specification</a> is the bible for OpenGL implemention work.
352You should read it.
353</p>
354<p>Most of the Mesa development work involves implementing new OpenGL
355extensions, writing hardware drivers (for the DRI), and code optimization.
356</p>
357
358<h2>4.2 How do I write a new device driver?</h2>
359<p>
360Unfortunately, writing a device driver isn't easy.
361It requires detailed understanding of OpenGL, the Mesa code, and your
362target hardware/operating system.
3633D graphics are not simple.
364</p>
365<p>
366The best way to get started is to use an existing driver as your starting
367point.
368For a software driver, the X11 and OSMesa drivers are good examples.
369For a hardware driver, the Radeon and R200 DRI drivers are good examples.
370</p>
371<p>The DRI website has more information about writing hardware drivers.
372The process isn't well document because the Mesa driver interface changes
373over time, and we seldome have spare time for writing documentation.
374That being said, many people have managed to figure out the process.
375</p>
376<p>
377Joining the appropriate mailing lists and asking questions (and searching
378the archives) is a good way to get information.
379</p>
380
381
Brian Paul0c656042006-06-08 19:59:41 +0000382<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
Brian Paulfc528e22003-12-31 20:59:51 +0000383<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200384The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt">specification for the extension</a>
Brian Paulfc528e22003-12-31 20:59:51 +0000385indicates that there are intellectual property (IP) and/or patent issues
386to be dealt with.
387</p>
388<p>We've been unsucessful in getting a response from S3 (or whoever owns
389the IP nowadays) to indicate whether or not an open source project can
390implement the extension (specifically the compression/decompression
391algorithms).
392</p>
393<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200394In the mean time, a 3rd party <a href="http://dri.freedesktop.org/wiki/S3TC">
395plug-in library</a> is available.
Brian Paulfc528e22003-12-31 20:59:51 +0000396</p>
397
Andreas Bollb5da52a2012-09-18 18:57:02 +0200398</div>
Brian Paul0b27ace2003-03-08 17:38:57 +0000399</body>
400</html>