faq.html revision 1.1 1 1.1 mrg <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 1.1 mrg <html lang="en">
3 1.1 mrg <head>
4 1.1 mrg <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 1.1 mrg <title>Mesa FAQ</title>
6 1.1 mrg <link rel="stylesheet" type="text/css" href="mesa.css">
7 1.1 mrg </head>
8 1.1 mrg <body>
9 1.1 mrg
10 1.1 mrg <div class="header">
11 1.1 mrg <h1>The Mesa 3D Graphics Library</h1>
12 1.1 mrg </div>
13 1.1 mrg
14 1.1 mrg <iframe src="contents.html"></iframe>
15 1.1 mrg <div class="content">
16 1.1 mrg
17 1.1 mrg <center>
18 1.1 mrg <h1>Mesa Frequently Asked Questions</h1>
19 1.1 mrg Last updated: 9 October 2012
20 1.1 mrg </center>
21 1.1 mrg
22 1.1 mrg <br>
23 1.1 mrg <br>
24 1.1 mrg <h2>Index</h2>
25 1.1 mrg <a href="#part1">1. High-level Questions and Answers</a>
26 1.1 mrg <br>
27 1.1 mrg <a href="#part2">2. Compilation and Installation Problems</a>
28 1.1 mrg <br>
29 1.1 mrg <a href="#part3">3. Runtime / Rendering Problems</a>
30 1.1 mrg <br>
31 1.1 mrg <a href="#part4">4. Developer Questions</a>
32 1.1 mrg <br>
33 1.1 mrg <br>
34 1.1 mrg <br>
35 1.1 mrg
36 1.1 mrg
37 1.1 mrg
38 1.1 mrg <h1 id="part1">1. High-level Questions and Answers</h1>
39 1.1 mrg
40 1.1 mrg <h2>1.1 What is Mesa?</h2>
41 1.1 mrg <p>
42 1.1 mrg Mesa is an open-source implementation of the OpenGL specification.
43 1.1 mrg OpenGL is a programming library for writing interactive 3D applications.
44 1.1 mrg See the <a href="http://www.opengl.org/">OpenGL website</a> for more
45 1.1 mrg information.
46 1.1 mrg </p>
47 1.1 mrg <p>
48 1.1 mrg Mesa 9.x supports the OpenGL 3.1 specification.
49 1.1 mrg </p>
50 1.1 mrg
51 1.1 mrg
52 1.1 mrg <h2>1.2 Does Mesa support/use graphics hardware?</h2>
53 1.1 mrg <p>
54 1.1 mrg Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
55 1.1 mrg drivers for X.org.
56 1.1 mrg </p>
57 1.1 mrg <ul>
58 1.1 mrg <li>See the <a href="http://dri.freedesktop.org/">DRI website</a>
59 1.1 mrg for more information.</li>
60 1.1 mrg <li>See <a href="http://intellinuxgraphics.org">intellinuxgraphics.org</a>
61 1.1 mrg for more information about Intel drivers.</li>
62 1.1 mrg <li>See <a href="http://nouveau.freedesktop.org">nouveau.freedesktop.org</a>
63 1.1 mrg for more information about Nouveau drivers.</li>
64 1.1 mrg <li>See <a href="http://www.x.org/wiki/RadeonFeature">www.x.org/wiki/RadeonFeature</a>
65 1.1 mrg for more information about Radeon drivers.</li>
66 1.1 mrg </ul>
67 1.1 mrg
68 1.1 mrg <h2>1.3 What purpose does Mesa serve today?</h2>
69 1.1 mrg <p>
70 1.1 mrg Hardware-accelerated OpenGL implementations are available for most popular
71 1.1 mrg operating systems today.
72 1.1 mrg Still, Mesa serves at least these purposes:
73 1.1 mrg </p>
74 1.1 mrg <ul>
75 1.1 mrg <li>Mesa is used as the core of the open-source X.org DRI
76 1.1 mrg hardware drivers.
77 1.1 mrg </li>
78 1.1 mrg <li>Mesa is quite portable and allows OpenGL to be used on systems
79 1.1 mrg that have no other OpenGL solution.
80 1.1 mrg </li>
81 1.1 mrg <li>Software rendering with Mesa serves as a reference for validating the
82 1.1 mrg hardware drivers.
83 1.1 mrg </li>
84 1.1 mrg <li>A software implementation of OpenGL is useful for experimentation,
85 1.1 mrg such as testing new rendering techniques.
86 1.1 mrg </li>
87 1.1 mrg <li>Mesa can render images with deep color channels: 16-bit integer
88 1.1 mrg and 32-bit floating point color channels are supported.
89 1.1 mrg This capability is only now appearing in hardware.
90 1.1 mrg </li>
91 1.1 mrg <li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
92 1.1 mrg changed for special needs (hardware limits are hard to overcome).
93 1.1 mrg </li>
94 1.1 mrg </ul>
95 1.1 mrg
96 1.1 mrg
97 1.1 mrg <h2>1.4 What's the difference between "Stand-Alone" Mesa and the DRI drivers?</h2>
98 1.1 mrg <p>
99 1.1 mrg <em>Stand-alone Mesa</em> is the original incarnation of Mesa.
100 1.1 mrg On systems running the X Window System it does all its rendering through
101 1.1 mrg the Xlib API:
102 1.1 mrg </p>
103 1.1 mrg <ul>
104 1.1 mrg <li>The GLX API is supported, but it's really just an emulation of the
105 1.1 mrg real thing.
106 1.1 mrg <li>The GLX wire protocol is not supported and there's no OpenGL extension
107 1.1 mrg loaded by the X server.
108 1.1 mrg <li>There is no hardware acceleration.
109 1.1 mrg <li>The OpenGL library, libGL.so, contains everything (the programming API,
110 1.1 mrg the GLX functions and all the rendering code).
111 1.1 mrg </ul>
112 1.1 mrg <p>
113 1.1 mrg Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
114 1.1 mrg within the DRI (Direct Rendering Infrastructure):
115 1.1 mrg <ul>
116 1.1 mrg <li>The libGL.so library provides the GL and GLX API functions, a GLX
117 1.1 mrg protocol encoder, and a device driver loader.
118 1.1 mrg <li>The device driver modules (such as r200_dri.so) contain a built-in
119 1.1 mrg copy of the core Mesa code.
120 1.1 mrg <li>The X server loads the GLX module.
121 1.1 mrg The GLX module decodes incoming GLX protocol and dispatches the commands
122 1.1 mrg to a rendering module.
123 1.1 mrg For the DRI, this module is basically a software Mesa renderer.
124 1.1 mrg </ul>
125 1.1 mrg
126 1.1 mrg
127 1.1 mrg
128 1.1 mrg <h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
129 1.1 mrg <p>
130 1.1 mrg This wasn't easy in the past.
131 1.1 mrg Now, the DRI drivers are included in the Mesa tree and can be compiled
132 1.1 mrg separately from the X server.
133 1.1 mrg Just follow the Mesa <a href="install.html">compilation instructions</a>.
134 1.1 mrg </p>
135 1.1 mrg
136 1.1 mrg
137 1.1 mrg <h2>1.6 Are there other open-source implementations of OpenGL?</h2>
138 1.1 mrg <p>
139 1.1 mrg Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
140 1.1 mrg OpenGL Sample Implementation (SI)</a> is available.
141 1.1 mrg The SI was written during the time that OpenGL was originally designed.
142 1.1 mrg Unfortunately, development of the SI has stagnated.
143 1.1 mrg Mesa is much more up to date with modern features and extensions.
144 1.1 mrg </p>
145 1.1 mrg
146 1.1 mrg <p>
147 1.1 mrg <a href="http://sourceforge.net/projects/ogl-es/">Vincent</a> is
148 1.1 mrg an open-source implementation of OpenGL ES for mobile devices.
149 1.1 mrg
150 1.1 mrg <p>
151 1.1 mrg <a href="http://www.dsbox.com/minigl.html">miniGL</a>
152 1.1 mrg is a subset of OpenGL for PalmOS devices.
153 1.1 mrg
154 1.1 mrg <p>
155 1.1 mrg <a href="http://bellard.org/TinyGL/">TinyGL</a>
156 1.1 mrg is a subset of OpenGL.
157 1.1 mrg </p>
158 1.1 mrg
159 1.1 mrg <p>
160 1.1 mrg <a href="http://sourceforge.net/projects/softgl/">SoftGL</a>
161 1.1 mrg is an OpenGL subset for mobile devices.
162 1.1 mrg </p>
163 1.1 mrg
164 1.1 mrg <p>
165 1.1 mrg <a href="http://chromium.sourceforge.net/">Chromium</a>
166 1.1 mrg isn't a conventional OpenGL implementation (it's layered upon OpenGL),
167 1.1 mrg but it does export the OpenGL API. It allows tiled rendering, sort-last
168 1.1 mrg rendering, etc.
169 1.1 mrg </p>
170 1.1 mrg
171 1.1 mrg <p>
172 1.1 mrg <a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html">ClosedGL</a>
173 1.1 mrg is an OpenGL subset library for TI graphing calculators.
174 1.1 mrg </p>
175 1.1 mrg
176 1.1 mrg <p>
177 1.1 mrg There may be other open OpenGL implementations, but Mesa is the most
178 1.1 mrg popular and feature-complete.
179 1.1 mrg </p>
180 1.1 mrg
181 1.1 mrg
182 1.1 mrg
183 1.1 mrg <br>
184 1.1 mrg <br>
185 1.1 mrg
186 1.1 mrg
187 1.1 mrg <h1 id="part2">2. Compilation and Installation Problems</h1>
188 1.1 mrg
189 1.1 mrg
190 1.1 mrg <h2>2.1 What's the easiest way to install Mesa?</h2>
191 1.1 mrg <p>
192 1.1 mrg If you're using a Linux-based system, your distro CD most likely already
193 1.1 mrg has Mesa packages (like RPM or DEB) which you can easily install.
194 1.1 mrg </p>
195 1.1 mrg
196 1.1 mrg
197 1.1 mrg <h2>2.2 I get undefined symbols such as bgnpolygon, v3f, etc...</h2>
198 1.1 mrg <p>
199 1.1 mrg You're application is written in IRIS GL, not OpenGL.
200 1.1 mrg IRIS GL was the predecessor to OpenGL and is a different thing (almost)
201 1.1 mrg entirely.
202 1.1 mrg Mesa's not the solution.
203 1.1 mrg </p>
204 1.1 mrg
205 1.1 mrg
206 1.1 mrg <h2>2.3 Where is the GLUT library?</h2>
207 1.1 mrg <p>
208 1.1 mrg GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
209 1.1 mrg If you don't already have GLUT installed, you should grab
210 1.1 mrg <a href="http://freeglut.sourceforge.net/">freeglut</a>.
211 1.1 mrg </p>
212 1.1 mrg
213 1.1 mrg
214 1.1 mrg <h2>2.4 Where is the GLw library?</h2>
215 1.1 mrg <p>
216 1.1 mrg 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.
217 1.1 mrg </p>
218 1.1 mrg
219 1.1 mrg
220 1.1 mrg <h2>2.5 What's the proper place for the libraries and headers?</h2>
221 1.1 mrg <p>
222 1.1 mrg On Linux-based systems you'll want to follow the
223 1.1 mrg <a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html">Linux ABI</a> standard.
224 1.1 mrg Basically you'll want the following:
225 1.1 mrg </p>
226 1.1 mrg <ul>
227 1.1 mrg <li>/usr/include/GL/gl.h - the main OpenGL header
228 1.1 mrg </li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
229 1.1 mrg </li><li>/usr/include/GL/glx.h - the OpenGL GLX header
230 1.1 mrg </li><li>/usr/include/GL/glext.h - the OpenGL extensions header
231 1.1 mrg </li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
232 1.1 mrg </li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
233 1.1 mrg </li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
234 1.1 mrg </li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
235 1.1 mrg </li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
236 1.1 mrg Mesa version number.
237 1.1 mrg </li></ul>
238 1.1 mrg <p>
239 1.1 mrg When configuring Mesa, there are three autoconf options that affect the install
240 1.1 mrg location that you should take care with: <code>--prefix</code>,
241 1.1 mrg <code>--libdir</code>, and <code>--with-dri-driverdir</code>. To install Mesa
242 1.1 mrg into the system location where it will be available for all programs to use, set
243 1.1 mrg <code>--prefix=/usr</code>. Set <code>--libdir</code> to where your Linux
244 1.1 mrg distribution installs system libraries, usually either <code>/usr/lib</code> or
245 1.1 mrg <code>/usr/lib64</code>. Set <code>--with-dri-driverdir</code> to the directory
246 1.1 mrg where your Linux distribution installs DRI drivers. To find your system's DRI
247 1.1 mrg driver directory, try executing <code>find /usr -type d -name dri</code>. For
248 1.1 mrg example, if the <code>find</code> command listed <code>/usr/lib64/dri</code>,
249 1.1 mrg then set <code>--with-dri-driverdir=/usr/lib64/dri</code>.
250 1.1 mrg </p>
251 1.1 mrg <p>
252 1.1 mrg After determining the correct values for the install location, configure Mesa
253 1.1 mrg with <code>./configure --prefix=/usr --libdir=xxx --with-dri-driverdir=xxx</code>
254 1.1 mrg and then install with <code>sudo make install</code>.
255 1.1 mrg </p>
256 1.1 mrg <br>
257 1.1 mrg <br>
258 1.1 mrg
259 1.1 mrg
260 1.1 mrg <h1 id="part3">3. Runtime / Rendering Problems</h1>
261 1.1 mrg
262 1.1 mrg <h2>3.1 Rendering is slow / why isn't my graphics hardware being used?</h2>
263 1.1 mrg <p>
264 1.1 mrg If Mesa can't use its hardware accelerated drivers it falls back on one of its software renderers.
265 1.1 mrg (eg. classic swrast, softpipe or llvmpipe)
266 1.1 mrg </p>
267 1.1 mrg <p>
268 1.1 mrg You can run the <code>glxinfo</code> program to learn about your OpenGL
269 1.1 mrg library.
270 1.1 mrg Look for the <code>OpenGL vendor</code> and <code>OpenGL renderer</code> values.
271 1.1 mrg That will identify who's OpenGL library with which driver you're using and what sort of
272 1.1 mrg hardware it has detected.
273 1.1 mrg </p>
274 1.1 mrg <p>
275 1.1 mrg If you're using a hardware accelerated driver you want <code>direct rendering: Yes</code>.
276 1.1 mrg </p>
277 1.1 mrg <p>
278 1.1 mrg If your DRI-based driver isn't working, go to the
279 1.1 mrg <a href="http://dri.freedesktop.org/">DRI website</a> for trouble-shooting information.
280 1.1 mrg </p>
281 1.1 mrg
282 1.1 mrg
283 1.1 mrg <h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
284 1.1 mrg <p>
285 1.1 mrg Make sure the ratio of the far to near clipping planes isn't too great.
286 1.1 mrg Look
287 1.1 mrg <a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040">here</a>
288 1.1 mrg for details.
289 1.1 mrg </p>
290 1.1 mrg <p>
291 1.1 mrg Mesa uses a 16-bit depth buffer by default which is smaller and faster
292 1.1 mrg to clear than a 32-bit buffer but not as accurate.
293 1.1 mrg If you need a deeper you can modify the parameters to
294 1.1 mrg <code> glXChooseVisual</code> in your code.
295 1.1 mrg </p>
296 1.1 mrg
297 1.1 mrg
298 1.1 mrg <h2>3.3 Why Isn't depth buffering working at all?</h2>
299 1.1 mrg <p>
300 1.1 mrg Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
301 1.1 mrg environment variable it will warn you about trying to enable depth testing
302 1.1 mrg when you don't have a depth buffer.
303 1.1 mrg </p>
304 1.1 mrg <p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
305 1.1 mrg with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
306 1.1 mrg called with a non-zero value for GLX_DEPTH_SIZE.
307 1.1 mrg </p>
308 1.1 mrg <p>This discussion applies to stencil buffers, accumulation buffers and
309 1.1 mrg alpha channels too.
310 1.1 mrg </p>
311 1.1 mrg
312 1.1 mrg
313 1.1 mrg <h2>3.4 Why does glGetString() always return NULL?</h2>
314 1.1 mrg <p>
315 1.1 mrg Be sure you have an active/current OpenGL rendering context before
316 1.1 mrg calling glGetString.
317 1.1 mrg </p>
318 1.1 mrg
319 1.1 mrg
320 1.1 mrg <h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
321 1.1 mrg <p>
322 1.1 mrg If you're trying to draw a filled region by using GL_POINTS or GL_LINES
323 1.1 mrg and seeing holes or gaps it's because of a float-to-int rounding problem.
324 1.1 mrg But this is not a bug.
325 1.1 mrg See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
326 1.1 mrg Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
327 1.1 mrg will fix the problem.
328 1.1 mrg </p>
329 1.1 mrg
330 1.1 mrg <h2>3.6 How can I change the maximum framebuffer size in Mesa's
331 1.1 mrg <tt>swrast</tt> backend?</h2>
332 1.1 mrg <p>
333 1.1 mrg These can be overridden by using the <tt>--with-max-width</tt> and
334 1.1 mrg <tt>--with-max-height</tt> options. The two need not be equal.
335 1.1 mrg </p><p>
336 1.1 mrg Do note that Mesa uses these values to size some internal buffers,
337 1.1 mrg so increasing these sizes will cause Mesa to require additional
338 1.1 mrg memory. Furthermore, increasing these limits beyond <tt>4096</tt>
339 1.1 mrg may introduce rasterization artifacts; see the leading comments in
340 1.1 mrg <tt>src/mesa/swrast/s_tritemp.h</tt>.
341 1.1 mrg </p>
342 1.1 mrg
343 1.1 mrg <br>
344 1.1 mrg <br>
345 1.1 mrg
346 1.1 mrg
347 1.1 mrg <h1 id="part4">4. Developer Questions</h1>
348 1.1 mrg
349 1.1 mrg <h2>4.1 How can I contribute?</h2>
350 1.1 mrg <p>
351 1.1 mrg First, join the <a href="lists.html">mesa-dev mailing list</a>.
352 1.1 mrg That's where Mesa development is discussed.
353 1.1 mrg </p>
354 1.1 mrg <p>
355 1.1 mrg The <a href="http://www.opengl.org/documentation">
356 1.1 mrg OpenGL Specification</a> is the bible for OpenGL implementation work.
357 1.1 mrg You should read it.
358 1.1 mrg </p>
359 1.1 mrg <p>Most of the Mesa development work involves implementing new OpenGL
360 1.1 mrg extensions, writing hardware drivers (for the DRI), and code optimization.
361 1.1 mrg </p>
362 1.1 mrg
363 1.1 mrg <h2>4.2 How do I write a new device driver?</h2>
364 1.1 mrg <p>
365 1.1 mrg Unfortunately, writing a device driver isn't easy.
366 1.1 mrg It requires detailed understanding of OpenGL, the Mesa code, and your
367 1.1 mrg target hardware/operating system.
368 1.1 mrg 3D graphics are not simple.
369 1.1 mrg </p>
370 1.1 mrg <p>
371 1.1 mrg The best way to get started is to use an existing driver as your starting
372 1.1 mrg point.
373 1.1 mrg For a classic hardware driver, the i965 driver is a good example.
374 1.1 mrg For a Gallium3D hardware driver, the r300g, r600g and the i915g are good examples.
375 1.1 mrg </p>
376 1.1 mrg <p>The DRI website has more information about writing hardware drivers.
377 1.1 mrg The process isn't well document because the Mesa driver interface changes
378 1.1 mrg over time, and we seldom have spare time for writing documentation.
379 1.1 mrg That being said, many people have managed to figure out the process.
380 1.1 mrg </p>
381 1.1 mrg <p>
382 1.1 mrg Joining the appropriate mailing lists and asking questions (and searching
383 1.1 mrg the archives) is a good way to get information.
384 1.1 mrg </p>
385 1.1 mrg
386 1.1 mrg
387 1.1 mrg <h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
388 1.1 mrg <p>
389 1.1 mrg The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt">specification for the extension</a>
390 1.1 mrg indicates that there are intellectual property (IP) and/or patent issues
391 1.1 mrg to be dealt with.
392 1.1 mrg </p>
393 1.1 mrg <p>We've been unsuccessful in getting a response from S3 (or whoever owns
394 1.1 mrg the IP nowadays) to indicate whether or not an open source project can
395 1.1 mrg implement the extension (specifically the compression/decompression
396 1.1 mrg algorithms).
397 1.1 mrg </p>
398 1.1 mrg <p>
399 1.1 mrg In the mean time, a 3rd party <a href="http://dri.freedesktop.org/wiki/S3TC">
400 1.1 mrg plug-in library</a> is available.
401 1.1 mrg </p>
402 1.1 mrg
403 1.1 mrg </div>
404 1.1 mrg </body>
405 1.1 mrg </html>
406