blob: 80f4a71dc43bbb751823970e2db1a83c1ff4cdba [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
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
Andreas Bollcc418882012-06-12 09:05:33 +020031<h1 id="part1">1. High-level Questions and Answers</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +000032
Andreas Bollcc418882012-06-12 09:05:33 +020033<h2>1.1 What is Mesa?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000034<p>
Andreas Bollcc418882012-06-12 09:05:33 +020035Mesa is an open-source implementation of the OpenGL specification.
Brian Paula376e332003-03-30 16:54:36 +000036OpenGL is a programming library for writing interactive 3D applications.
Andreas Bollcc418882012-06-12 09:05:33 +020037See the <a href="http://www.opengl.org/">OpenGL website</a> for more
Brian Paul0b27ace2003-03-08 17:38:57 +000038information.
39</p>
40<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000041Mesa 6.x supports the OpenGL 1.5 specification.
Brian Paul0b27ace2003-03-08 17:38:57 +000042</p>
43
44
45<h2>1.2 Does Mesa support/use graphics hardware?</h2>
46<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000047Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
Brian Pauld5299bf2006-08-21 14:26:06 +000048drivers for XFree86/X.org. See the <a href="http://dri.freedesktop.org/">DRI
Brian Paula376e332003-03-30 16:54:36 +000049website</a> for more information.
Brian Paul0b27ace2003-03-08 17:38:57 +000050</p>
51<p>
52There have been other hardware drivers for Mesa over the years (such as
53the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
54are the modern ones.
55</p>
56
Brian Paul65b79052004-11-22 17:49:15 +000057<h2>1.3 What purpose does Mesa serve today?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000058<p>
Brian Paula376e332003-03-30 16:54:36 +000059Hardware-accelerated OpenGL implementations are available for most popular
60operating systems today.
Brian Paul0b27ace2003-03-08 17:38:57 +000061Still, Mesa serves at least these purposes:
62</p>
63<ul>
Brian Paul7e4cc1c2005-10-24 23:33:27 +000064<li>Mesa is used as the core of the open-source XFree86/X.org DRI
65 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000066</li>
67<li>Mesa is quite portable and allows OpenGL to be used on systems
68 that have no other OpenGL solution.
69</li>
70<li>Software rendering with Mesa serves as a reference for validating the
Brian Paul0b27ace2003-03-08 17:38:57 +000071 hardware drivers.
Brian Paula376e332003-03-30 16:54:36 +000072</li>
73<li>A software implementation of OpenGL is useful for experimentation,
74 such as testing new rendering techniques.
75</li>
76<li>Mesa can render images with deep color channels: 16-bit integer
77 and 32-bit floating point color channels are supported.
Brian Paul0b27ace2003-03-08 17:38:57 +000078 This capability is only now appearing in hardware.
Brian Paula376e332003-03-30 16:54:36 +000079</li>
80<li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
Brian Paul0b27ace2003-03-08 17:38:57 +000081 changed for special needs (hardware limits are hard to overcome).
Brian Paula376e332003-03-30 16:54:36 +000082</li>
83</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000084
Brian Paul65b79052004-11-22 17:49:15 +000085
86<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
87<p>
88<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
Brian Paul7e4cc1c2005-10-24 23:33:27 +000089On systems running the X Window System it does all its rendering through
90the Xlib API:
Andreas Bolldf2be222012-06-12 09:05:22 +020091</p>
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>
Brian Paul65b79052004-11-22 17:49:15 +0000101<p>
102Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
103within the DRI (Direct Rendering Infrastructure):
104<ul>
105<li>The libGL.so library provides the GL and GLX API functions, a GLX
106 protocol encoder, and a device driver loader.
107<li>The device driver modules (such as r200_dri.so) contain a built-in
108 copy of the core Mesa code.
109<li>The X server loads the GLX module.
110 The GLX module decodes incoming GLX protocol and dispatches the commands
111 to a rendering module.
112 For the DRI, this module is basically a software Mesa renderer.
113</ul>
114
115
116
117<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000118<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000119This wasn't easy in the past.
120Now, the DRI drivers are included in the Mesa tree and can be compiled
121separately from the X server.
122Just follow the Mesa <a href="install.html">compilation instructions</a>.
Brian Paul824a4fc2003-08-06 19:05:26 +0000123</p>
124
Brian Paul0b27ace2003-03-08 17:38:57 +0000125
Brian Paul65b79052004-11-22 17:49:15 +0000126<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000127<p>
Brian Paul7df4f952003-11-25 21:13:26 +0000128Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
129target="_parent">
Brian Paul0b27ace2003-03-08 17:38:57 +0000130OpenGL Sample Implemenation (SI)</a> is available.
131The SI was written during the time that OpenGL was originally designed.
132Unfortunately, development of the SI has stagnated.
133Mesa is much more up to date with modern features and extensions.
134</p>
Brian Paul186d4d82004-04-27 12:55:08 +0000135
136<p>
137<a href="http://ogl-es.sourceforge.net" target="_parent">Vincent</a> is
138an open-source implementation of OpenGL ES for mobile devices.
139
Brian Paul0b27ace2003-03-08 17:38:57 +0000140<p>
Brian Paul7df4f952003-11-25 21:13:26 +0000141<a href="http://www.dsbox.com/minigl.html" target="_parent">miniGL</a>
142is a subset of OpenGL for PalmOS devices.
Brian Paul0b27ace2003-03-08 17:38:57 +0000143
Brian Paul7df4f952003-11-25 21:13:26 +0000144<p>
145<a href="http://fabrice.bellard.free.fr/TinyGL/"
146target="_parent">TinyGL</a> is a subset of OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000147</p>
Brian Paul7df4f952003-11-25 21:13:26 +0000148
149<p>
150<a href="http://softgl.studierstube.org/" target="_parent">SoftGL</a>
151is an OpenGL subset for mobile devices.
152</p>
153
Brian Paul0b27ace2003-03-08 17:38:57 +0000154<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000155<a href="http://chromium.sourceforge.net/" target="_parent">Chromium</a>
156isn't a conventional OpenGL implementation (it's layered upon OpenGL),
157but it does export the OpenGL API. It allows tiled rendering, sort-last
158rendering, etc.
159</p>
160
Brian Paulacbc1e02003-11-26 18:10:31 +0000161<p>
Brian Paul0c656042006-06-08 19:59:41 +0000162<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html"
163target="_parent">ClosedGL</a> is an OpenGL subset library for TI
164graphing calculators.
165</p>
166
167<p>
Brian Paulacbc1e02003-11-26 18:10:31 +0000168There may be other open OpenGL implementations, but Mesa is the most
169popular and feature-complete.
Brian Paul0b27ace2003-03-08 17:38:57 +0000170</p>
171
Brian Paul65b79052004-11-22 17:49:15 +0000172
173
Brian Paul0b27ace2003-03-08 17:38:57 +0000174<br>
175<br>
176
177
Andreas Bollcc418882012-06-12 09:05:33 +0200178<h1 id="part2">2. Compilation and Installation Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000179
180
Andreas Bollcc418882012-06-12 09:05:33 +0200181<h2>2.1 What's the easiest way to install Mesa?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000182<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200183If you're using a Linux-based system, your distro CD most likely already
Brian Paul0b27ace2003-03-08 17:38:57 +0000184has Mesa packages (like RPM or DEB) which you can easily install.
Andreas Bollcc418882012-06-12 09:05:33 +0200185</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000186
187
Andreas Bollcc418882012-06-12 09:05:33 +0200188<h2>2.2 I get undefined symbols such as bgnpolygon, v3f, etc...</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000189<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200190You're application is written in IRIS GL, not OpenGL.
Brian Paul0b27ace2003-03-08 17:38:57 +0000191IRIS GL was the predecessor to OpenGL and is a different thing (almost)
192entirely.
193Mesa's not the solution.
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.3 Where is the GLUT library?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000198<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200199GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
José Fonseca9a7f84d2011-07-14 17:28:52 +0100200If you don't already have GLUT installed, you should grab
201<a href="http://freeglut.sourceforge.net/">freeglut</a>.
Andreas Bollcc418882012-06-12 09:05:33 +0200202</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000203
204
Andreas Bollcc418882012-06-12 09:05:33 +0200205<h2>2.4 Where is the GLw library?</h2>
Kenneth Graunkec5481922011-08-05 16:59:04 -0700206<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200207GLw (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.
208</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000209
Kenneth Graunkec5481922011-08-05 16:59:04 -0700210
Andreas Bollcc418882012-06-12 09:05:33 +0200211<h2>2.5 What's the proper place for the libraries and headers?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000212<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200213On Linux-based systems you'll want to follow the
214<a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
Brian Paulfc528e22003-12-31 20:59:51 +0000215target="_parent">Linux ABI</a> standard.
Brian Paul0b27ace2003-03-08 17:38:57 +0000216Basically you'll want the following:
217</p>
218<ul>
219<li>/usr/include/GL/gl.h - the main OpenGL header
220</li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
221</li><li>/usr/include/GL/glx.h - the OpenGL GLX header
222</li><li>/usr/include/GL/glext.h - the OpenGL extensions header
223</li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
224</li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
225</li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
226</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
227</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
228Mesa version number.
Brian Paul0b27ace2003-03-08 17:38:57 +0000229</li></ul>
230<p>
Brian Paul7e4cc1c2005-10-24 23:33:27 +0000231After installing XFree86/X.org and the DRI drivers, some of these files
Brian Paul0b27ace2003-03-08 17:38:57 +0000232may be symlinks into the /usr/X11R6/ tree.
233</p>
234<p>
235The old-style Makefile system doesn't install the Mesa libraries; it's
236up to you to copy them (and the headers) to the right place.
237</p>
238<p>
239The GLUT header and library should go in the same directories.
240</p>
241<br>
242<br>
243
244
Andreas Bollcc418882012-06-12 09:05:33 +0200245<h1 id="part3">3. Runtime / Rendering Problems</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000246
Andreas Bollcc418882012-06-12 09:05:33 +0200247<h2>3.1 Rendering is slow / why isn't my graphics hardware being used?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000248<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200249Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
Brian Paul0b27ace2003-03-08 17:38:57 +0000250support for hardware acceleration (with the exception of the 3DFX Voodoo
251driver).
Andreas Bollcc418882012-06-12 09:05:33 +0200252</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000253<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200254What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
Brian Paul0b27ace2003-03-08 17:38:57 +0000255for your particular hardware.
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 +0200258You can run the <code>glxinfo</code> program to learn about your OpenGL
Brian Paul0b27ace2003-03-08 17:38:57 +0000259library.
260Look for the GL_VENDOR and GL_RENDERER values.
261That will identify who's OpenGL library you're using and what sort of
262hardware it has detected.
Andreas Bollcc418882012-06-12 09:05:33 +0200263</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000264<p>
Andreas Bollcc418882012-06-12 09:05:33 +0200265If your DRI-based driver isn't working, go to the
266<a href="http://dri.sf.net/" target="_parent">DRI website</a> for trouble-shooting information.
Brian Paul0b27ace2003-03-08 17:38:57 +0000267</p>
268
269
270<h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
271<p>
272Make sure the ratio of the far to near clipping planes isn't too great.
273Look
Brian Pauld5299bf2006-08-21 14:26:06 +0000274<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040"
275target="_parent"> here</a> for details.
Brian Paul0b27ace2003-03-08 17:38:57 +0000276</p>
277<p>
278Mesa uses a 16-bit depth buffer by default which is smaller and faster
279to clear than a 32-bit buffer but not as accurate.
280If you need a deeper you can modify the parameters to
281<code> glXChooseVisual</code> in your code.
282</p>
283
284
285<h2>3.3 Why Isn't depth buffering working at all?</h2>
286<p>
287Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
288environment variable it will warn you about trying to enable depth testing
289when you don't have a depth buffer.
290</p>
291<p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
292with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
293called with a non-zero value for GLX_DEPTH_SIZE.
294</p>
295<p>This discussion applies to stencil buffers, accumulation buffers and
296alpha channels too.
297</p>
298
299
300<h2>3.4 Why does glGetString() always return NULL?</h2>
301<p>
302Be sure you have an active/current OpenGL rendering context before
303calling glGetString.
304</p>
305
306
307<h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
308<p>
309If you're trying to draw a filled region by using GL_POINTS or GL_LINES
310and seeing holes or gaps it's because of a float-to-int rounding problem.
311But this is not a bug.
312See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
313Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
314will fix the problem.
315</p>
316
Tom Fogal9a8781b2009-08-13 19:51:57 -0600317<h2>3.6 How can I change the maximum framebuffer size in Mesa's
318<tt>swrast</tt> backend?</h2>
319<p>
320These can be overridden by using the <tt>--with-max-width</tt> and
321<tt>--with-max-height</tt> options. The two need not be equal.
322</p><p>
323Do note that Mesa uses these values to size some internal buffers,
324so increasing these sizes will cause Mesa to require additional
325memory. Furthermore, increasing these limits beyond <tt>4096</tt>
326may introduce rasterization artifacts; see the leading comments in
327<tt>src/mesa/swrast/s_tritemp.h</tt>.
328</p>
329
Brian Paul0b27ace2003-03-08 17:38:57 +0000330<br>
331<br>
332
333
Andreas Bollcc418882012-06-12 09:05:33 +0200334<h1 id="part4">4. Developer Questions</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +0000335
Andreas Bollcc418882012-06-12 09:05:33 +0200336<h2>4.1 How can I contribute?</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000337<p>
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800338First, join the <a href="http://www.mesa3d.org/lists.html">Mesa3d-dev
Brian Pauld5299bf2006-08-21 14:26:06 +0000339mailing list</a>.
340That's where Mesa development is discussed.
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800341</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000342<p>
Dan Nicholsonf71032b2007-12-14 09:59:16 -0800343The <a href="http://www.opengl.org/documentation" target="_parent">
Brian Paul0b27ace2003-03-08 17:38:57 +0000344OpenGL Specification</a> is the bible for OpenGL implemention work.
345You should read it.
346</p>
347<p>Most of the Mesa development work involves implementing new OpenGL
348extensions, writing hardware drivers (for the DRI), and code optimization.
349</p>
350
351<h2>4.2 How do I write a new device driver?</h2>
352<p>
353Unfortunately, writing a device driver isn't easy.
354It requires detailed understanding of OpenGL, the Mesa code, and your
355target hardware/operating system.
3563D graphics are not simple.
357</p>
358<p>
359The best way to get started is to use an existing driver as your starting
360point.
361For a software driver, the X11 and OSMesa drivers are good examples.
362For a hardware driver, the Radeon and R200 DRI drivers are good examples.
363</p>
364<p>The DRI website has more information about writing hardware drivers.
365The process isn't well document because the Mesa driver interface changes
366over time, and we seldome have spare time for writing documentation.
367That being said, many people have managed to figure out the process.
368</p>
369<p>
370Joining the appropriate mailing lists and asking questions (and searching
371the archives) is a good way to get information.
372</p>
373
374
Brian Paul0c656042006-06-08 19:59:41 +0000375<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
Brian Paulfc528e22003-12-31 20:59:51 +0000376<p>
377The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target="_parent">specification for the extension</a>
378indicates that there are intellectual property (IP) and/or patent issues
379to be dealt with.
380</p>
381<p>We've been unsucessful in getting a response from S3 (or whoever owns
382the IP nowadays) to indicate whether or not an open source project can
383implement the extension (specifically the compression/decompression
384algorithms).
385</p>
386<p>
Brian Paul0c656042006-06-08 19:59:41 +0000387In the mean time, a 3rd party <a href=
Andreas Boll297309c2012-06-25 21:52:51 +0200388"http://dri.freedesktop.org/wiki/S3TC"
Brian Paul0c656042006-06-08 19:59:41 +0000389target="_parent">plug-in library</a> is available.
Brian Paulfc528e22003-12-31 20:59:51 +0000390</p>
391
Brian Paul0b27ace2003-03-08 17:38:57 +0000392</body>
393</html>