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
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0);
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
->PixelMaps
.AtoA
.Size
);
682 case GL_PIXEL_MAP_B_TO_B_SIZE
:
683 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.BtoB
.Size
);
685 case GL_PIXEL_MAP_G_TO_G_SIZE
:
686 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.GtoG
.Size
);
688 case GL_PIXEL_MAP_I_TO_A_SIZE
:
689 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoA
.Size
);
691 case GL_PIXEL_MAP_I_TO_B_SIZE
:
692 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoB
.Size
);
694 case GL_PIXEL_MAP_I_TO_G_SIZE
:
695 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoG
.Size
);
697 case GL_PIXEL_MAP_I_TO_I_SIZE
:
698 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoI
.Size
);
700 case GL_PIXEL_MAP_I_TO_R_SIZE
:
701 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoR
.Size
);
703 case GL_PIXEL_MAP_R_TO_R_SIZE
:
704 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.RtoR
.Size
);
706 case GL_PIXEL_MAP_S_TO_S_SIZE
:
707 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.StoS
.Size
);
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_1D_ARRAY_EXT
:
874 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
875 params
[0] = _mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
);
877 case GL_TEXTURE_2D_ARRAY_EXT
:
878 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
879 params
[0] = _mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
);
881 case GL_TEXTURE_BINDING_1D
:
882 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
);
884 case GL_TEXTURE_BINDING_2D
:
885 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
);
887 case GL_TEXTURE_BINDING_3D
:
888 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
);
890 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
891 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
892 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1DArray
->Name
);
894 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
895 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
896 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2DArray
->Name
);
898 case GL_TEXTURE_ENV_COLOR
:
900 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
901 params
[0] = FLOAT_TO_BOOLEAN(color
[0]);
902 params
[1] = FLOAT_TO_BOOLEAN(color
[1]);
903 params
[2] = FLOAT_TO_BOOLEAN(color
[2]);
904 params
[3] = FLOAT_TO_BOOLEAN(color
[3]);
907 case GL_TEXTURE_ENV_MODE
:
908 params
[0] = ENUM_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
910 case GL_TEXTURE_GEN_S
:
911 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0);
913 case GL_TEXTURE_GEN_T
:
914 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0);
916 case GL_TEXTURE_GEN_R
:
917 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0);
919 case GL_TEXTURE_GEN_Q
:
920 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0);
922 case GL_TEXTURE_MATRIX
:
924 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
925 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
926 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
927 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
928 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
929 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
930 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
931 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
932 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
933 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
934 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
935 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
936 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
937 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
938 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
939 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
940 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
943 case GL_TEXTURE_STACK_DEPTH
:
944 params
[0] = INT_TO_BOOLEAN(ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1);
946 case GL_UNPACK_ALIGNMENT
:
947 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.Alignment
);
949 case GL_UNPACK_LSB_FIRST
:
950 params
[0] = ctx
->Unpack
.LsbFirst
;
952 case GL_UNPACK_ROW_LENGTH
:
953 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.RowLength
);
955 case GL_UNPACK_SKIP_PIXELS
:
956 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipPixels
);
958 case GL_UNPACK_SKIP_ROWS
:
959 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipRows
);
961 case GL_UNPACK_SWAP_BYTES
:
962 params
[0] = ctx
->Unpack
.SwapBytes
;
964 case GL_UNPACK_SKIP_IMAGES_EXT
:
965 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipImages
);
967 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
968 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.ImageHeight
);
970 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
971 params
[0] = ctx
->Unpack
.ClientStorage
;
974 params
[0] = INT_TO_BOOLEAN(ctx
->Viewport
.X
);
975 params
[1] = INT_TO_BOOLEAN(ctx
->Viewport
.Y
);
976 params
[2] = INT_TO_BOOLEAN(ctx
->Viewport
.Width
);
977 params
[3] = INT_TO_BOOLEAN(ctx
->Viewport
.Height
);
980 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomX
);
983 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomY
);
985 case GL_VERTEX_ARRAY
:
986 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Enabled
;
988 case GL_VERTEX_ARRAY_SIZE
:
989 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Size
);
991 case GL_VERTEX_ARRAY_TYPE
:
992 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Type
);
994 case GL_VERTEX_ARRAY_STRIDE
:
995 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
997 case GL_VERTEX_ARRAY_COUNT_EXT
:
998 params
[0] = INT_TO_BOOLEAN(0);
1000 case GL_NORMAL_ARRAY
:
1001 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
1003 case GL_NORMAL_ARRAY_TYPE
:
1004 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Type
);
1006 case GL_NORMAL_ARRAY_STRIDE
:
1007 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Stride
);
1009 case GL_NORMAL_ARRAY_COUNT_EXT
:
1010 params
[0] = INT_TO_BOOLEAN(0);
1012 case GL_COLOR_ARRAY
:
1013 params
[0] = ctx
->Array
.ArrayObj
->Color
.Enabled
;
1015 case GL_COLOR_ARRAY_SIZE
:
1016 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Size
);
1018 case GL_COLOR_ARRAY_TYPE
:
1019 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Type
);
1021 case GL_COLOR_ARRAY_STRIDE
:
1022 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Stride
);
1024 case GL_COLOR_ARRAY_COUNT_EXT
:
1025 params
[0] = INT_TO_BOOLEAN(0);
1027 case GL_INDEX_ARRAY
:
1028 params
[0] = ctx
->Array
.ArrayObj
->Index
.Enabled
;
1030 case GL_INDEX_ARRAY_TYPE
:
1031 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Type
);
1033 case GL_INDEX_ARRAY_STRIDE
:
1034 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Stride
);
1036 case GL_INDEX_ARRAY_COUNT_EXT
:
1037 params
[0] = INT_TO_BOOLEAN(0);
1039 case GL_TEXTURE_COORD_ARRAY
:
1040 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
;
1042 case GL_TEXTURE_COORD_ARRAY_SIZE
:
1043 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
1045 case GL_TEXTURE_COORD_ARRAY_TYPE
:
1046 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
1048 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
1049 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
1051 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
1052 params
[0] = INT_TO_BOOLEAN(0);
1054 case GL_EDGE_FLAG_ARRAY
:
1055 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
;
1057 case GL_EDGE_FLAG_ARRAY_STRIDE
:
1058 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
1060 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
1061 params
[0] = INT_TO_BOOLEAN(0);
1063 case GL_MAX_TEXTURE_UNITS_ARB
:
1064 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1065 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureUnits
);
1067 case GL_ACTIVE_TEXTURE_ARB
:
1068 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1069 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
1071 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
1072 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1073 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
1075 case GL_TEXTURE_CUBE_MAP_ARB
:
1076 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1077 params
[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
1079 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
1080 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1081 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
);
1083 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
1084 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1085 params
[0] = INT_TO_BOOLEAN((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
1087 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
1088 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1089 params
[0] = INT_TO_BOOLEAN(ctx
->Hint
.TextureCompression
);
1091 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
1092 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1093 params
[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
1095 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1096 CHECK_EXT1(ARB_texture_compression
, "GetBooleanv");
1099 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
1101 for (i
= 0; i
< n
; i
++)
1102 params
[i
] = ENUM_TO_INT(formats
[i
]);
1105 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1106 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1107 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockFirst
);
1109 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1110 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1111 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockCount
);
1113 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1115 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1116 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1117 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1118 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1119 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1120 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1121 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1122 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1123 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1124 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1125 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1126 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1127 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1128 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1129 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1130 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1131 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1134 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1136 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
1137 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1138 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1139 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1140 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1141 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1142 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1143 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1144 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1145 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1146 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1147 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1148 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1149 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1150 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1151 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1152 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1155 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1157 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
1158 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1159 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1160 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1161 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1162 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1163 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1164 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1165 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1166 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1167 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1168 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1169 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1170 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1171 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1172 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1173 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1176 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1178 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
1179 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1180 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1181 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1182 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1183 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1184 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1185 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1186 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1187 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1188 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1189 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1190 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1191 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1192 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1193 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1194 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1197 case GL_COLOR_MATRIX_SGI
:
1199 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1200 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1201 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1202 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1203 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1204 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1205 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1206 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1207 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1208 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1209 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1210 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1211 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1212 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1213 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1214 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1215 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1218 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1219 params
[0] = INT_TO_BOOLEAN(ctx
->ColorMatrixStack
.Depth
+ 1);
1221 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1222 params
[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH
);
1224 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1225 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[0]);
1227 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1228 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[1]);
1230 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1231 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[2]);
1233 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1234 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[3]);
1236 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1237 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[0]);
1239 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1240 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[1]);
1242 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1243 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[2]);
1245 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1246 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[3]);
1248 case GL_CONVOLUTION_1D_EXT
:
1249 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1250 params
[0] = ctx
->Pixel
.Convolution1DEnabled
;
1252 case GL_CONVOLUTION_2D_EXT
:
1253 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1254 params
[0] = ctx
->Pixel
.Convolution2DEnabled
;
1256 case GL_SEPARABLE_2D_EXT
:
1257 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1258 params
[0] = ctx
->Pixel
.Separable2DEnabled
;
1260 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1261 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1262 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[0]);
1264 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1265 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1266 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[1]);
1268 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1269 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1270 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[2]);
1272 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1273 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1274 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[3]);
1276 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1277 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1278 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[0]);
1280 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1281 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1282 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[1]);
1284 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1285 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1286 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[2]);
1288 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1289 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1290 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[3]);
1293 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1294 params
[0] = ctx
->Pixel
.HistogramEnabled
;
1297 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1298 params
[0] = ctx
->Pixel
.MinMaxEnabled
;
1300 case GL_COLOR_TABLE_SGI
:
1301 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1302 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
];
1304 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1305 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1306 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
];
1308 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1309 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1310 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
];
1312 case GL_TEXTURE_COLOR_TABLE_SGI
:
1313 CHECK_EXT1(SGI_texture_color_table
, "GetBooleanv");
1314 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
;
1316 case GL_COLOR_SUM_EXT
:
1317 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetBooleanv");
1318 params
[0] = ctx
->Fog
.ColorSumEnabled
;
1320 case GL_CURRENT_SECONDARY_COLOR_EXT
:
1321 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1323 FLUSH_CURRENT(ctx
, 0);
1324 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
1325 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
1326 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
1327 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
1330 case GL_SECONDARY_COLOR_ARRAY_EXT
:
1331 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1332 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
;
1334 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
1335 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1336 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
1338 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
1339 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1340 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
1342 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
1343 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1344 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
1346 case GL_CURRENT_FOG_COORDINATE_EXT
:
1347 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1349 FLUSH_CURRENT(ctx
, 0);
1350 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
1353 case GL_FOG_COORDINATE_ARRAY_EXT
:
1354 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1355 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Enabled
;
1357 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
1358 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1359 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
1361 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
1362 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1363 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
1365 case GL_FOG_COORDINATE_SOURCE_EXT
:
1366 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1367 params
[0] = ENUM_TO_BOOLEAN(ctx
->Fog
.FogCoordinateSource
);
1369 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
1370 CHECK_EXT1(EXT_texture_lod_bias
, "GetBooleanv");
1371 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureLodBias
);
1373 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
1374 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetBooleanv");
1375 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureMaxAnisotropy
);
1377 case GL_MULTISAMPLE_ARB
:
1378 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1379 params
[0] = ctx
->Multisample
.Enabled
;
1381 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
1382 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1383 params
[0] = ctx
->Multisample
.SampleAlphaToCoverage
;
1385 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
1386 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1387 params
[0] = ctx
->Multisample
.SampleAlphaToOne
;
1389 case GL_SAMPLE_COVERAGE_ARB
:
1390 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1391 params
[0] = ctx
->Multisample
.SampleCoverage
;
1393 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
1394 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1395 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Multisample
.SampleCoverageValue
);
1397 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
1398 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1399 params
[0] = ctx
->Multisample
.SampleCoverageInvert
;
1401 case GL_SAMPLE_BUFFERS_ARB
:
1402 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1403 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
1405 case GL_SAMPLES_ARB
:
1406 CHECK_EXT1(ARB_multisample
, "GetBooleanv");
1407 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.samples
);
1409 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
1410 CHECK_EXT1(IBM_rasterpos_clip
, "GetBooleanv");
1411 params
[0] = ctx
->Transform
.RasterPositionUnclipped
;
1413 case GL_POINT_SPRITE_NV
:
1414 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1415 params
[0] = ctx
->Point
.PointSprite
;
1417 case GL_POINT_SPRITE_R_MODE_NV
:
1418 CHECK_EXT1(NV_point_sprite
, "GetBooleanv");
1419 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteRMode
);
1421 case GL_POINT_SPRITE_COORD_ORIGIN
:
1422 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1423 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteOrigin
);
1425 case GL_GENERATE_MIPMAP_HINT_SGIS
:
1426 CHECK_EXT1(SGIS_generate_mipmap
, "GetBooleanv");
1427 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.GenerateMipmap
);
1429 case GL_VERTEX_PROGRAM_BINDING_NV
:
1430 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1431 params
[0] = INT_TO_BOOLEAN((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
1433 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
1434 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1435 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
;
1437 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
1438 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1439 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
;
1441 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
1442 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1443 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
;
1445 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
1446 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1447 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
;
1449 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
1450 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1451 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
;
1453 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
1454 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1455 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
;
1457 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
1458 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1459 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
;
1461 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
1462 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1463 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
;
1465 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
1466 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1467 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
;
1469 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
1470 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1471 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
;
1473 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
1474 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1475 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
;
1477 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
1478 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1479 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
;
1481 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
1482 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1483 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
;
1485 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
1486 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1487 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
;
1489 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
1490 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1491 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
;
1493 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
1494 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1495 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
;
1497 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
1498 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1499 params
[0] = ctx
->Eval
.Map1Attrib
[0];
1501 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
1502 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1503 params
[0] = ctx
->Eval
.Map1Attrib
[1];
1505 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
1506 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1507 params
[0] = ctx
->Eval
.Map1Attrib
[2];
1509 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
1510 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1511 params
[0] = ctx
->Eval
.Map1Attrib
[3];
1513 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
1514 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1515 params
[0] = ctx
->Eval
.Map1Attrib
[4];
1517 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
1518 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1519 params
[0] = ctx
->Eval
.Map1Attrib
[5];
1521 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
1522 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1523 params
[0] = ctx
->Eval
.Map1Attrib
[6];
1525 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
1526 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1527 params
[0] = ctx
->Eval
.Map1Attrib
[7];
1529 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
1530 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1531 params
[0] = ctx
->Eval
.Map1Attrib
[8];
1533 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
1534 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1535 params
[0] = ctx
->Eval
.Map1Attrib
[9];
1537 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
1538 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1539 params
[0] = ctx
->Eval
.Map1Attrib
[10];
1541 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
1542 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1543 params
[0] = ctx
->Eval
.Map1Attrib
[11];
1545 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
1546 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1547 params
[0] = ctx
->Eval
.Map1Attrib
[12];
1549 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
1550 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1551 params
[0] = ctx
->Eval
.Map1Attrib
[13];
1553 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
1554 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1555 params
[0] = ctx
->Eval
.Map1Attrib
[14];
1557 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
1558 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1559 params
[0] = ctx
->Eval
.Map1Attrib
[15];
1561 case GL_FRAGMENT_PROGRAM_NV
:
1562 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1563 params
[0] = ctx
->FragmentProgram
.Enabled
;
1565 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
1566 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1567 params
[0] = INT_TO_BOOLEAN(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
1569 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
1570 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1571 params
[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
1573 case GL_TEXTURE_RECTANGLE_NV
:
1574 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1575 params
[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
1577 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
1578 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1579 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
);
1581 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
1582 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1583 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureRectSize
);
1585 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
1586 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1587 params
[0] = ctx
->Stencil
.TestTwoSide
;
1589 case GL_ACTIVE_STENCIL_FACE_EXT
:
1590 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1591 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
1593 case GL_MAX_SHININESS_NV
:
1594 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1595 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxShininess
);
1597 case GL_MAX_SPOT_EXPONENT_NV
:
1598 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1599 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxSpotExponent
);
1601 case GL_ARRAY_BUFFER_BINDING_ARB
:
1602 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1603 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayBufferObj
->Name
);
1605 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
1606 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1607 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
1609 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
1610 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1611 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
1613 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1614 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1615 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
1617 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
1618 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1619 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
1621 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
1622 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1623 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
1625 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
1626 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1627 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
1629 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1630 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1631 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
1633 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
1634 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1635 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
1637 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
1638 CHECK_EXT1(ARB_vertex_buffer_object
, "GetBooleanv");
1639 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ElementArrayBufferObj
->Name
);
1641 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
1642 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1643 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.BufferObj
->Name
);
1645 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
1646 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1647 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.BufferObj
->Name
);
1649 case GL_VERTEX_PROGRAM_ARB
:
1650 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1651 params
[0] = ctx
->VertexProgram
.Enabled
;
1653 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
1654 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1655 params
[0] = ctx
->VertexProgram
.PointSizeEnabled
;
1657 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
1658 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1659 params
[0] = ctx
->VertexProgram
.TwoSideEnabled
;
1661 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
1662 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1663 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrixStackDepth
);
1665 case GL_MAX_PROGRAM_MATRICES_ARB
:
1666 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1667 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrices
);
1669 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
1670 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1671 params
[0] = ctx
->CurrentStack
->Depth
+ 1;
1673 case GL_CURRENT_MATRIX_ARB
:
1674 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1676 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1677 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1678 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1679 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1680 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1681 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1682 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1683 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1684 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1685 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1686 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1687 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1688 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1689 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1690 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1691 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1692 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1695 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
1696 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetBooleanv");
1698 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1699 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1700 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1701 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1702 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1703 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1704 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1705 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1706 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1707 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1708 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1709 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1710 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1711 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1712 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1713 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1714 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1717 case GL_MAX_VERTEX_ATTRIBS_ARB
:
1718 CHECK_EXT1(ARB_vertex_program
, "GetBooleanv");
1719 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxAttribs
);
1721 case GL_PROGRAM_ERROR_POSITION_ARB
:
1722 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetBooleanv");
1723 params
[0] = INT_TO_BOOLEAN(ctx
->Program
.ErrorPos
);
1725 case GL_FRAGMENT_PROGRAM_ARB
:
1726 CHECK_EXT1(ARB_fragment_program
, "GetBooleanv");
1727 params
[0] = ctx
->FragmentProgram
.Enabled
;
1729 case GL_MAX_TEXTURE_COORDS_ARB
:
1730 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1731 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureCoordUnits
);
1733 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
1734 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1735 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureImageUnits
);
1737 case GL_DEPTH_BOUNDS_TEST_EXT
:
1738 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1739 params
[0] = ctx
->Depth
.BoundsTest
;
1741 case GL_DEPTH_BOUNDS_EXT
:
1742 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1743 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMin
);
1744 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMax
);
1746 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
1747 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1748 params
[0] = ctx
->FragmentProgram
.CallbackEnabled
;
1750 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
1751 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1752 params
[0] = ctx
->VertexProgram
.CallbackEnabled
;
1754 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
1755 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1756 params
[0] = INT_TO_BOOLEAN(ctx
->FragmentProgram
.CurrentPosition
);
1758 case GL_VERTEX_PROGRAM_POSITION_MESA
:
1759 CHECK_EXT1(MESA_program_debug
, "GetBooleanv");
1760 params
[0] = INT_TO_BOOLEAN(ctx
->VertexProgram
.CurrentPosition
);
1762 case GL_MAX_DRAW_BUFFERS_ARB
:
1763 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1764 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxDrawBuffers
);
1766 case GL_DRAW_BUFFER0_ARB
:
1767 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1768 params
[0] = ENUM_TO_BOOLEAN(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
1770 case GL_DRAW_BUFFER1_ARB
:
1771 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1774 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1775 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1778 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
1779 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1782 case GL_DRAW_BUFFER2_ARB
:
1783 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1786 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1787 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1790 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
1791 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1794 case GL_DRAW_BUFFER3_ARB
:
1795 CHECK_EXT1(ARB_draw_buffers
, "GetBooleanv");
1798 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1799 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1802 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
1803 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1806 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
1807 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1808 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.ColorReadType
);
1810 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
1811 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1812 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.ColorReadFormat
);
1814 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
1815 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1816 params
[0] = INT_TO_BOOLEAN(6);
1818 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
1819 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1820 params
[0] = INT_TO_BOOLEAN(8);
1822 case GL_NUM_PASSES_ATI
:
1823 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1824 params
[0] = INT_TO_BOOLEAN(2);
1826 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
1827 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1828 params
[0] = INT_TO_BOOLEAN(8);
1830 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
1831 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1832 params
[0] = INT_TO_BOOLEAN(16);
1834 case GL_COLOR_ALPHA_PAIRING_ATI
:
1835 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1836 params
[0] = GL_TRUE
;
1838 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
1839 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1840 params
[0] = INT_TO_BOOLEAN(3);
1842 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
1843 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1844 params
[0] = INT_TO_BOOLEAN(3);
1846 case GL_STENCIL_BACK_FUNC
:
1847 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.Function
[1]);
1849 case GL_STENCIL_BACK_VALUE_MASK
:
1850 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.ValueMask
[1]);
1852 case GL_STENCIL_BACK_WRITEMASK
:
1853 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.WriteMask
[1]);
1855 case GL_STENCIL_BACK_REF
:
1856 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Ref
[1]);
1858 case GL_STENCIL_BACK_FAIL
:
1859 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.FailFunc
[1]);
1861 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
1862 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZFailFunc
[1]);
1864 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
1865 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZPassFunc
[1]);
1867 case GL_FRAMEBUFFER_BINDING_EXT
:
1868 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1869 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Name
);
1871 case GL_RENDERBUFFER_BINDING_EXT
:
1872 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1873 params
[0] = INT_TO_BOOLEAN(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
1875 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
1876 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1877 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxColorAttachments
);
1879 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
1880 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1881 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxRenderbufferSize
);
1883 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
1884 CHECK_EXT1(EXT_framebuffer_blit
, "GetBooleanv");
1885 params
[0] = INT_TO_BOOLEAN(ctx
->ReadBuffer
->Name
);
1887 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
1888 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1889 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
1891 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
1892 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1893 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.FragmentShaderDerivative
);
1895 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
1896 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1897 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
1899 case GL_MAX_VARYING_FLOATS_ARB
:
1900 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1901 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVarying
* 4);
1903 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
1904 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1905 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVertexTextureImageUnits
);
1907 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
1908 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1909 params
[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS
);
1911 case GL_CURRENT_PROGRAM
:
1912 CHECK_EXT1(ARB_shader_objects
, "GetBooleanv");
1913 params
[0] = INT_TO_BOOLEAN(ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0);
1916 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv(pname=0x%x)", pname
);
1921 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
1923 GET_CURRENT_CONTEXT(ctx
);
1924 ASSERT_OUTSIDE_BEGIN_END(ctx
);
1930 _mesa_update_state(ctx
);
1932 if (ctx
->Driver
.GetFloatv
&&
1933 ctx
->Driver
.GetFloatv(ctx
, pname
, params
))
1937 case GL_ACCUM_RED_BITS
:
1938 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumRedBits
);
1940 case GL_ACCUM_GREEN_BITS
:
1941 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
1943 case GL_ACCUM_BLUE_BITS
:
1944 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
1946 case GL_ACCUM_ALPHA_BITS
:
1947 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
1949 case GL_ACCUM_CLEAR_VALUE
:
1950 params
[0] = ctx
->Accum
.ClearColor
[0];
1951 params
[1] = ctx
->Accum
.ClearColor
[1];
1952 params
[2] = ctx
->Accum
.ClearColor
[2];
1953 params
[3] = ctx
->Accum
.ClearColor
[3];
1956 params
[0] = ctx
->Pixel
.AlphaBias
;
1959 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.alphaBits
);
1961 case GL_ALPHA_SCALE
:
1962 params
[0] = ctx
->Pixel
.AlphaScale
;
1965 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.AlphaEnabled
);
1967 case GL_ALPHA_TEST_FUNC
:
1968 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
1970 case GL_ALPHA_TEST_REF
:
1971 params
[0] = ctx
->Color
.AlphaRef
;
1973 case GL_ATTRIB_STACK_DEPTH
:
1974 params
[0] = (GLfloat
)(ctx
->AttribStackDepth
);
1976 case GL_AUTO_NORMAL
:
1977 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.AutoNormal
);
1979 case GL_AUX_BUFFERS
:
1980 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
1983 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.BlendEnabled
);
1986 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
1989 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
1991 case GL_BLEND_SRC_RGB_EXT
:
1992 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
1994 case GL_BLEND_DST_RGB_EXT
:
1995 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
1997 case GL_BLEND_SRC_ALPHA_EXT
:
1998 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
2000 case GL_BLEND_DST_ALPHA_EXT
:
2001 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
2003 case GL_BLEND_EQUATION
:
2004 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationRGB
);
2006 case GL_BLEND_EQUATION_ALPHA_EXT
:
2007 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationA
);
2009 case GL_BLEND_COLOR_EXT
:
2010 params
[0] = ctx
->Color
.BlendColor
[0];
2011 params
[1] = ctx
->Color
.BlendColor
[1];
2012 params
[2] = ctx
->Color
.BlendColor
[2];
2013 params
[3] = ctx
->Color
.BlendColor
[3];
2016 params
[0] = ctx
->Pixel
.BlueBias
;
2019 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.blueBits
);
2022 params
[0] = ctx
->Pixel
.BlueScale
;
2024 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2025 params
[0] = (GLfloat
)(ctx
->ClientAttribStackDepth
);
2027 case GL_CLIP_PLANE0
:
2028 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
2030 case GL_CLIP_PLANE1
:
2031 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
2033 case GL_CLIP_PLANE2
:
2034 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
2036 case GL_CLIP_PLANE3
:
2037 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
2039 case GL_CLIP_PLANE4
:
2040 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
2042 case GL_CLIP_PLANE5
:
2043 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
2045 case GL_COLOR_CLEAR_VALUE
:
2046 params
[0] = ctx
->Color
.ClearColor
[0];
2047 params
[1] = ctx
->Color
.ClearColor
[1];
2048 params
[2] = ctx
->Color
.ClearColor
[2];
2049 params
[3] = ctx
->Color
.ClearColor
[3];
2051 case GL_COLOR_MATERIAL
:
2052 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.ColorMaterialEnabled
);
2054 case GL_COLOR_MATERIAL_FACE
:
2055 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2057 case GL_COLOR_MATERIAL_PARAMETER
:
2058 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2060 case GL_COLOR_WRITEMASK
:
2061 params
[0] = (GLfloat
)(ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0);
2062 params
[1] = (GLfloat
)(ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0);
2063 params
[2] = (GLfloat
)(ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0);
2064 params
[3] = (GLfloat
)(ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0);
2067 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.CullFlag
);
2069 case GL_CULL_FACE_MODE
:
2070 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2072 case GL_CURRENT_COLOR
:
2074 FLUSH_CURRENT(ctx
, 0);
2075 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0];
2076 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1];
2077 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2];
2078 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3];
2081 case GL_CURRENT_INDEX
:
2083 FLUSH_CURRENT(ctx
, 0);
2084 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0];
2087 case GL_CURRENT_NORMAL
:
2089 FLUSH_CURRENT(ctx
, 0);
2090 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0];
2091 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1];
2092 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2];
2095 case GL_CURRENT_RASTER_COLOR
:
2096 params
[0] = ctx
->Current
.RasterColor
[0];
2097 params
[1] = ctx
->Current
.RasterColor
[1];
2098 params
[2] = ctx
->Current
.RasterColor
[2];
2099 params
[3] = ctx
->Current
.RasterColor
[3];
2101 case GL_CURRENT_RASTER_DISTANCE
:
2102 params
[0] = ctx
->Current
.RasterDistance
;
2104 case GL_CURRENT_RASTER_INDEX
:
2105 params
[0] = ctx
->Current
.RasterIndex
;
2107 case GL_CURRENT_RASTER_POSITION
:
2108 params
[0] = ctx
->Current
.RasterPos
[0];
2109 params
[1] = ctx
->Current
.RasterPos
[1];
2110 params
[2] = ctx
->Current
.RasterPos
[2];
2111 params
[3] = ctx
->Current
.RasterPos
[3];
2113 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
2114 params
[0] = ctx
->Current
.RasterSecondaryColor
[0];
2115 params
[1] = ctx
->Current
.RasterSecondaryColor
[1];
2116 params
[2] = ctx
->Current
.RasterSecondaryColor
[2];
2117 params
[3] = ctx
->Current
.RasterSecondaryColor
[3];
2119 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2121 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2122 params
[0] = ctx
->Current
.RasterTexCoords
[texUnit
][0];
2123 params
[1] = ctx
->Current
.RasterTexCoords
[texUnit
][1];
2124 params
[2] = ctx
->Current
.RasterTexCoords
[texUnit
][2];
2125 params
[3] = ctx
->Current
.RasterTexCoords
[texUnit
][3];
2128 case GL_CURRENT_RASTER_POSITION_VALID
:
2129 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Current
.RasterPosValid
);
2131 case GL_CURRENT_TEXTURE_COORDS
:
2133 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2134 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0];
2135 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1];
2136 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2];
2137 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3];
2141 params
[0] = ctx
->Pixel
.DepthBias
;
2144 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.depthBits
);
2146 case GL_DEPTH_CLEAR_VALUE
:
2147 params
[0] = ctx
->Depth
.Clear
;
2150 params
[0] = ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2152 case GL_DEPTH_RANGE
:
2153 params
[0] = ctx
->Viewport
.Near
;
2154 params
[1] = ctx
->Viewport
.Far
;
2156 case GL_DEPTH_SCALE
:
2157 params
[0] = ctx
->Pixel
.DepthScale
;
2160 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Test
);
2162 case GL_DEPTH_WRITEMASK
:
2163 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Mask
);
2166 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.DitherFlag
);
2168 case GL_DOUBLEBUFFER
:
2169 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
2171 case GL_DRAW_BUFFER
:
2172 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
2176 FLUSH_CURRENT(ctx
, 0);
2177 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0));
2180 case GL_FEEDBACK_BUFFER_SIZE
:
2181 params
[0] = (GLfloat
)(ctx
->Feedback
.BufferSize
);
2183 case GL_FEEDBACK_BUFFER_TYPE
:
2184 params
[0] = ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2187 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.Enabled
);
2190 params
[0] = ctx
->Fog
.Color
[0];
2191 params
[1] = ctx
->Fog
.Color
[1];
2192 params
[2] = ctx
->Fog
.Color
[2];
2193 params
[3] = ctx
->Fog
.Color
[3];
2195 case GL_FOG_DENSITY
:
2196 params
[0] = ctx
->Fog
.Density
;
2199 params
[0] = ctx
->Fog
.End
;
2202 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2205 params
[0] = ctx
->Fog
.Index
;
2208 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2211 params
[0] = ctx
->Fog
.Start
;
2214 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2217 params
[0] = ctx
->Pixel
.GreenBias
;
2220 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.greenBits
);
2222 case GL_GREEN_SCALE
:
2223 params
[0] = ctx
->Pixel
.GreenScale
;
2226 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.indexBits
);
2228 case GL_INDEX_CLEAR_VALUE
:
2229 params
[0] = (GLfloat
)(ctx
->Color
.ClearIndex
);
2232 params
[0] = BOOLEAN_TO_FLOAT(!ctx
->DrawBuffer
->Visual
.rgbMode
);
2234 case GL_INDEX_OFFSET
:
2235 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexOffset
);
2237 case GL_INDEX_SHIFT
:
2238 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexShift
);
2240 case GL_INDEX_WRITEMASK
:
2241 params
[0] = (GLfloat
)(ctx
->Color
.IndexMask
);
2244 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[0].Enabled
);
2247 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[1].Enabled
);
2250 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[2].Enabled
);
2253 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[3].Enabled
);
2256 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[4].Enabled
);
2259 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[5].Enabled
);
2262 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[6].Enabled
);
2265 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[7].Enabled
);
2268 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Enabled
);
2270 case GL_LIGHT_MODEL_AMBIENT
:
2271 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2272 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2273 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2274 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2276 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2277 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2279 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2280 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.LocalViewer
);
2282 case GL_LIGHT_MODEL_TWO_SIDE
:
2283 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.TwoSide
);
2285 case GL_LINE_SMOOTH
:
2286 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.SmoothFlag
);
2288 case GL_LINE_SMOOTH_HINT
:
2289 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2291 case GL_LINE_STIPPLE
:
2292 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.StippleFlag
);
2294 case GL_LINE_STIPPLE_PATTERN
:
2295 params
[0] = (GLfloat
)(ctx
->Line
.StipplePattern
);
2297 case GL_LINE_STIPPLE_REPEAT
:
2298 params
[0] = (GLfloat
)(ctx
->Line
.StippleFactor
);
2301 params
[0] = ctx
->Line
.Width
;
2303 case GL_LINE_WIDTH_GRANULARITY
:
2304 params
[0] = ctx
->Const
.LineWidthGranularity
;
2306 case GL_LINE_WIDTH_RANGE
:
2307 params
[0] = ctx
->Const
.MinLineWidthAA
;
2308 params
[1] = ctx
->Const
.MaxLineWidthAA
;
2310 case GL_ALIASED_LINE_WIDTH_RANGE
:
2311 params
[0] = ctx
->Const
.MinLineWidth
;
2312 params
[1] = ctx
->Const
.MaxLineWidth
;
2315 params
[0] = (GLfloat
)(ctx
->List
.ListBase
);
2318 params
[0] = (GLfloat
)(ctx
->ListState
.CurrentListNum
);
2323 if (!ctx
->CompileFlag
)
2325 else if (ctx
->ExecuteFlag
)
2326 mode
= GL_COMPILE_AND_EXECUTE
;
2329 params
[0] = ENUM_TO_FLOAT(mode
);
2332 case GL_INDEX_LOGIC_OP
:
2333 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.IndexLogicOpEnabled
);
2335 case GL_COLOR_LOGIC_OP
:
2336 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.ColorLogicOpEnabled
);
2338 case GL_LOGIC_OP_MODE
:
2339 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
2341 case GL_MAP1_COLOR_4
:
2342 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Color4
);
2344 case GL_MAP1_GRID_DOMAIN
:
2345 params
[0] = ctx
->Eval
.MapGrid1u1
;
2346 params
[1] = ctx
->Eval
.MapGrid1u2
;
2348 case GL_MAP1_GRID_SEGMENTS
:
2349 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid1un
);
2352 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Index
);
2354 case GL_MAP1_NORMAL
:
2355 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Normal
);
2357 case GL_MAP1_TEXTURE_COORD_1
:
2358 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord1
);
2360 case GL_MAP1_TEXTURE_COORD_2
:
2361 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord2
);
2363 case GL_MAP1_TEXTURE_COORD_3
:
2364 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord3
);
2366 case GL_MAP1_TEXTURE_COORD_4
:
2367 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord4
);
2369 case GL_MAP1_VERTEX_3
:
2370 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex3
);
2372 case GL_MAP1_VERTEX_4
:
2373 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex4
);
2375 case GL_MAP2_COLOR_4
:
2376 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Color4
);
2378 case GL_MAP2_GRID_DOMAIN
:
2379 params
[0] = ctx
->Eval
.MapGrid2u1
;
2380 params
[1] = ctx
->Eval
.MapGrid2u2
;
2381 params
[2] = ctx
->Eval
.MapGrid2v1
;
2382 params
[3] = ctx
->Eval
.MapGrid2v2
;
2384 case GL_MAP2_GRID_SEGMENTS
:
2385 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid2un
);
2386 params
[1] = (GLfloat
)(ctx
->Eval
.MapGrid2vn
);
2389 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Index
);
2391 case GL_MAP2_NORMAL
:
2392 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Normal
);
2394 case GL_MAP2_TEXTURE_COORD_1
:
2395 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord1
);
2397 case GL_MAP2_TEXTURE_COORD_2
:
2398 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord2
);
2400 case GL_MAP2_TEXTURE_COORD_3
:
2401 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord3
);
2403 case GL_MAP2_TEXTURE_COORD_4
:
2404 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord4
);
2406 case GL_MAP2_VERTEX_3
:
2407 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex3
);
2409 case GL_MAP2_VERTEX_4
:
2410 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex4
);
2413 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapColorFlag
);
2415 case GL_MAP_STENCIL
:
2416 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapStencilFlag
);
2418 case GL_MATRIX_MODE
:
2419 params
[0] = ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
2421 case GL_MAX_ATTRIB_STACK_DEPTH
:
2422 params
[0] = (GLfloat
)(MAX_ATTRIB_STACK_DEPTH
);
2424 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2425 params
[0] = (GLfloat
)(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
2427 case GL_MAX_CLIP_PLANES
:
2428 params
[0] = (GLfloat
)(ctx
->Const
.MaxClipPlanes
);
2430 case GL_MAX_ELEMENTS_VERTICES
:
2431 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2433 case GL_MAX_ELEMENTS_INDICES
:
2434 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2436 case GL_MAX_EVAL_ORDER
:
2437 params
[0] = (GLfloat
)(MAX_EVAL_ORDER
);
2440 params
[0] = (GLfloat
)(ctx
->Const
.MaxLights
);
2442 case GL_MAX_LIST_NESTING
:
2443 params
[0] = (GLfloat
)(MAX_LIST_NESTING
);
2445 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2446 params
[0] = (GLfloat
)(MAX_MODELVIEW_STACK_DEPTH
);
2448 case GL_MAX_NAME_STACK_DEPTH
:
2449 params
[0] = (GLfloat
)(MAX_NAME_STACK_DEPTH
);
2451 case GL_MAX_PIXEL_MAP_TABLE
:
2452 params
[0] = (GLfloat
)(MAX_PIXEL_MAP_TABLE
);
2454 case GL_MAX_PROJECTION_STACK_DEPTH
:
2455 params
[0] = (GLfloat
)(MAX_PROJECTION_STACK_DEPTH
);
2457 case GL_MAX_TEXTURE_SIZE
:
2458 params
[0] = (GLfloat
)(1 << (ctx
->Const
.MaxTextureLevels
- 1));
2460 case GL_MAX_3D_TEXTURE_SIZE
:
2461 params
[0] = (GLfloat
)(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
2463 case GL_MAX_TEXTURE_STACK_DEPTH
:
2464 params
[0] = (GLfloat
)(MAX_TEXTURE_STACK_DEPTH
);
2466 case GL_MAX_VIEWPORT_DIMS
:
2467 params
[0] = (GLfloat
)(ctx
->Const
.MaxViewportWidth
);
2468 params
[1] = (GLfloat
)(ctx
->Const
.MaxViewportHeight
);
2470 case GL_MODELVIEW_MATRIX
:
2472 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
2473 params
[0] = matrix
[0];
2474 params
[1] = matrix
[1];
2475 params
[2] = matrix
[2];
2476 params
[3] = matrix
[3];
2477 params
[4] = matrix
[4];
2478 params
[5] = matrix
[5];
2479 params
[6] = matrix
[6];
2480 params
[7] = matrix
[7];
2481 params
[8] = matrix
[8];
2482 params
[9] = matrix
[9];
2483 params
[10] = matrix
[10];
2484 params
[11] = matrix
[11];
2485 params
[12] = matrix
[12];
2486 params
[13] = matrix
[13];
2487 params
[14] = matrix
[14];
2488 params
[15] = matrix
[15];
2491 case GL_MODELVIEW_STACK_DEPTH
:
2492 params
[0] = (GLfloat
)(ctx
->ModelviewMatrixStack
.Depth
+ 1);
2494 case GL_NAME_STACK_DEPTH
:
2495 params
[0] = (GLfloat
)(ctx
->Select
.NameStackDepth
);
2498 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.Normalize
);
2500 case GL_PACK_ALIGNMENT
:
2501 params
[0] = (GLfloat
)(ctx
->Pack
.Alignment
);
2503 case GL_PACK_LSB_FIRST
:
2504 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.LsbFirst
);
2506 case GL_PACK_ROW_LENGTH
:
2507 params
[0] = (GLfloat
)(ctx
->Pack
.RowLength
);
2509 case GL_PACK_SKIP_PIXELS
:
2510 params
[0] = (GLfloat
)(ctx
->Pack
.SkipPixels
);
2512 case GL_PACK_SKIP_ROWS
:
2513 params
[0] = (GLfloat
)(ctx
->Pack
.SkipRows
);
2515 case GL_PACK_SWAP_BYTES
:
2516 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.SwapBytes
);
2518 case GL_PACK_SKIP_IMAGES_EXT
:
2519 params
[0] = (GLfloat
)(ctx
->Pack
.SkipImages
);
2521 case GL_PACK_IMAGE_HEIGHT_EXT
:
2522 params
[0] = (GLfloat
)(ctx
->Pack
.ImageHeight
);
2524 case GL_PACK_INVERT_MESA
:
2525 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.Invert
);
2527 case GL_PERSPECTIVE_CORRECTION_HINT
:
2528 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
2530 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2531 params
[0] = (GLfloat
)(ctx
->PixelMaps
.AtoA
.Size
);
2533 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2534 params
[0] = (GLfloat
)(ctx
->PixelMaps
.BtoB
.Size
);
2536 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2537 params
[0] = (GLfloat
)(ctx
->PixelMaps
.GtoG
.Size
);
2539 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2540 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoA
.Size
);
2542 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2543 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoB
.Size
);
2545 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2546 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoG
.Size
);
2548 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2549 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoI
.Size
);
2551 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2552 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoR
.Size
);
2554 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2555 params
[0] = (GLfloat
)(ctx
->PixelMaps
.RtoR
.Size
);
2557 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2558 params
[0] = (GLfloat
)(ctx
->PixelMaps
.StoS
.Size
);
2561 params
[0] = ctx
->Point
.Size
;
2563 case GL_POINT_SIZE_GRANULARITY
:
2564 params
[0] = ctx
->Const
.PointSizeGranularity
;
2566 case GL_POINT_SIZE_RANGE
:
2567 params
[0] = ctx
->Const
.MinPointSizeAA
;
2568 params
[1] = ctx
->Const
.MaxPointSizeAA
;
2570 case GL_ALIASED_POINT_SIZE_RANGE
:
2571 params
[0] = ctx
->Const
.MinPointSize
;
2572 params
[1] = ctx
->Const
.MaxPointSize
;
2574 case GL_POINT_SMOOTH
:
2575 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.SmoothFlag
);
2577 case GL_POINT_SMOOTH_HINT
:
2578 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
2580 case GL_POINT_SIZE_MIN_EXT
:
2581 params
[0] = ctx
->Point
.MinSize
;
2583 case GL_POINT_SIZE_MAX_EXT
:
2584 params
[0] = ctx
->Point
.MaxSize
;
2586 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2587 params
[0] = ctx
->Point
.Threshold
;
2589 case GL_DISTANCE_ATTENUATION_EXT
:
2590 params
[0] = ctx
->Point
.Params
[0];
2591 params
[1] = ctx
->Point
.Params
[1];
2592 params
[2] = ctx
->Point
.Params
[2];
2594 case GL_POLYGON_MODE
:
2595 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
2596 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
2598 case GL_POLYGON_OFFSET_BIAS_EXT
:
2599 params
[0] = ctx
->Polygon
.OffsetUnits
;
2601 case GL_POLYGON_OFFSET_FACTOR
:
2602 params
[0] = ctx
->Polygon
.OffsetFactor
;
2604 case GL_POLYGON_OFFSET_UNITS
:
2605 params
[0] = ctx
->Polygon
.OffsetUnits
;
2607 case GL_POLYGON_SMOOTH
:
2608 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.SmoothFlag
);
2610 case GL_POLYGON_SMOOTH_HINT
:
2611 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
2613 case GL_POLYGON_STIPPLE
:
2614 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.StippleFlag
);
2616 case GL_PROJECTION_MATRIX
:
2618 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
2619 params
[0] = matrix
[0];
2620 params
[1] = matrix
[1];
2621 params
[2] = matrix
[2];
2622 params
[3] = matrix
[3];
2623 params
[4] = matrix
[4];
2624 params
[5] = matrix
[5];
2625 params
[6] = matrix
[6];
2626 params
[7] = matrix
[7];
2627 params
[8] = matrix
[8];
2628 params
[9] = matrix
[9];
2629 params
[10] = matrix
[10];
2630 params
[11] = matrix
[11];
2631 params
[12] = matrix
[12];
2632 params
[13] = matrix
[13];
2633 params
[14] = matrix
[14];
2634 params
[15] = matrix
[15];
2637 case GL_PROJECTION_STACK_DEPTH
:
2638 params
[0] = (GLfloat
)(ctx
->ProjectionMatrixStack
.Depth
+ 1);
2640 case GL_READ_BUFFER
:
2641 params
[0] = ENUM_TO_FLOAT(ctx
->ReadBuffer
->ColorReadBuffer
);
2644 params
[0] = ctx
->Pixel
.RedBias
;
2647 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.redBits
);
2650 params
[0] = ctx
->Pixel
.RedScale
;
2652 case GL_RENDER_MODE
:
2653 params
[0] = ENUM_TO_FLOAT(ctx
->RenderMode
);
2655 case GL_RESCALE_NORMAL
:
2656 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RescaleNormals
);
2659 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.rgbMode
);
2661 case GL_SCISSOR_BOX
:
2662 params
[0] = (GLfloat
)(ctx
->Scissor
.X
);
2663 params
[1] = (GLfloat
)(ctx
->Scissor
.Y
);
2664 params
[2] = (GLfloat
)(ctx
->Scissor
.Width
);
2665 params
[3] = (GLfloat
)(ctx
->Scissor
.Height
);
2667 case GL_SCISSOR_TEST
:
2668 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Scissor
.Enabled
);
2670 case GL_SELECTION_BUFFER_SIZE
:
2671 params
[0] = (GLfloat
)(ctx
->Select
.BufferSize
);
2673 case GL_SHADE_MODEL
:
2674 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
2676 case GL_SHARED_TEXTURE_PALETTE_EXT
:
2677 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.SharedPalette
);
2679 case GL_STENCIL_BITS
:
2680 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.stencilBits
);
2682 case GL_STENCIL_CLEAR_VALUE
:
2683 params
[0] = (GLfloat
)(ctx
->Stencil
.Clear
);
2685 case GL_STENCIL_FAIL
:
2686 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
2688 case GL_STENCIL_FUNC
:
2689 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
2691 case GL_STENCIL_PASS_DEPTH_FAIL
:
2692 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
2694 case GL_STENCIL_PASS_DEPTH_PASS
:
2695 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
2697 case GL_STENCIL_REF
:
2698 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
2700 case GL_STENCIL_TEST
:
2701 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.Enabled
);
2703 case GL_STENCIL_VALUE_MASK
:
2704 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
2706 case GL_STENCIL_WRITEMASK
:
2707 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
2710 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.stereoMode
);
2712 case GL_SUBPIXEL_BITS
:
2713 params
[0] = (GLfloat
)(ctx
->Const
.SubPixelBits
);
2716 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D
));
2719 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D
));
2722 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D
));
2724 case GL_TEXTURE_1D_ARRAY_EXT
:
2725 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2726 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
));
2728 case GL_TEXTURE_2D_ARRAY_EXT
:
2729 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2730 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
));
2732 case GL_TEXTURE_BINDING_1D
:
2733 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
);
2735 case GL_TEXTURE_BINDING_2D
:
2736 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
);
2738 case GL_TEXTURE_BINDING_3D
:
2739 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
);
2741 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
2742 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2743 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1DArray
->Name
);
2745 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
2746 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2747 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2DArray
->Name
);
2749 case GL_TEXTURE_ENV_COLOR
:
2751 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
2752 params
[0] = color
[0];
2753 params
[1] = color
[1];
2754 params
[2] = color
[2];
2755 params
[3] = color
[3];
2758 case GL_TEXTURE_ENV_MODE
:
2759 params
[0] = ENUM_TO_FLOAT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
2761 case GL_TEXTURE_GEN_S
:
2762 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
2764 case GL_TEXTURE_GEN_T
:
2765 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
2767 case GL_TEXTURE_GEN_R
:
2768 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
2770 case GL_TEXTURE_GEN_Q
:
2771 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
2773 case GL_TEXTURE_MATRIX
:
2775 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
2776 params
[0] = matrix
[0];
2777 params
[1] = matrix
[1];
2778 params
[2] = matrix
[2];
2779 params
[3] = matrix
[3];
2780 params
[4] = matrix
[4];
2781 params
[5] = matrix
[5];
2782 params
[6] = matrix
[6];
2783 params
[7] = matrix
[7];
2784 params
[8] = matrix
[8];
2785 params
[9] = matrix
[9];
2786 params
[10] = matrix
[10];
2787 params
[11] = matrix
[11];
2788 params
[12] = matrix
[12];
2789 params
[13] = matrix
[13];
2790 params
[14] = matrix
[14];
2791 params
[15] = matrix
[15];
2794 case GL_TEXTURE_STACK_DEPTH
:
2795 params
[0] = (GLfloat
)(ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1);
2797 case GL_UNPACK_ALIGNMENT
:
2798 params
[0] = (GLfloat
)(ctx
->Unpack
.Alignment
);
2800 case GL_UNPACK_LSB_FIRST
:
2801 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.LsbFirst
);
2803 case GL_UNPACK_ROW_LENGTH
:
2804 params
[0] = (GLfloat
)(ctx
->Unpack
.RowLength
);
2806 case GL_UNPACK_SKIP_PIXELS
:
2807 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipPixels
);
2809 case GL_UNPACK_SKIP_ROWS
:
2810 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipRows
);
2812 case GL_UNPACK_SWAP_BYTES
:
2813 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.SwapBytes
);
2815 case GL_UNPACK_SKIP_IMAGES_EXT
:
2816 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipImages
);
2818 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2819 params
[0] = (GLfloat
)(ctx
->Unpack
.ImageHeight
);
2821 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
2822 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.ClientStorage
);
2825 params
[0] = (GLfloat
)(ctx
->Viewport
.X
);
2826 params
[1] = (GLfloat
)(ctx
->Viewport
.Y
);
2827 params
[2] = (GLfloat
)(ctx
->Viewport
.Width
);
2828 params
[3] = (GLfloat
)(ctx
->Viewport
.Height
);
2831 params
[0] = ctx
->Pixel
.ZoomX
;
2834 params
[0] = ctx
->Pixel
.ZoomY
;
2836 case GL_VERTEX_ARRAY
:
2837 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
2839 case GL_VERTEX_ARRAY_SIZE
:
2840 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Size
);
2842 case GL_VERTEX_ARRAY_TYPE
:
2843 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
2845 case GL_VERTEX_ARRAY_STRIDE
:
2846 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
2848 case GL_VERTEX_ARRAY_COUNT_EXT
:
2849 params
[0] = (GLfloat
)(0);
2851 case GL_NORMAL_ARRAY
:
2852 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
2854 case GL_NORMAL_ARRAY_TYPE
:
2855 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Type
);
2857 case GL_NORMAL_ARRAY_STRIDE
:
2858 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.Stride
);
2860 case GL_NORMAL_ARRAY_COUNT_EXT
:
2861 params
[0] = (GLfloat
)(0);
2863 case GL_COLOR_ARRAY
:
2864 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
2866 case GL_COLOR_ARRAY_SIZE
:
2867 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Size
);
2869 case GL_COLOR_ARRAY_TYPE
:
2870 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Type
);
2872 case GL_COLOR_ARRAY_STRIDE
:
2873 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Stride
);
2875 case GL_COLOR_ARRAY_COUNT_EXT
:
2876 params
[0] = (GLfloat
)(0);
2878 case GL_INDEX_ARRAY
:
2879 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
2881 case GL_INDEX_ARRAY_TYPE
:
2882 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Type
);
2884 case GL_INDEX_ARRAY_STRIDE
:
2885 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.Stride
);
2887 case GL_INDEX_ARRAY_COUNT_EXT
:
2888 params
[0] = (GLfloat
)(0);
2890 case GL_TEXTURE_COORD_ARRAY
:
2891 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
2893 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2894 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
2896 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2897 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
2899 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2900 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
2902 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2903 params
[0] = (GLfloat
)(0);
2905 case GL_EDGE_FLAG_ARRAY
:
2906 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
2908 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2909 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
2911 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2912 params
[0] = (GLfloat
)(0);
2914 case GL_MAX_TEXTURE_UNITS_ARB
:
2915 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2916 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureUnits
);
2918 case GL_ACTIVE_TEXTURE_ARB
:
2919 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2920 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2922 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2923 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2924 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2926 case GL_TEXTURE_CUBE_MAP_ARB
:
2927 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2928 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
2930 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2931 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2932 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
);
2934 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2935 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2936 params
[0] = (GLfloat
)((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
2938 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2939 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2940 params
[0] = (GLfloat
)(ctx
->Hint
.TextureCompression
);
2942 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2943 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2944 params
[0] = (GLfloat
)(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
2946 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2947 CHECK_EXT1(ARB_texture_compression
, "GetFloatv");
2950 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
2952 for (i
= 0; i
< n
; i
++)
2953 params
[i
] = ENUM_TO_INT(formats
[i
]);
2956 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2957 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
2958 params
[0] = (GLfloat
)(ctx
->Array
.LockFirst
);
2960 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2961 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
2962 params
[0] = (GLfloat
)(ctx
->Array
.LockCount
);
2964 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2966 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
2967 params
[0] = matrix
[0];
2968 params
[1] = matrix
[4];
2969 params
[2] = matrix
[8];
2970 params
[3] = matrix
[12];
2971 params
[4] = matrix
[1];
2972 params
[5] = matrix
[5];
2973 params
[6] = matrix
[9];
2974 params
[7] = matrix
[13];
2975 params
[8] = matrix
[2];
2976 params
[9] = matrix
[6];
2977 params
[10] = matrix
[10];
2978 params
[11] = matrix
[14];
2979 params
[12] = matrix
[3];
2980 params
[13] = matrix
[7];
2981 params
[14] = matrix
[11];
2982 params
[15] = matrix
[15];
2985 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2987 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
2988 params
[0] = matrix
[0];
2989 params
[1] = matrix
[4];
2990 params
[2] = matrix
[8];
2991 params
[3] = matrix
[12];
2992 params
[4] = matrix
[1];
2993 params
[5] = matrix
[5];
2994 params
[6] = matrix
[9];
2995 params
[7] = matrix
[13];
2996 params
[8] = matrix
[2];
2997 params
[9] = matrix
[6];
2998 params
[10] = matrix
[10];
2999 params
[11] = matrix
[14];
3000 params
[12] = matrix
[3];
3001 params
[13] = matrix
[7];
3002 params
[14] = matrix
[11];
3003 params
[15] = matrix
[15];
3006 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
3008 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
3009 params
[0] = matrix
[0];
3010 params
[1] = matrix
[4];
3011 params
[2] = matrix
[8];
3012 params
[3] = matrix
[12];
3013 params
[4] = matrix
[1];
3014 params
[5] = matrix
[5];
3015 params
[6] = matrix
[9];
3016 params
[7] = matrix
[13];
3017 params
[8] = matrix
[2];
3018 params
[9] = matrix
[6];
3019 params
[10] = matrix
[10];
3020 params
[11] = matrix
[14];
3021 params
[12] = matrix
[3];
3022 params
[13] = matrix
[7];
3023 params
[14] = matrix
[11];
3024 params
[15] = matrix
[15];
3027 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
3029 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
3030 params
[0] = matrix
[0];
3031 params
[1] = matrix
[4];
3032 params
[2] = matrix
[8];
3033 params
[3] = matrix
[12];
3034 params
[4] = matrix
[1];
3035 params
[5] = matrix
[5];
3036 params
[6] = matrix
[9];
3037 params
[7] = matrix
[13];
3038 params
[8] = matrix
[2];
3039 params
[9] = matrix
[6];
3040 params
[10] = matrix
[10];
3041 params
[11] = matrix
[14];
3042 params
[12] = matrix
[3];
3043 params
[13] = matrix
[7];
3044 params
[14] = matrix
[11];
3045 params
[15] = matrix
[15];
3048 case GL_COLOR_MATRIX_SGI
:
3050 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
3051 params
[0] = matrix
[0];
3052 params
[1] = matrix
[1];
3053 params
[2] = matrix
[2];
3054 params
[3] = matrix
[3];
3055 params
[4] = matrix
[4];
3056 params
[5] = matrix
[5];
3057 params
[6] = matrix
[6];
3058 params
[7] = matrix
[7];
3059 params
[8] = matrix
[8];
3060 params
[9] = matrix
[9];
3061 params
[10] = matrix
[10];
3062 params
[11] = matrix
[11];
3063 params
[12] = matrix
[12];
3064 params
[13] = matrix
[13];
3065 params
[14] = matrix
[14];
3066 params
[15] = matrix
[15];
3069 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3070 params
[0] = (GLfloat
)(ctx
->ColorMatrixStack
.Depth
+ 1);
3072 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3073 params
[0] = (GLfloat
)(MAX_COLOR_STACK_DEPTH
);
3075 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3076 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[0];
3078 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3079 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[1];
3081 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3082 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[2];
3084 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3085 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[3];
3087 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3088 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[0];
3090 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3091 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[1];
3093 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3094 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[2];
3096 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3097 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[3];
3099 case GL_CONVOLUTION_1D_EXT
:
3100 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3101 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution1DEnabled
);
3103 case GL_CONVOLUTION_2D_EXT
:
3104 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3105 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution2DEnabled
);
3107 case GL_SEPARABLE_2D_EXT
:
3108 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3109 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Separable2DEnabled
);
3111 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3112 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3113 params
[0] = ctx
->Pixel
.PostConvolutionScale
[0];
3115 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3116 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3117 params
[0] = ctx
->Pixel
.PostConvolutionScale
[1];
3119 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3120 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3121 params
[0] = ctx
->Pixel
.PostConvolutionScale
[2];
3123 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3124 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3125 params
[0] = ctx
->Pixel
.PostConvolutionScale
[3];
3127 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3128 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3129 params
[0] = ctx
->Pixel
.PostConvolutionBias
[0];
3131 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3132 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3133 params
[0] = ctx
->Pixel
.PostConvolutionBias
[1];
3135 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3136 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3137 params
[0] = ctx
->Pixel
.PostConvolutionBias
[2];
3139 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3140 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3141 params
[0] = ctx
->Pixel
.PostConvolutionBias
[3];
3144 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3145 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.HistogramEnabled
);
3148 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3149 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MinMaxEnabled
);
3151 case GL_COLOR_TABLE_SGI
:
3152 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3153 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
]);
3155 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3156 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3157 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
]);
3159 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3160 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3161 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
]);
3163 case GL_TEXTURE_COLOR_TABLE_SGI
:
3164 CHECK_EXT1(SGI_texture_color_table
, "GetFloatv");
3165 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
3167 case GL_COLOR_SUM_EXT
:
3168 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetFloatv");
3169 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.ColorSumEnabled
);
3171 case GL_CURRENT_SECONDARY_COLOR_EXT
:
3172 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3174 FLUSH_CURRENT(ctx
, 0);
3175 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0];
3176 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1];
3177 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2];
3178 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3];
3181 case GL_SECONDARY_COLOR_ARRAY_EXT
:
3182 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3183 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
3185 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
3186 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3187 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
3189 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
3190 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3191 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
3193 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
3194 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3195 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
3197 case GL_CURRENT_FOG_COORDINATE_EXT
:
3198 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3200 FLUSH_CURRENT(ctx
, 0);
3201 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
3204 case GL_FOG_COORDINATE_ARRAY_EXT
:
3205 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3206 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
3208 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
3209 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3210 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
3212 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
3213 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3214 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
3216 case GL_FOG_COORDINATE_SOURCE_EXT
:
3217 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3218 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.FogCoordinateSource
);
3220 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
3221 CHECK_EXT1(EXT_texture_lod_bias
, "GetFloatv");
3222 params
[0] = ctx
->Const
.MaxTextureLodBias
;
3224 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
3225 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetFloatv");
3226 params
[0] = ctx
->Const
.MaxTextureMaxAnisotropy
;
3228 case GL_MULTISAMPLE_ARB
:
3229 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3230 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.Enabled
);
3232 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
3233 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3234 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToCoverage
);
3236 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
3237 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3238 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToOne
);
3240 case GL_SAMPLE_COVERAGE_ARB
:
3241 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3242 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverage
);
3244 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
3245 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3246 params
[0] = ctx
->Multisample
.SampleCoverageValue
;
3248 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
3249 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3250 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverageInvert
);
3252 case GL_SAMPLE_BUFFERS_ARB
:
3253 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3254 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
3256 case GL_SAMPLES_ARB
:
3257 CHECK_EXT1(ARB_multisample
, "GetFloatv");
3258 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.samples
);
3260 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
3261 CHECK_EXT1(IBM_rasterpos_clip
, "GetFloatv");
3262 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RasterPositionUnclipped
);
3264 case GL_POINT_SPRITE_NV
:
3265 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3266 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.PointSprite
);
3268 case GL_POINT_SPRITE_R_MODE_NV
:
3269 CHECK_EXT1(NV_point_sprite
, "GetFloatv");
3270 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteRMode
);
3272 case GL_POINT_SPRITE_COORD_ORIGIN
:
3273 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3274 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteOrigin
);
3276 case GL_GENERATE_MIPMAP_HINT_SGIS
:
3277 CHECK_EXT1(SGIS_generate_mipmap
, "GetFloatv");
3278 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.GenerateMipmap
);
3280 case GL_VERTEX_PROGRAM_BINDING_NV
:
3281 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3282 params
[0] = (GLfloat
)((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
3284 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
3285 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3286 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
3288 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
3289 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3290 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
3292 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
3293 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3294 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
3296 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
3297 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3298 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
3300 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
3301 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3302 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
3304 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
3305 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3306 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
3308 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
3309 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3310 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
3312 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
3313 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3314 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
3316 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
3317 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3318 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
3320 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
3321 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3322 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
3324 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
3325 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3326 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
3328 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
3329 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3330 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
3332 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
3333 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3334 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
3336 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
3337 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3338 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
3340 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
3341 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3342 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
3344 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
3345 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3346 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
3348 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
3349 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3350 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[0]);
3352 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
3353 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3354 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[1]);
3356 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
3357 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3358 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[2]);
3360 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
3361 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3362 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[3]);
3364 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
3365 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3366 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[4]);
3368 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
3369 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3370 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[5]);
3372 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
3373 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3374 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[6]);
3376 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
3377 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3378 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[7]);
3380 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
3381 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3382 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[8]);
3384 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
3385 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3386 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[9]);
3388 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
3389 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3390 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[10]);
3392 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
3393 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3394 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[11]);
3396 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
3397 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3398 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[12]);
3400 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
3401 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3402 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[13]);
3404 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
3405 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3406 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[14]);
3408 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
3409 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3410 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[15]);
3412 case GL_FRAGMENT_PROGRAM_NV
:
3413 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3414 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3416 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
3417 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3418 params
[0] = (GLfloat
)(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
3420 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
3421 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3422 params
[0] = (GLfloat
)(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
3424 case GL_TEXTURE_RECTANGLE_NV
:
3425 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3426 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
3428 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
3429 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3430 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
);
3432 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
3433 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3434 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureRectSize
);
3436 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
3437 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3438 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.TestTwoSide
);
3440 case GL_ACTIVE_STENCIL_FACE_EXT
:
3441 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3442 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
3444 case GL_MAX_SHININESS_NV
:
3445 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3446 params
[0] = ctx
->Const
.MaxShininess
;
3448 case GL_MAX_SPOT_EXPONENT_NV
:
3449 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3450 params
[0] = ctx
->Const
.MaxSpotExponent
;
3452 case GL_ARRAY_BUFFER_BINDING_ARB
:
3453 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3454 params
[0] = (GLfloat
)(ctx
->Array
.ArrayBufferObj
->Name
);
3456 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
3457 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3458 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
3460 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
3461 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3462 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
3464 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3465 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3466 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
3468 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
3469 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3470 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
3472 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
3473 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3474 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
3476 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
3477 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3478 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
3480 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3481 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3482 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
3484 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
3485 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3486 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
3488 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
3489 CHECK_EXT1(ARB_vertex_buffer_object
, "GetFloatv");
3490 params
[0] = (GLfloat
)(ctx
->Array
.ElementArrayBufferObj
->Name
);
3492 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
3493 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3494 params
[0] = (GLfloat
)(ctx
->Pack
.BufferObj
->Name
);
3496 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
3497 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3498 params
[0] = (GLfloat
)(ctx
->Unpack
.BufferObj
->Name
);
3500 case GL_VERTEX_PROGRAM_ARB
:
3501 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3502 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.Enabled
);
3504 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
3505 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3506 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.PointSizeEnabled
);
3508 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
3509 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3510 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.TwoSideEnabled
);
3512 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
3513 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3514 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrixStackDepth
);
3516 case GL_MAX_PROGRAM_MATRICES_ARB
:
3517 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3518 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrices
);
3520 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
3521 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3522 params
[0] = BOOLEAN_TO_FLOAT(ctx
->CurrentStack
->Depth
+ 1);
3524 case GL_CURRENT_MATRIX_ARB
:
3525 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3527 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3528 params
[0] = matrix
[0];
3529 params
[1] = matrix
[1];
3530 params
[2] = matrix
[2];
3531 params
[3] = matrix
[3];
3532 params
[4] = matrix
[4];
3533 params
[5] = matrix
[5];
3534 params
[6] = matrix
[6];
3535 params
[7] = matrix
[7];
3536 params
[8] = matrix
[8];
3537 params
[9] = matrix
[9];
3538 params
[10] = matrix
[10];
3539 params
[11] = matrix
[11];
3540 params
[12] = matrix
[12];
3541 params
[13] = matrix
[13];
3542 params
[14] = matrix
[14];
3543 params
[15] = matrix
[15];
3546 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
3547 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetFloatv");
3549 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3550 params
[0] = matrix
[0];
3551 params
[1] = matrix
[4];
3552 params
[2] = matrix
[8];
3553 params
[3] = matrix
[12];
3554 params
[4] = matrix
[1];
3555 params
[5] = matrix
[5];
3556 params
[6] = matrix
[9];
3557 params
[7] = matrix
[13];
3558 params
[8] = matrix
[2];
3559 params
[9] = matrix
[6];
3560 params
[10] = matrix
[10];
3561 params
[11] = matrix
[14];
3562 params
[12] = matrix
[3];
3563 params
[13] = matrix
[7];
3564 params
[14] = matrix
[11];
3565 params
[15] = matrix
[15];
3568 case GL_MAX_VERTEX_ATTRIBS_ARB
:
3569 CHECK_EXT1(ARB_vertex_program
, "GetFloatv");
3570 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxAttribs
);
3572 case GL_PROGRAM_ERROR_POSITION_ARB
:
3573 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetFloatv");
3574 params
[0] = (GLfloat
)(ctx
->Program
.ErrorPos
);
3576 case GL_FRAGMENT_PROGRAM_ARB
:
3577 CHECK_EXT1(ARB_fragment_program
, "GetFloatv");
3578 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3580 case GL_MAX_TEXTURE_COORDS_ARB
:
3581 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3582 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureCoordUnits
);
3584 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
3585 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3586 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureImageUnits
);
3588 case GL_DEPTH_BOUNDS_TEST_EXT
:
3589 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3590 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.BoundsTest
);
3592 case GL_DEPTH_BOUNDS_EXT
:
3593 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3594 params
[0] = ctx
->Depth
.BoundsMin
;
3595 params
[1] = ctx
->Depth
.BoundsMax
;
3597 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
3598 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3599 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.CallbackEnabled
);
3601 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
3602 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3603 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.CallbackEnabled
);
3605 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
3606 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3607 params
[0] = (GLfloat
)(ctx
->FragmentProgram
.CurrentPosition
);
3609 case GL_VERTEX_PROGRAM_POSITION_MESA
:
3610 CHECK_EXT1(MESA_program_debug
, "GetFloatv");
3611 params
[0] = (GLfloat
)(ctx
->VertexProgram
.CurrentPosition
);
3613 case GL_MAX_DRAW_BUFFERS_ARB
:
3614 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3615 params
[0] = (GLfloat
)(ctx
->Const
.MaxDrawBuffers
);
3617 case GL_DRAW_BUFFER0_ARB
:
3618 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3619 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
3621 case GL_DRAW_BUFFER1_ARB
:
3622 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3625 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3626 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3629 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
3630 params
[0] = ENUM_TO_FLOAT(buffer
);
3633 case GL_DRAW_BUFFER2_ARB
:
3634 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3637 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3638 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3641 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
3642 params
[0] = ENUM_TO_FLOAT(buffer
);
3645 case GL_DRAW_BUFFER3_ARB
:
3646 CHECK_EXT1(ARB_draw_buffers
, "GetFloatv");
3649 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3650 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3653 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
3654 params
[0] = ENUM_TO_FLOAT(buffer
);
3657 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
3658 CHECK_EXT1(OES_read_format
, "GetFloatv");
3659 params
[0] = (GLfloat
)(ctx
->Const
.ColorReadType
);
3661 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
3662 CHECK_EXT1(OES_read_format
, "GetFloatv");
3663 params
[0] = (GLfloat
)(ctx
->Const
.ColorReadFormat
);
3665 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
3666 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3667 params
[0] = (GLfloat
)(6);
3669 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
3670 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3671 params
[0] = (GLfloat
)(8);
3673 case GL_NUM_PASSES_ATI
:
3674 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3675 params
[0] = (GLfloat
)(2);
3677 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
3678 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3679 params
[0] = (GLfloat
)(8);
3681 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
3682 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3683 params
[0] = (GLfloat
)(16);
3685 case GL_COLOR_ALPHA_PAIRING_ATI
:
3686 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3687 params
[0] = BOOLEAN_TO_FLOAT(GL_TRUE
);
3689 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
3690 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3691 params
[0] = (GLfloat
)(3);
3693 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
3694 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3695 params
[0] = (GLfloat
)(3);
3697 case GL_STENCIL_BACK_FUNC
:
3698 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[1]);
3700 case GL_STENCIL_BACK_VALUE_MASK
:
3701 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[1]);
3703 case GL_STENCIL_BACK_WRITEMASK
:
3704 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[1]);
3706 case GL_STENCIL_BACK_REF
:
3707 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[1]);
3709 case GL_STENCIL_BACK_FAIL
:
3710 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[1]);
3712 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
3713 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[1]);
3715 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
3716 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[1]);
3718 case GL_FRAMEBUFFER_BINDING_EXT
:
3719 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3720 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Name
);
3722 case GL_RENDERBUFFER_BINDING_EXT
:
3723 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3724 params
[0] = (GLfloat
)(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
3726 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
3727 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3728 params
[0] = (GLfloat
)(ctx
->Const
.MaxColorAttachments
);
3730 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
3731 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3732 params
[0] = (GLfloat
)(ctx
->Const
.MaxRenderbufferSize
);
3734 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
3735 CHECK_EXT1(EXT_framebuffer_blit
, "GetFloatv");
3736 params
[0] = (GLfloat
)(ctx
->ReadBuffer
->Name
);
3738 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
3739 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3740 params
[0] = (GLfloat
)(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
3742 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
3743 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3744 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.FragmentShaderDerivative
);
3746 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
3747 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3748 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
3750 case GL_MAX_VARYING_FLOATS_ARB
:
3751 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3752 params
[0] = (GLfloat
)(ctx
->Const
.MaxVarying
* 4);
3754 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
3755 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3756 params
[0] = (GLfloat
)(ctx
->Const
.MaxVertexTextureImageUnits
);
3758 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
3759 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3760 params
[0] = (GLfloat
)(MAX_COMBINED_TEXTURE_IMAGE_UNITS
);
3762 case GL_CURRENT_PROGRAM
:
3763 CHECK_EXT1(ARB_shader_objects
, "GetFloatv");
3764 params
[0] = (GLfloat
)(ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0);
3767 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv(pname=0x%x)", pname
);
3772 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3774 GET_CURRENT_CONTEXT(ctx
);
3775 ASSERT_OUTSIDE_BEGIN_END(ctx
);
3781 _mesa_update_state(ctx
);
3783 if (ctx
->Driver
.GetIntegerv
&&
3784 ctx
->Driver
.GetIntegerv(ctx
, pname
, params
))
3788 case GL_ACCUM_RED_BITS
:
3789 params
[0] = ctx
->DrawBuffer
->Visual
.accumRedBits
;
3791 case GL_ACCUM_GREEN_BITS
:
3792 params
[0] = ctx
->DrawBuffer
->Visual
.accumGreenBits
;
3794 case GL_ACCUM_BLUE_BITS
:
3795 params
[0] = ctx
->DrawBuffer
->Visual
.accumBlueBits
;
3797 case GL_ACCUM_ALPHA_BITS
:
3798 params
[0] = ctx
->DrawBuffer
->Visual
.accumAlphaBits
;
3800 case GL_ACCUM_CLEAR_VALUE
:
3801 params
[0] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[0]);
3802 params
[1] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[1]);
3803 params
[2] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[2]);
3804 params
[3] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[3]);
3807 params
[0] = IROUND(ctx
->Pixel
.AlphaBias
);
3810 params
[0] = ctx
->DrawBuffer
->Visual
.alphaBits
;
3812 case GL_ALPHA_SCALE
:
3813 params
[0] = IROUND(ctx
->Pixel
.AlphaScale
);
3816 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.AlphaEnabled
);
3818 case GL_ALPHA_TEST_FUNC
:
3819 params
[0] = ENUM_TO_INT(ctx
->Color
.AlphaFunc
);
3821 case GL_ALPHA_TEST_REF
:
3822 params
[0] = FLOAT_TO_INT(ctx
->Color
.AlphaRef
);
3824 case GL_ATTRIB_STACK_DEPTH
:
3825 params
[0] = ctx
->AttribStackDepth
;
3827 case GL_AUTO_NORMAL
:
3828 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.AutoNormal
);
3830 case GL_AUX_BUFFERS
:
3831 params
[0] = ctx
->DrawBuffer
->Visual
.numAuxBuffers
;
3834 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.BlendEnabled
);
3837 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3840 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3842 case GL_BLEND_SRC_RGB_EXT
:
3843 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3845 case GL_BLEND_DST_RGB_EXT
:
3846 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3848 case GL_BLEND_SRC_ALPHA_EXT
:
3849 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcA
);
3851 case GL_BLEND_DST_ALPHA_EXT
:
3852 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstA
);
3854 case GL_BLEND_EQUATION
:
3855 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationRGB
);
3857 case GL_BLEND_EQUATION_ALPHA_EXT
:
3858 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationA
);
3860 case GL_BLEND_COLOR_EXT
:
3861 params
[0] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[0]);
3862 params
[1] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[1]);
3863 params
[2] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[2]);
3864 params
[3] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[3]);
3867 params
[0] = IROUND(ctx
->Pixel
.BlueBias
);
3870 params
[0] = ctx
->DrawBuffer
->Visual
.blueBits
;
3873 params
[0] = IROUND(ctx
->Pixel
.BlueScale
);
3875 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3876 params
[0] = ctx
->ClientAttribStackDepth
;
3878 case GL_CLIP_PLANE0
:
3879 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
3881 case GL_CLIP_PLANE1
:
3882 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
3884 case GL_CLIP_PLANE2
:
3885 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
3887 case GL_CLIP_PLANE3
:
3888 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
3890 case GL_CLIP_PLANE4
:
3891 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
3893 case GL_CLIP_PLANE5
:
3894 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
3896 case GL_COLOR_CLEAR_VALUE
:
3897 params
[0] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[0]);
3898 params
[1] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[1]);
3899 params
[2] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[2]);
3900 params
[3] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[3]);
3902 case GL_COLOR_MATERIAL
:
3903 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.ColorMaterialEnabled
);
3905 case GL_COLOR_MATERIAL_FACE
:
3906 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialFace
);
3908 case GL_COLOR_MATERIAL_PARAMETER
:
3909 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialMode
);
3911 case GL_COLOR_WRITEMASK
:
3912 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
3913 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
3914 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
3915 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
3918 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.CullFlag
);
3920 case GL_CULL_FACE_MODE
:
3921 params
[0] = ENUM_TO_INT(ctx
->Polygon
.CullFaceMode
);
3923 case GL_CURRENT_COLOR
:
3925 FLUSH_CURRENT(ctx
, 0);
3926 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
3927 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
3928 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
3929 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
3932 case GL_CURRENT_INDEX
:
3934 FLUSH_CURRENT(ctx
, 0);
3935 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
3938 case GL_CURRENT_NORMAL
:
3940 FLUSH_CURRENT(ctx
, 0);
3941 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
3942 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
3943 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
3946 case GL_CURRENT_RASTER_COLOR
:
3947 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[0]);
3948 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[1]);
3949 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[2]);
3950 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[3]);
3952 case GL_CURRENT_RASTER_DISTANCE
:
3953 params
[0] = IROUND(ctx
->Current
.RasterDistance
);
3955 case GL_CURRENT_RASTER_INDEX
:
3956 params
[0] = IROUND(ctx
->Current
.RasterIndex
);
3958 case GL_CURRENT_RASTER_POSITION
:
3959 params
[0] = IROUND(ctx
->Current
.RasterPos
[0]);
3960 params
[1] = IROUND(ctx
->Current
.RasterPos
[1]);
3961 params
[2] = IROUND(ctx
->Current
.RasterPos
[2]);
3962 params
[3] = IROUND(ctx
->Current
.RasterPos
[3]);
3964 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
3965 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[0]);
3966 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[1]);
3967 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[2]);
3968 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[3]);
3970 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
3972 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3973 params
[0] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][0]);
3974 params
[1] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][1]);
3975 params
[2] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][2]);
3976 params
[3] = IROUND(ctx
->Current
.RasterTexCoords
[texUnit
][3]);
3979 case GL_CURRENT_RASTER_POSITION_VALID
:
3980 params
[0] = BOOLEAN_TO_INT(ctx
->Current
.RasterPosValid
);
3982 case GL_CURRENT_TEXTURE_COORDS
:
3984 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3985 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0]);
3986 params
[1] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1]);
3987 params
[2] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2]);
3988 params
[3] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3]);
3992 params
[0] = IROUND(ctx
->Pixel
.DepthBias
);
3995 params
[0] = ctx
->DrawBuffer
->Visual
.depthBits
;
3997 case GL_DEPTH_CLEAR_VALUE
:
3998 params
[0] = IROUND(ctx
->Depth
.Clear
);
4001 params
[0] = ENUM_TO_INT(ctx
->Depth
.Func
);
4003 case GL_DEPTH_RANGE
:
4004 params
[0] = FLOAT_TO_INT(ctx
->Viewport
.Near
);
4005 params
[1] = FLOAT_TO_INT(ctx
->Viewport
.Far
);
4007 case GL_DEPTH_SCALE
:
4008 params
[0] = IROUND(ctx
->Pixel
.DepthScale
);
4011 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Test
);
4013 case GL_DEPTH_WRITEMASK
:
4014 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Mask
);
4017 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.DitherFlag
);
4019 case GL_DOUBLEBUFFER
:
4020 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
4022 case GL_DRAW_BUFFER
:
4023 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
4027 FLUSH_CURRENT(ctx
, 0);
4028 params
[0] = BOOLEAN_TO_INT((ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0));
4031 case GL_FEEDBACK_BUFFER_SIZE
:
4032 params
[0] = ctx
->Feedback
.BufferSize
;
4034 case GL_FEEDBACK_BUFFER_TYPE
:
4035 params
[0] = ENUM_TO_INT(ctx
->Feedback
.Type
);
4038 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.Enabled
);
4041 params
[0] = FLOAT_TO_INT(ctx
->Fog
.Color
[0]);
4042 params
[1] = FLOAT_TO_INT(ctx
->Fog
.Color
[1]);
4043 params
[2] = FLOAT_TO_INT(ctx
->Fog
.Color
[2]);
4044 params
[3] = FLOAT_TO_INT(ctx
->Fog
.Color
[3]);
4046 case GL_FOG_DENSITY
:
4047 params
[0] = IROUND(ctx
->Fog
.Density
);
4050 params
[0] = IROUND(ctx
->Fog
.End
);
4053 params
[0] = ENUM_TO_INT(ctx
->Hint
.Fog
);
4056 params
[0] = IROUND(ctx
->Fog
.Index
);
4059 params
[0] = ENUM_TO_INT(ctx
->Fog
.Mode
);
4062 params
[0] = IROUND(ctx
->Fog
.Start
);
4065 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontFace
);
4068 params
[0] = IROUND(ctx
->Pixel
.GreenBias
);
4071 params
[0] = ctx
->DrawBuffer
->Visual
.greenBits
;
4073 case GL_GREEN_SCALE
:
4074 params
[0] = IROUND(ctx
->Pixel
.GreenScale
);
4077 params
[0] = ctx
->DrawBuffer
->Visual
.indexBits
;
4079 case GL_INDEX_CLEAR_VALUE
:
4080 params
[0] = ctx
->Color
.ClearIndex
;
4083 params
[0] = BOOLEAN_TO_INT(!ctx
->DrawBuffer
->Visual
.rgbMode
);
4085 case GL_INDEX_OFFSET
:
4086 params
[0] = ctx
->Pixel
.IndexOffset
;
4088 case GL_INDEX_SHIFT
:
4089 params
[0] = ctx
->Pixel
.IndexShift
;
4091 case GL_INDEX_WRITEMASK
:
4092 params
[0] = ctx
->Color
.IndexMask
;
4095 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[0].Enabled
);
4098 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[1].Enabled
);
4101 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[2].Enabled
);
4104 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[3].Enabled
);
4107 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[4].Enabled
);
4110 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[5].Enabled
);
4113 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[6].Enabled
);
4116 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[7].Enabled
);
4119 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Enabled
);
4121 case GL_LIGHT_MODEL_AMBIENT
:
4122 params
[0] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[0]);
4123 params
[1] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[1]);
4124 params
[2] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[2]);
4125 params
[3] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[3]);
4127 case GL_LIGHT_MODEL_COLOR_CONTROL
:
4128 params
[0] = ENUM_TO_INT(ctx
->Light
.Model
.ColorControl
);
4130 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
4131 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.LocalViewer
);
4133 case GL_LIGHT_MODEL_TWO_SIDE
:
4134 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.TwoSide
);
4136 case GL_LINE_SMOOTH
:
4137 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.SmoothFlag
);
4139 case GL_LINE_SMOOTH_HINT
:
4140 params
[0] = ENUM_TO_INT(ctx
->Hint
.LineSmooth
);
4142 case GL_LINE_STIPPLE
:
4143 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.StippleFlag
);
4145 case GL_LINE_STIPPLE_PATTERN
:
4146 params
[0] = ctx
->Line
.StipplePattern
;
4148 case GL_LINE_STIPPLE_REPEAT
:
4149 params
[0] = ctx
->Line
.StippleFactor
;
4152 params
[0] = IROUND(ctx
->Line
.Width
);
4154 case GL_LINE_WIDTH_GRANULARITY
:
4155 params
[0] = IROUND(ctx
->Const
.LineWidthGranularity
);
4157 case GL_LINE_WIDTH_RANGE
:
4158 params
[0] = IROUND(ctx
->Const
.MinLineWidthAA
);
4159 params
[1] = IROUND(ctx
->Const
.MaxLineWidthAA
);
4161 case GL_ALIASED_LINE_WIDTH_RANGE
:
4162 params
[0] = IROUND(ctx
->Const
.MinLineWidth
);
4163 params
[1] = IROUND(ctx
->Const
.MaxLineWidth
);
4166 params
[0] = ctx
->List
.ListBase
;
4169 params
[0] = ctx
->ListState
.CurrentListNum
;
4174 if (!ctx
->CompileFlag
)
4176 else if (ctx
->ExecuteFlag
)
4177 mode
= GL_COMPILE_AND_EXECUTE
;
4180 params
[0] = ENUM_TO_INT(mode
);
4183 case GL_INDEX_LOGIC_OP
:
4184 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.IndexLogicOpEnabled
);
4186 case GL_COLOR_LOGIC_OP
:
4187 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.ColorLogicOpEnabled
);
4189 case GL_LOGIC_OP_MODE
:
4190 params
[0] = ENUM_TO_INT(ctx
->Color
.LogicOp
);
4192 case GL_MAP1_COLOR_4
:
4193 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Color4
);
4195 case GL_MAP1_GRID_DOMAIN
:
4196 params
[0] = IROUND(ctx
->Eval
.MapGrid1u1
);
4197 params
[1] = IROUND(ctx
->Eval
.MapGrid1u2
);
4199 case GL_MAP1_GRID_SEGMENTS
:
4200 params
[0] = ctx
->Eval
.MapGrid1un
;
4203 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Index
);
4205 case GL_MAP1_NORMAL
:
4206 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Normal
);
4208 case GL_MAP1_TEXTURE_COORD_1
:
4209 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord1
);
4211 case GL_MAP1_TEXTURE_COORD_2
:
4212 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord2
);
4214 case GL_MAP1_TEXTURE_COORD_3
:
4215 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord3
);
4217 case GL_MAP1_TEXTURE_COORD_4
:
4218 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord4
);
4220 case GL_MAP1_VERTEX_3
:
4221 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex3
);
4223 case GL_MAP1_VERTEX_4
:
4224 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex4
);
4226 case GL_MAP2_COLOR_4
:
4227 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Color4
);
4229 case GL_MAP2_GRID_DOMAIN
:
4230 params
[0] = IROUND(ctx
->Eval
.MapGrid2u1
);
4231 params
[1] = IROUND(ctx
->Eval
.MapGrid2u2
);
4232 params
[2] = IROUND(ctx
->Eval
.MapGrid2v1
);
4233 params
[3] = IROUND(ctx
->Eval
.MapGrid2v2
);
4235 case GL_MAP2_GRID_SEGMENTS
:
4236 params
[0] = ctx
->Eval
.MapGrid2un
;
4237 params
[1] = ctx
->Eval
.MapGrid2vn
;
4240 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Index
);
4242 case GL_MAP2_NORMAL
:
4243 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Normal
);
4245 case GL_MAP2_TEXTURE_COORD_1
:
4246 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord1
);
4248 case GL_MAP2_TEXTURE_COORD_2
:
4249 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord2
);
4251 case GL_MAP2_TEXTURE_COORD_3
:
4252 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord3
);
4254 case GL_MAP2_TEXTURE_COORD_4
:
4255 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord4
);
4257 case GL_MAP2_VERTEX_3
:
4258 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex3
);
4260 case GL_MAP2_VERTEX_4
:
4261 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex4
);
4264 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapColorFlag
);
4266 case GL_MAP_STENCIL
:
4267 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapStencilFlag
);
4269 case GL_MATRIX_MODE
:
4270 params
[0] = ENUM_TO_INT(ctx
->Transform
.MatrixMode
);
4272 case GL_MAX_ATTRIB_STACK_DEPTH
:
4273 params
[0] = MAX_ATTRIB_STACK_DEPTH
;
4275 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
4276 params
[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH
;
4278 case GL_MAX_CLIP_PLANES
:
4279 params
[0] = ctx
->Const
.MaxClipPlanes
;
4281 case GL_MAX_ELEMENTS_VERTICES
:
4282 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4284 case GL_MAX_ELEMENTS_INDICES
:
4285 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4287 case GL_MAX_EVAL_ORDER
:
4288 params
[0] = MAX_EVAL_ORDER
;
4291 params
[0] = ctx
->Const
.MaxLights
;
4293 case GL_MAX_LIST_NESTING
:
4294 params
[0] = MAX_LIST_NESTING
;
4296 case GL_MAX_MODELVIEW_STACK_DEPTH
:
4297 params
[0] = MAX_MODELVIEW_STACK_DEPTH
;
4299 case GL_MAX_NAME_STACK_DEPTH
:
4300 params
[0] = MAX_NAME_STACK_DEPTH
;
4302 case GL_MAX_PIXEL_MAP_TABLE
:
4303 params
[0] = MAX_PIXEL_MAP_TABLE
;
4305 case GL_MAX_PROJECTION_STACK_DEPTH
:
4306 params
[0] = MAX_PROJECTION_STACK_DEPTH
;
4308 case GL_MAX_TEXTURE_SIZE
:
4309 params
[0] = 1 << (ctx
->Const
.MaxTextureLevels
- 1);
4311 case GL_MAX_3D_TEXTURE_SIZE
:
4312 params
[0] = 1 << (ctx
->Const
.Max3DTextureLevels
- 1);
4314 case GL_MAX_TEXTURE_STACK_DEPTH
:
4315 params
[0] = MAX_TEXTURE_STACK_DEPTH
;
4317 case GL_MAX_VIEWPORT_DIMS
:
4318 params
[0] = ctx
->Const
.MaxViewportWidth
;
4319 params
[1] = ctx
->Const
.MaxViewportHeight
;
4321 case GL_MODELVIEW_MATRIX
:
4323 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4324 params
[0] = IROUND(matrix
[0]);
4325 params
[1] = IROUND(matrix
[1]);
4326 params
[2] = IROUND(matrix
[2]);
4327 params
[3] = IROUND(matrix
[3]);
4328 params
[4] = IROUND(matrix
[4]);
4329 params
[5] = IROUND(matrix
[5]);
4330 params
[6] = IROUND(matrix
[6]);
4331 params
[7] = IROUND(matrix
[7]);
4332 params
[8] = IROUND(matrix
[8]);
4333 params
[9] = IROUND(matrix
[9]);
4334 params
[10] = IROUND(matrix
[10]);
4335 params
[11] = IROUND(matrix
[11]);
4336 params
[12] = IROUND(matrix
[12]);
4337 params
[13] = IROUND(matrix
[13]);
4338 params
[14] = IROUND(matrix
[14]);
4339 params
[15] = IROUND(matrix
[15]);
4342 case GL_MODELVIEW_STACK_DEPTH
:
4343 params
[0] = ctx
->ModelviewMatrixStack
.Depth
+ 1;
4345 case GL_NAME_STACK_DEPTH
:
4346 params
[0] = ctx
->Select
.NameStackDepth
;
4349 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.Normalize
);
4351 case GL_PACK_ALIGNMENT
:
4352 params
[0] = ctx
->Pack
.Alignment
;
4354 case GL_PACK_LSB_FIRST
:
4355 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.LsbFirst
);
4357 case GL_PACK_ROW_LENGTH
:
4358 params
[0] = ctx
->Pack
.RowLength
;
4360 case GL_PACK_SKIP_PIXELS
:
4361 params
[0] = ctx
->Pack
.SkipPixels
;
4363 case GL_PACK_SKIP_ROWS
:
4364 params
[0] = ctx
->Pack
.SkipRows
;
4366 case GL_PACK_SWAP_BYTES
:
4367 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.SwapBytes
);
4369 case GL_PACK_SKIP_IMAGES_EXT
:
4370 params
[0] = ctx
->Pack
.SkipImages
;
4372 case GL_PACK_IMAGE_HEIGHT_EXT
:
4373 params
[0] = ctx
->Pack
.ImageHeight
;
4375 case GL_PACK_INVERT_MESA
:
4376 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.Invert
);
4378 case GL_PERSPECTIVE_CORRECTION_HINT
:
4379 params
[0] = ENUM_TO_INT(ctx
->Hint
.PerspectiveCorrection
);
4381 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4382 params
[0] = ctx
->PixelMaps
.AtoA
.Size
;
4384 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4385 params
[0] = ctx
->PixelMaps
.BtoB
.Size
;
4387 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4388 params
[0] = ctx
->PixelMaps
.GtoG
.Size
;
4390 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4391 params
[0] = ctx
->PixelMaps
.ItoA
.Size
;
4393 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4394 params
[0] = ctx
->PixelMaps
.ItoB
.Size
;
4396 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4397 params
[0] = ctx
->PixelMaps
.ItoG
.Size
;
4399 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4400 params
[0] = ctx
->PixelMaps
.ItoI
.Size
;
4402 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4403 params
[0] = ctx
->PixelMaps
.ItoR
.Size
;
4405 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4406 params
[0] = ctx
->PixelMaps
.RtoR
.Size
;
4408 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4409 params
[0] = ctx
->PixelMaps
.StoS
.Size
;
4412 params
[0] = IROUND(ctx
->Point
.Size
);
4414 case GL_POINT_SIZE_GRANULARITY
:
4415 params
[0] = IROUND(ctx
->Const
.PointSizeGranularity
);
4417 case GL_POINT_SIZE_RANGE
:
4418 params
[0] = IROUND(ctx
->Const
.MinPointSizeAA
);
4419 params
[1] = IROUND(ctx
->Const
.MaxPointSizeAA
);
4421 case GL_ALIASED_POINT_SIZE_RANGE
:
4422 params
[0] = IROUND(ctx
->Const
.MinPointSize
);
4423 params
[1] = IROUND(ctx
->Const
.MaxPointSize
);
4425 case GL_POINT_SMOOTH
:
4426 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.SmoothFlag
);
4428 case GL_POINT_SMOOTH_HINT
:
4429 params
[0] = ENUM_TO_INT(ctx
->Hint
.PointSmooth
);
4431 case GL_POINT_SIZE_MIN_EXT
:
4432 params
[0] = IROUND(ctx
->Point
.MinSize
);
4434 case GL_POINT_SIZE_MAX_EXT
:
4435 params
[0] = IROUND(ctx
->Point
.MaxSize
);
4437 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4438 params
[0] = IROUND(ctx
->Point
.Threshold
);
4440 case GL_DISTANCE_ATTENUATION_EXT
:
4441 params
[0] = IROUND(ctx
->Point
.Params
[0]);
4442 params
[1] = IROUND(ctx
->Point
.Params
[1]);
4443 params
[2] = IROUND(ctx
->Point
.Params
[2]);
4445 case GL_POLYGON_MODE
:
4446 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontMode
);
4447 params
[1] = ENUM_TO_INT(ctx
->Polygon
.BackMode
);
4449 case GL_POLYGON_OFFSET_BIAS_EXT
:
4450 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4452 case GL_POLYGON_OFFSET_FACTOR
:
4453 params
[0] = IROUND(ctx
->Polygon
.OffsetFactor
);
4455 case GL_POLYGON_OFFSET_UNITS
:
4456 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4458 case GL_POLYGON_SMOOTH
:
4459 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.SmoothFlag
);
4461 case GL_POLYGON_SMOOTH_HINT
:
4462 params
[0] = ENUM_TO_INT(ctx
->Hint
.PolygonSmooth
);
4464 case GL_POLYGON_STIPPLE
:
4465 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.StippleFlag
);
4467 case GL_PROJECTION_MATRIX
:
4469 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4470 params
[0] = IROUND(matrix
[0]);
4471 params
[1] = IROUND(matrix
[1]);
4472 params
[2] = IROUND(matrix
[2]);
4473 params
[3] = IROUND(matrix
[3]);
4474 params
[4] = IROUND(matrix
[4]);
4475 params
[5] = IROUND(matrix
[5]);
4476 params
[6] = IROUND(matrix
[6]);
4477 params
[7] = IROUND(matrix
[7]);
4478 params
[8] = IROUND(matrix
[8]);
4479 params
[9] = IROUND(matrix
[9]);
4480 params
[10] = IROUND(matrix
[10]);
4481 params
[11] = IROUND(matrix
[11]);
4482 params
[12] = IROUND(matrix
[12]);
4483 params
[13] = IROUND(matrix
[13]);
4484 params
[14] = IROUND(matrix
[14]);
4485 params
[15] = IROUND(matrix
[15]);
4488 case GL_PROJECTION_STACK_DEPTH
:
4489 params
[0] = ctx
->ProjectionMatrixStack
.Depth
+ 1;
4491 case GL_READ_BUFFER
:
4492 params
[0] = ENUM_TO_INT(ctx
->ReadBuffer
->ColorReadBuffer
);
4495 params
[0] = IROUND(ctx
->Pixel
.RedBias
);
4498 params
[0] = ctx
->DrawBuffer
->Visual
.redBits
;
4501 params
[0] = IROUND(ctx
->Pixel
.RedScale
);
4503 case GL_RENDER_MODE
:
4504 params
[0] = ENUM_TO_INT(ctx
->RenderMode
);
4506 case GL_RESCALE_NORMAL
:
4507 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RescaleNormals
);
4510 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.rgbMode
);
4512 case GL_SCISSOR_BOX
:
4513 params
[0] = ctx
->Scissor
.X
;
4514 params
[1] = ctx
->Scissor
.Y
;
4515 params
[2] = ctx
->Scissor
.Width
;
4516 params
[3] = ctx
->Scissor
.Height
;
4518 case GL_SCISSOR_TEST
:
4519 params
[0] = BOOLEAN_TO_INT(ctx
->Scissor
.Enabled
);
4521 case GL_SELECTION_BUFFER_SIZE
:
4522 params
[0] = ctx
->Select
.BufferSize
;
4524 case GL_SHADE_MODEL
:
4525 params
[0] = ENUM_TO_INT(ctx
->Light
.ShadeModel
);
4527 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4528 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.SharedPalette
);
4530 case GL_STENCIL_BITS
:
4531 params
[0] = ctx
->DrawBuffer
->Visual
.stencilBits
;
4533 case GL_STENCIL_CLEAR_VALUE
:
4534 params
[0] = ctx
->Stencil
.Clear
;
4536 case GL_STENCIL_FAIL
:
4537 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
4539 case GL_STENCIL_FUNC
:
4540 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
4542 case GL_STENCIL_PASS_DEPTH_FAIL
:
4543 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
4545 case GL_STENCIL_PASS_DEPTH_PASS
:
4546 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
4548 case GL_STENCIL_REF
:
4549 params
[0] = ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
4551 case GL_STENCIL_TEST
:
4552 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.Enabled
);
4554 case GL_STENCIL_VALUE_MASK
:
4555 params
[0] = ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
4557 case GL_STENCIL_WRITEMASK
:
4558 params
[0] = ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
4561 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.stereoMode
);
4563 case GL_SUBPIXEL_BITS
:
4564 params
[0] = ctx
->Const
.SubPixelBits
;
4567 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D
));
4570 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D
));
4573 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D
));
4575 case GL_TEXTURE_1D_ARRAY_EXT
:
4576 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4577 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
));
4579 case GL_TEXTURE_2D_ARRAY_EXT
:
4580 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4581 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
));
4583 case GL_TEXTURE_BINDING_1D
:
4584 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1D
->Name
;
4586 case GL_TEXTURE_BINDING_2D
:
4587 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2D
->Name
;
4589 case GL_TEXTURE_BINDING_3D
:
4590 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current3D
->Name
;
4592 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
4593 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4594 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current1DArray
->Name
;
4596 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
4597 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4598 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].Current2DArray
->Name
;
4600 case GL_TEXTURE_ENV_COLOR
:
4602 const GLfloat
*color
= ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvColor
;
4603 params
[0] = FLOAT_TO_INT(color
[0]);
4604 params
[1] = FLOAT_TO_INT(color
[1]);
4605 params
[2] = FLOAT_TO_INT(color
[2]);
4606 params
[3] = FLOAT_TO_INT(color
[3]);
4609 case GL_TEXTURE_ENV_MODE
:
4610 params
[0] = ENUM_TO_INT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].EnvMode
);
4612 case GL_TEXTURE_GEN_S
:
4613 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
4615 case GL_TEXTURE_GEN_T
:
4616 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
4618 case GL_TEXTURE_GEN_R
:
4619 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
4621 case GL_TEXTURE_GEN_Q
:
4622 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
4624 case GL_TEXTURE_MATRIX
:
4626 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
4627 params
[0] = IROUND(matrix
[0]);
4628 params
[1] = IROUND(matrix
[1]);
4629 params
[2] = IROUND(matrix
[2]);
4630 params
[3] = IROUND(matrix
[3]);
4631 params
[4] = IROUND(matrix
[4]);
4632 params
[5] = IROUND(matrix
[5]);
4633 params
[6] = IROUND(matrix
[6]);
4634 params
[7] = IROUND(matrix
[7]);
4635 params
[8] = IROUND(matrix
[8]);
4636 params
[9] = IROUND(matrix
[9]);
4637 params
[10] = IROUND(matrix
[10]);
4638 params
[11] = IROUND(matrix
[11]);
4639 params
[12] = IROUND(matrix
[12]);
4640 params
[13] = IROUND(matrix
[13]);
4641 params
[14] = IROUND(matrix
[14]);
4642 params
[15] = IROUND(matrix
[15]);
4645 case GL_TEXTURE_STACK_DEPTH
:
4646 params
[0] = ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Depth
+ 1;
4648 case GL_UNPACK_ALIGNMENT
:
4649 params
[0] = ctx
->Unpack
.Alignment
;
4651 case GL_UNPACK_LSB_FIRST
:
4652 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.LsbFirst
);
4654 case GL_UNPACK_ROW_LENGTH
:
4655 params
[0] = ctx
->Unpack
.RowLength
;
4657 case GL_UNPACK_SKIP_PIXELS
:
4658 params
[0] = ctx
->Unpack
.SkipPixels
;
4660 case GL_UNPACK_SKIP_ROWS
:
4661 params
[0] = ctx
->Unpack
.SkipRows
;
4663 case GL_UNPACK_SWAP_BYTES
:
4664 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.SwapBytes
);
4666 case GL_UNPACK_SKIP_IMAGES_EXT
:
4667 params
[0] = ctx
->Unpack
.SkipImages
;
4669 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4670 params
[0] = ctx
->Unpack
.ImageHeight
;
4672 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
4673 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.ClientStorage
);
4676 params
[0] = ctx
->Viewport
.X
;
4677 params
[1] = ctx
->Viewport
.Y
;
4678 params
[2] = ctx
->Viewport
.Width
;
4679 params
[3] = ctx
->Viewport
.Height
;
4682 params
[0] = IROUND(ctx
->Pixel
.ZoomX
);
4685 params
[0] = IROUND(ctx
->Pixel
.ZoomY
);
4687 case GL_VERTEX_ARRAY
:
4688 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
4690 case GL_VERTEX_ARRAY_SIZE
:
4691 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Size
;
4693 case GL_VERTEX_ARRAY_TYPE
:
4694 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
4696 case GL_VERTEX_ARRAY_STRIDE
:
4697 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Stride
;
4699 case GL_VERTEX_ARRAY_COUNT_EXT
:
4702 case GL_NORMAL_ARRAY
:
4703 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
4705 case GL_NORMAL_ARRAY_TYPE
:
4706 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Type
);
4708 case GL_NORMAL_ARRAY_STRIDE
:
4709 params
[0] = ctx
->Array
.ArrayObj
->Normal
.Stride
;
4711 case GL_NORMAL_ARRAY_COUNT_EXT
:
4714 case GL_COLOR_ARRAY
:
4715 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
4717 case GL_COLOR_ARRAY_SIZE
:
4718 params
[0] = ctx
->Array
.ArrayObj
->Color
.Size
;
4720 case GL_COLOR_ARRAY_TYPE
:
4721 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Color
.Type
);
4723 case GL_COLOR_ARRAY_STRIDE
:
4724 params
[0] = ctx
->Array
.ArrayObj
->Color
.Stride
;
4726 case GL_COLOR_ARRAY_COUNT_EXT
:
4729 case GL_INDEX_ARRAY
:
4730 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
4732 case GL_INDEX_ARRAY_TYPE
:
4733 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Index
.Type
);
4735 case GL_INDEX_ARRAY_STRIDE
:
4736 params
[0] = ctx
->Array
.ArrayObj
->Index
.Stride
;
4738 case GL_INDEX_ARRAY_COUNT_EXT
:
4741 case GL_TEXTURE_COORD_ARRAY
:
4742 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
4744 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4745 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
;
4747 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4748 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
4750 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4751 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
;
4753 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4756 case GL_EDGE_FLAG_ARRAY
:
4757 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
4759 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4760 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
;
4762 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4765 case GL_MAX_TEXTURE_UNITS_ARB
:
4766 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4767 params
[0] = ctx
->Const
.MaxTextureUnits
;
4769 case GL_ACTIVE_TEXTURE_ARB
:
4770 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4771 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4773 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4774 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4775 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4777 case GL_TEXTURE_CUBE_MAP_ARB
:
4778 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4779 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
4781 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4782 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4783 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentCubeMap
->Name
;
4785 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4786 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4787 params
[0] = (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
4789 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4790 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4791 params
[0] = ctx
->Hint
.TextureCompression
;
4793 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4794 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4795 params
[0] = _mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
);
4797 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4798 CHECK_EXT1(ARB_texture_compression
, "GetIntegerv");
4801 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
4803 for (i
= 0; i
< n
; i
++)
4804 params
[i
] = ENUM_TO_INT(formats
[i
]);
4807 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4808 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4809 params
[0] = ctx
->Array
.LockFirst
;
4811 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4812 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4813 params
[0] = ctx
->Array
.LockCount
;
4815 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4817 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4818 params
[0] = IROUND(matrix
[0]);
4819 params
[1] = IROUND(matrix
[4]);
4820 params
[2] = IROUND(matrix
[8]);
4821 params
[3] = IROUND(matrix
[12]);
4822 params
[4] = IROUND(matrix
[1]);
4823 params
[5] = IROUND(matrix
[5]);
4824 params
[6] = IROUND(matrix
[9]);
4825 params
[7] = IROUND(matrix
[13]);
4826 params
[8] = IROUND(matrix
[2]);
4827 params
[9] = IROUND(matrix
[6]);
4828 params
[10] = IROUND(matrix
[10]);
4829 params
[11] = IROUND(matrix
[14]);
4830 params
[12] = IROUND(matrix
[3]);
4831 params
[13] = IROUND(matrix
[7]);
4832 params
[14] = IROUND(matrix
[11]);
4833 params
[15] = IROUND(matrix
[15]);
4836 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4838 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4839 params
[0] = IROUND(matrix
[0]);
4840 params
[1] = IROUND(matrix
[4]);
4841 params
[2] = IROUND(matrix
[8]);
4842 params
[3] = IROUND(matrix
[12]);
4843 params
[4] = IROUND(matrix
[1]);
4844 params
[5] = IROUND(matrix
[5]);
4845 params
[6] = IROUND(matrix
[9]);
4846 params
[7] = IROUND(matrix
[13]);
4847 params
[8] = IROUND(matrix
[2]);
4848 params
[9] = IROUND(matrix
[6]);
4849 params
[10] = IROUND(matrix
[10]);
4850 params
[11] = IROUND(matrix
[14]);
4851 params
[12] = IROUND(matrix
[3]);
4852 params
[13] = IROUND(matrix
[7]);
4853 params
[14] = IROUND(matrix
[11]);
4854 params
[15] = IROUND(matrix
[15]);
4857 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4859 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4860 params
[0] = IROUND(matrix
[0]);
4861 params
[1] = IROUND(matrix
[4]);
4862 params
[2] = IROUND(matrix
[8]);
4863 params
[3] = IROUND(matrix
[12]);
4864 params
[4] = IROUND(matrix
[1]);
4865 params
[5] = IROUND(matrix
[5]);
4866 params
[6] = IROUND(matrix
[9]);
4867 params
[7] = IROUND(matrix
[13]);
4868 params
[8] = IROUND(matrix
[2]);
4869 params
[9] = IROUND(matrix
[6]);
4870 params
[10] = IROUND(matrix
[10]);
4871 params
[11] = IROUND(matrix
[14]);
4872 params
[12] = IROUND(matrix
[3]);
4873 params
[13] = IROUND(matrix
[7]);
4874 params
[14] = IROUND(matrix
[11]);
4875 params
[15] = IROUND(matrix
[15]);
4878 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4880 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
4881 params
[0] = IROUND(matrix
[0]);
4882 params
[1] = IROUND(matrix
[4]);
4883 params
[2] = IROUND(matrix
[8]);
4884 params
[3] = IROUND(matrix
[12]);
4885 params
[4] = IROUND(matrix
[1]);
4886 params
[5] = IROUND(matrix
[5]);
4887 params
[6] = IROUND(matrix
[9]);
4888 params
[7] = IROUND(matrix
[13]);
4889 params
[8] = IROUND(matrix
[2]);
4890 params
[9] = IROUND(matrix
[6]);
4891 params
[10] = IROUND(matrix
[10]);
4892 params
[11] = IROUND(matrix
[14]);
4893 params
[12] = IROUND(matrix
[3]);
4894 params
[13] = IROUND(matrix
[7]);
4895 params
[14] = IROUND(matrix
[11]);
4896 params
[15] = IROUND(matrix
[15]);
4899 case GL_COLOR_MATRIX_SGI
:
4901 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4902 params
[0] = IROUND(matrix
[0]);
4903 params
[1] = IROUND(matrix
[1]);
4904 params
[2] = IROUND(matrix
[2]);
4905 params
[3] = IROUND(matrix
[3]);
4906 params
[4] = IROUND(matrix
[4]);
4907 params
[5] = IROUND(matrix
[5]);
4908 params
[6] = IROUND(matrix
[6]);
4909 params
[7] = IROUND(matrix
[7]);
4910 params
[8] = IROUND(matrix
[8]);
4911 params
[9] = IROUND(matrix
[9]);
4912 params
[10] = IROUND(matrix
[10]);
4913 params
[11] = IROUND(matrix
[11]);
4914 params
[12] = IROUND(matrix
[12]);
4915 params
[13] = IROUND(matrix
[13]);
4916 params
[14] = IROUND(matrix
[14]);
4917 params
[15] = IROUND(matrix
[15]);
4920 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4921 params
[0] = ctx
->ColorMatrixStack
.Depth
+ 1;
4923 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4924 params
[0] = MAX_COLOR_STACK_DEPTH
;
4926 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4927 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[0]);
4929 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4930 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[1]);
4932 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4933 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[2]);
4935 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4936 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[3]);
4938 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4939 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[0]);
4941 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4942 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[1]);
4944 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4945 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[2]);
4947 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4948 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[3]);
4950 case GL_CONVOLUTION_1D_EXT
:
4951 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4952 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution1DEnabled
);
4954 case GL_CONVOLUTION_2D_EXT
:
4955 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4956 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution2DEnabled
);
4958 case GL_SEPARABLE_2D_EXT
:
4959 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4960 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Separable2DEnabled
);
4962 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4963 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4964 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[0]);
4966 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4967 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4968 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[1]);
4970 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
4971 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4972 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[2]);
4974 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
4975 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4976 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[3]);
4978 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
4979 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4980 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[0]);
4982 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
4983 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4984 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[1]);
4986 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
4987 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4988 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[2]);
4990 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
4991 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
4992 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[3]);
4995 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
4996 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.HistogramEnabled
);
4999 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
5000 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MinMaxEnabled
);
5002 case GL_COLOR_TABLE_SGI
:
5003 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5004 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
]);
5006 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
5007 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5008 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
]);
5010 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
5011 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5012 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
]);
5014 case GL_TEXTURE_COLOR_TABLE_SGI
:
5015 CHECK_EXT1(SGI_texture_color_table
, "GetIntegerv");
5016 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
5018 case GL_COLOR_SUM_EXT
:
5019 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetIntegerv");
5020 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.ColorSumEnabled
);
5022 case GL_CURRENT_SECONDARY_COLOR_EXT
:
5023 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5025 FLUSH_CURRENT(ctx
, 0);
5026 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
5027 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
5028 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
5029 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
5032 case GL_SECONDARY_COLOR_ARRAY_EXT
:
5033 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5034 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
5036 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
5037 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5038 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
5040 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
5041 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5042 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
;
5044 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
5045 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5046 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Size
;
5048 case GL_CURRENT_FOG_COORDINATE_EXT
:
5049 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5051 FLUSH_CURRENT(ctx
, 0);
5052 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
5055 case GL_FOG_COORDINATE_ARRAY_EXT
:
5056 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5057 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
5059 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
5060 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5061 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
5063 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
5064 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5065 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Stride
;
5067 case GL_FOG_COORDINATE_SOURCE_EXT
:
5068 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5069 params
[0] = ENUM_TO_INT(ctx
->Fog
.FogCoordinateSource
);
5071 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
5072 CHECK_EXT1(EXT_texture_lod_bias
, "GetIntegerv");
5073 params
[0] = IROUND(ctx
->Const
.MaxTextureLodBias
);
5075 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
5076 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetIntegerv");
5077 params
[0] = IROUND(ctx
->Const
.MaxTextureMaxAnisotropy
);
5079 case GL_MULTISAMPLE_ARB
:
5080 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5081 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.Enabled
);
5083 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
5084 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5085 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToCoverage
);
5087 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
5088 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5089 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToOne
);
5091 case GL_SAMPLE_COVERAGE_ARB
:
5092 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5093 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverage
);
5095 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
5096 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5097 params
[0] = IROUND(ctx
->Multisample
.SampleCoverageValue
);
5099 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
5100 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5101 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverageInvert
);
5103 case GL_SAMPLE_BUFFERS_ARB
:
5104 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5105 params
[0] = ctx
->DrawBuffer
->Visual
.sampleBuffers
;
5107 case GL_SAMPLES_ARB
:
5108 CHECK_EXT1(ARB_multisample
, "GetIntegerv");
5109 params
[0] = ctx
->DrawBuffer
->Visual
.samples
;
5111 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
5112 CHECK_EXT1(IBM_rasterpos_clip
, "GetIntegerv");
5113 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RasterPositionUnclipped
);
5115 case GL_POINT_SPRITE_NV
:
5116 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5117 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.PointSprite
);
5119 case GL_POINT_SPRITE_R_MODE_NV
:
5120 CHECK_EXT1(NV_point_sprite
, "GetIntegerv");
5121 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteRMode
);
5123 case GL_POINT_SPRITE_COORD_ORIGIN
:
5124 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5125 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteOrigin
);
5127 case GL_GENERATE_MIPMAP_HINT_SGIS
:
5128 CHECK_EXT1(SGIS_generate_mipmap
, "GetIntegerv");
5129 params
[0] = ENUM_TO_INT(ctx
->Hint
.GenerateMipmap
);
5131 case GL_VERTEX_PROGRAM_BINDING_NV
:
5132 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5133 params
[0] = (ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0);
5135 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
5136 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5137 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
5139 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
5140 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5141 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
5143 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
5144 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5145 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
5147 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
5148 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5149 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
5151 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
5152 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5153 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
5155 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
5156 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5157 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
5159 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
5160 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5161 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
5163 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
5164 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5165 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
5167 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
5168 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5169 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
5171 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
5172 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5173 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
5175 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
5176 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5177 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
5179 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
5180 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5181 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
5183 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
5184 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5185 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
5187 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
5188 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5189 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
5191 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
5192 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5193 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
5195 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
5196 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5197 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
5199 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
5200 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5201 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[0]);
5203 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
5204 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5205 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[1]);
5207 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
5208 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5209 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[2]);
5211 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
5212 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5213 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[3]);
5215 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
5216 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5217 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[4]);
5219 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
5220 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5221 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[5]);
5223 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
5224 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5225 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[6]);
5227 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
5228 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5229 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[7]);
5231 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
5232 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5233 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[8]);
5235 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
5236 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5237 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[9]);
5239 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
5240 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5241 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[10]);
5243 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
5244 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5245 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[11]);
5247 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
5248 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5249 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[12]);
5251 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
5252 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5253 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[13]);
5255 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
5256 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5257 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[14]);
5259 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
5260 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5261 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[15]);
5263 case GL_FRAGMENT_PROGRAM_NV
:
5264 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5265 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5267 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
5268 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5269 params
[0] = ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0;
5271 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
5272 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5273 params
[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
5275 case GL_TEXTURE_RECTANGLE_NV
:
5276 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5277 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
5279 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
5280 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5281 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentRect
->Name
;
5283 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
5284 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5285 params
[0] = ctx
->Const
.MaxTextureRectSize
;
5287 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
5288 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5289 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.TestTwoSide
);
5291 case GL_ACTIVE_STENCIL_FACE_EXT
:
5292 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5293 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
5295 case GL_MAX_SHININESS_NV
:
5296 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5297 params
[0] = IROUND(ctx
->Const
.MaxShininess
);
5299 case GL_MAX_SPOT_EXPONENT_NV
:
5300 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5301 params
[0] = IROUND(ctx
->Const
.MaxSpotExponent
);
5303 case GL_ARRAY_BUFFER_BINDING_ARB
:
5304 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5305 params
[0] = ctx
->Array
.ArrayBufferObj
->Name
;
5307 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
5308 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5309 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
;
5311 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
5312 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5313 params
[0] = ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
;
5315 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5316 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5317 params
[0] = ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
;
5319 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
5320 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5321 params
[0] = ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
;
5323 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
5324 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5325 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
;
5327 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
5328 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5329 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
;
5331 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5332 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5333 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
;
5335 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
5336 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5337 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
;
5339 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
5340 CHECK_EXT1(ARB_vertex_buffer_object
, "GetIntegerv");
5341 params
[0] = ctx
->Array
.ElementArrayBufferObj
->Name
;
5343 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
5344 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5345 params
[0] = ctx
->Pack
.BufferObj
->Name
;
5347 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
5348 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5349 params
[0] = ctx
->Unpack
.BufferObj
->Name
;
5351 case GL_VERTEX_PROGRAM_ARB
:
5352 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5353 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.Enabled
);
5355 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
5356 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5357 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.PointSizeEnabled
);
5359 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
5360 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5361 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.TwoSideEnabled
);
5363 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
5364 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5365 params
[0] = ctx
->Const
.MaxProgramMatrixStackDepth
;
5367 case GL_MAX_PROGRAM_MATRICES_ARB
:
5368 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5369 params
[0] = ctx
->Const
.MaxProgramMatrices
;
5371 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
5372 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5373 params
[0] = BOOLEAN_TO_INT(ctx
->CurrentStack
->Depth
+ 1);
5375 case GL_CURRENT_MATRIX_ARB
:
5376 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5378 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5379 params
[0] = IROUND(matrix
[0]);
5380 params
[1] = IROUND(matrix
[1]);
5381 params
[2] = IROUND(matrix
[2]);
5382 params
[3] = IROUND(matrix
[3]);
5383 params
[4] = IROUND(matrix
[4]);
5384 params
[5] = IROUND(matrix
[5]);
5385 params
[6] = IROUND(matrix
[6]);
5386 params
[7] = IROUND(matrix
[7]);
5387 params
[8] = IROUND(matrix
[8]);
5388 params
[9] = IROUND(matrix
[9]);
5389 params
[10] = IROUND(matrix
[10]);
5390 params
[11] = IROUND(matrix
[11]);
5391 params
[12] = IROUND(matrix
[12]);
5392 params
[13] = IROUND(matrix
[13]);
5393 params
[14] = IROUND(matrix
[14]);
5394 params
[15] = IROUND(matrix
[15]);
5397 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
5398 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetIntegerv");
5400 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5401 params
[0] = IROUND(matrix
[0]);
5402 params
[1] = IROUND(matrix
[4]);
5403 params
[2] = IROUND(matrix
[8]);
5404 params
[3] = IROUND(matrix
[12]);
5405 params
[4] = IROUND(matrix
[1]);
5406 params
[5] = IROUND(matrix
[5]);
5407 params
[6] = IROUND(matrix
[9]);
5408 params
[7] = IROUND(matrix
[13]);
5409 params
[8] = IROUND(matrix
[2]);
5410 params
[9] = IROUND(matrix
[6]);
5411 params
[10] = IROUND(matrix
[10]);
5412 params
[11] = IROUND(matrix
[14]);
5413 params
[12] = IROUND(matrix
[3]);
5414 params
[13] = IROUND(matrix
[7]);
5415 params
[14] = IROUND(matrix
[11]);
5416 params
[15] = IROUND(matrix
[15]);
5419 case GL_MAX_VERTEX_ATTRIBS_ARB
:
5420 CHECK_EXT1(ARB_vertex_program
, "GetIntegerv");
5421 params
[0] = ctx
->Const
.VertexProgram
.MaxAttribs
;
5423 case GL_PROGRAM_ERROR_POSITION_ARB
:
5424 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetIntegerv");
5425 params
[0] = ctx
->Program
.ErrorPos
;
5427 case GL_FRAGMENT_PROGRAM_ARB
:
5428 CHECK_EXT1(ARB_fragment_program
, "GetIntegerv");
5429 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5431 case GL_MAX_TEXTURE_COORDS_ARB
:
5432 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5433 params
[0] = ctx
->Const
.MaxTextureCoordUnits
;
5435 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
5436 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5437 params
[0] = ctx
->Const
.MaxTextureImageUnits
;
5439 case GL_DEPTH_BOUNDS_TEST_EXT
:
5440 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5441 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.BoundsTest
);
5443 case GL_DEPTH_BOUNDS_EXT
:
5444 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5445 params
[0] = IROUND(ctx
->Depth
.BoundsMin
);
5446 params
[1] = IROUND(ctx
->Depth
.BoundsMax
);
5448 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
5449 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5450 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.CallbackEnabled
);
5452 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
5453 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5454 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.CallbackEnabled
);
5456 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
5457 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5458 params
[0] = ctx
->FragmentProgram
.CurrentPosition
;
5460 case GL_VERTEX_PROGRAM_POSITION_MESA
:
5461 CHECK_EXT1(MESA_program_debug
, "GetIntegerv");
5462 params
[0] = ctx
->VertexProgram
.CurrentPosition
;
5464 case GL_MAX_DRAW_BUFFERS_ARB
:
5465 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5466 params
[0] = ctx
->Const
.MaxDrawBuffers
;
5468 case GL_DRAW_BUFFER0_ARB
:
5469 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5470 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
5472 case GL_DRAW_BUFFER1_ARB
:
5473 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5476 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5477 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5480 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
5481 params
[0] = ENUM_TO_INT(buffer
);
5484 case GL_DRAW_BUFFER2_ARB
:
5485 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5488 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5489 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5492 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
5493 params
[0] = ENUM_TO_INT(buffer
);
5496 case GL_DRAW_BUFFER3_ARB
:
5497 CHECK_EXT1(ARB_draw_buffers
, "GetIntegerv");
5500 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5501 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5504 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
5505 params
[0] = ENUM_TO_INT(buffer
);
5508 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
5509 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5510 params
[0] = ctx
->Const
.ColorReadType
;
5512 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
5513 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5514 params
[0] = ctx
->Const
.ColorReadFormat
;
5516 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
5517 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5520 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
5521 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5524 case GL_NUM_PASSES_ATI
:
5525 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5528 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
5529 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5532 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
5533 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5536 case GL_COLOR_ALPHA_PAIRING_ATI
:
5537 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5538 params
[0] = BOOLEAN_TO_INT(GL_TRUE
);
5540 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
5541 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5544 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
5545 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5548 case GL_STENCIL_BACK_FUNC
:
5549 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[1]);
5551 case GL_STENCIL_BACK_VALUE_MASK
:
5552 params
[0] = ctx
->Stencil
.ValueMask
[1];
5554 case GL_STENCIL_BACK_WRITEMASK
:
5555 params
[0] = ctx
->Stencil
.WriteMask
[1];
5557 case GL_STENCIL_BACK_REF
:
5558 params
[0] = ctx
->Stencil
.Ref
[1];
5560 case GL_STENCIL_BACK_FAIL
:
5561 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[1]);
5563 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
5564 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[1]);
5566 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
5567 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[1]);
5569 case GL_FRAMEBUFFER_BINDING_EXT
:
5570 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5571 params
[0] = ctx
->DrawBuffer
->Name
;
5573 case GL_RENDERBUFFER_BINDING_EXT
:
5574 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5575 params
[0] = ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0;
5577 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
5578 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5579 params
[0] = ctx
->Const
.MaxColorAttachments
;
5581 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
5582 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5583 params
[0] = ctx
->Const
.MaxRenderbufferSize
;
5585 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
5586 CHECK_EXT1(EXT_framebuffer_blit
, "GetIntegerv");
5587 params
[0] = ctx
->ReadBuffer
->Name
;
5589 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
5590 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5591 params
[0] = ctx
->Const
.FragmentProgram
.MaxUniformComponents
;
5593 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
5594 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5595 params
[0] = ENUM_TO_INT(ctx
->Hint
.FragmentShaderDerivative
);
5597 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
5598 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5599 params
[0] = ctx
->Const
.VertexProgram
.MaxUniformComponents
;
5601 case GL_MAX_VARYING_FLOATS_ARB
:
5602 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5603 params
[0] = ctx
->Const
.MaxVarying
* 4;
5605 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
5606 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5607 params
[0] = ctx
->Const
.MaxVertexTextureImageUnits
;
5609 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
5610 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5611 params
[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS
;
5613 case GL_CURRENT_PROGRAM
:
5614 CHECK_EXT1(ARB_shader_objects
, "GetIntegerv");
5615 params
[0] = ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0;
5618 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv(pname=0x%x)", pname
);
5624 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
5626 const GLfloat magic
= -1234.5F
;
5633 /* Init temp array to magic numbers so we can figure out how many values
5634 * are returned by the GetFloatv() call.
5636 for (i
= 0; i
< 16; i
++)
5639 _mesa_GetFloatv(pname
, values
);
5641 for (i
= 0; i
< 16 && values
[i
] != magic
; i
++)
5642 params
[i
] = (GLdouble
) values
[i
];