Basic work to support deep color channels:
[mesa.git] / src / mesa / main / config.h
1 /* $Id: config.h,v 1.20 2000/10/28 18:34:48 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 /*
29 * Tunable configuration parameters.
30 */
31
32
33
34 #ifndef CONFIG_H
35 #define CONFIG_H
36
37 #ifdef HAVE_CONFIG_H
38 #include "conf.h"
39 #endif
40
41
42 /*
43 * OpenGL implementation limits
44 */
45
46 /* Maximum modelview matrix stack depth: */
47 #define MAX_MODELVIEW_STACK_DEPTH 32
48
49 /* Maximum projection matrix stack depth: */
50 #define MAX_PROJECTION_STACK_DEPTH 32
51
52 /* Maximum texture matrix stack depth: */
53 #define MAX_TEXTURE_STACK_DEPTH 10
54
55 /* Maximum color matrix stack depth: */
56 #define MAX_COLOR_STACK_DEPTH 4
57
58 /* Maximum attribute stack depth: */
59 #define MAX_ATTRIB_STACK_DEPTH 16
60
61 /* Maximum client attribute stack depth: */
62 #define MAX_CLIENT_ATTRIB_STACK_DEPTH 16
63
64 /* Maximum recursion depth of display list calls: */
65 #define MAX_LIST_NESTING 64
66
67 /* Maximum number of lights: */
68 #define MAX_LIGHTS 8
69
70 /* Maximum user-defined clipping planes: */
71 #define MAX_CLIP_PLANES 6
72
73 /* Maximum pixel map lookup table size: */
74 #define MAX_PIXEL_MAP_TABLE 256
75
76 /* Number of auxillary color buffers: */
77 #define NUM_AUX_BUFFERS 0
78
79 /* Maximum order (degree) of curves: */
80 #ifdef AMIGA
81 # define MAX_EVAL_ORDER 12
82 #else
83 # define MAX_EVAL_ORDER 30
84 #endif
85
86 /* Maximum Name stack depth */
87 #define MAX_NAME_STACK_DEPTH 64
88
89 /* Min and Max point sizes and granularity */
90 #define MIN_POINT_SIZE 1.0
91 #define MAX_POINT_SIZE 10.0
92 #define POINT_SIZE_GRANULARITY 0.1
93
94 /* Min and Max line widths and granularity */
95 #define MIN_LINE_WIDTH 1.0
96 #define MAX_LINE_WIDTH 10.0
97 #define LINE_WIDTH_GRANULARITY 0.1
98
99 /* Max texture palette / color table size */
100 #define MAX_COLOR_TABLE_SIZE 256
101
102 /* Number of texture levels */
103 #define MAX_TEXTURE_LEVELS 12
104
105 /* Number of texture units - GL_ARB_multitexture */
106 #define MAX_TEXTURE_UNITS 3
107
108 /* Maximum viewport/image size: */
109 #define MAX_WIDTH 2048
110 #define MAX_HEIGHT 1200
111
112 /* Maxmimum size for CVA. May be overridden by the drivers. */
113 #define MAX_ARRAY_LOCK_SIZE 3000
114
115 /* Subpixel precision for antialiasing, window coordinate snapping */
116 #define SUB_PIXEL_BITS 4
117
118 /* Size of histogram tables */
119 #define HISTOGRAM_TABLE_SIZE 256
120
121 /* Max convolution filter sizes */
122 #define MAX_CONVOLUTION_WIDTH 9
123 #define MAX_CONVOLUTION_HEIGHT 9
124
125 /* GL_ARB_texture_compression */
126 #define MAX_COMPRESSED_TEXTURE_FORMATS 25
127
128
129
130 /*
131 * Mesa-specific parameters
132 */
133
134
135 /*
136 * Bits per accumulation buffer color component: 8 or 16
137 */
138 #define ACCUM_BITS 16
139
140
141 /*
142 * Bits per depth buffer value. Any reasonable value up to 31 will
143 * work. 32 doesn't work because of integer overflow problems in the
144 * rasterizer code.
145 */
146 #define DEFAULT_SOFTWARE_DEPTH_BITS 16
147 #if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
148 #define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
149 #else
150 #define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
151 #endif
152
153
154
155 /*
156 * Bits per stencil value: 8
157 */
158 #define STENCIL_BITS 8
159
160
161 /*
162 * Bits per color channel (must be 8 at this time!)
163 */
164 #define CHAN_BITS 8
165 #define CHAN_MAX ((1 << CHAN_BITS) - 1)
166 #define CHAN_MAXF ((GLfloat) CHAN_MAX)
167 #if CHAN_BITS == 8
168 typedef GLubyte GLchan;
169 #elif CHAN_BITS == 16
170 typedef GLushort GLchan;
171 #else
172 #error illegal number of color channel bits
173 #endif
174
175
176
177
178
179 /*
180 * Color channel component order
181 * (changes will almost certainly cause problems at this time)
182 */
183 #define RCOMP 0
184 #define GCOMP 1
185 #define BCOMP 2
186 #define ACOMP 3
187
188
189
190 /* Vertex buffer size. KW: no restrictions on the divisibility of
191 * this number, though things may go better for you if you choose a
192 * value of 12n + 3.
193 */
194 #define VB_START 3
195
196 #define VB_MAX (216 + VB_START)
197
198
199
200 /*
201 * Actual vertex buffer size.
202 *
203 * Arrays must also accomodate new vertices from clipping, and
204 * potential overflow from primitives which don't fit into neatly into
205 * VB_MAX vertices. (This only happens when mixed primitives are
206 * sharing the vb).
207 */
208 #define VB_MAX_CLIPPED_VERTS ((2 * (6 + MAX_CLIP_PLANES))+1)
209 #define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS)
210
211
212 typedef struct __GLcontextRec GLcontext;
213
214 extern void
215 gl_read_config_file(GLcontext *ctx);
216
217 extern void
218 gl_register_config_var(const char *name, void (*notify)( const char *, int ));
219
220
221 #endif