config.h revision c1f859d4
17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
3c1f859d4Smrg * Version:  7.3
47117f1b4Smrg *
57117f1b4Smrg * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
6c1f859d4Smrg * Copyright (C) 2008  VMware, Inc.  All Rights Reserved.
77117f1b4Smrg *
87117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
97117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
107117f1b4Smrg * to deal in the Software without restriction, including without limitation
117117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
127117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
137117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
147117f1b4Smrg *
157117f1b4Smrg * The above copyright notice and this permission notice shall be included
167117f1b4Smrg * in all copies or substantial portions of the Software.
177117f1b4Smrg *
187117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
197117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
207117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
217117f1b4Smrg * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
227117f1b4Smrg * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
237117f1b4Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR 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
35c1f859d4Smrg#include "main/mfeatures.h"
36c1f859d4Smrg
37c1f859d4Smrg
387117f1b4Smrg/**
397117f1b4Smrg * \name OpenGL implementation limits
407117f1b4Smrg */
417117f1b4Smrg/*@{*/
427117f1b4Smrg
437117f1b4Smrg/** Maximum modelview matrix stack depth */
447117f1b4Smrg#define MAX_MODELVIEW_STACK_DEPTH 32
457117f1b4Smrg
467117f1b4Smrg/** Maximum projection matrix stack depth */
477117f1b4Smrg#define MAX_PROJECTION_STACK_DEPTH 32
487117f1b4Smrg
497117f1b4Smrg/** Maximum texture matrix stack depth */
507117f1b4Smrg#define MAX_TEXTURE_STACK_DEPTH 10
517117f1b4Smrg
527117f1b4Smrg/** Maximum color matrix stack depth */
537117f1b4Smrg#define MAX_COLOR_STACK_DEPTH 4
547117f1b4Smrg
557117f1b4Smrg/** Maximum attribute stack depth */
567117f1b4Smrg#define MAX_ATTRIB_STACK_DEPTH 16
577117f1b4Smrg
587117f1b4Smrg/** Maximum client attribute stack depth */
597117f1b4Smrg#define MAX_CLIENT_ATTRIB_STACK_DEPTH 16
607117f1b4Smrg
617117f1b4Smrg/** Maximum recursion depth of display list calls */
627117f1b4Smrg#define MAX_LIST_NESTING 64
637117f1b4Smrg
647117f1b4Smrg/** Maximum number of lights */
657117f1b4Smrg#define MAX_LIGHTS 8
667117f1b4Smrg
677117f1b4Smrg/** Maximum user-defined clipping planes */
687117f1b4Smrg#define MAX_CLIP_PLANES 6
697117f1b4Smrg
707117f1b4Smrg/** Maximum pixel map lookup table size */
717117f1b4Smrg#define MAX_PIXEL_MAP_TABLE 256
727117f1b4Smrg
737117f1b4Smrg/** Maximum number of auxillary color buffers */
747117f1b4Smrg#define MAX_AUX_BUFFERS 4
757117f1b4Smrg
767117f1b4Smrg/** Maximum order (degree) of curves */
777117f1b4Smrg#ifdef AMIGA
787117f1b4Smrg#   define MAX_EVAL_ORDER 12
797117f1b4Smrg#else
807117f1b4Smrg#   define MAX_EVAL_ORDER 30
817117f1b4Smrg#endif
827117f1b4Smrg
837117f1b4Smrg/** Maximum Name stack depth */
847117f1b4Smrg#define MAX_NAME_STACK_DEPTH 64
857117f1b4Smrg
867117f1b4Smrg/** Minimum point size */
877117f1b4Smrg#define MIN_POINT_SIZE 1.0
887117f1b4Smrg/** Maximum point size */
89c1f859d4Smrg#define MAX_POINT_SIZE 60.0
907117f1b4Smrg/** Point size granularity */
917117f1b4Smrg#define POINT_SIZE_GRANULARITY 0.1
927117f1b4Smrg
937117f1b4Smrg/** Minimum line width */
947117f1b4Smrg#define MIN_LINE_WIDTH 1.0
957117f1b4Smrg/** Maximum line width */
967117f1b4Smrg#define MAX_LINE_WIDTH 10.0
977117f1b4Smrg/** Line width granularity */
987117f1b4Smrg#define LINE_WIDTH_GRANULARITY 0.1
997117f1b4Smrg
1007117f1b4Smrg/** Max texture palette / color table size */
1017117f1b4Smrg#define MAX_COLOR_TABLE_SIZE 256
1027117f1b4Smrg
1037117f1b4Smrg/** Number of 1D/2D texture mipmap levels */
1047117f1b4Smrg#define MAX_TEXTURE_LEVELS 12
1057117f1b4Smrg
1067117f1b4Smrg/** Number of 3D texture mipmap levels */
1077117f1b4Smrg#define MAX_3D_TEXTURE_LEVELS 9
1087117f1b4Smrg
1097117f1b4Smrg/** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */
1107117f1b4Smrg#define MAX_CUBE_TEXTURE_LEVELS 12
1117117f1b4Smrg
1127117f1b4Smrg/** Maximum rectangular texture size - GL_NV_texture_rectangle */
1137117f1b4Smrg#define MAX_TEXTURE_RECT_SIZE 2048
1147117f1b4Smrg
115c1f859d4Smrg/** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */
116c1f859d4Smrg#define MAX_ARRAY_TEXTURE_LAYERS 64
1177117f1b4Smrg
118c1f859d4Smrg/**
119c1f859d4Smrg * Max number of texture coordinate units.  This mainly just applies to
120c1f859d4Smrg * the fixed-function vertex code.  This will be difficult to raise above
121c1f859d4Smrg * eight because of various vertex attribute bitvectors.
122c1f859d4Smrg */
123c1f859d4Smrg#define MAX_TEXTURE_COORD_UNITS 8
1247117f1b4Smrg
125c1f859d4Smrg/**
126c1f859d4Smrg * Max number of texture image units.  Also determines number of texture
127c1f859d4Smrg * samplers in shaders.
128c1f859d4Smrg */
129c1f859d4Smrg#define MAX_TEXTURE_IMAGE_UNITS 16
1307117f1b4Smrg
1317117f1b4Smrg/**
132c1f859d4Smrg * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS.
133c1f859d4Smrg * This value is only used for dimensioning arrays.
134c1f859d4Smrg * Either MAX_TEXTURE_COORD_UNITS or MAX_TEXTURE_IMAGE_UNITS (or the
135c1f859d4Smrg * corresponding ctx->Const.MaxTextureCoord/ImageUnits fields) should be
136c1f859d4Smrg * used almost everywhere else.
1377117f1b4Smrg */
138c1f859d4Smrg#define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS)
139c1f859d4Smrg
1407117f1b4Smrg
1417117f1b4Smrg/**
1427117f1b4Smrg * Maximum viewport/image width. Must accomodate all texture sizes too.
1437117f1b4Smrg */
1447117f1b4Smrg#define MAX_WIDTH 4096
1457117f1b4Smrg/** Maximum viewport/image height */
1467117f1b4Smrg#define MAX_HEIGHT 4096
1477117f1b4Smrg
1487117f1b4Smrg/** Maxmimum size for CVA.  May be overridden by the drivers.  */
1497117f1b4Smrg#define MAX_ARRAY_LOCK_SIZE 3000
1507117f1b4Smrg
1517117f1b4Smrg/** Subpixel precision for antialiasing, window coordinate snapping */
1527117f1b4Smrg#define SUB_PIXEL_BITS 4
1537117f1b4Smrg
1547117f1b4Smrg/** Size of histogram tables */
1557117f1b4Smrg#define HISTOGRAM_TABLE_SIZE 256
1567117f1b4Smrg
1577117f1b4Smrg/** Max convolution filter width */
1587117f1b4Smrg#define MAX_CONVOLUTION_WIDTH 9
1597117f1b4Smrg/** Max convolution filter height */
1607117f1b4Smrg#define MAX_CONVOLUTION_HEIGHT 9
1617117f1b4Smrg
1627117f1b4Smrg/** For GL_ARB_texture_compression */
1637117f1b4Smrg#define MAX_COMPRESSED_TEXTURE_FORMATS 25
1647117f1b4Smrg
1657117f1b4Smrg/** For GL_EXT_texture_filter_anisotropic */
1667117f1b4Smrg#define MAX_TEXTURE_MAX_ANISOTROPY 16.0
1677117f1b4Smrg
1687117f1b4Smrg/** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
1697117f1b4Smrg#define MAX_TEXTURE_LOD_BIAS 11.0
1707117f1b4Smrg
1717117f1b4Smrg/** For GL_ARB_vertex_program */
1727117f1b4Smrg/*@{*/
1737117f1b4Smrg#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
1747117f1b4Smrg#define MAX_VERTEX_PROGRAM_ATTRIBS     16
1757117f1b4Smrg/*@}*/
1767117f1b4Smrg
1777117f1b4Smrg/** For GL_ARB_fragment_program */
1787117f1b4Smrg/*@{*/
1797117f1b4Smrg#define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0
1807117f1b4Smrg#define MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS 48
1817117f1b4Smrg#define MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS 24
1827117f1b4Smrg#define MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS  4
1837117f1b4Smrg/*@}*/
1847117f1b4Smrg
1857117f1b4Smrg/** For any program target/extension */
1867117f1b4Smrg/*@{*/
187c1f859d4Smrg#define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */
1887117f1b4Smrg#define MAX_PROGRAM_ENV_PARAMS 128
1897117f1b4Smrg#define MAX_PROGRAM_MATRICES 8
1907117f1b4Smrg#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
1917117f1b4Smrg#define MAX_PROGRAM_CALL_DEPTH 8
1927117f1b4Smrg#define MAX_PROGRAM_TEMPS 128
1937117f1b4Smrg#define MAX_PROGRAM_ADDRESS_REGS 2
194c1f859d4Smrg#define MAX_UNIFORMS 1024  /**< number of vec4 uniforms */
195c1f859d4Smrg#define MAX_VARYING 8      /**< number of float[4] vectors */
196c1f859d4Smrg#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
197c1f859d4Smrg#define MAX_PROGRAM_INPUTS 32
198c1f859d4Smrg#define MAX_PROGRAM_OUTPUTS 32
1997117f1b4Smrg/*@}*/
2007117f1b4Smrg
201c1f859d4Smrg/** For GL_NV_vertex_program */
202c1f859d4Smrg/*@{*/
203c1f859d4Smrg#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128
204c1f859d4Smrg#define MAX_NV_VERTEX_PROGRAM_TEMPS         12
205c1f859d4Smrg#define MAX_NV_VERTEX_PROGRAM_PARAMS        MAX_PROGRAM_ENV_PARAMS
206c1f859d4Smrg#define MAX_NV_VERTEX_PROGRAM_INPUTS        16
207c1f859d4Smrg#define MAX_NV_VERTEX_PROGRAM_OUTPUTS       15
208c1f859d4Smrg/*@}*/
209c1f859d4Smrg
210c1f859d4Smrg/** For GL_NV_fragment_program */
211c1f859d4Smrg/*@{*/
212c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
213c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_TEMPS         96
214c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_PARAMS        64
215c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_INPUTS        12
216c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_OUTPUTS        3
217c1f859d4Smrg#define MAX_NV_FRAGMENT_PROGRAM_WRITE_ONLYS    2
218c1f859d4Smrg/*@}*/
219c1f859d4Smrg
220c1f859d4Smrg
2217117f1b4Smrg/** For GL_ARB_vertex_shader */
2227117f1b4Smrg/*@{*/
2237117f1b4Smrg#define MAX_VERTEX_ATTRIBS 16
224c1f859d4Smrg#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
225c1f859d4Smrg#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
2267117f1b4Smrg/*@}*/
2277117f1b4Smrg
2287117f1b4Smrg
2297117f1b4Smrg/** For GL_ARB_draw_buffers */
2307117f1b4Smrg/*@{*/
2317117f1b4Smrg#define MAX_DRAW_BUFFERS 4
2327117f1b4Smrg/*@}*/
2337117f1b4Smrg
2347117f1b4Smrg
2357117f1b4Smrg/** For GL_EXT_framebuffer_object */
2367117f1b4Smrg/*@{*/
2377117f1b4Smrg#define MAX_COLOR_ATTACHMENTS 8
2387117f1b4Smrg/*@}*/
2397117f1b4Smrg
2407117f1b4Smrg
2417117f1b4Smrg
2427117f1b4Smrg/**
2437117f1b4Smrg * \name Mesa-specific parameters
2447117f1b4Smrg */
2457117f1b4Smrg/*@{*/
2467117f1b4Smrg
2477117f1b4Smrg
2487117f1b4Smrg/**
2497117f1b4Smrg * If non-zero use GLdouble for walking triangle edges, for better accuracy.
2507117f1b4Smrg */
2517117f1b4Smrg#define TRIANGLE_WALK_DOUBLE 0
2527117f1b4Smrg
2537117f1b4Smrg
2547117f1b4Smrg/**
2557117f1b4Smrg * Bits per depth buffer value (max is 32).
2567117f1b4Smrg */
2577117f1b4Smrg#ifndef DEFAULT_SOFTWARE_DEPTH_BITS
2587117f1b4Smrg#define DEFAULT_SOFTWARE_DEPTH_BITS 16
2597117f1b4Smrg#endif
2607117f1b4Smrg/** Depth buffer data type */
2617117f1b4Smrg#if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
2627117f1b4Smrg#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
2637117f1b4Smrg#else
2647117f1b4Smrg#define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
2657117f1b4Smrg#endif
2667117f1b4Smrg
2677117f1b4Smrg
2687117f1b4Smrg/**
2697117f1b4Smrg * Bits per stencil value: 8
2707117f1b4Smrg */
2717117f1b4Smrg#define STENCIL_BITS 8
2727117f1b4Smrg
2737117f1b4Smrg
2747117f1b4Smrg/**
2757117f1b4Smrg * Bits per color channel:  8, 16 or 32
2767117f1b4Smrg */
2777117f1b4Smrg#ifndef CHAN_BITS
2787117f1b4Smrg#define CHAN_BITS 8
2797117f1b4Smrg#endif
2807117f1b4Smrg
2817117f1b4Smrg
2827117f1b4Smrg/*
2837117f1b4Smrg * Color channel component order
2847117f1b4Smrg *
2857117f1b4Smrg * \note Changes will almost certainly cause problems at this time.
2867117f1b4Smrg */
2877117f1b4Smrg#define RCOMP 0
2887117f1b4Smrg#define GCOMP 1
2897117f1b4Smrg#define BCOMP 2
2907117f1b4Smrg#define ACOMP 3
2917117f1b4Smrg
2927117f1b4Smrg
2937117f1b4Smrg/**
2947117f1b4Smrg * Maximum number of temporary vertices required for clipping.
2957117f1b4Smrg *
2967117f1b4Smrg * Used in array_cache and tnl modules.
2977117f1b4Smrg */
2987117f1b4Smrg#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
2997117f1b4Smrg
3007117f1b4Smrg
3017117f1b4Smrg#endif /* MESA_CONFIG_H_INCLUDED */
302