config.h revision af69d88d
17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
37117f1b4Smrg *
47117f1b4Smrg * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
5c1f859d4Smrg * Copyright (C) 2008  VMware, Inc.  All Rights Reserved.
67117f1b4Smrg *
77117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
87117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
97117f1b4Smrg * to deal in the Software without restriction, including without limitation
107117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
117117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
127117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
137117f1b4Smrg *
147117f1b4Smrg * The above copyright notice and this permission notice shall be included
157117f1b4Smrg * in all copies or substantial portions of the Software.
167117f1b4Smrg *
177117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
187117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE.
247117f1b4Smrg */
257117f1b4Smrg
26c1f859d4Smrg/**
27c1f859d4Smrg * \file config.h
28c1f859d4Smrg * Tunable configuration parameters.
29c1f859d4Smrg */
307117f1b4Smrg
317117f1b4Smrg#ifndef MESA_CONFIG_H_INCLUDED
327117f1b4Smrg#define MESA_CONFIG_H_INCLUDED
337117f1b4Smrg
34c1f859d4Smrg
357117f1b4Smrg/**
367117f1b4Smrg * \name OpenGL implementation limits
377117f1b4Smrg */
387117f1b4Smrg/*@{*/
397117f1b4Smrg
407117f1b4Smrg/** Maximum modelview matrix stack depth */
417117f1b4Smrg#define MAX_MODELVIEW_STACK_DEPTH 32
427117f1b4Smrg
437117f1b4Smrg/** Maximum projection matrix stack depth */
447117f1b4Smrg#define MAX_PROJECTION_STACK_DEPTH 32
457117f1b4Smrg
467117f1b4Smrg/** Maximum texture matrix stack depth */
477117f1b4Smrg#define MAX_TEXTURE_STACK_DEPTH 10
487117f1b4Smrg
497117f1b4Smrg/** Maximum attribute stack depth */
507117f1b4Smrg#define MAX_ATTRIB_STACK_DEPTH 16
517117f1b4Smrg
527117f1b4Smrg/** Maximum client attribute stack depth */
537117f1b4Smrg#define MAX_CLIENT_ATTRIB_STACK_DEPTH 16
547117f1b4Smrg
557117f1b4Smrg/** Maximum recursion depth of display list calls */
567117f1b4Smrg#define MAX_LIST_NESTING 64
577117f1b4Smrg
587117f1b4Smrg/** Maximum number of lights */
597117f1b4Smrg#define MAX_LIGHTS 8
607117f1b4Smrg
61af69d88dSmrg/**
62af69d88dSmrg * Maximum number of user-defined clipping planes supported by any driver in
63af69d88dSmrg * Mesa.  This is used to size arrays.
64af69d88dSmrg */
65af69d88dSmrg#define MAX_CLIP_PLANES 8
667117f1b4Smrg
677117f1b4Smrg/** Maximum pixel map lookup table size */
687117f1b4Smrg#define MAX_PIXEL_MAP_TABLE 256
697117f1b4Smrg
707117f1b4Smrg/** Maximum number of auxillary color buffers */
714a49301eSmrg#define MAX_AUX_BUFFERS 1
727117f1b4Smrg
737117f1b4Smrg/** Maximum order (degree) of curves */
74af69d88dSmrg#define MAX_EVAL_ORDER 30
757117f1b4Smrg
767117f1b4Smrg/** Maximum Name stack depth */
777117f1b4Smrg#define MAX_NAME_STACK_DEPTH 64
787117f1b4Smrg
797117f1b4Smrg/** Minimum point size */
807117f1b4Smrg#define MIN_POINT_SIZE 1.0
817117f1b4Smrg/** Maximum point size */
82c1f859d4Smrg#define MAX_POINT_SIZE 60.0
837117f1b4Smrg/** Point size granularity */
847117f1b4Smrg#define POINT_SIZE_GRANULARITY 0.1
857117f1b4Smrg
867117f1b4Smrg/** Minimum line width */
877117f1b4Smrg#define MIN_LINE_WIDTH 1.0
887117f1b4Smrg/** Maximum line width */
897117f1b4Smrg#define MAX_LINE_WIDTH 10.0
907117f1b4Smrg/** Line width granularity */
917117f1b4Smrg#define LINE_WIDTH_GRANULARITY 0.1
927117f1b4Smrg
933464ebd5Sriastradh/** Max memory to allow for a single texture image (in megabytes) */
943464ebd5Sriastradh#define MAX_TEXTURE_MBYTES 1024
953464ebd5Sriastradh
967117f1b4Smrg/** Number of 1D/2D texture mipmap levels */
973464ebd5Sriastradh#define MAX_TEXTURE_LEVELS 15
987117f1b4Smrg
997117f1b4Smrg/** Number of 3D texture mipmap levels */
1003464ebd5Sriastradh#define MAX_3D_TEXTURE_LEVELS 15
1017117f1b4Smrg
1027117f1b4Smrg/** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */
1033464ebd5Sriastradh#define MAX_CUBE_TEXTURE_LEVELS 15
1047117f1b4Smrg
1057117f1b4Smrg/** Maximum rectangular texture size - GL_NV_texture_rectangle */
1063464ebd5Sriastradh#define MAX_TEXTURE_RECT_SIZE 16384
1077117f1b4Smrg
108af69d88dSmrg/**
109af69d88dSmrg * Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array
110af69d88dSmrg */
111c1f859d4Smrg#define MAX_ARRAY_TEXTURE_LAYERS 64
1127117f1b4Smrg
113c1f859d4Smrg/**
114c1f859d4Smrg * Max number of texture coordinate units.  This mainly just applies to
115c1f859d4Smrg * the fixed-function vertex code.  This will be difficult to raise above
116c1f859d4Smrg * eight because of various vertex attribute bitvectors.
117c1f859d4Smrg */
118c1f859d4Smrg#define MAX_TEXTURE_COORD_UNITS 8
1197117f1b4Smrg
120c1f859d4Smrg/**
121c1f859d4Smrg * Max number of texture image units.  Also determines number of texture
122c1f859d4Smrg * samplers in shaders.
123c1f859d4Smrg */
124af69d88dSmrg#define MAX_TEXTURE_IMAGE_UNITS 32
1257117f1b4Smrg
1267117f1b4Smrg/**
127c1f859d4Smrg * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS.
128c1f859d4Smrg * This value is only used for dimensioning arrays.
129c1f859d4Smrg * Either MAX_TEXTURE_COORD_UNITS or MAX_TEXTURE_IMAGE_UNITS (or the
130c1f859d4Smrg * corresponding ctx->Const.MaxTextureCoord/ImageUnits fields) should be
131c1f859d4Smrg * used almost everywhere else.
1327117f1b4Smrg */
133c1f859d4Smrg#define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS)
134c1f859d4Smrg
1357117f1b4Smrg
136af69d88dSmrg/** Maximum viewport size */
137af69d88dSmrg#define MAX_VIEWPORT_WIDTH 16384
138af69d88dSmrg#define MAX_VIEWPORT_HEIGHT 16384
1394a49301eSmrg
140af69d88dSmrg/** Maximun number of viewports supported with ARB_viewport_array */
141af69d88dSmrg#define MAX_VIEWPORTS 16
1427117f1b4Smrg
1437117f1b4Smrg/** Maxmimum size for CVA.  May be overridden by the drivers.  */
1447117f1b4Smrg#define MAX_ARRAY_LOCK_SIZE 3000
1457117f1b4Smrg
1467117f1b4Smrg/** Subpixel precision for antialiasing, window coordinate snapping */
1477117f1b4Smrg#define SUB_PIXEL_BITS 4
1487117f1b4Smrg
1497117f1b4Smrg/** For GL_ARB_texture_compression */
1507117f1b4Smrg#define MAX_COMPRESSED_TEXTURE_FORMATS 25
1517117f1b4Smrg
1527117f1b4Smrg/** For GL_EXT_texture_filter_anisotropic */
1537117f1b4Smrg#define MAX_TEXTURE_MAX_ANISOTROPY 16.0
1547117f1b4Smrg
1557117f1b4Smrg/** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
1563464ebd5Sriastradh#define MAX_TEXTURE_LOD_BIAS 14.0
1574a49301eSmrg
1584a49301eSmrg/** For any program target/extension */
1594a49301eSmrg/*@{*/
1604a49301eSmrg#define MAX_PROGRAM_INSTRUCTIONS       (16 * 1024)
1614a49301eSmrg
1624a49301eSmrg/**
1634a49301eSmrg * Per-program constants (power of two)
1644a49301eSmrg *
1653464ebd5Sriastradh * \c MAX_PROGRAM_LOCAL_PARAMS and \c MAX_UNIFORMS are just the assembly shader
1664a49301eSmrg * and GLSL shader names for the same thing.  They should \b always have the
1674a49301eSmrg * same value.  Each refers to the number of vec4 values supplied as
1684a49301eSmrg * per-program parameters.
1694a49301eSmrg */
1704a49301eSmrg/*@{*/
171af69d88dSmrg#define MAX_PROGRAM_LOCAL_PARAMS       4096
172af69d88dSmrg#define MAX_UNIFORMS                   4096
173af69d88dSmrg#define MAX_UNIFORM_BUFFERS            15 /* + 1 default uniform buffer */
174af69d88dSmrg/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
175af69d88dSmrg#define MAX_COMBINED_UNIFORM_BUFFERS   (MAX_UNIFORM_BUFFERS * 6)
176af69d88dSmrg#define MAX_ATOMIC_COUNTERS            4096
177af69d88dSmrg/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
178af69d88dSmrg#define MAX_COMBINED_ATOMIC_BUFFERS    (MAX_UNIFORM_BUFFERS * 6)
179af69d88dSmrg/* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */
180af69d88dSmrg#define ATOMIC_COUNTER_SIZE            4
181af69d88dSmrg#define MAX_IMAGE_UNIFORMS             16
182af69d88dSmrg/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
183af69d88dSmrg#define MAX_IMAGE_UNITS                (MAX_IMAGE_UNIFORMS * 6)
1844a49301eSmrg/*@}*/
1854a49301eSmrg
1864a49301eSmrg/**
1874a49301eSmrg * Per-context constants (power of two)
1884a49301eSmrg *
1894a49301eSmrg * \note
1904a49301eSmrg * This value should always be less than or equal to \c MAX_PROGRAM_LOCAL_PARAMS
1914a49301eSmrg * and \c MAX_VERTEX_PROGRAM_PARAMS.  Otherwise some applications will make
1924a49301eSmrg * incorrect assumptions.
1934a49301eSmrg */
1944a49301eSmrg#define MAX_PROGRAM_ENV_PARAMS         256
1954a49301eSmrg
1964a49301eSmrg#define MAX_PROGRAM_MATRICES           8
1974a49301eSmrg#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
1984a49301eSmrg#define MAX_PROGRAM_CALL_DEPTH         8
1994a49301eSmrg#define MAX_PROGRAM_TEMPS              256
200af69d88dSmrg#define MAX_PROGRAM_ADDRESS_REGS       1
201af69d88dSmrg#define MAX_VARYING                    32    /**< number of float[4] vectors */
2024a49301eSmrg#define MAX_SAMPLERS                   MAX_TEXTURE_IMAGE_UNITS
2034a49301eSmrg#define MAX_PROGRAM_INPUTS             32
2044a49301eSmrg#define MAX_PROGRAM_OUTPUTS            64
2054a49301eSmrg/*@}*/
2067117f1b4Smrg
2077117f1b4Smrg/** For GL_ARB_vertex_program */
2087117f1b4Smrg/*@{*/
2097117f1b4Smrg#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
2104a49301eSmrg#define MAX_VERTEX_PROGRAM_PARAMS       MAX_UNIFORMS
2117117f1b4Smrg/*@}*/
2127117f1b4Smrg
2137117f1b4Smrg/** For GL_ARB_fragment_program */
2147117f1b4Smrg/*@{*/
2157117f1b4Smrg#define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0
2167117f1b4Smrg/*@}*/
2177117f1b4Smrg
218c1f859d4Smrg/** For GL_NV_fragment_program */
219c1f859d4Smrg/*@{*/
220c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
221c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_TEMPS         96
222c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_PARAMS        64
223c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_INPUTS        12
224c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS        3
225c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS    2
226c1f859d4Smrg/*@}*/
227c1f859d4Smrg
228c1f859d4Smrg
2297117f1b4Smrg/** For GL_ARB_vertex_shader */
2307117f1b4Smrg/*@{*/
2314a49301eSmrg#define MAX_VERTEX_GENERIC_ATTRIBS 16
232af69d88dSmrg/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
233af69d88dSmrg#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS * 6)
2347117f1b4Smrg/*@}*/
2357117f1b4Smrg
2367117f1b4Smrg
2377117f1b4Smrg/** For GL_ARB_draw_buffers */
2387117f1b4Smrg/*@{*/
2393464ebd5Sriastradh#define MAX_DRAW_BUFFERS 8
2407117f1b4Smrg/*@}*/
2417117f1b4Smrg
2427117f1b4Smrg
2437117f1b4Smrg/** For GL_EXT_framebuffer_object */
2447117f1b4Smrg/*@{*/
2457117f1b4Smrg#define MAX_COLOR_ATTACHMENTS 8
246af69d88dSmrg#define MAX_RENDERBUFFER_SIZE 16384
2477117f1b4Smrg/*@}*/
2487117f1b4Smrg
2494a49301eSmrg/** For GL_ATI_envmap_bump - support bump mapping on first 8 units */
2504a49301eSmrg#define SUPPORTED_ATI_BUMP_UNITS 0xff
2517117f1b4Smrg
2523464ebd5Sriastradh/** For GL_EXT_transform_feedback */
253af69d88dSmrg#define MAX_FEEDBACK_BUFFERS 4
2543464ebd5Sriastradh#define MAX_FEEDBACK_ATTRIBS 32
2553464ebd5Sriastradh
2563464ebd5Sriastradh/** For GL_ARB_geometry_shader4 */
2573464ebd5Sriastradh/*@{*/
2583464ebd5Sriastradh#define MAX_GEOMETRY_UNIFORM_COMPONENTS              512
2593464ebd5Sriastradh#define MAX_GEOMETRY_OUTPUT_VERTICES                 256
2603464ebd5Sriastradh#define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS         1024
2613464ebd5Sriastradh/*@}*/
2623464ebd5Sriastradh
263af69d88dSmrg/** For GL_ARB_debug_output and GL_KHR_debug */
2647117f1b4Smrg/*@{*/
265af69d88dSmrg#define MAX_DEBUG_LOGGED_MESSAGES   10
266af69d88dSmrg#define MAX_DEBUG_MESSAGE_LENGTH    4096
267af69d88dSmrg/*@}*/
2687117f1b4Smrg
269af69d88dSmrg/** For GL_KHR_debug */
270af69d88dSmrg/*@{*/
271af69d88dSmrg#define MAX_LABEL_LENGTH 256
272af69d88dSmrg#define MAX_DEBUG_GROUP_STACK_DEPTH 64
273af69d88dSmrg/*@}*/
2747117f1b4Smrg
275af69d88dSmrg/** For GL_ARB_gpu_shader5 */
276af69d88dSmrg/*@{*/
277af69d88dSmrg#define MAX_GEOMETRY_SHADER_INVOCATIONS     32
278af69d88dSmrg#define MIN_FRAGMENT_INTERPOLATION_OFFSET   -0.5
279af69d88dSmrg#define MAX_FRAGMENT_INTERPOLATION_OFFSET   0.5
280af69d88dSmrg#define FRAGMENT_INTERPOLATION_OFFSET_BITS  4
281af69d88dSmrg#define MAX_VERTEX_STREAMS                  4
282af69d88dSmrg/*@}*/
2837117f1b4Smrg
284af69d88dSmrg/** For GL_INTEL_performance_query */
285af69d88dSmrg/*@{*/
286af69d88dSmrg#define MAX_PERFQUERY_QUERY_NAME_LENGTH     256
287af69d88dSmrg#define MAX_PERFQUERY_COUNTER_NAME_LENGTH   256
288af69d88dSmrg#define MAX_PERFQUERY_COUNTER_DESC_LENGTH   1024
289af69d88dSmrg#define PERFQUERY_HAVE_GPA_EXTENDED_COUNTERS 0
290af69d88dSmrg/*@}*/
2917117f1b4Smrg
292af69d88dSmrg/** For GL_ARB_compute_shader */
293af69d88dSmrg/*@{*/
294af69d88dSmrg#define MAX_COMPUTE_UNIFORM_BLOCKS          12
295af69d88dSmrg#define MAX_COMPUTE_TEXTURE_IMAGE_UNITS     16
296af69d88dSmrg#define MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS  8
297af69d88dSmrg#define MAX_COMPUTE_ATOMIC_COUNTERS         8
298af69d88dSmrg#define MAX_COMPUTE_SHARED_MEMORY_SIZE      32768
299af69d88dSmrg#define MAX_COMPUTE_UNIFORM_COMPONENTS      512
300af69d88dSmrg#define MAX_COMPUTE_IMAGE_UNIFORMS          8
301af69d88dSmrg/*@}*/
3027117f1b4Smrg
3037117f1b4Smrg/*
3047117f1b4Smrg * Color channel component order
3057117f1b4Smrg *
3067117f1b4Smrg * \note Changes will almost certainly cause problems at this time.
3077117f1b4Smrg */
3087117f1b4Smrg#define RCOMP 0
3097117f1b4Smrg#define GCOMP 1
3107117f1b4Smrg#define BCOMP 2
3117117f1b4Smrg#define ACOMP 3
3127117f1b4Smrg
3137117f1b4Smrg
3147117f1b4Smrg/**
3157117f1b4Smrg * Maximum number of temporary vertices required for clipping.
3167117f1b4Smrg *
3177117f1b4Smrg * Used in array_cache and tnl modules.
3187117f1b4Smrg */
3197117f1b4Smrg#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
3207117f1b4Smrg
3217117f1b4Smrg
3227117f1b4Smrg#endif /* MESA_CONFIG_H_INCLUDED */
323