ReactOS  0.4.12-dev-375-g61fed54
get.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Brian Paul All Rights Reserved.
3  * Copyright (C) 2010 Intel Corporation
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Author: Kristian Høgsberg <krh@bitplanet.net>
23  */
24 
25 #include <precomp.h>
26 
27 /* This is a table driven implementation of the glGet*v() functions.
28  * The basic idea is that most getters just look up an int somewhere
29  * in struct gl_context and then convert it to a bool or float according to
30  * which of glGetIntegerv() glGetBooleanv() etc is being called.
31  * Instead of generating code to do this, we can just record the enum
32  * value and the offset into struct gl_context in an array of structs. Then
33  * in glGet*(), we lookup the struct for the enum in question, and use
34  * the offset to get the int we need.
35  *
36  * Sometimes we need to look up a float, a boolean, a bit in a
37  * bitfield, a matrix or other types instead, so we need to track the
38  * type of the value in struct gl_context. And sometimes the value isn't in
39  * struct gl_context but in the drawbuffer, the array object, current texture
40  * unit, or maybe it's a computed value. So we need to also track
41  * where or how to find the value. Finally, we sometimes need to
42  * check that one of a number of extensions are enabled, the GL
43  * version or flush or call _mesa_update_state(). This is done by
44  * attaching optional extra information to the value description
45  * struct, it's sort of like an array of opcodes that describe extra
46  * checks or actions.
47  *
48  * Putting all this together we end up with struct value_desc below,
49  * and with a couple of macros to help, the table of struct value_desc
50  * is about as concise as the specification in the old python script.
51  */
52 
53 #undef CONST
54 
55 #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
56 #define FLOAT_TO_FIXED(F) ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : \
57  ((F) * 65536.0f < INT_MIN) ? INT_MIN : \
58  (GLint) ((F) * 65536.0f) )
59 
60 #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
61 #define INT_TO_FIXED(I) ( ((I) > SHRT_MAX) ? INT_MAX : \
62  ((I) < SHRT_MIN) ? INT_MIN : \
63  (GLint) ((I) * 65536) )
64 
65 #define INT64_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
66 #define INT64_TO_INT(I) ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) )
67 
68 #define BOOLEAN_TO_INT(B) ( (GLint) (B) )
69 #define BOOLEAN_TO_INT64(B) ( (GLint64) (B) )
70 #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
71 #define BOOLEAN_TO_FIXED(B) ( (GLint) ((B) ? 1 : 0) << 16 )
72 
73 #define ENUM_TO_INT64(E) ( (GLint64) (E) )
74 #define ENUM_TO_FIXED(E) (E)
75 
76 enum value_type {
107 };
108 
115 };
116 
118  EXTRA_END = 0x8000,
126 };
127 
128 #define NO_EXTRA NULL
129 #define NO_OFFSET 0
130 
131 struct value_desc {
135  int offset;
136  const int *extra;
137 };
138 
139 union value {
147 
148  /* Sigh, see GL_COMPRESSED_TEXTURE_FORMATS_ARB handling */
149  struct {
150  GLint n, ints[100];
151  } value_int_n;
153 };
154 
155 #define BUFFER_FIELD(field, type) \
156  LOC_BUFFER, type, offsetof(struct gl_framebuffer, field)
157 #define CONTEXT_FIELD(field, type) \
158  LOC_CONTEXT, type, offsetof(struct gl_context, field)
159 #define ARRAY_FIELD(field, type) \
160  LOC_ARRAY, type, offsetof(struct gl_array_attrib, field)
161 #define CONST(value) \
162  LOC_CONTEXT, TYPE_CONST, value
163 
164 #define BUFFER_INT(field) BUFFER_FIELD(field, TYPE_INT)
165 #define BUFFER_ENUM(field) BUFFER_FIELD(field, TYPE_ENUM)
166 #define BUFFER_BOOL(field) BUFFER_FIELD(field, TYPE_BOOLEAN)
167 
168 #define CONTEXT_INT(field) CONTEXT_FIELD(field, TYPE_INT)
169 #define CONTEXT_INT2(field) CONTEXT_FIELD(field, TYPE_INT_2)
170 #define CONTEXT_INT64(field) CONTEXT_FIELD(field, TYPE_INT64)
171 #define CONTEXT_ENUM(field) CONTEXT_FIELD(field, TYPE_ENUM)
172 #define CONTEXT_ENUM2(field) CONTEXT_FIELD(field, TYPE_ENUM_2)
173 #define CONTEXT_BOOL(field) CONTEXT_FIELD(field, TYPE_BOOLEAN)
174 #define CONTEXT_BIT0(field) CONTEXT_FIELD(field, TYPE_BIT_0)
175 #define CONTEXT_BIT1(field) CONTEXT_FIELD(field, TYPE_BIT_1)
176 #define CONTEXT_BIT2(field) CONTEXT_FIELD(field, TYPE_BIT_2)
177 #define CONTEXT_BIT3(field) CONTEXT_FIELD(field, TYPE_BIT_3)
178 #define CONTEXT_BIT4(field) CONTEXT_FIELD(field, TYPE_BIT_4)
179 #define CONTEXT_BIT5(field) CONTEXT_FIELD(field, TYPE_BIT_5)
180 #define CONTEXT_BIT6(field) CONTEXT_FIELD(field, TYPE_BIT_6)
181 #define CONTEXT_BIT7(field) CONTEXT_FIELD(field, TYPE_BIT_7)
182 #define CONTEXT_FLOAT(field) CONTEXT_FIELD(field, TYPE_FLOAT)
183 #define CONTEXT_FLOAT2(field) CONTEXT_FIELD(field, TYPE_FLOAT_2)
184 #define CONTEXT_FLOAT3(field) CONTEXT_FIELD(field, TYPE_FLOAT_3)
185 #define CONTEXT_FLOAT4(field) CONTEXT_FIELD(field, TYPE_FLOAT_4)
186 #define CONTEXT_MATRIX(field) CONTEXT_FIELD(field, TYPE_MATRIX)
187 #define CONTEXT_MATRIX_T(field) CONTEXT_FIELD(field, TYPE_MATRIX_T)
188 
189 #define ARRAY_INT(field) ARRAY_FIELD(field, TYPE_INT)
190 #define ARRAY_ENUM(field) ARRAY_FIELD(field, TYPE_ENUM)
191 #define ARRAY_BOOL(field) ARRAY_FIELD(field, TYPE_BOOLEAN)
192 
193 #define EXT(f) \
194  offsetof(struct gl_extensions, f)
195 
196 #define EXTRA_EXT(e) \
197  static const int extra_##e[] = { \
198  EXT(e), EXTRA_END \
199  }
200 
201 #define EXTRA_EXT2(e1, e2) \
202  static const int extra_##e1##_##e2[] = { \
203  EXT(e1), EXT(e2), EXTRA_END \
204  }
205 
206 /* The 'extra' mechanism is a way to specify extra checks (such as
207  * extensions or specific gl versions) or actions (flush current, new
208  * buffers) that we need to do before looking up an enum. We need to
209  * declare them all up front so we can refer to them in the value_desc
210  * structs below. */
211 
212 static const int extra_new_buffers[] = {
214  EXTRA_END
215 };
216 
217 static const int extra_valid_texture_unit[] = {
219  EXTRA_END
220 };
221 
222 static const int extra_valid_clip_distance[] = {
224  EXTRA_END
225 };
226 
230  EXTRA_END
231 };
232 
233 static const int extra_flush_current[] = {
235  EXTRA_END
236 };
237 
238 static const int extra_EXT_fog_coord_flush_current[] = {
239  EXT(EXT_fog_coord),
241  EXTRA_END
242 };
243 
244 static const int extra_EXT_texture_integer[] = {
245  EXT(EXT_texture_integer),
246  EXTRA_END
247 };
248 
249 
250 EXTRA_EXT(ARB_texture_cube_map);
251 EXTRA_EXT(EXT_fog_coord);
252 EXTRA_EXT(NV_fog_distance);
253 EXTRA_EXT(EXT_texture_filter_anisotropic);
254 EXTRA_EXT(IBM_rasterpos_clip);
255 EXTRA_EXT(NV_point_sprite);
256 EXTRA_EXT(NV_light_max_exponent);
257 EXTRA_EXT(EXT_depth_bounds_test);
258 EXTRA_EXT(EXT_compiled_vertex_array);
259 EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
260 
261 static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END };
262 static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
263 
264 #define API_OPENGL_BIT (1 << API_OPENGL)
265 
266 /* This is the big table describing all the enums we accept in
267  * glGet*v(). The table is partitioned into six parts: enums
268  * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
269  * between OpenGL and GLES, enums exclusive to GLES, etc for the
270  * remaining combinations. When we add the enums to the hash table in
271  * _mesa_init_get_hash(), we only add the enums for the API we're
272  * instantiating and the different sections are guarded by #if
273  * FEATURE_GL etc to make sure we only compile in the enums we may
274  * need. */
275 
276 static const struct value_desc values[] = {
277  { GL_ALPHA_BITS, BUFFER_INT(Visual.alphaBits), extra_new_buffers },
278  { GL_BLEND, CONTEXT_BIT0(Color.BlendEnabled), NO_EXTRA },
279  { GL_BLEND_SRC, CONTEXT_ENUM(Color.SrcFactor), NO_EXTRA },
280  { GL_BLUE_BITS, BUFFER_INT(Visual.blueBits), extra_new_buffers },
283  { GL_CULL_FACE, CONTEXT_BOOL(Polygon.CullFlag), NO_EXTRA },
284  { GL_CULL_FACE_MODE, CONTEXT_ENUM(Polygon.CullFaceMode), NO_EXTRA },
285  { GL_DEPTH_BITS, BUFFER_INT(Visual.depthBits), NO_EXTRA },
288  { GL_DEPTH_RANGE, CONTEXT_FIELD(Viewport.Near, TYPE_FLOATN_2), NO_EXTRA },
291  { GL_DITHER, CONTEXT_BOOL(Color.DitherFlag), NO_EXTRA },
292  { GL_FRONT_FACE, CONTEXT_ENUM(Polygon.FrontFace), NO_EXTRA },
293  { GL_GREEN_BITS, BUFFER_INT(Visual.greenBits), extra_new_buffers },
295  { GL_ALIASED_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidth), NO_EXTRA },
296  { GL_MAX_ELEMENTS_VERTICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
297  { GL_MAX_ELEMENTS_INDICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
299  offsetof(struct gl_context, Const.MaxTextureLevels), NO_EXTRA },
300  { GL_MAX_VIEWPORT_DIMS, CONTEXT_INT2(Const.MaxViewportWidth), NO_EXTRA },
301  { GL_PACK_ALIGNMENT, CONTEXT_INT(Pack.Alignment), NO_EXTRA },
302  { GL_ALIASED_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSize), NO_EXTRA },
306  { GL_RED_BITS, BUFFER_INT(Visual.redBits), extra_new_buffers },
308  { GL_SCISSOR_TEST, CONTEXT_BOOL(Scissor.Enabled), NO_EXTRA },
309  { GL_STENCIL_BITS, BUFFER_INT(Visual.stencilBits), NO_EXTRA },
310  { GL_STENCIL_CLEAR_VALUE, CONTEXT_INT(Stencil.Clear), NO_EXTRA },
316  { GL_STENCIL_TEST, CONTEXT_BOOL(Stencil.Enabled), NO_EXTRA },
319  { GL_SUBPIXEL_BITS, CONTEXT_INT(Const.SubPixelBits), NO_EXTRA },
321  { GL_UNPACK_ALIGNMENT, CONTEXT_INT(Unpack.Alignment), NO_EXTRA },
323 
324  /* GL_ARB_multitexture */
326 
327  /* Note that all the OES_* extensions require that the Mesa "struct
328  * gl_extensions" include a member with the name of the extension.
329  * That structure does not yet include OES extensions (and we're
330  * not sure whether it will). If it does, all the OES_*
331  * extensions below should mark the dependency. */
332 
333  /* GL_ARB_texture_cube_map */
335  TEXTURE_CUBE_INDEX, extra_ARB_texture_cube_map },
337  offsetof(struct gl_context, Const.MaxCubeTextureLevels),
338  extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */
339 
340  /* XXX: OES_blend_subtract */
343 
344  /* GL_ARB_multisample */
346  CONTEXT_BOOL(Multisample.SampleAlphaToCoverage), NO_EXTRA },
347  { GL_SAMPLE_COVERAGE_ARB, CONTEXT_BOOL(Multisample.SampleCoverage), NO_EXTRA },
349  CONTEXT_FLOAT(Multisample.SampleCoverageValue), NO_EXTRA },
351  CONTEXT_BOOL(Multisample.SampleCoverageInvert), NO_EXTRA },
352 
353  /* GL_ARB_vertex_buffer_object */
355 
356  /* GL_ARB_vertex_buffer_object */
357  /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported */
359 
360  /* GL_OES_read_format */
365 
366  /* This entry isn't spec'ed for GLES 2, but is needed for Mesa's
367  * GLSL: */
368  { GL_MAX_CLIP_PLANES, CONTEXT_INT(Const.MaxClipPlanes), NO_EXTRA },
369 
370  { GL_MAX_LIGHTS, CONTEXT_INT(Const.MaxLights), NO_EXTRA },
371  { GL_LIGHT0, CONTEXT_BOOL(Light.Light[0].Enabled), NO_EXTRA },
372  { GL_LIGHT1, CONTEXT_BOOL(Light.Light[1].Enabled), NO_EXTRA },
373  { GL_LIGHT2, CONTEXT_BOOL(Light.Light[2].Enabled), NO_EXTRA },
374  { GL_LIGHT3, CONTEXT_BOOL(Light.Light[3].Enabled), NO_EXTRA },
375  { GL_LIGHT4, CONTEXT_BOOL(Light.Light[4].Enabled), NO_EXTRA },
376  { GL_LIGHT5, CONTEXT_BOOL(Light.Light[5].Enabled), NO_EXTRA },
377  { GL_LIGHT6, CONTEXT_BOOL(Light.Light[6].Enabled), NO_EXTRA },
378  { GL_LIGHT7, CONTEXT_BOOL(Light.Light[7].Enabled), NO_EXTRA },
379  { GL_LIGHTING, CONTEXT_BOOL(Light.Enabled), NO_EXTRA },
381  CONTEXT_FIELD(Light.Model.Ambient[0], TYPE_FLOATN_4), NO_EXTRA },
382  { GL_LIGHT_MODEL_TWO_SIDE, CONTEXT_BOOL(Light.Model.TwoSide), NO_EXTRA },
383  { GL_ALPHA_TEST, CONTEXT_BOOL(Color.AlphaEnabled), NO_EXTRA },
386  { GL_BLEND_DST, CONTEXT_ENUM(Color.DstFactor), NO_EXTRA },
387  { GL_CLIP_DISTANCE0, CONTEXT_BIT0(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
388  { GL_CLIP_DISTANCE1, CONTEXT_BIT1(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
389  { GL_CLIP_DISTANCE2, CONTEXT_BIT2(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
390  { GL_CLIP_DISTANCE3, CONTEXT_BIT3(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
391  { GL_CLIP_DISTANCE4, CONTEXT_BIT4(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
392  { GL_CLIP_DISTANCE5, CONTEXT_BIT5(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
393  { GL_CLIP_DISTANCE6, CONTEXT_BIT6(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
394  { GL_CLIP_DISTANCE7, CONTEXT_BIT7(Transform.ClipPlanesEnabled), extra_valid_clip_distance },
395  { GL_COLOR_MATERIAL, CONTEXT_BOOL(Light.ColorMaterialEnabled), NO_EXTRA },
397  CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR][0], TYPE_FLOATN_4),
400  CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_NORMAL][0], TYPE_FLOATN_3),
405  { GL_FOG, CONTEXT_BOOL(Fog.Enabled), NO_EXTRA },
407  { GL_FOG_DENSITY, CONTEXT_FLOAT(Fog.Density), NO_EXTRA },
408  { GL_FOG_END, CONTEXT_FLOAT(Fog.End), NO_EXTRA },
409  { GL_FOG_HINT, CONTEXT_ENUM(Hint.Fog), NO_EXTRA },
410  { GL_FOG_MODE, CONTEXT_ENUM(Fog.Mode), NO_EXTRA },
411  { GL_FOG_START, CONTEXT_FLOAT(Fog.Start), NO_EXTRA },
412  { GL_LINE_SMOOTH, CONTEXT_BOOL(Line.SmoothFlag), NO_EXTRA },
413  { GL_LINE_SMOOTH_HINT, CONTEXT_ENUM(Hint.LineSmooth), NO_EXTRA },
414  { GL_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidthAA), NO_EXTRA },
415  { GL_COLOR_LOGIC_OP, CONTEXT_BOOL(Color.ColorLogicOpEnabled), NO_EXTRA },
417  { GL_MATRIX_MODE, CONTEXT_ENUM(Transform.MatrixMode), NO_EXTRA },
421  { GL_MODELVIEW_MATRIX, CONTEXT_MATRIX(ModelviewMatrixStack.Top), NO_EXTRA },
423  offsetof(struct gl_context, ModelviewMatrixStack.Depth), NO_EXTRA },
424  { GL_NORMALIZE, CONTEXT_BOOL(Transform.Normalize), NO_EXTRA },
425  { GL_PACK_SKIP_IMAGES_EXT, CONTEXT_INT(Pack.SkipImages), NO_EXTRA },
426  { GL_PERSPECTIVE_CORRECTION_HINT, CONTEXT_ENUM(Hint.PerspectiveCorrection), NO_EXTRA },
428  { GL_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSizeAA), NO_EXTRA },
429  { GL_POINT_SMOOTH, CONTEXT_BOOL(Point.SmoothFlag), NO_EXTRA },
430  { GL_POINT_SMOOTH_HINT, CONTEXT_ENUM(Hint.PointSmooth), NO_EXTRA },
434  { GL_PROJECTION_MATRIX, CONTEXT_MATRIX(ProjectionMatrixStack.Top), NO_EXTRA },
436  offsetof(struct gl_context, ProjectionMatrixStack.Depth), NO_EXTRA },
437  { GL_RESCALE_NORMAL, CONTEXT_BOOL(Transform.RescaleNormals), NO_EXTRA },
438  { GL_SHADE_MODEL, CONTEXT_ENUM(Light.ShadeModel), NO_EXTRA },
443 
447  { GL_VERTEX_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_POS].Stride), NO_EXTRA },
450  { GL_NORMAL_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA },
454  { GL_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR].Stride), NO_EXTRA },
462  LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Stride), NO_EXTRA },
463 
464  /* GL_ARB_texture_cube_map */
466  /* S, T, and R are always set at the same time */
468  offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
469 
470  /* GL_ARB_multisample */
471  { GL_MULTISAMPLE_ARB, CONTEXT_BOOL(Multisample.Enabled), NO_EXTRA },
472  { GL_SAMPLE_ALPHA_TO_ONE_ARB, CONTEXT_BOOL(Multisample.SampleAlphaToOne), NO_EXTRA },
473 
474  /* GL_ARB_vertex_buffer_object */
476  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_POS].BufferObj), NO_EXTRA },
478  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_NORMAL].BufferObj), NO_EXTRA },
480  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR].BufferObj), NO_EXTRA },
482 
483  /* GL_OES_point_sprite */
485  CONTEXT_BOOL(Point.PointSprite),
486  extra_NV_point_sprite_ARB_point_sprite },
487 
488  /* GL_EXT_texture_filter_anisotropic */
490  CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
491  extra_EXT_texture_filter_anisotropic },
492 
494 
495  { GL_ACCUM_RED_BITS, BUFFER_INT(Visual.accumRedBits), NO_EXTRA },
496  { GL_ACCUM_GREEN_BITS, BUFFER_INT(Visual.accumGreenBits), NO_EXTRA },
497  { GL_ACCUM_BLUE_BITS, BUFFER_INT(Visual.accumBlueBits), NO_EXTRA },
498  { GL_ACCUM_ALPHA_BITS, BUFFER_INT(Visual.accumAlphaBits), NO_EXTRA },
499  { GL_ACCUM_CLEAR_VALUE, CONTEXT_FIELD(Accum.ClearColor[0], TYPE_FLOATN_4), NO_EXTRA },
500  { GL_ALPHA_BIAS, CONTEXT_FLOAT(Pixel.AlphaBias), NO_EXTRA },
501  { GL_ALPHA_SCALE, CONTEXT_FLOAT(Pixel.AlphaScale), NO_EXTRA },
502  { GL_ATTRIB_STACK_DEPTH, CONTEXT_INT(AttribStackDepth), NO_EXTRA },
503  { GL_AUTO_NORMAL, CONTEXT_BOOL(Eval.AutoNormal), NO_EXTRA },
504  { GL_AUX_BUFFERS, BUFFER_INT(Visual.numAuxBuffers), NO_EXTRA },
505  { GL_BLUE_BIAS, CONTEXT_FLOAT(Pixel.BlueBias), NO_EXTRA },
506  { GL_BLUE_SCALE, CONTEXT_FLOAT(Pixel.BlueScale), NO_EXTRA },
507  { GL_CLIENT_ATTRIB_STACK_DEPTH, CONTEXT_INT(ClientAttribStackDepth), NO_EXTRA },
508  { GL_COLOR_MATERIAL_FACE, CONTEXT_ENUM(Light.ColorMaterialFace), NO_EXTRA },
509  { GL_COLOR_MATERIAL_PARAMETER, CONTEXT_ENUM(Light.ColorMaterialMode), NO_EXTRA },
511  CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]),
514  CONTEXT_FIELD(Current.RasterColor[0], TYPE_FLOATN_4), NO_EXTRA },
515  { GL_CURRENT_RASTER_DISTANCE, CONTEXT_FLOAT(Current.RasterDistance), NO_EXTRA },
517  { GL_CURRENT_RASTER_POSITION, CONTEXT_FLOAT4(Current.RasterPos[0]), NO_EXTRA },
520  { GL_CURRENT_RASTER_POSITION_VALID, CONTEXT_BOOL(Current.RasterPosValid), NO_EXTRA },
521  { GL_DEPTH_BIAS, CONTEXT_FLOAT(Pixel.DepthBias), NO_EXTRA },
522  { GL_DEPTH_SCALE, CONTEXT_FLOAT(Pixel.DepthScale), NO_EXTRA },
523  { GL_DOUBLEBUFFER, BUFFER_INT(Visual.doubleBufferMode), NO_EXTRA },
524  { GL_DRAW_BUFFER, BUFFER_ENUM(ColorDrawBuffer), NO_EXTRA },
526  { GL_FEEDBACK_BUFFER_SIZE, CONTEXT_INT(Feedback.BufferSize), NO_EXTRA },
527  { GL_FEEDBACK_BUFFER_TYPE, CONTEXT_ENUM(Feedback.Type), NO_EXTRA },
528  { GL_FOG_INDEX, CONTEXT_FLOAT(Fog.Index), NO_EXTRA },
529  { GL_GREEN_BIAS, CONTEXT_FLOAT(Pixel.GreenBias), NO_EXTRA },
530  { GL_GREEN_SCALE, CONTEXT_FLOAT(Pixel.GreenScale), NO_EXTRA },
531  { GL_INDEX_BITS, BUFFER_INT(Visual.indexBits), extra_new_buffers },
533  { GL_INDEX_MODE, CONST(0) , NO_EXTRA},
534  { GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA },
535  { GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA },
536  { GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA },
537  { GL_LIGHT_MODEL_LOCAL_VIEWER, CONTEXT_BOOL(Light.Model.LocalViewer), NO_EXTRA },
538  { GL_LINE_STIPPLE, CONTEXT_BOOL(Line.StippleFlag), NO_EXTRA },
540  { GL_LINE_STIPPLE_REPEAT, CONTEXT_INT(Line.StippleFactor), NO_EXTRA },
541  { GL_LINE_WIDTH_GRANULARITY, CONTEXT_FLOAT(Const.LineWidthGranularity), NO_EXTRA },
542  { GL_LIST_BASE, CONTEXT_INT(List.ListBase), NO_EXTRA },
545  { GL_INDEX_LOGIC_OP, CONTEXT_BOOL(Color.IndexLogicOpEnabled), NO_EXTRA },
546  { GL_MAP1_COLOR_4, CONTEXT_BOOL(Eval.Map1Color4), NO_EXTRA },
547  { GL_MAP1_GRID_DOMAIN, CONTEXT_FLOAT2(Eval.MapGrid1u1), NO_EXTRA },
548  { GL_MAP1_GRID_SEGMENTS, CONTEXT_INT(Eval.MapGrid1un), NO_EXTRA },
549  { GL_MAP1_INDEX, CONTEXT_BOOL(Eval.Map1Index), NO_EXTRA },
550  { GL_MAP1_NORMAL, CONTEXT_BOOL(Eval.Map1Normal), NO_EXTRA },
551  { GL_MAP1_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map1TextureCoord1), NO_EXTRA },
552  { GL_MAP1_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map1TextureCoord2), NO_EXTRA },
553  { GL_MAP1_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map1TextureCoord3), NO_EXTRA },
554  { GL_MAP1_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map1TextureCoord4), NO_EXTRA },
555  { GL_MAP1_VERTEX_3, CONTEXT_BOOL(Eval.Map1Vertex3), NO_EXTRA },
556  { GL_MAP1_VERTEX_4, CONTEXT_BOOL(Eval.Map1Vertex4), NO_EXTRA },
557  { GL_MAP2_COLOR_4, CONTEXT_BOOL(Eval.Map2Color4), NO_EXTRA },
559  { GL_MAP2_GRID_SEGMENTS, CONTEXT_INT2(Eval.MapGrid2un), NO_EXTRA },
560  { GL_MAP2_INDEX, CONTEXT_BOOL(Eval.Map2Index), NO_EXTRA },
561  { GL_MAP2_NORMAL, CONTEXT_BOOL(Eval.Map2Normal), NO_EXTRA },
562  { GL_MAP2_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map2TextureCoord1), NO_EXTRA },
563  { GL_MAP2_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map2TextureCoord2), NO_EXTRA },
564  { GL_MAP2_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map2TextureCoord3), NO_EXTRA },
565  { GL_MAP2_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map2TextureCoord4), NO_EXTRA },
566  { GL_MAP2_VERTEX_3, CONTEXT_BOOL(Eval.Map2Vertex3), NO_EXTRA },
567  { GL_MAP2_VERTEX_4, CONTEXT_BOOL(Eval.Map2Vertex4), NO_EXTRA },
568  { GL_MAP_COLOR, CONTEXT_BOOL(Pixel.MapColorFlag), NO_EXTRA },
569  { GL_MAP_STENCIL, CONTEXT_BOOL(Pixel.MapStencilFlag), NO_EXTRA },
572 
577  { GL_NAME_STACK_DEPTH, CONTEXT_INT(Select.NameStackDepth), NO_EXTRA },
578  { GL_PACK_LSB_FIRST, CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA },
579  { GL_PACK_ROW_LENGTH, CONTEXT_INT(Pack.RowLength), NO_EXTRA },
580  { GL_PACK_SKIP_PIXELS, CONTEXT_INT(Pack.SkipPixels), NO_EXTRA },
581  { GL_PACK_SKIP_ROWS, CONTEXT_INT(Pack.SkipRows), NO_EXTRA },
582  { GL_PACK_SWAP_BYTES, CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA },
583  { GL_PACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Pack.ImageHeight), NO_EXTRA },
584  { GL_PACK_INVERT_MESA, CONTEXT_BOOL(Pack.Invert), NO_EXTRA },
585  { GL_PIXEL_MAP_A_TO_A_SIZE, CONTEXT_INT(PixelMaps.AtoA.Size), NO_EXTRA },
586  { GL_PIXEL_MAP_B_TO_B_SIZE, CONTEXT_INT(PixelMaps.BtoB.Size), NO_EXTRA },
587  { GL_PIXEL_MAP_G_TO_G_SIZE, CONTEXT_INT(PixelMaps.GtoG.Size), NO_EXTRA },
588  { GL_PIXEL_MAP_I_TO_A_SIZE, CONTEXT_INT(PixelMaps.ItoA.Size), NO_EXTRA },
589  { GL_PIXEL_MAP_I_TO_B_SIZE, CONTEXT_INT(PixelMaps.ItoB.Size), NO_EXTRA },
590  { GL_PIXEL_MAP_I_TO_G_SIZE, CONTEXT_INT(PixelMaps.ItoG.Size), NO_EXTRA },
591  { GL_PIXEL_MAP_I_TO_I_SIZE, CONTEXT_INT(PixelMaps.ItoI.Size), NO_EXTRA },
592  { GL_PIXEL_MAP_I_TO_R_SIZE, CONTEXT_INT(PixelMaps.ItoR.Size), NO_EXTRA },
593  { GL_PIXEL_MAP_R_TO_R_SIZE, CONTEXT_INT(PixelMaps.RtoR.Size), NO_EXTRA },
594  { GL_PIXEL_MAP_S_TO_S_SIZE, CONTEXT_INT(PixelMaps.StoS.Size), NO_EXTRA },
595  { GL_POINT_SIZE_GRANULARITY, CONTEXT_FLOAT(Const.PointSizeGranularity), NO_EXTRA },
601  { GL_POLYGON_SMOOTH_HINT, CONTEXT_ENUM(Hint.PolygonSmooth), NO_EXTRA },
602  { GL_POLYGON_STIPPLE, CONTEXT_BOOL(Polygon.StippleFlag), NO_EXTRA },
604  { GL_RED_BIAS, CONTEXT_FLOAT(Pixel.RedBias), NO_EXTRA },
605  { GL_RED_SCALE, CONTEXT_FLOAT(Pixel.RedScale), NO_EXTRA },
606  { GL_RENDER_MODE, CONTEXT_ENUM(RenderMode), NO_EXTRA },
607  { GL_RGBA_MODE, CONST(1), NO_EXTRA },
608  { GL_SELECTION_BUFFER_SIZE, CONTEXT_INT(Select.BufferSize), NO_EXTRA },
609 
610  { GL_STEREO, BUFFER_INT(Visual.stereoMode), NO_EXTRA },
611 
613 
615 
617  offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
619  offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
621  offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
623  offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
624  { GL_UNPACK_LSB_FIRST, CONTEXT_BOOL(Unpack.LsbFirst), NO_EXTRA },
625  { GL_UNPACK_ROW_LENGTH, CONTEXT_INT(Unpack.RowLength), NO_EXTRA },
626  { GL_UNPACK_SKIP_PIXELS, CONTEXT_INT(Unpack.SkipPixels), NO_EXTRA },
627  { GL_UNPACK_SKIP_ROWS, CONTEXT_INT(Unpack.SkipRows), NO_EXTRA },
628  { GL_UNPACK_SWAP_BYTES, CONTEXT_BOOL(Unpack.SwapBytes), NO_EXTRA },
629  { GL_UNPACK_SKIP_IMAGES_EXT, CONTEXT_INT(Unpack.SkipImages), NO_EXTRA },
630  { GL_UNPACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Unpack.ImageHeight), NO_EXTRA },
631  { GL_ZOOM_X, CONTEXT_FLOAT(Pixel.ZoomX), NO_EXTRA },
632  { GL_ZOOM_Y, CONTEXT_FLOAT(Pixel.ZoomY), NO_EXTRA },
633 
634  /* Vertex arrays */
646 
647  /* GL_EXT_compiled_vertex_array */
648  { GL_ARRAY_ELEMENT_LOCK_FIRST_EXT, CONTEXT_INT(Array.LockFirst),
649  extra_EXT_compiled_vertex_array },
650  { GL_ARRAY_ELEMENT_LOCK_COUNT_EXT, CONTEXT_INT(Array.LockCount),
651  extra_EXT_compiled_vertex_array },
652 
653  /* GL_ARB_transpose_matrix */
655  CONTEXT_MATRIX_T(ModelviewMatrixStack), NO_EXTRA },
657  CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA },
659 
660  /* GL_EXT_fog_coord */
662  CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]),
665  extra_EXT_fog_coord },
667  extra_EXT_fog_coord },
669  extra_EXT_fog_coord },
670  { GL_FOG_COORDINATE_SOURCE_EXT, CONTEXT_ENUM(Fog.FogCoordinateSource),
671  extra_EXT_fog_coord },
672 
673  /* GL_NV_fog_distance */
674  { GL_FOG_DISTANCE_MODE_NV, CONTEXT_ENUM(Fog.FogDistanceMode),
675  extra_NV_fog_distance },
676 
677  /* GL_IBM_rasterpos_clip */
679  CONTEXT_BOOL(Transform.RasterPositionUnclipped),
680  extra_IBM_rasterpos_clip },
681 
682  /* GL_NV_point_sprite */
684  CONTEXT_ENUM(Point.SpriteRMode), extra_NV_point_sprite },
686  extra_NV_point_sprite_ARB_point_sprite },
687 
688  /* GL_NV_light_max_exponent */
689  { GL_MAX_SHININESS_NV, CONTEXT_FLOAT(Const.MaxShininess),
690  extra_NV_light_max_exponent },
691  { GL_MAX_SPOT_EXPONENT_NV, CONTEXT_FLOAT(Const.MaxSpotExponent),
692  extra_NV_light_max_exponent },
693 
694  /* GL_ARB_vertex_buffer_object */
696  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR_INDEX].BufferObj), NO_EXTRA },
698  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_EDGEFLAG].BufferObj), NO_EXTRA },
700  offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_FOG].BufferObj), NO_EXTRA },
701 
702  /* GL_EXT_depth_bounds_test */
704  extra_EXT_depth_bounds_test },
706  extra_EXT_depth_bounds_test },
707 
708  /* GL_EXT_texture_integer */
709  { GL_RGBA_INTEGER_MODE_EXT, BUFFER_BOOL(_IntegerColor),
711 
712  /* GL 3.0 */
714  { GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
715  { GL_MINOR_VERSION, CONTEXT_INT(VersionMinor), extra_version_30 },
716  { GL_CONTEXT_FLAGS, CONTEXT_INT(Const.ContextFlags), extra_version_30 },
717 
718 
719  /* GL 3.2 */
720  { GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask),
722 };
723 
724 /* All we need now is a way to look up the value struct from the enum.
725  * The code generated by gcc for the old generated big switch
726  * statement is a big, balanced, open coded if/else tree, essentially
727  * an unrolled binary search. It would be natural to sort the new
728  * enum table and use bsearch(), but we will use a read-only hash
729  * table instead. bsearch() has a nice guaranteed worst case
730  * performance, but we're also guaranteed to hit that worst case
731  * (log2(n) iterations) for about half the enums. Instead, using an
732  * open addressing hash table, we can find the enum on the first try
733  * for 80% of the enums, 1 collision for 10% and never more than 5
734  * collisions for any enum (typical numbers). And the code is very
735  * simple, even though it feels a little magic. */
736 
737 static unsigned short table[1024];
738 static const int prime_factor = 89, prime_step = 281;
739 
740 #ifdef GET_DEBUG
741 static void
742 print_table_stats(void)
743 {
744  int i, j, collisions[11], count, hash, mask;
745  const struct value_desc *d;
746 
747  count = 0;
748  mask = Elements(table) - 1;
749  memset(collisions, 0, sizeof collisions);
750 
751  for (i = 0; i < Elements(table); i++) {
752  if (!table[i])
753  continue;
754  count++;
755  d = &values[table[i]];
756  hash = (d->pname * prime_factor);
757  j = 0;
758  while (1) {
759  if (values[table[hash & mask]].pname == d->pname)
760  break;
761  hash += prime_step;
762  j++;
763  }
764 
765  if (j < 10)
766  collisions[j]++;
767  else
768  collisions[10]++;
769  }
770 
771  printf("number of enums: %d (total %d)\n", count, Elements(values));
772  for (i = 0; i < Elements(collisions) - 1; i++)
773  if (collisions[i] > 0)
774  printf(" %d enums with %d %scollisions\n",
775  collisions[i], i, i == 10 ? "or more " : "");
776 }
777 #endif
778 
788 {
789  int i, hash, index, mask;
790 
791  mask = Elements(table) - 1;
792 
793  for (i = 0; i < Elements(values); i++) {
794 
795  hash = (values[i].pname * prime_factor) & mask;
796  while (1) {
797  index = hash & mask;
798  if (!table[index]) {
799  table[index] = i;
800  break;
801  }
802  hash += prime_step;
803  }
804  }
805 
806 #ifdef GET_DEBUG
807  print_table_stats();
808 #endif
809 }
810 
827 static void
828 find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v)
829 {
830  struct gl_buffer_object **buffer_obj;
831  struct gl_client_array *array;
832  GLuint *p;
833 
834  switch (d->pname) {
835  case GL_TEXTURE_1D:
836  case GL_TEXTURE_2D:
838  v->value_bool = _mesa_IsEnabled(d->pname);
839  break;
840 
842  /* This is the only GLushort, special case it here by promoting
843  * to an int rather than introducing a new type. */
844  v->value_int = ctx->Line.StipplePattern;
845  break;
846 
848  v->value_float_4[0] = ctx->Current.RasterTexCoords[0];
849  v->value_float_4[1] = ctx->Current.RasterTexCoords[1];
850  v->value_float_4[2] = ctx->Current.RasterTexCoords[2];
851  v->value_float_4[3] = ctx->Current.RasterTexCoords[3];
852  break;
853 
855  v->value_float_4[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX][0];
856  v->value_float_4[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX][1];
857  v->value_float_4[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX][2];
858  v->value_float_4[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX][3];
859  break;
860 
861  case GL_COLOR_WRITEMASK:
862  v->value_int_4[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0;
863  v->value_int_4[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0;
864  v->value_int_4[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0;
865  v->value_int_4[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0;
866  break;
867 
868  case GL_EDGE_FLAG:
869  v->value_bool = ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0;
870  break;
871 
872  case GL_READ_BUFFER:
873  v->value_enum = ctx->ReadBuffer->ColorReadBuffer;
874  break;
875 
876  case GL_MAP2_GRID_DOMAIN:
877  v->value_float_4[0] = ctx->Eval.MapGrid2u1;
878  v->value_float_4[1] = ctx->Eval.MapGrid2u2;
879  v->value_float_4[2] = ctx->Eval.MapGrid2v1;
880  v->value_float_4[3] = ctx->Eval.MapGrid2v2;
881  break;
882 
884  v->value_int = ctx->TextureMatrixStack.Depth + 1;
885  break;
886  case GL_TEXTURE_MATRIX:
887  v->value_matrix = ctx->TextureMatrixStack.Top;
888  break;
889 
894  array = &ctx->Array.VertexAttrib[VERT_ATTRIB_TEX];
895  v->value_int = *(GLuint *) ((char *) array + d->offset);
896  break;
897 
900  v->value_int = *(GLint *) ((char *) ctx + d->offset) + 1;
901  break;
902 
903  case GL_MAX_TEXTURE_SIZE:
906  p = (GLuint *) ((char *) ctx + d->offset);
907  v->value_int = 1 << (*p - 1);
908  break;
909 
910  case GL_SCISSOR_BOX:
911  v->value_int_4[0] = ctx->Scissor.X;
912  v->value_int_4[1] = ctx->Scissor.Y;
913  v->value_int_4[2] = ctx->Scissor.Width;
914  v->value_int_4[3] = ctx->Scissor.Height;
915  break;
916 
917  case GL_LIST_INDEX:
918  v->value_int =
919  ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0;
920  break;
921  case GL_LIST_MODE:
922  if (!ctx->CompileFlag)
923  v->value_enum = 0;
924  else if (ctx->ExecuteFlag)
925  v->value_enum = GL_COMPILE_AND_EXECUTE;
926  else
927  v->value_enum = GL_COMPILE;
928  break;
929 
930  case GL_VIEWPORT:
931  v->value_int_4[0] = ctx->Viewport.X;
932  v->value_int_4[1] = ctx->Viewport.Y;
933  v->value_int_4[2] = ctx->Viewport.Width;
934  v->value_int_4[3] = ctx->Viewport.Height;
935  break;
936 
937  case GL_STENCIL_FAIL:
938  v->value_enum = ctx->Stencil.FailFunc;
939  break;
940  case GL_STENCIL_FUNC:
941  v->value_enum = ctx->Stencil.Function;
942  break;
944  v->value_enum = ctx->Stencil.ZFailFunc;
945  break;
947  v->value_enum = ctx->Stencil.ZPassFunc;
948  break;
949  case GL_STENCIL_REF:
950  v->value_int = ctx->Stencil.Ref;
951  break;
953  v->value_int = ctx->Stencil.ValueMask;
954  break;
956  v->value_int = ctx->Stencil.WriteMask;
957  break;
958 
959  case GL_NUM_EXTENSIONS:
960  v->value_int = _mesa_get_extension_count(ctx);
961  break;
962 
964  v->value_int = _mesa_get_color_read_type(ctx);
965  break;
967  v->value_int = _mesa_get_color_read_format(ctx);
968  break;
969 
971  v->value_int = ctx->CurrentStack->Depth + 1;
972  break;
975  v->value_matrix = ctx->CurrentStack->Top;
976  break;
977 
978  /* Various object names */
979 
984  v->value_int =
985  ctx->Texture.Unit.CurrentTex[d->offset]->Name;
986  break;
987 
988  /* GL_ARB_vertex_buffer_object */
996  buffer_obj = (struct gl_buffer_object **)
997  ((char *) &ctx->Array + d->offset);
998  v->value_int = (*buffer_obj)->Name;
999  break;
1001  v->value_int =
1002  ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].BufferObj->Name;
1003  break;
1005  v->value_int = ctx->Array.ElementArrayBufferObj->Name;
1006  break;
1007 
1008  case GL_FOG_COLOR:
1009  COPY_4FV(v->value_float_4, ctx->Fog.Color);
1010  break;
1011  case GL_COLOR_CLEAR_VALUE:
1012  v->value_float_4[0] = ctx->Color.ClearColor.f[0];
1013  v->value_float_4[1] = ctx->Color.ClearColor.f[1];
1014  v->value_float_4[2] = ctx->Color.ClearColor.f[2];
1015  v->value_float_4[3] = ctx->Color.ClearColor.f[3];
1016  break;
1017  case GL_ALPHA_TEST_REF:
1018  v->value_float = ctx->Color.AlphaRef;
1019  break;
1020  }
1021 }
1022 
1038 static GLboolean
1039 check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d)
1040 {
1041  const GLuint version = ctx->VersionMajor * 10 + ctx->VersionMinor;
1042  int total, enabled;
1043  const int *e;
1044 
1045  total = 0;
1046  enabled = 0;
1047  for (e = d->extra; *e != EXTRA_END; e++)
1048  switch (*e) {
1049  case EXTRA_VERSION_30:
1050  if (version >= 30) {
1051  total++;
1052  enabled++;
1053  }
1054  break;
1055  case EXTRA_VERSION_31:
1056  if (version >= 31) {
1057  total++;
1058  enabled++;
1059  }
1060  break;
1061  case EXTRA_VERSION_32:
1062  if (version >= 32) {
1063  total++;
1064  enabled++;
1065  }
1066  break;
1067  case EXTRA_NEW_BUFFERS:
1068  if (ctx->NewState & _NEW_BUFFERS)
1069  _mesa_update_state(ctx);
1070  break;
1071  case EXTRA_FLUSH_CURRENT:
1072  FLUSH_CURRENT(ctx, 0);
1073  break;
1075  if (d->pname - GL_CLIP_DISTANCE0 >= ctx->Const.MaxClipPlanes) {
1076  _mesa_error(ctx, GL_INVALID_ENUM, "%s(clip distance %u)",
1077  func, d->pname - GL_CLIP_DISTANCE0);
1078  return GL_FALSE;
1079  }
1080  break;
1081  case EXTRA_END:
1082  break;
1083  default: /* *e is a offset into the extension struct */
1084  total++;
1085  if (*(GLboolean *) ((char *) &ctx->Extensions + *e))
1086  enabled++;
1087  break;
1088  }
1089 
1090  if (total > 0 && enabled == 0) {
1091  _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
1092  _mesa_lookup_enum_by_nr(d->pname));
1093  return GL_FALSE;
1094  }
1095 
1096  return GL_TRUE;
1097 }
1098 
1099 static const struct value_desc error_value =
1100  { 0, 0, TYPE_INVALID, NO_OFFSET, NO_EXTRA };
1101 
1124 static const struct value_desc *
1125 find_value(const char *func, GLenum pname, void **p, union value *v)
1126 {
1127  GET_CURRENT_CONTEXT(ctx);
1128  struct gl_texture_unit *unit;
1129  int mask, hash;
1130  const struct value_desc *d;
1131 
1132  mask = Elements(table) - 1;
1133  hash = (pname * prime_factor);
1134  while (1) {
1135  int idx = table[hash & mask];
1136 
1137  /* If the enum isn't valid, the hash walk ends with index 0,
1138  * pointing to the first entry of values[] which doesn't hold
1139  * any valid enum. */
1140  if (unlikely(idx == 0)) {
1141  _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
1143  return &error_value;
1144  }
1145 
1146  d = &values[idx];
1147  if (likely(d->pname == pname))
1148  break;
1149 
1150  hash += prime_step;
1151  }
1152 
1153  if (unlikely(d->extra && !check_extra(ctx, func, d)))
1154  return &error_value;
1155 
1156  switch (d->location) {
1157  case LOC_BUFFER:
1158  *p = ((char *) ctx->DrawBuffer + d->offset);
1159  return d;
1160  case LOC_CONTEXT:
1161  *p = ((char *) ctx + d->offset);
1162  return d;
1163  case LOC_ARRAY:
1164  *p = ((char *)&ctx->Array + d->offset);
1165  return d;
1166  case LOC_TEXUNIT:
1167  unit = &ctx->Texture.Unit;
1168  *p = ((char *) unit + d->offset);
1169  return d;
1170  case LOC_CUSTOM:
1171  find_custom_value(ctx, d, v);
1172  *p = v;
1173  return d;
1174  default:
1175  assert(0);
1176  break;
1177  }
1178 
1179  /* silence warning */
1180  return &error_value;
1181 }
1182 
1183 static const int transpose[] = {
1184  0, 4, 8, 12,
1185  1, 5, 9, 13,
1186  2, 6, 10, 14,
1187  3, 7, 11, 15
1188 };
1189 
1190 void GLAPIENTRY
1192 {
1193  const struct value_desc *d;
1194  union value v;
1195  GLmatrix *m;
1196  int shift, i;
1197  void *p;
1198  GET_CURRENT_CONTEXT(ctx);
1199 
1201 
1202  d = find_value("glGetBooleanv", pname, &p, &v);
1203  switch (d->type) {
1204  case TYPE_INVALID:
1205  break;
1206  case TYPE_CONST:
1207  params[0] = INT_TO_BOOLEAN(d->offset);
1208  break;
1209 
1210  case TYPE_FLOAT_4:
1211  case TYPE_FLOATN_4:
1212  params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]);
1213  case TYPE_FLOAT_3:
1214  case TYPE_FLOATN_3:
1215  params[2] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[2]);
1216  case TYPE_FLOAT_2:
1217  case TYPE_FLOATN_2:
1218  params[1] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[1]);
1219  case TYPE_FLOAT:
1220  case TYPE_FLOATN:
1221  params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]);
1222  break;
1223 
1224  case TYPE_DOUBLEN:
1225  params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]);
1226  break;
1227 
1228  case TYPE_INT_4:
1229  params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]);
1230  case TYPE_INT_3:
1231  params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]);
1232  case TYPE_INT_2:
1233  case TYPE_ENUM_2:
1234  params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]);
1235  case TYPE_INT:
1236  case TYPE_ENUM:
1237  params[0] = INT_TO_BOOLEAN(((GLint *) p)[0]);
1238  break;
1239 
1240  case TYPE_INT_N:
1241  for (i = 0; i < v.value_int_n.n; i++)
1242  params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
1243  break;
1244 
1245  case TYPE_INT64:
1246  params[0] = INT64_TO_BOOLEAN(((GLint64 *) p)[0]);
1247  break;
1248 
1249  case TYPE_BOOLEAN:
1250  params[0] = ((GLboolean*) p)[0];
1251  break;
1252 
1253  case TYPE_MATRIX:
1254  m = *(GLmatrix **) p;
1255  for (i = 0; i < 16; i++)
1256  params[i] = FLOAT_TO_BOOLEAN(m->m[i]);
1257  break;
1258 
1259  case TYPE_MATRIX_T:
1260  m = *(GLmatrix **) p;
1261  for (i = 0; i < 16; i++)
1262  params[i] = FLOAT_TO_BOOLEAN(m->m[transpose[i]]);
1263  break;
1264 
1265  case TYPE_BIT_0:
1266  case TYPE_BIT_1:
1267  case TYPE_BIT_2:
1268  case TYPE_BIT_3:
1269  case TYPE_BIT_4:
1270  case TYPE_BIT_5:
1271  case TYPE_BIT_6:
1272  case TYPE_BIT_7:
1273  shift = d->type - TYPE_BIT_0;
1274  params[0] = (*(GLbitfield *) p >> shift) & 1;
1275  break;
1276  }
1277 }
1278 
1279 void GLAPIENTRY
1281 {
1282  const struct value_desc *d;
1283  union value v;
1284  GLmatrix *m;
1285  int shift, i;
1286  void *p;
1287  GET_CURRENT_CONTEXT(ctx);
1288 
1290 
1291  d = find_value("glGetFloatv", pname, &p, &v);
1292  switch (d->type) {
1293  case TYPE_INVALID:
1294  break;
1295  case TYPE_CONST:
1296  params[0] = (GLfloat) d->offset;
1297  break;
1298 
1299  case TYPE_FLOAT_4:
1300  case TYPE_FLOATN_4:
1301  params[3] = ((GLfloat *) p)[3];
1302  case TYPE_FLOAT_3:
1303  case TYPE_FLOATN_3:
1304  params[2] = ((GLfloat *) p)[2];
1305  case TYPE_FLOAT_2:
1306  case TYPE_FLOATN_2:
1307  params[1] = ((GLfloat *) p)[1];
1308  case TYPE_FLOAT:
1309  case TYPE_FLOATN:
1310  params[0] = ((GLfloat *) p)[0];
1311  break;
1312 
1313  case TYPE_DOUBLEN:
1314  params[0] = ((GLdouble *) p)[0];
1315  break;
1316 
1317  case TYPE_INT_4:
1318  params[3] = (GLfloat) (((GLint *) p)[3]);
1319  case TYPE_INT_3:
1320  params[2] = (GLfloat) (((GLint *) p)[2]);
1321  case TYPE_INT_2:
1322  case TYPE_ENUM_2:
1323  params[1] = (GLfloat) (((GLint *) p)[1]);
1324  case TYPE_INT:
1325  case TYPE_ENUM:
1326  params[0] = (GLfloat) (((GLint *) p)[0]);
1327  break;
1328 
1329  case TYPE_INT_N:
1330  for (i = 0; i < v.value_int_n.n; i++)
1331  params[i] = INT_TO_FLOAT(v.value_int_n.ints[i]);
1332  break;
1333 
1334  case TYPE_INT64:
1335  params[0] = ((GLint64 *) p)[0];
1336  break;
1337 
1338  case TYPE_BOOLEAN:
1339  params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p);
1340  break;
1341 
1342  case TYPE_MATRIX:
1343  m = *(GLmatrix **) p;
1344  for (i = 0; i < 16; i++)
1345  params[i] = m->m[i];
1346  break;
1347 
1348  case TYPE_MATRIX_T:
1349  m = *(GLmatrix **) p;
1350  for (i = 0; i < 16; i++)
1351  params[i] = m->m[transpose[i]];
1352  break;
1353 
1354  case TYPE_BIT_0:
1355  case TYPE_BIT_1:
1356  case TYPE_BIT_2:
1357  case TYPE_BIT_3:
1358  case TYPE_BIT_4:
1359  case TYPE_BIT_5:
1360  case TYPE_BIT_6:
1361  case TYPE_BIT_7:
1362  shift = d->type - TYPE_BIT_0;
1363  params[0] = BOOLEAN_TO_FLOAT((*(GLbitfield *) p >> shift) & 1);
1364  break;
1365  }
1366 }
1367 
1368 void GLAPIENTRY
1370 {
1371  const struct value_desc *d;
1372  union value v;
1373  GLmatrix *m;
1374  int shift, i;
1375  void *p;
1376  GET_CURRENT_CONTEXT(ctx);
1377 
1379 
1380  d = find_value("glGetIntegerv", pname, &p, &v);
1381  switch (d->type) {
1382  case TYPE_INVALID:
1383  break;
1384  case TYPE_CONST:
1385  params[0] = d->offset;
1386  break;
1387 
1388  case TYPE_FLOAT_4:
1389  params[3] = IROUND(((GLfloat *) p)[3]);
1390  case TYPE_FLOAT_3:
1391  params[2] = IROUND(((GLfloat *) p)[2]);
1392  case TYPE_FLOAT_2:
1393  params[1] = IROUND(((GLfloat *) p)[1]);
1394  case TYPE_FLOAT:
1395  params[0] = IROUND(((GLfloat *) p)[0]);
1396  break;
1397 
1398  case TYPE_FLOATN_4:
1399  params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]);
1400  case TYPE_FLOATN_3:
1401  params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]);
1402  case TYPE_FLOATN_2:
1403  params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]);
1404  case TYPE_FLOATN:
1405  params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]);
1406  break;
1407 
1408  case TYPE_DOUBLEN:
1409  params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]);
1410  break;
1411 
1412  case TYPE_INT_4:
1413  params[3] = ((GLint *) p)[3];
1414  case TYPE_INT_3:
1415  params[2] = ((GLint *) p)[2];
1416  case TYPE_INT_2:
1417  case TYPE_ENUM_2:
1418  params[1] = ((GLint *) p)[1];
1419  case TYPE_INT:
1420  case TYPE_ENUM:
1421  params[0] = ((GLint *) p)[0];
1422  break;
1423 
1424  case TYPE_INT_N:
1425  for (i = 0; i < v.value_int_n.n; i++)
1426  params[i] = v.value_int_n.ints[i];
1427  break;
1428 
1429  case TYPE_INT64:
1430  params[0] = INT64_TO_INT(((GLint64 *) p)[0]);
1431  break;
1432 
1433  case TYPE_BOOLEAN:
1434  params[0] = BOOLEAN_TO_INT(*(GLboolean*) p);
1435  break;
1436 
1437  case TYPE_MATRIX:
1438  m = *(GLmatrix **) p;
1439  for (i = 0; i < 16; i++)
1440  params[i] = FLOAT_TO_INT(m->m[i]);
1441  break;
1442 
1443  case TYPE_MATRIX_T:
1444  m = *(GLmatrix **) p;
1445  for (i = 0; i < 16; i++)
1446  params[i] = FLOAT_TO_INT(m->m[transpose[i]]);
1447  break;
1448 
1449  case TYPE_BIT_0:
1450  case TYPE_BIT_1:
1451  case TYPE_BIT_2:
1452  case TYPE_BIT_3:
1453  case TYPE_BIT_4:
1454  case TYPE_BIT_5:
1455  case TYPE_BIT_6:
1456  case TYPE_BIT_7:
1457  shift = d->type - TYPE_BIT_0;
1458  params[0] = (*(GLbitfield *) p >> shift) & 1;
1459  break;
1460  }
1461 }
1462 
1463 
1464 void GLAPIENTRY
1466 {
1467  const struct value_desc *d;
1468  union value v;
1469  GLmatrix *m;
1470  int shift, i;
1471  void *p;
1472  GET_CURRENT_CONTEXT(ctx);
1473 
1475 
1476  d = find_value("glGetDoublev", pname, &p, &v);
1477  switch (d->type) {
1478  case TYPE_INVALID:
1479  break;
1480  case TYPE_CONST:
1481  params[0] = d->offset;
1482  break;
1483 
1484  case TYPE_FLOAT_4:
1485  case TYPE_FLOATN_4:
1486  params[3] = ((GLfloat *) p)[3];
1487  case TYPE_FLOAT_3:
1488  case TYPE_FLOATN_3:
1489  params[2] = ((GLfloat *) p)[2];
1490  case TYPE_FLOAT_2:
1491  case TYPE_FLOATN_2:
1492  params[1] = ((GLfloat *) p)[1];
1493  case TYPE_FLOAT:
1494  case TYPE_FLOATN:
1495  params[0] = ((GLfloat *) p)[0];
1496  break;
1497 
1498  case TYPE_DOUBLEN:
1499  params[0] = ((GLdouble *) p)[0];
1500  break;
1501 
1502  case TYPE_INT_4:
1503  params[3] = ((GLint *) p)[3];
1504  case TYPE_INT_3:
1505  params[2] = ((GLint *) p)[2];
1506  case TYPE_INT_2:
1507  case TYPE_ENUM_2:
1508  params[1] = ((GLint *) p)[1];
1509  case TYPE_INT:
1510  case TYPE_ENUM:
1511  params[0] = ((GLint *) p)[0];
1512  break;
1513 
1514  case TYPE_INT_N:
1515  for (i = 0; i < v.value_int_n.n; i++)
1516  params[i] = v.value_int_n.ints[i];
1517  break;
1518 
1519  case TYPE_INT64:
1520  params[0] = ((GLint64 *) p)[0];
1521  break;
1522 
1523  case TYPE_BOOLEAN:
1524  params[0] = *(GLboolean*) p;
1525  break;
1526 
1527  case TYPE_MATRIX:
1528  m = *(GLmatrix **) p;
1529  for (i = 0; i < 16; i++)
1530  params[i] = m->m[i];
1531  break;
1532 
1533  case TYPE_MATRIX_T:
1534  m = *(GLmatrix **) p;
1535  for (i = 0; i < 16; i++)
1536  params[i] = m->m[transpose[i]];
1537  break;
1538 
1539  case TYPE_BIT_0:
1540  case TYPE_BIT_1:
1541  case TYPE_BIT_2:
1542  case TYPE_BIT_3:
1543  case TYPE_BIT_4:
1544  case TYPE_BIT_5:
1545  case TYPE_BIT_6:
1546  case TYPE_BIT_7:
1547  shift = d->type - TYPE_BIT_0;
1548  params[0] = (*(GLbitfield *) p >> shift) & 1;
1549  break;
1550  }
1551 }
1552 
1553 #if FEATURE_ES1
1554 void GLAPIENTRY
1556 {
1557  const struct value_desc *d;
1558  union value v;
1559  GLmatrix *m;
1560  int shift, i;
1561  void *p;
1562 
1563  d = find_value("glGetDoublev", pname, &p, &v);
1564  switch (d->type) {
1565  case TYPE_INVALID:
1566  break;
1567  case TYPE_CONST:
1568  params[0] = INT_TO_FIXED(d->offset);
1569  break;
1570 
1571  case TYPE_FLOAT_4:
1572  case TYPE_FLOATN_4:
1573  params[3] = FLOAT_TO_FIXED(((GLfloat *) p)[3]);
1574  case TYPE_FLOAT_3:
1575  case TYPE_FLOATN_3:
1576  params[2] = FLOAT_TO_FIXED(((GLfloat *) p)[2]);
1577  case TYPE_FLOAT_2:
1578  case TYPE_FLOATN_2:
1579  params[1] = FLOAT_TO_FIXED(((GLfloat *) p)[1]);
1580  case TYPE_FLOAT:
1581  case TYPE_FLOATN:
1582  params[0] = FLOAT_TO_FIXED(((GLfloat *) p)[0]);
1583  break;
1584 
1585  case TYPE_DOUBLEN:
1586  params[0] = FLOAT_TO_FIXED(((GLdouble *) p)[0]);
1587  break;
1588 
1589  case TYPE_INT_4:
1590  params[3] = INT_TO_FIXED(((GLint *) p)[3]);
1591  case TYPE_INT_3:
1592  params[2] = INT_TO_FIXED(((GLint *) p)[2]);
1593  case TYPE_INT_2:
1594  case TYPE_ENUM_2:
1595  params[1] = INT_TO_FIXED(((GLint *) p)[1]);
1596  case TYPE_INT:
1597  case TYPE_ENUM:
1598  params[0] = INT_TO_FIXED(((GLint *) p)[0]);
1599  break;
1600 
1601  case TYPE_INT_N:
1602  for (i = 0; i < v.value_int_n.n; i++)
1603  params[i] = INT_TO_FIXED(v.value_int_n.ints[i]);
1604  break;
1605 
1606  case TYPE_INT64:
1607  params[0] = ((GLint64 *) p)[0];
1608  break;
1609 
1610  case TYPE_BOOLEAN:
1611  params[0] = BOOLEAN_TO_FIXED(((GLboolean*) p)[0]);
1612  break;
1613 
1614  case TYPE_MATRIX:
1615  m = *(GLmatrix **) p;
1616  for (i = 0; i < 16; i++)
1617  params[i] = FLOAT_TO_FIXED(m->m[i]);
1618  break;
1619 
1620  case TYPE_MATRIX_T:
1621  m = *(GLmatrix **) p;
1622  for (i = 0; i < 16; i++)
1623  params[i] = FLOAT_TO_FIXED(m->m[transpose[i]]);
1624  break;
1625 
1626  case TYPE_BIT_0:
1627  case TYPE_BIT_1:
1628  case TYPE_BIT_2:
1629  case TYPE_BIT_3:
1630  case TYPE_BIT_4:
1631  case TYPE_BIT_5:
1632  case TYPE_BIT_6:
1633  case TYPE_BIT_7:
1634  shift = d->type - TYPE_BIT_0;
1635  params[0] = BOOLEAN_TO_FIXED((*(GLbitfield *) p >> shift) & 1);
1636  break;
1637  }
1638 }
1639 #endif
#define GL_NORMAL_ARRAY_COUNT_EXT
Definition: glext.h:2676
#define GL_MAP1_VERTEX_4
Definition: gl.h:559
GLint n
Definition: get.c:150
#define GL_FOG_DENSITY
Definition: gl.h:416
#define GL_STENCIL_FUNC
Definition: gl.h:451
#define GL_DEPTH_BITS
Definition: gl.h:302
#define CONTEXT_INT(field)
Definition: get.c:168
#define IROUND(f)
Definition: imports.h:321
#define GL_SAMPLE_COVERAGE_ARB
Definition: glext.h:1216
#define GL_CLIP_DISTANCE7
Definition: glext.h:513
#define GL_LIGHT2
Definition: gl.h:313
static const int extra_EXT_texture_integer[]
Definition: get.c:244
#define GL_LIST_MODE
Definition: gl.h:290
static const int extra_version_30[]
Definition: get.c:261
#define GL_NORMAL_ARRAY_TYPE
Definition: gl.h:211
void GLAPIENTRY _mesa_GetFloatv(GLenum pname, GLfloat *params)
Definition: get.c:1280
GLubyte location
Definition: get.c:133
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define GL_UNPACK_IMAGE_HEIGHT_EXT
Definition: glext.h:2470
struct gl_matrix_stack * CurrentStack
Definition: mtypes.h:1785
#define GL_BLEND_SRC_RGB_EXT
Definition: glext.h:3300
Definition: get.c:83
#define GL_POINT_SMOOTH
Definition: gl.h:250
#define MAX_ATTRIB_STACK_DEPTH
Definition: config.h:53
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
void GLAPIENTRY _mesa_GetDoublev(GLenum pname, GLdouble *params)
Definition: get.c:1465
#define GL_VIEWPORT
Definition: gl.h:547
Definition: get.c:139
#define GL_CURRENT_RASTER_POSITION
Definition: gl.h:531
Definition: get.c:93
#define GL_PIXEL_MAP_I_TO_I_SIZE
Definition: gl.h:607
#define GL_POLYGON_OFFSET_FACTOR
Definition: gl.h:279
#define GL_UNPACK_SWAP_BYTES
Definition: gl.h:637
#define shift
Definition: input.c:1668
#define GL_POINT_SPRITE_COORD_ORIGIN
Definition: glext.h:460
#define GL_SAMPLE_COVERAGE_INVERT_ARB
Definition: glext.h:1220
#define likely(x)
Definition: compiler.h:186
#define GL_TEXTURE_COORD_ARRAY_TYPE
Definition: gl.h:219
double GLdouble
Definition: gl.h:163
GLuint VersionMajor
Definition: mtypes.h:1801
#define COPY_4FV(DST, SRC)
Definition: macros.h:248
value_extra
Definition: get.c:117
#define FLUSH_CURRENT(ctx, newstate)
Definition: context.h:223
#define GL_PACK_SKIP_IMAGES_EXT
Definition: glext.h:2467
#define GL_MAP1_COLOR_4
Definition: gl.h:551
Type
Definition: Type.h:6
GLboolean ExecuteFlag
Definition: mtypes.h:1794
#define MAX_TEXTURE_STACK_DEPTH
Definition: config.h:47
#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1491
#define NO_OFFSET
Definition: get.c:129
Definition: get.c:94
#define GL_SHADE_MODEL
Definition: gl.h:337
static const int extra_flush_current_valid_texture_unit[]
Definition: get.c:227
#define GL_COLOR_ARRAY_STRIDE
Definition: gl.h:215
#define GL_BLEND
Definition: gl.h:371
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
Definition: polytest.cpp:730
#define GL_MAX_ATTRIB_STACK_DEPTH
Definition: gl.h:512
#define GL_CULL_FACE
Definition: gl.h:276
#define GL_ACTIVE_TEXTURE
Definition: gl.h:1782
#define CONTEXT_BIT5(field)
Definition: get.c:179
#define GL_LINE_STIPPLE_REPEAT
Definition: gl.h:259
#define MAX_LIST_NESTING
Definition: config.h:59
#define GL_POLYGON_OFFSET_POINT
Definition: gl.h:281
#define GL_CURRENT_INDEX
Definition: gl.h:525
#define GL_PIXEL_MAP_S_TO_S_SIZE
Definition: gl.h:606
#define GL_CURRENT_RASTER_DISTANCE
Definition: gl.h:529
#define GL_TEXTURE_COORD_ARRAY_SIZE
Definition: gl.h:218
#define EXTRA_EXT(e)
Definition: get.c:196
#define GL_MAX_TEXTURE_SIZE
Definition: gl.h:510
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
Definition: glext.h:1239
#define GL_POINT_SIZE_RANGE
Definition: gl.h:253
#define GL_EDGE_FLAG_ARRAY_COUNT_EXT
Definition: glext.h:2689
#define GL_TRANSPOSE_CURRENT_MATRIX_ARB
Definition: glext.h:1430
static const int extra_flush_current[]
Definition: get.c:233
#define GL_CURRENT_COLOR
Definition: gl.h:526
#define GL_FALSE
Definition: gl.h:173
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define BOOLEAN_TO_INT(B)
Definition: get.c:68
#define INT_TO_FLOAT(I)
Definition: macros.h:99
#define FLOAT_TO_FIXED(F)
Definition: get.c:56
GLenum _mesa_get_color_read_format(struct gl_context *ctx)
Definition: framebuffer.c:594
void GLAPIENTRY _mesa_GetFixedv(GLenum pname, GLfixed *params)
#define GL_MAP2_GRID_SEGMENTS
Definition: gl.h:572
#define GL_FOG_HINT
Definition: gl.h:582
#define GL_CONTEXT_PROFILE_MASK
Definition: glext.h:831
#define GL_LINE_STIPPLE
Definition: gl.h:257
#define GL_CURRENT_RASTER_INDEX
Definition: gl.h:530
#define GL_MAP1_INDEX
Definition: gl.h:552
#define GL_CLIP_DISTANCE3
Definition: glext.h:509
#define GL_STENCIL_BITS
Definition: gl.h:448
#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB
Definition: glext.h:1395
#define GL_POLYGON_OFFSET_UNITS
Definition: gl.h:280
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
#define GL_COLOR_ARRAY
Definition: gl.h:204
int offset
Definition: get.c:135
#define GL_VERTEX_ARRAY_COUNT_EXT
Definition: glext.h:2673
#define GL_PROJECTION_STACK_DEPTH
Definition: gl.h:542
static const int prime_factor
Definition: get.c:738
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
#define GL_MAP2_TEXTURE_COORD_1
Definition: gl.h:563
#define GL_MAX_EVAL_ORDER
Definition: gl.h:507
#define GL_NORMAL_ARRAY
Definition: gl.h:203
int GLfixed
Definition: glheader.h:85
#define GL_CLIENT_ATTRIB_STACK_DEPTH
Definition: gl.h:522
#define GL_MAP_COLOR
Definition: gl.h:592
#define GL_PIXEL_MAP_I_TO_B_SIZE
Definition: gl.h:610
#define GL_FOG_END
Definition: gl.h:420
static const int prime_step
Definition: get.c:738
#define GL_MAX_TEXTURE_STACK_DEPTH
Definition: gl.h:516
#define CONTEXT_FIELD(field, type)
Definition: get.c:157
#define GL_VERTEX_ARRAY_TYPE
Definition: gl.h:209
#define GL_ALPHA_TEST_REF
Definition: gl.h:367
#define assert(x)
Definition: debug.h:53
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
Definition: glext.h:4372
#define GL_EDGE_FLAG_ARRAY
Definition: gl.h:207
#define GL_NORMAL_ARRAY_STRIDE
Definition: gl.h:212
#define CONTEXT_BIT2(field)
Definition: get.c:176
#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
Definition: glext.h:3201
#define GL_LIGHT_MODEL_TWO_SIDE
Definition: gl.h:333
#define GL_MAP2_TEXTURE_COORD_4
Definition: gl.h:566
struct gl_current_attrib Current
Definition: mtypes.h:1818
#define GL_GREEN_SCALE
Definition: gl.h:598
GLuint _mesa_get_extension_count(struct gl_context *ctx)
Definition: extensions.c:581
#define CONTEXT_FLOAT(field)
Definition: get.c:182
#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1490
#define BOOLEAN_TO_FIXED(B)
Definition: get.c:71
struct gl_dlist_state ListState
Definition: mtypes.h:1792
#define GL_PERSPECTIVE_CORRECTION_HINT
Definition: gl.h:578
#define GL_RASTER_POSITION_UNCLIPPED_IBM
Definition: glext.h:3062
#define GL_DITHER
Definition: gl.h:501
GLsizei GLboolean transpose
Definition: glext.h:6077
#define _NEW_BUFFERS
Definition: mtypes.h:1609
#define GL_FOG_DISTANCE_MODE_NV
Definition: glext.h:3459
#define GL_UNPACK_SKIP_ROWS
Definition: gl.h:636
#define GL_PACK_SWAP_BYTES
Definition: gl.h:631
#define GL_PACK_IMAGE_HEIGHT_EXT
Definition: glext.h:2468
#define GL_BLEND_SRC
Definition: gl.h:372
#define GL_COLOR_WRITEMASK
Definition: gl.h:524
#define GL_STEREO
Definition: gl.h:496
static const int extra_version_32[]
Definition: get.c:262
#define GL_CURRENT_FOG_COORDINATE_EXT
Definition: glext.h:3199
#define GL_POINT_SPRITE_R_MODE_NV
Definition: glext.h:4180
#define GL_MINOR_VERSION
Definition: glext.h:516
GLuint const GLubyte mask[]
Definition: s_context.h:57
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
#define GL_MAX_PROJECTION_STACK_DEPTH
Definition: gl.h:515
#define GL_MAX_SHININESS_NV
Definition: glext.h:3387
#define GL_MAX_3D_TEXTURE_SIZE
Definition: gl.h:1519
#define GL_PACK_ROW_LENGTH
Definition: gl.h:628
#define GL_UNPACK_ROW_LENGTH
Definition: gl.h:634
#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1493
#define GL_LIGHT6
Definition: gl.h:317
#define GL_MAX_VIEWPORT_DIMS
Definition: gl.h:517
struct gl_extensions Extensions
Definition: mtypes.h:1798
GLmatrix * value_matrix
Definition: get.c:142
#define GL_MAP1_TEXTURE_COORD_2
Definition: gl.h:555
static const int extra_EXT_fog_coord_flush_current[]
Definition: get.c:238
#define GL_TEXTURE_GEN_R
Definition: gl.h:653
#define GL_PIXEL_MAP_R_TO_R_SIZE
Definition: gl.h:612
#define GL_UNPACK_ALIGNMENT
Definition: gl.h:632
#define GL_LINE_WIDTH
Definition: gl.h:260
#define GL_ATTRIB_STACK_DEPTH
Definition: gl.h:521
#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
Definition: glext.h:1206
#define GL_VERTEX_ARRAY
Definition: gl.h:202
#define GL_PIXEL_MAP_I_TO_G_SIZE
Definition: gl.h:609
#define GL_RED_BIAS
Definition: gl.h:597
Definition: get.c:80
#define GL_INDEX_BITS
Definition: gl.h:490
#define GL_EDGE_FLAG_ARRAY_STRIDE
Definition: gl.h:221
unsigned int GLbitfield
Definition: gl.h:152
#define GL_TEXTURE_CUBE_MAP_ARB
Definition: glext.h:1230
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
#define GL_MAX_ELEMENTS_VERTICES
Definition: gl.h:1482
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define GL_MAX_LIST_NESTING
Definition: gl.h:506
#define GL_INDEX_LOGIC_OP
Definition: gl.h:427
GLenum GLint GLuint mask
Definition: glext.h:6028
#define EXT(f)
Definition: get.c:193
GLint64 value_int64
Definition: get.c:145
#define GL_LIGHT0
Definition: gl.h:311
#define GL_VERTEX_ARRAY_STRIDE
Definition: gl.h:210
#define GL_BLUE_SCALE
Definition: gl.h:600
GLenum const GLfloat * params
Definition: glext.h:5645
#define BCOMP
Definition: txc_dxtn.h:35
int hash
Definition: main.c:58
#define GL_AUX_BUFFERS
Definition: gl.h:492
#define INT64_TO_BOOLEAN(I)
Definition: get.c:65
#define GL_TEXTURE_1D
Definition: gl.h:644
#define GL_LIGHT3
Definition: gl.h:314
#define GL_STENCIL_WRITEMASK
Definition: gl.h:457
#define GL_FOG_COORDINATE_SOURCE_EXT
Definition: glext.h:3196
#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
Definition: glext.h:3023
#define GL_BLEND_DST
Definition: gl.h:373
struct gl_constants Const
Definition: mtypes.h:1778
#define GL_CURRENT_RASTER_COLOR
Definition: gl.h:528
#define GL_CURRENT_TEXTURE_COORDS
Definition: gl.h:534
#define GL_PROJECTION_MATRIX
Definition: gl.h:541
#define GL_LIGHT_MODEL_AMBIENT
Definition: gl.h:335
#define e
Definition: ke_i.h:82
unsigned char GLboolean
Definition: gl.h:151
#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
Definition: gl.h:518
#define GL_POLYGON_OFFSET_LINE
Definition: gl.h:282
#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1489
Definition: get.c:79
#define MAX_PROJECTION_STACK_DEPTH
Definition: config.h:44
#define GL_DOUBLEBUFFER
Definition: gl.h:495
#define GL_STENCIL_PASS_DEPTH_FAIL
Definition: gl.h:454
#define unlikely(x)
Definition: compiler.h:187
unsigned int idx
Definition: utils.c:41
#define GL_LIGHT1
Definition: gl.h:312
#define GL_DEPTH_FUNC
Definition: gl.h:304
#define CONTEXT_MATRIX_T(field)
Definition: get.c:187
#define GL_MAP2_INDEX
Definition: gl.h:561
#define MAX_NAME_STACK_DEPTH
Definition: config.h:84
png_const_structrp png_const_inforp int * unit
Definition: png.h:2161
#define GL_POLYGON_OFFSET_FILL
Definition: gl.h:283
#define GL_PIXEL_MAP_I_TO_A_SIZE
Definition: gl.h:611
#define GL_BLEND_DST_RGB_EXT
Definition: glext.h:3299
#define GCOMP
Definition: txc_dxtn.h:34
#define GL_POINT_SIZE
Definition: gl.h:251
static const WCHAR version[]
Definition: asmname.c:64
#define offsetof(TYPE, MEMBER)
#define GL_POLYGON_MODE
Definition: gl.h:272
GLint value_int
Definition: get.c:143
#define GL_MAP2_TEXTURE_COORD_3
Definition: gl.h:565
#define CONTEXT_BOOL(field)
Definition: get.c:173
#define GL_UNPACK_SKIP_PIXELS
Definition: gl.h:635
#define GL_DEPTH_BIAS
Definition: gl.h:605
#define CONTEXT_BIT6(field)
Definition: get.c:180
#define GL_MAP2_VERTEX_4
Definition: gl.h:568
#define RCOMP
Definition: txc_dxtn.h:33
#define GL_MULTISAMPLE_ARB
Definition: glext.h:1213
Definition: get.c:118
#define GL_ALIASED_LINE_WIDTH_RANGE
Definition: gl.h:1510
#define GL_PACK_SKIP_ROWS
Definition: gl.h:630
#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
Definition: glext.h:1214
GLuint index
Definition: glext.h:6031
#define GL_LINE_SMOOTH_HINT
Definition: gl.h:580
Definition: get.c:90
struct gl_colorbuffer_attrib Color
Definition: mtypes.h:1817
static const int extra_valid_texture_unit[]
Definition: get.c:217
#define GL_POLYGON_STIPPLE
Definition: gl.h:274
#define GL_INDEX_ARRAY_COUNT_EXT
Definition: glext.h:2683
#define GL_INDEX_MODE
Definition: gl.h:536
#define GL_POINT_SMOOTH_HINT
Definition: gl.h:579
#define GL_INDEX_ARRAY
Definition: gl.h:205
#define GL_TEXTURE_GEN_Q
Definition: gl.h:654
#define GL_TEXTURE_BINDING_1D
Definition: gl.h:730
#define GL_LOGIC_OP_MODE
Definition: gl.h:429
float GLfloat
Definition: gl.h:161
Definition: get.c:92
#define GL_POINT_SPRITE_NV
Definition: glext.h:4178
#define GL_LINE_WIDTH_RANGE
Definition: gl.h:262
#define GL_CONTEXT_FLAGS
Definition: glext.h:518
struct gl_fog_attrib Fog
Definition: mtypes.h:1821
#define GL_INDEX_ARRAY_STRIDE
Definition: gl.h:217
#define INT_TO_FIXED(I)
Definition: get.c:61
#define GL_PACK_INVERT_MESA
Definition: glext.h:4393
#define GL_UNPACK_LSB_FIRST
Definition: gl.h:633
#define GL_FOG_MODE
Definition: gl.h:415
#define GL_SAMPLE_COVERAGE_VALUE_ARB
Definition: glext.h:1219
#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT
Definition: glext.h:2687
#define GL_LIST_INDEX
Definition: gl.h:289
struct gl_scissor_attrib Scissor
Definition: mtypes.h:1831
#define GL_SCISSOR_TEST
Definition: gl.h:589
#define GL_CURRENT_MATRIX_ARB
Definition: glext.h:1396
struct gl_texture_attrib Texture
Definition: mtypes.h:1833
#define FLOAT_TO_INT(X)
Definition: macros.h:106
#define GL_RED_SCALE
Definition: gl.h:596
#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB
Definition: glext.h:1207
struct gl_eval_attrib Eval
Definition: mtypes.h:1820
#define GL_RENDER_MODE
Definition: gl.h:543
#define GL_CURRENT_RASTER_TEXTURE_COORDS
Definition: gl.h:532
#define GL_LIGHT_MODEL_LOCAL_VIEWER
Definition: gl.h:334
#define GL_INDEX_ARRAY_TYPE
Definition: gl.h:216
#define d
Definition: ke_i.h:81
void _mesa_init_get_hash(struct gl_context *ctx)
Definition: get.c:787
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum array
Definition: glfuncs.h:84
LIST_ENTRY List
Definition: psmgr.c:57
#define GL_DEPTH_BOUNDS_EXT
Definition: glext.h:4378
#define CONTEXT_BIT1(field)
Definition: get.c:175
#define GL_FOG_INDEX
Definition: gl.h:418
#define CONST(value)
Definition: get.c:161
#define GL_FOG_COLOR
Definition: gl.h:417
#define GL_MAP1_TEXTURE_COORD_3
Definition: gl.h:556
#define GL_MAP1_TEXTURE_COORD_1
Definition: gl.h:554
#define GL_MAP1_NORMAL
Definition: gl.h:553
Definition: get.c:95
#define GL_MAP2_NORMAL
Definition: gl.h:562
#define GL_STENCIL_TEST
Definition: gl.h:449
#define GL_INDEX_WRITEMASK
Definition: gl.h:537
#define GL_ALPHA_TEST_FUNC
Definition: gl.h:368
#define CONTEXT_FLOAT2(field)
Definition: get.c:183
#define ARRAY_BOOL(field)
Definition: get.c:191
#define GL_SUBPIXEL_BITS
Definition: gl.h:491
#define BOOLEAN_TO_FLOAT(B)
Definition: get.c:70
#define MAX_CLIENT_ATTRIB_STACK_DEPTH
Definition: config.h:56
#define GL_MODELVIEW_MATRIX
Definition: gl.h:538
#define GL_STENCIL_REF
Definition: gl.h:456
#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1492
#define GL_MATRIX_MODE
Definition: gl.h:244
#define GL_MAP1_TEXTURE_COORD_4
Definition: gl.h:557
GLint ints[100]
Definition: get.c:150
Definition: get.c:88
#define GL_DEPTH_SCALE
Definition: gl.h:604
#define GL_STENCIL_CLEAR_VALUE
Definition: gl.h:450
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1496
GLfloat value_float_4[4]
Definition: get.c:141
#define FLOAT_TO_BOOLEAN(X)
Definition: get.c:55
#define GL_LIGHT5
Definition: gl.h:316
#define GL_COLOR_MATERIAL
Definition: gl.h:340
#define GL_LIGHTING
Definition: gl.h:310
#define GL_SELECTION_BUFFER_SIZE
Definition: gl.h:411
#define GL_COMPILE_AND_EXECUTE
Definition: gl.h:287
GLboolean GLAPIENTRY _mesa_IsEnabled(GLenum cap)
Definition: enable.c:729
#define GL_DEPTH_WRITEMASK
Definition: gl.h:306
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1497
#define GL_MAP2_COLOR_4
Definition: gl.h:560
#define GL_LIST_BASE
Definition: gl.h:288
#define GL_MAX_SPOT_EXPONENT_NV
Definition: glext.h:3388
#define GL_READ_BUFFER
Definition: gl.h:493
Definition: get.c:112
#define GL_ACCUM_RED_BITS
Definition: gl.h:354
#define GL_INDEX_OFFSET
Definition: gl.h:595
#define GL_DRAW_BUFFER
Definition: gl.h:494
static const struct value_desc * find_value(const char *func, GLenum pname, void **p, union value *v)
Definition: get.c:1125
#define GL_LINE_SMOOTH
Definition: gl.h:256
#define GL_PIXEL_MAP_G_TO_G_SIZE
Definition: gl.h:613
#define GL_POINT_SIZE_GRANULARITY
Definition: gl.h:252
#define GL_AUTO_NORMAL
Definition: gl.h:550
Definition: get.c:84
#define GL_POLYGON_SMOOTH_HINT
Definition: gl.h:581
Definition: ncftp.h:79
#define GL_PACK_SKIP_PIXELS
Definition: gl.h:629
#define GL_LINE_WIDTH_GRANULARITY
Definition: gl.h:261
#define GL_MAP1_GRID_SEGMENTS
Definition: gl.h:570
value_location
Definition: get.c:109
GLboolean CompileFlag
Definition: mtypes.h:1795
#define GL_MAX_MODELVIEW_STACK_DEPTH
Definition: gl.h:513
#define GL_MAP2_VERTEX_3
Definition: gl.h:567
#define index(s, c)
Definition: various.h:29
GLfloat value_float
Definition: get.c:140
void _mesa_update_state(struct gl_context *ctx)
Definition: state.c:298
int64_t GLint64
Definition: glext.h:5567
#define GL_DEPTH_RANGE
Definition: gl.h:305
Definition: get.c:82
#define INT_TO_BOOLEAN(I)
Definition: get.c:60
#define GL_EDGE_FLAG
Definition: gl.h:275
#define GL_ALIASED_POINT_SIZE_RANGE
Definition: gl.h:1509
#define GL_SCISSOR_BOX
Definition: gl.h:588
#define GL_FEEDBACK_BUFFER_SIZE
Definition: gl.h:406
#define CONTEXT_BIT3(field)
Definition: get.c:177
#define GL_TEXTURE_BINDING_2D
Definition: gl.h:731
GLenum pname
Definition: get.c:132
#define GL_CULL_FACE_MODE
Definition: gl.h:277
#define GL_RGBA_INTEGER_MODE_EXT
Definition: glext.h:4811
GLboolean value_bool
Definition: get.c:152
#define GL_CURRENT_NORMAL
Definition: gl.h:527
#define GL_TEXTURE_STACK_DEPTH
Definition: gl.h:546
#define GL_INDEX_CLEAR_VALUE
Definition: gl.h:535
#define GL_ALPHA_BIAS
Definition: gl.h:603
#define GL_FOG
Definition: gl.h:414
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define GL_STENCIL_VALUE_MASK
Definition: gl.h:452
#define GL_COLOR_CLEAR_VALUE
Definition: gl.h:523
Definition: get.c:89
GLbitfield NewState
Definition: mtypes.h:1875
#define GL_SAMPLE_ALPHA_TO_ONE_ARB
Definition: glext.h:1215
#define GL_TEXTURE_COORD_ARRAY_STRIDE
Definition: gl.h:220
#define GL_ACCUM_GREEN_BITS
Definition: gl.h:355
static GLboolean check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d)
Definition: get.c:1039
#define GL_LINE_STIPPLE_PATTERN
Definition: gl.h:258
#define GL_POLYGON_OFFSET_BIAS_EXT
Definition: glext.h:2417
#define GL_NORMALIZE
Definition: gl.h:343
#define GL_STENCIL_PASS_DEPTH_PASS
Definition: gl.h:455
GLuint VersionMinor
Definition: mtypes.h:1801
#define GL_MAX_ELEMENTS_INDICES
Definition: gl.h:1483
#define GL_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1488
unsigned char GLubyte
Definition: gl.h:157
struct value::@280 value_int_n
#define BUFFER_BOOL(field)
Definition: get.c:166
static const int extra_new_buffers[]
Definition: get.c:212
void GLAPIENTRY _mesa_GetIntegerv(GLenum pname, GLint *params)
Definition: get.c:1369
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
Definition: glext.h:4373
GLenum value_enum
Definition: get.c:146
#define MAX_EVAL_ORDER
Definition: config.h:80
#define GL_TEXTURE_BINDING_CUBE_MAP_ARB
Definition: glext.h:1231
const GLfloat * m
Definition: glext.h:10848
#define GL_POLYGON_SMOOTH
Definition: gl.h:273
#define GL_VERTEX_ARRAY_SIZE
Definition: gl.h:208
struct gl_depthbuffer_attrib Depth
Definition: mtypes.h:1819
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
void GLAPIENTRY _mesa_GetBooleanv(GLenum pname, GLboolean *params)
Definition: get.c:1191
static const struct value_desc error_value
Definition: get.c:1099
struct gl_framebuffer * ReadBuffer
Definition: mtypes.h:1766
#define GL_COLOR_ARRAY_TYPE
Definition: gl.h:214
#define CONTEXT_BIT7(field)
Definition: get.c:181
const GLdouble * v
Definition: gl.h:2040
unsigned int GLuint
Definition: gl.h:159
#define GL_RESCALE_NORMAL
Definition: gl.h:1480
#define GL_DEPTH_CLEAR_VALUE
Definition: gl.h:303
#define GL_CLIP_DISTANCE0
Definition: glext.h:506
#define GL_DEPTH_TEST
Definition: gl.h:301
#define GL_ACCUM_ALPHA_BITS
Definition: gl.h:357
#define GL_BLUE_BIAS
Definition: gl.h:601
#define GL_CLIP_DISTANCE5
Definition: glext.h:511
#define GL_FOG_COORDINATE_ARRAY_EXT
Definition: glext.h:3203
#define GL_TEXTURE_GEN_S
Definition: gl.h:651
GLenum _mesa_get_color_read_type(struct gl_context *ctx)
Definition: framebuffer.c:611
#define GL_TRUE
Definition: gl.h:174
struct gl_array_attrib Array
Definition: mtypes.h:1846
#define GL_MAX_PIXEL_MAP_TABLE
Definition: gl.h:511
#define GL_CURRENT_RASTER_POSITION_VALID
Definition: gl.h:533
#define GL_POINT_SIZE_MAX_EXT
Definition: glext.h:2807
#define GL_PACK_LSB_FIRST
Definition: gl.h:627
#define BUFFER_INT(field)
Definition: get.c:164
struct gl_stencil_attrib Stencil
Definition: mtypes.h:1832
#define GL_NAME_STACK_DEPTH
Definition: gl.h:540
#define CONTEXT_BIT4(field)
Definition: get.c:178
#define GL_POINT_SIZE_MIN_EXT
Definition: glext.h:2806
#define GL_RED_BITS
Definition: gl.h:487
#define MAX_PIXEL_MAP_TABLE
Definition: config.h:71
Definition: get.c:78
#define ARRAY_INT(field)
Definition: get.c:189
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_MAP1_VERTEX_3
Definition: gl.h:558
#define NO_EXTRA
Definition: get.c:128
struct gl_viewport_attrib Viewport
Definition: mtypes.h:1835
#define GL_MAP_STENCIL
Definition: gl.h:593
#define GL_COLOR_MATERIAL_PARAMETER
Definition: gl.h:342
#define GL_BLUE_BITS
Definition: gl.h:489
GLint value_int_4[4]
Definition: get.c:144
#define GL_GREEN_BITS
Definition: gl.h:488
#define GL_LIGHT7
Definition: gl.h:318
#define GL_ZOOM_Y
Definition: gl.h:639
#define INT64_TO_INT(I)
Definition: get.c:66
#define GL_PIXEL_MAP_I_TO_R_SIZE
Definition: gl.h:608
#define GL_CLIP_DISTANCE6
Definition: glext.h:512
#define GL_ACCUM_BLUE_BITS
Definition: gl.h:356
#define GL_ALPHA_TEST
Definition: gl.h:366
#define CONTEXT_FLOAT4(field)
Definition: get.c:185
#define GL_TEXTURE_GEN_STR_OES
Definition: glheader.h:126
#define GL_TEXTURE_2D
Definition: gl.h:645
#define GL_PACK_ALIGNMENT
Definition: gl.h:626
#define GL_TEXTURE_COORD_ARRAY
Definition: gl.h:206
#define BUFFER_ENUM(field)
Definition: get.c:165
#define GL_CLIP_DISTANCE4
Definition: glext.h:510
#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
Definition: glext.h:3024
Definition: get.c:81
#define GL_FRONT_FACE
Definition: gl.h:278
#define CONTEXT_BIT0(field)
Definition: get.c:174
#define GL_COLOR_ARRAY_COUNT_EXT
Definition: glext.h:2680
#define GL_COLOR_ARRAY_SIZE
Definition: gl.h:213
#define GL_COMPILE
Definition: gl.h:286
#define GL_BLEND_COLOR_EXT
Definition: glext.h:2411
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1494
CONST GLfloat m[16]
Definition: m_xform.h:144
#define GL_MAX_NAME_STACK_DEPTH
Definition: gl.h:514
const int * extra
Definition: get.c:136
GLubyte type
Definition: get.c:134
#define GL_GREEN_BIAS
Definition: gl.h:599
Definition: get.c:91
#define GL_STENCIL_FAIL
Definition: gl.h:453
#define Elements(x)
Definition: compiler.h:496
#define GL_MAX_CLIP_PLANES
Definition: gl.h:509
#define CONTEXT_INT2(field)
Definition: get.c:169
#define GL_MODELVIEW_STACK_DEPTH
Definition: gl.h:539
struct gl_matrix_stack TextureMatrixStack
Definition: mtypes.h:1784
#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT
Definition: glext.h:3200
#define GL_FEEDBACK_BUFFER_TYPE
Definition: gl.h:407
#define GL_ACCUM_CLEAR_VALUE
Definition: gl.h:358
#define CONTEXT_ENUM2(field)
Definition: get.c:172
#define GL_LIGHT4
Definition: gl.h:315
#define GL_MAP2_GRID_DOMAIN
Definition: gl.h:571
#define GL_TEXTURE_GEN_T
Definition: gl.h:652
#define GL_COLOR_MATERIAL_FACE
Definition: gl.h:341
value_type
Definition: get.c:76
static const int extra_valid_clip_distance[]
Definition: get.c:222
#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB
Definition: glext.h:1208
GLfloat GLfloat p
Definition: glext.h:8902
static void find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v)
Definition: get.c:828
#define GL_NUM_EXTENSIONS
Definition: glext.h:517
#define GL_MAP2_TEXTURE_COORD_2
Definition: gl.h:564
#define GL_MAX_LIGHTS
Definition: gl.h:508
#define CONTEXT_FLOAT3(field)
Definition: get.c:184
Definition: _hash_fun.h:40
#define GL_COLOR_LOGIC_OP
Definition: gl.h:428
#define memset(x, y, z)
Definition: compat.h:39
#define GL_ALPHA_SCALE
Definition: gl.h:602
#define ARRAY_ENUM(field)
Definition: get.c:190
#define CONTEXT_MATRIX(field)
Definition: get.c:186
#define GL_TEXTURE_BINDING_3D
Definition: gl.h:1520
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
Definition: glext.h:3367
#define EXTRA_EXT2(e1, e2)
Definition: get.c:201
#define MAX_MODELVIEW_STACK_DEPTH
Definition: config.h:41
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
Definition: glext.h:1495
#define GL_PIXEL_MAP_B_TO_B_SIZE
Definition: gl.h:614
#define GL_FOG_START
Definition: gl.h:419
#define ACOMP
Definition: txc_dxtn.h:36
#define GLAPIENTRY
Definition: glu.h:44
#define GL_PIXEL_MAP_A_TO_A_SIZE
Definition: gl.h:615
#define GL_RGBA_MODE
Definition: gl.h:544
#define GL_DISTANCE_ATTENUATION_EXT
Definition: glext.h:2809
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT
Definition: glext.h:2808
#define GL_MAP1_GRID_DOMAIN
Definition: gl.h:569
Definition: get.c:87
#define GL_TEXTURE_MATRIX
Definition: gl.h:545
#define GL_DEPTH_BOUNDS_TEST_EXT
Definition: glext.h:4377
#define CONTEXT_ENUM(field)
Definition: get.c:171
#define GL_CLIP_DISTANCE2
Definition: glext.h:508
#define GL_UNPACK_SKIP_IMAGES_EXT
Definition: glext.h:2469
struct gl_line_attrib Line
Definition: mtypes.h:1824
#define GL_ZOOM_X
Definition: gl.h:638
const GLint const GLsizei GLint
Definition: dispatch.h:5271
#define GL_MAJOR_VERSION
Definition: glext.h:515
#define printf
Definition: config.h:203
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832
#define GL_ALPHA_BITS
Definition: gl.h:486
#define GL_CLIP_DISTANCE1
Definition: glext.h:507
#define GL_INDEX_SHIFT
Definition: gl.h:594