3 <head><title>Mesa FAQ
</title></head>
5 <link rel=
"stylesheet" type=
"text/css" href=
"mesa.css"></head>
11 <h1>Mesa Frequently Asked Questions
</h1>
12 Last updated:
21 August
2006
18 <a href=
"#part1">1. High-level Questions and Answers
</a>
20 <a href=
"#part2">2. Compilation and Installation Problems
</a>
22 <a href=
"#part3">3. Runtime / Rendering Problems
</a>
24 <a href=
"#part4">4. Developer Questions
</a>
32 </a><h1><a name=
"part1">1. High-level Questions and Answers
</a></h1>
34 <h2><a name=
"part1">1.1 What is Mesa?
</a></h2>
36 <a name=
"part1">Mesa is an open-source implementation of the OpenGL specification.
37 OpenGL is a programming library for writing interactive
3D applications.
38 See the
</a><a href=
"http://www.opengl.org/">OpenGL website
</a> for more
42 Mesa
6.x supports the OpenGL
1.5 specification.
46 <h2>1.2 Does Mesa support/use graphics hardware?
</h2>
48 Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
49 drivers for XFree86/X.org. See the
<a href=
"http://dri.freedesktop.org/">DRI
50 website
</a> for more information.
53 There have been other hardware drivers for Mesa over the years (such as
54 the
3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
58 <h2>1.3 What purpose does Mesa serve today?
</h2>
60 Hardware-accelerated OpenGL implementations are available for most popular
61 operating systems today.
62 Still, Mesa serves at least these purposes:
65 <li>Mesa is used as the core of the open-source XFree86/X.org DRI
68 <li>Mesa is quite portable and allows OpenGL to be used on systems
69 that have no other OpenGL solution.
71 <li>Software rendering with Mesa serves as a reference for validating the
74 <li>A software implementation of OpenGL is useful for experimentation,
75 such as testing new rendering techniques.
77 <li>Mesa can render images with deep color channels:
16-bit integer
78 and
32-bit floating point color channels are supported.
79 This capability is only now appearing in hardware.
81 <li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
82 changed for special needs (hardware limits are hard to overcome).
87 <h2>1.4 What's the difference between
"Stand-Alone" Mesa and the DRI drivers?
</h2>
89 <em>Stand-alone Mesa
</em> is the original incarnation of Mesa.
90 On systems running the X Window System it does all its rendering through
93 <li>The GLX API is supported, but it's really just an emulation of the
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).
103 Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
104 within the DRI (Direct Rendering Infrastructure):
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.
118 <h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?
</h2>
120 This wasn't easy in the past.
121 Now, the DRI drivers are included in the Mesa tree and can be compiled
122 separately from the X server.
123 Just follow the Mesa
<a href=
"install.html">compilation instructions
</a>.
127 <h2>1.6 Are there other open-source implementations of OpenGL?
</h2>
129 Yes, SGI's
<a href=
"http://oss.sgi.com/projects/ogl-sample/index.html"
131 OpenGL Sample Implemenation (SI)
</a> is available.
132 The SI was written during the time that OpenGL was originally designed.
133 Unfortunately, development of the SI has stagnated.
134 Mesa is much more up to date with modern features and extensions.
138 <a href=
"http://ogl-es.sourceforge.net" target=
"_parent">Vincent
</a> is
139 an open-source implementation of OpenGL ES for mobile devices.
142 <a href=
"http://www.dsbox.com/minigl.html" target=
"_parent">miniGL
</a>
143 is a subset of OpenGL for PalmOS devices.
146 <a href=
"http://fabrice.bellard.free.fr/TinyGL/"
147 target=
"_parent">TinyGL
</a> is a subset of OpenGL.
151 <a href=
"http://softgl.studierstube.org/" target=
"_parent">SoftGL
</a>
152 is an OpenGL subset for mobile devices.
156 <a href=
"http://chromium.sourceforge.net/" target=
"_parent">Chromium
</a>
157 isn't a conventional OpenGL implementation (it's layered upon OpenGL),
158 but it does export the OpenGL API. It allows tiled rendering, sort-last
163 <a href=
"http://www.ticalc.org/archives/files/fileinfo/361/36173.html"
164 target=
"_parent">ClosedGL
</a> is an OpenGL subset library for TI
165 graphing calculators.
169 There may be other open OpenGL implementations, but Mesa is the most
170 popular and feature-complete.
180 </a><h1><a name=
"part2">2. Compilation and Installation Problems
</a></h1>
183 <h2><a name=
"part2">2.1 What's the easiest way to install Mesa?
</a></h2>
185 <a name=
"part2">If you're using a Linux-based system, your distro CD most likely already
186 has Mesa packages (like RPM or DEB) which you can easily install.
190 <h2><a name=
"part2">2.2 I get undefined symbols such as bgnpolygon, v3f, etc...
</a></h2>
192 <a name=
"part2">You're application is written in IRIS GL, not OpenGL.
193 IRIS GL was the predecessor to OpenGL and is a different thing (almost)
195 Mesa's not the solution.
199 <h2><a name=
"part2">2.3 Where is the GLUT library?
</a></h2>
201 <a name=
"part2">GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
202 If you don't already have GLUT installed, you should grab
203 <a href=
"http://freeglut.sourceforge.net/">freeglut
</a>.
207 <h2><a name=
"part2">2.4 Where is the GLw library?
</a></h2>
209 <a name=
"part2">GLw (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 <h2><a name=
"part2">2.5 What's the proper place for the libraries and headers?
</a></h2>
215 <a name=
"part2">On Linux-based systems you'll want to follow the
216 </a><a href=
"http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
217 target=
"_parent">Linux ABI
</a> standard.
218 Basically you'll want the following:
221 <li>/usr/include/GL/gl.h - the main OpenGL header
222 </li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
223 </li><li>/usr/include/GL/glx.h - the OpenGL GLX header
224 </li><li>/usr/include/GL/glext.h - the OpenGL extensions header
225 </li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
226 </li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
227 </li><li>/usr/lib/libGL.so - a symlink to libGL.so
.1
228 </li><li>/usr/lib/libGL.so
.1 - a symlink to libGL.so
.1.xyz
229 </li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
231 </li><li>/usr/lib/libGLU.so - a symlink to libGLU.so
.1
232 </li><li>/usr/lib/libGLU.so
.1 - a symlink to libGLU.so
.1.3.xyz
233 </li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
237 After installing XFree86/X.org and the DRI drivers, some of these files
238 may be symlinks into the /usr/X11R6/ tree.
241 The old-style Makefile system doesn't install the Mesa libraries; it's
242 up to you to copy them (and the headers) to the right place.
245 The GLUT header and library should go in the same directories.
252 </a><h1><a name=
"part3">3. Runtime / Rendering Problems
</a></h1>
254 <h2><a name=
"part3">3.1 Rendering is slow / why isn't my graphics hardware being used?
</a></h2>
256 <a name=
"part3">Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
257 support for hardware acceleration (with the exception of the
3DFX Voodoo
261 <a name=
"part3">What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
262 for your particular hardware.
265 <a name=
"part3">You can run the
<code>glxinfo
</code> program to learn about your OpenGL
267 Look for the GL_VENDOR and GL_RENDERER values.
268 That will identify who's OpenGL library you're using and what sort of
269 hardware it has detected.
272 <a name=
"part3">If your DRI-based driver isn't working, go to the
273 </a><a href=
"http://dri.sf.net/" target=
"_parent">DRI website
</a> for trouble-shooting information.
277 <h2>3.2 I'm seeing errors in depth (Z) buffering. Why?
</h2>
279 Make sure the ratio of the far to near clipping planes isn't too great.
281 <a href=
"http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040"
282 target=
"_parent"> here
</a> for details.
285 Mesa uses a
16-bit depth buffer by default which is smaller and faster
286 to clear than a
32-bit buffer but not as accurate.
287 If you need a deeper you can modify the parameters to
288 <code> glXChooseVisual
</code> in your code.
292 <h2>3.3 Why Isn't depth buffering working at all?
</h2>
294 Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
295 environment variable it will warn you about trying to enable depth testing
296 when you don't have a depth buffer.
298 <p>Specifically, make sure
<code>glutInitDisplayMode
</code> is being called
299 with
<code>GLUT_DEPTH
</code> or
<code>glXChooseVisual
</code> is being
300 called with a non-zero value for GLX_DEPTH_SIZE.
302 <p>This discussion applies to stencil buffers, accumulation buffers and
307 <h2>3.4 Why does glGetString() always return NULL?
</h2>
309 Be sure you have an active/current OpenGL rendering context before
314 <h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels
</h2>
316 If you're trying to draw a filled region by using GL_POINTS or GL_LINES
317 and seeing holes or gaps it's because of a float-to-int rounding problem.
318 But this is not a bug.
319 See Appendix H of the OpenGL Programming Guide -
"OpenGL Correctness Tips".
320 Basically, applying a translation of (
0.375,
0.375,
0.0) to your coordinates
321 will fix the problem.
324 <h2>3.6 How can I change the maximum framebuffer size in Mesa's
325 <tt>swrast
</tt> backend?
</h2>
327 These can be overridden by using the
<tt>--with-max-width
</tt> and
328 <tt>--with-max-height
</tt> options. The two need not be equal.
330 Do note that Mesa uses these values to size some internal buffers,
331 so increasing these sizes will cause Mesa to require additional
332 memory. Furthermore, increasing these limits beyond
<tt>4096</tt>
333 may introduce rasterization artifacts; see the leading comments in
334 <tt>src/mesa/swrast/s_tritemp.h
</tt>.
342 </a><h1><a name=
"part4">4. Developer Questions
</a></h1>
344 <h2>4.1 How can I contribute?
</a></h2>
346 First, join the
<a href=
"http://www.mesa3d.org/lists.html">Mesa3d-dev
348 That's where Mesa development is discussed.
351 The
<a href=
"http://www.opengl.org/documentation" target=
"_parent">
352 OpenGL Specification
</a> is the bible for OpenGL implemention work.
355 <p>Most of the Mesa development work involves implementing new OpenGL
356 extensions, writing hardware drivers (for the DRI), and code optimization.
359 <h2>4.2 How do I write a new device driver?
</h2>
361 Unfortunately, writing a device driver isn't easy.
362 It requires detailed understanding of OpenGL, the Mesa code, and your
363 target hardware/operating system.
364 3D graphics are not simple.
367 The best way to get started is to use an existing driver as your starting
369 For a software driver, the X11 and OSMesa drivers are good examples.
370 For a hardware driver, the Radeon and R200 DRI drivers are good examples.
372 <p>The DRI website has more information about writing hardware drivers.
373 The process isn't well document because the Mesa driver interface changes
374 over time, and we seldome have spare time for writing documentation.
375 That being said, many people have managed to figure out the process.
378 Joining the appropriate mailing lists and asking questions (and searching
379 the archives) is a good way to get information.
383 <h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?
</h2>
385 The
<a href=
"http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target=
"_parent">specification for the extension
</a>
386 indicates that there are intellectual property (IP) and/or patent issues
389 <p>We've been unsucessful in getting a response from S3 (or whoever owns
390 the IP nowadays) to indicate whether or not an open source project can
391 implement the extension (specifically the compression/decompression
395 In the mean time, a
3rd party
<a href=
396 "http://homepage.hispeed.ch/rscheidegger/dri_experimental/s3tc_index.html"
397 target=
"_parent">plug-in library
</a> is available.