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