1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved.
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef CR_LIMITS_H
|
---|
8 | #define CR_LIMITS_H
|
---|
9 |
|
---|
10 | #include "chromium.h"
|
---|
11 | #include "cr_version.h"
|
---|
12 |
|
---|
13 | #include <iprt/cdefs.h>
|
---|
14 |
|
---|
15 | #ifdef __cplusplus
|
---|
16 | extern "C" {
|
---|
17 | #endif
|
---|
18 |
|
---|
19 |
|
---|
20 | /* glGetString strings */
|
---|
21 | #define CR_RENDERER "Chromium"
|
---|
22 | #define CR_VENDOR "Humper"
|
---|
23 |
|
---|
24 |
|
---|
25 | #define CR_MAX_TEXTURE_UNITS 8
|
---|
26 | #define CR_MAX_GENERAL_COMBINERS 8
|
---|
27 | #define CR_MAX_TEXTURE_SIZE 8192
|
---|
28 | #define CR_MAX_3D_TEXTURE_SIZE 512
|
---|
29 | #define CR_MAX_CUBE_TEXTURE_SIZE 4096
|
---|
30 | #define CR_MAX_RECTANGLE_TEXTURE_SIZE 4096
|
---|
31 | #define CR_MAX_TEXTURE_ANISOTROPY 8.0
|
---|
32 | #define CR_MAX_LIGHTS 8
|
---|
33 | #define CR_MAX_CLIP_PLANES 8
|
---|
34 | #define CR_MAX_PROJECTION_STACK_DEPTH 32
|
---|
35 | #define CR_MAX_MODELVIEW_STACK_DEPTH 32
|
---|
36 | #define CR_MAX_TEXTURE_STACK_DEPTH 10
|
---|
37 | #define CR_MAX_COLOR_STACK_DEPTH 2
|
---|
38 | #define CR_MAX_ATTRIB_STACK_DEPTH 16
|
---|
39 | #define CR_MAX_CLIENT_ATTRIB_STACK_DEPTH 16
|
---|
40 | #define CR_MAX_NAME_STACK_DEPTH 64
|
---|
41 | #define CR_MAX_ELEMENTS_INDICES 16384
|
---|
42 | #define CR_MAX_ELEMENTS_VERTICES 16384
|
---|
43 | #define CR_MAX_EVAL_ORDER 8
|
---|
44 | #define CR_MAX_LIST_NESTING 64
|
---|
45 | #define CR_MAX_PIXEL_MAP_TABLE 256
|
---|
46 | #define CR_MAX_VIEWPORT_DIM 16384
|
---|
47 | #define CR_SUBPIXEL_BITS 8
|
---|
48 | #define CR_ALIASED_POINT_SIZE_MIN 1.0
|
---|
49 | #define CR_ALIASED_POINT_SIZE_MAX 64.0
|
---|
50 | #define CR_SMOOTH_POINT_SIZE_MIN 1.0
|
---|
51 | #define CR_SMOOTH_POINT_SIZE_MAX 64.0
|
---|
52 | #define CR_POINT_SIZE_GRANULARITY 0.5
|
---|
53 | #define CR_ALIASED_LINE_WIDTH_MIN 1.0
|
---|
54 | #define CR_ALIASED_LINE_WIDTH_MAX 64.0
|
---|
55 | #define CR_SMOOTH_LINE_WIDTH_MIN 1.0
|
---|
56 | #define CR_SMOOTH_LINE_WIDTH_MAX 64.0
|
---|
57 | #define CR_LINE_WIDTH_GRANULARITY 0.5
|
---|
58 | #define CR_MAX_VERTEX_ATTRIBS 16
|
---|
59 | #define CR_MAX_TEXTURE_LOD_BIAS 8.0
|
---|
60 | #ifdef CR_NV_fragment_program
|
---|
61 | #define CR_MAX_TEXTURE_COORDS 2
|
---|
62 | #define CR_MAX_TEXTURE_IMAGE_UNITS 2
|
---|
63 | #define CR_MAX_FRAGMENT_LOCAL_PARAMS 64
|
---|
64 | #endif
|
---|
65 | #ifdef CR_NV_vertex_program
|
---|
66 | #define CR_MAX_PROGRAM_MATRICES 8
|
---|
67 | #define CR_MAX_PROGRAM_MATRIX_STACK_DEPTH 4
|
---|
68 | #endif
|
---|
69 | #ifdef CR_ARB_fragment_program
|
---|
70 | #define CR_MAX_FRAGMENT_PROGRAM_INSTRUCTIONS 72
|
---|
71 | #define CR_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMS 24
|
---|
72 | #define CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS 256
|
---|
73 | #define CR_MAX_FRAGMENT_PROGRAM_TEMPS 16
|
---|
74 | #define CR_MAX_FRAGMENT_PROGRAM_ATTRIBS 10
|
---|
75 | #define CR_MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 1
|
---|
76 | #define CR_MAX_FRAGMENT_PROGRAM_ALU_INSTRUCTIONS 48
|
---|
77 | #define CR_MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS 24
|
---|
78 | #define CR_MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS 4
|
---|
79 | #endif
|
---|
80 | #ifdef CR_ARB_vertex_program
|
---|
81 | #define CR_MAX_VERTEX_PROGRAM_INSTRUCTIONS 128
|
---|
82 | #define CR_MAX_VERTEX_PROGRAM_LOCAL_PARAMS 96
|
---|
83 | #define CR_MAX_VERTEX_PROGRAM_ENV_PARAMS 256 /* for GL_NV_vertex_program2 */
|
---|
84 | #define CR_MAX_VERTEX_PROGRAM_TEMPS 12
|
---|
85 | #define CR_MAX_VERTEX_PROGRAM_ATTRIBS 16
|
---|
86 | #define CR_MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | #if defined(CR_ARB_vertex_program) || defined(CR_ARB_fragment_program)
|
---|
90 | /* These must be the max of the fragment and vertex program limits */
|
---|
91 | #define CR_MAX_PROGRAM_LOCAL_PARAMS (CR_MAX_VERTEX_PROGRAM_LOCAL_PARAMS > CR_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMS ? CR_MAX_VERTEX_PROGRAM_LOCAL_PARAMS : CR_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMS)
|
---|
92 |
|
---|
93 | #define CR_MAX_PROGRAM_ENV_PARAMS (CR_MAX_VERTEX_PROGRAM_ENV_PARAMS > CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS ? CR_MAX_VERTEX_PROGRAM_ENV_PARAMS : CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS)
|
---|
94 | #endif
|
---|
95 |
|
---|
96 |
|
---|
97 | /* Just need these for autogenerated code in state_get.c, etc */
|
---|
98 | #if defined(CR_ARB_vertex_program) || defined(CR_NV_vertex_program)
|
---|
99 | #define CR_any_vertex_program 1
|
---|
100 | #endif
|
---|
101 |
|
---|
102 | #if defined(CR_ARB_fragment_program) || defined(CR_NV_fragment_program)
|
---|
103 | #define CR_any_fragment_program 1
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | #if defined(CR_any_vertex_program) || defined(CR_any_fragment_program)
|
---|
107 | #define CR_any_program 1
|
---|
108 | #endif
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|
112 | /*
|
---|
113 | * OpenGL's implementation-dependent values (not part of any attribute group).
|
---|
114 | */
|
---|
115 | typedef struct {
|
---|
116 | GLuint maxTextureUnits;
|
---|
117 | GLuint maxTextureSize;
|
---|
118 | GLuint max3DTextureSize; /* OpenGL 1.2 */
|
---|
119 | #ifdef CR_ARB_texture_cube_map
|
---|
120 | GLuint maxCubeMapTextureSize;
|
---|
121 | #endif
|
---|
122 | GLuint maxLights;
|
---|
123 | GLuint maxClipPlanes;
|
---|
124 | GLuint maxProjectionStackDepth;
|
---|
125 | GLuint maxModelviewStackDepth;
|
---|
126 | GLuint maxTextureStackDepth;
|
---|
127 | GLuint maxColorStackDepth; /* OpenGL 1.2 */
|
---|
128 | GLuint maxAttribStackDepth;
|
---|
129 | GLuint maxClientAttribStackDepth;
|
---|
130 | GLuint maxNameStackDepth;
|
---|
131 | GLuint maxElementsIndices;
|
---|
132 | GLuint maxElementsVertices;
|
---|
133 | GLuint maxEvalOrder;
|
---|
134 | GLuint maxListNesting;
|
---|
135 | GLuint maxPixelMapTable;
|
---|
136 | GLint maxViewportDims[2];
|
---|
137 | GLuint subpixelBits;
|
---|
138 | GLfloat aliasedPointSizeRange[2];
|
---|
139 | GLfloat smoothPointSizeRange[2];
|
---|
140 | GLfloat pointSizeGranularity;
|
---|
141 | GLfloat aliasedLineWidthRange[2];
|
---|
142 | GLfloat smoothLineWidthRange[2];
|
---|
143 | GLfloat lineWidthGranularity;
|
---|
144 | #ifdef CR_EXT_texture_lod_bias
|
---|
145 | GLfloat maxTextureLodBias;
|
---|
146 | #endif
|
---|
147 | #ifdef CR_EXT_texture_filter_anisotropic
|
---|
148 | GLfloat maxTextureAnisotropy;
|
---|
149 | #endif
|
---|
150 | #ifdef CR_ARB_texture_compression
|
---|
151 | GLuint numCompressedFormats;
|
---|
152 | GLenum compressedFormats[10];
|
---|
153 | #endif
|
---|
154 | #ifdef CR_NV_register_combiners
|
---|
155 | GLuint maxGeneralCombiners;
|
---|
156 | #endif
|
---|
157 | #ifdef CR_NV_texture_rectangle
|
---|
158 | GLuint maxRectTextureSize;
|
---|
159 | #endif
|
---|
160 | #ifdef CR_NV_fragment_program
|
---|
161 | GLuint maxTextureCoords;
|
---|
162 | GLuint maxTextureImageUnits;
|
---|
163 | /*GLuint maxFragmentProgramLocalParams;*/
|
---|
164 | #endif
|
---|
165 | #ifdef CR_NV_vertex_program
|
---|
166 | GLuint maxProgramMatrixStackDepth;
|
---|
167 | GLuint maxProgramMatrices;
|
---|
168 | #endif
|
---|
169 | #ifdef CR_ARB_fragment_program
|
---|
170 | GLuint maxFragmentProgramInstructions;
|
---|
171 | GLuint maxFragmentProgramLocalParams;
|
---|
172 | GLuint maxFragmentProgramEnvParams;
|
---|
173 | GLuint maxFragmentProgramTemps;
|
---|
174 | GLuint maxFragmentProgramAttribs;
|
---|
175 | GLuint maxFragmentProgramAddressRegs;
|
---|
176 | GLuint maxFragmentProgramAluInstructions;
|
---|
177 | GLuint maxFragmentProgramTexInstructions;
|
---|
178 | GLuint maxFragmentProgramTexIndirections;
|
---|
179 | #endif
|
---|
180 | #ifdef CR_ARB_vertex_program
|
---|
181 | GLuint maxVertexProgramInstructions;
|
---|
182 | GLuint maxVertexProgramLocalParams;
|
---|
183 | GLuint maxVertexProgramEnvParams;
|
---|
184 | GLuint maxVertexProgramTemps;
|
---|
185 | GLuint maxVertexProgramAttribs;
|
---|
186 | GLuint maxVertexProgramAddressRegs;
|
---|
187 | #endif
|
---|
188 | const GLubyte *extensions;
|
---|
189 |
|
---|
190 | /* Framebuffer/visual attributes */
|
---|
191 | GLuint redBits, greenBits, blueBits, alphaBits;
|
---|
192 | GLuint depthBits, stencilBits, indexBits;
|
---|
193 | GLuint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
|
---|
194 | GLuint auxBuffers;
|
---|
195 | GLboolean rgbaMode;
|
---|
196 | GLboolean doubleBuffer;
|
---|
197 | GLboolean stereo;
|
---|
198 | GLuint sampleBuffers;
|
---|
199 | GLuint samples;
|
---|
200 | GLuint level;
|
---|
201 |
|
---|
202 | } CRLimitsState;
|
---|
203 |
|
---|
204 |
|
---|
205 | /* Booleans to indicate which OpenGL extensions are supported at runtime.
|
---|
206 | * XXX might merge this into the above structure someday.
|
---|
207 | */
|
---|
208 | typedef struct {
|
---|
209 | GLboolean ARB_depth_texture;
|
---|
210 | GLboolean ARB_fragment_program;
|
---|
211 | GLboolean ARB_imaging;
|
---|
212 | GLboolean ARB_multisample;
|
---|
213 | GLboolean ARB_multitexture;
|
---|
214 | GLboolean ARB_occlusion_query;
|
---|
215 | GLboolean ARB_point_parameters;
|
---|
216 | GLboolean ARB_point_sprite;
|
---|
217 | GLboolean ARB_shadow;
|
---|
218 | GLboolean ARB_shadow_ambient;
|
---|
219 | GLboolean ARB_texture_border_clamp; /* or SGIS_texture_border_clamp */
|
---|
220 | GLboolean ARB_texture_compression;
|
---|
221 | GLboolean ARB_texture_cube_map; /* or EXT_texture_cube_map */
|
---|
222 | GLboolean ARB_texture_env_add; /* standard in OpenGL 1.3 */
|
---|
223 | GLboolean ARB_texture_env_combine; /* standard in OpenGL 1.3 */
|
---|
224 | GLboolean ARB_texture_env_crossbar; /* standard in OpenGL 1.4 */
|
---|
225 | GLboolean ARB_texture_env_dot3; /* standard in OpenGL 1.3 */
|
---|
226 | GLboolean ARB_texture_mirrored_repeat;
|
---|
227 | GLboolean ARB_texture_non_power_of_two; /* standard in 1.5 */
|
---|
228 | GLboolean ARB_transpose_matrix;
|
---|
229 | GLboolean ARB_vertex_buffer_object;
|
---|
230 | GLboolean ARB_pixel_buffer_object;
|
---|
231 | GLboolean ARB_vertex_program;
|
---|
232 | GLboolean ARB_window_pos;
|
---|
233 | GLboolean EXT_blend_color;
|
---|
234 | GLboolean EXT_blend_logic_op;
|
---|
235 | GLboolean EXT_blend_func_separate;
|
---|
236 | GLboolean EXT_blend_minmax;
|
---|
237 | GLboolean EXT_blend_subtract;
|
---|
238 | GLboolean EXT_clip_volume_hint;
|
---|
239 | GLboolean EXT_fog_coord;
|
---|
240 | GLboolean EXT_multi_draw_arrays;
|
---|
241 | GLboolean EXT_secondary_color;
|
---|
242 | GLboolean EXT_separate_specular_color;
|
---|
243 | GLboolean EXT_shadow_funcs;
|
---|
244 | GLboolean EXT_stencil_wrap;
|
---|
245 | GLboolean EXT_texture_edge_clamp; /* or SGIS_texture_edge_clamp */
|
---|
246 | GLboolean EXT_texture_filter_anisotropic;
|
---|
247 | GLboolean EXT_texture_lod_bias;
|
---|
248 | GLboolean EXT_texture3D;
|
---|
249 | GLboolean IBM_rasterpos_clip;
|
---|
250 | GLboolean NV_fog_distance;
|
---|
251 | GLboolean NV_fragment_program;
|
---|
252 | GLboolean NV_register_combiners;
|
---|
253 | GLboolean NV_register_combiners2;
|
---|
254 | GLboolean NV_texgen_reflection;
|
---|
255 | GLboolean NV_texture_rectangle;
|
---|
256 | GLboolean NV_vertex_program;
|
---|
257 | GLboolean NV_vertex_program1_1;
|
---|
258 | GLboolean NV_vertex_program2;
|
---|
259 | GLboolean SGIS_generate_mipmap;
|
---|
260 | GLboolean EXT_texture_from_pixmap;
|
---|
261 | GLboolean ATI_texture_mirror_once;
|
---|
262 |
|
---|
263 | /* derived from above */
|
---|
264 | GLboolean any_vertex_program; /* NV or ARB */
|
---|
265 | GLboolean any_fragment_program; /* NV or ARB */
|
---|
266 | GLboolean any_program; /* vertex or fragment */
|
---|
267 | } CRExtensionState;
|
---|
268 |
|
---|
269 | extern DECLEXPORT(void) crStateLimitsInit(CRLimitsState *limits);
|
---|
270 | extern DECLEXPORT(void) crStateLimitsDestroy(CRLimitsState *limits);
|
---|
271 |
|
---|
272 | extern DECLEXPORT(void) crStateLimitsPrint(const CRLimitsState *limits);
|
---|
273 |
|
---|
274 | extern DECLEXPORT(GLfloat) crStateComputeVersion(float minVersion);
|
---|
275 |
|
---|
276 | extern DECLEXPORT(GLubyte *) crStateMergeExtensions(GLuint n, const GLubyte **extensions);
|
---|
277 |
|
---|
278 | extern DECLEXPORT(void) crStateExtensionsInit( CRLimitsState *limits, CRExtensionState *extensions );
|
---|
279 |
|
---|
280 |
|
---|
281 | #ifdef __cplusplus
|
---|
282 | }
|
---|
283 | #endif
|
---|
284 |
|
---|
285 | #endif /* CR_STATE_FOG_H */
|
---|