c307058da65780cd1da2de708fce308a1b688410
3 # Mesa 3-D graphics library
5 # Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
7 # Permission is hereby granted, free of charge, to any person obtaining a
8 # copy of this software and associated documentation files (the "Software"),
9 # to deal in the Software without restriction, including without limitation
10 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 # and/or sell copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the following conditions:
14 # The above copyright notice and this permission notice shall be included
15 # in all copies or substantial portions of the Software.
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 # This script is used to generate the get.c file:
26 # python get_gen.py > get.c
37 GLfloatN
= 6 # A normalized value, such as a color or depth range
44 GLdouble
: "GLdouble",
45 GLboolean
: "GLboolean"
49 # Each entry is a tuple of:
50 # - the GL state name, such as GL_CURRENT_COLOR
51 # - the state datatype, one of GLint, GLfloat, GLboolean or GLenum
52 # - list of code fragments to get the state, such as ["ctx->Foo.Bar"]
53 # - optional extra code or empty string
54 # - optional extensions to check, or None
57 ( "GL_ACCUM_RED_BITS", GLint
, ["ctx->DrawBuffer->Visual.accumRedBits"],
59 ( "GL_ACCUM_GREEN_BITS", GLint
, ["ctx->DrawBuffer->Visual.accumGreenBits"],
61 ( "GL_ACCUM_BLUE_BITS", GLint
, ["ctx->DrawBuffer->Visual.accumBlueBits"],
63 ( "GL_ACCUM_ALPHA_BITS", GLint
, ["ctx->DrawBuffer->Visual.accumAlphaBits"],
65 ( "GL_ACCUM_CLEAR_VALUE", GLfloatN
,
66 [ "ctx->Accum.ClearColor[0]",
67 "ctx->Accum.ClearColor[1]",
68 "ctx->Accum.ClearColor[2]",
69 "ctx->Accum.ClearColor[3]" ],
71 ( "GL_ALPHA_BIAS", GLfloat
, ["ctx->Pixel.AlphaBias"], "", None ),
72 ( "GL_ALPHA_BITS", GLint
, ["ctx->DrawBuffer->Visual.alphaBits"],
74 ( "GL_ALPHA_SCALE", GLfloat
, ["ctx->Pixel.AlphaScale"], "", None ),
75 ( "GL_ALPHA_TEST", GLboolean
, ["ctx->Color.AlphaEnabled"], "", None ),
76 ( "GL_ALPHA_TEST_FUNC", GLenum
, ["ctx->Color.AlphaFunc"], "", None ),
77 ( "GL_ALPHA_TEST_REF", GLfloatN
, ["ctx->Color.AlphaRef"], "", None ),
78 ( "GL_ATTRIB_STACK_DEPTH", GLint
, ["ctx->AttribStackDepth"], "", None ),
79 ( "GL_AUTO_NORMAL", GLboolean
, ["ctx->Eval.AutoNormal"], "", None ),
80 ( "GL_AUX_BUFFERS", GLint
, ["ctx->DrawBuffer->Visual.numAuxBuffers"],
82 ( "GL_BLEND", GLboolean
, ["ctx->Color.BlendEnabled"], "", None ),
83 ( "GL_BLEND_DST", GLenum
, ["ctx->Color.BlendDstRGB"], "", None ),
84 ( "GL_BLEND_SRC", GLenum
, ["ctx->Color.BlendSrcRGB"], "", None ),
85 ( "GL_BLEND_SRC_RGB_EXT", GLenum
, ["ctx->Color.BlendSrcRGB"], "", None ),
86 ( "GL_BLEND_DST_RGB_EXT", GLenum
, ["ctx->Color.BlendDstRGB"], "", None ),
87 ( "GL_BLEND_SRC_ALPHA_EXT", GLenum
, ["ctx->Color.BlendSrcA"], "", None ),
88 ( "GL_BLEND_DST_ALPHA_EXT", GLenum
, ["ctx->Color.BlendDstA"], "", None ),
89 ( "GL_BLEND_EQUATION", GLenum
, ["ctx->Color.BlendEquationRGB "], "", None),
90 ( "GL_BLEND_EQUATION_ALPHA_EXT", GLenum
, ["ctx->Color.BlendEquationA "],
92 ( "GL_BLEND_COLOR_EXT", GLfloatN
,
93 [ "ctx->Color.BlendColor[0]",
94 "ctx->Color.BlendColor[1]",
95 "ctx->Color.BlendColor[2]",
96 "ctx->Color.BlendColor[3]"], "", None ),
97 ( "GL_BLUE_BIAS", GLfloat
, ["ctx->Pixel.BlueBias"], "", None ),
98 ( "GL_BLUE_BITS", GLint
, ["ctx->DrawBuffer->Visual.blueBits"], "", None ),
99 ( "GL_BLUE_SCALE", GLfloat
, ["ctx->Pixel.BlueScale"], "", None ),
100 ( "GL_CLIENT_ATTRIB_STACK_DEPTH", GLint
,
101 ["ctx->ClientAttribStackDepth"], "", None ),
102 ( "GL_CLIP_PLANE0", GLboolean
,
103 [ "(ctx->Transform.ClipPlanesEnabled >> 0) & 1" ], "", None ),
104 ( "GL_CLIP_PLANE1", GLboolean
,
105 [ "(ctx->Transform.ClipPlanesEnabled >> 1) & 1" ], "", None ),
106 ( "GL_CLIP_PLANE2", GLboolean
,
107 [ "(ctx->Transform.ClipPlanesEnabled >> 2) & 1" ], "", None ),
108 ( "GL_CLIP_PLANE3", GLboolean
,
109 [ "(ctx->Transform.ClipPlanesEnabled >> 3) & 1" ], "", None ),
110 ( "GL_CLIP_PLANE4", GLboolean
,
111 [ "(ctx->Transform.ClipPlanesEnabled >> 4) & 1" ], "", None ),
112 ( "GL_CLIP_PLANE5", GLboolean
,
113 [ "(ctx->Transform.ClipPlanesEnabled >> 5) & 1" ], "", None ),
114 ( "GL_COLOR_CLEAR_VALUE", GLfloatN
,
115 [ "ctx->Color.ClearColor[0]",
116 "ctx->Color.ClearColor[1]",
117 "ctx->Color.ClearColor[2]",
118 "ctx->Color.ClearColor[3]" ], "", None ),
119 ( "GL_COLOR_MATERIAL", GLboolean
,
120 ["ctx->Light.ColorMaterialEnabled"], "", None ),
121 ( "GL_COLOR_MATERIAL_FACE", GLenum
,
122 ["ctx->Light.ColorMaterialFace"], "", None ),
123 ( "GL_COLOR_MATERIAL_PARAMETER", GLenum
,
124 ["ctx->Light.ColorMaterialMode"], "", None ),
125 ( "GL_COLOR_WRITEMASK", GLint
,
126 [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0",
127 "ctx->Color.ColorMask[GCOMP] ? 1 : 0",
128 "ctx->Color.ColorMask[BCOMP] ? 1 : 0",
129 "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ),
130 ( "GL_CULL_FACE", GLboolean
, ["ctx->Polygon.CullFlag"], "", None ),
131 ( "GL_CULL_FACE_MODE", GLenum
, ["ctx->Polygon.CullFaceMode"], "", None ),
132 ( "GL_CURRENT_COLOR", GLfloatN
,
133 [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]",
134 "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]",
135 "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]",
136 "ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]" ],
137 "FLUSH_CURRENT(ctx, 0);", None ),
138 ( "GL_CURRENT_INDEX", GLfloat
,
139 [ "ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]" ],
140 "FLUSH_CURRENT(ctx, 0);", None ),
141 ( "GL_CURRENT_NORMAL", GLfloatN
,
142 [ "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]",
143 "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]",
144 "ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]"],
145 "FLUSH_CURRENT(ctx, 0);", None ),
146 ( "GL_CURRENT_RASTER_COLOR", GLfloatN
,
147 ["ctx->Current.RasterColor[0]",
148 "ctx->Current.RasterColor[1]",
149 "ctx->Current.RasterColor[2]",
150 "ctx->Current.RasterColor[3]"], "", None ),
151 ( "GL_CURRENT_RASTER_DISTANCE", GLfloat
,
152 ["ctx->Current.RasterDistance"], "", None ),
153 ( "GL_CURRENT_RASTER_INDEX", GLfloat
,
154 ["ctx->Current.RasterIndex"], "", None ),
155 ( "GL_CURRENT_RASTER_POSITION", GLfloat
,
156 ["ctx->Current.RasterPos[0]",
157 "ctx->Current.RasterPos[1]",
158 "ctx->Current.RasterPos[2]",
159 "ctx->Current.RasterPos[3]"], "", None ),
160 ( "GL_CURRENT_RASTER_SECONDARY_COLOR", GLfloatN
,
161 ["ctx->Current.RasterSecondaryColor[0]",
162 "ctx->Current.RasterSecondaryColor[1]",
163 "ctx->Current.RasterSecondaryColor[2]",
164 "ctx->Current.RasterSecondaryColor[3]"], "", None ),
165 ( "GL_CURRENT_RASTER_TEXTURE_COORDS", GLfloat
,
166 ["ctx->Current.RasterTexCoords[texUnit][0]",
167 "ctx->Current.RasterTexCoords[texUnit][1]",
168 "ctx->Current.RasterTexCoords[texUnit][2]",
169 "ctx->Current.RasterTexCoords[texUnit][3]"],
170 "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ),
171 ( "GL_CURRENT_RASTER_POSITION_VALID", GLboolean
,
172 ["ctx->Current.RasterPosValid"], "", None ),
173 ( "GL_CURRENT_TEXTURE_COORDS", GLfloat
,
174 ["ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]",
175 "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]",
176 "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]",
177 "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"],
178 "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ),
179 ( "GL_DEPTH_BIAS", GLfloat
, ["ctx->Pixel.DepthBias"], "", None ),
180 ( "GL_DEPTH_BITS", GLint
, ["ctx->DrawBuffer->Visual.depthBits"],
182 ( "GL_DEPTH_CLEAR_VALUE", GLfloat
, ["ctx->Depth.Clear"], "", None ),
183 ( "GL_DEPTH_FUNC", GLenum
, ["ctx->Depth.Func"], "", None ),
184 ( "GL_DEPTH_RANGE", GLfloatN
,
185 [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ),
186 ( "GL_DEPTH_SCALE", GLfloat
, ["ctx->Pixel.DepthScale"], "", None ),
187 ( "GL_DEPTH_TEST", GLboolean
, ["ctx->Depth.Test"], "", None ),
188 ( "GL_DEPTH_WRITEMASK", GLboolean
, ["ctx->Depth.Mask"], "", None ),
189 ( "GL_DITHER", GLboolean
, ["ctx->Color.DitherFlag"], "", None ),
190 ( "GL_DOUBLEBUFFER", GLboolean
,
191 ["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ),
192 ( "GL_DRAW_BUFFER", GLenum
, ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ),
193 ( "GL_EDGE_FLAG", GLboolean
, ["(ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0)"],
194 "FLUSH_CURRENT(ctx, 0);", None ),
195 ( "GL_FEEDBACK_BUFFER_SIZE", GLint
, ["ctx->Feedback.BufferSize"], "", None ),
196 ( "GL_FEEDBACK_BUFFER_TYPE", GLenum
, ["ctx->Feedback.Type"], "", None ),
197 ( "GL_FOG", GLboolean
, ["ctx->Fog.Enabled"], "", None ),
198 ( "GL_FOG_COLOR", GLfloatN
,
199 [ "ctx->Fog.Color[0]",
202 "ctx->Fog.Color[3]" ], "", None ),
203 ( "GL_FOG_DENSITY", GLfloat
, ["ctx->Fog.Density"], "", None ),
204 ( "GL_FOG_END", GLfloat
, ["ctx->Fog.End"], "", None ),
205 ( "GL_FOG_HINT", GLenum
, ["ctx->Hint.Fog"], "", None ),
206 ( "GL_FOG_INDEX", GLfloat
, ["ctx->Fog.Index"], "", None ),
207 ( "GL_FOG_MODE", GLenum
, ["ctx->Fog.Mode"], "", None ),
208 ( "GL_FOG_START", GLfloat
, ["ctx->Fog.Start"], "", None ),
209 ( "GL_FRONT_FACE", GLenum
, ["ctx->Polygon.FrontFace"], "", None ),
210 ( "GL_GREEN_BIAS", GLfloat
, ["ctx->Pixel.GreenBias"], "", None ),
211 ( "GL_GREEN_BITS", GLint
, ["ctx->DrawBuffer->Visual.greenBits"],
213 ( "GL_GREEN_SCALE", GLfloat
, ["ctx->Pixel.GreenScale"], "", None ),
214 ( "GL_INDEX_BITS", GLint
, ["ctx->DrawBuffer->Visual.indexBits"],
216 ( "GL_INDEX_CLEAR_VALUE", GLint
, ["ctx->Color.ClearIndex"], "", None ),
217 ( "GL_INDEX_MODE", GLboolean
, ["!ctx->DrawBuffer->Visual.rgbMode"],
219 ( "GL_INDEX_OFFSET", GLint
, ["ctx->Pixel.IndexOffset"], "", None ),
220 ( "GL_INDEX_SHIFT", GLint
, ["ctx->Pixel.IndexShift"], "", None ),
221 ( "GL_INDEX_WRITEMASK", GLint
, ["ctx->Color.IndexMask"], "", None ),
222 ( "GL_LIGHT0", GLboolean
, ["ctx->Light.Light[0].Enabled"], "", None ),
223 ( "GL_LIGHT1", GLboolean
, ["ctx->Light.Light[1].Enabled"], "", None ),
224 ( "GL_LIGHT2", GLboolean
, ["ctx->Light.Light[2].Enabled"], "", None ),
225 ( "GL_LIGHT3", GLboolean
, ["ctx->Light.Light[3].Enabled"], "", None ),
226 ( "GL_LIGHT4", GLboolean
, ["ctx->Light.Light[4].Enabled"], "", None ),
227 ( "GL_LIGHT5", GLboolean
, ["ctx->Light.Light[5].Enabled"], "", None ),
228 ( "GL_LIGHT6", GLboolean
, ["ctx->Light.Light[6].Enabled"], "", None ),
229 ( "GL_LIGHT7", GLboolean
, ["ctx->Light.Light[7].Enabled"], "", None ),
230 ( "GL_LIGHTING", GLboolean
, ["ctx->Light.Enabled"], "", None ),
231 ( "GL_LIGHT_MODEL_AMBIENT", GLfloatN
,
232 ["ctx->Light.Model.Ambient[0]",
233 "ctx->Light.Model.Ambient[1]",
234 "ctx->Light.Model.Ambient[2]",
235 "ctx->Light.Model.Ambient[3]"], "", None ),
236 ( "GL_LIGHT_MODEL_COLOR_CONTROL", GLenum
,
237 ["ctx->Light.Model.ColorControl"], "", None ),
238 ( "GL_LIGHT_MODEL_LOCAL_VIEWER", GLboolean
,
239 ["ctx->Light.Model.LocalViewer"], "", None ),
240 ( "GL_LIGHT_MODEL_TWO_SIDE", GLboolean
, ["ctx->Light.Model.TwoSide"], "", None ),
241 ( "GL_LINE_SMOOTH", GLboolean
, ["ctx->Line.SmoothFlag"], "", None ),
242 ( "GL_LINE_SMOOTH_HINT", GLenum
, ["ctx->Hint.LineSmooth"], "", None ),
243 ( "GL_LINE_STIPPLE", GLboolean
, ["ctx->Line.StippleFlag"], "", None ),
244 ( "GL_LINE_STIPPLE_PATTERN", GLint
, ["ctx->Line.StipplePattern"], "", None ),
245 ( "GL_LINE_STIPPLE_REPEAT", GLint
, ["ctx->Line.StippleFactor"], "", None ),
246 ( "GL_LINE_WIDTH", GLfloat
, ["ctx->Line.Width"], "", None ),
247 ( "GL_LINE_WIDTH_GRANULARITY", GLfloat
,
248 ["ctx->Const.LineWidthGranularity"], "", None ),
249 ( "GL_LINE_WIDTH_RANGE", GLfloat
,
250 ["ctx->Const.MinLineWidthAA",
251 "ctx->Const.MaxLineWidthAA"], "", None ),
252 ( "GL_ALIASED_LINE_WIDTH_RANGE", GLfloat
,
253 ["ctx->Const.MinLineWidth",
254 "ctx->Const.MaxLineWidth"], "", None ),
255 ( "GL_LIST_BASE", GLint
, ["ctx->List.ListBase"], "", None ),
256 ( "GL_LIST_INDEX", GLint
, ["ctx->ListState.CurrentListNum"], "", None ),
257 ( "GL_LIST_MODE", GLenum
, ["mode"],
259 if (!ctx->CompileFlag)
261 else if (ctx->ExecuteFlag)
262 mode = GL_COMPILE_AND_EXECUTE;
264 mode = GL_COMPILE;""", None ),
265 ( "GL_INDEX_LOGIC_OP", GLboolean
, ["ctx->Color.IndexLogicOpEnabled"], "", None ),
266 ( "GL_COLOR_LOGIC_OP", GLboolean
, ["ctx->Color.ColorLogicOpEnabled"], "", None ),
267 ( "GL_LOGIC_OP_MODE", GLenum
, ["ctx->Color.LogicOp"], "", None ),
268 ( "GL_MAP1_COLOR_4", GLboolean
, ["ctx->Eval.Map1Color4"], "", None ),
269 ( "GL_MAP1_GRID_DOMAIN", GLfloat
,
270 ["ctx->Eval.MapGrid1u1",
271 "ctx->Eval.MapGrid1u2"], "", None ),
272 ( "GL_MAP1_GRID_SEGMENTS", GLint
, ["ctx->Eval.MapGrid1un"], "", None ),
273 ( "GL_MAP1_INDEX", GLboolean
, ["ctx->Eval.Map1Index"], "", None ),
274 ( "GL_MAP1_NORMAL", GLboolean
, ["ctx->Eval.Map1Normal"], "", None ),
275 ( "GL_MAP1_TEXTURE_COORD_1", GLboolean
, ["ctx->Eval.Map1TextureCoord1"], "", None ),
276 ( "GL_MAP1_TEXTURE_COORD_2", GLboolean
, ["ctx->Eval.Map1TextureCoord2"], "", None ),
277 ( "GL_MAP1_TEXTURE_COORD_3", GLboolean
, ["ctx->Eval.Map1TextureCoord3"], "", None ),
278 ( "GL_MAP1_TEXTURE_COORD_4", GLboolean
, ["ctx->Eval.Map1TextureCoord4"], "", None ),
279 ( "GL_MAP1_VERTEX_3", GLboolean
, ["ctx->Eval.Map1Vertex3"], "", None ),
280 ( "GL_MAP1_VERTEX_4", GLboolean
, ["ctx->Eval.Map1Vertex4"], "", None ),
281 ( "GL_MAP2_COLOR_4", GLboolean
, ["ctx->Eval.Map2Color4"], "", None ),
282 ( "GL_MAP2_GRID_DOMAIN", GLfloat
,
283 ["ctx->Eval.MapGrid2u1",
284 "ctx->Eval.MapGrid2u2",
285 "ctx->Eval.MapGrid2v1",
286 "ctx->Eval.MapGrid2v2"], "", None ),
287 ( "GL_MAP2_GRID_SEGMENTS", GLint
,
288 ["ctx->Eval.MapGrid2un",
289 "ctx->Eval.MapGrid2vn"], "", None ),
290 ( "GL_MAP2_INDEX", GLboolean
, ["ctx->Eval.Map2Index"], "", None ),
291 ( "GL_MAP2_NORMAL", GLboolean
, ["ctx->Eval.Map2Normal"], "", None ),
292 ( "GL_MAP2_TEXTURE_COORD_1", GLboolean
, ["ctx->Eval.Map2TextureCoord1"], "", None ),
293 ( "GL_MAP2_TEXTURE_COORD_2", GLboolean
, ["ctx->Eval.Map2TextureCoord2"], "", None ),
294 ( "GL_MAP2_TEXTURE_COORD_3", GLboolean
, ["ctx->Eval.Map2TextureCoord3"], "", None ),
295 ( "GL_MAP2_TEXTURE_COORD_4", GLboolean
, ["ctx->Eval.Map2TextureCoord4"], "", None ),
296 ( "GL_MAP2_VERTEX_3", GLboolean
, ["ctx->Eval.Map2Vertex3"], "", None ),
297 ( "GL_MAP2_VERTEX_4", GLboolean
, ["ctx->Eval.Map2Vertex4"], "", None ),
298 ( "GL_MAP_COLOR", GLboolean
, ["ctx->Pixel.MapColorFlag"], "", None ),
299 ( "GL_MAP_STENCIL", GLboolean
, ["ctx->Pixel.MapStencilFlag"], "", None ),
300 ( "GL_MATRIX_MODE", GLenum
, ["ctx->Transform.MatrixMode"], "", None ),
302 ( "GL_MAX_ATTRIB_STACK_DEPTH", GLint
, ["MAX_ATTRIB_STACK_DEPTH"], "", None ),
303 ( "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", GLint
, ["MAX_CLIENT_ATTRIB_STACK_DEPTH"], "", None ),
304 ( "GL_MAX_CLIP_PLANES", GLint
, ["ctx->Const.MaxClipPlanes"], "", None ),
305 ( "GL_MAX_ELEMENTS_VERTICES", GLint
, ["ctx->Const.MaxArrayLockSize"], "", None ),
306 ( "GL_MAX_ELEMENTS_INDICES", GLint
, ["ctx->Const.MaxArrayLockSize"], "", None ),
307 ( "GL_MAX_EVAL_ORDER", GLint
, ["MAX_EVAL_ORDER"], "", None ),
308 ( "GL_MAX_LIGHTS", GLint
, ["ctx->Const.MaxLights"], "", None ),
309 ( "GL_MAX_LIST_NESTING", GLint
, ["MAX_LIST_NESTING"], "", None ),
310 ( "GL_MAX_MODELVIEW_STACK_DEPTH", GLint
, ["MAX_MODELVIEW_STACK_DEPTH"], "", None ),
311 ( "GL_MAX_NAME_STACK_DEPTH", GLint
, ["MAX_NAME_STACK_DEPTH"], "", None ),
312 ( "GL_MAX_PIXEL_MAP_TABLE", GLint
, ["MAX_PIXEL_MAP_TABLE"], "", None ),
313 ( "GL_MAX_PROJECTION_STACK_DEPTH", GLint
, ["MAX_PROJECTION_STACK_DEPTH"], "", None ),
314 ( "GL_MAX_TEXTURE_SIZE", GLint
, ["1 << (ctx->Const.MaxTextureLevels - 1)"], "", None ),
315 ( "GL_MAX_3D_TEXTURE_SIZE", GLint
, ["1 << (ctx->Const.Max3DTextureLevels - 1)"], "", None ),
316 ( "GL_MAX_TEXTURE_STACK_DEPTH", GLint
, ["MAX_TEXTURE_STACK_DEPTH"], "", None ),
317 ( "GL_MAX_VIEWPORT_DIMS", GLint
,
318 ["ctx->Const.MaxViewportWidth", "ctx->Const.MaxViewportHeight"],
320 ( "GL_MODELVIEW_MATRIX", GLfloat
,
321 [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
322 "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
323 "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
324 "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
325 "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ),
326 ( "GL_MODELVIEW_STACK_DEPTH", GLint
, ["ctx->ModelviewMatrixStack.Depth + 1"], "", None ),
327 ( "GL_NAME_STACK_DEPTH", GLint
, ["ctx->Select.NameStackDepth"], "", None ),
328 ( "GL_NORMALIZE", GLboolean
, ["ctx->Transform.Normalize"], "", None ),
329 ( "GL_PACK_ALIGNMENT", GLint
, ["ctx->Pack.Alignment"], "", None ),
330 ( "GL_PACK_LSB_FIRST", GLboolean
, ["ctx->Pack.LsbFirst"], "", None ),
331 ( "GL_PACK_ROW_LENGTH", GLint
, ["ctx->Pack.RowLength"], "", None ),
332 ( "GL_PACK_SKIP_PIXELS", GLint
, ["ctx->Pack.SkipPixels"], "", None ),
333 ( "GL_PACK_SKIP_ROWS", GLint
, ["ctx->Pack.SkipRows"], "", None ),
334 ( "GL_PACK_SWAP_BYTES", GLboolean
, ["ctx->Pack.SwapBytes"], "", None ),
335 ( "GL_PACK_SKIP_IMAGES_EXT", GLint
, ["ctx->Pack.SkipImages"], "", None ),
336 ( "GL_PACK_IMAGE_HEIGHT_EXT", GLint
, ["ctx->Pack.ImageHeight"], "", None ),
337 ( "GL_PACK_INVERT_MESA", GLboolean
, ["ctx->Pack.Invert"], "", None ),
338 ( "GL_PERSPECTIVE_CORRECTION_HINT", GLenum
,
339 ["ctx->Hint.PerspectiveCorrection"], "", None ),
340 ( "GL_PIXEL_MAP_A_TO_A_SIZE", GLint
, ["ctx->PixelMaps.AtoA.Size"], "", None ),
341 ( "GL_PIXEL_MAP_B_TO_B_SIZE", GLint
, ["ctx->PixelMaps.BtoB.Size"], "", None ),
342 ( "GL_PIXEL_MAP_G_TO_G_SIZE", GLint
, ["ctx->PixelMaps.GtoG.Size"], "", None ),
343 ( "GL_PIXEL_MAP_I_TO_A_SIZE", GLint
, ["ctx->PixelMaps.ItoA.Size"], "", None ),
344 ( "GL_PIXEL_MAP_I_TO_B_SIZE", GLint
, ["ctx->PixelMaps.ItoB.Size"], "", None ),
345 ( "GL_PIXEL_MAP_I_TO_G_SIZE", GLint
, ["ctx->PixelMaps.ItoG.Size"], "", None ),
346 ( "GL_PIXEL_MAP_I_TO_I_SIZE", GLint
, ["ctx->PixelMaps.ItoI.Size"], "", None ),
347 ( "GL_PIXEL_MAP_I_TO_R_SIZE", GLint
, ["ctx->PixelMaps.ItoR.Size"], "", None ),
348 ( "GL_PIXEL_MAP_R_TO_R_SIZE", GLint
, ["ctx->PixelMaps.RtoR.Size"], "", None ),
349 ( "GL_PIXEL_MAP_S_TO_S_SIZE", GLint
, ["ctx->PixelMaps.StoS.Size"], "", None ),
350 ( "GL_POINT_SIZE", GLfloat
, ["ctx->Point.Size"], "", None ),
351 ( "GL_POINT_SIZE_GRANULARITY", GLfloat
,
352 ["ctx->Const.PointSizeGranularity"], "", None ),
353 ( "GL_POINT_SIZE_RANGE", GLfloat
,
354 ["ctx->Const.MinPointSizeAA",
355 "ctx->Const.MaxPointSizeAA"], "", None ),
356 ( "GL_ALIASED_POINT_SIZE_RANGE", GLfloat
,
357 ["ctx->Const.MinPointSize",
358 "ctx->Const.MaxPointSize"], "", None ),
359 ( "GL_POINT_SMOOTH", GLboolean
, ["ctx->Point.SmoothFlag"], "", None ),
360 ( "GL_POINT_SMOOTH_HINT", GLenum
, ["ctx->Hint.PointSmooth"], "", None ),
361 ( "GL_POINT_SIZE_MIN_EXT", GLfloat
, ["ctx->Point.MinSize"], "", None ),
362 ( "GL_POINT_SIZE_MAX_EXT", GLfloat
, ["ctx->Point.MaxSize"], "", None ),
363 ( "GL_POINT_FADE_THRESHOLD_SIZE_EXT", GLfloat
,
364 ["ctx->Point.Threshold"], "", None ),
365 ( "GL_DISTANCE_ATTENUATION_EXT", GLfloat
,
366 ["ctx->Point.Params[0]",
367 "ctx->Point.Params[1]",
368 "ctx->Point.Params[2]"], "", None ),
369 ( "GL_POLYGON_MODE", GLenum
,
370 ["ctx->Polygon.FrontMode",
371 "ctx->Polygon.BackMode"], "", None ),
372 ( "GL_POLYGON_OFFSET_BIAS_EXT", GLfloat
, ["ctx->Polygon.OffsetUnits"], "", None ),
373 ( "GL_POLYGON_OFFSET_FACTOR", GLfloat
, ["ctx->Polygon.OffsetFactor "], "", None ),
374 ( "GL_POLYGON_OFFSET_UNITS", GLfloat
, ["ctx->Polygon.OffsetUnits "], "", None ),
375 ( "GL_POLYGON_SMOOTH", GLboolean
, ["ctx->Polygon.SmoothFlag"], "", None ),
376 ( "GL_POLYGON_SMOOTH_HINT", GLenum
, ["ctx->Hint.PolygonSmooth"], "", None ),
377 ( "GL_POLYGON_STIPPLE", GLboolean
, ["ctx->Polygon.StippleFlag"], "", None ),
378 ( "GL_PROJECTION_MATRIX", GLfloat
,
379 [ "matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
380 "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
381 "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
382 "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
383 "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
384 ( "GL_PROJECTION_STACK_DEPTH", GLint
,
385 ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ),
386 ( "GL_READ_BUFFER", GLenum
, ["ctx->ReadBuffer->ColorReadBuffer"], "", None ),
387 ( "GL_RED_BIAS", GLfloat
, ["ctx->Pixel.RedBias"], "", None ),
388 ( "GL_RED_BITS", GLint
, ["ctx->DrawBuffer->Visual.redBits"], "", None ),
389 ( "GL_RED_SCALE", GLfloat
, ["ctx->Pixel.RedScale"], "", None ),
390 ( "GL_RENDER_MODE", GLenum
, ["ctx->RenderMode"], "", None ),
391 ( "GL_RESCALE_NORMAL", GLboolean
,
392 ["ctx->Transform.RescaleNormals"], "", None ),
393 ( "GL_RGBA_MODE", GLboolean
, ["ctx->DrawBuffer->Visual.rgbMode"],
395 ( "GL_SCISSOR_BOX", GLint
,
398 "ctx->Scissor.Width",
399 "ctx->Scissor.Height"], "", None ),
400 ( "GL_SCISSOR_TEST", GLboolean
, ["ctx->Scissor.Enabled"], "", None ),
401 ( "GL_SELECTION_BUFFER_SIZE", GLint
, ["ctx->Select.BufferSize"], "", None ),
402 ( "GL_SHADE_MODEL", GLenum
, ["ctx->Light.ShadeModel"], "", None ),
403 ( "GL_SHARED_TEXTURE_PALETTE_EXT", GLboolean
,
404 ["ctx->Texture.SharedPalette"], "", None ),
405 ( "GL_STENCIL_BITS", GLint
, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ),
406 ( "GL_STENCIL_CLEAR_VALUE", GLint
, ["ctx->Stencil.Clear"], "", None ),
407 ( "GL_STENCIL_FAIL", GLenum
,
408 ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ),
409 ( "GL_STENCIL_FUNC", GLenum
,
410 ["ctx->Stencil.Function[ctx->Stencil.ActiveFace]"], "", None ),
411 ( "GL_STENCIL_PASS_DEPTH_FAIL", GLenum
,
412 ["ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]"], "", None ),
413 ( "GL_STENCIL_PASS_DEPTH_PASS", GLenum
,
414 ["ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]"], "", None ),
415 ( "GL_STENCIL_REF", GLint
,
416 ["ctx->Stencil.Ref[ctx->Stencil.ActiveFace]"], "", None ),
417 ( "GL_STENCIL_TEST", GLboolean
, ["ctx->Stencil.Enabled"], "", None ),
418 ( "GL_STENCIL_VALUE_MASK", GLint
,
419 ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ),
420 ( "GL_STENCIL_WRITEMASK", GLint
,
421 ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ),
422 ( "GL_STEREO", GLboolean
, ["ctx->DrawBuffer->Visual.stereoMode"],
424 ( "GL_SUBPIXEL_BITS", GLint
, ["ctx->Const.SubPixelBits"], "", None ),
425 ( "GL_TEXTURE_1D", GLboolean
, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ),
426 ( "GL_TEXTURE_2D", GLboolean
, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ),
427 ( "GL_TEXTURE_3D", GLboolean
, ["_mesa_IsEnabled(GL_TEXTURE_3D)"], "", None ),
428 ( "GL_TEXTURE_1D_ARRAY_EXT", GLboolean
, ["_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)"], "", ["MESA_texture_array"] ),
429 ( "GL_TEXTURE_2D_ARRAY_EXT", GLboolean
, ["_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)"], "", ["MESA_texture_array"] ),
430 ( "GL_TEXTURE_BINDING_1D", GLint
,
431 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name"], "", None ),
432 ( "GL_TEXTURE_BINDING_2D", GLint
,
433 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name"], "", None ),
434 ( "GL_TEXTURE_BINDING_3D", GLint
,
435 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name"], "", None ),
436 ( "GL_TEXTURE_BINDING_1D_ARRAY_EXT", GLint
,
437 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name"], "", ["MESA_texture_array"] ),
438 ( "GL_TEXTURE_BINDING_2D_ARRAY_EXT", GLint
,
439 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name"], "", ["MESA_texture_array"] ),
440 ( "GL_TEXTURE_ENV_COLOR", GLfloatN
,
441 ["color[0]", "color[1]", "color[2]", "color[3]"],
442 "const GLfloat *color = ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvColor;",
444 ( "GL_TEXTURE_ENV_MODE", GLenum
,
445 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].EnvMode"], "", None ),
446 ( "GL_TEXTURE_GEN_S", GLboolean
,
447 ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None ),
448 ( "GL_TEXTURE_GEN_T", GLboolean
,
449 ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0)"], "", None ),
450 ( "GL_TEXTURE_GEN_R", GLboolean
,
451 ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0)"], "", None ),
452 ( "GL_TEXTURE_GEN_Q", GLboolean
,
453 ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0)"], "", None ),
454 ( "GL_TEXTURE_MATRIX", GLfloat
,
455 ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
456 "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
457 "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
458 "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
459 "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
460 ( "GL_TEXTURE_STACK_DEPTH", GLint
,
461 ["ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1"], "", None ),
462 ( "GL_UNPACK_ALIGNMENT", GLint
, ["ctx->Unpack.Alignment"], "", None ),
463 ( "GL_UNPACK_LSB_FIRST", GLboolean
, ["ctx->Unpack.LsbFirst"], "", None ),
464 ( "GL_UNPACK_ROW_LENGTH", GLint
, ["ctx->Unpack.RowLength"], "", None ),
465 ( "GL_UNPACK_SKIP_PIXELS", GLint
, ["ctx->Unpack.SkipPixels"], "", None ),
466 ( "GL_UNPACK_SKIP_ROWS", GLint
, ["ctx->Unpack.SkipRows"], "", None ),
467 ( "GL_UNPACK_SWAP_BYTES", GLboolean
, ["ctx->Unpack.SwapBytes"], "", None ),
468 ( "GL_UNPACK_SKIP_IMAGES_EXT", GLint
, ["ctx->Unpack.SkipImages"], "", None ),
469 ( "GL_UNPACK_IMAGE_HEIGHT_EXT", GLint
, ["ctx->Unpack.ImageHeight"], "", None ),
470 ( "GL_UNPACK_CLIENT_STORAGE_APPLE", GLboolean
, ["ctx->Unpack.ClientStorage"], "", None ),
471 ( "GL_VIEWPORT", GLint
, [ "ctx->Viewport.X", "ctx->Viewport.Y",
472 "ctx->Viewport.Width", "ctx->Viewport.Height" ], "", None ),
473 ( "GL_ZOOM_X", GLfloat
, ["ctx->Pixel.ZoomX"], "", None ),
474 ( "GL_ZOOM_Y", GLfloat
, ["ctx->Pixel.ZoomY"], "", None ),
477 ( "GL_VERTEX_ARRAY", GLboolean
, ["ctx->Array.ArrayObj->Vertex.Enabled"], "", None ),
478 ( "GL_VERTEX_ARRAY_SIZE", GLint
, ["ctx->Array.ArrayObj->Vertex.Size"], "", None ),
479 ( "GL_VERTEX_ARRAY_TYPE", GLenum
, ["ctx->Array.ArrayObj->Vertex.Type"], "", None ),
480 ( "GL_VERTEX_ARRAY_STRIDE", GLint
, ["ctx->Array.ArrayObj->Vertex.Stride"], "", None ),
481 ( "GL_VERTEX_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
482 ( "GL_NORMAL_ARRAY", GLenum
, ["ctx->Array.ArrayObj->Normal.Enabled"], "", None ),
483 ( "GL_NORMAL_ARRAY_TYPE", GLenum
, ["ctx->Array.ArrayObj->Normal.Type"], "", None ),
484 ( "GL_NORMAL_ARRAY_STRIDE", GLint
, ["ctx->Array.ArrayObj->Normal.Stride"], "", None ),
485 ( "GL_NORMAL_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
486 ( "GL_COLOR_ARRAY", GLboolean
, ["ctx->Array.ArrayObj->Color.Enabled"], "", None ),
487 ( "GL_COLOR_ARRAY_SIZE", GLint
, ["ctx->Array.ArrayObj->Color.Size"], "", None ),
488 ( "GL_COLOR_ARRAY_TYPE", GLenum
, ["ctx->Array.ArrayObj->Color.Type"], "", None ),
489 ( "GL_COLOR_ARRAY_STRIDE", GLint
, ["ctx->Array.ArrayObj->Color.Stride"], "", None ),
490 ( "GL_COLOR_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
491 ( "GL_INDEX_ARRAY", GLboolean
, ["ctx->Array.ArrayObj->Index.Enabled"], "", None ),
492 ( "GL_INDEX_ARRAY_TYPE", GLenum
, ["ctx->Array.ArrayObj->Index.Type"], "", None ),
493 ( "GL_INDEX_ARRAY_STRIDE", GLint
, ["ctx->Array.ArrayObj->Index.Stride"], "", None ),
494 ( "GL_INDEX_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
495 ( "GL_TEXTURE_COORD_ARRAY", GLboolean
,
496 ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled"], "", None ),
497 ( "GL_TEXTURE_COORD_ARRAY_SIZE", GLint
,
498 ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size"], "", None ),
499 ( "GL_TEXTURE_COORD_ARRAY_TYPE", GLenum
,
500 ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type"], "", None ),
501 ( "GL_TEXTURE_COORD_ARRAY_STRIDE", GLint
,
502 ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride"], "", None ),
503 ( "GL_TEXTURE_COORD_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
504 ( "GL_EDGE_FLAG_ARRAY", GLboolean
, ["ctx->Array.ArrayObj->EdgeFlag.Enabled"], "", None ),
505 ( "GL_EDGE_FLAG_ARRAY_STRIDE", GLint
, ["ctx->Array.ArrayObj->EdgeFlag.Stride"], "", None ),
506 ( "GL_EDGE_FLAG_ARRAY_COUNT_EXT", GLint
, ["0"], "", None ),
508 # GL_ARB_multitexture
509 ( "GL_MAX_TEXTURE_UNITS_ARB", GLint
,
510 ["ctx->Const.MaxTextureUnits"], "", ["ARB_multitexture"] ),
511 ( "GL_ACTIVE_TEXTURE_ARB", GLint
,
512 [ "GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit"], "", ["ARB_multitexture"] ),
513 ( "GL_CLIENT_ACTIVE_TEXTURE_ARB", GLint
,
514 ["GL_TEXTURE0_ARB + ctx->Array.ActiveTexture"], "", ["ARB_multitexture"] ),
516 # GL_ARB_texture_cube_map
517 ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean
,
518 ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", ["ARB_texture_cube_map"] ),
519 ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint
,
520 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name"],
521 "", ["ARB_texture_cube_map"] ),
522 ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint
,
523 ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"],
524 "", ["ARB_texture_cube_map"]),
526 # GL_ARB_texture_compression */
527 ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint
,
528 ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ),
529 ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint
,
530 ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"],
531 "", ["ARB_texture_compression"] ),
532 ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum
,
534 """GLint formats[100];
535 GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
537 for (i = 0; i < n; i++)
538 params[i] = ENUM_TO_INT(formats[i]);""",
539 ["ARB_texture_compression"] ),
541 # GL_EXT_compiled_vertex_array
542 ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint
, ["ctx->Array.LockFirst"],
543 "", ["EXT_compiled_vertex_array"] ),
544 ( "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", GLint
, ["ctx->Array.LockCount"],
545 "", ["EXT_compiled_vertex_array"] ),
547 # GL_ARB_transpose_matrix
548 ( "GL_TRANSPOSE_COLOR_MATRIX_ARB", GLfloat
,
549 ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
550 "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
551 "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
552 "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
553 "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ),
554 ( "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB", GLfloat
,
555 ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
556 "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
557 "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
558 "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
559 "const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;", None ),
560 ( "GL_TRANSPOSE_PROJECTION_MATRIX_ARB", GLfloat
,
561 ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
562 "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
563 "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
564 "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
565 "const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
566 ( "GL_TRANSPOSE_TEXTURE_MATRIX_ARB", GLfloat
,
567 ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
568 "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
569 "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
570 "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
571 "const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
573 # GL_SGI_color_matrix (also in 1.2 imaging)
574 ( "GL_COLOR_MATRIX_SGI", GLfloat
,
575 ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
576 "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
577 "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
578 "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
579 "const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;", None ),
580 ( "GL_COLOR_MATRIX_STACK_DEPTH_SGI", GLint
,
581 ["ctx->ColorMatrixStack.Depth + 1"], "", None ),
582 ( "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI", GLint
,
583 ["MAX_COLOR_STACK_DEPTH"], "", None ),
584 ( "GL_POST_COLOR_MATRIX_RED_SCALE_SGI", GLfloat
,
585 ["ctx->Pixel.PostColorMatrixScale[0]"], "", None ),
586 ( "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI", GLfloat
,
587 ["ctx->Pixel.PostColorMatrixScale[1]"], "", None ),
588 ( "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI", GLfloat
,
589 ["ctx->Pixel.PostColorMatrixScale[2]"], "", None ),
590 ( "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI", GLfloat
,
591 ["ctx->Pixel.PostColorMatrixScale[3]"], "", None ),
592 ( "GL_POST_COLOR_MATRIX_RED_BIAS_SGI", GLfloat
,
593 ["ctx->Pixel.PostColorMatrixBias[0]"], "", None ),
594 ( "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI", GLfloat
,
595 ["ctx->Pixel.PostColorMatrixBias[1]"], "", None ),
596 ( "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI", GLfloat
,
597 ["ctx->Pixel.PostColorMatrixBias[2]"], "", None ),
598 ( "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI", GLfloat
,
599 ["ctx->Pixel.PostColorMatrixBias[3]"], "", None ),
601 # GL_EXT_convolution (also in 1.2 imaging)
602 ( "GL_CONVOLUTION_1D_EXT", GLboolean
,
603 ["ctx->Pixel.Convolution1DEnabled"], "", ["EXT_convolution"] ),
604 ( "GL_CONVOLUTION_2D_EXT", GLboolean
,
605 ["ctx->Pixel.Convolution2DEnabled"], "", ["EXT_convolution"] ),
606 ( "GL_SEPARABLE_2D_EXT", GLboolean
,
607 ["ctx->Pixel.Separable2DEnabled"], "", ["EXT_convolution"] ),
608 ( "GL_POST_CONVOLUTION_RED_SCALE_EXT", GLfloat
,
609 ["ctx->Pixel.PostConvolutionScale[0]"], "", ["EXT_convolution"] ),
610 ( "GL_POST_CONVOLUTION_GREEN_SCALE_EXT", GLfloat
,
611 ["ctx->Pixel.PostConvolutionScale[1]"], "", ["EXT_convolution"] ),
612 ( "GL_POST_CONVOLUTION_BLUE_SCALE_EXT", GLfloat
,
613 ["ctx->Pixel.PostConvolutionScale[2]"], "", ["EXT_convolution"] ),
614 ( "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT", GLfloat
,
615 ["ctx->Pixel.PostConvolutionScale[3]"], "", ["EXT_convolution"] ),
616 ( "GL_POST_CONVOLUTION_RED_BIAS_EXT", GLfloat
,
617 ["ctx->Pixel.PostConvolutionBias[0]"], "", ["EXT_convolution"] ),
618 ( "GL_POST_CONVOLUTION_GREEN_BIAS_EXT", GLfloat
,
619 ["ctx->Pixel.PostConvolutionBias[1]"], "", ["EXT_convolution"] ),
620 ( "GL_POST_CONVOLUTION_BLUE_BIAS_EXT", GLfloat
,
621 ["ctx->Pixel.PostConvolutionBias[2]"], "", ["EXT_convolution"] ),
622 ( "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT", GLfloat
,
623 ["ctx->Pixel.PostConvolutionBias[3]"], "", ["EXT_convolution"] ),
625 # GL_EXT_histogram / GL_ARB_imaging
626 ( "GL_HISTOGRAM", GLboolean
,
627 [ "ctx->Pixel.HistogramEnabled" ], "", ["EXT_histogram"] ),
628 ( "GL_MINMAX", GLboolean
,
629 [ "ctx->Pixel.MinMaxEnabled" ], "", ["EXT_histogram"] ),
631 # GL_SGI_color_table / GL_ARB_imaging
632 ( "GL_COLOR_TABLE_SGI", GLboolean
,
633 ["ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]"], "", ["SGI_color_table"] ),
634 ( "GL_POST_CONVOLUTION_COLOR_TABLE_SGI", GLboolean
,
635 ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]"], "", ["SGI_color_table"] ),
636 ( "GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI", GLboolean
,
637 ["ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]"], "", ["SGI_color_table"] ),
639 # GL_SGI_texture_color_table
640 ( "GL_TEXTURE_COLOR_TABLE_SGI", GLboolean
,
641 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled"],
642 "", ["SGI_texture_color_table"] ),
644 # GL_EXT_secondary_color
645 ( "GL_COLOR_SUM_EXT", GLboolean
,
646 ["ctx->Fog.ColorSumEnabled"], "",
647 ["EXT_secondary_color", "ARB_vertex_program"] ),
648 ( "GL_CURRENT_SECONDARY_COLOR_EXT", GLfloatN
,
649 ["ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]",
650 "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]",
651 "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]",
652 "ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]"],
653 "FLUSH_CURRENT(ctx, 0);", ["EXT_secondary_color"] ),
654 ( "GL_SECONDARY_COLOR_ARRAY_EXT", GLboolean
,
655 ["ctx->Array.ArrayObj->SecondaryColor.Enabled"], "", ["EXT_secondary_color"] ),
656 ( "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT", GLenum
,
657 ["ctx->Array.ArrayObj->SecondaryColor.Type"], "", ["EXT_secondary_color"] ),
658 ( "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT", GLint
,
659 ["ctx->Array.ArrayObj->SecondaryColor.Stride"], "", ["EXT_secondary_color"] ),
660 ( "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT", GLint
,
661 ["ctx->Array.ArrayObj->SecondaryColor.Size"], "", ["EXT_secondary_color"] ),
664 ( "GL_CURRENT_FOG_COORDINATE_EXT", GLfloat
,
665 ["ctx->Current.Attrib[VERT_ATTRIB_FOG][0]"],
666 "FLUSH_CURRENT(ctx, 0);", ["EXT_fog_coord"] ),
667 ( "GL_FOG_COORDINATE_ARRAY_EXT", GLboolean
, ["ctx->Array.ArrayObj->FogCoord.Enabled"],
668 "", ["EXT_fog_coord"] ),
669 ( "GL_FOG_COORDINATE_ARRAY_TYPE_EXT", GLenum
, ["ctx->Array.ArrayObj->FogCoord.Type"],
670 "", ["EXT_fog_coord"] ),
671 ( "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT", GLint
, ["ctx->Array.ArrayObj->FogCoord.Stride"],
672 "", ["EXT_fog_coord"] ),
673 ( "GL_FOG_COORDINATE_SOURCE_EXT", GLenum
, ["ctx->Fog.FogCoordinateSource"],
674 "", ["EXT_fog_coord"] ),
676 # GL_EXT_texture_lod_bias
677 ( "GL_MAX_TEXTURE_LOD_BIAS_EXT", GLfloat
,
678 ["ctx->Const.MaxTextureLodBias"], "", ["EXT_texture_lod_bias"]),
680 # GL_EXT_texture_filter_anisotropic
681 ( "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", GLfloat
,
682 ["ctx->Const.MaxTextureMaxAnisotropy"], "", ["EXT_texture_filter_anisotropic"]),
685 ( "GL_MULTISAMPLE_ARB", GLboolean
,
686 ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ),
687 ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean
,
688 ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ),
689 ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean
,
690 ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ),
691 ( "GL_SAMPLE_COVERAGE_ARB", GLboolean
,
692 ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ),
693 ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat
,
694 ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ),
695 ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean
,
696 ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ),
697 ( "GL_SAMPLE_BUFFERS_ARB", GLint
,
698 ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ),
699 ( "GL_SAMPLES_ARB", GLint
,
700 ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ),
702 # GL_IBM_rasterpos_clip
703 ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean
,
704 ["ctx->Transform.RasterPositionUnclipped"], "", ["IBM_rasterpos_clip"] ),
707 ( "GL_POINT_SPRITE_NV", GLboolean
, ["ctx->Point.PointSprite"], # == GL_POINT_SPRITE_ARB
708 "", ["NV_point_sprite", "ARB_point_sprite"] ),
709 ( "GL_POINT_SPRITE_R_MODE_NV", GLenum
, ["ctx->Point.SpriteRMode"],
710 "", ["NV_point_sprite"] ),
711 ( "GL_POINT_SPRITE_COORD_ORIGIN", GLenum
, ["ctx->Point.SpriteOrigin"],
712 "", ["NV_point_sprite", "ARB_point_sprite"] ),
714 # GL_SGIS_generate_mipmap
715 ( "GL_GENERATE_MIPMAP_HINT_SGIS", GLenum
, ["ctx->Hint.GenerateMipmap"],
716 "", ["SGIS_generate_mipmap"] ),
718 # GL_NV_vertex_program
719 ( "GL_VERTEX_PROGRAM_BINDING_NV", GLint
,
720 ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"],
721 "", ["NV_vertex_program"] ),
722 ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean
,
723 ["ctx->Array.ArrayObj->VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ),
724 ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean
,
725 ["ctx->Array.ArrayObj->VertexAttrib[1].Enabled"], "", ["NV_vertex_program"] ),
726 ( "GL_VERTEX_ATTRIB_ARRAY2_NV", GLboolean
,
727 ["ctx->Array.ArrayObj->VertexAttrib[2].Enabled"], "", ["NV_vertex_program"] ),
728 ( "GL_VERTEX_ATTRIB_ARRAY3_NV", GLboolean
,
729 ["ctx->Array.ArrayObj->VertexAttrib[3].Enabled"], "", ["NV_vertex_program"] ),
730 ( "GL_VERTEX_ATTRIB_ARRAY4_NV", GLboolean
,
731 ["ctx->Array.ArrayObj->VertexAttrib[4].Enabled"], "", ["NV_vertex_program"] ),
732 ( "GL_VERTEX_ATTRIB_ARRAY5_NV", GLboolean
,
733 ["ctx->Array.ArrayObj->VertexAttrib[5].Enabled"], "", ["NV_vertex_program"] ),
734 ( "GL_VERTEX_ATTRIB_ARRAY6_NV", GLboolean
,
735 ["ctx->Array.ArrayObj->VertexAttrib[6].Enabled"], "", ["NV_vertex_program"] ),
736 ( "GL_VERTEX_ATTRIB_ARRAY7_NV", GLboolean
,
737 ["ctx->Array.ArrayObj->VertexAttrib[7].Enabled"], "", ["NV_vertex_program"] ),
738 ( "GL_VERTEX_ATTRIB_ARRAY8_NV", GLboolean
,
739 ["ctx->Array.ArrayObj->VertexAttrib[8].Enabled"], "", ["NV_vertex_program"] ),
740 ( "GL_VERTEX_ATTRIB_ARRAY9_NV", GLboolean
,
741 ["ctx->Array.ArrayObj->VertexAttrib[9].Enabled"], "", ["NV_vertex_program"] ),
742 ( "GL_VERTEX_ATTRIB_ARRAY10_NV", GLboolean
,
743 ["ctx->Array.ArrayObj->VertexAttrib[10].Enabled"], "", ["NV_vertex_program"] ),
744 ( "GL_VERTEX_ATTRIB_ARRAY11_NV", GLboolean
,
745 ["ctx->Array.ArrayObj->VertexAttrib[11].Enabled"], "", ["NV_vertex_program"] ),
746 ( "GL_VERTEX_ATTRIB_ARRAY12_NV", GLboolean
,
747 ["ctx->Array.ArrayObj->VertexAttrib[12].Enabled"], "", ["NV_vertex_program"] ),
748 ( "GL_VERTEX_ATTRIB_ARRAY13_NV", GLboolean
,
749 ["ctx->Array.ArrayObj->VertexAttrib[13].Enabled"], "", ["NV_vertex_program"] ),
750 ( "GL_VERTEX_ATTRIB_ARRAY14_NV", GLboolean
,
751 ["ctx->Array.ArrayObj->VertexAttrib[14].Enabled"], "", ["NV_vertex_program"] ),
752 ( "GL_VERTEX_ATTRIB_ARRAY15_NV", GLboolean
,
753 ["ctx->Array.ArrayObj->VertexAttrib[15].Enabled"], "", ["NV_vertex_program"] ),
754 ( "GL_MAP1_VERTEX_ATTRIB0_4_NV", GLboolean
,
755 ["ctx->Eval.Map1Attrib[0]"], "", ["NV_vertex_program"] ),
756 ( "GL_MAP1_VERTEX_ATTRIB1_4_NV", GLboolean
,
757 ["ctx->Eval.Map1Attrib[1]"], "", ["NV_vertex_program"] ),
758 ( "GL_MAP1_VERTEX_ATTRIB2_4_NV", GLboolean
,
759 ["ctx->Eval.Map1Attrib[2]"], "", ["NV_vertex_program"] ),
760 ( "GL_MAP1_VERTEX_ATTRIB3_4_NV", GLboolean
,
761 ["ctx->Eval.Map1Attrib[3]"], "", ["NV_vertex_program"] ),
762 ( "GL_MAP1_VERTEX_ATTRIB4_4_NV", GLboolean
,
763 ["ctx->Eval.Map1Attrib[4]"], "", ["NV_vertex_program"] ),
764 ( "GL_MAP1_VERTEX_ATTRIB5_4_NV", GLboolean
,
765 ["ctx->Eval.Map1Attrib[5]"], "", ["NV_vertex_program"] ),
766 ( "GL_MAP1_VERTEX_ATTRIB6_4_NV", GLboolean
,
767 ["ctx->Eval.Map1Attrib[6]"], "", ["NV_vertex_program"] ),
768 ( "GL_MAP1_VERTEX_ATTRIB7_4_NV", GLboolean
,
769 ["ctx->Eval.Map1Attrib[7]"], "", ["NV_vertex_program"] ),
770 ( "GL_MAP1_VERTEX_ATTRIB8_4_NV", GLboolean
,
771 ["ctx->Eval.Map1Attrib[8]"], "", ["NV_vertex_program"] ),
772 ( "GL_MAP1_VERTEX_ATTRIB9_4_NV", GLboolean
,
773 ["ctx->Eval.Map1Attrib[9]"], "", ["NV_vertex_program"] ),
774 ( "GL_MAP1_VERTEX_ATTRIB10_4_NV", GLboolean
,
775 ["ctx->Eval.Map1Attrib[10]"], "", ["NV_vertex_program"] ),
776 ( "GL_MAP1_VERTEX_ATTRIB11_4_NV", GLboolean
,
777 ["ctx->Eval.Map1Attrib[11]"], "", ["NV_vertex_program"] ),
778 ( "GL_MAP1_VERTEX_ATTRIB12_4_NV", GLboolean
,
779 ["ctx->Eval.Map1Attrib[12]"], "", ["NV_vertex_program"] ),
780 ( "GL_MAP1_VERTEX_ATTRIB13_4_NV", GLboolean
,
781 ["ctx->Eval.Map1Attrib[13]"], "", ["NV_vertex_program"] ),
782 ( "GL_MAP1_VERTEX_ATTRIB14_4_NV", GLboolean
,
783 ["ctx->Eval.Map1Attrib[14]"], "", ["NV_vertex_program"] ),
784 ( "GL_MAP1_VERTEX_ATTRIB15_4_NV", GLboolean
,
785 ["ctx->Eval.Map1Attrib[15]"], "", ["NV_vertex_program"] ),
787 # GL_NV_fragment_program
788 ( "GL_FRAGMENT_PROGRAM_NV", GLboolean
,
789 ["ctx->FragmentProgram.Enabled"], "", ["NV_fragment_program"] ),
790 ( "GL_FRAGMENT_PROGRAM_BINDING_NV", GLint
,
791 ["ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0"],
792 "", ["NV_fragment_program"] ),
793 ( "GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV", GLint
,
794 ["MAX_NV_FRAGMENT_PROGRAM_PARAMS"], "", ["NV_fragment_program"] ),
796 # GL_NV_texture_rectangle
797 ( "GL_TEXTURE_RECTANGLE_NV", GLboolean
,
798 ["_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)"], "", ["NV_texture_rectangle"] ),
799 ( "GL_TEXTURE_BINDING_RECTANGLE_NV", GLint
,
800 ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name"],
801 "", ["NV_texture_rectangle"] ),
802 ( "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", GLint
,
803 ["ctx->Const.MaxTextureRectSize"], "", ["NV_texture_rectangle"] ),
805 # GL_EXT_stencil_two_side
806 ( "GL_STENCIL_TEST_TWO_SIDE_EXT", GLboolean
,
807 ["ctx->Stencil.TestTwoSide"], "", ["EXT_stencil_two_side"] ),
808 ( "GL_ACTIVE_STENCIL_FACE_EXT", GLenum
,
809 ["ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT"],
810 "", ["EXT_stencil_two_side"] ),
812 # GL_NV_light_max_exponent
813 ( "GL_MAX_SHININESS_NV", GLfloat
,
814 ["ctx->Const.MaxShininess"], "", ["NV_light_max_exponent"] ),
815 ( "GL_MAX_SPOT_EXPONENT_NV", GLfloat
,
816 ["ctx->Const.MaxSpotExponent"], "", ["NV_light_max_exponent"] ),
818 # GL_ARB_vertex_buffer_object
819 ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint
,
820 ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
821 ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint
,
822 ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
823 ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint
,
824 ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
825 ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint
,
826 ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
827 ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint
,
828 ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
829 ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint
,
830 ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"],
831 "", ["ARB_vertex_buffer_object"] ),
832 ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint
,
833 ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ),
834 ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint
,
835 ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"],
836 "", ["ARB_vertex_buffer_object"] ),
837 ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint
,
838 ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"],
839 "", ["ARB_vertex_buffer_object"] ),
840 # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported
841 ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint
,
842 ["ctx->Array.ElementArrayBufferObj->Name"],
843 "", ["ARB_vertex_buffer_object"] ),
845 # GL_EXT_pixel_buffer_object
846 ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint
,
847 ["ctx->Pack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ),
848 ( "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT", GLint
,
849 ["ctx->Unpack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ),
851 # GL_ARB_vertex_program
852 ( "GL_VERTEX_PROGRAM_ARB", GLboolean
, # == GL_VERTEX_PROGRAM_NV
853 ["ctx->VertexProgram.Enabled"], "",
854 ["ARB_vertex_program", "NV_vertex_program"] ),
855 ( "GL_VERTEX_PROGRAM_POINT_SIZE_ARB", GLboolean
, # == GL_VERTEX_PROGRAM_POINT_SIZE_NV
856 ["ctx->VertexProgram.PointSizeEnabled"], "",
857 ["ARB_vertex_program", "NV_vertex_program"] ),
858 ( "GL_VERTEX_PROGRAM_TWO_SIDE_ARB", GLboolean
, # == GL_VERTEX_PROGRAM_TWO_SIDE_NV
859 ["ctx->VertexProgram.TwoSideEnabled"], "",
860 ["ARB_vertex_program", "NV_vertex_program"] ),
861 ( "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", GLint
, # == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
862 ["ctx->Const.MaxProgramMatrixStackDepth"], "",
863 ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ),
864 ( "GL_MAX_PROGRAM_MATRICES_ARB", GLint
, # == GL_MAX_TRACK_MATRICES_NV
865 ["ctx->Const.MaxProgramMatrices"], "",
866 ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ),
867 ( "GL_CURRENT_MATRIX_STACK_DEPTH_ARB", GLboolean
, # == GL_CURRENT_MATRIX_STACK_DEPTH_NV
868 ["ctx->CurrentStack->Depth + 1"], "",
869 ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ),
870 ( "GL_CURRENT_MATRIX_ARB", GLfloat
, # == GL_CURRENT_MATRIX_NV
871 ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]",
872 "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]",
873 "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]",
874 "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ],
875 "const GLfloat *matrix = ctx->CurrentStack->Top->m;",
876 ["ARB_vertex_program", "ARB_fragment_program", "NV_fragment_program"] ),
877 ( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat
,
878 ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]",
879 "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]",
880 "matrix[2]", "matrix[6]", "matrix[10]", "matrix[14]",
881 "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
882 "const GLfloat *matrix = ctx->CurrentStack->Top->m;",
883 ["ARB_vertex_program", "ARB_fragment_program"] ),
884 ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint
,
885 ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ),
886 ( "GL_PROGRAM_ERROR_POSITION_ARB", GLint
, # == GL_PROGRAM_ERROR_POSITION_NV
887 ["ctx->Program.ErrorPos"], "", ["NV_vertex_program",
888 "ARB_vertex_program", "NV_fragment_program", "ARB_fragment_program"] ),
890 # GL_ARB_fragment_program
891 ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean
,
892 ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ),
893 ( "GL_MAX_TEXTURE_COORDS_ARB", GLint
, # == GL_MAX_TEXTURE_COORDS_NV
894 ["ctx->Const.MaxTextureCoordUnits"], "",
895 ["ARB_fragment_program", "NV_fragment_program"] ),
896 ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint
, # == GL_MAX_TEXTURE_IMAGE_UNITS_NV
897 ["ctx->Const.MaxTextureImageUnits"], "",
898 ["ARB_fragment_program", "NV_fragment_program"] ),
900 # GL_EXT_depth_bounds_test
901 ( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean
,
902 ["ctx->Depth.BoundsTest"], "", ["EXT_depth_bounds_test"] ),
903 ( "GL_DEPTH_BOUNDS_EXT", GLfloat
,
904 ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"],
905 "", ["EXT_depth_bounds_test"] ),
907 # GL_MESA_program_debug
908 ( "GL_FRAGMENT_PROGRAM_CALLBACK_MESA", GLboolean
,
909 ["ctx->FragmentProgram.CallbackEnabled"], "", ["MESA_program_debug"] ),
910 ( "GL_VERTEX_PROGRAM_CALLBACK_MESA", GLboolean
,
911 ["ctx->VertexProgram.CallbackEnabled"], "", ["MESA_program_debug"] ),
912 ( "GL_FRAGMENT_PROGRAM_POSITION_MESA", GLint
,
913 ["ctx->FragmentProgram.CurrentPosition"], "", ["MESA_program_debug"] ),
914 ( "GL_VERTEX_PROGRAM_POSITION_MESA", GLint
,
915 ["ctx->VertexProgram.CurrentPosition"], "", ["MESA_program_debug"] ),
917 # GL_ARB_draw_buffers
918 ( "GL_MAX_DRAW_BUFFERS_ARB", GLint
,
919 ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ),
920 ( "GL_DRAW_BUFFER0_ARB", GLenum
,
921 ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ),
922 ( "GL_DRAW_BUFFER1_ARB", GLenum
,
925 if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
926 _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
929 buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ),
930 ( "GL_DRAW_BUFFER2_ARB", GLenum
,
933 if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
934 _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
937 buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ),
938 ( "GL_DRAW_BUFFER3_ARB", GLenum
,
941 if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
942 _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
945 buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ),
946 # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future
949 ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint
,
950 ["ctx->Const.ColorReadType"], "", ["OES_read_format"] ),
951 ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint
,
952 ["ctx->Const.ColorReadFormat"], "", ["OES_read_format"] ),
954 # GL_ATI_fragment_shader
955 ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint
, ["6"], "", ["ATI_fragment_shader"] ),
956 ( "GL_NUM_FRAGMENT_CONSTANTS_ATI", GLint
, ["8"], "", ["ATI_fragment_shader"] ),
957 ( "GL_NUM_PASSES_ATI", GLint
, ["2"], "", ["ATI_fragment_shader"] ),
958 ( "GL_NUM_INSTRUCTIONS_PER_PASS_ATI", GLint
, ["8"], "", ["ATI_fragment_shader"] ),
959 ( "GL_NUM_INSTRUCTIONS_TOTAL_ATI", GLint
, ["16"], "", ["ATI_fragment_shader"] ),
960 ( "GL_COLOR_ALPHA_PAIRING_ATI", GLboolean
, ["GL_TRUE"], "", ["ATI_fragment_shader"] ),
961 ( "GL_NUM_LOOPBACK_COMPONENTS_ATI", GLint
, ["3"], "", ["ATI_fragment_shader"] ),
962 ( "GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI", GLint
, ["3"], "", ["ATI_fragment_shader"] ),
965 ( "GL_STENCIL_BACK_FUNC", GLenum
, ["ctx->Stencil.Function[1]"], "", None ),
966 ( "GL_STENCIL_BACK_VALUE_MASK", GLint
, ["ctx->Stencil.ValueMask[1]"], "", None ),
967 ( "GL_STENCIL_BACK_WRITEMASK", GLint
, ["ctx->Stencil.WriteMask[1]"], "", None ),
968 ( "GL_STENCIL_BACK_REF", GLint
, ["ctx->Stencil.Ref[1]"], "", None ),
969 ( "GL_STENCIL_BACK_FAIL", GLenum
, ["ctx->Stencil.FailFunc[1]"], "", None ),
970 ( "GL_STENCIL_BACK_PASS_DEPTH_FAIL", GLenum
, ["ctx->Stencil.ZFailFunc[1]"], "", None ),
971 ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum
, ["ctx->Stencil.ZPassFunc[1]"], "", None ),
973 # GL_EXT_framebuffer_object
974 ( "GL_FRAMEBUFFER_BINDING_EXT", GLint
, ["ctx->DrawBuffer->Name"], "",
975 ["EXT_framebuffer_object"] ),
976 ( "GL_RENDERBUFFER_BINDING_EXT", GLint
,
977 ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "",
978 ["EXT_framebuffer_object"] ),
979 ( "GL_MAX_COLOR_ATTACHMENTS_EXT", GLint
,
980 ["ctx->Const.MaxColorAttachments"], "",
981 ["EXT_framebuffer_object"] ),
982 ( "GL_MAX_RENDERBUFFER_SIZE_EXT", GLint
,
983 ["ctx->Const.MaxRenderbufferSize"], "",
984 ["EXT_framebuffer_object"] ),
986 # GL_ARB_fragment_shader
987 ( "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", GLint
,
988 ["ctx->Const.FragmentProgram.MaxUniformComponents"], "",
989 ["ARB_fragment_shader"] ),
990 ( "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB", GLenum
,
991 ["ctx->Hint.FragmentShaderDerivative"], "", ["ARB_fragment_shader"] ),
993 # GL_ARB_vertex_shader
994 ( "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB", GLint
,
995 ["ctx->Const.VertexProgram.MaxUniformComponents"], "",
996 ["ARB_vertex_shader"] ),
997 ( "GL_MAX_VARYING_FLOATS_ARB", GLint
,
998 ["ctx->Const.MaxVarying * 4"], "", ["ARB_vertex_shader"] ),
999 ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint
,
1000 ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ),
1001 ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint
,
1002 ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ),
1004 # GL_ARB_shader_objects
1005 # Actually, this token isn't part of GL_ARB_shader_objects, but is
1006 # close enough for now.
1007 ( "GL_CURRENT_PROGRAM", GLint
,
1008 ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"],
1009 "", ["ARB_shader_objects"] )
1013 def ConversionFunc(fromType
, toType
):
1014 """Return the name of the macro to convert between two data types."""
1015 if fromType
== toType
:
1017 elif fromType
== GLfloat
and toType
== GLint
:
1019 elif fromType
== GLfloatN
and toType
== GLfloat
:
1021 elif fromType
== GLint
and toType
== GLfloat
: # but not GLfloatN!
1024 if fromType
== GLfloatN
:
1026 fromStr
= TypeStrings
[fromType
]
1027 fromStr
= string
.upper(fromStr
[2:])
1028 toStr
= TypeStrings
[toType
]
1029 toStr
= string
.upper(toStr
[2:])
1030 return fromStr
+ "_TO_" + toStr
1033 def EmitGetFunction(stateVars
, returnType
):
1034 """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv."""
1035 assert (returnType
== GLboolean
or
1036 returnType
== GLint
or
1037 returnType
== GLfloat
)
1039 strType
= TypeStrings
[returnType
]
1040 # Capitalize first letter of return type
1041 if returnType
== GLint
:
1042 function
= "GetIntegerv"
1043 elif returnType
== GLboolean
:
1044 function
= "GetBooleanv"
1045 elif returnType
== GLfloat
:
1046 function
= "GetFloatv"
1050 print "void GLAPIENTRY"
1051 print "_mesa_%s( GLenum pname, %s *params )" % (function
, strType
)
1053 print " GET_CURRENT_CONTEXT(ctx);"
1054 print " ASSERT_OUTSIDE_BEGIN_END(ctx);"
1056 print " if (!params)"
1059 print " if (ctx->NewState)"
1060 print " _mesa_update_state(ctx);"
1062 print " if (ctx->Driver.%s &&" % function
1063 print " ctx->Driver.%s(ctx, pname, params))" % function
1066 print " switch (pname) {"
1068 for (name
, varType
, state
, optionalCode
, extensions
) in stateVars
:
1069 print " case " + name
+ ":"
1071 if len(extensions
) == 1:
1072 print (' CHECK_EXT1(%s, "%s");' %
1073 (extensions
[0], function
))
1074 elif len(extensions
) == 2:
1075 print (' CHECK_EXT2(%s, %s, "%s");' %
1076 (extensions
[0], extensions
[1], function
))
1077 elif len(extensions
) == 3:
1078 print (' CHECK_EXT3(%s, %s, %s, "%s");' %
1079 (extensions
[0], extensions
[1], extensions
[2], function
))
1081 assert len(extensions
) == 4
1082 print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' %
1083 (extensions
[0], extensions
[1], extensions
[2], extensions
[3], function
))
1086 print " " + optionalCode
1087 conversion
= ConversionFunc(varType
, returnType
)
1091 print " params[%d] = %s(%s);" % (i
, conversion
, state
[i
])
1093 print " params[%d] = %s;" % (i
, state
[i
])
1099 print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function
1108 """Print the get.c file header."""
1111 *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py
1114 #include "glheader.h"
1115 #include "context.h"
1117 #include "extensions.h"
1118 #include "fbobject.h"
1123 #include "texcompress.h"
1126 #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
1128 #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
1130 #define BOOLEAN_TO_INT(B) ( (GLint) (B) )
1131 #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
1135 * Check if named extension is enabled, if not generate error and return.
1137 #define CHECK_EXT1(EXT1, FUNC) \\
1138 if (!ctx->Extensions.EXT1) { \\
1139 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
1144 * Check if either of two extensions is enabled.
1146 #define CHECK_EXT2(EXT1, EXT2, FUNC) \\
1147 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \\
1148 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
1153 * Check if either of three extensions is enabled.
1155 #define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \\
1156 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\
1157 !ctx->Extensions.EXT3) { \\
1158 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
1163 * Check if either of four extensions is enabled.
1165 #define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \\
1166 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \\
1167 !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \\
1168 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \\
1177 def EmitGetDoublev():
1180 _mesa_GetDoublev( GLenum pname, GLdouble *params )
1182 const GLfloat magic = -1234.5F;
1189 /* Init temp array to magic numbers so we can figure out how many values
1190 * are returned by the GetFloatv() call.
1192 for (i = 0; i < 16; i++)
1195 _mesa_GetFloatv(pname, values);
1197 for (i = 0; i < 16 && values[i] != magic; i++)
1198 params[i] = (GLdouble) values[i];
1206 # XXX Maybe sort the StateVars list
1207 EmitGetFunction(StateVars
, GLboolean
)
1208 EmitGetFunction(StateVars
, GLfloat
)
1209 EmitGetFunction(StateVars
, GLint
)