3 *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py
9 #include "extensions.h"
15 #include "texcompress.h"
18 #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
20 #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
22 #define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE )
23 #define ENUM_TO_INT(E) ( (GLint) (E) )
24 #define ENUM_TO_FLOAT(E) ( (GLfloat) (E) )
26 #define BOOLEAN_TO_INT(B) ( (GLint) (B) )
27 #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
31 * Check if named extension is enabled, if not generate error and return.
33 #define CHECK_EXT1(EXT1, FUNC) \
34 if (!ctx->Extensions.EXT1) { \
35 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
40 * Check if either of two extensions is enabled.
42 #define CHECK_EXT2(EXT1, EXT2, FUNC) \
43 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
44 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
49 * Check if either of three extensions is enabled.
51 #define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \
52 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \
53 !ctx->Extensions.EXT3) { \
54 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
59 * Check if either of four extensions is enabled.
61 #define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \
62 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \
63 !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \
64 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
70 _mesa_GetBooleanv( GLenum pname
, GLboolean
*params
)
72 GET_CURRENT_CONTEXT(ctx
);
73 ASSERT_OUTSIDE_BEGIN_END(ctx
);
79 _mesa_update_state(ctx
);
81 if (ctx
->Driver
.GetBooleanv
&&
82 ctx
->Driver
.GetBooleanv(ctx
, pname
, params
))
86 case GL_ACCUM_RED_BITS
:
87 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumRedBits
);
89 case GL_ACCUM_GREEN_BITS
:
90 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
92 case GL_ACCUM_BLUE_BITS
:
93 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
95 case GL_ACCUM_ALPHA_BITS
:
96 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
98 case GL_ACCUM_CLEAR_VALUE
:
99 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[0]);
100 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[1]);
101 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[2]);
102 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[3]);
105 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.AlphaBias
);
108 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.alphaBits
);
111 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.AlphaScale
);
114 params
[0] = ctx
->Color
.AlphaEnabled
;
116 case GL_ALPHA_TEST_FUNC
:
117 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.AlphaFunc
);
119 case GL_ALPHA_TEST_REF
:
120 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.AlphaRef
);
122 case GL_ATTRIB_STACK_DEPTH
:
123 params
[0] = INT_TO_BOOLEAN(ctx
->AttribStackDepth
);
126 params
[0] = ctx
->Eval
.AutoNormal
;
129 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
132 params
[0] = ctx
->Color
.BlendEnabled
;
135 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstRGB
);
138 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcRGB
);
140 case GL_BLEND_SRC_RGB_EXT
:
141 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcRGB
);
143 case GL_BLEND_DST_RGB_EXT
:
144 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstRGB
);
146 case GL_BLEND_SRC_ALPHA_EXT
:
147 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcA
);
149 case GL_BLEND_DST_ALPHA_EXT
:
150 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstA
);
152 case GL_BLEND_EQUATION
:
153 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendEquationRGB
);
155 case GL_BLEND_EQUATION_ALPHA_EXT
:
156 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendEquationA
);
158 case GL_BLEND_COLOR_EXT
:
159 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[0]);
160 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[1]);
161 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[2]);
162 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[3]);
165 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.BlueBias
);
168 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.blueBits
);
171 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.BlueScale
);
173 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
174 params
[0] = INT_TO_BOOLEAN(ctx
->ClientAttribStackDepth
);
177 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1;
180 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1;
183 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1;
186 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1;
189 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1;
192 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1;
194 case GL_COLOR_CLEAR_VALUE
:
195 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[0]);
196 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[1]);
197 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[2]);
198 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[3]);
200 case GL_COLOR_MATERIAL
:
201 params
[0] = ctx
->Light
.ColorMaterialEnabled
;
203 case GL_COLOR_MATERIAL_FACE
:
204 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ColorMaterialFace
);
206 case GL_COLOR_MATERIAL_PARAMETER
:
207 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ColorMaterialMode
);
209 case GL_COLOR_WRITEMASK
:
210 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0);
211 params
[1] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0);
212 params
[2] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0);
213 params
[3] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0);
216 params
[0] = ctx
->Polygon
.CullFlag
;
218 case GL_CULL_FACE_MODE
:
219 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.CullFaceMode
);
221 case GL_CURRENT_COLOR
:
223 FLUSH_CURRENT(ctx
, 0);
224 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
225 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
226 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
227 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
230 case GL_CURRENT_INDEX
:
232 FLUSH_CURRENT(ctx
, 0);
233 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
236 case GL_CURRENT_NORMAL
:
238 FLUSH_CURRENT(ctx
, 0);
239 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
240 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
241 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
244 case GL_CURRENT_RASTER_COLOR
:
245 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[0]);
246 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[1]);
247 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[2]);
248 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[3]);
250 case GL_CURRENT_RASTER_DISTANCE
:
251 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterDistance
);
253 case GL_CURRENT_RASTER_INDEX
:
254 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterIndex
);
256 case GL_CURRENT_RASTER_POSITION
:
257 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[0]);
258 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[1]);
259 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[2]);
260 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[3]);
262 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
263 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[0]);
264 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[1]);
265 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[2]);
266 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[3]);
268 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
270 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
271 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[texUnit
][0]);
272 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[texUnit
][1]);
273 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[texUnit
][2]);
274 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[texUnit
][3]);
277 case GL_CURRENT_RASTER_POSITION_VALID
:
278 params
[0] = ctx
->Current
.RasterPosValid
;
280 case GL_CURRENT_TEXTURE_COORDS
:
282 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
283 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0]);
284 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1]);
285 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2]);
286 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3]);
290 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.DepthBias
);
293 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.depthBits
);
295 case GL_DEPTH_CLEAR_VALUE
:
296 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Depth
.Clear
);
299 params
[0] = ENUM_TO_BOOLEAN(ctx
->Depth
.Func
);
302 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Viewport
.Near
);
303 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Viewport
.Far
);
306 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.DepthScale
);
309 params
[0] = ctx
->Depth
.Test
;
311 case GL_DEPTH_WRITEMASK
:
312 params
[0] = ctx
->Depth
.Mask
;
315 params
[0] = ctx
->Color
.DitherFlag
;
317 case GL_DOUBLEBUFFER
:
318 params
[0] = ctx
->DrawBuffer
->Visual
.doubleBufferMode
;
321 params
[0] = ENUM_TO_BOOLEAN(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
325 FLUSH_CURRENT(ctx
, 0);
326 params
[0] = ctx
->Current
.EdgeFlag
;
329 case GL_FEEDBACK_BUFFER_SIZE
:
330 params
[0] = INT_TO_BOOLEAN(ctx
->Feedback
.BufferSize
);
332 case GL_FEEDBACK_BUFFER_TYPE
:
333 params
[0] = ENUM_TO_BOOLEAN(ctx
->Feedback
.Type
);
336 params
[0] = ctx
->Fog
.Enabled
;
339 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[0]);
340 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[1]);
341 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[2]);
342 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[3]);
345 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Density
);
348 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.End
);
351 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.Fog
);
354 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Index
);
357 params
[0] = ENUM_TO_BOOLEAN(ctx
->Fog
.Mode
);
360 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Start
);
363 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.FrontFace
);
366 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.GreenBias
);
369 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.greenBits
);
372 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.GreenScale
);
375 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.indexBits
);
377 case GL_INDEX_CLEAR_VALUE
:
378 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.ClearIndex
);
381 params
[0] = !ctx
->DrawBuffer
->Visual
.rgbMode
;
383 case GL_INDEX_OFFSET
:
384 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.IndexOffset
);
387 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.IndexShift
);
389 case GL_INDEX_WRITEMASK
:
390 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.IndexMask
);
393 params
[0] = ctx
->Light
.Light
[0].Enabled
;
396 params
[0] = ctx
->Light
.Light
[1].Enabled
;
399 params
[0] = ctx
->Light
.Light
[2].Enabled
;
402 params
[0] = ctx
->Light
.Light
[3].Enabled
;
405 params
[0] = ctx
->Light
.Light
[4].Enabled
;
408 params
[0] = ctx
->Light
.Light
[5].Enabled
;
411 params
[0] = ctx
->Light
.Light
[6].Enabled
;
414 params
[0] = ctx
->Light
.Light
[7].Enabled
;
417 params
[0] = ctx
->Light
.Enabled
;
419 case GL_LIGHT_MODEL_AMBIENT
:
420 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[0]);
421 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[1]);
422 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[2]);
423 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[3]);
425 case GL_LIGHT_MODEL_COLOR_CONTROL
:
426 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.Model
.ColorControl
);
428 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
429 params
[0] = ctx
->Light
.Model
.LocalViewer
;
431 case GL_LIGHT_MODEL_TWO_SIDE
:
432 params
[0] = ctx
->Light
.Model
.TwoSide
;
435 params
[0] = ctx
->Line
.SmoothFlag
;
437 case GL_LINE_SMOOTH_HINT
:
438 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.LineSmooth
);
440 case GL_LINE_STIPPLE
:
441 params
[0] = ctx
->Line
.StippleFlag
;
443 case GL_LINE_STIPPLE_PATTERN
:
444 params
[0] = INT_TO_BOOLEAN(ctx
->Line
.StipplePattern
);
446 case GL_LINE_STIPPLE_REPEAT
:
447 params
[0] = INT_TO_BOOLEAN(ctx
->Line
.StippleFactor
);
450 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Line
.Width
);
452 case GL_LINE_WIDTH_GRANULARITY
:
453 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.LineWidthGranularity
);
455 case GL_LINE_WIDTH_RANGE
:
456 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinLineWidthAA
);
457 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxLineWidthAA
);
459 case GL_ALIASED_LINE_WIDTH_RANGE
:
460 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinLineWidth
);
461 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxLineWidth
);
464 params
[0] = INT_TO_BOOLEAN(ctx
->List
.ListBase
);
467 params
[0] = INT_TO_BOOLEAN(ctx
->ListState
.CurrentListNum
);
472 if (!ctx
->CompileFlag
)
474 else if (ctx
->ExecuteFlag
)
475 mode
= GL_COMPILE_AND_EXECUTE
;
478 params
[0] = ENUM_TO_BOOLEAN(mode
);
481 case GL_INDEX_LOGIC_OP
:
482 params
[0] = ctx
->Color
.IndexLogicOpEnabled
;
484 case GL_COLOR_LOGIC_OP
:
485 params
[0] = ctx
->Color
.ColorLogicOpEnabled
;
487 case GL_LOGIC_OP_MODE
:
488 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.LogicOp
);
490 case GL_MAP1_COLOR_4
:
491 params
[0] = ctx
->Eval
.Map1Color4
;
493 case GL_MAP1_GRID_DOMAIN
:
494 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid1u1
);
495 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid1u2
);
497 case GL_MAP1_GRID_SEGMENTS
:
498 params
[0] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid1un
);
501 params
[0] = ctx
->Eval
.Map1Index
;
504 params
[0] = ctx
->Eval
.Map1Normal
;
506 case GL_MAP1_TEXTURE_COORD_1
:
507 params
[0] = ctx
->Eval
.Map1TextureCoord1
;
509 case GL_MAP1_TEXTURE_COORD_2
:
510 params
[0] = ctx
->Eval
.Map1TextureCoord2
;
512 case GL_MAP1_TEXTURE_COORD_3
:
513 params
[0] = ctx
->Eval
.Map1TextureCoord3
;
515 case GL_MAP1_TEXTURE_COORD_4
:
516 params
[0] = ctx
->Eval
.Map1TextureCoord4
;
518 case GL_MAP1_VERTEX_3
:
519 params
[0] = ctx
->Eval
.Map1Vertex3
;
521 case GL_MAP1_VERTEX_4
:
522 params
[0] = ctx
->Eval
.Map1Vertex4
;
524 case GL_MAP2_COLOR_4
:
525 params
[0] = ctx
->Eval
.Map2Color4
;
527 case GL_MAP2_GRID_DOMAIN
:
528 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2u1
);
529 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2u2
);
530 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2v1
);
531 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2v2
);
533 case GL_MAP2_GRID_SEGMENTS
:
534 params
[0] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid2un
);
535 params
[1] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid2vn
);
538 params
[0] = ctx
->Eval
.Map2Index
;
541 params
[0] = ctx
->Eval
.Map2Normal
;
543 case GL_MAP2_TEXTURE_COORD_1
:
544 params
[0] = ctx
->Eval
.Map2TextureCoord1
;
546 case GL_MAP2_TEXTURE_COORD_2
:
547 params
[0] = ctx
->Eval
.Map2TextureCoord2
;
549 case GL_MAP2_TEXTURE_COORD_3
:
550 params
[0] = ctx
->Eval
.Map2TextureCoord3
;
552 case GL_MAP2_TEXTURE_COORD_4
:
553 params
[0] = ctx
->Eval
.Map2TextureCoord4
;
555 case GL_MAP2_VERTEX_3
:
556 params
[0] = ctx
->Eval
.Map2Vertex3
;
558 case GL_MAP2_VERTEX_4
:
559 params
[0] = ctx
->Eval
.Map2Vertex4
;
562 params
[0] = ctx
->Pixel
.MapColorFlag
;
565 params
[0] = ctx
->Pixel
.MapStencilFlag
;
568 params
[0] = ENUM_TO_BOOLEAN(ctx
->Transform
.MatrixMode
);
570 case GL_MAX_ATTRIB_STACK_DEPTH
:
571 params
[0] = INT_TO_BOOLEAN(MAX_ATTRIB_STACK_DEPTH
);
573 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
574 params
[0] = INT_TO_BOOLEAN(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
576 case GL_MAX_CLIP_PLANES
:
577 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxClipPlanes
);
579 case GL_MAX_ELEMENTS_VERTICES
:
580 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxArrayLockSize
);
582 case GL_MAX_ELEMENTS_INDICES
:
583 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxArrayLockSize
);
585 case GL_MAX_EVAL_ORDER
:
586 params
[0] = INT_TO_BOOLEAN(MAX_EVAL_ORDER
);
589 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxLights
);
591 case GL_MAX_LIST_NESTING
:
592 params
[0] = INT_TO_BOOLEAN(MAX_LIST_NESTING
);
594 case GL_MAX_MODELVIEW_STACK_DEPTH
:
595 params
[0] = INT_TO_BOOLEAN(MAX_MODELVIEW_STACK_DEPTH
);
597 case GL_MAX_NAME_STACK_DEPTH
:
598 params
[0] = INT_TO_BOOLEAN(MAX_NAME_STACK_DEPTH
);
600 case GL_MAX_PIXEL_MAP_TABLE
:
601 params
[0] = INT_TO_BOOLEAN(MAX_PIXEL_MAP_TABLE
);
603 case GL_MAX_PROJECTION_STACK_DEPTH
:
604 params
[0] = INT_TO_BOOLEAN(MAX_PROJECTION_STACK_DEPTH
);
606 case GL_MAX_TEXTURE_SIZE
:
607 params
[0] = INT_TO_BOOLEAN(1 << (ctx
->Const
.MaxTextureLevels
- 1));
609 case GL_MAX_3D_TEXTURE_SIZE
:
610 params
[0] = INT_TO_BOOLEAN(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
612 case GL_MAX_TEXTURE_STACK_DEPTH
:
613 params
[0] = INT_TO_BOOLEAN(MAX_TEXTURE_STACK_DEPTH
);
615 case GL_MAX_VIEWPORT_DIMS
:
616 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxViewportWidth
);
617 params
[1] = INT_TO_BOOLEAN(ctx
->Const
.MaxViewportHeight
);
619 case GL_MODELVIEW_MATRIX
:
621 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
622 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
623 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
624 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
625 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
626 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
627 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
628 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
629 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
630 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
631 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
632 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
633 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
634 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
635 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
636 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
637 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
640 case GL_MODELVIEW_STACK_DEPTH
:
641 params
[0] = INT_TO_BOOLEAN(ctx
->ModelviewMatrixStack
.Depth
+ 1);
643 case GL_NAME_STACK_DEPTH
:
644 params
[0] = INT_TO_BOOLEAN(ctx
->Select
.NameStackDepth
);
647 params
[0] = ctx
->Transform
.Normalize
;
649 case GL_PACK_ALIGNMENT
:
650 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.Alignment
);
652 case GL_PACK_LSB_FIRST
:
653 params
[0] = ctx
->Pack
.LsbFirst
;
655 case GL_PACK_ROW_LENGTH
:
656 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.RowLength
);
658 case GL_PACK_SKIP_PIXELS
:
659 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipPixels
);
661 case GL_PACK_SKIP_ROWS
:
662 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipRows
);
664 case GL_PACK_SWAP_BYTES
:
665 params
[0] = ctx
->Pack
.SwapBytes
;
667 case GL_PACK_SKIP_IMAGES_EXT
:
668 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipImages
);
670 case GL_PACK_IMAGE_HEIGHT_EXT
:
671 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.ImageHeight
);
673 case GL_PACK_INVERT_MESA
:
674 params
[0] = ctx
->Pack
.Invert
;
676 case GL_PERSPECTIVE_CORRECTION_HINT
:
677 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PerspectiveCorrection
);
679 case GL_PIXEL_MAP_A_TO_A_SIZE
:
680 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapAtoAsize
);
682 case GL_PIXEL_MAP_B_TO_B_SIZE
:
683 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapBtoBsize
);
685 case GL_PIXEL_MAP_G_TO_G_SIZE
:
686 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapGtoGsize
);
688 case GL_PIXEL_MAP_I_TO_A_SIZE
:
689 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapItoAsize
);
691 case GL_PIXEL_MAP_I_TO_B_SIZE
:
692 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapItoBsize
);
694 case GL_PIXEL_MAP_I_TO_G_SIZE
:
695 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapItoGsize
);
697 case GL_PIXEL_MAP_I_TO_I_SIZE
:
698 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapItoIsize
);
700 case GL_PIXEL_MAP_I_TO_R_SIZE
:
701 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapItoRsize
);
703 case GL_PIXEL_MAP_R_TO_R_SIZE
:
704 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapRtoRsize
);
706 case GL_PIXEL_MAP_S_TO_S_SIZE
:
707 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.MapStoSsize
);
710 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Size
);
712 case GL_POINT_SIZE_GRANULARITY
:
713 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.PointSizeGranularity
);
715 case GL_POINT_SIZE_RANGE
:
716 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinPointSizeAA
);
717 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxPointSizeAA
);
719 case GL_ALIASED_POINT_SIZE_RANGE
:
720 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinPointSize
);
721 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxPointSize
);
723 case GL_POINT_SMOOTH
:
724 params
[0] = ctx
->Point
.SmoothFlag
;
726 case GL_POINT_SMOOTH_HINT
:
727 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PointSmooth
);
729 case GL_POINT_SIZE_MIN_EXT
:
730 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.MinSize
);
732 case GL_POINT_SIZE_MAX_EXT
:
733 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.MaxSize
);
735 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
736 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Threshold
);
738 case GL_DISTANCE_ATTENUATION_EXT
:
739 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[0]);
740 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[1]);
741 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[2]);
743 case GL_POLYGON_MODE
:
744 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.FrontMode
);
745 params
[1] = ENUM_TO_BOOLEAN(ctx
->Polygon
.BackMode
);
747 case GL_POLYGON_OFFSET_BIAS_EXT
:
748 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetUnits
);
750 case GL_POLYGON_OFFSET_FACTOR
:
751 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetFactor
);
753 case GL_POLYGON_OFFSET_UNITS
:
754 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetUnits
);
756 case GL_POLYGON_SMOOTH
:
757 params
[0] = ctx
->Polygon
.SmoothFlag
;
759 case GL_POLYGON_SMOOTH_HINT
:
760 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PolygonSmooth
);
762 case GL_POLYGON_STIPPLE
:
763 params
[0] = ctx
->Polygon
.StippleFlag
;
765 case GL_PROJECTION_MATRIX
:
767 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
768 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
769 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
770 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
771 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
772 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
773 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
774 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
775 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
776 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
777 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
778 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
779 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
780 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
781 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
782 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
783 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
786 case GL_PROJECTION_STACK_DEPTH
:
787 params
[0] = INT_TO_BOOLEAN(ctx
->ProjectionMatrixStack
.Depth
+ 1);
790 params
[0] = ENUM_TO_BOOLEAN(ctx
->ReadBuffer
->ColorReadBuffer
);
793 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.RedBias
);
796 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.redBits
);
799 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.RedScale
);
802 params
[0] = ENUM_TO_BOOLEAN(ctx
->RenderMode
);
804 case GL_RESCALE_NORMAL
:
805 params
[0] = ctx
->Transform
.RescaleNormals
;
808 params
[0] = ctx
->DrawBuffer
->Visual
.rgbMode
;
811 params
[0] = INT_TO_BOOLEAN(ctx
->Scissor
.X
);
812 params
[1] = INT_TO_BOOLEAN(ctx
->Scissor
.Y
);
813 params
[2] = INT_TO_BOOLEAN(ctx
->Scissor
.Width
);
814 params
[3] = INT_TO_BOOLEAN(ctx
->Scissor
.Height
);
816 case GL_SCISSOR_TEST
:
817 params
[0] = ctx
->Scissor
.Enabled
;
819 case GL_SELECTION_BUFFER_SIZE
:
820 params
[0] = INT_TO_BOOLEAN(ctx
->Select
.BufferSize
);
823 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ShadeModel
);
825 case GL_SHARED_TEXTURE_PALETTE_EXT
:
826 params
[0] = ctx
->Texture
.SharedPalette
;
828 case GL_STENCIL_BITS
:
829 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.stencilBits
);
831 case GL_STENCIL_CLEAR_VALUE
:
832 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Clear
);
834 case GL_STENCIL_FAIL
:
835 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
837 case GL_STENCIL_FUNC
:
838 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
840 case GL_STENCIL_PASS_DEPTH_FAIL
:
841 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
843 case GL_STENCIL_PASS_DEPTH_PASS
:
844 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
847 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
849 case GL_STENCIL_TEST
:
850 params
[0] = ctx
->Stencil
.Enabled
;
852 case GL_STENCIL_VALUE_MASK
:
853 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
855 case GL_STENCIL_WRITEMASK
:
856 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
859 params
[0] = ctx
->DrawBuffer
->Visual
.stereoMode
;
861 case GL_SUBPIXEL_BITS
:
862 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.SubPixelBits
);
865 params
[0] = _mesa_IsEnabled(GL_TEXTURE_1D
);
868 params
[0] = _mesa_IsEnabled(GL_TEXTURE_2D
);
871 params
[0] = _mesa_IsEnabled(GL_TEXTURE_3D
);
873 case GL_TEXTURE_BINDING_1D
:
874 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
);
876 case GL_TEXTURE_BINDING_2D
:
877 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
);
879 case GL_TEXTURE_BINDING_3D
:
880 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
);
882 case GL_TEXTURE_ENV_COLOR
:
884 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
885 params
[0] = FLOAT_TO_BOOLEAN(color
[0]);
886 params
[1] = FLOAT_TO_BOOLEAN(color
[1]);
887 params
[2] = FLOAT_TO_BOOLEAN(color
[2]);
888 params
[3] = FLOAT_TO_BOOLEAN(color
[3]);
891 case GL_TEXTURE_ENV_MODE
:
892 params
[0] = ENUM_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
894 case GL_TEXTURE_GEN_S
:
895 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0);
897 case GL_TEXTURE_GEN_T
:
898 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0);
900 case GL_TEXTURE_GEN_R
:
901 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0);
903 case GL_TEXTURE_GEN_Q
:
904 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0);
906 case GL_TEXTURE_MATRIX
:
908 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
909 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
910 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
911 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
912 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
913 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
914 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
915 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
916 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
917 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
918 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
919 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
920 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
921 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
922 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
923 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
924 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
927 case GL_TEXTURE_STACK_DEPTH
:
928 params
[0] = INT_TO_BOOLEAN(ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1);
930 case GL_UNPACK_ALIGNMENT
:
931 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.Alignment
);
933 case GL_UNPACK_LSB_FIRST
:
934 params
[0] = ctx
->Unpack
.LsbFirst
;
936 case GL_UNPACK_ROW_LENGTH
:
937 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.RowLength
);
939 case GL_UNPACK_SKIP_PIXELS
:
940 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipPixels
);
942 case GL_UNPACK_SKIP_ROWS
:
943 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipRows
);
945 case GL_UNPACK_SWAP_BYTES
:
946 params
[0] = ctx
->Unpack
.SwapBytes
;
948 case GL_UNPACK_SKIP_IMAGES_EXT
:
949 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipImages
);
951 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
952 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.ImageHeight
);
954 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
955 params
[0] = ctx
->Unpack
.ClientStorage
;
958 params
[0] = INT_TO_BOOLEAN(ctx
->Viewport
.X
);
959 params
[1] = INT_TO_BOOLEAN(ctx
->Viewport
.Y
);
960 params
[2] = INT_TO_BOOLEAN(ctx
->Viewport
.Width
);
961 params
[3] = INT_TO_BOOLEAN(ctx
->Viewport
.Height
);
964 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomX
);
967 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomY
);
969 case GL_VERTEX_ARRAY
:
970 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Enabled
;
972 case GL_VERTEX_ARRAY_SIZE
:
973 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Size
);
975 case GL_VERTEX_ARRAY_TYPE
:
976 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Type
);
978 case GL_VERTEX_ARRAY_STRIDE
:
979 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
981 case GL_VERTEX_ARRAY_COUNT_EXT
:
982 params
[0] = INT_TO_BOOLEAN(0);
984 case GL_NORMAL_ARRAY
:
985 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
987 case GL_NORMAL_ARRAY_TYPE
:
988 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Type
);
990 case GL_NORMAL_ARRAY_STRIDE
:
991 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Stride
);
993 case GL_NORMAL_ARRAY_COUNT_EXT
:
994 params
[0] = INT_TO_BOOLEAN(0);
997 params
[0] = ctx
->Array
.ArrayObj
->Color
.Enabled
;
999 case GL_COLOR_ARRAY_SIZE
:
1000 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Size
);
1002 case GL_COLOR_ARRAY_TYPE
:
1003 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Type
);
1005 case GL_COLOR_ARRAY_STRIDE
:
1006 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Stride
);
1008 case GL_COLOR_ARRAY_COUNT_EXT
:
1009 params
[0] = INT_TO_BOOLEAN(0);
1011 case GL_INDEX_ARRAY
:
1012 params
[0] = ctx
->Array
.ArrayObj
->Index
.Enabled
;
1014 case GL_INDEX_ARRAY_TYPE
:
1015 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Type
);
1017 case GL_INDEX_ARRAY_STRIDE
:
1018 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Stride
);
1020 case GL_INDEX_ARRAY_COUNT_EXT
:
1021 params
[0] = INT_TO_BOOLEAN(0);
1023 case GL_TEXTURE_COORD_ARRAY
:
1024 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
;
1026 case GL_TEXTURE_COORD_ARRAY_SIZE
:
1027 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
1029 case GL_TEXTURE_COORD_ARRAY_TYPE
:
1030 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
1032 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
1033 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
1035 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
1036 params
[0] = INT_TO_BOOLEAN(0);
1038 case GL_EDGE_FLAG_ARRAY
:
1039 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
;
1041 case GL_EDGE_FLAG_ARRAY_STRIDE
:
1042 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
1044 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
1045 params
[0] = INT_TO_BOOLEAN(0);
1047 case GL_MAX_TEXTURE_UNITS_ARB
:
1048 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1049 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureUnits
);
1051 case GL_ACTIVE_TEXTURE_ARB
:
1052 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1053 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
1055 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
1056 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1057 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
1059 case GL_TEXTURE_CUBE_MAP_ARB
:
1060 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1061 params
[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
1063 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
1064 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1065 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
);
1067 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
1068 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1069 params
[0] = INT_TO_BOOLEAN((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
1071 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
1072 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1073 params
[0] = INT_TO_BOOLEAN(ctx
->Hint
.TextureCompression
);
1075 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
1076 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1077 params
[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
1079 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1080 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1083 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
1085 for (i
= 0; i
< n
; i
++)
1086 params
[i
] = ENUM_TO_INT(formats
[i
]);
1089 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1090 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1091 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockFirst
);
1093 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1094 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1095 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockCount
);
1097 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1099 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1100 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1101 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1102 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1103 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1104 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1105 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1106 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1107 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1108 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1109 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1110 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1111 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1112 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1113 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1114 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1115 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1118 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1120 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
1121 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1122 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1123 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1124 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1125 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1126 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1127 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1128 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1129 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1130 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1131 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1132 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1133 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1134 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1135 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1136 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1139 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1141 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
1142 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1143 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1144 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1145 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1146 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1147 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1148 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1149 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1150 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1151 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1152 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1153 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1154 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1155 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1156 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1157 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1160 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1162 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
1163 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1164 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1165 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1166 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1167 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1168 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1169 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1170 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1171 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1172 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1173 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1174 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1175 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1176 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1177 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1178 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1181 case GL_COLOR_MATRIX_SGI
:
1183 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1184 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1185 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1186 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1187 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1188 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1189 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1190 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1191 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1192 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1193 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1194 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1195 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1196 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1197 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1198 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1199 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1202 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1203 params
[0] = INT_TO_BOOLEAN(ctx
->ColorMatrixStack
.Depth
+ 1);
1205 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1206 params
[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH
);
1208 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1209 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[0]);
1211 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1212 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[1]);
1214 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1215 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[2]);
1217 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1218 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[3]);
1220 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1221 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[0]);
1223 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1224 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[1]);
1226 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1227 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[2]);
1229 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1230 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[3]);
1232 case GL_CONVOLUTION_1D_EXT
:
1233 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1234 params
[0] = ctx
->Pixel
.Convolution1DEnabled
;
1236 case GL_CONVOLUTION_2D_EXT
:
1237 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1238 params
[0] = ctx
->Pixel
.Convolution2DEnabled
;
1240 case GL_SEPARABLE_2D_EXT
:
1241 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1242 params
[0] = ctx
->Pixel
.Separable2DEnabled
;
1244 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1245 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1246 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[0]);
1248 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1249 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1250 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[1]);
1252 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1253 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1254 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[2]);
1256 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1257 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1258 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[3]);
1260 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1261 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1262 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[0]);
1264 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1265 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1266 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[1]);
1268 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1269 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1270 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[2]);
1272 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1273 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1274 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[3]);
1277 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1278 params
[0] = ctx
->Pixel
.HistogramEnabled
;
1281 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1282 params
[0] = ctx
->Pixel
.MinMaxEnabled
;
1284 case GL_COLOR_TABLE_SGI
:
1285 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1286 params
[0] = ctx
->Pixel
.ColorTableEnabled
;
1288 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1289 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1290 params
[0] = ctx
->Pixel
.PostConvolutionColorTableEnabled
;
1292 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1293 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1294 params
[0] = ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
1296 case GL_TEXTURE_COLOR_TABLE_SGI
:
1297 CHECK_EXT1(SGI_texture_color_table
, "GetBooleanv");
1298 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
;
1300 case GL_COLOR_SUM_EXT
:
1301 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetBooleanv");
1302 params
[0] = ctx
->Fog
.ColorSumEnabled
;
1304 case GL_CURRENT_SECONDARY_COLOR_EXT
:
1305 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1307 FLUSH_CURRENT(ctx
, 0);
1308 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
1309 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
1310 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
1311 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
1314 case GL_SECONDARY_COLOR_ARRAY_EXT
:
1315 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1316 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
;
1318 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
1319 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1320 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
1322 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
1323 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1324 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
1326 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
1327 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1328 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
1330 case GL_CURRENT_FOG_COORDINATE_EXT
:
1331 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1333 FLUSH_CURRENT(ctx
, 0);
1334 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
1337 case GL_FOG_COORDINATE_ARRAY_EXT
:
1338 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1339 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Enabled
;
1341 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
1342 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1343 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
1345 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
1346 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1347 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
1349 case GL_FOG_COORDINATE_SOURCE_EXT
:
1350 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1351 params
[0] = ENUM_TO_BOOLEAN(ctx
->Fog
.FogCoordinateSource
);
1353 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
1354 CHECK_EXT1(EXT_texture_lod_bias
, "GetBooleanv");
1355 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureLodBias
);
1357 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
1358 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetBooleanv");
1359 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureMaxAnisotropy
);
1361 case GL_MULTISAMPLE_ARB
:
1362 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1363 params
[0] = ctx
->Multisample
.Enabled
;
1365 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
1366 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1367 params
[0] = ctx
->Multisample
.SampleAlphaToCoverage
;
1369 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
1370 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1371 params
[0] = ctx
->Multisample
.SampleAlphaToOne
;
1373 case GL_SAMPLE_COVERAGE_ARB
:
1374 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1375 params
[0] = ctx
->Multisample
.SampleCoverage
;
1377 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
1378 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1379 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Multisample
.SampleCoverageValue
);
1381 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
1382 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1383 params
[0] = ctx
->Multisample
.SampleCoverageInvert
;
1385 case GL_SAMPLE_BUFFERS_ARB
:
1386 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1387 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
1389 case GL_SAMPLES_ARB
:
1390 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1391 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.samples
);
1393 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
1394 CHECK_EXT1(IBM_rasterpos_clip
, "GetBooleanv");
1395 params
[0] = ctx
->Transform
.RasterPositionUnclipped
;
1397 case GL_POINT_SPRITE_NV
:
1398 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1399 params
[0] = ctx
->Point
.PointSprite
;
1401 case GL_POINT_SPRITE_R_MODE_NV
:
1402 CHECK_EXT1(NV_point_sprite
, "GetBooleanv");
1403 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteRMode
);
1405 case GL_POINT_SPRITE_COORD_ORIGIN
:
1406 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1407 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteOrigin
);
1409 case GL_GENERATE_MIPMAP_HINT_SGIS
:
1410 CHECK_EXT1(SGIS_generate_mipmap
, "GetBooleanv");
1411 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.GenerateMipmap
);
1413 case GL_VERTEX_PROGRAM_BINDING_NV
:
1414 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1415 params
[0] = INT_TO_BOOLEAN((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
1417 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
1418 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1419 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
;
1421 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
1422 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1423 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
;
1425 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
1426 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1427 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
;
1429 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
1430 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1431 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
;
1433 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
1434 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1435 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
;
1437 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
1438 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1439 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
;
1441 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
1442 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1443 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
;
1445 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
1446 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1447 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
;
1449 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
1450 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1451 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
;
1453 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
1454 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1455 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
;
1457 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
1458 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1459 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
;
1461 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
1462 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1463 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
;
1465 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
1466 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1467 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
;
1469 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
1470 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1471 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
;
1473 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
1474 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1475 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
;
1477 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
1478 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1479 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
;
1481 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
1482 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1483 params
[0] = ctx
->Eval
.Map1Attrib
[0];
1485 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
1486 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1487 params
[0] = ctx
->Eval
.Map1Attrib
[1];
1489 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
1490 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1491 params
[0] = ctx
->Eval
.Map1Attrib
[2];
1493 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
1494 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1495 params
[0] = ctx
->Eval
.Map1Attrib
[3];
1497 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
1498 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1499 params
[0] = ctx
->Eval
.Map1Attrib
[4];
1501 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
1502 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1503 params
[0] = ctx
->Eval
.Map1Attrib
[5];
1505 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
1506 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1507 params
[0] = ctx
->Eval
.Map1Attrib
[6];
1509 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
1510 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1511 params
[0] = ctx
->Eval
.Map1Attrib
[7];
1513 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
1514 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1515 params
[0] = ctx
->Eval
.Map1Attrib
[8];
1517 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
1518 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1519 params
[0] = ctx
->Eval
.Map1Attrib
[9];
1521 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
1522 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1523 params
[0] = ctx
->Eval
.Map1Attrib
[10];
1525 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
1526 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1527 params
[0] = ctx
->Eval
.Map1Attrib
[11];
1529 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
1530 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1531 params
[0] = ctx
->Eval
.Map1Attrib
[12];
1533 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
1534 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1535 params
[0] = ctx
->Eval
.Map1Attrib
[13];
1537 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
1538 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1539 params
[0] = ctx
->Eval
.Map1Attrib
[14];
1541 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
1542 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1543 params
[0] = ctx
->Eval
.Map1Attrib
[15];
1545 case GL_FRAGMENT_PROGRAM_NV
:
1546 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1547 params
[0] = ctx
->FragmentProgram
.Enabled
;
1549 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
1550 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1551 params
[0] = INT_TO_BOOLEAN(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
1553 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
1554 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1555 params
[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
1557 case GL_TEXTURE_RECTANGLE_NV
:
1558 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1559 params
[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
1561 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
1562 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1563 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
);
1565 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
1566 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1567 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureRectSize
);
1569 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
1570 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1571 params
[0] = ctx
->Stencil
.TestTwoSide
;
1573 case GL_ACTIVE_STENCIL_FACE_EXT
:
1574 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1575 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
1577 case GL_MAX_SHININESS_NV
:
1578 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1579 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxShininess
);
1581 case GL_MAX_SPOT_EXPONENT_NV
:
1582 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1583 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxSpotExponent
);
1585 case GL_ARRAY_BUFFER_BINDING_ARB
:
1586 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1587 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayBufferObj
->Name
);
1589 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
1590 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1591 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
1593 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
1594 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1595 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
1597 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1598 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1599 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
1601 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
1602 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1603 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
1605 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
1606 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1607 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
1609 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
1610 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1611 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
1613 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1614 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1615 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
1617 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
1618 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1619 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
1621 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
1622 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1623 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ElementArrayBufferObj
->Name
);
1625 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
1626 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1627 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.BufferObj
->Name
);
1629 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
1630 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1631 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.BufferObj
->Name
);
1633 case GL_VERTEX_PROGRAM_ARB
:
1634 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1635 params
[0] = ctx
->VertexProgram
.Enabled
;
1637 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
1638 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1639 params
[0] = ctx
->VertexProgram
.PointSizeEnabled
;
1641 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
1642 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1643 params
[0] = ctx
->VertexProgram
.TwoSideEnabled
;
1645 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
1646 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1647 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrixStackDepth
);
1649 case GL_MAX_PROGRAM_MATRICES_ARB
:
1650 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1651 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrices
);
1653 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
1654 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1655 params
[0] = ctx
->CurrentStack
->Depth
+ 1;
1657 case GL_CURRENT_MATRIX_ARB
:
1658 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1660 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1661 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1662 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1663 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1664 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1665 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1666 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1667 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1668 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1669 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1670 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1671 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1672 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1673 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1674 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1675 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1676 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1679 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
1680 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetBooleanv");
1682 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1683 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1684 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1685 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1686 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1687 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1688 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1689 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1690 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1691 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1692 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1693 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1694 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1695 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1696 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1697 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1698 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1701 case GL_MAX_VERTEX_ATTRIBS_ARB
:
1702 CHECK_EXT1(ARB_vertex_program
, "GetBooleanv");
1703 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxAttribs
);
1705 case GL_PROGRAM_ERROR_POSITION_ARB
:
1706 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetBooleanv");
1707 params
[0] = INT_TO_BOOLEAN(ctx
->Program
.ErrorPos
);
1709 case GL_FRAGMENT_PROGRAM_ARB
:
1710 CHECK_EXT1(ARB_fragment_program
, "GetBooleanv");
1711 params
[0] = ctx
->FragmentProgram
.Enabled
;
1713 case GL_MAX_TEXTURE_COORDS_ARB
:
1714 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1715 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureCoordUnits
);
1717 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
1718 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1719 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureImageUnits
);
1721 case GL_DEPTH_BOUNDS_TEST_EXT
:
1722 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1723 params
[0] = ctx
->Depth
.BoundsTest
;
1725 case GL_DEPTH_BOUNDS_EXT
:
1726 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1727 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMin
);
1728 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMax
);
1730 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
1731 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1732 params
[0] = ctx
->FragmentProgram
.CallbackEnabled
;
1734 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
1735 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1736 params
[0] = ctx
->VertexProgram
.CallbackEnabled
;
1738 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
1739 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1740 params
[0] = INT_TO_BOOLEAN(ctx
->FragmentProgram
.CurrentPosition
);
1742 case GL_VERTEX_PROGRAM_POSITION_MESA
:
1743 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1744 params
[0] = INT_TO_BOOLEAN(ctx
->VertexProgram
.CurrentPosition
);
1746 case GL_MAX_DRAW_BUFFERS_ARB
:
1747 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1748 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxDrawBuffers
);
1750 case GL_DRAW_BUFFER0_ARB
:
1751 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1752 params
[0] = ENUM_TO_BOOLEAN(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
1754 case GL_DRAW_BUFFER1_ARB
:
1755 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1758 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1759 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1762 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
1763 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1766 case GL_DRAW_BUFFER2_ARB
:
1767 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1770 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1771 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1774 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
1775 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1778 case GL_DRAW_BUFFER3_ARB
:
1779 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1782 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1783 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1786 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
1787 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1790 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
1791 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1792 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.ColorReadType
);
1794 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
1795 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1796 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.ColorReadFormat
);
1798 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
1799 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1800 params
[0] = INT_TO_BOOLEAN(6);
1802 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
1803 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1804 params
[0] = INT_TO_BOOLEAN(8);
1806 case GL_NUM_PASSES_ATI
:
1807 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1808 params
[0] = INT_TO_BOOLEAN(2);
1810 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
1811 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1812 params
[0] = INT_TO_BOOLEAN(8);
1814 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
1815 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1816 params
[0] = INT_TO_BOOLEAN(16);
1818 case GL_COLOR_ALPHA_PAIRING_ATI
:
1819 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1820 params
[0] = GL_TRUE
;
1822 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
1823 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1824 params
[0] = INT_TO_BOOLEAN(3);
1826 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
1827 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1828 params
[0] = INT_TO_BOOLEAN(3);
1830 case GL_STENCIL_BACK_FUNC
:
1831 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.Function
[1]);
1833 case GL_STENCIL_BACK_VALUE_MASK
:
1834 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.ValueMask
[1]);
1836 case GL_STENCIL_BACK_WRITEMASK
:
1837 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.WriteMask
[1]);
1839 case GL_STENCIL_BACK_REF
:
1840 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Ref
[1]);
1842 case GL_STENCIL_BACK_FAIL
:
1843 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.FailFunc
[1]);
1845 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
1846 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZFailFunc
[1]);
1848 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
1849 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZPassFunc
[1]);
1851 case GL_FRAMEBUFFER_BINDING_EXT
:
1852 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1853 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Name
);
1855 case GL_RENDERBUFFER_BINDING_EXT
:
1856 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1857 params
[0] = INT_TO_BOOLEAN(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
1859 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
1860 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1861 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxColorAttachments
);
1863 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
1864 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1865 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxRenderbufferSize
);
1867 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
1868 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1869 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
1871 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
1872 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1873 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.FragmentShaderDerivative
);
1875 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
1876 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1877 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
1879 case GL_MAX_VARYING_FLOATS_ARB
:
1880 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1881 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVaryingFloats
);
1883 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
1884 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1885 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVertexTextureImageUnits
);
1887 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
1888 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1889 params
[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS
);
1892 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv(pname=0x%x)", pname
);
1897 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
1899 GET_CURRENT_CONTEXT(ctx
);
1900 ASSERT_OUTSIDE_BEGIN_END(ctx
);
1906 _mesa_update_state(ctx
);
1908 if (ctx
->Driver
.GetFloatv
&&
1909 ctx
->Driver
.GetFloatv(ctx
, pname
, params
))
1913 case GL_ACCUM_RED_BITS
:
1914 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumRedBits
);
1916 case GL_ACCUM_GREEN_BITS
:
1917 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
1919 case GL_ACCUM_BLUE_BITS
:
1920 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
1922 case GL_ACCUM_ALPHA_BITS
:
1923 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
1925 case GL_ACCUM_CLEAR_VALUE
:
1926 params
[0] = ctx
->Accum
.ClearColor
[0];
1927 params
[1] = ctx
->Accum
.ClearColor
[1];
1928 params
[2] = ctx
->Accum
.ClearColor
[2];
1929 params
[3] = ctx
->Accum
.ClearColor
[3];
1932 params
[0] = ctx
->Pixel
.AlphaBias
;
1935 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.alphaBits
);
1937 case GL_ALPHA_SCALE
:
1938 params
[0] = ctx
->Pixel
.AlphaScale
;
1941 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.AlphaEnabled
);
1943 case GL_ALPHA_TEST_FUNC
:
1944 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
1946 case GL_ALPHA_TEST_REF
:
1947 params
[0] = ctx
->Color
.AlphaRef
;
1949 case GL_ATTRIB_STACK_DEPTH
:
1950 params
[0] = (GLfloat
)(ctx
->AttribStackDepth
);
1952 case GL_AUTO_NORMAL
:
1953 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.AutoNormal
);
1955 case GL_AUX_BUFFERS
:
1956 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
1959 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.BlendEnabled
);
1962 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
1965 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
1967 case GL_BLEND_SRC_RGB_EXT
:
1968 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
1970 case GL_BLEND_DST_RGB_EXT
:
1971 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
1973 case GL_BLEND_SRC_ALPHA_EXT
:
1974 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
1976 case GL_BLEND_DST_ALPHA_EXT
:
1977 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
1979 case GL_BLEND_EQUATION
:
1980 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationRGB
);
1982 case GL_BLEND_EQUATION_ALPHA_EXT
:
1983 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationA
);
1985 case GL_BLEND_COLOR_EXT
:
1986 params
[0] = ctx
->Color
.BlendColor
[0];
1987 params
[1] = ctx
->Color
.BlendColor
[1];
1988 params
[2] = ctx
->Color
.BlendColor
[2];
1989 params
[3] = ctx
->Color
.BlendColor
[3];
1992 params
[0] = ctx
->Pixel
.BlueBias
;
1995 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.blueBits
);
1998 params
[0] = ctx
->Pixel
.BlueScale
;
2000 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2001 params
[0] = (GLfloat
)(ctx
->ClientAttribStackDepth
);
2003 case GL_CLIP_PLANE0
:
2004 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
2006 case GL_CLIP_PLANE1
:
2007 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
2009 case GL_CLIP_PLANE2
:
2010 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
2012 case GL_CLIP_PLANE3
:
2013 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
2015 case GL_CLIP_PLANE4
:
2016 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
2018 case GL_CLIP_PLANE5
:
2019 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
2021 case GL_COLOR_CLEAR_VALUE
:
2022 params
[0] = ctx
->Color
.ClearColor
[0];
2023 params
[1] = ctx
->Color
.ClearColor
[1];
2024 params
[2] = ctx
->Color
.ClearColor
[2];
2025 params
[3] = ctx
->Color
.ClearColor
[3];
2027 case GL_COLOR_MATERIAL
:
2028 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.ColorMaterialEnabled
);
2030 case GL_COLOR_MATERIAL_FACE
:
2031 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2033 case GL_COLOR_MATERIAL_PARAMETER
:
2034 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2036 case GL_COLOR_WRITEMASK
:
2037 params
[0] = (GLfloat
)(ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0);
2038 params
[1] = (GLfloat
)(ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0);
2039 params
[2] = (GLfloat
)(ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0);
2040 params
[3] = (GLfloat
)(ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0);
2043 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.CullFlag
);
2045 case GL_CULL_FACE_MODE
:
2046 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2048 case GL_CURRENT_COLOR
:
2050 FLUSH_CURRENT(ctx
, 0);
2051 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0];
2052 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1];
2053 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2];
2054 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3];
2057 case GL_CURRENT_INDEX
:
2059 FLUSH_CURRENT(ctx
, 0);
2060 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0];
2063 case GL_CURRENT_NORMAL
:
2065 FLUSH_CURRENT(ctx
, 0);
2066 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0];
2067 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1];
2068 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2];
2071 case GL_CURRENT_RASTER_COLOR
:
2072 params
[0] = ctx
->Current
.RasterColor
[0];
2073 params
[1] = ctx
->Current
.RasterColor
[1];
2074 params
[2] = ctx
->Current
.RasterColor
[2];
2075 params
[3] = ctx
->Current
.RasterColor
[3];
2077 case GL_CURRENT_RASTER_DISTANCE
:
2078 params
[0] = ctx
->Current
.RasterDistance
;
2080 case GL_CURRENT_RASTER_INDEX
:
2081 params
[0] = ctx
->Current
.RasterIndex
;
2083 case GL_CURRENT_RASTER_POSITION
:
2084 params
[0] = ctx
->Current
.RasterPos
[0];
2085 params
[1] = ctx
->Current
.RasterPos
[1];
2086 params
[2] = ctx
->Current
.RasterPos
[2];
2087 params
[3] = ctx
->Current
.RasterPos
[3];
2089 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
2090 params
[0] = ctx
->Current
.RasterSecondaryColor
[0];
2091 params
[1] = ctx
->Current
.RasterSecondaryColor
[1];
2092 params
[2] = ctx
->Current
.RasterSecondaryColor
[2];
2093 params
[3] = ctx
->Current
.RasterSecondaryColor
[3];
2095 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2097 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2098 params
[0] = ctx
->Current
.RasterTexCoords
[texUnit
][0];
2099 params
[1] = ctx
->Current
.RasterTexCoords
[texUnit
][1];
2100 params
[2] = ctx
->Current
.RasterTexCoords
[texUnit
][2];
2101 params
[3] = ctx
->Current
.RasterTexCoords
[texUnit
][3];
2104 case GL_CURRENT_RASTER_POSITION_VALID
:
2105 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Current
.RasterPosValid
);
2107 case GL_CURRENT_TEXTURE_COORDS
:
2109 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2110 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0];
2111 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1];
2112 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2];
2113 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3];
2117 params
[0] = ctx
->Pixel
.DepthBias
;
2120 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.depthBits
);
2122 case GL_DEPTH_CLEAR_VALUE
:
2123 params
[0] = ctx
->Depth
.Clear
;
2126 params
[0] = ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2128 case GL_DEPTH_RANGE
:
2129 params
[0] = ctx
->Viewport
.Near
;
2130 params
[1] = ctx
->Viewport
.Far
;
2132 case GL_DEPTH_SCALE
:
2133 params
[0] = ctx
->Pixel
.DepthScale
;
2136 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Test
);
2138 case GL_DEPTH_WRITEMASK
:
2139 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Mask
);
2142 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.DitherFlag
);
2144 case GL_DOUBLEBUFFER
:
2145 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
2147 case GL_DRAW_BUFFER
:
2148 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
2152 FLUSH_CURRENT(ctx
, 0);
2153 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Current
.EdgeFlag
);
2156 case GL_FEEDBACK_BUFFER_SIZE
:
2157 params
[0] = (GLfloat
)(ctx
->Feedback
.BufferSize
);
2159 case GL_FEEDBACK_BUFFER_TYPE
:
2160 params
[0] = ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2163 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.Enabled
);
2166 params
[0] = ctx
->Fog
.Color
[0];
2167 params
[1] = ctx
->Fog
.Color
[1];
2168 params
[2] = ctx
->Fog
.Color
[2];
2169 params
[3] = ctx
->Fog
.Color
[3];
2171 case GL_FOG_DENSITY
:
2172 params
[0] = ctx
->Fog
.Density
;
2175 params
[0] = ctx
->Fog
.End
;
2178 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2181 params
[0] = ctx
->Fog
.Index
;
2184 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2187 params
[0] = ctx
->Fog
.Start
;
2190 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2193 params
[0] = ctx
->Pixel
.GreenBias
;
2196 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.greenBits
);
2198 case GL_GREEN_SCALE
:
2199 params
[0] = ctx
->Pixel
.GreenScale
;
2202 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.indexBits
);
2204 case GL_INDEX_CLEAR_VALUE
:
2205 params
[0] = (GLfloat
)(ctx
->Color
.ClearIndex
);
2208 params
[0] = BOOLEAN_TO_FLOAT(!ctx
->DrawBuffer
->Visual
.rgbMode
);
2210 case GL_INDEX_OFFSET
:
2211 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexOffset
);
2213 case GL_INDEX_SHIFT
:
2214 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexShift
);
2216 case GL_INDEX_WRITEMASK
:
2217 params
[0] = (GLfloat
)(ctx
->Color
.IndexMask
);
2220 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[0].Enabled
);
2223 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[1].Enabled
);
2226 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[2].Enabled
);
2229 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[3].Enabled
);
2232 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[4].Enabled
);
2235 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[5].Enabled
);
2238 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[6].Enabled
);
2241 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[7].Enabled
);
2244 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Enabled
);
2246 case GL_LIGHT_MODEL_AMBIENT
:
2247 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2248 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2249 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2250 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2252 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2253 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2255 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2256 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.LocalViewer
);
2258 case GL_LIGHT_MODEL_TWO_SIDE
:
2259 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.TwoSide
);
2261 case GL_LINE_SMOOTH
:
2262 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.SmoothFlag
);
2264 case GL_LINE_SMOOTH_HINT
:
2265 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2267 case GL_LINE_STIPPLE
:
2268 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.StippleFlag
);
2270 case GL_LINE_STIPPLE_PATTERN
:
2271 params
[0] = (GLfloat
)(ctx
->Line
.StipplePattern
);
2273 case GL_LINE_STIPPLE_REPEAT
:
2274 params
[0] = (GLfloat
)(ctx
->Line
.StippleFactor
);
2277 params
[0] = ctx
->Line
.Width
;
2279 case GL_LINE_WIDTH_GRANULARITY
:
2280 params
[0] = ctx
->Const
.LineWidthGranularity
;
2282 case GL_LINE_WIDTH_RANGE
:
2283 params
[0] = ctx
->Const
.MinLineWidthAA
;
2284 params
[1] = ctx
->Const
.MaxLineWidthAA
;
2286 case GL_ALIASED_LINE_WIDTH_RANGE
:
2287 params
[0] = ctx
->Const
.MinLineWidth
;
2288 params
[1] = ctx
->Const
.MaxLineWidth
;
2291 params
[0] = (GLfloat
)(ctx
->List
.ListBase
);
2294 params
[0] = (GLfloat
)(ctx
->ListState
.CurrentListNum
);
2299 if (!ctx
->CompileFlag
)
2301 else if (ctx
->ExecuteFlag
)
2302 mode
= GL_COMPILE_AND_EXECUTE
;
2305 params
[0] = ENUM_TO_FLOAT(mode
);
2308 case GL_INDEX_LOGIC_OP
:
2309 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.IndexLogicOpEnabled
);
2311 case GL_COLOR_LOGIC_OP
:
2312 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.ColorLogicOpEnabled
);
2314 case GL_LOGIC_OP_MODE
:
2315 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
2317 case GL_MAP1_COLOR_4
:
2318 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Color4
);
2320 case GL_MAP1_GRID_DOMAIN
:
2321 params
[0] = ctx
->Eval
.MapGrid1u1
;
2322 params
[1] = ctx
->Eval
.MapGrid1u2
;
2324 case GL_MAP1_GRID_SEGMENTS
:
2325 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid1un
);
2328 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Index
);
2330 case GL_MAP1_NORMAL
:
2331 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Normal
);
2333 case GL_MAP1_TEXTURE_COORD_1
:
2334 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord1
);
2336 case GL_MAP1_TEXTURE_COORD_2
:
2337 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord2
);
2339 case GL_MAP1_TEXTURE_COORD_3
:
2340 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord3
);
2342 case GL_MAP1_TEXTURE_COORD_4
:
2343 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord4
);
2345 case GL_MAP1_VERTEX_3
:
2346 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex3
);
2348 case GL_MAP1_VERTEX_4
:
2349 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex4
);
2351 case GL_MAP2_COLOR_4
:
2352 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Color4
);
2354 case GL_MAP2_GRID_DOMAIN
:
2355 params
[0] = ctx
->Eval
.MapGrid2u1
;
2356 params
[1] = ctx
->Eval
.MapGrid2u2
;
2357 params
[2] = ctx
->Eval
.MapGrid2v1
;
2358 params
[3] = ctx
->Eval
.MapGrid2v2
;
2360 case GL_MAP2_GRID_SEGMENTS
:
2361 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid2un
);
2362 params
[1] = (GLfloat
)(ctx
->Eval
.MapGrid2vn
);
2365 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Index
);
2367 case GL_MAP2_NORMAL
:
2368 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Normal
);
2370 case GL_MAP2_TEXTURE_COORD_1
:
2371 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord1
);
2373 case GL_MAP2_TEXTURE_COORD_2
:
2374 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord2
);
2376 case GL_MAP2_TEXTURE_COORD_3
:
2377 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord3
);
2379 case GL_MAP2_TEXTURE_COORD_4
:
2380 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord4
);
2382 case GL_MAP2_VERTEX_3
:
2383 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex3
);
2385 case GL_MAP2_VERTEX_4
:
2386 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex4
);
2389 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapColorFlag
);
2391 case GL_MAP_STENCIL
:
2392 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapStencilFlag
);
2394 case GL_MATRIX_MODE
:
2395 params
[0] = ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
2397 case GL_MAX_ATTRIB_STACK_DEPTH
:
2398 params
[0] = (GLfloat
)(MAX_ATTRIB_STACK_DEPTH
);
2400 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2401 params
[0] = (GLfloat
)(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
2403 case GL_MAX_CLIP_PLANES
:
2404 params
[0] = (GLfloat
)(ctx
->Const
.MaxClipPlanes
);
2406 case GL_MAX_ELEMENTS_VERTICES
:
2407 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2409 case GL_MAX_ELEMENTS_INDICES
:
2410 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2412 case GL_MAX_EVAL_ORDER
:
2413 params
[0] = (GLfloat
)(MAX_EVAL_ORDER
);
2416 params
[0] = (GLfloat
)(ctx
->Const
.MaxLights
);
2418 case GL_MAX_LIST_NESTING
:
2419 params
[0] = (GLfloat
)(MAX_LIST_NESTING
);
2421 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2422 params
[0] = (GLfloat
)(MAX_MODELVIEW_STACK_DEPTH
);
2424 case GL_MAX_NAME_STACK_DEPTH
:
2425 params
[0] = (GLfloat
)(MAX_NAME_STACK_DEPTH
);
2427 case GL_MAX_PIXEL_MAP_TABLE
:
2428 params
[0] = (GLfloat
)(MAX_PIXEL_MAP_TABLE
);
2430 case GL_MAX_PROJECTION_STACK_DEPTH
:
2431 params
[0] = (GLfloat
)(MAX_PROJECTION_STACK_DEPTH
);
2433 case GL_MAX_TEXTURE_SIZE
:
2434 params
[0] = (GLfloat
)(1 << (ctx
->Const
.MaxTextureLevels
- 1));
2436 case GL_MAX_3D_TEXTURE_SIZE
:
2437 params
[0] = (GLfloat
)(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
2439 case GL_MAX_TEXTURE_STACK_DEPTH
:
2440 params
[0] = (GLfloat
)(MAX_TEXTURE_STACK_DEPTH
);
2442 case GL_MAX_VIEWPORT_DIMS
:
2443 params
[0] = (GLfloat
)(ctx
->Const
.MaxViewportWidth
);
2444 params
[1] = (GLfloat
)(ctx
->Const
.MaxViewportHeight
);
2446 case GL_MODELVIEW_MATRIX
:
2448 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
2449 params
[0] = matrix
[0];
2450 params
[1] = matrix
[1];
2451 params
[2] = matrix
[2];
2452 params
[3] = matrix
[3];
2453 params
[4] = matrix
[4];
2454 params
[5] = matrix
[5];
2455 params
[6] = matrix
[6];
2456 params
[7] = matrix
[7];
2457 params
[8] = matrix
[8];
2458 params
[9] = matrix
[9];
2459 params
[10] = matrix
[10];
2460 params
[11] = matrix
[11];
2461 params
[12] = matrix
[12];
2462 params
[13] = matrix
[13];
2463 params
[14] = matrix
[14];
2464 params
[15] = matrix
[15];
2467 case GL_MODELVIEW_STACK_DEPTH
:
2468 params
[0] = (GLfloat
)(ctx
->ModelviewMatrixStack
.Depth
+ 1);
2470 case GL_NAME_STACK_DEPTH
:
2471 params
[0] = (GLfloat
)(ctx
->Select
.NameStackDepth
);
2474 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.Normalize
);
2476 case GL_PACK_ALIGNMENT
:
2477 params
[0] = (GLfloat
)(ctx
->Pack
.Alignment
);
2479 case GL_PACK_LSB_FIRST
:
2480 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.LsbFirst
);
2482 case GL_PACK_ROW_LENGTH
:
2483 params
[0] = (GLfloat
)(ctx
->Pack
.RowLength
);
2485 case GL_PACK_SKIP_PIXELS
:
2486 params
[0] = (GLfloat
)(ctx
->Pack
.SkipPixels
);
2488 case GL_PACK_SKIP_ROWS
:
2489 params
[0] = (GLfloat
)(ctx
->Pack
.SkipRows
);
2491 case GL_PACK_SWAP_BYTES
:
2492 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.SwapBytes
);
2494 case GL_PACK_SKIP_IMAGES_EXT
:
2495 params
[0] = (GLfloat
)(ctx
->Pack
.SkipImages
);
2497 case GL_PACK_IMAGE_HEIGHT_EXT
:
2498 params
[0] = (GLfloat
)(ctx
->Pack
.ImageHeight
);
2500 case GL_PACK_INVERT_MESA
:
2501 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.Invert
);
2503 case GL_PERSPECTIVE_CORRECTION_HINT
:
2504 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
2506 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2507 params
[0] = (GLfloat
)(ctx
->Pixel
.MapAtoAsize
);
2509 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2510 params
[0] = (GLfloat
)(ctx
->Pixel
.MapBtoBsize
);
2512 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2513 params
[0] = (GLfloat
)(ctx
->Pixel
.MapGtoGsize
);
2515 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2516 params
[0] = (GLfloat
)(ctx
->Pixel
.MapItoAsize
);
2518 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2519 params
[0] = (GLfloat
)(ctx
->Pixel
.MapItoBsize
);
2521 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2522 params
[0] = (GLfloat
)(ctx
->Pixel
.MapItoGsize
);
2524 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2525 params
[0] = (GLfloat
)(ctx
->Pixel
.MapItoIsize
);
2527 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2528 params
[0] = (GLfloat
)(ctx
->Pixel
.MapItoRsize
);
2530 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2531 params
[0] = (GLfloat
)(ctx
->Pixel
.MapRtoRsize
);
2533 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2534 params
[0] = (GLfloat
)(ctx
->Pixel
.MapStoSsize
);
2537 params
[0] = ctx
->Point
.Size
;
2539 case GL_POINT_SIZE_GRANULARITY
:
2540 params
[0] = ctx
->Const
.PointSizeGranularity
;
2542 case GL_POINT_SIZE_RANGE
:
2543 params
[0] = ctx
->Const
.MinPointSizeAA
;
2544 params
[1] = ctx
->Const
.MaxPointSizeAA
;
2546 case GL_ALIASED_POINT_SIZE_RANGE
:
2547 params
[0] = ctx
->Const
.MinPointSize
;
2548 params
[1] = ctx
->Const
.MaxPointSize
;
2550 case GL_POINT_SMOOTH
:
2551 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.SmoothFlag
);
2553 case GL_POINT_SMOOTH_HINT
:
2554 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
2556 case GL_POINT_SIZE_MIN_EXT
:
2557 params
[0] = ctx
->Point
.MinSize
;
2559 case GL_POINT_SIZE_MAX_EXT
:
2560 params
[0] = ctx
->Point
.MaxSize
;
2562 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2563 params
[0] = ctx
->Point
.Threshold
;
2565 case GL_DISTANCE_ATTENUATION_EXT
:
2566 params
[0] = ctx
->Point
.Params
[0];
2567 params
[1] = ctx
->Point
.Params
[1];
2568 params
[2] = ctx
->Point
.Params
[2];
2570 case GL_POLYGON_MODE
:
2571 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
2572 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
2574 case GL_POLYGON_OFFSET_BIAS_EXT
:
2575 params
[0] = ctx
->Polygon
.OffsetUnits
;
2577 case GL_POLYGON_OFFSET_FACTOR
:
2578 params
[0] = ctx
->Polygon
.OffsetFactor
;
2580 case GL_POLYGON_OFFSET_UNITS
:
2581 params
[0] = ctx
->Polygon
.OffsetUnits
;
2583 case GL_POLYGON_SMOOTH
:
2584 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.SmoothFlag
);
2586 case GL_POLYGON_SMOOTH_HINT
:
2587 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
2589 case GL_POLYGON_STIPPLE
:
2590 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.StippleFlag
);
2592 case GL_PROJECTION_MATRIX
:
2594 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
2595 params
[0] = matrix
[0];
2596 params
[1] = matrix
[1];
2597 params
[2] = matrix
[2];
2598 params
[3] = matrix
[3];
2599 params
[4] = matrix
[4];
2600 params
[5] = matrix
[5];
2601 params
[6] = matrix
[6];
2602 params
[7] = matrix
[7];
2603 params
[8] = matrix
[8];
2604 params
[9] = matrix
[9];
2605 params
[10] = matrix
[10];
2606 params
[11] = matrix
[11];
2607 params
[12] = matrix
[12];
2608 params
[13] = matrix
[13];
2609 params
[14] = matrix
[14];
2610 params
[15] = matrix
[15];
2613 case GL_PROJECTION_STACK_DEPTH
:
2614 params
[0] = (GLfloat
)(ctx
->ProjectionMatrixStack
.Depth
+ 1);
2616 case GL_READ_BUFFER
:
2617 params
[0] = ENUM_TO_FLOAT(ctx
->ReadBuffer
->ColorReadBuffer
);
2620 params
[0] = ctx
->Pixel
.RedBias
;
2623 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.redBits
);
2626 params
[0] = ctx
->Pixel
.RedScale
;
2628 case GL_RENDER_MODE
:
2629 params
[0] = ENUM_TO_FLOAT(ctx
->RenderMode
);
2631 case GL_RESCALE_NORMAL
:
2632 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RescaleNormals
);
2635 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.rgbMode
);
2637 case GL_SCISSOR_BOX
:
2638 params
[0] = (GLfloat
)(ctx
->Scissor
.X
);
2639 params
[1] = (GLfloat
)(ctx
->Scissor
.Y
);
2640 params
[2] = (GLfloat
)(ctx
->Scissor
.Width
);
2641 params
[3] = (GLfloat
)(ctx
->Scissor
.Height
);
2643 case GL_SCISSOR_TEST
:
2644 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Scissor
.Enabled
);
2646 case GL_SELECTION_BUFFER_SIZE
:
2647 params
[0] = (GLfloat
)(ctx
->Select
.BufferSize
);
2649 case GL_SHADE_MODEL
:
2650 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
2652 case GL_SHARED_TEXTURE_PALETTE_EXT
:
2653 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.SharedPalette
);
2655 case GL_STENCIL_BITS
:
2656 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.stencilBits
);
2658 case GL_STENCIL_CLEAR_VALUE
:
2659 params
[0] = (GLfloat
)(ctx
->Stencil
.Clear
);
2661 case GL_STENCIL_FAIL
:
2662 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
2664 case GL_STENCIL_FUNC
:
2665 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
2667 case GL_STENCIL_PASS_DEPTH_FAIL
:
2668 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
2670 case GL_STENCIL_PASS_DEPTH_PASS
:
2671 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
2673 case GL_STENCIL_REF
:
2674 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
2676 case GL_STENCIL_TEST
:
2677 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.Enabled
);
2679 case GL_STENCIL_VALUE_MASK
:
2680 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
2682 case GL_STENCIL_WRITEMASK
:
2683 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
2686 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.stereoMode
);
2688 case GL_SUBPIXEL_BITS
:
2689 params
[0] = (GLfloat
)(ctx
->Const
.SubPixelBits
);
2692 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D
));
2695 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D
));
2698 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D
));
2700 case GL_TEXTURE_BINDING_1D
:
2701 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
);
2703 case GL_TEXTURE_BINDING_2D
:
2704 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
);
2706 case GL_TEXTURE_BINDING_3D
:
2707 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
);
2709 case GL_TEXTURE_ENV_COLOR
:
2711 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
2712 params
[0] = color
[0];
2713 params
[1] = color
[1];
2714 params
[2] = color
[2];
2715 params
[3] = color
[3];
2718 case GL_TEXTURE_ENV_MODE
:
2719 params
[0] = ENUM_TO_FLOAT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
2721 case GL_TEXTURE_GEN_S
:
2722 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
2724 case GL_TEXTURE_GEN_T
:
2725 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
2727 case GL_TEXTURE_GEN_R
:
2728 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
2730 case GL_TEXTURE_GEN_Q
:
2731 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
2733 case GL_TEXTURE_MATRIX
:
2735 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
2736 params
[0] = matrix
[0];
2737 params
[1] = matrix
[1];
2738 params
[2] = matrix
[2];
2739 params
[3] = matrix
[3];
2740 params
[4] = matrix
[4];
2741 params
[5] = matrix
[5];
2742 params
[6] = matrix
[6];
2743 params
[7] = matrix
[7];
2744 params
[8] = matrix
[8];
2745 params
[9] = matrix
[9];
2746 params
[10] = matrix
[10];
2747 params
[11] = matrix
[11];
2748 params
[12] = matrix
[12];
2749 params
[13] = matrix
[13];
2750 params
[14] = matrix
[14];
2751 params
[15] = matrix
[15];
2754 case GL_TEXTURE_STACK_DEPTH
:
2755 params
[0] = (GLfloat
)(ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1);
2757 case GL_UNPACK_ALIGNMENT
:
2758 params
[0] = (GLfloat
)(ctx
->Unpack
.Alignment
);
2760 case GL_UNPACK_LSB_FIRST
:
2761 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.LsbFirst
);
2763 case GL_UNPACK_ROW_LENGTH
:
2764 params
[0] = (GLfloat
)(ctx
->Unpack
.RowLength
);
2766 case GL_UNPACK_SKIP_PIXELS
:
2767 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipPixels
);
2769 case GL_UNPACK_SKIP_ROWS
:
2770 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipRows
);
2772 case GL_UNPACK_SWAP_BYTES
:
2773 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.SwapBytes
);
2775 case GL_UNPACK_SKIP_IMAGES_EXT
:
2776 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipImages
);
2778 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2779 params
[0] = (GLfloat
)(ctx
->Unpack
.ImageHeight
);
2781 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
2782 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.ClientStorage
);
2785 params
[0] = (GLfloat
)(ctx
->Viewport
.X
);
2786 params
[1] = (GLfloat
)(ctx
->Viewport
.Y
);
2787 params
[2] = (GLfloat
)(ctx
->Viewport
.Width
);
2788 params
[3] = (GLfloat
)(ctx
->Viewport
.Height
);
2791 params
[0] = ctx
->Pixel
.ZoomX
;
2794 params
[0] = ctx
->Pixel
.ZoomY
;
2796 case GL_VERTEX_ARRAY
:
2797 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
2799 case GL_VERTEX_ARRAY_SIZE
:
2800 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Size
);
2802 case GL_VERTEX_ARRAY_TYPE
:
2803 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
2805 case GL_VERTEX_ARRAY_STRIDE
:
2806 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
2808 case GL_VERTEX_ARRAY_COUNT_EXT
:
2809 params
[0] = (GLfloat
)(0);
2811 case GL_NORMAL_ARRAY
:
2812 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
2814 case GL_NORMAL_ARRAY_TYPE
:
2815 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Type
);
2817 case GL_NORMAL_ARRAY_STRIDE
:
2818 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.Stride
);
2820 case GL_NORMAL_ARRAY_COUNT_EXT
:
2821 params
[0] = (GLfloat
)(0);
2823 case GL_COLOR_ARRAY
:
2824 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
2826 case GL_COLOR_ARRAY_SIZE
:
2827 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Size
);
2829 case GL_COLOR_ARRAY_TYPE
:
2830 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Type
);
2832 case GL_COLOR_ARRAY_STRIDE
:
2833 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Stride
);
2835 case GL_COLOR_ARRAY_COUNT_EXT
:
2836 params
[0] = (GLfloat
)(0);
2838 case GL_INDEX_ARRAY
:
2839 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
2841 case GL_INDEX_ARRAY_TYPE
:
2842 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Type
);
2844 case GL_INDEX_ARRAY_STRIDE
:
2845 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.Stride
);
2847 case GL_INDEX_ARRAY_COUNT_EXT
:
2848 params
[0] = (GLfloat
)(0);
2850 case GL_TEXTURE_COORD_ARRAY
:
2851 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
2853 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2854 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
2856 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2857 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
2859 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2860 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
2862 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2863 params
[0] = (GLfloat
)(0);
2865 case GL_EDGE_FLAG_ARRAY
:
2866 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
2868 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2869 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
2871 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2872 params
[0] = (GLfloat
)(0);
2874 case GL_MAX_TEXTURE_UNITS_ARB
:
2875 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2876 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureUnits
);
2878 case GL_ACTIVE_TEXTURE_ARB
:
2879 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2880 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2882 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2883 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2884 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2886 case GL_TEXTURE_CUBE_MAP_ARB
:
2887 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2888 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
2890 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2891 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2892 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
);
2894 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2895 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2896 params
[0] = (GLfloat
)((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
2898 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2899 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2900 params
[0] = (GLfloat
)(ctx
->Hint
.TextureCompression
);
2902 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2903 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2904 params
[0] = (GLfloat
)(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
2906 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2907 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2910 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
2912 for (i
= 0; i
< n
; i
++)
2913 params
[i
] = ENUM_TO_INT(formats
[i
]);
2916 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2917 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
2918 params
[0] = (GLfloat
)(ctx
->Array
.LockFirst
);
2920 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2921 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
2922 params
[0] = (GLfloat
)(ctx
->Array
.LockCount
);
2924 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2926 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
2927 params
[0] = matrix
[0];
2928 params
[1] = matrix
[4];
2929 params
[2] = matrix
[8];
2930 params
[3] = matrix
[12];
2931 params
[4] = matrix
[1];
2932 params
[5] = matrix
[5];
2933 params
[6] = matrix
[9];
2934 params
[7] = matrix
[13];
2935 params
[8] = matrix
[2];
2936 params
[9] = matrix
[6];
2937 params
[10] = matrix
[10];
2938 params
[11] = matrix
[14];
2939 params
[12] = matrix
[3];
2940 params
[13] = matrix
[7];
2941 params
[14] = matrix
[11];
2942 params
[15] = matrix
[15];
2945 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2947 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
2948 params
[0] = matrix
[0];
2949 params
[1] = matrix
[4];
2950 params
[2] = matrix
[8];
2951 params
[3] = matrix
[12];
2952 params
[4] = matrix
[1];
2953 params
[5] = matrix
[5];
2954 params
[6] = matrix
[9];
2955 params
[7] = matrix
[13];
2956 params
[8] = matrix
[2];
2957 params
[9] = matrix
[6];
2958 params
[10] = matrix
[10];
2959 params
[11] = matrix
[14];
2960 params
[12] = matrix
[3];
2961 params
[13] = matrix
[7];
2962 params
[14] = matrix
[11];
2963 params
[15] = matrix
[15];
2966 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
2968 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
2969 params
[0] = matrix
[0];
2970 params
[1] = matrix
[4];
2971 params
[2] = matrix
[8];
2972 params
[3] = matrix
[12];
2973 params
[4] = matrix
[1];
2974 params
[5] = matrix
[5];
2975 params
[6] = matrix
[9];
2976 params
[7] = matrix
[13];
2977 params
[8] = matrix
[2];
2978 params
[9] = matrix
[6];
2979 params
[10] = matrix
[10];
2980 params
[11] = matrix
[14];
2981 params
[12] = matrix
[3];
2982 params
[13] = matrix
[7];
2983 params
[14] = matrix
[11];
2984 params
[15] = matrix
[15];
2987 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
2989 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
2990 params
[0] = matrix
[0];
2991 params
[1] = matrix
[4];
2992 params
[2] = matrix
[8];
2993 params
[3] = matrix
[12];
2994 params
[4] = matrix
[1];
2995 params
[5] = matrix
[5];
2996 params
[6] = matrix
[9];
2997 params
[7] = matrix
[13];
2998 params
[8] = matrix
[2];
2999 params
[9] = matrix
[6];
3000 params
[10] = matrix
[10];
3001 params
[11] = matrix
[14];
3002 params
[12] = matrix
[3];
3003 params
[13] = matrix
[7];
3004 params
[14] = matrix
[11];
3005 params
[15] = matrix
[15];
3008 case GL_COLOR_MATRIX_SGI
:
3010 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
3011 params
[0] = matrix
[0];
3012 params
[1] = matrix
[1];
3013 params
[2] = matrix
[2];
3014 params
[3] = matrix
[3];
3015 params
[4] = matrix
[4];
3016 params
[5] = matrix
[5];
3017 params
[6] = matrix
[6];
3018 params
[7] = matrix
[7];
3019 params
[8] = matrix
[8];
3020 params
[9] = matrix
[9];
3021 params
[10] = matrix
[10];
3022 params
[11] = matrix
[11];
3023 params
[12] = matrix
[12];
3024 params
[13] = matrix
[13];
3025 params
[14] = matrix
[14];
3026 params
[15] = matrix
[15];
3029 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3030 params
[0] = (GLfloat
)(ctx
->ColorMatrixStack
.Depth
+ 1);
3032 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3033 params
[0] = (GLfloat
)(MAX_COLOR_STACK_DEPTH
);
3035 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3036 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[0];
3038 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3039 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[1];
3041 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3042 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[2];
3044 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3045 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[3];
3047 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3048 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[0];
3050 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3051 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[1];
3053 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3054 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[2];
3056 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3057 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[3];
3059 case GL_CONVOLUTION_1D_EXT
:
3060 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3061 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution1DEnabled
);
3063 case GL_CONVOLUTION_2D_EXT
:
3064 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3065 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution2DEnabled
);
3067 case GL_SEPARABLE_2D_EXT
:
3068 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3069 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Separable2DEnabled
);
3071 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3072 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3073 params
[0] = ctx
->Pixel
.PostConvolutionScale
[0];
3075 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3076 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3077 params
[0] = ctx
->Pixel
.PostConvolutionScale
[1];
3079 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3080 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3081 params
[0] = ctx
->Pixel
.PostConvolutionScale
[2];
3083 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3084 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3085 params
[0] = ctx
->Pixel
.PostConvolutionScale
[3];
3087 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3088 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3089 params
[0] = ctx
->Pixel
.PostConvolutionBias
[0];
3091 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3092 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3093 params
[0] = ctx
->Pixel
.PostConvolutionBias
[1];
3095 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3096 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3097 params
[0] = ctx
->Pixel
.PostConvolutionBias
[2];
3099 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3100 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3101 params
[0] = ctx
->Pixel
.PostConvolutionBias
[3];
3104 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3105 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.HistogramEnabled
);
3108 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3109 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MinMaxEnabled
);
3111 case GL_COLOR_TABLE_SGI
:
3112 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3113 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
);
3115 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3116 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3117 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.PostConvolutionColorTableEnabled
);
3119 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3120 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3121 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.PostColorMatrixColorTableEnabled
);
3123 case GL_TEXTURE_COLOR_TABLE_SGI
:
3124 CHECK_EXT1(SGI_texture_color_table
, "GetFloatv");
3125 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
3127 case GL_COLOR_SUM_EXT
:
3128 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetFloatv");
3129 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.ColorSumEnabled
);
3131 case GL_CURRENT_SECONDARY_COLOR_EXT
:
3132 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3134 FLUSH_CURRENT(ctx
, 0);
3135 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0];
3136 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1];
3137 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2];
3138 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3];
3141 case GL_SECONDARY_COLOR_ARRAY_EXT
:
3142 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3143 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
3145 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
3146 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3147 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
3149 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
3150 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3151 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
3153 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
3154 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3155 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
3157 case GL_CURRENT_FOG_COORDINATE_EXT
:
3158 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3160 FLUSH_CURRENT(ctx
, 0);
3161 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
3164 case GL_FOG_COORDINATE_ARRAY_EXT
:
3165 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3166 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
3168 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
3169 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3170 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
3172 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
3173 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3174 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
3176 case GL_FOG_COORDINATE_SOURCE_EXT
:
3177 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3178 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.FogCoordinateSource
);
3180 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
3181 CHECK_EXT1(EXT_texture_lod_bias
, "GetFloatv");
3182 params
[0] = ctx
->Const
.MaxTextureLodBias
;
3184 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
3185 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetFloatv");
3186 params
[0] = ctx
->Const
.MaxTextureMaxAnisotropy
;
3188 case GL_MULTISAMPLE_ARB
:
3189 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3190 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.Enabled
);
3192 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
3193 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3194 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToCoverage
);
3196 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
3197 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3198 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToOne
);
3200 case GL_SAMPLE_COVERAGE_ARB
:
3201 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3202 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverage
);
3204 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
3205 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3206 params
[0] = ctx
->Multisample
.SampleCoverageValue
;
3208 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
3209 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3210 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverageInvert
);
3212 case GL_SAMPLE_BUFFERS_ARB
:
3213 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3214 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
3216 case GL_SAMPLES_ARB
:
3217 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3218 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.samples
);
3220 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
3221 CHECK_EXT1(IBM_rasterpos_clip
, "GetFloatv");
3222 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RasterPositionUnclipped
);
3224 case GL_POINT_SPRITE_NV
:
3225 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3226 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.PointSprite
);
3228 case GL_POINT_SPRITE_R_MODE_NV
:
3229 CHECK_EXT1(NV_point_sprite
, "GetFloatv");
3230 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteRMode
);
3232 case GL_POINT_SPRITE_COORD_ORIGIN
:
3233 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3234 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteOrigin
);
3236 case GL_GENERATE_MIPMAP_HINT_SGIS
:
3237 CHECK_EXT1(SGIS_generate_mipmap
, "GetFloatv");
3238 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.GenerateMipmap
);
3240 case GL_VERTEX_PROGRAM_BINDING_NV
:
3241 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3242 params
[0] = (GLfloat
)((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
3244 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
3245 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3246 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
3248 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
3249 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3250 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
3252 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
3253 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3254 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
3256 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
3257 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3258 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
3260 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
3261 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3262 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
3264 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
3265 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3266 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
3268 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
3269 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3270 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
3272 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
3273 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3274 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
3276 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
3277 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3278 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
3280 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
3281 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3282 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
3284 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
3285 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3286 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
3288 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
3289 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3290 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
3292 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
3293 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3294 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
3296 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
3297 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3298 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
3300 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
3301 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3302 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
3304 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
3305 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3306 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
3308 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
3309 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3310 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[0]);
3312 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
3313 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3314 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[1]);
3316 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
3317 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3318 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[2]);
3320 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
3321 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3322 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[3]);
3324 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
3325 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3326 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[4]);
3328 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
3329 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3330 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[5]);
3332 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
3333 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3334 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[6]);
3336 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
3337 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3338 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[7]);
3340 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
3341 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3342 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[8]);
3344 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
3345 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3346 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[9]);
3348 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
3349 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3350 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[10]);
3352 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
3353 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3354 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[11]);
3356 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
3357 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3358 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[12]);
3360 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
3361 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3362 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[13]);
3364 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
3365 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3366 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[14]);
3368 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
3369 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3370 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[15]);
3372 case GL_FRAGMENT_PROGRAM_NV
:
3373 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3374 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3376 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
3377 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3378 params
[0] = (GLfloat
)(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
3380 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
3381 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3382 params
[0] = (GLfloat
)(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
3384 case GL_TEXTURE_RECTANGLE_NV
:
3385 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3386 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
3388 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
3389 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3390 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
);
3392 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
3393 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3394 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureRectSize
);
3396 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
3397 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3398 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.TestTwoSide
);
3400 case GL_ACTIVE_STENCIL_FACE_EXT
:
3401 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3402 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
3404 case GL_MAX_SHININESS_NV
:
3405 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3406 params
[0] = ctx
->Const
.MaxShininess
;
3408 case GL_MAX_SPOT_EXPONENT_NV
:
3409 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3410 params
[0] = ctx
->Const
.MaxSpotExponent
;
3412 case GL_ARRAY_BUFFER_BINDING_ARB
:
3413 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3414 params
[0] = (GLfloat
)(ctx
->Array
.ArrayBufferObj
->Name
);
3416 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
3417 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3418 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
3420 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
3421 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3422 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
3424 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3425 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3426 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
3428 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
3429 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3430 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
3432 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
3433 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3434 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
3436 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
3437 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3438 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
3440 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3441 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3442 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
3444 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
3445 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3446 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
3448 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
3449 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3450 params
[0] = (GLfloat
)(ctx
->Array
.ElementArrayBufferObj
->Name
);
3452 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
3453 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3454 params
[0] = (GLfloat
)(ctx
->Pack
.BufferObj
->Name
);
3456 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
3457 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3458 params
[0] = (GLfloat
)(ctx
->Unpack
.BufferObj
->Name
);
3460 case GL_VERTEX_PROGRAM_ARB
:
3461 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3462 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.Enabled
);
3464 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
3465 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3466 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.PointSizeEnabled
);
3468 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
3469 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3470 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.TwoSideEnabled
);
3472 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
3473 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3474 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrixStackDepth
);
3476 case GL_MAX_PROGRAM_MATRICES_ARB
:
3477 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3478 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrices
);
3480 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
3481 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3482 params
[0] = BOOLEAN_TO_FLOAT(ctx
->CurrentStack
->Depth
+ 1);
3484 case GL_CURRENT_MATRIX_ARB
:
3485 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3487 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3488 params
[0] = matrix
[0];
3489 params
[1] = matrix
[1];
3490 params
[2] = matrix
[2];
3491 params
[3] = matrix
[3];
3492 params
[4] = matrix
[4];
3493 params
[5] = matrix
[5];
3494 params
[6] = matrix
[6];
3495 params
[7] = matrix
[7];
3496 params
[8] = matrix
[8];
3497 params
[9] = matrix
[9];
3498 params
[10] = matrix
[10];
3499 params
[11] = matrix
[11];
3500 params
[12] = matrix
[12];
3501 params
[13] = matrix
[13];
3502 params
[14] = matrix
[14];
3503 params
[15] = matrix
[15];
3506 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
3507 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetFloatv");
3509 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3510 params
[0] = matrix
[0];
3511 params
[1] = matrix
[4];
3512 params
[2] = matrix
[8];
3513 params
[3] = matrix
[12];
3514 params
[4] = matrix
[1];
3515 params
[5] = matrix
[5];
3516 params
[6] = matrix
[9];
3517 params
[7] = matrix
[13];
3518 params
[8] = matrix
[2];
3519 params
[9] = matrix
[6];
3520 params
[10] = matrix
[10];
3521 params
[11] = matrix
[14];
3522 params
[12] = matrix
[3];
3523 params
[13] = matrix
[7];
3524 params
[14] = matrix
[11];
3525 params
[15] = matrix
[15];
3528 case GL_MAX_VERTEX_ATTRIBS_ARB
:
3529 CHECK_EXT1(ARB_vertex_program
, "GetFloatv");
3530 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxAttribs
);
3532 case GL_PROGRAM_ERROR_POSITION_ARB
:
3533 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetFloatv");
3534 params
[0] = (GLfloat
)(ctx
->Program
.ErrorPos
);
3536 case GL_FRAGMENT_PROGRAM_ARB
:
3537 CHECK_EXT1(ARB_fragment_program
, "GetFloatv");
3538 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3540 case GL_MAX_TEXTURE_COORDS_ARB
:
3541 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3542 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureCoordUnits
);
3544 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
3545 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3546 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureImageUnits
);
3548 case GL_DEPTH_BOUNDS_TEST_EXT
:
3549 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3550 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.BoundsTest
);
3552 case GL_DEPTH_BOUNDS_EXT
:
3553 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3554 params
[0] = ctx
->Depth
.BoundsMin
;
3555 params
[1] = ctx
->Depth
.BoundsMax
;
3557 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
3558 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3559 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.CallbackEnabled
);
3561 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
3562 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3563 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.CallbackEnabled
);
3565 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
3566 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3567 params
[0] = (GLfloat
)(ctx
->FragmentProgram
.CurrentPosition
);
3569 case GL_VERTEX_PROGRAM_POSITION_MESA
:
3570 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3571 params
[0] = (GLfloat
)(ctx
->VertexProgram
.CurrentPosition
);
3573 case GL_MAX_DRAW_BUFFERS_ARB
:
3574 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3575 params
[0] = (GLfloat
)(ctx
->Const
.MaxDrawBuffers
);
3577 case GL_DRAW_BUFFER0_ARB
:
3578 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3579 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
3581 case GL_DRAW_BUFFER1_ARB
:
3582 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3585 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3586 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3589 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
3590 params
[0] = ENUM_TO_FLOAT(buffer
);
3593 case GL_DRAW_BUFFER2_ARB
:
3594 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3597 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3598 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3601 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
3602 params
[0] = ENUM_TO_FLOAT(buffer
);
3605 case GL_DRAW_BUFFER3_ARB
:
3606 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3609 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3610 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3613 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
3614 params
[0] = ENUM_TO_FLOAT(buffer
);
3617 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
3618 CHECK_EXT1(OES_read_format
, "GetFloatv");
3619 params
[0] = (GLfloat
)(ctx
->Const
.ColorReadType
);
3621 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
3622 CHECK_EXT1(OES_read_format
, "GetFloatv");
3623 params
[0] = (GLfloat
)(ctx
->Const
.ColorReadFormat
);
3625 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
3626 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3627 params
[0] = (GLfloat
)(6);
3629 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
3630 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3631 params
[0] = (GLfloat
)(8);
3633 case GL_NUM_PASSES_ATI
:
3634 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3635 params
[0] = (GLfloat
)(2);
3637 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
3638 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3639 params
[0] = (GLfloat
)(8);
3641 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
3642 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3643 params
[0] = (GLfloat
)(16);
3645 case GL_COLOR_ALPHA_PAIRING_ATI
:
3646 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3647 params
[0] = BOOLEAN_TO_FLOAT(GL_TRUE
);
3649 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
3650 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3651 params
[0] = (GLfloat
)(3);
3653 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
3654 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3655 params
[0] = (GLfloat
)(3);
3657 case GL_STENCIL_BACK_FUNC
:
3658 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[1]);
3660 case GL_STENCIL_BACK_VALUE_MASK
:
3661 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[1]);
3663 case GL_STENCIL_BACK_WRITEMASK
:
3664 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[1]);
3666 case GL_STENCIL_BACK_REF
:
3667 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[1]);
3669 case GL_STENCIL_BACK_FAIL
:
3670 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[1]);
3672 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
3673 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[1]);
3675 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
3676 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[1]);
3678 case GL_FRAMEBUFFER_BINDING_EXT
:
3679 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3680 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Name
);
3682 case GL_RENDERBUFFER_BINDING_EXT
:
3683 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3684 params
[0] = (GLfloat
)(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
3686 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
3687 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3688 params
[0] = (GLfloat
)(ctx
->Const
.MaxColorAttachments
);
3690 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
3691 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3692 params
[0] = (GLfloat
)(ctx
->Const
.MaxRenderbufferSize
);
3694 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
3695 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3696 params
[0] = (GLfloat
)(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
3698 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
3699 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3700 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.FragmentShaderDerivative
);
3702 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
3703 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3704 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
3706 case GL_MAX_VARYING_FLOATS_ARB
:
3707 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3708 params
[0] = (GLfloat
)(ctx
->Const
.MaxVaryingFloats
);
3710 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
3711 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3712 params
[0] = (GLfloat
)(ctx
->Const
.MaxVertexTextureImageUnits
);
3714 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
3715 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3716 params
[0] = (GLfloat
)(MAX_COMBINED_TEXTURE_IMAGE_UNITS
);
3719 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv(pname=0x%x)", pname
);
3724 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3726 GET_CURRENT_CONTEXT(ctx
);
3727 ASSERT_OUTSIDE_BEGIN_END(ctx
);
3733 _mesa_update_state(ctx
);
3735 if (ctx
->Driver
.GetIntegerv
&&
3736 ctx
->Driver
.GetIntegerv(ctx
, pname
, params
))
3740 case GL_ACCUM_RED_BITS
:
3741 params
[0] = ctx
->DrawBuffer
->Visual
.accumRedBits
;
3743 case GL_ACCUM_GREEN_BITS
:
3744 params
[0] = ctx
->DrawBuffer
->Visual
.accumGreenBits
;
3746 case GL_ACCUM_BLUE_BITS
:
3747 params
[0] = ctx
->DrawBuffer
->Visual
.accumBlueBits
;
3749 case GL_ACCUM_ALPHA_BITS
:
3750 params
[0] = ctx
->DrawBuffer
->Visual
.accumAlphaBits
;
3752 case GL_ACCUM_CLEAR_VALUE
:
3753 params
[0] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[0]);
3754 params
[1] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[1]);
3755 params
[2] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[2]);
3756 params
[3] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[3]);
3759 params
[0] = IROUND(ctx
->Pixel
.AlphaBias
);
3762 params
[0] = ctx
->DrawBuffer
->Visual
.alphaBits
;
3764 case GL_ALPHA_SCALE
:
3765 params
[0] = IROUND(ctx
->Pixel
.AlphaScale
);
3768 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.AlphaEnabled
);
3770 case GL_ALPHA_TEST_FUNC
:
3771 params
[0] = ENUM_TO_INT(ctx
->Color
.AlphaFunc
);
3773 case GL_ALPHA_TEST_REF
:
3774 params
[0] = FLOAT_TO_INT(ctx
->Color
.AlphaRef
);
3776 case GL_ATTRIB_STACK_DEPTH
:
3777 params
[0] = ctx
->AttribStackDepth
;
3779 case GL_AUTO_NORMAL
:
3780 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.AutoNormal
);
3782 case GL_AUX_BUFFERS
:
3783 params
[0] = ctx
->DrawBuffer
->Visual
.numAuxBuffers
;
3786 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.BlendEnabled
);
3789 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3792 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3794 case GL_BLEND_SRC_RGB_EXT
:
3795 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3797 case GL_BLEND_DST_RGB_EXT
:
3798 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3800 case GL_BLEND_SRC_ALPHA_EXT
:
3801 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcA
);
3803 case GL_BLEND_DST_ALPHA_EXT
:
3804 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstA
);
3806 case GL_BLEND_EQUATION
:
3807 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationRGB
);
3809 case GL_BLEND_EQUATION_ALPHA_EXT
:
3810 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationA
);
3812 case GL_BLEND_COLOR_EXT
:
3813 params
[0] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[0]);
3814 params
[1] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[1]);
3815 params
[2] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[2]);
3816 params
[3] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[3]);
3819 params
[0] = IROUND(ctx
->Pixel
.BlueBias
);
3822 params
[0] = ctx
->DrawBuffer
->Visual
.blueBits
;
3825 params
[0] = IROUND(ctx
->Pixel
.BlueScale
);
3827 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3828 params
[0] = ctx
->ClientAttribStackDepth
;
3830 case GL_CLIP_PLANE0
:
3831 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
3833 case GL_CLIP_PLANE1
:
3834 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
3836 case GL_CLIP_PLANE2
:
3837 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
3839 case GL_CLIP_PLANE3
:
3840 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
3842 case GL_CLIP_PLANE4
:
3843 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
3845 case GL_CLIP_PLANE5
:
3846 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
3848 case GL_COLOR_CLEAR_VALUE
:
3849 params
[0] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[0]);
3850 params
[1] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[1]);
3851 params
[2] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[2]);
3852 params
[3] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[3]);
3854 case GL_COLOR_MATERIAL
:
3855 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.ColorMaterialEnabled
);
3857 case GL_COLOR_MATERIAL_FACE
:
3858 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialFace
);
3860 case GL_COLOR_MATERIAL_PARAMETER
:
3861 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialMode
);
3863 case GL_COLOR_WRITEMASK
:
3864 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
3865 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
3866 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
3867 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
3870 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.CullFlag
);
3872 case GL_CULL_FACE_MODE
:
3873 params
[0] = ENUM_TO_INT(ctx
->Polygon
.CullFaceMode
);
3875 case GL_CURRENT_COLOR
:
3877 FLUSH_CURRENT(ctx
, 0);
3878 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
3879 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
3880 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
3881 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
3884 case GL_CURRENT_INDEX
:
3886 FLUSH_CURRENT(ctx
, 0);
3887 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
3890 case GL_CURRENT_NORMAL
:
3892 FLUSH_CURRENT(ctx
, 0);
3893 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
3894 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
3895 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
3898 case GL_CURRENT_RASTER_COLOR
:
3899 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[0]);
3900 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[1]);
3901 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[2]);
3902 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[3]);
3904 case GL_CURRENT_RASTER_DISTANCE
:
3905 params
[0] = IROUND(ctx
->Current
.RasterDistance
);
3907 case GL_CURRENT_RASTER_INDEX
:
3908 params
[0] = IROUND(ctx
->Current
.RasterIndex
);
3910 case GL_CURRENT_RASTER_POSITION
:
3911 params
[0] = IROUND(ctx
->Current
.RasterPos
[0]);
3912 params
[1] = IROUND(ctx
->Current
.RasterPos
[1]);
3913 params
[2] = IROUND(ctx
->Current
.RasterPos
[2]);
3914 params
[3] = IROUND(ctx
->Current
.RasterPos
[3]);
3916 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
3917 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[0]);
3918 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[1]);
3919 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[2]);
3920 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[3]);
3922 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
3924 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3925 params
[0] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][0]);
3926 params
[1] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][1]);
3927 params
[2] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][2]);
3928 params
[3] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][3]);
3931 case GL_CURRENT_RASTER_POSITION_VALID
:
3932 params
[0] = BOOLEAN_TO_INT(ctx
->Current
.RasterPosValid
);
3934 case GL_CURRENT_TEXTURE_COORDS
:
3936 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3937 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0]);
3938 params
[1] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1]);
3939 params
[2] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2]);
3940 params
[3] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3]);
3944 params
[0] = IROUND(ctx
->Pixel
.DepthBias
);
3947 params
[0] = ctx
->DrawBuffer
->Visual
.depthBits
;
3949 case GL_DEPTH_CLEAR_VALUE
:
3950 params
[0] = IROUND(ctx
->Depth
.Clear
);
3953 params
[0] = ENUM_TO_INT(ctx
->Depth
.Func
);
3955 case GL_DEPTH_RANGE
:
3956 params
[0] = FLOAT_TO_INT(ctx
->Viewport
.Near
);
3957 params
[1] = FLOAT_TO_INT(ctx
->Viewport
.Far
);
3959 case GL_DEPTH_SCALE
:
3960 params
[0] = IROUND(ctx
->Pixel
.DepthScale
);
3963 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Test
);
3965 case GL_DEPTH_WRITEMASK
:
3966 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Mask
);
3969 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.DitherFlag
);
3971 case GL_DOUBLEBUFFER
:
3972 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
3974 case GL_DRAW_BUFFER
:
3975 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
3979 FLUSH_CURRENT(ctx
, 0);
3980 params
[0] = BOOLEAN_TO_INT(ctx
->Current
.EdgeFlag
);
3983 case GL_FEEDBACK_BUFFER_SIZE
:
3984 params
[0] = ctx
->Feedback
.BufferSize
;
3986 case GL_FEEDBACK_BUFFER_TYPE
:
3987 params
[0] = ENUM_TO_INT(ctx
->Feedback
.Type
);
3990 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.Enabled
);
3993 params
[0] = FLOAT_TO_INT(ctx
->Fog
.Color
[0]);
3994 params
[1] = FLOAT_TO_INT(ctx
->Fog
.Color
[1]);
3995 params
[2] = FLOAT_TO_INT(ctx
->Fog
.Color
[2]);
3996 params
[3] = FLOAT_TO_INT(ctx
->Fog
.Color
[3]);
3998 case GL_FOG_DENSITY
:
3999 params
[0] = IROUND(ctx
->Fog
.Density
);
4002 params
[0] = IROUND(ctx
->Fog
.End
);
4005 params
[0] = ENUM_TO_INT(ctx
->Hint
.Fog
);
4008 params
[0] = IROUND(ctx
->Fog
.Index
);
4011 params
[0] = ENUM_TO_INT(ctx
->Fog
.Mode
);
4014 params
[0] = IROUND(ctx
->Fog
.Start
);
4017 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontFace
);
4020 params
[0] = IROUND(ctx
->Pixel
.GreenBias
);
4023 params
[0] = ctx
->DrawBuffer
->Visual
.greenBits
;
4025 case GL_GREEN_SCALE
:
4026 params
[0] = IROUND(ctx
->Pixel
.GreenScale
);
4029 params
[0] = ctx
->DrawBuffer
->Visual
.indexBits
;
4031 case GL_INDEX_CLEAR_VALUE
:
4032 params
[0] = ctx
->Color
.ClearIndex
;
4035 params
[0] = BOOLEAN_TO_INT(!ctx
->DrawBuffer
->Visual
.rgbMode
);
4037 case GL_INDEX_OFFSET
:
4038 params
[0] = ctx
->Pixel
.IndexOffset
;
4040 case GL_INDEX_SHIFT
:
4041 params
[0] = ctx
->Pixel
.IndexShift
;
4043 case GL_INDEX_WRITEMASK
:
4044 params
[0] = ctx
->Color
.IndexMask
;
4047 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[0].Enabled
);
4050 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[1].Enabled
);
4053 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[2].Enabled
);
4056 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[3].Enabled
);
4059 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[4].Enabled
);
4062 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[5].Enabled
);
4065 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[6].Enabled
);
4068 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[7].Enabled
);
4071 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Enabled
);
4073 case GL_LIGHT_MODEL_AMBIENT
:
4074 params
[0] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[0]);
4075 params
[1] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[1]);
4076 params
[2] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[2]);
4077 params
[3] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[3]);
4079 case GL_LIGHT_MODEL_COLOR_CONTROL
:
4080 params
[0] = ENUM_TO_INT(ctx
->Light
.Model
.ColorControl
);
4082 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
4083 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.LocalViewer
);
4085 case GL_LIGHT_MODEL_TWO_SIDE
:
4086 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.TwoSide
);
4088 case GL_LINE_SMOOTH
:
4089 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.SmoothFlag
);
4091 case GL_LINE_SMOOTH_HINT
:
4092 params
[0] = ENUM_TO_INT(ctx
->Hint
.LineSmooth
);
4094 case GL_LINE_STIPPLE
:
4095 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.StippleFlag
);
4097 case GL_LINE_STIPPLE_PATTERN
:
4098 params
[0] = ctx
->Line
.StipplePattern
;
4100 case GL_LINE_STIPPLE_REPEAT
:
4101 params
[0] = ctx
->Line
.StippleFactor
;
4104 params
[0] = IROUND(ctx
->Line
.Width
);
4106 case GL_LINE_WIDTH_GRANULARITY
:
4107 params
[0] = IROUND(ctx
->Const
.LineWidthGranularity
);
4109 case GL_LINE_WIDTH_RANGE
:
4110 params
[0] = IROUND(ctx
->Const
.MinLineWidthAA
);
4111 params
[1] = IROUND(ctx
->Const
.MaxLineWidthAA
);
4113 case GL_ALIASED_LINE_WIDTH_RANGE
:
4114 params
[0] = IROUND(ctx
->Const
.MinLineWidth
);
4115 params
[1] = IROUND(ctx
->Const
.MaxLineWidth
);
4118 params
[0] = ctx
->List
.ListBase
;
4121 params
[0] = ctx
->ListState
.CurrentListNum
;
4126 if (!ctx
->CompileFlag
)
4128 else if (ctx
->ExecuteFlag
)
4129 mode
= GL_COMPILE_AND_EXECUTE
;
4132 params
[0] = ENUM_TO_INT(mode
);
4135 case GL_INDEX_LOGIC_OP
:
4136 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.IndexLogicOpEnabled
);
4138 case GL_COLOR_LOGIC_OP
:
4139 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.ColorLogicOpEnabled
);
4141 case GL_LOGIC_OP_MODE
:
4142 params
[0] = ENUM_TO_INT(ctx
->Color
.LogicOp
);
4144 case GL_MAP1_COLOR_4
:
4145 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Color4
);
4147 case GL_MAP1_GRID_DOMAIN
:
4148 params
[0] = IROUND(ctx
->Eval
.MapGrid1u1
);
4149 params
[1] = IROUND(ctx
->Eval
.MapGrid1u2
);
4151 case GL_MAP1_GRID_SEGMENTS
:
4152 params
[0] = ctx
->Eval
.MapGrid1un
;
4155 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Index
);
4157 case GL_MAP1_NORMAL
:
4158 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Normal
);
4160 case GL_MAP1_TEXTURE_COORD_1
:
4161 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord1
);
4163 case GL_MAP1_TEXTURE_COORD_2
:
4164 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord2
);
4166 case GL_MAP1_TEXTURE_COORD_3
:
4167 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord3
);
4169 case GL_MAP1_TEXTURE_COORD_4
:
4170 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord4
);
4172 case GL_MAP1_VERTEX_3
:
4173 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex3
);
4175 case GL_MAP1_VERTEX_4
:
4176 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex4
);
4178 case GL_MAP2_COLOR_4
:
4179 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Color4
);
4181 case GL_MAP2_GRID_DOMAIN
:
4182 params
[0] = IROUND(ctx
->Eval
.MapGrid2u1
);
4183 params
[1] = IROUND(ctx
->Eval
.MapGrid2u2
);
4184 params
[2] = IROUND(ctx
->Eval
.MapGrid2v1
);
4185 params
[3] = IROUND(ctx
->Eval
.MapGrid2v2
);
4187 case GL_MAP2_GRID_SEGMENTS
:
4188 params
[0] = ctx
->Eval
.MapGrid2un
;
4189 params
[1] = ctx
->Eval
.MapGrid2vn
;
4192 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Index
);
4194 case GL_MAP2_NORMAL
:
4195 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Normal
);
4197 case GL_MAP2_TEXTURE_COORD_1
:
4198 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord1
);
4200 case GL_MAP2_TEXTURE_COORD_2
:
4201 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord2
);
4203 case GL_MAP2_TEXTURE_COORD_3
:
4204 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord3
);
4206 case GL_MAP2_TEXTURE_COORD_4
:
4207 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord4
);
4209 case GL_MAP2_VERTEX_3
:
4210 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex3
);
4212 case GL_MAP2_VERTEX_4
:
4213 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex4
);
4216 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapColorFlag
);
4218 case GL_MAP_STENCIL
:
4219 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapStencilFlag
);
4221 case GL_MATRIX_MODE
:
4222 params
[0] = ENUM_TO_INT(ctx
->Transform
.MatrixMode
);
4224 case GL_MAX_ATTRIB_STACK_DEPTH
:
4225 params
[0] = MAX_ATTRIB_STACK_DEPTH
;
4227 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
4228 params
[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH
;
4230 case GL_MAX_CLIP_PLANES
:
4231 params
[0] = ctx
->Const
.MaxClipPlanes
;
4233 case GL_MAX_ELEMENTS_VERTICES
:
4234 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4236 case GL_MAX_ELEMENTS_INDICES
:
4237 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4239 case GL_MAX_EVAL_ORDER
:
4240 params
[0] = MAX_EVAL_ORDER
;
4243 params
[0] = ctx
->Const
.MaxLights
;
4245 case GL_MAX_LIST_NESTING
:
4246 params
[0] = MAX_LIST_NESTING
;
4248 case GL_MAX_MODELVIEW_STACK_DEPTH
:
4249 params
[0] = MAX_MODELVIEW_STACK_DEPTH
;
4251 case GL_MAX_NAME_STACK_DEPTH
:
4252 params
[0] = MAX_NAME_STACK_DEPTH
;
4254 case GL_MAX_PIXEL_MAP_TABLE
:
4255 params
[0] = MAX_PIXEL_MAP_TABLE
;
4257 case GL_MAX_PROJECTION_STACK_DEPTH
:
4258 params
[0] = MAX_PROJECTION_STACK_DEPTH
;
4260 case GL_MAX_TEXTURE_SIZE
:
4261 params
[0] = 1 << (ctx
->Const
.MaxTextureLevels
- 1);
4263 case GL_MAX_3D_TEXTURE_SIZE
:
4264 params
[0] = 1 << (ctx
->Const
.Max3DTextureLevels
- 1);
4266 case GL_MAX_TEXTURE_STACK_DEPTH
:
4267 params
[0] = MAX_TEXTURE_STACK_DEPTH
;
4269 case GL_MAX_VIEWPORT_DIMS
:
4270 params
[0] = ctx
->Const
.MaxViewportWidth
;
4271 params
[1] = ctx
->Const
.MaxViewportHeight
;
4273 case GL_MODELVIEW_MATRIX
:
4275 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4276 params
[0] = IROUND(matrix
[0]);
4277 params
[1] = IROUND(matrix
[1]);
4278 params
[2] = IROUND(matrix
[2]);
4279 params
[3] = IROUND(matrix
[3]);
4280 params
[4] = IROUND(matrix
[4]);
4281 params
[5] = IROUND(matrix
[5]);
4282 params
[6] = IROUND(matrix
[6]);
4283 params
[7] = IROUND(matrix
[7]);
4284 params
[8] = IROUND(matrix
[8]);
4285 params
[9] = IROUND(matrix
[9]);
4286 params
[10] = IROUND(matrix
[10]);
4287 params
[11] = IROUND(matrix
[11]);
4288 params
[12] = IROUND(matrix
[12]);
4289 params
[13] = IROUND(matrix
[13]);
4290 params
[14] = IROUND(matrix
[14]);
4291 params
[15] = IROUND(matrix
[15]);
4294 case GL_MODELVIEW_STACK_DEPTH
:
4295 params
[0] = ctx
->ModelviewMatrixStack
.Depth
+ 1;
4297 case GL_NAME_STACK_DEPTH
:
4298 params
[0] = ctx
->Select
.NameStackDepth
;
4301 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.Normalize
);
4303 case GL_PACK_ALIGNMENT
:
4304 params
[0] = ctx
->Pack
.Alignment
;
4306 case GL_PACK_LSB_FIRST
:
4307 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.LsbFirst
);
4309 case GL_PACK_ROW_LENGTH
:
4310 params
[0] = ctx
->Pack
.RowLength
;
4312 case GL_PACK_SKIP_PIXELS
:
4313 params
[0] = ctx
->Pack
.SkipPixels
;
4315 case GL_PACK_SKIP_ROWS
:
4316 params
[0] = ctx
->Pack
.SkipRows
;
4318 case GL_PACK_SWAP_BYTES
:
4319 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.SwapBytes
);
4321 case GL_PACK_SKIP_IMAGES_EXT
:
4322 params
[0] = ctx
->Pack
.SkipImages
;
4324 case GL_PACK_IMAGE_HEIGHT_EXT
:
4325 params
[0] = ctx
->Pack
.ImageHeight
;
4327 case GL_PACK_INVERT_MESA
:
4328 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.Invert
);
4330 case GL_PERSPECTIVE_CORRECTION_HINT
:
4331 params
[0] = ENUM_TO_INT(ctx
->Hint
.PerspectiveCorrection
);
4333 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4334 params
[0] = ctx
->Pixel
.MapAtoAsize
;
4336 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4337 params
[0] = ctx
->Pixel
.MapBtoBsize
;
4339 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4340 params
[0] = ctx
->Pixel
.MapGtoGsize
;
4342 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4343 params
[0] = ctx
->Pixel
.MapItoAsize
;
4345 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4346 params
[0] = ctx
->Pixel
.MapItoBsize
;
4348 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4349 params
[0] = ctx
->Pixel
.MapItoGsize
;
4351 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4352 params
[0] = ctx
->Pixel
.MapItoIsize
;
4354 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4355 params
[0] = ctx
->Pixel
.MapItoRsize
;
4357 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4358 params
[0] = ctx
->Pixel
.MapRtoRsize
;
4360 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4361 params
[0] = ctx
->Pixel
.MapStoSsize
;
4364 params
[0] = IROUND(ctx
->Point
.Size
);
4366 case GL_POINT_SIZE_GRANULARITY
:
4367 params
[0] = IROUND(ctx
->Const
.PointSizeGranularity
);
4369 case GL_POINT_SIZE_RANGE
:
4370 params
[0] = IROUND(ctx
->Const
.MinPointSizeAA
);
4371 params
[1] = IROUND(ctx
->Const
.MaxPointSizeAA
);
4373 case GL_ALIASED_POINT_SIZE_RANGE
:
4374 params
[0] = IROUND(ctx
->Const
.MinPointSize
);
4375 params
[1] = IROUND(ctx
->Const
.MaxPointSize
);
4377 case GL_POINT_SMOOTH
:
4378 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.SmoothFlag
);
4380 case GL_POINT_SMOOTH_HINT
:
4381 params
[0] = ENUM_TO_INT(ctx
->Hint
.PointSmooth
);
4383 case GL_POINT_SIZE_MIN_EXT
:
4384 params
[0] = IROUND(ctx
->Point
.MinSize
);
4386 case GL_POINT_SIZE_MAX_EXT
:
4387 params
[0] = IROUND(ctx
->Point
.MaxSize
);
4389 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4390 params
[0] = IROUND(ctx
->Point
.Threshold
);
4392 case GL_DISTANCE_ATTENUATION_EXT
:
4393 params
[0] = IROUND(ctx
->Point
.Params
[0]);
4394 params
[1] = IROUND(ctx
->Point
.Params
[1]);
4395 params
[2] = IROUND(ctx
->Point
.Params
[2]);
4397 case GL_POLYGON_MODE
:
4398 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontMode
);
4399 params
[1] = ENUM_TO_INT(ctx
->Polygon
.BackMode
);
4401 case GL_POLYGON_OFFSET_BIAS_EXT
:
4402 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4404 case GL_POLYGON_OFFSET_FACTOR
:
4405 params
[0] = IROUND(ctx
->Polygon
.OffsetFactor
);
4407 case GL_POLYGON_OFFSET_UNITS
:
4408 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4410 case GL_POLYGON_SMOOTH
:
4411 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.SmoothFlag
);
4413 case GL_POLYGON_SMOOTH_HINT
:
4414 params
[0] = ENUM_TO_INT(ctx
->Hint
.PolygonSmooth
);
4416 case GL_POLYGON_STIPPLE
:
4417 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.StippleFlag
);
4419 case GL_PROJECTION_MATRIX
:
4421 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4422 params
[0] = IROUND(matrix
[0]);
4423 params
[1] = IROUND(matrix
[1]);
4424 params
[2] = IROUND(matrix
[2]);
4425 params
[3] = IROUND(matrix
[3]);
4426 params
[4] = IROUND(matrix
[4]);
4427 params
[5] = IROUND(matrix
[5]);
4428 params
[6] = IROUND(matrix
[6]);
4429 params
[7] = IROUND(matrix
[7]);
4430 params
[8] = IROUND(matrix
[8]);
4431 params
[9] = IROUND(matrix
[9]);
4432 params
[10] = IROUND(matrix
[10]);
4433 params
[11] = IROUND(matrix
[11]);
4434 params
[12] = IROUND(matrix
[12]);
4435 params
[13] = IROUND(matrix
[13]);
4436 params
[14] = IROUND(matrix
[14]);
4437 params
[15] = IROUND(matrix
[15]);
4440 case GL_PROJECTION_STACK_DEPTH
:
4441 params
[0] = ctx
->ProjectionMatrixStack
.Depth
+ 1;
4443 case GL_READ_BUFFER
:
4444 params
[0] = ENUM_TO_INT(ctx
->ReadBuffer
->ColorReadBuffer
);
4447 params
[0] = IROUND(ctx
->Pixel
.RedBias
);
4450 params
[0] = ctx
->DrawBuffer
->Visual
.redBits
;
4453 params
[0] = IROUND(ctx
->Pixel
.RedScale
);
4455 case GL_RENDER_MODE
:
4456 params
[0] = ENUM_TO_INT(ctx
->RenderMode
);
4458 case GL_RESCALE_NORMAL
:
4459 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RescaleNormals
);
4462 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.rgbMode
);
4464 case GL_SCISSOR_BOX
:
4465 params
[0] = ctx
->Scissor
.X
;
4466 params
[1] = ctx
->Scissor
.Y
;
4467 params
[2] = ctx
->Scissor
.Width
;
4468 params
[3] = ctx
->Scissor
.Height
;
4470 case GL_SCISSOR_TEST
:
4471 params
[0] = BOOLEAN_TO_INT(ctx
->Scissor
.Enabled
);
4473 case GL_SELECTION_BUFFER_SIZE
:
4474 params
[0] = ctx
->Select
.BufferSize
;
4476 case GL_SHADE_MODEL
:
4477 params
[0] = ENUM_TO_INT(ctx
->Light
.ShadeModel
);
4479 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4480 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.SharedPalette
);
4482 case GL_STENCIL_BITS
:
4483 params
[0] = ctx
->DrawBuffer
->Visual
.stencilBits
;
4485 case GL_STENCIL_CLEAR_VALUE
:
4486 params
[0] = ctx
->Stencil
.Clear
;
4488 case GL_STENCIL_FAIL
:
4489 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
4491 case GL_STENCIL_FUNC
:
4492 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
4494 case GL_STENCIL_PASS_DEPTH_FAIL
:
4495 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
4497 case GL_STENCIL_PASS_DEPTH_PASS
:
4498 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
4500 case GL_STENCIL_REF
:
4501 params
[0] = ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
4503 case GL_STENCIL_TEST
:
4504 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.Enabled
);
4506 case GL_STENCIL_VALUE_MASK
:
4507 params
[0] = ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
4509 case GL_STENCIL_WRITEMASK
:
4510 params
[0] = ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
4513 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.stereoMode
);
4515 case GL_SUBPIXEL_BITS
:
4516 params
[0] = ctx
->Const
.SubPixelBits
;
4519 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D
));
4522 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D
));
4525 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D
));
4527 case GL_TEXTURE_BINDING_1D
:
4528 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
;
4530 case GL_TEXTURE_BINDING_2D
:
4531 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
;
4533 case GL_TEXTURE_BINDING_3D
:
4534 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
;
4536 case GL_TEXTURE_ENV_COLOR
:
4538 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
4539 params
[0] = FLOAT_TO_INT(color
[0]);
4540 params
[1] = FLOAT_TO_INT(color
[1]);
4541 params
[2] = FLOAT_TO_INT(color
[2]);
4542 params
[3] = FLOAT_TO_INT(color
[3]);
4545 case GL_TEXTURE_ENV_MODE
:
4546 params
[0] = ENUM_TO_INT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
4548 case GL_TEXTURE_GEN_S
:
4549 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
4551 case GL_TEXTURE_GEN_T
:
4552 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
4554 case GL_TEXTURE_GEN_R
:
4555 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
4557 case GL_TEXTURE_GEN_Q
:
4558 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
4560 case GL_TEXTURE_MATRIX
:
4562 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
4563 params
[0] = IROUND(matrix
[0]);
4564 params
[1] = IROUND(matrix
[1]);
4565 params
[2] = IROUND(matrix
[2]);
4566 params
[3] = IROUND(matrix
[3]);
4567 params
[4] = IROUND(matrix
[4]);
4568 params
[5] = IROUND(matrix
[5]);
4569 params
[6] = IROUND(matrix
[6]);
4570 params
[7] = IROUND(matrix
[7]);
4571 params
[8] = IROUND(matrix
[8]);
4572 params
[9] = IROUND(matrix
[9]);
4573 params
[10] = IROUND(matrix
[10]);
4574 params
[11] = IROUND(matrix
[11]);
4575 params
[12] = IROUND(matrix
[12]);
4576 params
[13] = IROUND(matrix
[13]);
4577 params
[14] = IROUND(matrix
[14]);
4578 params
[15] = IROUND(matrix
[15]);
4581 case GL_TEXTURE_STACK_DEPTH
:
4582 params
[0] = ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1;
4584 case GL_UNPACK_ALIGNMENT
:
4585 params
[0] = ctx
->Unpack
.Alignment
;
4587 case GL_UNPACK_LSB_FIRST
:
4588 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.LsbFirst
);
4590 case GL_UNPACK_ROW_LENGTH
:
4591 params
[0] = ctx
->Unpack
.RowLength
;
4593 case GL_UNPACK_SKIP_PIXELS
:
4594 params
[0] = ctx
->Unpack
.SkipPixels
;
4596 case GL_UNPACK_SKIP_ROWS
:
4597 params
[0] = ctx
->Unpack
.SkipRows
;
4599 case GL_UNPACK_SWAP_BYTES
:
4600 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.SwapBytes
);
4602 case GL_UNPACK_SKIP_IMAGES_EXT
:
4603 params
[0] = ctx
->Unpack
.SkipImages
;
4605 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4606 params
[0] = ctx
->Unpack
.ImageHeight
;
4608 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
4609 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.ClientStorage
);
4612 params
[0] = ctx
->Viewport
.X
;
4613 params
[1] = ctx
->Viewport
.Y
;
4614 params
[2] = ctx
->Viewport
.Width
;
4615 params
[3] = ctx
->Viewport
.Height
;
4618 params
[0] = IROUND(ctx
->Pixel
.ZoomX
);
4621 params
[0] = IROUND(ctx
->Pixel
.ZoomY
);
4623 case GL_VERTEX_ARRAY
:
4624 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
4626 case GL_VERTEX_ARRAY_SIZE
:
4627 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Size
;
4629 case GL_VERTEX_ARRAY_TYPE
:
4630 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
4632 case GL_VERTEX_ARRAY_STRIDE
:
4633 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Stride
;
4635 case GL_VERTEX_ARRAY_COUNT_EXT
:
4638 case GL_NORMAL_ARRAY
:
4639 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
4641 case GL_NORMAL_ARRAY_TYPE
:
4642 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Type
);
4644 case GL_NORMAL_ARRAY_STRIDE
:
4645 params
[0] = ctx
->Array
.ArrayObj
->Normal
.Stride
;
4647 case GL_NORMAL_ARRAY_COUNT_EXT
:
4650 case GL_COLOR_ARRAY
:
4651 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
4653 case GL_COLOR_ARRAY_SIZE
:
4654 params
[0] = ctx
->Array
.ArrayObj
->Color
.Size
;
4656 case GL_COLOR_ARRAY_TYPE
:
4657 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Color
.Type
);
4659 case GL_COLOR_ARRAY_STRIDE
:
4660 params
[0] = ctx
->Array
.ArrayObj
->Color
.Stride
;
4662 case GL_COLOR_ARRAY_COUNT_EXT
:
4665 case GL_INDEX_ARRAY
:
4666 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
4668 case GL_INDEX_ARRAY_TYPE
:
4669 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Index
.Type
);
4671 case GL_INDEX_ARRAY_STRIDE
:
4672 params
[0] = ctx
->Array
.ArrayObj
->Index
.Stride
;
4674 case GL_INDEX_ARRAY_COUNT_EXT
:
4677 case GL_TEXTURE_COORD_ARRAY
:
4678 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
4680 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4681 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
;
4683 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4684 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
4686 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4687 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
;
4689 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4692 case GL_EDGE_FLAG_ARRAY
:
4693 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
4695 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4696 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
;
4698 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4701 case GL_MAX_TEXTURE_UNITS_ARB
:
4702 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4703 params
[0] = ctx
->Const
.MaxTextureUnits
;
4705 case GL_ACTIVE_TEXTURE_ARB
:
4706 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4707 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4709 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4710 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4711 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4713 case GL_TEXTURE_CUBE_MAP_ARB
:
4714 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4715 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
4717 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4718 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4719 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
;
4721 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4722 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4723 params
[0] = (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
4725 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4726 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4727 params
[0] = ctx
->Hint
.TextureCompression
;
4729 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4730 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4731 params
[0] = _mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
);
4733 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4734 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4737 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
4739 for (i
= 0; i
< n
; i
++)
4740 params
[i
] = ENUM_TO_INT(formats
[i
]);
4743 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4744 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4745 params
[0] = ctx
->Array
.LockFirst
;
4747 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4748 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4749 params
[0] = ctx
->Array
.LockCount
;
4751 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4753 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4754 params
[0] = IROUND(matrix
[0]);
4755 params
[1] = IROUND(matrix
[4]);
4756 params
[2] = IROUND(matrix
[8]);
4757 params
[3] = IROUND(matrix
[12]);
4758 params
[4] = IROUND(matrix
[1]);
4759 params
[5] = IROUND(matrix
[5]);
4760 params
[6] = IROUND(matrix
[9]);
4761 params
[7] = IROUND(matrix
[13]);
4762 params
[8] = IROUND(matrix
[2]);
4763 params
[9] = IROUND(matrix
[6]);
4764 params
[10] = IROUND(matrix
[10]);
4765 params
[11] = IROUND(matrix
[14]);
4766 params
[12] = IROUND(matrix
[3]);
4767 params
[13] = IROUND(matrix
[7]);
4768 params
[14] = IROUND(matrix
[11]);
4769 params
[15] = IROUND(matrix
[15]);
4772 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4774 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4775 params
[0] = IROUND(matrix
[0]);
4776 params
[1] = IROUND(matrix
[4]);
4777 params
[2] = IROUND(matrix
[8]);
4778 params
[3] = IROUND(matrix
[12]);
4779 params
[4] = IROUND(matrix
[1]);
4780 params
[5] = IROUND(matrix
[5]);
4781 params
[6] = IROUND(matrix
[9]);
4782 params
[7] = IROUND(matrix
[13]);
4783 params
[8] = IROUND(matrix
[2]);
4784 params
[9] = IROUND(matrix
[6]);
4785 params
[10] = IROUND(matrix
[10]);
4786 params
[11] = IROUND(matrix
[14]);
4787 params
[12] = IROUND(matrix
[3]);
4788 params
[13] = IROUND(matrix
[7]);
4789 params
[14] = IROUND(matrix
[11]);
4790 params
[15] = IROUND(matrix
[15]);
4793 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4795 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4796 params
[0] = IROUND(matrix
[0]);
4797 params
[1] = IROUND(matrix
[4]);
4798 params
[2] = IROUND(matrix
[8]);
4799 params
[3] = IROUND(matrix
[12]);
4800 params
[4] = IROUND(matrix
[1]);
4801 params
[5] = IROUND(matrix
[5]);
4802 params
[6] = IROUND(matrix
[9]);
4803 params
[7] = IROUND(matrix
[13]);
4804 params
[8] = IROUND(matrix
[2]);
4805 params
[9] = IROUND(matrix
[6]);
4806 params
[10] = IROUND(matrix
[10]);
4807 params
[11] = IROUND(matrix
[14]);
4808 params
[12] = IROUND(matrix
[3]);
4809 params
[13] = IROUND(matrix
[7]);
4810 params
[14] = IROUND(matrix
[11]);
4811 params
[15] = IROUND(matrix
[15]);
4814 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4816 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
4817 params
[0] = IROUND(matrix
[0]);
4818 params
[1] = IROUND(matrix
[4]);
4819 params
[2] = IROUND(matrix
[8]);
4820 params
[3] = IROUND(matrix
[12]);
4821 params
[4] = IROUND(matrix
[1]);
4822 params
[5] = IROUND(matrix
[5]);
4823 params
[6] = IROUND(matrix
[9]);
4824 params
[7] = IROUND(matrix
[13]);
4825 params
[8] = IROUND(matrix
[2]);
4826 params
[9] = IROUND(matrix
[6]);
4827 params
[10] = IROUND(matrix
[10]);
4828 params
[11] = IROUND(matrix
[14]);
4829 params
[12] = IROUND(matrix
[3]);
4830 params
[13] = IROUND(matrix
[7]);
4831 params
[14] = IROUND(matrix
[11]);
4832 params
[15] = IROUND(matrix
[15]);
4835 case GL_COLOR_MATRIX_SGI
:
4837 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4838 params
[0] = IROUND(matrix
[0]);
4839 params
[1] = IROUND(matrix
[1]);
4840 params
[2] = IROUND(matrix
[2]);
4841 params
[3] = IROUND(matrix
[3]);
4842 params
[4] = IROUND(matrix
[4]);
4843 params
[5] = IROUND(matrix
[5]);
4844 params
[6] = IROUND(matrix
[6]);
4845 params
[7] = IROUND(matrix
[7]);
4846 params
[8] = IROUND(matrix
[8]);
4847 params
[9] = IROUND(matrix
[9]);
4848 params
[10] = IROUND(matrix
[10]);
4849 params
[11] = IROUND(matrix
[11]);
4850 params
[12] = IROUND(matrix
[12]);
4851 params
[13] = IROUND(matrix
[13]);
4852 params
[14] = IROUND(matrix
[14]);
4853 params
[15] = IROUND(matrix
[15]);
4856 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4857 params
[0] = ctx
->ColorMatrixStack
.Depth
+ 1;
4859 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4860 params
[0] = MAX_COLOR_STACK_DEPTH
;
4862 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4863 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[0]);
4865 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4866 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[1]);
4868 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4869 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[2]);
4871 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4872 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[3]);
4874 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4875 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[0]);
4877 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4878 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[1]);
4880 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4881 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[2]);
4883 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4884 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[3]);
4886 case GL_CONVOLUTION_1D_EXT
:
4887 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4888 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution1DEnabled
);
4890 case GL_CONVOLUTION_2D_EXT
:
4891 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4892 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution2DEnabled
);
4894 case GL_SEPARABLE_2D_EXT
:
4895 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4896 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Separable2DEnabled
);
4898 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4899 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4900 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[0]);
4902 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4903 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4904 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[1]);
4906 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
4907 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4908 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[2]);
4910 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
4911 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4912 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[3]);
4914 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
4915 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4916 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[0]);
4918 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
4919 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4920 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[1]);
4922 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
4923 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4924 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[2]);
4926 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
4927 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4928 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[3]);
4931 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
4932 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.HistogramEnabled
);
4935 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
4936 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MinMaxEnabled
);
4938 case GL_COLOR_TABLE_SGI
:
4939 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
4940 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
);
4942 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
4943 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
4944 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.PostConvolutionColorTableEnabled
);
4946 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
4947 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
4948 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.PostColorMatrixColorTableEnabled
);
4950 case GL_TEXTURE_COLOR_TABLE_SGI
:
4951 CHECK_EXT1(SGI_texture_color_table
, "GetIntegerv");
4952 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
4954 case GL_COLOR_SUM_EXT
:
4955 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetIntegerv");
4956 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.ColorSumEnabled
);
4958 case GL_CURRENT_SECONDARY_COLOR_EXT
:
4959 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
4961 FLUSH_CURRENT(ctx
, 0);
4962 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
4963 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
4964 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
4965 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
4968 case GL_SECONDARY_COLOR_ARRAY_EXT
:
4969 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
4970 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
4972 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
4973 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
4974 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
4976 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
4977 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
4978 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
;
4980 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
4981 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
4982 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Size
;
4984 case GL_CURRENT_FOG_COORDINATE_EXT
:
4985 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
4987 FLUSH_CURRENT(ctx
, 0);
4988 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
4991 case GL_FOG_COORDINATE_ARRAY_EXT
:
4992 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
4993 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
4995 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
4996 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
4997 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
4999 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
5000 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5001 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Stride
;
5003 case GL_FOG_COORDINATE_SOURCE_EXT
:
5004 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5005 params
[0] = ENUM_TO_INT(ctx
->Fog
.FogCoordinateSource
);
5007 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
5008 CHECK_EXT1(EXT_texture_lod_bias
, "GetIntegerv");
5009 params
[0] = IROUND(ctx
->Const
.MaxTextureLodBias
);
5011 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
5012 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetIntegerv");
5013 params
[0] = IROUND(ctx
->Const
.MaxTextureMaxAnisotropy
);
5015 case GL_MULTISAMPLE_ARB
:
5016 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5017 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.Enabled
);
5019 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
5020 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5021 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToCoverage
);
5023 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
5024 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5025 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToOne
);
5027 case GL_SAMPLE_COVERAGE_ARB
:
5028 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5029 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverage
);
5031 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
5032 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5033 params
[0] = IROUND(ctx
->Multisample
.SampleCoverageValue
);
5035 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
5036 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5037 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverageInvert
);
5039 case GL_SAMPLE_BUFFERS_ARB
:
5040 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5041 params
[0] = ctx
->DrawBuffer
->Visual
.sampleBuffers
;
5043 case GL_SAMPLES_ARB
:
5044 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5045 params
[0] = ctx
->DrawBuffer
->Visual
.samples
;
5047 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
5048 CHECK_EXT1(IBM_rasterpos_clip
, "GetIntegerv");
5049 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RasterPositionUnclipped
);
5051 case GL_POINT_SPRITE_NV
:
5052 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5053 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.PointSprite
);
5055 case GL_POINT_SPRITE_R_MODE_NV
:
5056 CHECK_EXT1(NV_point_sprite
, "GetIntegerv");
5057 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteRMode
);
5059 case GL_POINT_SPRITE_COORD_ORIGIN
:
5060 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5061 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteOrigin
);
5063 case GL_GENERATE_MIPMAP_HINT_SGIS
:
5064 CHECK_EXT1(SGIS_generate_mipmap
, "GetIntegerv");
5065 params
[0] = ENUM_TO_INT(ctx
->Hint
.GenerateMipmap
);
5067 case GL_VERTEX_PROGRAM_BINDING_NV
:
5068 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5069 params
[0] = (ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0);
5071 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
5072 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5073 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
5075 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
5076 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5077 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
5079 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
5080 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5081 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
5083 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
5084 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5085 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
5087 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
5088 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5089 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
5091 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
5092 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5093 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
5095 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
5096 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5097 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
5099 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
5100 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5101 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
5103 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
5104 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5105 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
5107 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
5108 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5109 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
5111 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
5112 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5113 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
5115 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
5116 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5117 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
5119 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
5120 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5121 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
5123 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
5124 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5125 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
5127 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
5128 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5129 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
5131 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
5132 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5133 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
5135 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
5136 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5137 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[0]);
5139 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
5140 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5141 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[1]);
5143 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
5144 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5145 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[2]);
5147 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
5148 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5149 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[3]);
5151 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
5152 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5153 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[4]);
5155 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
5156 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5157 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[5]);
5159 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
5160 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5161 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[6]);
5163 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
5164 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5165 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[7]);
5167 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
5168 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5169 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[8]);
5171 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
5172 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5173 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[9]);
5175 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
5176 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5177 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[10]);
5179 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
5180 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5181 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[11]);
5183 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
5184 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5185 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[12]);
5187 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
5188 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5189 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[13]);
5191 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
5192 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5193 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[14]);
5195 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
5196 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5197 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[15]);
5199 case GL_FRAGMENT_PROGRAM_NV
:
5200 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5201 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5203 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
5204 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5205 params
[0] = ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0;
5207 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
5208 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5209 params
[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
5211 case GL_TEXTURE_RECTANGLE_NV
:
5212 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5213 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
5215 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
5216 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5217 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
;
5219 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
5220 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5221 params
[0] = ctx
->Const
.MaxTextureRectSize
;
5223 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
5224 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5225 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.TestTwoSide
);
5227 case GL_ACTIVE_STENCIL_FACE_EXT
:
5228 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5229 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
5231 case GL_MAX_SHININESS_NV
:
5232 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5233 params
[0] = IROUND(ctx
->Const
.MaxShininess
);
5235 case GL_MAX_SPOT_EXPONENT_NV
:
5236 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5237 params
[0] = IROUND(ctx
->Const
.MaxSpotExponent
);
5239 case GL_ARRAY_BUFFER_BINDING_ARB
:
5240 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5241 params
[0] = ctx
->Array
.ArrayBufferObj
->Name
;
5243 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
5244 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5245 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
;
5247 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
5248 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5249 params
[0] = ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
;
5251 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5252 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5253 params
[0] = ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
;
5255 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
5256 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5257 params
[0] = ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
;
5259 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
5260 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5261 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
;
5263 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
5264 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5265 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
;
5267 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5268 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5269 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
;
5271 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
5272 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5273 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
;
5275 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
5276 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5277 params
[0] = ctx
->Array
.ElementArrayBufferObj
->Name
;
5279 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
5280 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5281 params
[0] = ctx
->Pack
.BufferObj
->Name
;
5283 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
5284 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5285 params
[0] = ctx
->Unpack
.BufferObj
->Name
;
5287 case GL_VERTEX_PROGRAM_ARB
:
5288 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5289 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.Enabled
);
5291 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
5292 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5293 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.PointSizeEnabled
);
5295 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
5296 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5297 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.TwoSideEnabled
);
5299 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
5300 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5301 params
[0] = ctx
->Const
.MaxProgramMatrixStackDepth
;
5303 case GL_MAX_PROGRAM_MATRICES_ARB
:
5304 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5305 params
[0] = ctx
->Const
.MaxProgramMatrices
;
5307 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
5308 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5309 params
[0] = BOOLEAN_TO_INT(ctx
->CurrentStack
->Depth
+ 1);
5311 case GL_CURRENT_MATRIX_ARB
:
5312 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5314 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5315 params
[0] = IROUND(matrix
[0]);
5316 params
[1] = IROUND(matrix
[1]);
5317 params
[2] = IROUND(matrix
[2]);
5318 params
[3] = IROUND(matrix
[3]);
5319 params
[4] = IROUND(matrix
[4]);
5320 params
[5] = IROUND(matrix
[5]);
5321 params
[6] = IROUND(matrix
[6]);
5322 params
[7] = IROUND(matrix
[7]);
5323 params
[8] = IROUND(matrix
[8]);
5324 params
[9] = IROUND(matrix
[9]);
5325 params
[10] = IROUND(matrix
[10]);
5326 params
[11] = IROUND(matrix
[11]);
5327 params
[12] = IROUND(matrix
[12]);
5328 params
[13] = IROUND(matrix
[13]);
5329 params
[14] = IROUND(matrix
[14]);
5330 params
[15] = IROUND(matrix
[15]);
5333 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
5334 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetIntegerv");
5336 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5337 params
[0] = IROUND(matrix
[0]);
5338 params
[1] = IROUND(matrix
[4]);
5339 params
[2] = IROUND(matrix
[8]);
5340 params
[3] = IROUND(matrix
[12]);
5341 params
[4] = IROUND(matrix
[1]);
5342 params
[5] = IROUND(matrix
[5]);
5343 params
[6] = IROUND(matrix
[9]);
5344 params
[7] = IROUND(matrix
[13]);
5345 params
[8] = IROUND(matrix
[2]);
5346 params
[9] = IROUND(matrix
[6]);
5347 params
[10] = IROUND(matrix
[10]);
5348 params
[11] = IROUND(matrix
[14]);
5349 params
[12] = IROUND(matrix
[3]);
5350 params
[13] = IROUND(matrix
[7]);
5351 params
[14] = IROUND(matrix
[11]);
5352 params
[15] = IROUND(matrix
[15]);
5355 case GL_MAX_VERTEX_ATTRIBS_ARB
:
5356 CHECK_EXT1(ARB_vertex_program
, "GetIntegerv");
5357 params
[0] = ctx
->Const
.VertexProgram
.MaxAttribs
;
5359 case GL_PROGRAM_ERROR_POSITION_ARB
:
5360 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetIntegerv");
5361 params
[0] = ctx
->Program
.ErrorPos
;
5363 case GL_FRAGMENT_PROGRAM_ARB
:
5364 CHECK_EXT1(ARB_fragment_program
, "GetIntegerv");
5365 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5367 case GL_MAX_TEXTURE_COORDS_ARB
:
5368 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5369 params
[0] = ctx
->Const
.MaxTextureCoordUnits
;
5371 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
5372 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5373 params
[0] = ctx
->Const
.MaxTextureImageUnits
;
5375 case GL_DEPTH_BOUNDS_TEST_EXT
:
5376 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5377 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.BoundsTest
);
5379 case GL_DEPTH_BOUNDS_EXT
:
5380 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5381 params
[0] = IROUND(ctx
->Depth
.BoundsMin
);
5382 params
[1] = IROUND(ctx
->Depth
.BoundsMax
);
5384 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
5385 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5386 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.CallbackEnabled
);
5388 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
5389 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5390 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.CallbackEnabled
);
5392 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
5393 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5394 params
[0] = ctx
->FragmentProgram
.CurrentPosition
;
5396 case GL_VERTEX_PROGRAM_POSITION_MESA
:
5397 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5398 params
[0] = ctx
->VertexProgram
.CurrentPosition
;
5400 case GL_MAX_DRAW_BUFFERS_ARB
:
5401 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5402 params
[0] = ctx
->Const
.MaxDrawBuffers
;
5404 case GL_DRAW_BUFFER0_ARB
:
5405 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5406 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
5408 case GL_DRAW_BUFFER1_ARB
:
5409 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5412 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5413 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5416 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
5417 params
[0] = ENUM_TO_INT(buffer
);
5420 case GL_DRAW_BUFFER2_ARB
:
5421 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5424 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5425 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5428 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
5429 params
[0] = ENUM_TO_INT(buffer
);
5432 case GL_DRAW_BUFFER3_ARB
:
5433 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5436 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5437 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5440 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
5441 params
[0] = ENUM_TO_INT(buffer
);
5444 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
5445 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5446 params
[0] = ctx
->Const
.ColorReadType
;
5448 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
5449 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5450 params
[0] = ctx
->Const
.ColorReadFormat
;
5452 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
5453 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5456 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
5457 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5460 case GL_NUM_PASSES_ATI
:
5461 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5464 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
5465 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5468 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
5469 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5472 case GL_COLOR_ALPHA_PAIRING_ATI
:
5473 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5474 params
[0] = BOOLEAN_TO_INT(GL_TRUE
);
5476 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
5477 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5480 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
5481 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5484 case GL_STENCIL_BACK_FUNC
:
5485 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[1]);
5487 case GL_STENCIL_BACK_VALUE_MASK
:
5488 params
[0] = ctx
->Stencil
.ValueMask
[1];
5490 case GL_STENCIL_BACK_WRITEMASK
:
5491 params
[0] = ctx
->Stencil
.WriteMask
[1];
5493 case GL_STENCIL_BACK_REF
:
5494 params
[0] = ctx
->Stencil
.Ref
[1];
5496 case GL_STENCIL_BACK_FAIL
:
5497 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[1]);
5499 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
5500 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[1]);
5502 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
5503 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[1]);
5505 case GL_FRAMEBUFFER_BINDING_EXT
:
5506 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5507 params
[0] = ctx
->DrawBuffer
->Name
;
5509 case GL_RENDERBUFFER_BINDING_EXT
:
5510 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5511 params
[0] = ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0;
5513 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
5514 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5515 params
[0] = ctx
->Const
.MaxColorAttachments
;
5517 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
5518 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5519 params
[0] = ctx
->Const
.MaxRenderbufferSize
;
5521 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
5522 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5523 params
[0] = ctx
->Const
.FragmentProgram
.MaxUniformComponents
;
5525 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
5526 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5527 params
[0] = ENUM_TO_INT(ctx
->Hint
.FragmentShaderDerivative
);
5529 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
5530 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5531 params
[0] = ctx
->Const
.VertexProgram
.MaxUniformComponents
;
5533 case GL_MAX_VARYING_FLOATS_ARB
:
5534 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5535 params
[0] = ctx
->Const
.MaxVaryingFloats
;
5537 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
5538 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5539 params
[0] = ctx
->Const
.MaxVertexTextureImageUnits
;
5541 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
5542 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5543 params
[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS
;
5546 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv(pname=0x%x)", pname
);
5552 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
5554 const GLfloat magic
= -1234.5F
;
5561 /* Init temp array to magic numbers so we can figure out how many values
5562 * are returned by the GetFloatv() call.
5564 for (i
= 0; i
< 16; i
++)
5567 _mesa_GetFloatv(pname
, values
);
5569 for (i
= 0; i
< 16 && values
[i
] != magic
; i
++)
5570 params
[i
] = (GLdouble
) values
[i
];