mesa: allow MESA_GL_VERSION_OVERRIDE to override the API type
[mesa.git] / docs / envvars.html
1 <!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>Environment Variables</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7 </head>
8 <body>
9
10 <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
17 <h1>Environment Variables</h1>
18
19 <p>
20 Normally, no environment variables need to be set. Most of the environment
21 variables used by Mesa/Gallium are for debugging purposes, but they can
22 sometimes be useful for debugging end-user issues.
23 </p>
24
25
26 <h2>LibGL environment variables</h2>
27
28 <ul>
29 <li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
30 If set to 'verbose' additional information will be printed.
31 <li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
32 <li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
33 <li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
34 <li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
35 </ul>
36
37
38
39 <h2>Core Mesa environment variables</h2>
40
41 <ul>
42 <li>MESA_NO_ASM - if set, disables all assembly language optimizations
43 <li>MESA_NO_MMX - if set, disables Intel MMX optimizations
44 <li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
45 <li>MESA_NO_SSE - if set, disables Intel SSE optimizations
46 <li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
47 if the application generates a GL_INVALID_ENUM error, a corresponding error
48 message indicating where the error occured, and possibly why, will be
49 printed to stderr.<br>
50 If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
51 generate exceptions.
52 <li>MESA_LOG_FILE - specifies a file name for logging all errors, warnings,
53 etc., rather than stderr
54 <li>MESA_TEX_PROG - if set, implement conventional texture env modes with
55 fragment programs (intended for developers only)
56 <li>MESA_TNL_PROG - if set, implement conventional vertex transformation
57 operations with vertex programs (intended for developers only).
58 Setting this variable automatically sets the MESA_TEX_PROG variable as well.
59 <li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
60 A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
61 and disable the GL_EXT_bar extension.
62 <li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
63 by extension year.
64 If this variable is set to year X, only extensions defined on or before year
65 X will be reported.
66 This is to work-around a bug in some games where the extension string is
67 copied into a fixed-size buffer without truncating.
68 If the extension string is too long, the buffer overrun can cause the game
69 to crash.
70 This is a work-around for that.
71 <li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
72 glGetString(GL_VERSION) and possibly the GL API type.
73 <ul>
74 <li> The format should be MAJOR.MINOR[FC]
75 <li> FC is an optional suffix that indicates a forward compatible context.
76 This is only valid for versions &gt;= 3.0.
77 <li> GL versions &lt; 3.0 are set to a compatibility (non-Core) profile
78 <li> GL versions = 3.0, see below
79 <li> GL versions &gt; 3.0 are set to a Core profile
80 <li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
81 <ul>
82 <li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
83 <li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
84 <li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
85 <li> 3.1 - select a Core profile with GL version 3.1
86 <li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
87 </ul>
88 <li> Mesa may not really implement all the features of the given version.
89 (for developers only)
90 </ul>
91 <li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
92 glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
93 "130". Mesa will not really implement all the features of the given language version
94 if it's higher than what's normally reported. (for developers only)
95 <li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
96 </ul>
97
98
99 <h2>Mesa Xlib driver environment variables</h2>
100
101 <p>
102 The following are only applicable to the Mesa Xlib software driver.
103 See the <a href="xlibdriver.html">Xlib software driver page</a> for details.
104 </p>
105 <ul>
106 <li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
107 <li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
108 <li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
109 either "pixmap" or "ximage"
110 <li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
111 <li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
112 <li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
113 <li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
114 <li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
115 <li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
116 </ul>
117
118
119 <h2>i945/i965 driver environment variables (non-Gallium)</h2>
120
121 <ul>
122 <li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
123 OpenGL conformance. If set to 2, always use software rendering.
124 <li>INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap,
125 glCopyPixels, glDrawPixels.
126 </ul>
127
128
129 <h2>Radeon driver environment variables (radeon, r200, and r300g)</h2>
130
131 <ul>
132 <li>RADEON_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
133 </ul>
134
135
136 <h2>EGL environment variables</h2>
137
138 <p>
139 Mesa EGL supports different sets of environment variables. See the
140 <a href="egl.html">Mesa EGL</a> page for the details.
141 </p>
142
143
144 <h2>Gallium environment variables</h2>
145
146 <ul>
147 <li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc.
148 rather than stderr.
149 <li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
150 variables which are used, and their current values.
151 <li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
152 shader execution
153 <li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
154 shader execution
155 <li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
156 <li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
157 print any errors to stderr.
158 <LI>DRAW_FSE - ???
159 <LI>DRAW_NO_FSE - ???
160 <li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
161 shaders, vertex fetch, etc.
162 </ul>
163
164 <h3>Softpipe driver environment variables</h3>
165 <ul>
166 <li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
167 to stderr
168 <li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
169 to stderr
170 <li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
171 <li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for
172 vertex shading procesing.
173 </ul>
174
175
176 <h3>LLVMpipe driver environment variables</h3>
177 <ul>
178 <li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
179 <li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
180 source code for details.
181 <li>LP_PERF - a comma-separated list of options to selectively no-op various
182 parts of the driver. See the source code for details.
183 <li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
184 Zero turns of threading completely. The default value is the number of CPU
185 cores present.
186 </ul>
187
188
189 <p>
190 Other Gallium drivers have their own environment variables. These may change
191 frequently so the source code should be consulted for details.
192 </p>
193
194 </div>
195 </body>
196 </html>