Merge commit 'origin/master' into drm-gem
[mesa.git] / src / mesa / main / config.h
1 /**
2 * \file config.h
3 * Tunable configuration parameters.
4 */
5
6 /*
7 * Mesa 3-D graphics library
8 * Version: 7.1
9 *
10 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 */
29
30
31 #ifndef MESA_CONFIG_H_INCLUDED
32 #define MESA_CONFIG_H_INCLUDED
33
34 /**
35 * \name OpenGL implementation limits
36 */
37 /*@{*/
38
39 /** Maximum modelview matrix stack depth */
40 #define MAX_MODELVIEW_STACK_DEPTH 32
41
42 /** Maximum projection matrix stack depth */
43 #define MAX_PROJECTION_STACK_DEPTH 32
44
45 /** Maximum texture matrix stack depth */
46 #define MAX_TEXTURE_STACK_DEPTH 10
47
48 /** Maximum color matrix stack depth */
49 #define MAX_COLOR_STACK_DEPTH 4
50
51 /** Maximum attribute stack depth */
52 #define MAX_ATTRIB_STACK_DEPTH 16
53
54 /** Maximum client attribute stack depth */
55 #define MAX_CLIENT_ATTRIB_STACK_DEPTH 16
56
57 /** Maximum recursion depth of display list calls */
58 #define MAX_LIST_NESTING 64
59
60 /** Maximum number of lights */
61 #define MAX_LIGHTS 8
62
63 /** Maximum user-defined clipping planes */
64 #define MAX_CLIP_PLANES 6
65
66 /** Maximum pixel map lookup table size */
67 #define MAX_PIXEL_MAP_TABLE 256
68
69 /** Maximum number of auxillary color buffers */
70 #define MAX_AUX_BUFFERS 4
71
72 /** Maximum order (degree) of curves */
73 #ifdef AMIGA
74 # define MAX_EVAL_ORDER 12
75 #else
76 # define MAX_EVAL_ORDER 30
77 #endif
78
79 /** Maximum Name stack depth */
80 #define MAX_NAME_STACK_DEPTH 64
81
82 /** Minimum point size */
83 #define MIN_POINT_SIZE 1.0
84 /** Maximum point size */
85 #define MAX_POINT_SIZE 60.0
86 /** Point size granularity */
87 #define POINT_SIZE_GRANULARITY 0.1
88
89 /** Minimum line width */
90 #define MIN_LINE_WIDTH 1.0
91 /** Maximum line width */
92 #define MAX_LINE_WIDTH 10.0
93 /** Line width granularity */
94 #define LINE_WIDTH_GRANULARITY 0.1
95
96 /** Max texture palette / color table size */
97 #define MAX_COLOR_TABLE_SIZE 256
98
99 /** Number of 1D/2D texture mipmap levels */
100 #define MAX_TEXTURE_LEVELS 12
101
102 /** Number of 3D texture mipmap levels */
103 #define MAX_3D_TEXTURE_LEVELS 9
104
105 /** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */
106 #define MAX_CUBE_TEXTURE_LEVELS 12
107
108 /** Maximum rectangular texture size - GL_NV_texture_rectangle */
109 #define MAX_TEXTURE_RECT_SIZE 2048
110
111 /** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */
112 #define MAX_ARRAY_TEXTURE_LAYERS 64
113
114 /** Number of texture units - GL_ARB_multitexture
115 * This needs to be the larger of MAX_TEXTURE_COORD_UNITS and
116 * MAX_TEXTURE_IMAGE_UNITS seen below, since MAX_TEXTURE_UNITS is used
117 * to dimension some arrays that store both coord and image data.
118 */
119 #define MAX_TEXTURE_UNITS 8
120
121 /*@}*/
122
123
124 /**
125 * \name Separate numbers of texture coordinates and texture image units.
126 *
127 * These values will eventually replace most instances of MAX_TEXTURE_UNITS.
128 * We should always have MAX_TEXTURE_COORD_UNITS <= MAX_TEXTURE_IMAGE_UNITS.
129 * And, GL_MAX_TEXTURE_UNITS <= MAX_TEXTURE_COORD_UNITS.
130 */
131 /*@{*/
132 #define MAX_TEXTURE_COORD_UNITS 8
133 #define MAX_TEXTURE_IMAGE_UNITS 8
134 /*@}*/
135
136 /**
137 * Maximum viewport/image width. Must accomodate all texture sizes too.
138 */
139 #define MAX_WIDTH 4096
140 /** Maximum viewport/image height */
141 #define MAX_HEIGHT 4096
142
143 /** Maxmimum size for CVA. May be overridden by the drivers. */
144 #define MAX_ARRAY_LOCK_SIZE 3000
145
146 /** Subpixel precision for antialiasing, window coordinate snapping */
147 #define SUB_PIXEL_BITS 4
148
149 /** Size of histogram tables */
150 #define HISTOGRAM_TABLE_SIZE 256
151
152 /** Max convolution filter width */
153 #define MAX_CONVOLUTION_WIDTH 9
154 /** Max convolution filter height */
155 #define MAX_CONVOLUTION_HEIGHT 9
156
157 /** For GL_ARB_texture_compression */
158 #define MAX_COMPRESSED_TEXTURE_FORMATS 25
159
160 /** For GL_EXT_texture_filter_anisotropic */
161 #define MAX_TEXTURE_MAX_ANISOTROPY 16.0
162
163 /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
164 #define MAX_TEXTURE_LOD_BIAS 11.0
165
166 /** For GL_ARB_vertex_program */
167 /*@{*/
168 #define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
169 #define MAX_VERTEX_PROGRAM_ATTRIBS 16
170 /*@}*/
171
172 /** For GL_ARB_fragment_program */
173 /*@{*/
174 #define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0
175 #define MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS 48
176 #define MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS 24
177 #define MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS 4
178 /*@}*/
179
180 /** For any program target/extension */
181 /*@{*/
182 #define MAX_PROGRAM_LOCAL_PARAMS 128 /* KW: power of two */
183 #define MAX_PROGRAM_ENV_PARAMS 128
184 #define MAX_PROGRAM_MATRICES 8
185 #define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
186 #define MAX_PROGRAM_CALL_DEPTH 8
187 #define MAX_PROGRAM_TEMPS 128
188 #define MAX_PROGRAM_ADDRESS_REGS 2
189 #define MAX_UNIFORMS 128
190 #define MAX_VARYING 8
191 #define MAX_SAMPLERS 8
192 /*@}*/
193
194 /** For GL_NV_vertex_program */
195 /*@{*/
196 #define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128
197 #define MAX_NV_VERTEX_PROGRAM_TEMPS 12
198 #define MAX_NV_VERTEX_PROGRAM_PARAMS MAX_PROGRAM_ENV_PARAMS
199 #define MAX_NV_VERTEX_PROGRAM_INPUTS 16
200 #define MAX_NV_VERTEX_PROGRAM_OUTPUTS 15
201 /*@}*/
202
203 /** For GL_NV_fragment_program */
204 /*@{*/
205 #define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
206 #define MAX_NV_FRAGMENT_PROGRAM_TEMPS 96
207 #define MAX_NV_FRAGMENT_PROGRAM_PARAMS 64
208 #define MAX_NV_FRAGMENT_PROGRAM_INPUTS 12
209 #define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS 3
210 #define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS 2
211 /*@}*/
212
213
214 /** For GL_ARB_vertex_shader */
215 /*@{*/
216 #define MAX_VERTEX_ATTRIBS 16
217 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_UNITS
218 #define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS)
219 /*@}*/
220
221
222 /** For GL_ARB_draw_buffers */
223 /*@{*/
224 #define MAX_DRAW_BUFFERS 4
225 /*@}*/
226
227
228 /** For GL_EXT_framebuffer_object */
229 /*@{*/
230 #define MAX_COLOR_ATTACHMENTS 8
231 /*@}*/
232
233
234
235 /**
236 * \name Mesa-specific parameters
237 */
238 /*@{*/
239
240
241 /**
242 * If non-zero use GLdouble for walking triangle edges, for better accuracy.
243 */
244 #define TRIANGLE_WALK_DOUBLE 0
245
246
247 /**
248 * Bits per depth buffer value (max is 32).
249 */
250 #ifndef DEFAULT_SOFTWARE_DEPTH_BITS
251 #define DEFAULT_SOFTWARE_DEPTH_BITS 16
252 #endif
253 /** Depth buffer data type */
254 #if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
255 #define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
256 #else
257 #define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
258 #endif
259
260
261 /**
262 * Bits per stencil value: 8
263 */
264 #define STENCIL_BITS 8
265
266
267 /**
268 * Bits per color channel: 8, 16 or 32
269 */
270 #ifndef CHAN_BITS
271 #define CHAN_BITS 8
272 #endif
273
274
275 /*
276 * Color channel component order
277 *
278 * \note Changes will almost certainly cause problems at this time.
279 */
280 #define RCOMP 0
281 #define GCOMP 1
282 #define BCOMP 2
283 #define ACOMP 3
284
285
286 /*
287 * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1.
288 */
289 #ifndef _HAVE_FULL_GL
290 #define _HAVE_FULL_GL 1
291 #endif
292
293 #define FEATURE_userclip _HAVE_FULL_GL
294 #define FEATURE_texgen _HAVE_FULL_GL
295 #define FEATURE_windowpos _HAVE_FULL_GL
296 #define FEATURE_ARB_occlusion_query _HAVE_FULL_GL
297 #define FEATURE_ARB_fragment_program _HAVE_FULL_GL
298 #define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL
299 #define FEATURE_ARB_vertex_program _HAVE_FULL_GL
300
301 #define FEATURE_ARB_vertex_shader _HAVE_FULL_GL
302 #define FEATURE_ARB_fragment_shader _HAVE_FULL_GL
303 #define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader)
304 #define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects
305 #define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects
306
307 #define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL
308 #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL
309 #define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL
310 #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL
311 #define FEATURE_EXT_timer_query _HAVE_FULL_GL
312 #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL
313 #define FEATURE_MESA_program_debug _HAVE_FULL_GL
314 #define FEATURE_NV_fence _HAVE_FULL_GL
315 #define FEATURE_NV_fragment_program _HAVE_FULL_GL
316 #define FEATURE_NV_vertex_program _HAVE_FULL_GL
317 /*@}*/
318
319
320 /**
321 * Maximum number of temporary vertices required for clipping.
322 *
323 * Used in array_cache and tnl modules.
324 */
325 #define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
326
327
328 #endif /* MESA_CONFIG_H_INCLUDED */