blob: 97b6491a7bd2aaf6d47abc3810988221e9ae6445 [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 Boll5abb1f82012-09-19 18:22:37 +020019Last updated: 19 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
Brian Pauld5299bf2006-08-21 14:26:06 +000055drivers for XFree86/X.org. See the <a href="http://dri.freedesktop.org/">DRI
Brian Paula376e332003-03-30 16:54:36 +000056website</a> for more information.
Brian Paul0b27ace2003-03-08 17:38:57 +000057</p>
58<p>
59There have been other hardware drivers for Mesa over the years (such as
60the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
61are the modern ones.
62</p>
63
Brian Paul65b79052004-11-22 17:49:15 +000064<h2>1.3 What purpose does Mesa serve today?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000065<p>
Brian Paula376e332003-03-30 16:54:36 +000066Hardware-accelerated OpenGL implementations are available for most popular
67operating systems today.
Brian Paul0b27ace2003-03-08 17:38:57 +000068Still, Mesa serves at least these purposes:
69</p>
70<ul>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000071<li>Mesa is used as the core of the open-source XFree86/X.org DRI
72 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000073</li>
74<li>Mesa is quite portable and allows OpenGL to be used on systems
75 that have no other OpenGL solution.
76</li>
77<li>Software rendering with Mesa serves as a reference for validating the
Brian Paul0b27ace2003-03-08 17:38:57 +000078 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000079</li>
80<li>A software implementation of OpenGL is useful for experimentation,
81 such as testing new rendering techniques.
82</li>
83<li>Mesa can render images with deep color channels: 16-bit integer
84 and 32-bit floating point color channels are supported.
Brian Paul0b27ace2003-03-08 17:38:57 +000085 This capability is only now appearing in hardware.
Brian Paula376e332003-03-30 16:54:36 +000086</li>
87<li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
Brian Paul0b27ace2003-03-08 17:38:57 +000088 changed for special needs (hardware limits are hard to overcome).
Brian Paula376e332003-03-30 16:54:36 +000089</li>
90</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000091
Brian Paul65b79052004-11-22 17:49:15 +000092
Andreas Boll5abb1f82012-09-19 18:22:37 +020093<h2>1.4 What's the difference between "Stand-Alone" Mesa and the DRI drivers?</h2>
Brian Paul65b79052004-11-22 17:49:15 +000094<p>
95<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
Brian Paul7e4cc1c2005-10-24 23:33:27 +000096On systems running the X Window System it does all its rendering through
97the Xlib API:
Andreas Bolldf2be222012-06-12 09:05:22 +020098</p>
Brian Paul65b79052004-11-22 17:49:15 +000099<ul>
100<li>The GLX API is supported, but it's really just an emulation of the
101 real thing.
102<li>The GLX wire protocol is not supported and there's no OpenGL extension
103 loaded by the X server.
104<li>There is no hardware acceleration.
105<li>The OpenGL library, libGL.so, contains everything (the programming API,
106 the GLX functions and all the rendering code).
107</ul>
Brian Paul65b79052004-11-22 17:49:15 +0000108<p>
109Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
110within the DRI (Direct Rendering Infrastructure):
111<ul>
112<li>The libGL.so library provides the GL and GLX API functions, a GLX
113 protocol encoder, and a device driver loader.
114<li>The device driver modules (such as r200_dri.so) contain a built-in
115 copy of the core Mesa code.
116<li>The X server loads the GLX module.
117 The GLX module decodes incoming GLX protocol and dispatches the commands
118 to a rendering module.
119 For the DRI, this module is basically a software Mesa renderer.
120</ul>
121
122
123
124<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000125<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000126This wasn't easy in the past.
127Now, the DRI drivers are included in the Mesa tree and can be compiled
128separately from the X server.
129Just follow the Mesa <a href="install.html">compilation instructions</a>.
Brian Paul824a4fc2003-08-06 19:05:26 +0000130</p>
131
Brian Paul0b27ace2003-03-08 17:38:57 +0000132
Brian Paul65b79052004-11-22 17:49:15 +0000133<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000134<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200135Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
Brian Paul0b27ace2003-03-08 17:38:57 +0000136OpenGL Sample Implemenation (SI)</a> is available.
137The SI was written during the time that OpenGL was originally designed.
138Unfortunately, development of the SI has stagnated.
139Mesa is much more up to date with modern features and extensions.
140</p>
Brian Paul186d4d82004-04-27 12:55:08 +0000141
142<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200143<a href="http://ogl-es.sourceforge.net">Vincent</a> is
Brian Paul186d4d82004-04-27 12:55:08 +0000144an open-source implementation of OpenGL ES for mobile devices.
145
Brian Paul0b27ace2003-03-08 17:38:57 +0000146<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200147<a href="http://www.dsbox.com/minigl.html">miniGL</a>
Brian Paul7df4f952003-11-25 21:13:26 +0000148is a subset of OpenGL for PalmOS devices.
Brian Paul0b27ace2003-03-08 17:38:57 +0000149
Brian Paul7df4f952003-11-25 21:13:26 +0000150<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200151<a href="http://fabrice.bellard.free.fr/TinyGL/">TinyGL</a>
152is a subset of OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000153</p>
Brian Paul7df4f952003-11-25 21:13:26 +0000154
155<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200156<a href="http://softgl.studierstube.org/">SoftGL</a>
Brian Paul7df4f952003-11-25 21:13:26 +0000157is an OpenGL subset for mobile devices.
158</p>
159
Brian Paul0b27ace2003-03-08 17:38:57 +0000160<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200161<a href="http://chromium.sourceforge.net/">Chromium</a>
Brian Paulacbc1e02003-11-26 18:10:31 +0000162isn't a conventional OpenGL implementation (it's layered upon OpenGL),
163but it does export the OpenGL API. It allows tiled rendering, sort-last
164rendering, etc.
165</p>
166
Brian Paulacbc1e02003-11-26 18:10:31 +0000167<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200168<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html">ClosedGL</a>
169is an OpenGL subset library for TI graphing calculators.
Brian Paul0c656042006-06-08 19:59:41 +0000170</p>
171
172<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000173There may be other open OpenGL implementations, but Mesa is the most
174popular and feature-complete.
Brian Paul0b27ace2003-03-08 17:38:57 +0000175</p>
176
Brian Paul65b79052004-11-22 17:49:15 +0000177
178
Brian Paul0b27ace2003-03-08 17:38:57 +0000179<br>
180<br>
181
182
Andreas Bollcc418882012-06-12 09:05:33 +0200183<h1 id="part2">2. Compilation and Installation Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000184
185
Andreas Bollcc418882012-06-12 09:05:33 +0200186<h2>2.1 What's the easiest way to install Mesa?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000187<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200188If you're using a Linux-based system, your distro CD most likely already
Brian Paul0b27ace2003-03-08 17:38:57 +0000189has Mesa packages (like RPM or DEB) which you can easily install.
Andreas Bollcc418882012-06-12 09:05:33 +0200190</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000191
192
Andreas Bollcc418882012-06-12 09:05:33 +0200193<h2>2.2 I get undefined symbols such as bgnpolygon, v3f, etc...</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000194<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200195You're application is written in IRIS GL, not OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000196IRIS GL was the predecessor to OpenGL and is a different thing (almost)
197entirely.
198Mesa's not the solution.
Andreas Bollcc418882012-06-12 09:05:33 +0200199</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000200
201
Andreas Bollcc418882012-06-12 09:05:33 +0200202<h2>2.3 Where is the GLUT library?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000203<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200204GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
José Fonseca9a7f84d2011-07-14 17:28:52 +0100205If you don't already have GLUT installed, you should grab
206<a href="http://freeglut.sourceforge.net/">freeglut</a>.
Andreas Bollcc418882012-06-12 09:05:33 +0200207</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000208
209
Andreas Bollcc418882012-06-12 09:05:33 +0200210<h2>2.4 Where is the GLw library?</h2>
Kenneth Graunkec5481922011-08-05 16:59:04 -0700211<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200212GLw (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.
213</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000214
Kenneth Graunkec5481922011-08-05 16:59:04 -0700215
Andreas Bollcc418882012-06-12 09:05:33 +0200216<h2>2.5 What's the proper place for the libraries and headers?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000217<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200218On Linux-based systems you'll want to follow the
Andreas Bolla73c59b2012-09-18 19:31:28 +0200219<a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html">Linux ABI</a> standard.
Brian Paul0b27ace2003-03-08 17:38:57 +0000220Basically you'll want the following:
221</p>
222<ul>
223<li>/usr/include/GL/gl.h - the main OpenGL header
224</li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
225</li><li>/usr/include/GL/glx.h - the OpenGL GLX header
226</li><li>/usr/include/GL/glext.h - the OpenGL extensions header
227</li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
228</li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
229</li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
230</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
231</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
232Mesa version number.
Brian Paul0b27ace2003-03-08 17:38:57 +0000233</li></ul>
234<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000235After installing XFree86/X.org and the DRI drivers, some of these files
Brian Paul0b27ace2003-03-08 17:38:57 +0000236may be symlinks into the /usr/X11R6/ tree.
237</p>
238<p>
239The old-style Makefile system doesn't install the Mesa libraries; it's
240up to you to copy them (and the headers) to the right place.
241</p>
242<p>
243The GLUT header and library should go in the same directories.
244</p>
245<br>
246<br>
247
248
Andreas Bollcc418882012-06-12 09:05:33 +0200249<h1 id="part3">3. Runtime / Rendering Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000250
Andreas Bollcc418882012-06-12 09:05:33 +0200251<h2>3.1 Rendering is slow / why isn't my graphics hardware being used?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000252<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200253Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
Brian Paul0b27ace2003-03-08 17:38:57 +0000254support for hardware acceleration (with the exception of the 3DFX Voodoo
255driver).
Andreas Bollcc418882012-06-12 09:05:33 +0200256</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000257<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200258What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
Brian Paul0b27ace2003-03-08 17:38:57 +0000259for your particular hardware.
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 +0200262You can run the <code>glxinfo</code> program to learn about your OpenGL
Brian Paul0b27ace2003-03-08 17:38:57 +0000263library.
264Look for the GL_VENDOR and GL_RENDERER values.
265That will identify who's OpenGL library you're using and what sort of
266hardware it has detected.
Andreas Bollcc418882012-06-12 09:05:33 +0200267</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000268<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200269If your DRI-based driver isn't working, go to the
Andreas Bolla73c59b2012-09-18 19:31:28 +0200270<a href="http://dri.sf.net/">DRI website</a> for trouble-shooting information.
Brian Paul0b27ace2003-03-08 17:38:57 +0000271</p>
272
273
274<h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
275<p>
276Make sure the ratio of the far to near clipping planes isn't too great.
277Look
Andreas Bolla73c59b2012-09-18 19:31:28 +0200278<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040">here</a>
279for details.
Brian Paul0b27ace2003-03-08 17:38:57 +0000280</p>
281<p>
282Mesa uses a 16-bit depth buffer by default which is smaller and faster
283to clear than a 32-bit buffer but not as accurate.
284If you need a deeper you can modify the parameters to
285<code> glXChooseVisual</code> in your code.
286</p>
287
288
289<h2>3.3 Why Isn't depth buffering working at all?</h2>
290<p>
291Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
292environment variable it will warn you about trying to enable depth testing
293when you don't have a depth buffer.
294</p>
295<p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
296with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
297called with a non-zero value for GLX_DEPTH_SIZE.
298</p>
299<p>This discussion applies to stencil buffers, accumulation buffers and
300alpha channels too.
301</p>
302
303
304<h2>3.4 Why does glGetString() always return NULL?</h2>
305<p>
306Be sure you have an active/current OpenGL rendering context before
307calling glGetString.
308</p>
309
310
311<h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
312<p>
313If you're trying to draw a filled region by using GL_POINTS or GL_LINES
314and seeing holes or gaps it's because of a float-to-int rounding problem.
315But this is not a bug.
316See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
317Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
318will fix the problem.
319</p>
320
Tom Fogal9a8781b2009-08-13 19:51:57 -0600321<h2>3.6 How can I change the maximum framebuffer size in Mesa's
322<tt>swrast</tt> backend?</h2>
323<p>
324These can be overridden by using the <tt>--with-max-width</tt> and
325<tt>--with-max-height</tt> options. The two need not be equal.
326</p><p>
327Do note that Mesa uses these values to size some internal buffers,
328so increasing these sizes will cause Mesa to require additional
329memory. Furthermore, increasing these limits beyond <tt>4096</tt>
330may introduce rasterization artifacts; see the leading comments in
331<tt>src/mesa/swrast/s_tritemp.h</tt>.
332</p>
333
Brian Paul0b27ace2003-03-08 17:38:57 +0000334<br>
335<br>
336
337
Andreas Bollcc418882012-06-12 09:05:33 +0200338<h1 id="part4">4. Developer Questions</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000339
Andreas Bollcc418882012-06-12 09:05:33 +0200340<h2>4.1 How can I contribute?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000341<p>
Andreas Boll5abb1f82012-09-19 18:22:37 +0200342First, join the <a href="lists.html">mesa-dev mailing list</a>.
Brian Pauld5299bf2006-08-21 14:26:06 +0000343That's where Mesa development is discussed.
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800344</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000345<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200346The <a href="http://www.opengl.org/documentation">
Brian Paul0b27ace2003-03-08 17:38:57 +0000347OpenGL Specification</a> is the bible for OpenGL implemention work.
348You should read it.
349</p>
350<p>Most of the Mesa development work involves implementing new OpenGL
351extensions, writing hardware drivers (for the DRI), and code optimization.
352</p>
353
354<h2>4.2 How do I write a new device driver?</h2>
355<p>
356Unfortunately, writing a device driver isn't easy.
357It requires detailed understanding of OpenGL, the Mesa code, and your
358target hardware/operating system.
3593D graphics are not simple.
360</p>
361<p>
362The best way to get started is to use an existing driver as your starting
363point.
364For a software driver, the X11 and OSMesa drivers are good examples.
365For a hardware driver, the Radeon and R200 DRI drivers are good examples.
366</p>
367<p>The DRI website has more information about writing hardware drivers.
368The process isn't well document because the Mesa driver interface changes
369over time, and we seldome have spare time for writing documentation.
370That being said, many people have managed to figure out the process.
371</p>
372<p>
373Joining the appropriate mailing lists and asking questions (and searching
374the archives) is a good way to get information.
375</p>
376
377
Brian Paul0c656042006-06-08 19:59:41 +0000378<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
Brian Paulfc528e22003-12-31 20:59:51 +0000379<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200380The <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 +0000381indicates that there are intellectual property (IP) and/or patent issues
382to be dealt with.
383</p>
384<p>We've been unsucessful in getting a response from S3 (or whoever owns
385the IP nowadays) to indicate whether or not an open source project can
386implement the extension (specifically the compression/decompression
387algorithms).
388</p>
389<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200390In the mean time, a 3rd party <a href="http://dri.freedesktop.org/wiki/S3TC">
391plug-in library</a> is available.
Brian Paulfc528e22003-12-31 20:59:51 +0000392</p>
393
Andreas Bollb5da52a2012-09-18 18:57:02 +0200394</div>
Brian Paul0b27ace2003-03-08 17:38:57 +0000395</body>
396</html>