3 *** NOTE!!! DO NOT EDIT THIS FILE!!! IT IS GENERATED BY get_gen.py
9 #include "extensions.h"
14 #include "texcompress.h"
15 #include "framebuffer.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 INT64_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
23 #define INT64_TO_INT(I) ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) )
25 #define BOOLEAN_TO_INT(B) ( (GLint) (B) )
26 #define BOOLEAN_TO_INT64(B) ( (GLint64) (B) )
27 #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
29 #define ENUM_TO_INT64(E) ( (GLint64) (E) )
33 * Check if named extension is enabled, if not generate error and return.
35 #define CHECK_EXT1(EXT1, FUNC) \
36 if (!ctx->Extensions.EXT1) { \
37 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
42 * Check if either of two extensions is enabled.
44 #define CHECK_EXT2(EXT1, EXT2, FUNC) \
45 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
46 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
51 * Check if either of three extensions is enabled.
53 #define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC) \
54 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \
55 !ctx->Extensions.EXT3) { \
56 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
61 * Check if either of four extensions is enabled.
63 #define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC) \
64 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 && \
65 !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) { \
66 _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname); \
72 _mesa_GetBooleanv( GLenum pname
, GLboolean
*params
)
74 GET_CURRENT_CONTEXT(ctx
);
75 ASSERT_OUTSIDE_BEGIN_END(ctx
);
81 _mesa_update_state(ctx
);
83 if (ctx
->Driver
.GetBooleanv
&&
84 ctx
->Driver
.GetBooleanv(ctx
, pname
, params
))
88 case GL_ACCUM_RED_BITS
:
89 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumRedBits
);
91 case GL_ACCUM_GREEN_BITS
:
92 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
94 case GL_ACCUM_BLUE_BITS
:
95 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
97 case GL_ACCUM_ALPHA_BITS
:
98 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
100 case GL_ACCUM_CLEAR_VALUE
:
101 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[0]);
102 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[1]);
103 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[2]);
104 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Accum
.ClearColor
[3]);
107 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.AlphaBias
);
110 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.alphaBits
);
113 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.AlphaScale
);
116 params
[0] = ctx
->Color
.AlphaEnabled
;
118 case GL_ALPHA_TEST_FUNC
:
119 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.AlphaFunc
);
121 case GL_ALPHA_TEST_REF
:
122 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.AlphaRef
);
124 case GL_ATTRIB_STACK_DEPTH
:
125 params
[0] = INT_TO_BOOLEAN(ctx
->AttribStackDepth
);
128 params
[0] = ctx
->Eval
.AutoNormal
;
131 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
134 params
[0] = (ctx
->Color
.BlendEnabled
& 1);
137 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstRGB
);
140 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcRGB
);
142 case GL_BLEND_SRC_RGB_EXT
:
143 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcRGB
);
145 case GL_BLEND_DST_RGB_EXT
:
146 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstRGB
);
148 case GL_BLEND_SRC_ALPHA_EXT
:
149 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendSrcA
);
151 case GL_BLEND_DST_ALPHA_EXT
:
152 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendDstA
);
154 case GL_BLEND_EQUATION
:
155 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendEquationRGB
);
157 case GL_BLEND_EQUATION_ALPHA_EXT
:
158 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.BlendEquationA
);
160 case GL_BLEND_COLOR_EXT
:
161 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[0]);
162 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[1]);
163 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[2]);
164 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Color
.BlendColor
[3]);
167 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.BlueBias
);
170 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.blueBits
);
173 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.BlueScale
);
175 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
176 params
[0] = INT_TO_BOOLEAN(ctx
->ClientAttribStackDepth
);
179 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1;
182 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1;
185 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1;
188 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1;
191 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1;
194 params
[0] = (ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1;
196 case GL_COLOR_CLEAR_VALUE
:
197 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[0]);
198 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[1]);
199 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[2]);
200 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Color
.ClearColor
[3]);
202 case GL_COLOR_MATERIAL
:
203 params
[0] = ctx
->Light
.ColorMaterialEnabled
;
205 case GL_COLOR_MATERIAL_FACE
:
206 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ColorMaterialFace
);
208 case GL_COLOR_MATERIAL_PARAMETER
:
209 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ColorMaterialMode
);
211 case GL_COLOR_WRITEMASK
:
212 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[0][RCOMP
] ? 1 : 0);
213 params
[1] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[0][GCOMP
] ? 1 : 0);
214 params
[2] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[0][BCOMP
] ? 1 : 0);
215 params
[3] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[0][ACOMP
] ? 1 : 0);
218 params
[0] = ctx
->Polygon
.CullFlag
;
220 case GL_CULL_FACE_MODE
:
221 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.CullFaceMode
);
223 case GL_CURRENT_COLOR
:
225 FLUSH_CURRENT(ctx
, 0);
226 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
227 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
228 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
229 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
232 case GL_CURRENT_INDEX
:
234 FLUSH_CURRENT(ctx
, 0);
235 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
238 case GL_CURRENT_NORMAL
:
240 FLUSH_CURRENT(ctx
, 0);
241 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
242 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
243 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
246 case GL_CURRENT_RASTER_COLOR
:
247 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[0]);
248 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[1]);
249 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[2]);
250 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterColor
[3]);
252 case GL_CURRENT_RASTER_DISTANCE
:
253 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterDistance
);
255 case GL_CURRENT_RASTER_INDEX
:
256 params
[0] = FLOAT_TO_BOOLEAN(1.0);
258 case GL_CURRENT_RASTER_POSITION
:
259 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[0]);
260 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[1]);
261 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[2]);
262 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterPos
[3]);
264 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
265 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[0]);
266 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[1]);
267 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[2]);
268 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterSecondaryColor
[3]);
270 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
272 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
273 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
274 _mesa_error(ctx
, GL_INVALID_OPERATION
,
275 "glGet(raster tex coords, unit %u)", unit
);
278 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[unit
][0]);
279 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[unit
][1]);
280 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[unit
][2]);
281 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.RasterTexCoords
[unit
][3]);
284 case GL_CURRENT_RASTER_POSITION_VALID
:
285 params
[0] = ctx
->Current
.RasterPosValid
;
287 case GL_CURRENT_TEXTURE_COORDS
:
289 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
290 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
291 _mesa_error(ctx
, GL_INVALID_OPERATION
,
292 "glGet(current tex coords, unit %u)", unit
);
295 FLUSH_CURRENT(ctx
, 0);
296 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][0]);
297 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][1]);
298 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][2]);
299 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][3]);
303 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.DepthBias
);
306 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.depthBits
);
308 case GL_DEPTH_CLEAR_VALUE
:
309 params
[0] = FLOAT_TO_BOOLEAN(((GLfloat
) ctx
->Depth
.Clear
));
312 params
[0] = ENUM_TO_BOOLEAN(ctx
->Depth
.Func
);
315 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Viewport
.Near
);
316 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Viewport
.Far
);
319 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.DepthScale
);
322 params
[0] = ctx
->Depth
.Test
;
324 case GL_DEPTH_WRITEMASK
:
325 params
[0] = ctx
->Depth
.Mask
;
328 params
[0] = ctx
->Color
.DitherFlag
;
330 case GL_DOUBLEBUFFER
:
331 params
[0] = ctx
->DrawBuffer
->Visual
.doubleBufferMode
;
334 params
[0] = ENUM_TO_BOOLEAN(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
338 FLUSH_CURRENT(ctx
, 0);
339 params
[0] = (ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0);
342 case GL_FEEDBACK_BUFFER_SIZE
:
343 params
[0] = INT_TO_BOOLEAN(ctx
->Feedback
.BufferSize
);
345 case GL_FEEDBACK_BUFFER_TYPE
:
346 params
[0] = ENUM_TO_BOOLEAN(ctx
->Feedback
.Type
);
349 params
[0] = ctx
->Fog
.Enabled
;
352 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[0]);
353 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[1]);
354 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[2]);
355 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Color
[3]);
358 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Density
);
361 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.End
);
364 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.Fog
);
367 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Index
);
370 params
[0] = ENUM_TO_BOOLEAN(ctx
->Fog
.Mode
);
373 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Fog
.Start
);
376 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.FrontFace
);
379 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.GreenBias
);
382 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.greenBits
);
385 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.GreenScale
);
388 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.indexBits
);
390 case GL_INDEX_CLEAR_VALUE
:
391 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.ClearIndex
);
394 params
[0] = GL_FALSE
;
396 case GL_INDEX_OFFSET
:
397 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.IndexOffset
);
400 params
[0] = INT_TO_BOOLEAN(ctx
->Pixel
.IndexShift
);
402 case GL_INDEX_WRITEMASK
:
403 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.IndexMask
);
406 params
[0] = ctx
->Light
.Light
[0].Enabled
;
409 params
[0] = ctx
->Light
.Light
[1].Enabled
;
412 params
[0] = ctx
->Light
.Light
[2].Enabled
;
415 params
[0] = ctx
->Light
.Light
[3].Enabled
;
418 params
[0] = ctx
->Light
.Light
[4].Enabled
;
421 params
[0] = ctx
->Light
.Light
[5].Enabled
;
424 params
[0] = ctx
->Light
.Light
[6].Enabled
;
427 params
[0] = ctx
->Light
.Light
[7].Enabled
;
430 params
[0] = ctx
->Light
.Enabled
;
432 case GL_LIGHT_MODEL_AMBIENT
:
433 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[0]);
434 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[1]);
435 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[2]);
436 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Light
.Model
.Ambient
[3]);
438 case GL_LIGHT_MODEL_COLOR_CONTROL
:
439 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.Model
.ColorControl
);
441 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
442 params
[0] = ctx
->Light
.Model
.LocalViewer
;
444 case GL_LIGHT_MODEL_TWO_SIDE
:
445 params
[0] = ctx
->Light
.Model
.TwoSide
;
448 params
[0] = ctx
->Line
.SmoothFlag
;
450 case GL_LINE_SMOOTH_HINT
:
451 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.LineSmooth
);
453 case GL_LINE_STIPPLE
:
454 params
[0] = ctx
->Line
.StippleFlag
;
456 case GL_LINE_STIPPLE_PATTERN
:
457 params
[0] = INT_TO_BOOLEAN(ctx
->Line
.StipplePattern
);
459 case GL_LINE_STIPPLE_REPEAT
:
460 params
[0] = INT_TO_BOOLEAN(ctx
->Line
.StippleFactor
);
463 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Line
.Width
);
465 case GL_LINE_WIDTH_GRANULARITY
:
466 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.LineWidthGranularity
);
468 case GL_LINE_WIDTH_RANGE
:
469 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinLineWidthAA
);
470 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxLineWidthAA
);
472 case GL_ALIASED_LINE_WIDTH_RANGE
:
473 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinLineWidth
);
474 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxLineWidth
);
477 params
[0] = INT_TO_BOOLEAN(ctx
->List
.ListBase
);
480 params
[0] = INT_TO_BOOLEAN((ctx
->ListState
.CurrentList
? ctx
->ListState
.CurrentList
->Name
: 0));
485 if (!ctx
->CompileFlag
)
487 else if (ctx
->ExecuteFlag
)
488 mode
= GL_COMPILE_AND_EXECUTE
;
491 params
[0] = ENUM_TO_BOOLEAN(mode
);
494 case GL_INDEX_LOGIC_OP
:
495 params
[0] = ctx
->Color
.IndexLogicOpEnabled
;
497 case GL_COLOR_LOGIC_OP
:
498 params
[0] = ctx
->Color
.ColorLogicOpEnabled
;
500 case GL_LOGIC_OP_MODE
:
501 params
[0] = ENUM_TO_BOOLEAN(ctx
->Color
.LogicOp
);
503 case GL_MAP1_COLOR_4
:
504 params
[0] = ctx
->Eval
.Map1Color4
;
506 case GL_MAP1_GRID_DOMAIN
:
507 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid1u1
);
508 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid1u2
);
510 case GL_MAP1_GRID_SEGMENTS
:
511 params
[0] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid1un
);
514 params
[0] = ctx
->Eval
.Map1Index
;
517 params
[0] = ctx
->Eval
.Map1Normal
;
519 case GL_MAP1_TEXTURE_COORD_1
:
520 params
[0] = ctx
->Eval
.Map1TextureCoord1
;
522 case GL_MAP1_TEXTURE_COORD_2
:
523 params
[0] = ctx
->Eval
.Map1TextureCoord2
;
525 case GL_MAP1_TEXTURE_COORD_3
:
526 params
[0] = ctx
->Eval
.Map1TextureCoord3
;
528 case GL_MAP1_TEXTURE_COORD_4
:
529 params
[0] = ctx
->Eval
.Map1TextureCoord4
;
531 case GL_MAP1_VERTEX_3
:
532 params
[0] = ctx
->Eval
.Map1Vertex3
;
534 case GL_MAP1_VERTEX_4
:
535 params
[0] = ctx
->Eval
.Map1Vertex4
;
537 case GL_MAP2_COLOR_4
:
538 params
[0] = ctx
->Eval
.Map2Color4
;
540 case GL_MAP2_GRID_DOMAIN
:
541 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2u1
);
542 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2u2
);
543 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2v1
);
544 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Eval
.MapGrid2v2
);
546 case GL_MAP2_GRID_SEGMENTS
:
547 params
[0] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid2un
);
548 params
[1] = INT_TO_BOOLEAN(ctx
->Eval
.MapGrid2vn
);
551 params
[0] = ctx
->Eval
.Map2Index
;
554 params
[0] = ctx
->Eval
.Map2Normal
;
556 case GL_MAP2_TEXTURE_COORD_1
:
557 params
[0] = ctx
->Eval
.Map2TextureCoord1
;
559 case GL_MAP2_TEXTURE_COORD_2
:
560 params
[0] = ctx
->Eval
.Map2TextureCoord2
;
562 case GL_MAP2_TEXTURE_COORD_3
:
563 params
[0] = ctx
->Eval
.Map2TextureCoord3
;
565 case GL_MAP2_TEXTURE_COORD_4
:
566 params
[0] = ctx
->Eval
.Map2TextureCoord4
;
568 case GL_MAP2_VERTEX_3
:
569 params
[0] = ctx
->Eval
.Map2Vertex3
;
571 case GL_MAP2_VERTEX_4
:
572 params
[0] = ctx
->Eval
.Map2Vertex4
;
575 params
[0] = ctx
->Pixel
.MapColorFlag
;
578 params
[0] = ctx
->Pixel
.MapStencilFlag
;
581 params
[0] = ENUM_TO_BOOLEAN(ctx
->Transform
.MatrixMode
);
583 case GL_MAX_ATTRIB_STACK_DEPTH
:
584 params
[0] = INT_TO_BOOLEAN(MAX_ATTRIB_STACK_DEPTH
);
586 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
587 params
[0] = INT_TO_BOOLEAN(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
589 case GL_MAX_CLIP_PLANES
:
590 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxClipPlanes
);
592 case GL_MAX_ELEMENTS_VERTICES
:
593 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxArrayLockSize
);
595 case GL_MAX_ELEMENTS_INDICES
:
596 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxArrayLockSize
);
598 case GL_MAX_EVAL_ORDER
:
599 params
[0] = INT_TO_BOOLEAN(MAX_EVAL_ORDER
);
602 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxLights
);
604 case GL_MAX_LIST_NESTING
:
605 params
[0] = INT_TO_BOOLEAN(MAX_LIST_NESTING
);
607 case GL_MAX_MODELVIEW_STACK_DEPTH
:
608 params
[0] = INT_TO_BOOLEAN(MAX_MODELVIEW_STACK_DEPTH
);
610 case GL_MAX_NAME_STACK_DEPTH
:
611 params
[0] = INT_TO_BOOLEAN(MAX_NAME_STACK_DEPTH
);
613 case GL_MAX_PIXEL_MAP_TABLE
:
614 params
[0] = INT_TO_BOOLEAN(MAX_PIXEL_MAP_TABLE
);
616 case GL_MAX_PROJECTION_STACK_DEPTH
:
617 params
[0] = INT_TO_BOOLEAN(MAX_PROJECTION_STACK_DEPTH
);
619 case GL_MAX_TEXTURE_SIZE
:
620 params
[0] = INT_TO_BOOLEAN(1 << (ctx
->Const
.MaxTextureLevels
- 1));
622 case GL_MAX_3D_TEXTURE_SIZE
:
623 params
[0] = INT_TO_BOOLEAN(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
625 case GL_MAX_TEXTURE_STACK_DEPTH
:
626 params
[0] = INT_TO_BOOLEAN(MAX_TEXTURE_STACK_DEPTH
);
628 case GL_MAX_VIEWPORT_DIMS
:
629 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxViewportWidth
);
630 params
[1] = INT_TO_BOOLEAN(ctx
->Const
.MaxViewportHeight
);
632 case GL_MODELVIEW_MATRIX
:
634 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
635 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
636 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
637 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
638 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
639 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
640 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
641 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
642 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
643 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
644 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
645 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
646 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
647 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
648 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
649 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
650 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
653 case GL_MODELVIEW_STACK_DEPTH
:
654 params
[0] = INT_TO_BOOLEAN(ctx
->ModelviewMatrixStack
.Depth
+ 1);
656 case GL_NAME_STACK_DEPTH
:
657 params
[0] = INT_TO_BOOLEAN(ctx
->Select
.NameStackDepth
);
660 params
[0] = ctx
->Transform
.Normalize
;
662 case GL_PACK_ALIGNMENT
:
663 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.Alignment
);
665 case GL_PACK_LSB_FIRST
:
666 params
[0] = ctx
->Pack
.LsbFirst
;
668 case GL_PACK_ROW_LENGTH
:
669 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.RowLength
);
671 case GL_PACK_SKIP_PIXELS
:
672 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipPixels
);
674 case GL_PACK_SKIP_ROWS
:
675 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipRows
);
677 case GL_PACK_SWAP_BYTES
:
678 params
[0] = ctx
->Pack
.SwapBytes
;
680 case GL_PACK_SKIP_IMAGES_EXT
:
681 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.SkipImages
);
683 case GL_PACK_IMAGE_HEIGHT_EXT
:
684 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.ImageHeight
);
686 case GL_PACK_INVERT_MESA
:
687 params
[0] = ctx
->Pack
.Invert
;
689 case GL_PERSPECTIVE_CORRECTION_HINT
:
690 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PerspectiveCorrection
);
692 case GL_PIXEL_MAP_A_TO_A_SIZE
:
693 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.AtoA
.Size
);
695 case GL_PIXEL_MAP_B_TO_B_SIZE
:
696 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.BtoB
.Size
);
698 case GL_PIXEL_MAP_G_TO_G_SIZE
:
699 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.GtoG
.Size
);
701 case GL_PIXEL_MAP_I_TO_A_SIZE
:
702 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoA
.Size
);
704 case GL_PIXEL_MAP_I_TO_B_SIZE
:
705 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoB
.Size
);
707 case GL_PIXEL_MAP_I_TO_G_SIZE
:
708 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoG
.Size
);
710 case GL_PIXEL_MAP_I_TO_I_SIZE
:
711 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoI
.Size
);
713 case GL_PIXEL_MAP_I_TO_R_SIZE
:
714 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.ItoR
.Size
);
716 case GL_PIXEL_MAP_R_TO_R_SIZE
:
717 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.RtoR
.Size
);
719 case GL_PIXEL_MAP_S_TO_S_SIZE
:
720 params
[0] = INT_TO_BOOLEAN(ctx
->PixelMaps
.StoS
.Size
);
723 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Size
);
725 case GL_POINT_SIZE_GRANULARITY
:
726 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.PointSizeGranularity
);
728 case GL_POINT_SIZE_RANGE
:
729 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinPointSizeAA
);
730 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxPointSizeAA
);
732 case GL_ALIASED_POINT_SIZE_RANGE
:
733 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MinPointSize
);
734 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxPointSize
);
736 case GL_POINT_SMOOTH
:
737 params
[0] = ctx
->Point
.SmoothFlag
;
739 case GL_POINT_SMOOTH_HINT
:
740 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PointSmooth
);
742 case GL_POINT_SIZE_MIN_EXT
:
743 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.MinSize
);
745 case GL_POINT_SIZE_MAX_EXT
:
746 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.MaxSize
);
748 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
749 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Threshold
);
751 case GL_DISTANCE_ATTENUATION_EXT
:
752 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[0]);
753 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[1]);
754 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Point
.Params
[2]);
756 case GL_POLYGON_MODE
:
757 params
[0] = ENUM_TO_BOOLEAN(ctx
->Polygon
.FrontMode
);
758 params
[1] = ENUM_TO_BOOLEAN(ctx
->Polygon
.BackMode
);
760 case GL_POLYGON_OFFSET_BIAS_EXT
:
761 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetUnits
);
763 case GL_POLYGON_OFFSET_FACTOR
:
764 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetFactor
);
766 case GL_POLYGON_OFFSET_UNITS
:
767 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Polygon
.OffsetUnits
);
769 case GL_POLYGON_OFFSET_POINT
:
770 params
[0] = ctx
->Polygon
.OffsetPoint
;
772 case GL_POLYGON_OFFSET_LINE
:
773 params
[0] = ctx
->Polygon
.OffsetLine
;
775 case GL_POLYGON_OFFSET_FILL
:
776 params
[0] = ctx
->Polygon
.OffsetFill
;
778 case GL_POLYGON_SMOOTH
:
779 params
[0] = ctx
->Polygon
.SmoothFlag
;
781 case GL_POLYGON_SMOOTH_HINT
:
782 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.PolygonSmooth
);
784 case GL_POLYGON_STIPPLE
:
785 params
[0] = ctx
->Polygon
.StippleFlag
;
787 case GL_PROJECTION_MATRIX
:
789 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
790 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
791 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
792 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
793 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
794 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
795 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
796 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
797 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
798 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
799 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
800 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
801 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
802 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
803 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
804 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
805 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
808 case GL_PROJECTION_STACK_DEPTH
:
809 params
[0] = INT_TO_BOOLEAN(ctx
->ProjectionMatrixStack
.Depth
+ 1);
812 params
[0] = ENUM_TO_BOOLEAN(ctx
->ReadBuffer
->ColorReadBuffer
);
815 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.RedBias
);
818 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.redBits
);
821 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.RedScale
);
824 params
[0] = ENUM_TO_BOOLEAN(ctx
->RenderMode
);
826 case GL_RESCALE_NORMAL
:
827 params
[0] = ctx
->Transform
.RescaleNormals
;
833 params
[0] = INT_TO_BOOLEAN(ctx
->Scissor
.X
);
834 params
[1] = INT_TO_BOOLEAN(ctx
->Scissor
.Y
);
835 params
[2] = INT_TO_BOOLEAN(ctx
->Scissor
.Width
);
836 params
[3] = INT_TO_BOOLEAN(ctx
->Scissor
.Height
);
838 case GL_SCISSOR_TEST
:
839 params
[0] = ctx
->Scissor
.Enabled
;
841 case GL_SELECTION_BUFFER_SIZE
:
842 params
[0] = INT_TO_BOOLEAN(ctx
->Select
.BufferSize
);
845 params
[0] = ENUM_TO_BOOLEAN(ctx
->Light
.ShadeModel
);
847 case GL_SHARED_TEXTURE_PALETTE_EXT
:
848 params
[0] = ctx
->Texture
.SharedPalette
;
850 case GL_STENCIL_BITS
:
851 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.stencilBits
);
853 case GL_STENCIL_CLEAR_VALUE
:
854 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Clear
);
856 case GL_STENCIL_FAIL
:
857 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
859 case GL_STENCIL_FUNC
:
860 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
862 case GL_STENCIL_PASS_DEPTH_FAIL
:
863 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
865 case GL_STENCIL_PASS_DEPTH_PASS
:
866 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
869 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
871 case GL_STENCIL_TEST
:
872 params
[0] = ctx
->Stencil
.Enabled
;
874 case GL_STENCIL_VALUE_MASK
:
875 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
877 case GL_STENCIL_WRITEMASK
:
878 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
881 params
[0] = ctx
->DrawBuffer
->Visual
.stereoMode
;
883 case GL_SUBPIXEL_BITS
:
884 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.SubPixelBits
);
887 params
[0] = _mesa_IsEnabled(GL_TEXTURE_1D
);
890 params
[0] = _mesa_IsEnabled(GL_TEXTURE_2D
);
893 params
[0] = _mesa_IsEnabled(GL_TEXTURE_3D
);
895 case GL_TEXTURE_1D_ARRAY_EXT
:
896 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
897 params
[0] = _mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
);
899 case GL_TEXTURE_2D_ARRAY_EXT
:
900 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
901 params
[0] = _mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
);
903 case GL_TEXTURE_BINDING_1D
:
904 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_INDEX
]->Name
);
906 case GL_TEXTURE_BINDING_2D
:
907 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_INDEX
]->Name
);
909 case GL_TEXTURE_BINDING_3D
:
910 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_3D_INDEX
]->Name
);
912 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
913 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
914 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_ARRAY_INDEX
]->Name
);
916 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
917 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
918 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_ARRAY_INDEX
]->Name
);
920 case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT
:
921 CHECK_EXT1(MESA_texture_array
, "GetBooleanv");
922 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxArrayTextureLayers
);
924 case GL_TEXTURE_GEN_S
:
925 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0);
927 case GL_TEXTURE_GEN_T
:
928 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0);
930 case GL_TEXTURE_GEN_R
:
931 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0);
933 case GL_TEXTURE_GEN_Q
:
934 params
[0] = ((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0);
936 case GL_TEXTURE_MATRIX
:
938 const GLfloat
*matrix
;
939 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
940 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
941 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGet(texture matrix %u)",
945 matrix
= ctx
->TextureMatrixStack
[unit
].Top
->m
;
946 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
947 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
948 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
949 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
950 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
951 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
952 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
953 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
954 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
955 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
956 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
957 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
958 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
959 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
960 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
961 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
964 case GL_TEXTURE_STACK_DEPTH
:
966 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
967 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
968 _mesa_error(ctx
, GL_INVALID_OPERATION
,
969 "glGet(texture stack depth, unit %u)", unit
);
972 params
[0] = INT_TO_BOOLEAN(ctx
->TextureMatrixStack
[unit
].Depth
+ 1);
975 case GL_UNPACK_ALIGNMENT
:
976 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.Alignment
);
978 case GL_UNPACK_LSB_FIRST
:
979 params
[0] = ctx
->Unpack
.LsbFirst
;
981 case GL_UNPACK_ROW_LENGTH
:
982 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.RowLength
);
984 case GL_UNPACK_SKIP_PIXELS
:
985 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipPixels
);
987 case GL_UNPACK_SKIP_ROWS
:
988 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipRows
);
990 case GL_UNPACK_SWAP_BYTES
:
991 params
[0] = ctx
->Unpack
.SwapBytes
;
993 case GL_UNPACK_SKIP_IMAGES_EXT
:
994 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.SkipImages
);
996 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
997 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.ImageHeight
);
999 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
1000 params
[0] = ctx
->Unpack
.ClientStorage
;
1003 params
[0] = INT_TO_BOOLEAN(ctx
->Viewport
.X
);
1004 params
[1] = INT_TO_BOOLEAN(ctx
->Viewport
.Y
);
1005 params
[2] = INT_TO_BOOLEAN(ctx
->Viewport
.Width
);
1006 params
[3] = INT_TO_BOOLEAN(ctx
->Viewport
.Height
);
1009 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomX
);
1012 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.ZoomY
);
1014 case GL_VERTEX_ARRAY
:
1015 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Enabled
;
1017 case GL_VERTEX_ARRAY_SIZE
:
1018 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Size
);
1020 case GL_VERTEX_ARRAY_TYPE
:
1021 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Type
);
1023 case GL_VERTEX_ARRAY_STRIDE
:
1024 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
1026 case GL_VERTEX_ARRAY_COUNT_EXT
:
1027 params
[0] = INT_TO_BOOLEAN(0);
1029 case GL_NORMAL_ARRAY
:
1030 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
1032 case GL_NORMAL_ARRAY_TYPE
:
1033 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Type
);
1035 case GL_NORMAL_ARRAY_STRIDE
:
1036 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.Stride
);
1038 case GL_NORMAL_ARRAY_COUNT_EXT
:
1039 params
[0] = INT_TO_BOOLEAN(0);
1041 case GL_COLOR_ARRAY
:
1042 params
[0] = ctx
->Array
.ArrayObj
->Color
.Enabled
;
1044 case GL_COLOR_ARRAY_SIZE
:
1045 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Size
);
1047 case GL_COLOR_ARRAY_TYPE
:
1048 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Type
);
1050 case GL_COLOR_ARRAY_STRIDE
:
1051 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.Stride
);
1053 case GL_COLOR_ARRAY_COUNT_EXT
:
1054 params
[0] = INT_TO_BOOLEAN(0);
1056 case GL_INDEX_ARRAY
:
1057 params
[0] = ctx
->Array
.ArrayObj
->Index
.Enabled
;
1059 case GL_INDEX_ARRAY_TYPE
:
1060 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Type
);
1062 case GL_INDEX_ARRAY_STRIDE
:
1063 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.Stride
);
1065 case GL_INDEX_ARRAY_COUNT_EXT
:
1066 params
[0] = INT_TO_BOOLEAN(0);
1068 case GL_TEXTURE_COORD_ARRAY
:
1069 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
;
1071 case GL_TEXTURE_COORD_ARRAY_SIZE
:
1072 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
1074 case GL_TEXTURE_COORD_ARRAY_TYPE
:
1075 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
1077 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
1078 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
1080 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
1081 params
[0] = INT_TO_BOOLEAN(0);
1083 case GL_EDGE_FLAG_ARRAY
:
1084 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
;
1086 case GL_EDGE_FLAG_ARRAY_STRIDE
:
1087 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
1089 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
1090 params
[0] = INT_TO_BOOLEAN(0);
1092 case GL_MAX_TEXTURE_UNITS_ARB
:
1093 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1094 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureUnits
);
1096 case GL_ACTIVE_TEXTURE_ARB
:
1097 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1098 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
1100 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
1101 CHECK_EXT1(ARB_multitexture
, "GetBooleanv");
1102 params
[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
1104 case GL_TEXTURE_CUBE_MAP_ARB
:
1105 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1106 params
[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
1108 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
1109 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1110 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_CUBE_INDEX
]->Name
);
1112 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
1113 CHECK_EXT1(ARB_texture_cube_map
, "GetBooleanv");
1114 params
[0] = INT_TO_BOOLEAN((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
1116 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
1117 params
[0] = INT_TO_BOOLEAN(ctx
->Hint
.TextureCompression
);
1119 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
1120 params
[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
1122 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1125 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
1127 for (i
= 0; i
< n
; i
++)
1128 params
[i
] = ENUM_TO_BOOLEAN(formats
[i
]);
1131 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1132 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1133 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockFirst
);
1135 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1136 CHECK_EXT1(EXT_compiled_vertex_array
, "GetBooleanv");
1137 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.LockCount
);
1139 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1141 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1142 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1143 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1144 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1145 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1146 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1147 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1148 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1149 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1150 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1151 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1152 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1153 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1154 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1155 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1156 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1157 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1160 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1162 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
1163 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1164 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1165 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1166 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1167 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1168 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1169 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1170 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1171 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1172 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1173 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1174 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1175 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1176 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1177 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1178 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1181 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1183 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
1184 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1185 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1186 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1187 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1188 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1189 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1190 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1191 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1192 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1193 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1194 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1195 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1196 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1197 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1198 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1199 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1202 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1204 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
1205 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1206 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1207 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1208 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1209 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1210 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1211 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1212 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1213 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1214 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1215 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1216 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1217 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1218 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1219 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1220 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1223 case GL_COLOR_MATRIX_SGI
:
1225 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
1226 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1227 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1228 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1229 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1230 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1231 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1232 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1233 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1234 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1235 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1236 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1237 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1238 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1239 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1240 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1241 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1244 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1245 params
[0] = INT_TO_BOOLEAN(ctx
->ColorMatrixStack
.Depth
+ 1);
1247 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1248 params
[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH
);
1250 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1251 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[0]);
1253 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1254 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[1]);
1256 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1257 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[2]);
1259 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1260 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixScale
[3]);
1262 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1263 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[0]);
1265 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1266 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[1]);
1268 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1269 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[2]);
1271 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1272 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostColorMatrixBias
[3]);
1274 case GL_CONVOLUTION_1D_EXT
:
1275 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1276 params
[0] = ctx
->Pixel
.Convolution1DEnabled
;
1278 case GL_CONVOLUTION_2D_EXT
:
1279 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1280 params
[0] = ctx
->Pixel
.Convolution2DEnabled
;
1282 case GL_SEPARABLE_2D_EXT
:
1283 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1284 params
[0] = ctx
->Pixel
.Separable2DEnabled
;
1286 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1287 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1288 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[0]);
1290 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1291 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1292 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[1]);
1294 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1295 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1296 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[2]);
1298 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1299 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1300 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionScale
[3]);
1302 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1303 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1304 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[0]);
1306 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1307 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1308 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[1]);
1310 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1311 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1312 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[2]);
1314 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1315 CHECK_EXT1(EXT_convolution
, "GetBooleanv");
1316 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Pixel
.PostConvolutionBias
[3]);
1319 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1320 params
[0] = ctx
->Pixel
.HistogramEnabled
;
1323 CHECK_EXT1(EXT_histogram
, "GetBooleanv");
1324 params
[0] = ctx
->Pixel
.MinMaxEnabled
;
1326 case GL_COLOR_TABLE_SGI
:
1327 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1328 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
];
1330 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1331 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1332 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
];
1334 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1335 CHECK_EXT1(SGI_color_table
, "GetBooleanv");
1336 params
[0] = ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
];
1338 case GL_TEXTURE_COLOR_TABLE_SGI
:
1339 CHECK_EXT1(SGI_texture_color_table
, "GetBooleanv");
1340 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
;
1342 case GL_COLOR_SUM_EXT
:
1343 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetBooleanv");
1344 params
[0] = ctx
->Fog
.ColorSumEnabled
;
1346 case GL_CURRENT_SECONDARY_COLOR_EXT
:
1347 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1349 FLUSH_CURRENT(ctx
, 0);
1350 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
1351 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
1352 params
[2] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
1353 params
[3] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
1356 case GL_SECONDARY_COLOR_ARRAY_EXT
:
1357 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1358 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
;
1360 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
1361 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1362 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
1364 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
1365 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1366 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
1368 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
1369 CHECK_EXT1(EXT_secondary_color
, "GetBooleanv");
1370 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
1372 case GL_CURRENT_FOG_COORDINATE_EXT
:
1373 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1375 FLUSH_CURRENT(ctx
, 0);
1376 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
1379 case GL_FOG_COORDINATE_ARRAY_EXT
:
1380 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1381 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Enabled
;
1383 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
1384 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1385 params
[0] = ENUM_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
1387 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
1388 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1389 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
1391 case GL_FOG_COORDINATE_SOURCE_EXT
:
1392 CHECK_EXT1(EXT_fog_coord
, "GetBooleanv");
1393 params
[0] = ENUM_TO_BOOLEAN(ctx
->Fog
.FogCoordinateSource
);
1395 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
1396 CHECK_EXT1(EXT_texture_lod_bias
, "GetBooleanv");
1397 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureLodBias
);
1399 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
1400 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetBooleanv");
1401 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxTextureMaxAnisotropy
);
1403 case GL_MULTISAMPLE_ARB
:
1404 params
[0] = ctx
->Multisample
.Enabled
;
1406 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
1407 params
[0] = ctx
->Multisample
.SampleAlphaToCoverage
;
1409 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
1410 params
[0] = ctx
->Multisample
.SampleAlphaToOne
;
1412 case GL_SAMPLE_COVERAGE_ARB
:
1413 params
[0] = ctx
->Multisample
.SampleCoverage
;
1415 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
1416 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Multisample
.SampleCoverageValue
);
1418 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
1419 params
[0] = ctx
->Multisample
.SampleCoverageInvert
;
1421 case GL_SAMPLE_BUFFERS_ARB
:
1422 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
1424 case GL_SAMPLES_ARB
:
1425 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Visual
.samples
);
1427 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
1428 CHECK_EXT1(IBM_rasterpos_clip
, "GetBooleanv");
1429 params
[0] = ctx
->Transform
.RasterPositionUnclipped
;
1431 case GL_POINT_SPRITE_NV
:
1432 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1433 params
[0] = ctx
->Point
.PointSprite
;
1435 case GL_POINT_SPRITE_R_MODE_NV
:
1436 CHECK_EXT1(NV_point_sprite
, "GetBooleanv");
1437 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteRMode
);
1439 case GL_POINT_SPRITE_COORD_ORIGIN
:
1440 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetBooleanv");
1441 params
[0] = ENUM_TO_BOOLEAN(ctx
->Point
.SpriteOrigin
);
1443 case GL_GENERATE_MIPMAP_HINT_SGIS
:
1444 CHECK_EXT1(SGIS_generate_mipmap
, "GetBooleanv");
1445 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.GenerateMipmap
);
1447 case GL_VERTEX_PROGRAM_BINDING_NV
:
1448 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1449 params
[0] = INT_TO_BOOLEAN((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
1451 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
1452 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1453 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
;
1455 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
1456 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1457 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
;
1459 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
1460 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1461 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
;
1463 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
1464 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1465 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
;
1467 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
1468 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1469 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
;
1471 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
1472 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1473 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
;
1475 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
1476 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1477 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
;
1479 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
1480 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1481 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
;
1483 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
1484 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1485 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
;
1487 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
1488 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1489 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
;
1491 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
1492 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1493 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
;
1495 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
1496 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1497 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
;
1499 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
1500 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1501 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
;
1503 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
1504 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1505 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
;
1507 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
1508 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1509 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
;
1511 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
1512 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1513 params
[0] = ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
;
1515 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
1516 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1517 params
[0] = ctx
->Eval
.Map1Attrib
[0];
1519 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
1520 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1521 params
[0] = ctx
->Eval
.Map1Attrib
[1];
1523 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
1524 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1525 params
[0] = ctx
->Eval
.Map1Attrib
[2];
1527 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
1528 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1529 params
[0] = ctx
->Eval
.Map1Attrib
[3];
1531 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
1532 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1533 params
[0] = ctx
->Eval
.Map1Attrib
[4];
1535 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
1536 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1537 params
[0] = ctx
->Eval
.Map1Attrib
[5];
1539 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
1540 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1541 params
[0] = ctx
->Eval
.Map1Attrib
[6];
1543 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
1544 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1545 params
[0] = ctx
->Eval
.Map1Attrib
[7];
1547 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
1548 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1549 params
[0] = ctx
->Eval
.Map1Attrib
[8];
1551 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
1552 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1553 params
[0] = ctx
->Eval
.Map1Attrib
[9];
1555 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
1556 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1557 params
[0] = ctx
->Eval
.Map1Attrib
[10];
1559 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
1560 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1561 params
[0] = ctx
->Eval
.Map1Attrib
[11];
1563 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
1564 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1565 params
[0] = ctx
->Eval
.Map1Attrib
[12];
1567 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
1568 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1569 params
[0] = ctx
->Eval
.Map1Attrib
[13];
1571 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
1572 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1573 params
[0] = ctx
->Eval
.Map1Attrib
[14];
1575 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
1576 CHECK_EXT1(NV_vertex_program
, "GetBooleanv");
1577 params
[0] = ctx
->Eval
.Map1Attrib
[15];
1579 case GL_FRAGMENT_PROGRAM_NV
:
1580 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1581 params
[0] = ctx
->FragmentProgram
.Enabled
;
1583 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
1584 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1585 params
[0] = INT_TO_BOOLEAN(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
1587 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
1588 CHECK_EXT1(NV_fragment_program
, "GetBooleanv");
1589 params
[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
1591 case GL_TEXTURE_RECTANGLE_NV
:
1592 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1593 params
[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
1595 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
1596 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1597 params
[0] = INT_TO_BOOLEAN(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_RECT_INDEX
]->Name
);
1599 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
1600 CHECK_EXT1(NV_texture_rectangle
, "GetBooleanv");
1601 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureRectSize
);
1603 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
1604 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1605 params
[0] = ctx
->Stencil
.TestTwoSide
;
1607 case GL_ACTIVE_STENCIL_FACE_EXT
:
1608 CHECK_EXT1(EXT_stencil_two_side
, "GetBooleanv");
1609 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
1611 case GL_MAX_SHININESS_NV
:
1612 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1613 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxShininess
);
1615 case GL_MAX_SPOT_EXPONENT_NV
:
1616 CHECK_EXT1(NV_light_max_exponent
, "GetBooleanv");
1617 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Const
.MaxSpotExponent
);
1619 case GL_ARRAY_BUFFER_BINDING_ARB
:
1620 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayBufferObj
->Name
);
1622 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
1623 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
1625 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
1626 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
1628 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1629 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
1631 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
1632 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
1634 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
1635 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
1637 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
1638 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
1640 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1641 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
1643 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
1644 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
1646 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
1647 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ElementArrayBufferObj
->Name
);
1649 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
1650 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1651 params
[0] = INT_TO_BOOLEAN(ctx
->Pack
.BufferObj
->Name
);
1653 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
1654 CHECK_EXT1(EXT_pixel_buffer_object
, "GetBooleanv");
1655 params
[0] = INT_TO_BOOLEAN(ctx
->Unpack
.BufferObj
->Name
);
1657 case GL_VERTEX_PROGRAM_ARB
:
1658 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1659 params
[0] = ctx
->VertexProgram
.Enabled
;
1661 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
1662 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1663 params
[0] = ctx
->VertexProgram
.PointSizeEnabled
;
1665 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
1666 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetBooleanv");
1667 params
[0] = ctx
->VertexProgram
.TwoSideEnabled
;
1669 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
1670 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1671 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrixStackDepth
);
1673 case GL_MAX_PROGRAM_MATRICES_ARB
:
1674 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1675 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxProgramMatrices
);
1677 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
1678 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetBooleanv");
1679 params
[0] = ctx
->CurrentStack
->Depth
+ 1;
1681 case GL_CURRENT_MATRIX_ARB
:
1682 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1684 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1685 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1686 params
[1] = FLOAT_TO_BOOLEAN(matrix
[1]);
1687 params
[2] = FLOAT_TO_BOOLEAN(matrix
[2]);
1688 params
[3] = FLOAT_TO_BOOLEAN(matrix
[3]);
1689 params
[4] = FLOAT_TO_BOOLEAN(matrix
[4]);
1690 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1691 params
[6] = FLOAT_TO_BOOLEAN(matrix
[6]);
1692 params
[7] = FLOAT_TO_BOOLEAN(matrix
[7]);
1693 params
[8] = FLOAT_TO_BOOLEAN(matrix
[8]);
1694 params
[9] = FLOAT_TO_BOOLEAN(matrix
[9]);
1695 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1696 params
[11] = FLOAT_TO_BOOLEAN(matrix
[11]);
1697 params
[12] = FLOAT_TO_BOOLEAN(matrix
[12]);
1698 params
[13] = FLOAT_TO_BOOLEAN(matrix
[13]);
1699 params
[14] = FLOAT_TO_BOOLEAN(matrix
[14]);
1700 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1703 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
1704 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetBooleanv");
1706 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
1707 params
[0] = FLOAT_TO_BOOLEAN(matrix
[0]);
1708 params
[1] = FLOAT_TO_BOOLEAN(matrix
[4]);
1709 params
[2] = FLOAT_TO_BOOLEAN(matrix
[8]);
1710 params
[3] = FLOAT_TO_BOOLEAN(matrix
[12]);
1711 params
[4] = FLOAT_TO_BOOLEAN(matrix
[1]);
1712 params
[5] = FLOAT_TO_BOOLEAN(matrix
[5]);
1713 params
[6] = FLOAT_TO_BOOLEAN(matrix
[9]);
1714 params
[7] = FLOAT_TO_BOOLEAN(matrix
[13]);
1715 params
[8] = FLOAT_TO_BOOLEAN(matrix
[2]);
1716 params
[9] = FLOAT_TO_BOOLEAN(matrix
[6]);
1717 params
[10] = FLOAT_TO_BOOLEAN(matrix
[10]);
1718 params
[11] = FLOAT_TO_BOOLEAN(matrix
[14]);
1719 params
[12] = FLOAT_TO_BOOLEAN(matrix
[3]);
1720 params
[13] = FLOAT_TO_BOOLEAN(matrix
[7]);
1721 params
[14] = FLOAT_TO_BOOLEAN(matrix
[11]);
1722 params
[15] = FLOAT_TO_BOOLEAN(matrix
[15]);
1725 case GL_MAX_VERTEX_ATTRIBS_ARB
:
1726 CHECK_EXT1(ARB_vertex_program
, "GetBooleanv");
1727 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxAttribs
);
1729 case GL_PROGRAM_ERROR_POSITION_ARB
:
1730 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetBooleanv");
1731 params
[0] = INT_TO_BOOLEAN(ctx
->Program
.ErrorPos
);
1733 case GL_FRAGMENT_PROGRAM_ARB
:
1734 CHECK_EXT1(ARB_fragment_program
, "GetBooleanv");
1735 params
[0] = ctx
->FragmentProgram
.Enabled
;
1737 case GL_MAX_TEXTURE_COORDS_ARB
:
1738 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1739 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureCoordUnits
);
1741 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
1742 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetBooleanv");
1743 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxTextureImageUnits
);
1745 case GL_DEPTH_BOUNDS_TEST_EXT
:
1746 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1747 params
[0] = ctx
->Depth
.BoundsTest
;
1749 case GL_DEPTH_BOUNDS_EXT
:
1750 CHECK_EXT1(EXT_depth_bounds_test
, "GetBooleanv");
1751 params
[0] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMin
);
1752 params
[1] = FLOAT_TO_BOOLEAN(ctx
->Depth
.BoundsMax
);
1754 case GL_DEPTH_CLAMP
:
1755 CHECK_EXT1(ARB_depth_clamp
, "GetBooleanv");
1756 params
[0] = ctx
->Transform
.DepthClamp
;
1758 case GL_MAX_DRAW_BUFFERS_ARB
:
1759 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxDrawBuffers
);
1761 case GL_DRAW_BUFFER0_ARB
:
1762 params
[0] = ENUM_TO_BOOLEAN(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
1764 case GL_DRAW_BUFFER1_ARB
:
1767 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1768 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1771 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
1772 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1775 case GL_DRAW_BUFFER2_ARB
:
1778 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1779 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1782 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
1783 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1786 case GL_DRAW_BUFFER3_ARB
:
1789 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
1790 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
1793 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
1794 params
[0] = ENUM_TO_BOOLEAN(buffer
);
1797 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
1798 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1799 params
[0] = INT_TO_BOOLEAN(_mesa_get_color_read_type(ctx
));
1801 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
1802 CHECK_EXT1(OES_read_format
, "GetBooleanv");
1803 params
[0] = INT_TO_BOOLEAN(_mesa_get_color_read_format(ctx
));
1805 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
1806 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1807 params
[0] = INT_TO_BOOLEAN(6);
1809 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
1810 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1811 params
[0] = INT_TO_BOOLEAN(8);
1813 case GL_NUM_PASSES_ATI
:
1814 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1815 params
[0] = INT_TO_BOOLEAN(2);
1817 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
1818 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1819 params
[0] = INT_TO_BOOLEAN(8);
1821 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
1822 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1823 params
[0] = INT_TO_BOOLEAN(16);
1825 case GL_COLOR_ALPHA_PAIRING_ATI
:
1826 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1827 params
[0] = GL_TRUE
;
1829 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
1830 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1831 params
[0] = INT_TO_BOOLEAN(3);
1833 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
1834 CHECK_EXT1(ATI_fragment_shader
, "GetBooleanv");
1835 params
[0] = INT_TO_BOOLEAN(3);
1837 case GL_STENCIL_BACK_FUNC
:
1838 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.Function
[1]);
1840 case GL_STENCIL_BACK_VALUE_MASK
:
1841 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.ValueMask
[1]);
1843 case GL_STENCIL_BACK_WRITEMASK
:
1844 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.WriteMask
[1]);
1846 case GL_STENCIL_BACK_REF
:
1847 params
[0] = INT_TO_BOOLEAN(ctx
->Stencil
.Ref
[1]);
1849 case GL_STENCIL_BACK_FAIL
:
1850 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.FailFunc
[1]);
1852 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
1853 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZFailFunc
[1]);
1855 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
1856 params
[0] = ENUM_TO_BOOLEAN(ctx
->Stencil
.ZPassFunc
[1]);
1858 case GL_FRAMEBUFFER_BINDING_EXT
:
1859 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1860 params
[0] = INT_TO_BOOLEAN(ctx
->DrawBuffer
->Name
);
1862 case GL_RENDERBUFFER_BINDING_EXT
:
1863 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1864 params
[0] = INT_TO_BOOLEAN(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
1866 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
1867 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1868 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxColorAttachments
);
1870 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
1871 CHECK_EXT1(EXT_framebuffer_object
, "GetBooleanv");
1872 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxRenderbufferSize
);
1874 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
1875 CHECK_EXT1(EXT_framebuffer_blit
, "GetBooleanv");
1876 params
[0] = INT_TO_BOOLEAN(ctx
->ReadBuffer
->Name
);
1878 case GL_PROVOKING_VERTEX_EXT
:
1879 CHECK_EXT1(EXT_provoking_vertex
, "GetBooleanv");
1880 params
[0] = ctx
->Light
.ProvokingVertex
;
1882 case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT
:
1883 CHECK_EXT1(EXT_provoking_vertex
, "GetBooleanv");
1884 params
[0] = ctx
->Const
.QuadsFollowProvokingVertexConvention
;
1886 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
1887 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1888 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
1890 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
1891 CHECK_EXT1(ARB_fragment_shader
, "GetBooleanv");
1892 params
[0] = ENUM_TO_BOOLEAN(ctx
->Hint
.FragmentShaderDerivative
);
1894 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
1895 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1896 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
1898 case GL_MAX_VARYING_FLOATS_ARB
:
1899 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1900 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVarying
* 4);
1902 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
1903 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1904 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxVertexTextureImageUnits
);
1906 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
1907 CHECK_EXT1(ARB_vertex_shader
, "GetBooleanv");
1908 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxCombinedTextureImageUnits
);
1910 case GL_CURRENT_PROGRAM
:
1911 CHECK_EXT1(ARB_shader_objects
, "GetBooleanv");
1912 params
[0] = INT_TO_BOOLEAN(ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0);
1914 case GL_MAX_SAMPLES
:
1915 CHECK_EXT1(ARB_framebuffer_object
, "GetBooleanv");
1916 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.MaxSamples
);
1918 case GL_VERTEX_ARRAY_BINDING_APPLE
:
1919 CHECK_EXT1(APPLE_vertex_array_object
, "GetBooleanv");
1920 params
[0] = INT_TO_BOOLEAN(ctx
->Array
.ArrayObj
->Name
);
1922 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1923 CHECK_EXT1(ARB_seamless_cube_map
, "GetBooleanv");
1924 params
[0] = ctx
->Texture
.CubeMapSeamless
;
1926 case GL_MAX_SERVER_WAIT_TIMEOUT
:
1927 CHECK_EXT1(ARB_sync
, "GetBooleanv");
1928 params
[0] = INT64_TO_BOOLEAN(ctx
->Const
.MaxServerWaitTimeout
);
1930 case GL_NUM_EXTENSIONS
:
1931 params
[0] = INT_TO_BOOLEAN(_mesa_get_extension_count(ctx
));
1933 case GL_MAJOR_VERSION
:
1934 params
[0] = INT_TO_BOOLEAN(ctx
->VersionMajor
);
1936 case GL_MINOR_VERSION
:
1937 params
[0] = INT_TO_BOOLEAN(ctx
->VersionMinor
);
1939 case GL_CONTEXT_FLAGS
:
1940 params
[0] = INT_TO_BOOLEAN(ctx
->Const
.ContextFlags
);
1943 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv(pname=0x%x)", pname
);
1948 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
1950 GET_CURRENT_CONTEXT(ctx
);
1951 ASSERT_OUTSIDE_BEGIN_END(ctx
);
1957 _mesa_update_state(ctx
);
1959 if (ctx
->Driver
.GetFloatv
&&
1960 ctx
->Driver
.GetFloatv(ctx
, pname
, params
))
1964 case GL_ACCUM_RED_BITS
:
1965 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumRedBits
);
1967 case GL_ACCUM_GREEN_BITS
:
1968 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
1970 case GL_ACCUM_BLUE_BITS
:
1971 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
1973 case GL_ACCUM_ALPHA_BITS
:
1974 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
1976 case GL_ACCUM_CLEAR_VALUE
:
1977 params
[0] = ctx
->Accum
.ClearColor
[0];
1978 params
[1] = ctx
->Accum
.ClearColor
[1];
1979 params
[2] = ctx
->Accum
.ClearColor
[2];
1980 params
[3] = ctx
->Accum
.ClearColor
[3];
1983 params
[0] = ctx
->Pixel
.AlphaBias
;
1986 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.alphaBits
);
1988 case GL_ALPHA_SCALE
:
1989 params
[0] = ctx
->Pixel
.AlphaScale
;
1992 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.AlphaEnabled
);
1994 case GL_ALPHA_TEST_FUNC
:
1995 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
1997 case GL_ALPHA_TEST_REF
:
1998 params
[0] = ctx
->Color
.AlphaRef
;
2000 case GL_ATTRIB_STACK_DEPTH
:
2001 params
[0] = (GLfloat
)(ctx
->AttribStackDepth
);
2003 case GL_AUTO_NORMAL
:
2004 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.AutoNormal
);
2006 case GL_AUX_BUFFERS
:
2007 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
2010 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Color
.BlendEnabled
& 1));
2013 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2016 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2018 case GL_BLEND_SRC_RGB_EXT
:
2019 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2021 case GL_BLEND_DST_RGB_EXT
:
2022 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2024 case GL_BLEND_SRC_ALPHA_EXT
:
2025 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
2027 case GL_BLEND_DST_ALPHA_EXT
:
2028 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
2030 case GL_BLEND_EQUATION
:
2031 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationRGB
);
2033 case GL_BLEND_EQUATION_ALPHA_EXT
:
2034 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.BlendEquationA
);
2036 case GL_BLEND_COLOR_EXT
:
2037 params
[0] = ctx
->Color
.BlendColor
[0];
2038 params
[1] = ctx
->Color
.BlendColor
[1];
2039 params
[2] = ctx
->Color
.BlendColor
[2];
2040 params
[3] = ctx
->Color
.BlendColor
[3];
2043 params
[0] = ctx
->Pixel
.BlueBias
;
2046 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.blueBits
);
2049 params
[0] = ctx
->Pixel
.BlueScale
;
2051 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2052 params
[0] = (GLfloat
)(ctx
->ClientAttribStackDepth
);
2054 case GL_CLIP_PLANE0
:
2055 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
2057 case GL_CLIP_PLANE1
:
2058 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
2060 case GL_CLIP_PLANE2
:
2061 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
2063 case GL_CLIP_PLANE3
:
2064 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
2066 case GL_CLIP_PLANE4
:
2067 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
2069 case GL_CLIP_PLANE5
:
2070 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
2072 case GL_COLOR_CLEAR_VALUE
:
2073 params
[0] = ctx
->Color
.ClearColor
[0];
2074 params
[1] = ctx
->Color
.ClearColor
[1];
2075 params
[2] = ctx
->Color
.ClearColor
[2];
2076 params
[3] = ctx
->Color
.ClearColor
[3];
2078 case GL_COLOR_MATERIAL
:
2079 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.ColorMaterialEnabled
);
2081 case GL_COLOR_MATERIAL_FACE
:
2082 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2084 case GL_COLOR_MATERIAL_PARAMETER
:
2085 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2087 case GL_COLOR_WRITEMASK
:
2088 params
[0] = (GLfloat
)(ctx
->Color
.ColorMask
[0][RCOMP
] ? 1 : 0);
2089 params
[1] = (GLfloat
)(ctx
->Color
.ColorMask
[0][GCOMP
] ? 1 : 0);
2090 params
[2] = (GLfloat
)(ctx
->Color
.ColorMask
[0][BCOMP
] ? 1 : 0);
2091 params
[3] = (GLfloat
)(ctx
->Color
.ColorMask
[0][ACOMP
] ? 1 : 0);
2094 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.CullFlag
);
2096 case GL_CULL_FACE_MODE
:
2097 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2099 case GL_CURRENT_COLOR
:
2101 FLUSH_CURRENT(ctx
, 0);
2102 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0];
2103 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1];
2104 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2];
2105 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3];
2108 case GL_CURRENT_INDEX
:
2110 FLUSH_CURRENT(ctx
, 0);
2111 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0];
2114 case GL_CURRENT_NORMAL
:
2116 FLUSH_CURRENT(ctx
, 0);
2117 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0];
2118 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1];
2119 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2];
2122 case GL_CURRENT_RASTER_COLOR
:
2123 params
[0] = ctx
->Current
.RasterColor
[0];
2124 params
[1] = ctx
->Current
.RasterColor
[1];
2125 params
[2] = ctx
->Current
.RasterColor
[2];
2126 params
[3] = ctx
->Current
.RasterColor
[3];
2128 case GL_CURRENT_RASTER_DISTANCE
:
2129 params
[0] = ctx
->Current
.RasterDistance
;
2131 case GL_CURRENT_RASTER_INDEX
:
2134 case GL_CURRENT_RASTER_POSITION
:
2135 params
[0] = ctx
->Current
.RasterPos
[0];
2136 params
[1] = ctx
->Current
.RasterPos
[1];
2137 params
[2] = ctx
->Current
.RasterPos
[2];
2138 params
[3] = ctx
->Current
.RasterPos
[3];
2140 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
2141 params
[0] = ctx
->Current
.RasterSecondaryColor
[0];
2142 params
[1] = ctx
->Current
.RasterSecondaryColor
[1];
2143 params
[2] = ctx
->Current
.RasterSecondaryColor
[2];
2144 params
[3] = ctx
->Current
.RasterSecondaryColor
[3];
2146 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2148 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
2149 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
2150 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2151 "glGet(raster tex coords, unit %u)", unit
);
2154 params
[0] = ctx
->Current
.RasterTexCoords
[unit
][0];
2155 params
[1] = ctx
->Current
.RasterTexCoords
[unit
][1];
2156 params
[2] = ctx
->Current
.RasterTexCoords
[unit
][2];
2157 params
[3] = ctx
->Current
.RasterTexCoords
[unit
][3];
2160 case GL_CURRENT_RASTER_POSITION_VALID
:
2161 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Current
.RasterPosValid
);
2163 case GL_CURRENT_TEXTURE_COORDS
:
2165 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
2166 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
2167 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2168 "glGet(current tex coords, unit %u)", unit
);
2171 FLUSH_CURRENT(ctx
, 0);
2172 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][0];
2173 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][1];
2174 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][2];
2175 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][3];
2179 params
[0] = ctx
->Pixel
.DepthBias
;
2182 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.depthBits
);
2184 case GL_DEPTH_CLEAR_VALUE
:
2185 params
[0] = ((GLfloat
) ctx
->Depth
.Clear
);
2188 params
[0] = ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2190 case GL_DEPTH_RANGE
:
2191 params
[0] = ctx
->Viewport
.Near
;
2192 params
[1] = ctx
->Viewport
.Far
;
2194 case GL_DEPTH_SCALE
:
2195 params
[0] = ctx
->Pixel
.DepthScale
;
2198 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Test
);
2200 case GL_DEPTH_WRITEMASK
:
2201 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.Mask
);
2204 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.DitherFlag
);
2206 case GL_DOUBLEBUFFER
:
2207 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
2209 case GL_DRAW_BUFFER
:
2210 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
2214 FLUSH_CURRENT(ctx
, 0);
2215 params
[0] = BOOLEAN_TO_FLOAT((ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0));
2218 case GL_FEEDBACK_BUFFER_SIZE
:
2219 params
[0] = (GLfloat
)(ctx
->Feedback
.BufferSize
);
2221 case GL_FEEDBACK_BUFFER_TYPE
:
2222 params
[0] = ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2225 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.Enabled
);
2228 params
[0] = ctx
->Fog
.Color
[0];
2229 params
[1] = ctx
->Fog
.Color
[1];
2230 params
[2] = ctx
->Fog
.Color
[2];
2231 params
[3] = ctx
->Fog
.Color
[3];
2233 case GL_FOG_DENSITY
:
2234 params
[0] = ctx
->Fog
.Density
;
2237 params
[0] = ctx
->Fog
.End
;
2240 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2243 params
[0] = ctx
->Fog
.Index
;
2246 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2249 params
[0] = ctx
->Fog
.Start
;
2252 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2255 params
[0] = ctx
->Pixel
.GreenBias
;
2258 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.greenBits
);
2260 case GL_GREEN_SCALE
:
2261 params
[0] = ctx
->Pixel
.GreenScale
;
2264 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.indexBits
);
2266 case GL_INDEX_CLEAR_VALUE
:
2267 params
[0] = (GLfloat
)(ctx
->Color
.ClearIndex
);
2270 params
[0] = BOOLEAN_TO_FLOAT(GL_FALSE
);
2272 case GL_INDEX_OFFSET
:
2273 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexOffset
);
2275 case GL_INDEX_SHIFT
:
2276 params
[0] = (GLfloat
)(ctx
->Pixel
.IndexShift
);
2278 case GL_INDEX_WRITEMASK
:
2279 params
[0] = (GLfloat
)(ctx
->Color
.IndexMask
);
2282 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[0].Enabled
);
2285 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[1].Enabled
);
2288 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[2].Enabled
);
2291 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[3].Enabled
);
2294 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[4].Enabled
);
2297 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[5].Enabled
);
2300 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[6].Enabled
);
2303 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Light
[7].Enabled
);
2306 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Enabled
);
2308 case GL_LIGHT_MODEL_AMBIENT
:
2309 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2310 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2311 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2312 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2314 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2315 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2317 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2318 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.LocalViewer
);
2320 case GL_LIGHT_MODEL_TWO_SIDE
:
2321 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.Model
.TwoSide
);
2323 case GL_LINE_SMOOTH
:
2324 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.SmoothFlag
);
2326 case GL_LINE_SMOOTH_HINT
:
2327 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2329 case GL_LINE_STIPPLE
:
2330 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Line
.StippleFlag
);
2332 case GL_LINE_STIPPLE_PATTERN
:
2333 params
[0] = (GLfloat
)(ctx
->Line
.StipplePattern
);
2335 case GL_LINE_STIPPLE_REPEAT
:
2336 params
[0] = (GLfloat
)(ctx
->Line
.StippleFactor
);
2339 params
[0] = ctx
->Line
.Width
;
2341 case GL_LINE_WIDTH_GRANULARITY
:
2342 params
[0] = ctx
->Const
.LineWidthGranularity
;
2344 case GL_LINE_WIDTH_RANGE
:
2345 params
[0] = ctx
->Const
.MinLineWidthAA
;
2346 params
[1] = ctx
->Const
.MaxLineWidthAA
;
2348 case GL_ALIASED_LINE_WIDTH_RANGE
:
2349 params
[0] = ctx
->Const
.MinLineWidth
;
2350 params
[1] = ctx
->Const
.MaxLineWidth
;
2353 params
[0] = (GLfloat
)(ctx
->List
.ListBase
);
2356 params
[0] = (GLfloat
)((ctx
->ListState
.CurrentList
? ctx
->ListState
.CurrentList
->Name
: 0));
2361 if (!ctx
->CompileFlag
)
2363 else if (ctx
->ExecuteFlag
)
2364 mode
= GL_COMPILE_AND_EXECUTE
;
2367 params
[0] = ENUM_TO_FLOAT(mode
);
2370 case GL_INDEX_LOGIC_OP
:
2371 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.IndexLogicOpEnabled
);
2373 case GL_COLOR_LOGIC_OP
:
2374 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Color
.ColorLogicOpEnabled
);
2376 case GL_LOGIC_OP_MODE
:
2377 params
[0] = ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
2379 case GL_MAP1_COLOR_4
:
2380 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Color4
);
2382 case GL_MAP1_GRID_DOMAIN
:
2383 params
[0] = ctx
->Eval
.MapGrid1u1
;
2384 params
[1] = ctx
->Eval
.MapGrid1u2
;
2386 case GL_MAP1_GRID_SEGMENTS
:
2387 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid1un
);
2390 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Index
);
2392 case GL_MAP1_NORMAL
:
2393 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Normal
);
2395 case GL_MAP1_TEXTURE_COORD_1
:
2396 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord1
);
2398 case GL_MAP1_TEXTURE_COORD_2
:
2399 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord2
);
2401 case GL_MAP1_TEXTURE_COORD_3
:
2402 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord3
);
2404 case GL_MAP1_TEXTURE_COORD_4
:
2405 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1TextureCoord4
);
2407 case GL_MAP1_VERTEX_3
:
2408 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex3
);
2410 case GL_MAP1_VERTEX_4
:
2411 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Vertex4
);
2413 case GL_MAP2_COLOR_4
:
2414 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Color4
);
2416 case GL_MAP2_GRID_DOMAIN
:
2417 params
[0] = ctx
->Eval
.MapGrid2u1
;
2418 params
[1] = ctx
->Eval
.MapGrid2u2
;
2419 params
[2] = ctx
->Eval
.MapGrid2v1
;
2420 params
[3] = ctx
->Eval
.MapGrid2v2
;
2422 case GL_MAP2_GRID_SEGMENTS
:
2423 params
[0] = (GLfloat
)(ctx
->Eval
.MapGrid2un
);
2424 params
[1] = (GLfloat
)(ctx
->Eval
.MapGrid2vn
);
2427 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Index
);
2429 case GL_MAP2_NORMAL
:
2430 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Normal
);
2432 case GL_MAP2_TEXTURE_COORD_1
:
2433 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord1
);
2435 case GL_MAP2_TEXTURE_COORD_2
:
2436 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord2
);
2438 case GL_MAP2_TEXTURE_COORD_3
:
2439 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord3
);
2441 case GL_MAP2_TEXTURE_COORD_4
:
2442 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2TextureCoord4
);
2444 case GL_MAP2_VERTEX_3
:
2445 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex3
);
2447 case GL_MAP2_VERTEX_4
:
2448 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map2Vertex4
);
2451 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapColorFlag
);
2453 case GL_MAP_STENCIL
:
2454 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MapStencilFlag
);
2456 case GL_MATRIX_MODE
:
2457 params
[0] = ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
2459 case GL_MAX_ATTRIB_STACK_DEPTH
:
2460 params
[0] = (GLfloat
)(MAX_ATTRIB_STACK_DEPTH
);
2462 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2463 params
[0] = (GLfloat
)(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
2465 case GL_MAX_CLIP_PLANES
:
2466 params
[0] = (GLfloat
)(ctx
->Const
.MaxClipPlanes
);
2468 case GL_MAX_ELEMENTS_VERTICES
:
2469 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2471 case GL_MAX_ELEMENTS_INDICES
:
2472 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayLockSize
);
2474 case GL_MAX_EVAL_ORDER
:
2475 params
[0] = (GLfloat
)(MAX_EVAL_ORDER
);
2478 params
[0] = (GLfloat
)(ctx
->Const
.MaxLights
);
2480 case GL_MAX_LIST_NESTING
:
2481 params
[0] = (GLfloat
)(MAX_LIST_NESTING
);
2483 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2484 params
[0] = (GLfloat
)(MAX_MODELVIEW_STACK_DEPTH
);
2486 case GL_MAX_NAME_STACK_DEPTH
:
2487 params
[0] = (GLfloat
)(MAX_NAME_STACK_DEPTH
);
2489 case GL_MAX_PIXEL_MAP_TABLE
:
2490 params
[0] = (GLfloat
)(MAX_PIXEL_MAP_TABLE
);
2492 case GL_MAX_PROJECTION_STACK_DEPTH
:
2493 params
[0] = (GLfloat
)(MAX_PROJECTION_STACK_DEPTH
);
2495 case GL_MAX_TEXTURE_SIZE
:
2496 params
[0] = (GLfloat
)(1 << (ctx
->Const
.MaxTextureLevels
- 1));
2498 case GL_MAX_3D_TEXTURE_SIZE
:
2499 params
[0] = (GLfloat
)(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
2501 case GL_MAX_TEXTURE_STACK_DEPTH
:
2502 params
[0] = (GLfloat
)(MAX_TEXTURE_STACK_DEPTH
);
2504 case GL_MAX_VIEWPORT_DIMS
:
2505 params
[0] = (GLfloat
)(ctx
->Const
.MaxViewportWidth
);
2506 params
[1] = (GLfloat
)(ctx
->Const
.MaxViewportHeight
);
2508 case GL_MODELVIEW_MATRIX
:
2510 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
2511 params
[0] = matrix
[0];
2512 params
[1] = matrix
[1];
2513 params
[2] = matrix
[2];
2514 params
[3] = matrix
[3];
2515 params
[4] = matrix
[4];
2516 params
[5] = matrix
[5];
2517 params
[6] = matrix
[6];
2518 params
[7] = matrix
[7];
2519 params
[8] = matrix
[8];
2520 params
[9] = matrix
[9];
2521 params
[10] = matrix
[10];
2522 params
[11] = matrix
[11];
2523 params
[12] = matrix
[12];
2524 params
[13] = matrix
[13];
2525 params
[14] = matrix
[14];
2526 params
[15] = matrix
[15];
2529 case GL_MODELVIEW_STACK_DEPTH
:
2530 params
[0] = (GLfloat
)(ctx
->ModelviewMatrixStack
.Depth
+ 1);
2532 case GL_NAME_STACK_DEPTH
:
2533 params
[0] = (GLfloat
)(ctx
->Select
.NameStackDepth
);
2536 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.Normalize
);
2538 case GL_PACK_ALIGNMENT
:
2539 params
[0] = (GLfloat
)(ctx
->Pack
.Alignment
);
2541 case GL_PACK_LSB_FIRST
:
2542 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.LsbFirst
);
2544 case GL_PACK_ROW_LENGTH
:
2545 params
[0] = (GLfloat
)(ctx
->Pack
.RowLength
);
2547 case GL_PACK_SKIP_PIXELS
:
2548 params
[0] = (GLfloat
)(ctx
->Pack
.SkipPixels
);
2550 case GL_PACK_SKIP_ROWS
:
2551 params
[0] = (GLfloat
)(ctx
->Pack
.SkipRows
);
2553 case GL_PACK_SWAP_BYTES
:
2554 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.SwapBytes
);
2556 case GL_PACK_SKIP_IMAGES_EXT
:
2557 params
[0] = (GLfloat
)(ctx
->Pack
.SkipImages
);
2559 case GL_PACK_IMAGE_HEIGHT_EXT
:
2560 params
[0] = (GLfloat
)(ctx
->Pack
.ImageHeight
);
2562 case GL_PACK_INVERT_MESA
:
2563 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pack
.Invert
);
2565 case GL_PERSPECTIVE_CORRECTION_HINT
:
2566 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
2568 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2569 params
[0] = (GLfloat
)(ctx
->PixelMaps
.AtoA
.Size
);
2571 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2572 params
[0] = (GLfloat
)(ctx
->PixelMaps
.BtoB
.Size
);
2574 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2575 params
[0] = (GLfloat
)(ctx
->PixelMaps
.GtoG
.Size
);
2577 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2578 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoA
.Size
);
2580 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2581 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoB
.Size
);
2583 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2584 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoG
.Size
);
2586 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2587 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoI
.Size
);
2589 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2590 params
[0] = (GLfloat
)(ctx
->PixelMaps
.ItoR
.Size
);
2592 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2593 params
[0] = (GLfloat
)(ctx
->PixelMaps
.RtoR
.Size
);
2595 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2596 params
[0] = (GLfloat
)(ctx
->PixelMaps
.StoS
.Size
);
2599 params
[0] = ctx
->Point
.Size
;
2601 case GL_POINT_SIZE_GRANULARITY
:
2602 params
[0] = ctx
->Const
.PointSizeGranularity
;
2604 case GL_POINT_SIZE_RANGE
:
2605 params
[0] = ctx
->Const
.MinPointSizeAA
;
2606 params
[1] = ctx
->Const
.MaxPointSizeAA
;
2608 case GL_ALIASED_POINT_SIZE_RANGE
:
2609 params
[0] = ctx
->Const
.MinPointSize
;
2610 params
[1] = ctx
->Const
.MaxPointSize
;
2612 case GL_POINT_SMOOTH
:
2613 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.SmoothFlag
);
2615 case GL_POINT_SMOOTH_HINT
:
2616 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
2618 case GL_POINT_SIZE_MIN_EXT
:
2619 params
[0] = ctx
->Point
.MinSize
;
2621 case GL_POINT_SIZE_MAX_EXT
:
2622 params
[0] = ctx
->Point
.MaxSize
;
2624 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2625 params
[0] = ctx
->Point
.Threshold
;
2627 case GL_DISTANCE_ATTENUATION_EXT
:
2628 params
[0] = ctx
->Point
.Params
[0];
2629 params
[1] = ctx
->Point
.Params
[1];
2630 params
[2] = ctx
->Point
.Params
[2];
2632 case GL_POLYGON_MODE
:
2633 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
2634 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
2636 case GL_POLYGON_OFFSET_BIAS_EXT
:
2637 params
[0] = ctx
->Polygon
.OffsetUnits
;
2639 case GL_POLYGON_OFFSET_FACTOR
:
2640 params
[0] = ctx
->Polygon
.OffsetFactor
;
2642 case GL_POLYGON_OFFSET_UNITS
:
2643 params
[0] = ctx
->Polygon
.OffsetUnits
;
2645 case GL_POLYGON_OFFSET_POINT
:
2646 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.OffsetPoint
);
2648 case GL_POLYGON_OFFSET_LINE
:
2649 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.OffsetLine
);
2651 case GL_POLYGON_OFFSET_FILL
:
2652 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.OffsetFill
);
2654 case GL_POLYGON_SMOOTH
:
2655 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.SmoothFlag
);
2657 case GL_POLYGON_SMOOTH_HINT
:
2658 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
2660 case GL_POLYGON_STIPPLE
:
2661 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Polygon
.StippleFlag
);
2663 case GL_PROJECTION_MATRIX
:
2665 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
2666 params
[0] = matrix
[0];
2667 params
[1] = matrix
[1];
2668 params
[2] = matrix
[2];
2669 params
[3] = matrix
[3];
2670 params
[4] = matrix
[4];
2671 params
[5] = matrix
[5];
2672 params
[6] = matrix
[6];
2673 params
[7] = matrix
[7];
2674 params
[8] = matrix
[8];
2675 params
[9] = matrix
[9];
2676 params
[10] = matrix
[10];
2677 params
[11] = matrix
[11];
2678 params
[12] = matrix
[12];
2679 params
[13] = matrix
[13];
2680 params
[14] = matrix
[14];
2681 params
[15] = matrix
[15];
2684 case GL_PROJECTION_STACK_DEPTH
:
2685 params
[0] = (GLfloat
)(ctx
->ProjectionMatrixStack
.Depth
+ 1);
2687 case GL_READ_BUFFER
:
2688 params
[0] = ENUM_TO_FLOAT(ctx
->ReadBuffer
->ColorReadBuffer
);
2691 params
[0] = ctx
->Pixel
.RedBias
;
2694 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.redBits
);
2697 params
[0] = ctx
->Pixel
.RedScale
;
2699 case GL_RENDER_MODE
:
2700 params
[0] = ENUM_TO_FLOAT(ctx
->RenderMode
);
2702 case GL_RESCALE_NORMAL
:
2703 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RescaleNormals
);
2706 params
[0] = BOOLEAN_TO_FLOAT(GL_TRUE
);
2708 case GL_SCISSOR_BOX
:
2709 params
[0] = (GLfloat
)(ctx
->Scissor
.X
);
2710 params
[1] = (GLfloat
)(ctx
->Scissor
.Y
);
2711 params
[2] = (GLfloat
)(ctx
->Scissor
.Width
);
2712 params
[3] = (GLfloat
)(ctx
->Scissor
.Height
);
2714 case GL_SCISSOR_TEST
:
2715 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Scissor
.Enabled
);
2717 case GL_SELECTION_BUFFER_SIZE
:
2718 params
[0] = (GLfloat
)(ctx
->Select
.BufferSize
);
2720 case GL_SHADE_MODEL
:
2721 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
2723 case GL_SHARED_TEXTURE_PALETTE_EXT
:
2724 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.SharedPalette
);
2726 case GL_STENCIL_BITS
:
2727 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.stencilBits
);
2729 case GL_STENCIL_CLEAR_VALUE
:
2730 params
[0] = (GLfloat
)(ctx
->Stencil
.Clear
);
2732 case GL_STENCIL_FAIL
:
2733 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
2735 case GL_STENCIL_FUNC
:
2736 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
2738 case GL_STENCIL_PASS_DEPTH_FAIL
:
2739 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
2741 case GL_STENCIL_PASS_DEPTH_PASS
:
2742 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
2744 case GL_STENCIL_REF
:
2745 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
2747 case GL_STENCIL_TEST
:
2748 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.Enabled
);
2750 case GL_STENCIL_VALUE_MASK
:
2751 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
2753 case GL_STENCIL_WRITEMASK
:
2754 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
2757 params
[0] = BOOLEAN_TO_FLOAT(ctx
->DrawBuffer
->Visual
.stereoMode
);
2759 case GL_SUBPIXEL_BITS
:
2760 params
[0] = (GLfloat
)(ctx
->Const
.SubPixelBits
);
2763 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D
));
2766 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D
));
2769 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D
));
2771 case GL_TEXTURE_1D_ARRAY_EXT
:
2772 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2773 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
));
2775 case GL_TEXTURE_2D_ARRAY_EXT
:
2776 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2777 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
));
2779 case GL_TEXTURE_BINDING_1D
:
2780 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_INDEX
]->Name
);
2782 case GL_TEXTURE_BINDING_2D
:
2783 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_INDEX
]->Name
);
2785 case GL_TEXTURE_BINDING_3D
:
2786 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_3D_INDEX
]->Name
);
2788 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
2789 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2790 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_ARRAY_INDEX
]->Name
);
2792 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
2793 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2794 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_ARRAY_INDEX
]->Name
);
2796 case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT
:
2797 CHECK_EXT1(MESA_texture_array
, "GetFloatv");
2798 params
[0] = (GLfloat
)(ctx
->Const
.MaxArrayTextureLayers
);
2800 case GL_TEXTURE_GEN_S
:
2801 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
2803 case GL_TEXTURE_GEN_T
:
2804 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
2806 case GL_TEXTURE_GEN_R
:
2807 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
2809 case GL_TEXTURE_GEN_Q
:
2810 params
[0] = BOOLEAN_TO_FLOAT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
2812 case GL_TEXTURE_MATRIX
:
2814 const GLfloat
*matrix
;
2815 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
2816 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
2817 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGet(texture matrix %u)",
2821 matrix
= ctx
->TextureMatrixStack
[unit
].Top
->m
;
2822 params
[0] = matrix
[0];
2823 params
[1] = matrix
[1];
2824 params
[2] = matrix
[2];
2825 params
[3] = matrix
[3];
2826 params
[4] = matrix
[4];
2827 params
[5] = matrix
[5];
2828 params
[6] = matrix
[6];
2829 params
[7] = matrix
[7];
2830 params
[8] = matrix
[8];
2831 params
[9] = matrix
[9];
2832 params
[10] = matrix
[10];
2833 params
[11] = matrix
[11];
2834 params
[12] = matrix
[12];
2835 params
[13] = matrix
[13];
2836 params
[14] = matrix
[14];
2837 params
[15] = matrix
[15];
2840 case GL_TEXTURE_STACK_DEPTH
:
2842 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
2843 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
2844 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2845 "glGet(texture stack depth, unit %u)", unit
);
2848 params
[0] = (GLfloat
)(ctx
->TextureMatrixStack
[unit
].Depth
+ 1);
2851 case GL_UNPACK_ALIGNMENT
:
2852 params
[0] = (GLfloat
)(ctx
->Unpack
.Alignment
);
2854 case GL_UNPACK_LSB_FIRST
:
2855 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.LsbFirst
);
2857 case GL_UNPACK_ROW_LENGTH
:
2858 params
[0] = (GLfloat
)(ctx
->Unpack
.RowLength
);
2860 case GL_UNPACK_SKIP_PIXELS
:
2861 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipPixels
);
2863 case GL_UNPACK_SKIP_ROWS
:
2864 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipRows
);
2866 case GL_UNPACK_SWAP_BYTES
:
2867 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.SwapBytes
);
2869 case GL_UNPACK_SKIP_IMAGES_EXT
:
2870 params
[0] = (GLfloat
)(ctx
->Unpack
.SkipImages
);
2872 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2873 params
[0] = (GLfloat
)(ctx
->Unpack
.ImageHeight
);
2875 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
2876 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Unpack
.ClientStorage
);
2879 params
[0] = (GLfloat
)(ctx
->Viewport
.X
);
2880 params
[1] = (GLfloat
)(ctx
->Viewport
.Y
);
2881 params
[2] = (GLfloat
)(ctx
->Viewport
.Width
);
2882 params
[3] = (GLfloat
)(ctx
->Viewport
.Height
);
2885 params
[0] = ctx
->Pixel
.ZoomX
;
2888 params
[0] = ctx
->Pixel
.ZoomY
;
2890 case GL_VERTEX_ARRAY
:
2891 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
2893 case GL_VERTEX_ARRAY_SIZE
:
2894 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Size
);
2896 case GL_VERTEX_ARRAY_TYPE
:
2897 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
2899 case GL_VERTEX_ARRAY_STRIDE
:
2900 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
2902 case GL_VERTEX_ARRAY_COUNT_EXT
:
2903 params
[0] = (GLfloat
)(0);
2905 case GL_NORMAL_ARRAY
:
2906 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
2908 case GL_NORMAL_ARRAY_TYPE
:
2909 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Normal
.Type
);
2911 case GL_NORMAL_ARRAY_STRIDE
:
2912 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.Stride
);
2914 case GL_NORMAL_ARRAY_COUNT_EXT
:
2915 params
[0] = (GLfloat
)(0);
2917 case GL_COLOR_ARRAY
:
2918 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
2920 case GL_COLOR_ARRAY_SIZE
:
2921 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Size
);
2923 case GL_COLOR_ARRAY_TYPE
:
2924 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Color
.Type
);
2926 case GL_COLOR_ARRAY_STRIDE
:
2927 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.Stride
);
2929 case GL_COLOR_ARRAY_COUNT_EXT
:
2930 params
[0] = (GLfloat
)(0);
2932 case GL_INDEX_ARRAY
:
2933 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
2935 case GL_INDEX_ARRAY_TYPE
:
2936 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->Index
.Type
);
2938 case GL_INDEX_ARRAY_STRIDE
:
2939 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.Stride
);
2941 case GL_INDEX_ARRAY_COUNT_EXT
:
2942 params
[0] = (GLfloat
)(0);
2944 case GL_TEXTURE_COORD_ARRAY
:
2945 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
2947 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2948 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
2950 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2951 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
2953 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2954 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
2956 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2957 params
[0] = (GLfloat
)(0);
2959 case GL_EDGE_FLAG_ARRAY
:
2960 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
2962 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2963 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
2965 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2966 params
[0] = (GLfloat
)(0);
2968 case GL_MAX_TEXTURE_UNITS_ARB
:
2969 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2970 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureUnits
);
2972 case GL_ACTIVE_TEXTURE_ARB
:
2973 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2974 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2976 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2977 CHECK_EXT1(ARB_multitexture
, "GetFloatv");
2978 params
[0] = (GLfloat
)(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2980 case GL_TEXTURE_CUBE_MAP_ARB
:
2981 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2982 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
2984 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2985 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2986 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_CUBE_INDEX
]->Name
);
2988 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2989 CHECK_EXT1(ARB_texture_cube_map
, "GetFloatv");
2990 params
[0] = (GLfloat
)((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
2992 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2993 params
[0] = (GLfloat
)(ctx
->Hint
.TextureCompression
);
2995 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2996 params
[0] = (GLfloat
)(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
2998 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
3001 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
3003 for (i
= 0; i
< n
; i
++)
3004 params
[i
] = ENUM_TO_FLOAT(formats
[i
]);
3007 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
3008 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
3009 params
[0] = (GLfloat
)(ctx
->Array
.LockFirst
);
3011 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
3012 CHECK_EXT1(EXT_compiled_vertex_array
, "GetFloatv");
3013 params
[0] = (GLfloat
)(ctx
->Array
.LockCount
);
3015 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
3017 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
3018 params
[0] = matrix
[0];
3019 params
[1] = matrix
[4];
3020 params
[2] = matrix
[8];
3021 params
[3] = matrix
[12];
3022 params
[4] = matrix
[1];
3023 params
[5] = matrix
[5];
3024 params
[6] = matrix
[9];
3025 params
[7] = matrix
[13];
3026 params
[8] = matrix
[2];
3027 params
[9] = matrix
[6];
3028 params
[10] = matrix
[10];
3029 params
[11] = matrix
[14];
3030 params
[12] = matrix
[3];
3031 params
[13] = matrix
[7];
3032 params
[14] = matrix
[11];
3033 params
[15] = matrix
[15];
3036 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
3038 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
3039 params
[0] = matrix
[0];
3040 params
[1] = matrix
[4];
3041 params
[2] = matrix
[8];
3042 params
[3] = matrix
[12];
3043 params
[4] = matrix
[1];
3044 params
[5] = matrix
[5];
3045 params
[6] = matrix
[9];
3046 params
[7] = matrix
[13];
3047 params
[8] = matrix
[2];
3048 params
[9] = matrix
[6];
3049 params
[10] = matrix
[10];
3050 params
[11] = matrix
[14];
3051 params
[12] = matrix
[3];
3052 params
[13] = matrix
[7];
3053 params
[14] = matrix
[11];
3054 params
[15] = matrix
[15];
3057 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
3059 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
3060 params
[0] = matrix
[0];
3061 params
[1] = matrix
[4];
3062 params
[2] = matrix
[8];
3063 params
[3] = matrix
[12];
3064 params
[4] = matrix
[1];
3065 params
[5] = matrix
[5];
3066 params
[6] = matrix
[9];
3067 params
[7] = matrix
[13];
3068 params
[8] = matrix
[2];
3069 params
[9] = matrix
[6];
3070 params
[10] = matrix
[10];
3071 params
[11] = matrix
[14];
3072 params
[12] = matrix
[3];
3073 params
[13] = matrix
[7];
3074 params
[14] = matrix
[11];
3075 params
[15] = matrix
[15];
3078 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
3080 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
3081 params
[0] = matrix
[0];
3082 params
[1] = matrix
[4];
3083 params
[2] = matrix
[8];
3084 params
[3] = matrix
[12];
3085 params
[4] = matrix
[1];
3086 params
[5] = matrix
[5];
3087 params
[6] = matrix
[9];
3088 params
[7] = matrix
[13];
3089 params
[8] = matrix
[2];
3090 params
[9] = matrix
[6];
3091 params
[10] = matrix
[10];
3092 params
[11] = matrix
[14];
3093 params
[12] = matrix
[3];
3094 params
[13] = matrix
[7];
3095 params
[14] = matrix
[11];
3096 params
[15] = matrix
[15];
3099 case GL_COLOR_MATRIX_SGI
:
3101 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
3102 params
[0] = matrix
[0];
3103 params
[1] = matrix
[1];
3104 params
[2] = matrix
[2];
3105 params
[3] = matrix
[3];
3106 params
[4] = matrix
[4];
3107 params
[5] = matrix
[5];
3108 params
[6] = matrix
[6];
3109 params
[7] = matrix
[7];
3110 params
[8] = matrix
[8];
3111 params
[9] = matrix
[9];
3112 params
[10] = matrix
[10];
3113 params
[11] = matrix
[11];
3114 params
[12] = matrix
[12];
3115 params
[13] = matrix
[13];
3116 params
[14] = matrix
[14];
3117 params
[15] = matrix
[15];
3120 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3121 params
[0] = (GLfloat
)(ctx
->ColorMatrixStack
.Depth
+ 1);
3123 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3124 params
[0] = (GLfloat
)(MAX_COLOR_STACK_DEPTH
);
3126 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3127 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[0];
3129 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3130 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[1];
3132 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3133 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[2];
3135 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3136 params
[0] = ctx
->Pixel
.PostColorMatrixScale
[3];
3138 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3139 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[0];
3141 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3142 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[1];
3144 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3145 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[2];
3147 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3148 params
[0] = ctx
->Pixel
.PostColorMatrixBias
[3];
3150 case GL_CONVOLUTION_1D_EXT
:
3151 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3152 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution1DEnabled
);
3154 case GL_CONVOLUTION_2D_EXT
:
3155 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3156 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Convolution2DEnabled
);
3158 case GL_SEPARABLE_2D_EXT
:
3159 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3160 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.Separable2DEnabled
);
3162 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3163 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3164 params
[0] = ctx
->Pixel
.PostConvolutionScale
[0];
3166 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3167 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3168 params
[0] = ctx
->Pixel
.PostConvolutionScale
[1];
3170 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3171 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3172 params
[0] = ctx
->Pixel
.PostConvolutionScale
[2];
3174 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3175 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3176 params
[0] = ctx
->Pixel
.PostConvolutionScale
[3];
3178 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3179 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3180 params
[0] = ctx
->Pixel
.PostConvolutionBias
[0];
3182 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3183 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3184 params
[0] = ctx
->Pixel
.PostConvolutionBias
[1];
3186 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3187 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3188 params
[0] = ctx
->Pixel
.PostConvolutionBias
[2];
3190 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3191 CHECK_EXT1(EXT_convolution
, "GetFloatv");
3192 params
[0] = ctx
->Pixel
.PostConvolutionBias
[3];
3195 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3196 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.HistogramEnabled
);
3199 CHECK_EXT1(EXT_histogram
, "GetFloatv");
3200 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.MinMaxEnabled
);
3202 case GL_COLOR_TABLE_SGI
:
3203 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3204 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
]);
3206 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3207 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3208 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
]);
3210 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3211 CHECK_EXT1(SGI_color_table
, "GetFloatv");
3212 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
]);
3214 case GL_TEXTURE_COLOR_TABLE_SGI
:
3215 CHECK_EXT1(SGI_texture_color_table
, "GetFloatv");
3216 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
3218 case GL_COLOR_SUM_EXT
:
3219 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetFloatv");
3220 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Fog
.ColorSumEnabled
);
3222 case GL_CURRENT_SECONDARY_COLOR_EXT
:
3223 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3225 FLUSH_CURRENT(ctx
, 0);
3226 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0];
3227 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1];
3228 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2];
3229 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3];
3232 case GL_SECONDARY_COLOR_ARRAY_EXT
:
3233 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3234 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
3236 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
3237 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3238 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
3240 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
3241 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3242 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
3244 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
3245 CHECK_EXT1(EXT_secondary_color
, "GetFloatv");
3246 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
3248 case GL_CURRENT_FOG_COORDINATE_EXT
:
3249 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3251 FLUSH_CURRENT(ctx
, 0);
3252 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
3255 case GL_FOG_COORDINATE_ARRAY_EXT
:
3256 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3257 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
3259 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
3260 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3261 params
[0] = ENUM_TO_FLOAT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
3263 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
3264 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3265 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
3267 case GL_FOG_COORDINATE_SOURCE_EXT
:
3268 CHECK_EXT1(EXT_fog_coord
, "GetFloatv");
3269 params
[0] = ENUM_TO_FLOAT(ctx
->Fog
.FogCoordinateSource
);
3271 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
3272 CHECK_EXT1(EXT_texture_lod_bias
, "GetFloatv");
3273 params
[0] = ctx
->Const
.MaxTextureLodBias
;
3275 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
3276 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetFloatv");
3277 params
[0] = ctx
->Const
.MaxTextureMaxAnisotropy
;
3279 case GL_MULTISAMPLE_ARB
:
3280 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.Enabled
);
3282 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
3283 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToCoverage
);
3285 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
3286 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleAlphaToOne
);
3288 case GL_SAMPLE_COVERAGE_ARB
:
3289 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverage
);
3291 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
3292 params
[0] = ctx
->Multisample
.SampleCoverageValue
;
3294 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
3295 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Multisample
.SampleCoverageInvert
);
3297 case GL_SAMPLE_BUFFERS_ARB
:
3298 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
3300 case GL_SAMPLES_ARB
:
3301 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Visual
.samples
);
3303 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
3304 CHECK_EXT1(IBM_rasterpos_clip
, "GetFloatv");
3305 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.RasterPositionUnclipped
);
3307 case GL_POINT_SPRITE_NV
:
3308 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3309 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Point
.PointSprite
);
3311 case GL_POINT_SPRITE_R_MODE_NV
:
3312 CHECK_EXT1(NV_point_sprite
, "GetFloatv");
3313 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteRMode
);
3315 case GL_POINT_SPRITE_COORD_ORIGIN
:
3316 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetFloatv");
3317 params
[0] = ENUM_TO_FLOAT(ctx
->Point
.SpriteOrigin
);
3319 case GL_GENERATE_MIPMAP_HINT_SGIS
:
3320 CHECK_EXT1(SGIS_generate_mipmap
, "GetFloatv");
3321 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.GenerateMipmap
);
3323 case GL_VERTEX_PROGRAM_BINDING_NV
:
3324 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3325 params
[0] = (GLfloat
)((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
3327 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
3328 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3329 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
3331 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
3332 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3333 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
3335 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
3336 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3337 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
3339 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
3340 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3341 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
3343 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
3344 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3345 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
3347 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
3348 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3349 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
3351 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
3352 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3353 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
3355 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
3356 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3357 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
3359 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
3360 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3361 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
3363 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
3364 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3365 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
3367 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
3368 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3369 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
3371 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
3372 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3373 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
3375 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
3376 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3377 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
3379 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
3380 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3381 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
3383 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
3384 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3385 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
3387 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
3388 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3389 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
3391 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
3392 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3393 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[0]);
3395 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
3396 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3397 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[1]);
3399 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
3400 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3401 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[2]);
3403 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
3404 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3405 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[3]);
3407 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
3408 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3409 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[4]);
3411 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
3412 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3413 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[5]);
3415 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
3416 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3417 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[6]);
3419 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
3420 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3421 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[7]);
3423 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
3424 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3425 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[8]);
3427 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
3428 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3429 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[9]);
3431 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
3432 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3433 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[10]);
3435 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
3436 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3437 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[11]);
3439 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
3440 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3441 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[12]);
3443 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
3444 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3445 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[13]);
3447 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
3448 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3449 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[14]);
3451 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
3452 CHECK_EXT1(NV_vertex_program
, "GetFloatv");
3453 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Eval
.Map1Attrib
[15]);
3455 case GL_FRAGMENT_PROGRAM_NV
:
3456 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3457 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3459 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
3460 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3461 params
[0] = (GLfloat
)(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
3463 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
3464 CHECK_EXT1(NV_fragment_program
, "GetFloatv");
3465 params
[0] = (GLfloat
)(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
3467 case GL_TEXTURE_RECTANGLE_NV
:
3468 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3469 params
[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
3471 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
3472 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3473 params
[0] = (GLfloat
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_RECT_INDEX
]->Name
);
3475 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
3476 CHECK_EXT1(NV_texture_rectangle
, "GetFloatv");
3477 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureRectSize
);
3479 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
3480 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3481 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Stencil
.TestTwoSide
);
3483 case GL_ACTIVE_STENCIL_FACE_EXT
:
3484 CHECK_EXT1(EXT_stencil_two_side
, "GetFloatv");
3485 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
3487 case GL_MAX_SHININESS_NV
:
3488 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3489 params
[0] = ctx
->Const
.MaxShininess
;
3491 case GL_MAX_SPOT_EXPONENT_NV
:
3492 CHECK_EXT1(NV_light_max_exponent
, "GetFloatv");
3493 params
[0] = ctx
->Const
.MaxSpotExponent
;
3495 case GL_ARRAY_BUFFER_BINDING_ARB
:
3496 params
[0] = (GLfloat
)(ctx
->Array
.ArrayBufferObj
->Name
);
3498 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
3499 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
3501 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
3502 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
3504 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3505 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
3507 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
3508 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
3510 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
3511 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
3513 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
3514 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
3516 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3517 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
3519 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
3520 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
3522 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
3523 params
[0] = (GLfloat
)(ctx
->Array
.ElementArrayBufferObj
->Name
);
3525 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
3526 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3527 params
[0] = (GLfloat
)(ctx
->Pack
.BufferObj
->Name
);
3529 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
3530 CHECK_EXT1(EXT_pixel_buffer_object
, "GetFloatv");
3531 params
[0] = (GLfloat
)(ctx
->Unpack
.BufferObj
->Name
);
3533 case GL_VERTEX_PROGRAM_ARB
:
3534 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3535 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.Enabled
);
3537 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
3538 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3539 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.PointSizeEnabled
);
3541 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
3542 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetFloatv");
3543 params
[0] = BOOLEAN_TO_FLOAT(ctx
->VertexProgram
.TwoSideEnabled
);
3545 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
3546 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3547 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrixStackDepth
);
3549 case GL_MAX_PROGRAM_MATRICES_ARB
:
3550 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3551 params
[0] = (GLfloat
)(ctx
->Const
.MaxProgramMatrices
);
3553 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
3554 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetFloatv");
3555 params
[0] = BOOLEAN_TO_FLOAT(ctx
->CurrentStack
->Depth
+ 1);
3557 case GL_CURRENT_MATRIX_ARB
:
3558 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3560 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3561 params
[0] = matrix
[0];
3562 params
[1] = matrix
[1];
3563 params
[2] = matrix
[2];
3564 params
[3] = matrix
[3];
3565 params
[4] = matrix
[4];
3566 params
[5] = matrix
[5];
3567 params
[6] = matrix
[6];
3568 params
[7] = matrix
[7];
3569 params
[8] = matrix
[8];
3570 params
[9] = matrix
[9];
3571 params
[10] = matrix
[10];
3572 params
[11] = matrix
[11];
3573 params
[12] = matrix
[12];
3574 params
[13] = matrix
[13];
3575 params
[14] = matrix
[14];
3576 params
[15] = matrix
[15];
3579 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
3580 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetFloatv");
3582 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
3583 params
[0] = matrix
[0];
3584 params
[1] = matrix
[4];
3585 params
[2] = matrix
[8];
3586 params
[3] = matrix
[12];
3587 params
[4] = matrix
[1];
3588 params
[5] = matrix
[5];
3589 params
[6] = matrix
[9];
3590 params
[7] = matrix
[13];
3591 params
[8] = matrix
[2];
3592 params
[9] = matrix
[6];
3593 params
[10] = matrix
[10];
3594 params
[11] = matrix
[14];
3595 params
[12] = matrix
[3];
3596 params
[13] = matrix
[7];
3597 params
[14] = matrix
[11];
3598 params
[15] = matrix
[15];
3601 case GL_MAX_VERTEX_ATTRIBS_ARB
:
3602 CHECK_EXT1(ARB_vertex_program
, "GetFloatv");
3603 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxAttribs
);
3605 case GL_PROGRAM_ERROR_POSITION_ARB
:
3606 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetFloatv");
3607 params
[0] = (GLfloat
)(ctx
->Program
.ErrorPos
);
3609 case GL_FRAGMENT_PROGRAM_ARB
:
3610 CHECK_EXT1(ARB_fragment_program
, "GetFloatv");
3611 params
[0] = BOOLEAN_TO_FLOAT(ctx
->FragmentProgram
.Enabled
);
3613 case GL_MAX_TEXTURE_COORDS_ARB
:
3614 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3615 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureCoordUnits
);
3617 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
3618 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetFloatv");
3619 params
[0] = (GLfloat
)(ctx
->Const
.MaxTextureImageUnits
);
3621 case GL_DEPTH_BOUNDS_TEST_EXT
:
3622 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3623 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Depth
.BoundsTest
);
3625 case GL_DEPTH_BOUNDS_EXT
:
3626 CHECK_EXT1(EXT_depth_bounds_test
, "GetFloatv");
3627 params
[0] = ctx
->Depth
.BoundsMin
;
3628 params
[1] = ctx
->Depth
.BoundsMax
;
3630 case GL_DEPTH_CLAMP
:
3631 CHECK_EXT1(ARB_depth_clamp
, "GetFloatv");
3632 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Transform
.DepthClamp
);
3634 case GL_MAX_DRAW_BUFFERS_ARB
:
3635 params
[0] = (GLfloat
)(ctx
->Const
.MaxDrawBuffers
);
3637 case GL_DRAW_BUFFER0_ARB
:
3638 params
[0] = ENUM_TO_FLOAT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
3640 case GL_DRAW_BUFFER1_ARB
:
3643 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3644 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3647 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
3648 params
[0] = ENUM_TO_FLOAT(buffer
);
3651 case GL_DRAW_BUFFER2_ARB
:
3654 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3655 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3658 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
3659 params
[0] = ENUM_TO_FLOAT(buffer
);
3662 case GL_DRAW_BUFFER3_ARB
:
3665 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
3666 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
3669 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
3670 params
[0] = ENUM_TO_FLOAT(buffer
);
3673 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
3674 CHECK_EXT1(OES_read_format
, "GetFloatv");
3675 params
[0] = (GLfloat
)(_mesa_get_color_read_type(ctx
));
3677 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
3678 CHECK_EXT1(OES_read_format
, "GetFloatv");
3679 params
[0] = (GLfloat
)(_mesa_get_color_read_format(ctx
));
3681 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
3682 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3683 params
[0] = (GLfloat
)(6);
3685 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
3686 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3687 params
[0] = (GLfloat
)(8);
3689 case GL_NUM_PASSES_ATI
:
3690 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3691 params
[0] = (GLfloat
)(2);
3693 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
3694 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3695 params
[0] = (GLfloat
)(8);
3697 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
3698 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3699 params
[0] = (GLfloat
)(16);
3701 case GL_COLOR_ALPHA_PAIRING_ATI
:
3702 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3703 params
[0] = BOOLEAN_TO_FLOAT(GL_TRUE
);
3705 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
3706 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3707 params
[0] = (GLfloat
)(3);
3709 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
3710 CHECK_EXT1(ATI_fragment_shader
, "GetFloatv");
3711 params
[0] = (GLfloat
)(3);
3713 case GL_STENCIL_BACK_FUNC
:
3714 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.Function
[1]);
3716 case GL_STENCIL_BACK_VALUE_MASK
:
3717 params
[0] = (GLfloat
)(ctx
->Stencil
.ValueMask
[1]);
3719 case GL_STENCIL_BACK_WRITEMASK
:
3720 params
[0] = (GLfloat
)(ctx
->Stencil
.WriteMask
[1]);
3722 case GL_STENCIL_BACK_REF
:
3723 params
[0] = (GLfloat
)(ctx
->Stencil
.Ref
[1]);
3725 case GL_STENCIL_BACK_FAIL
:
3726 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[1]);
3728 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
3729 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[1]);
3731 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
3732 params
[0] = ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[1]);
3734 case GL_FRAMEBUFFER_BINDING_EXT
:
3735 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3736 params
[0] = (GLfloat
)(ctx
->DrawBuffer
->Name
);
3738 case GL_RENDERBUFFER_BINDING_EXT
:
3739 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3740 params
[0] = (GLfloat
)(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
3742 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
3743 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3744 params
[0] = (GLfloat
)(ctx
->Const
.MaxColorAttachments
);
3746 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
3747 CHECK_EXT1(EXT_framebuffer_object
, "GetFloatv");
3748 params
[0] = (GLfloat
)(ctx
->Const
.MaxRenderbufferSize
);
3750 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
3751 CHECK_EXT1(EXT_framebuffer_blit
, "GetFloatv");
3752 params
[0] = (GLfloat
)(ctx
->ReadBuffer
->Name
);
3754 case GL_PROVOKING_VERTEX_EXT
:
3755 CHECK_EXT1(EXT_provoking_vertex
, "GetFloatv");
3756 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Light
.ProvokingVertex
);
3758 case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT
:
3759 CHECK_EXT1(EXT_provoking_vertex
, "GetFloatv");
3760 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Const
.QuadsFollowProvokingVertexConvention
);
3762 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
3763 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3764 params
[0] = (GLfloat
)(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
3766 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
3767 CHECK_EXT1(ARB_fragment_shader
, "GetFloatv");
3768 params
[0] = ENUM_TO_FLOAT(ctx
->Hint
.FragmentShaderDerivative
);
3770 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
3771 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3772 params
[0] = (GLfloat
)(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
3774 case GL_MAX_VARYING_FLOATS_ARB
:
3775 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3776 params
[0] = (GLfloat
)(ctx
->Const
.MaxVarying
* 4);
3778 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
3779 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3780 params
[0] = (GLfloat
)(ctx
->Const
.MaxVertexTextureImageUnits
);
3782 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
3783 CHECK_EXT1(ARB_vertex_shader
, "GetFloatv");
3784 params
[0] = (GLfloat
)(ctx
->Const
.MaxCombinedTextureImageUnits
);
3786 case GL_CURRENT_PROGRAM
:
3787 CHECK_EXT1(ARB_shader_objects
, "GetFloatv");
3788 params
[0] = (GLfloat
)(ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0);
3790 case GL_MAX_SAMPLES
:
3791 CHECK_EXT1(ARB_framebuffer_object
, "GetFloatv");
3792 params
[0] = (GLfloat
)(ctx
->Const
.MaxSamples
);
3794 case GL_VERTEX_ARRAY_BINDING_APPLE
:
3795 CHECK_EXT1(APPLE_vertex_array_object
, "GetFloatv");
3796 params
[0] = (GLfloat
)(ctx
->Array
.ArrayObj
->Name
);
3798 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
3799 CHECK_EXT1(ARB_seamless_cube_map
, "GetFloatv");
3800 params
[0] = BOOLEAN_TO_FLOAT(ctx
->Texture
.CubeMapSeamless
);
3802 case GL_MAX_SERVER_WAIT_TIMEOUT
:
3803 CHECK_EXT1(ARB_sync
, "GetFloatv");
3804 params
[0] = (GLfloat
)(ctx
->Const
.MaxServerWaitTimeout
);
3806 case GL_NUM_EXTENSIONS
:
3807 params
[0] = (GLfloat
)(_mesa_get_extension_count(ctx
));
3809 case GL_MAJOR_VERSION
:
3810 params
[0] = (GLfloat
)(ctx
->VersionMajor
);
3812 case GL_MINOR_VERSION
:
3813 params
[0] = (GLfloat
)(ctx
->VersionMinor
);
3815 case GL_CONTEXT_FLAGS
:
3816 params
[0] = (GLfloat
)(ctx
->Const
.ContextFlags
);
3819 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv(pname=0x%x)", pname
);
3824 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3826 GET_CURRENT_CONTEXT(ctx
);
3827 ASSERT_OUTSIDE_BEGIN_END(ctx
);
3833 _mesa_update_state(ctx
);
3835 if (ctx
->Driver
.GetIntegerv
&&
3836 ctx
->Driver
.GetIntegerv(ctx
, pname
, params
))
3840 case GL_ACCUM_RED_BITS
:
3841 params
[0] = ctx
->DrawBuffer
->Visual
.accumRedBits
;
3843 case GL_ACCUM_GREEN_BITS
:
3844 params
[0] = ctx
->DrawBuffer
->Visual
.accumGreenBits
;
3846 case GL_ACCUM_BLUE_BITS
:
3847 params
[0] = ctx
->DrawBuffer
->Visual
.accumBlueBits
;
3849 case GL_ACCUM_ALPHA_BITS
:
3850 params
[0] = ctx
->DrawBuffer
->Visual
.accumAlphaBits
;
3852 case GL_ACCUM_CLEAR_VALUE
:
3853 params
[0] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[0]);
3854 params
[1] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[1]);
3855 params
[2] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[2]);
3856 params
[3] = FLOAT_TO_INT(ctx
->Accum
.ClearColor
[3]);
3859 params
[0] = IROUND(ctx
->Pixel
.AlphaBias
);
3862 params
[0] = ctx
->DrawBuffer
->Visual
.alphaBits
;
3864 case GL_ALPHA_SCALE
:
3865 params
[0] = IROUND(ctx
->Pixel
.AlphaScale
);
3868 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.AlphaEnabled
);
3870 case GL_ALPHA_TEST_FUNC
:
3871 params
[0] = ENUM_TO_INT(ctx
->Color
.AlphaFunc
);
3873 case GL_ALPHA_TEST_REF
:
3874 params
[0] = FLOAT_TO_INT(ctx
->Color
.AlphaRef
);
3876 case GL_ATTRIB_STACK_DEPTH
:
3877 params
[0] = ctx
->AttribStackDepth
;
3879 case GL_AUTO_NORMAL
:
3880 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.AutoNormal
);
3882 case GL_AUX_BUFFERS
:
3883 params
[0] = ctx
->DrawBuffer
->Visual
.numAuxBuffers
;
3886 params
[0] = BOOLEAN_TO_INT((ctx
->Color
.BlendEnabled
& 1));
3889 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3892 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3894 case GL_BLEND_SRC_RGB_EXT
:
3895 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcRGB
);
3897 case GL_BLEND_DST_RGB_EXT
:
3898 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstRGB
);
3900 case GL_BLEND_SRC_ALPHA_EXT
:
3901 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendSrcA
);
3903 case GL_BLEND_DST_ALPHA_EXT
:
3904 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendDstA
);
3906 case GL_BLEND_EQUATION
:
3907 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationRGB
);
3909 case GL_BLEND_EQUATION_ALPHA_EXT
:
3910 params
[0] = ENUM_TO_INT(ctx
->Color
.BlendEquationA
);
3912 case GL_BLEND_COLOR_EXT
:
3913 params
[0] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[0]);
3914 params
[1] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[1]);
3915 params
[2] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[2]);
3916 params
[3] = FLOAT_TO_INT(ctx
->Color
.BlendColor
[3]);
3919 params
[0] = IROUND(ctx
->Pixel
.BlueBias
);
3922 params
[0] = ctx
->DrawBuffer
->Visual
.blueBits
;
3925 params
[0] = IROUND(ctx
->Pixel
.BlueScale
);
3927 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3928 params
[0] = ctx
->ClientAttribStackDepth
;
3930 case GL_CLIP_PLANE0
:
3931 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
3933 case GL_CLIP_PLANE1
:
3934 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
3936 case GL_CLIP_PLANE2
:
3937 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
3939 case GL_CLIP_PLANE3
:
3940 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
3942 case GL_CLIP_PLANE4
:
3943 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
3945 case GL_CLIP_PLANE5
:
3946 params
[0] = BOOLEAN_TO_INT((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
3948 case GL_COLOR_CLEAR_VALUE
:
3949 params
[0] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[0]);
3950 params
[1] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[1]);
3951 params
[2] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[2]);
3952 params
[3] = FLOAT_TO_INT(ctx
->Color
.ClearColor
[3]);
3954 case GL_COLOR_MATERIAL
:
3955 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.ColorMaterialEnabled
);
3957 case GL_COLOR_MATERIAL_FACE
:
3958 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialFace
);
3960 case GL_COLOR_MATERIAL_PARAMETER
:
3961 params
[0] = ENUM_TO_INT(ctx
->Light
.ColorMaterialMode
);
3963 case GL_COLOR_WRITEMASK
:
3964 params
[0] = ctx
->Color
.ColorMask
[0][RCOMP
] ? 1 : 0;
3965 params
[1] = ctx
->Color
.ColorMask
[0][GCOMP
] ? 1 : 0;
3966 params
[2] = ctx
->Color
.ColorMask
[0][BCOMP
] ? 1 : 0;
3967 params
[3] = ctx
->Color
.ColorMask
[0][ACOMP
] ? 1 : 0;
3970 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.CullFlag
);
3972 case GL_CULL_FACE_MODE
:
3973 params
[0] = ENUM_TO_INT(ctx
->Polygon
.CullFaceMode
);
3975 case GL_CURRENT_COLOR
:
3977 FLUSH_CURRENT(ctx
, 0);
3978 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
3979 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
3980 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
3981 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
3984 case GL_CURRENT_INDEX
:
3986 FLUSH_CURRENT(ctx
, 0);
3987 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
3990 case GL_CURRENT_NORMAL
:
3992 FLUSH_CURRENT(ctx
, 0);
3993 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
3994 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
3995 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
3998 case GL_CURRENT_RASTER_COLOR
:
3999 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[0]);
4000 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[1]);
4001 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[2]);
4002 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterColor
[3]);
4004 case GL_CURRENT_RASTER_DISTANCE
:
4005 params
[0] = IROUND(ctx
->Current
.RasterDistance
);
4007 case GL_CURRENT_RASTER_INDEX
:
4008 params
[0] = IROUND(1.0);
4010 case GL_CURRENT_RASTER_POSITION
:
4011 params
[0] = IROUND(ctx
->Current
.RasterPos
[0]);
4012 params
[1] = IROUND(ctx
->Current
.RasterPos
[1]);
4013 params
[2] = IROUND(ctx
->Current
.RasterPos
[2]);
4014 params
[3] = IROUND(ctx
->Current
.RasterPos
[3]);
4016 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
4017 params
[0] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[0]);
4018 params
[1] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[1]);
4019 params
[2] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[2]);
4020 params
[3] = FLOAT_TO_INT(ctx
->Current
.RasterSecondaryColor
[3]);
4022 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
4024 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
4025 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
4026 _mesa_error(ctx
, GL_INVALID_OPERATION
,
4027 "glGet(raster tex coords, unit %u)", unit
);
4030 params
[0] = IROUND(ctx
->Current
.RasterTexCoords
[unit
][0]);
4031 params
[1] = IROUND(ctx
->Current
.RasterTexCoords
[unit
][1]);
4032 params
[2] = IROUND(ctx
->Current
.RasterTexCoords
[unit
][2]);
4033 params
[3] = IROUND(ctx
->Current
.RasterTexCoords
[unit
][3]);
4036 case GL_CURRENT_RASTER_POSITION_VALID
:
4037 params
[0] = BOOLEAN_TO_INT(ctx
->Current
.RasterPosValid
);
4039 case GL_CURRENT_TEXTURE_COORDS
:
4041 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
4042 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
4043 _mesa_error(ctx
, GL_INVALID_OPERATION
,
4044 "glGet(current tex coords, unit %u)", unit
);
4047 FLUSH_CURRENT(ctx
, 0);
4048 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][0]);
4049 params
[1] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][1]);
4050 params
[2] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][2]);
4051 params
[3] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][3]);
4055 params
[0] = IROUND(ctx
->Pixel
.DepthBias
);
4058 params
[0] = ctx
->DrawBuffer
->Visual
.depthBits
;
4060 case GL_DEPTH_CLEAR_VALUE
:
4061 params
[0] = FLOAT_TO_INT(((GLfloat
) ctx
->Depth
.Clear
));
4064 params
[0] = ENUM_TO_INT(ctx
->Depth
.Func
);
4066 case GL_DEPTH_RANGE
:
4067 params
[0] = FLOAT_TO_INT(ctx
->Viewport
.Near
);
4068 params
[1] = FLOAT_TO_INT(ctx
->Viewport
.Far
);
4070 case GL_DEPTH_SCALE
:
4071 params
[0] = IROUND(ctx
->Pixel
.DepthScale
);
4074 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Test
);
4076 case GL_DEPTH_WRITEMASK
:
4077 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.Mask
);
4080 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.DitherFlag
);
4082 case GL_DOUBLEBUFFER
:
4083 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
4085 case GL_DRAW_BUFFER
:
4086 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
4090 FLUSH_CURRENT(ctx
, 0);
4091 params
[0] = BOOLEAN_TO_INT((ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0));
4094 case GL_FEEDBACK_BUFFER_SIZE
:
4095 params
[0] = ctx
->Feedback
.BufferSize
;
4097 case GL_FEEDBACK_BUFFER_TYPE
:
4098 params
[0] = ENUM_TO_INT(ctx
->Feedback
.Type
);
4101 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.Enabled
);
4104 params
[0] = FLOAT_TO_INT(ctx
->Fog
.Color
[0]);
4105 params
[1] = FLOAT_TO_INT(ctx
->Fog
.Color
[1]);
4106 params
[2] = FLOAT_TO_INT(ctx
->Fog
.Color
[2]);
4107 params
[3] = FLOAT_TO_INT(ctx
->Fog
.Color
[3]);
4109 case GL_FOG_DENSITY
:
4110 params
[0] = IROUND(ctx
->Fog
.Density
);
4113 params
[0] = IROUND(ctx
->Fog
.End
);
4116 params
[0] = ENUM_TO_INT(ctx
->Hint
.Fog
);
4119 params
[0] = IROUND(ctx
->Fog
.Index
);
4122 params
[0] = ENUM_TO_INT(ctx
->Fog
.Mode
);
4125 params
[0] = IROUND(ctx
->Fog
.Start
);
4128 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontFace
);
4131 params
[0] = IROUND(ctx
->Pixel
.GreenBias
);
4134 params
[0] = ctx
->DrawBuffer
->Visual
.greenBits
;
4136 case GL_GREEN_SCALE
:
4137 params
[0] = IROUND(ctx
->Pixel
.GreenScale
);
4140 params
[0] = ctx
->DrawBuffer
->Visual
.indexBits
;
4142 case GL_INDEX_CLEAR_VALUE
:
4143 params
[0] = ctx
->Color
.ClearIndex
;
4146 params
[0] = BOOLEAN_TO_INT(GL_FALSE
);
4148 case GL_INDEX_OFFSET
:
4149 params
[0] = ctx
->Pixel
.IndexOffset
;
4151 case GL_INDEX_SHIFT
:
4152 params
[0] = ctx
->Pixel
.IndexShift
;
4154 case GL_INDEX_WRITEMASK
:
4155 params
[0] = ctx
->Color
.IndexMask
;
4158 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[0].Enabled
);
4161 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[1].Enabled
);
4164 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[2].Enabled
);
4167 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[3].Enabled
);
4170 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[4].Enabled
);
4173 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[5].Enabled
);
4176 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[6].Enabled
);
4179 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Light
[7].Enabled
);
4182 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Enabled
);
4184 case GL_LIGHT_MODEL_AMBIENT
:
4185 params
[0] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[0]);
4186 params
[1] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[1]);
4187 params
[2] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[2]);
4188 params
[3] = FLOAT_TO_INT(ctx
->Light
.Model
.Ambient
[3]);
4190 case GL_LIGHT_MODEL_COLOR_CONTROL
:
4191 params
[0] = ENUM_TO_INT(ctx
->Light
.Model
.ColorControl
);
4193 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
4194 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.LocalViewer
);
4196 case GL_LIGHT_MODEL_TWO_SIDE
:
4197 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.Model
.TwoSide
);
4199 case GL_LINE_SMOOTH
:
4200 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.SmoothFlag
);
4202 case GL_LINE_SMOOTH_HINT
:
4203 params
[0] = ENUM_TO_INT(ctx
->Hint
.LineSmooth
);
4205 case GL_LINE_STIPPLE
:
4206 params
[0] = BOOLEAN_TO_INT(ctx
->Line
.StippleFlag
);
4208 case GL_LINE_STIPPLE_PATTERN
:
4209 params
[0] = ctx
->Line
.StipplePattern
;
4211 case GL_LINE_STIPPLE_REPEAT
:
4212 params
[0] = ctx
->Line
.StippleFactor
;
4215 params
[0] = IROUND(ctx
->Line
.Width
);
4217 case GL_LINE_WIDTH_GRANULARITY
:
4218 params
[0] = IROUND(ctx
->Const
.LineWidthGranularity
);
4220 case GL_LINE_WIDTH_RANGE
:
4221 params
[0] = IROUND(ctx
->Const
.MinLineWidthAA
);
4222 params
[1] = IROUND(ctx
->Const
.MaxLineWidthAA
);
4224 case GL_ALIASED_LINE_WIDTH_RANGE
:
4225 params
[0] = IROUND(ctx
->Const
.MinLineWidth
);
4226 params
[1] = IROUND(ctx
->Const
.MaxLineWidth
);
4229 params
[0] = ctx
->List
.ListBase
;
4232 params
[0] = (ctx
->ListState
.CurrentList
? ctx
->ListState
.CurrentList
->Name
: 0);
4237 if (!ctx
->CompileFlag
)
4239 else if (ctx
->ExecuteFlag
)
4240 mode
= GL_COMPILE_AND_EXECUTE
;
4243 params
[0] = ENUM_TO_INT(mode
);
4246 case GL_INDEX_LOGIC_OP
:
4247 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.IndexLogicOpEnabled
);
4249 case GL_COLOR_LOGIC_OP
:
4250 params
[0] = BOOLEAN_TO_INT(ctx
->Color
.ColorLogicOpEnabled
);
4252 case GL_LOGIC_OP_MODE
:
4253 params
[0] = ENUM_TO_INT(ctx
->Color
.LogicOp
);
4255 case GL_MAP1_COLOR_4
:
4256 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Color4
);
4258 case GL_MAP1_GRID_DOMAIN
:
4259 params
[0] = IROUND(ctx
->Eval
.MapGrid1u1
);
4260 params
[1] = IROUND(ctx
->Eval
.MapGrid1u2
);
4262 case GL_MAP1_GRID_SEGMENTS
:
4263 params
[0] = ctx
->Eval
.MapGrid1un
;
4266 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Index
);
4268 case GL_MAP1_NORMAL
:
4269 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Normal
);
4271 case GL_MAP1_TEXTURE_COORD_1
:
4272 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord1
);
4274 case GL_MAP1_TEXTURE_COORD_2
:
4275 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord2
);
4277 case GL_MAP1_TEXTURE_COORD_3
:
4278 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord3
);
4280 case GL_MAP1_TEXTURE_COORD_4
:
4281 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1TextureCoord4
);
4283 case GL_MAP1_VERTEX_3
:
4284 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex3
);
4286 case GL_MAP1_VERTEX_4
:
4287 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Vertex4
);
4289 case GL_MAP2_COLOR_4
:
4290 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Color4
);
4292 case GL_MAP2_GRID_DOMAIN
:
4293 params
[0] = IROUND(ctx
->Eval
.MapGrid2u1
);
4294 params
[1] = IROUND(ctx
->Eval
.MapGrid2u2
);
4295 params
[2] = IROUND(ctx
->Eval
.MapGrid2v1
);
4296 params
[3] = IROUND(ctx
->Eval
.MapGrid2v2
);
4298 case GL_MAP2_GRID_SEGMENTS
:
4299 params
[0] = ctx
->Eval
.MapGrid2un
;
4300 params
[1] = ctx
->Eval
.MapGrid2vn
;
4303 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Index
);
4305 case GL_MAP2_NORMAL
:
4306 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Normal
);
4308 case GL_MAP2_TEXTURE_COORD_1
:
4309 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord1
);
4311 case GL_MAP2_TEXTURE_COORD_2
:
4312 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord2
);
4314 case GL_MAP2_TEXTURE_COORD_3
:
4315 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord3
);
4317 case GL_MAP2_TEXTURE_COORD_4
:
4318 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2TextureCoord4
);
4320 case GL_MAP2_VERTEX_3
:
4321 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex3
);
4323 case GL_MAP2_VERTEX_4
:
4324 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map2Vertex4
);
4327 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapColorFlag
);
4329 case GL_MAP_STENCIL
:
4330 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MapStencilFlag
);
4332 case GL_MATRIX_MODE
:
4333 params
[0] = ENUM_TO_INT(ctx
->Transform
.MatrixMode
);
4335 case GL_MAX_ATTRIB_STACK_DEPTH
:
4336 params
[0] = MAX_ATTRIB_STACK_DEPTH
;
4338 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
4339 params
[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH
;
4341 case GL_MAX_CLIP_PLANES
:
4342 params
[0] = ctx
->Const
.MaxClipPlanes
;
4344 case GL_MAX_ELEMENTS_VERTICES
:
4345 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4347 case GL_MAX_ELEMENTS_INDICES
:
4348 params
[0] = ctx
->Const
.MaxArrayLockSize
;
4350 case GL_MAX_EVAL_ORDER
:
4351 params
[0] = MAX_EVAL_ORDER
;
4354 params
[0] = ctx
->Const
.MaxLights
;
4356 case GL_MAX_LIST_NESTING
:
4357 params
[0] = MAX_LIST_NESTING
;
4359 case GL_MAX_MODELVIEW_STACK_DEPTH
:
4360 params
[0] = MAX_MODELVIEW_STACK_DEPTH
;
4362 case GL_MAX_NAME_STACK_DEPTH
:
4363 params
[0] = MAX_NAME_STACK_DEPTH
;
4365 case GL_MAX_PIXEL_MAP_TABLE
:
4366 params
[0] = MAX_PIXEL_MAP_TABLE
;
4368 case GL_MAX_PROJECTION_STACK_DEPTH
:
4369 params
[0] = MAX_PROJECTION_STACK_DEPTH
;
4371 case GL_MAX_TEXTURE_SIZE
:
4372 params
[0] = 1 << (ctx
->Const
.MaxTextureLevels
- 1);
4374 case GL_MAX_3D_TEXTURE_SIZE
:
4375 params
[0] = 1 << (ctx
->Const
.Max3DTextureLevels
- 1);
4377 case GL_MAX_TEXTURE_STACK_DEPTH
:
4378 params
[0] = MAX_TEXTURE_STACK_DEPTH
;
4380 case GL_MAX_VIEWPORT_DIMS
:
4381 params
[0] = ctx
->Const
.MaxViewportWidth
;
4382 params
[1] = ctx
->Const
.MaxViewportHeight
;
4384 case GL_MODELVIEW_MATRIX
:
4386 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4387 params
[0] = IROUND(matrix
[0]);
4388 params
[1] = IROUND(matrix
[1]);
4389 params
[2] = IROUND(matrix
[2]);
4390 params
[3] = IROUND(matrix
[3]);
4391 params
[4] = IROUND(matrix
[4]);
4392 params
[5] = IROUND(matrix
[5]);
4393 params
[6] = IROUND(matrix
[6]);
4394 params
[7] = IROUND(matrix
[7]);
4395 params
[8] = IROUND(matrix
[8]);
4396 params
[9] = IROUND(matrix
[9]);
4397 params
[10] = IROUND(matrix
[10]);
4398 params
[11] = IROUND(matrix
[11]);
4399 params
[12] = IROUND(matrix
[12]);
4400 params
[13] = IROUND(matrix
[13]);
4401 params
[14] = IROUND(matrix
[14]);
4402 params
[15] = IROUND(matrix
[15]);
4405 case GL_MODELVIEW_STACK_DEPTH
:
4406 params
[0] = ctx
->ModelviewMatrixStack
.Depth
+ 1;
4408 case GL_NAME_STACK_DEPTH
:
4409 params
[0] = ctx
->Select
.NameStackDepth
;
4412 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.Normalize
);
4414 case GL_PACK_ALIGNMENT
:
4415 params
[0] = ctx
->Pack
.Alignment
;
4417 case GL_PACK_LSB_FIRST
:
4418 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.LsbFirst
);
4420 case GL_PACK_ROW_LENGTH
:
4421 params
[0] = ctx
->Pack
.RowLength
;
4423 case GL_PACK_SKIP_PIXELS
:
4424 params
[0] = ctx
->Pack
.SkipPixels
;
4426 case GL_PACK_SKIP_ROWS
:
4427 params
[0] = ctx
->Pack
.SkipRows
;
4429 case GL_PACK_SWAP_BYTES
:
4430 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.SwapBytes
);
4432 case GL_PACK_SKIP_IMAGES_EXT
:
4433 params
[0] = ctx
->Pack
.SkipImages
;
4435 case GL_PACK_IMAGE_HEIGHT_EXT
:
4436 params
[0] = ctx
->Pack
.ImageHeight
;
4438 case GL_PACK_INVERT_MESA
:
4439 params
[0] = BOOLEAN_TO_INT(ctx
->Pack
.Invert
);
4441 case GL_PERSPECTIVE_CORRECTION_HINT
:
4442 params
[0] = ENUM_TO_INT(ctx
->Hint
.PerspectiveCorrection
);
4444 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4445 params
[0] = ctx
->PixelMaps
.AtoA
.Size
;
4447 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4448 params
[0] = ctx
->PixelMaps
.BtoB
.Size
;
4450 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4451 params
[0] = ctx
->PixelMaps
.GtoG
.Size
;
4453 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4454 params
[0] = ctx
->PixelMaps
.ItoA
.Size
;
4456 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4457 params
[0] = ctx
->PixelMaps
.ItoB
.Size
;
4459 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4460 params
[0] = ctx
->PixelMaps
.ItoG
.Size
;
4462 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4463 params
[0] = ctx
->PixelMaps
.ItoI
.Size
;
4465 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4466 params
[0] = ctx
->PixelMaps
.ItoR
.Size
;
4468 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4469 params
[0] = ctx
->PixelMaps
.RtoR
.Size
;
4471 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4472 params
[0] = ctx
->PixelMaps
.StoS
.Size
;
4475 params
[0] = IROUND(ctx
->Point
.Size
);
4477 case GL_POINT_SIZE_GRANULARITY
:
4478 params
[0] = IROUND(ctx
->Const
.PointSizeGranularity
);
4480 case GL_POINT_SIZE_RANGE
:
4481 params
[0] = IROUND(ctx
->Const
.MinPointSizeAA
);
4482 params
[1] = IROUND(ctx
->Const
.MaxPointSizeAA
);
4484 case GL_ALIASED_POINT_SIZE_RANGE
:
4485 params
[0] = IROUND(ctx
->Const
.MinPointSize
);
4486 params
[1] = IROUND(ctx
->Const
.MaxPointSize
);
4488 case GL_POINT_SMOOTH
:
4489 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.SmoothFlag
);
4491 case GL_POINT_SMOOTH_HINT
:
4492 params
[0] = ENUM_TO_INT(ctx
->Hint
.PointSmooth
);
4494 case GL_POINT_SIZE_MIN_EXT
:
4495 params
[0] = IROUND(ctx
->Point
.MinSize
);
4497 case GL_POINT_SIZE_MAX_EXT
:
4498 params
[0] = IROUND(ctx
->Point
.MaxSize
);
4500 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4501 params
[0] = IROUND(ctx
->Point
.Threshold
);
4503 case GL_DISTANCE_ATTENUATION_EXT
:
4504 params
[0] = IROUND(ctx
->Point
.Params
[0]);
4505 params
[1] = IROUND(ctx
->Point
.Params
[1]);
4506 params
[2] = IROUND(ctx
->Point
.Params
[2]);
4508 case GL_POLYGON_MODE
:
4509 params
[0] = ENUM_TO_INT(ctx
->Polygon
.FrontMode
);
4510 params
[1] = ENUM_TO_INT(ctx
->Polygon
.BackMode
);
4512 case GL_POLYGON_OFFSET_BIAS_EXT
:
4513 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4515 case GL_POLYGON_OFFSET_FACTOR
:
4516 params
[0] = IROUND(ctx
->Polygon
.OffsetFactor
);
4518 case GL_POLYGON_OFFSET_UNITS
:
4519 params
[0] = IROUND(ctx
->Polygon
.OffsetUnits
);
4521 case GL_POLYGON_OFFSET_POINT
:
4522 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.OffsetPoint
);
4524 case GL_POLYGON_OFFSET_LINE
:
4525 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.OffsetLine
);
4527 case GL_POLYGON_OFFSET_FILL
:
4528 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.OffsetFill
);
4530 case GL_POLYGON_SMOOTH
:
4531 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.SmoothFlag
);
4533 case GL_POLYGON_SMOOTH_HINT
:
4534 params
[0] = ENUM_TO_INT(ctx
->Hint
.PolygonSmooth
);
4536 case GL_POLYGON_STIPPLE
:
4537 params
[0] = BOOLEAN_TO_INT(ctx
->Polygon
.StippleFlag
);
4539 case GL_PROJECTION_MATRIX
:
4541 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4542 params
[0] = IROUND(matrix
[0]);
4543 params
[1] = IROUND(matrix
[1]);
4544 params
[2] = IROUND(matrix
[2]);
4545 params
[3] = IROUND(matrix
[3]);
4546 params
[4] = IROUND(matrix
[4]);
4547 params
[5] = IROUND(matrix
[5]);
4548 params
[6] = IROUND(matrix
[6]);
4549 params
[7] = IROUND(matrix
[7]);
4550 params
[8] = IROUND(matrix
[8]);
4551 params
[9] = IROUND(matrix
[9]);
4552 params
[10] = IROUND(matrix
[10]);
4553 params
[11] = IROUND(matrix
[11]);
4554 params
[12] = IROUND(matrix
[12]);
4555 params
[13] = IROUND(matrix
[13]);
4556 params
[14] = IROUND(matrix
[14]);
4557 params
[15] = IROUND(matrix
[15]);
4560 case GL_PROJECTION_STACK_DEPTH
:
4561 params
[0] = ctx
->ProjectionMatrixStack
.Depth
+ 1;
4563 case GL_READ_BUFFER
:
4564 params
[0] = ENUM_TO_INT(ctx
->ReadBuffer
->ColorReadBuffer
);
4567 params
[0] = IROUND(ctx
->Pixel
.RedBias
);
4570 params
[0] = ctx
->DrawBuffer
->Visual
.redBits
;
4573 params
[0] = IROUND(ctx
->Pixel
.RedScale
);
4575 case GL_RENDER_MODE
:
4576 params
[0] = ENUM_TO_INT(ctx
->RenderMode
);
4578 case GL_RESCALE_NORMAL
:
4579 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RescaleNormals
);
4582 params
[0] = BOOLEAN_TO_INT(GL_TRUE
);
4584 case GL_SCISSOR_BOX
:
4585 params
[0] = ctx
->Scissor
.X
;
4586 params
[1] = ctx
->Scissor
.Y
;
4587 params
[2] = ctx
->Scissor
.Width
;
4588 params
[3] = ctx
->Scissor
.Height
;
4590 case GL_SCISSOR_TEST
:
4591 params
[0] = BOOLEAN_TO_INT(ctx
->Scissor
.Enabled
);
4593 case GL_SELECTION_BUFFER_SIZE
:
4594 params
[0] = ctx
->Select
.BufferSize
;
4596 case GL_SHADE_MODEL
:
4597 params
[0] = ENUM_TO_INT(ctx
->Light
.ShadeModel
);
4599 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4600 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.SharedPalette
);
4602 case GL_STENCIL_BITS
:
4603 params
[0] = ctx
->DrawBuffer
->Visual
.stencilBits
;
4605 case GL_STENCIL_CLEAR_VALUE
:
4606 params
[0] = ctx
->Stencil
.Clear
;
4608 case GL_STENCIL_FAIL
:
4609 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
4611 case GL_STENCIL_FUNC
:
4612 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
4614 case GL_STENCIL_PASS_DEPTH_FAIL
:
4615 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
4617 case GL_STENCIL_PASS_DEPTH_PASS
:
4618 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
4620 case GL_STENCIL_REF
:
4621 params
[0] = ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
4623 case GL_STENCIL_TEST
:
4624 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.Enabled
);
4626 case GL_STENCIL_VALUE_MASK
:
4627 params
[0] = ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
4629 case GL_STENCIL_WRITEMASK
:
4630 params
[0] = ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
4633 params
[0] = BOOLEAN_TO_INT(ctx
->DrawBuffer
->Visual
.stereoMode
);
4635 case GL_SUBPIXEL_BITS
:
4636 params
[0] = ctx
->Const
.SubPixelBits
;
4639 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D
));
4642 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D
));
4645 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D
));
4647 case GL_TEXTURE_1D_ARRAY_EXT
:
4648 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4649 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
));
4651 case GL_TEXTURE_2D_ARRAY_EXT
:
4652 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4653 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
));
4655 case GL_TEXTURE_BINDING_1D
:
4656 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_INDEX
]->Name
;
4658 case GL_TEXTURE_BINDING_2D
:
4659 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_INDEX
]->Name
;
4661 case GL_TEXTURE_BINDING_3D
:
4662 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_3D_INDEX
]->Name
;
4664 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
4665 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4666 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_ARRAY_INDEX
]->Name
;
4668 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
4669 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4670 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_ARRAY_INDEX
]->Name
;
4672 case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT
:
4673 CHECK_EXT1(MESA_texture_array
, "GetIntegerv");
4674 params
[0] = ctx
->Const
.MaxArrayTextureLayers
;
4676 case GL_TEXTURE_GEN_S
:
4677 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
4679 case GL_TEXTURE_GEN_T
:
4680 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
4682 case GL_TEXTURE_GEN_R
:
4683 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
4685 case GL_TEXTURE_GEN_Q
:
4686 params
[0] = BOOLEAN_TO_INT(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
4688 case GL_TEXTURE_MATRIX
:
4690 const GLfloat
*matrix
;
4691 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
4692 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
4693 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGet(texture matrix %u)",
4697 matrix
= ctx
->TextureMatrixStack
[unit
].Top
->m
;
4698 params
[0] = IROUND(matrix
[0]);
4699 params
[1] = IROUND(matrix
[1]);
4700 params
[2] = IROUND(matrix
[2]);
4701 params
[3] = IROUND(matrix
[3]);
4702 params
[4] = IROUND(matrix
[4]);
4703 params
[5] = IROUND(matrix
[5]);
4704 params
[6] = IROUND(matrix
[6]);
4705 params
[7] = IROUND(matrix
[7]);
4706 params
[8] = IROUND(matrix
[8]);
4707 params
[9] = IROUND(matrix
[9]);
4708 params
[10] = IROUND(matrix
[10]);
4709 params
[11] = IROUND(matrix
[11]);
4710 params
[12] = IROUND(matrix
[12]);
4711 params
[13] = IROUND(matrix
[13]);
4712 params
[14] = IROUND(matrix
[14]);
4713 params
[15] = IROUND(matrix
[15]);
4716 case GL_TEXTURE_STACK_DEPTH
:
4718 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
4719 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
4720 _mesa_error(ctx
, GL_INVALID_OPERATION
,
4721 "glGet(texture stack depth, unit %u)", unit
);
4724 params
[0] = ctx
->TextureMatrixStack
[unit
].Depth
+ 1;
4727 case GL_UNPACK_ALIGNMENT
:
4728 params
[0] = ctx
->Unpack
.Alignment
;
4730 case GL_UNPACK_LSB_FIRST
:
4731 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.LsbFirst
);
4733 case GL_UNPACK_ROW_LENGTH
:
4734 params
[0] = ctx
->Unpack
.RowLength
;
4736 case GL_UNPACK_SKIP_PIXELS
:
4737 params
[0] = ctx
->Unpack
.SkipPixels
;
4739 case GL_UNPACK_SKIP_ROWS
:
4740 params
[0] = ctx
->Unpack
.SkipRows
;
4742 case GL_UNPACK_SWAP_BYTES
:
4743 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.SwapBytes
);
4745 case GL_UNPACK_SKIP_IMAGES_EXT
:
4746 params
[0] = ctx
->Unpack
.SkipImages
;
4748 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4749 params
[0] = ctx
->Unpack
.ImageHeight
;
4751 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
4752 params
[0] = BOOLEAN_TO_INT(ctx
->Unpack
.ClientStorage
);
4755 params
[0] = ctx
->Viewport
.X
;
4756 params
[1] = ctx
->Viewport
.Y
;
4757 params
[2] = ctx
->Viewport
.Width
;
4758 params
[3] = ctx
->Viewport
.Height
;
4761 params
[0] = IROUND(ctx
->Pixel
.ZoomX
);
4764 params
[0] = IROUND(ctx
->Pixel
.ZoomY
);
4766 case GL_VERTEX_ARRAY
:
4767 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
4769 case GL_VERTEX_ARRAY_SIZE
:
4770 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Size
;
4772 case GL_VERTEX_ARRAY_TYPE
:
4773 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Vertex
.Type
);
4775 case GL_VERTEX_ARRAY_STRIDE
:
4776 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.Stride
;
4778 case GL_VERTEX_ARRAY_COUNT_EXT
:
4781 case GL_NORMAL_ARRAY
:
4782 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
4784 case GL_NORMAL_ARRAY_TYPE
:
4785 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Normal
.Type
);
4787 case GL_NORMAL_ARRAY_STRIDE
:
4788 params
[0] = ctx
->Array
.ArrayObj
->Normal
.Stride
;
4790 case GL_NORMAL_ARRAY_COUNT_EXT
:
4793 case GL_COLOR_ARRAY
:
4794 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Color
.Enabled
);
4796 case GL_COLOR_ARRAY_SIZE
:
4797 params
[0] = ctx
->Array
.ArrayObj
->Color
.Size
;
4799 case GL_COLOR_ARRAY_TYPE
:
4800 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Color
.Type
);
4802 case GL_COLOR_ARRAY_STRIDE
:
4803 params
[0] = ctx
->Array
.ArrayObj
->Color
.Stride
;
4805 case GL_COLOR_ARRAY_COUNT_EXT
:
4808 case GL_INDEX_ARRAY
:
4809 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->Index
.Enabled
);
4811 case GL_INDEX_ARRAY_TYPE
:
4812 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->Index
.Type
);
4814 case GL_INDEX_ARRAY_STRIDE
:
4815 params
[0] = ctx
->Array
.ArrayObj
->Index
.Stride
;
4817 case GL_INDEX_ARRAY_COUNT_EXT
:
4820 case GL_TEXTURE_COORD_ARRAY
:
4821 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
4823 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4824 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
;
4826 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4827 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
4829 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4830 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
;
4832 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4835 case GL_EDGE_FLAG_ARRAY
:
4836 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
4838 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4839 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
;
4841 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4844 case GL_MAX_TEXTURE_UNITS_ARB
:
4845 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4846 params
[0] = ctx
->Const
.MaxTextureUnits
;
4848 case GL_ACTIVE_TEXTURE_ARB
:
4849 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4850 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4852 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4853 CHECK_EXT1(ARB_multitexture
, "GetIntegerv");
4854 params
[0] = GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4856 case GL_TEXTURE_CUBE_MAP_ARB
:
4857 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4858 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
4860 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4861 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4862 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_CUBE_INDEX
]->Name
;
4864 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4865 CHECK_EXT1(ARB_texture_cube_map
, "GetIntegerv");
4866 params
[0] = (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
4868 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4869 params
[0] = ctx
->Hint
.TextureCompression
;
4871 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4872 params
[0] = _mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
);
4874 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4877 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
4879 for (i
= 0; i
< n
; i
++)
4880 params
[i
] = ENUM_TO_INT(formats
[i
]);
4883 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4884 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4885 params
[0] = ctx
->Array
.LockFirst
;
4887 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4888 CHECK_EXT1(EXT_compiled_vertex_array
, "GetIntegerv");
4889 params
[0] = ctx
->Array
.LockCount
;
4891 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4893 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4894 params
[0] = IROUND(matrix
[0]);
4895 params
[1] = IROUND(matrix
[4]);
4896 params
[2] = IROUND(matrix
[8]);
4897 params
[3] = IROUND(matrix
[12]);
4898 params
[4] = IROUND(matrix
[1]);
4899 params
[5] = IROUND(matrix
[5]);
4900 params
[6] = IROUND(matrix
[9]);
4901 params
[7] = IROUND(matrix
[13]);
4902 params
[8] = IROUND(matrix
[2]);
4903 params
[9] = IROUND(matrix
[6]);
4904 params
[10] = IROUND(matrix
[10]);
4905 params
[11] = IROUND(matrix
[14]);
4906 params
[12] = IROUND(matrix
[3]);
4907 params
[13] = IROUND(matrix
[7]);
4908 params
[14] = IROUND(matrix
[11]);
4909 params
[15] = IROUND(matrix
[15]);
4912 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4914 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
4915 params
[0] = IROUND(matrix
[0]);
4916 params
[1] = IROUND(matrix
[4]);
4917 params
[2] = IROUND(matrix
[8]);
4918 params
[3] = IROUND(matrix
[12]);
4919 params
[4] = IROUND(matrix
[1]);
4920 params
[5] = IROUND(matrix
[5]);
4921 params
[6] = IROUND(matrix
[9]);
4922 params
[7] = IROUND(matrix
[13]);
4923 params
[8] = IROUND(matrix
[2]);
4924 params
[9] = IROUND(matrix
[6]);
4925 params
[10] = IROUND(matrix
[10]);
4926 params
[11] = IROUND(matrix
[14]);
4927 params
[12] = IROUND(matrix
[3]);
4928 params
[13] = IROUND(matrix
[7]);
4929 params
[14] = IROUND(matrix
[11]);
4930 params
[15] = IROUND(matrix
[15]);
4933 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4935 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
4936 params
[0] = IROUND(matrix
[0]);
4937 params
[1] = IROUND(matrix
[4]);
4938 params
[2] = IROUND(matrix
[8]);
4939 params
[3] = IROUND(matrix
[12]);
4940 params
[4] = IROUND(matrix
[1]);
4941 params
[5] = IROUND(matrix
[5]);
4942 params
[6] = IROUND(matrix
[9]);
4943 params
[7] = IROUND(matrix
[13]);
4944 params
[8] = IROUND(matrix
[2]);
4945 params
[9] = IROUND(matrix
[6]);
4946 params
[10] = IROUND(matrix
[10]);
4947 params
[11] = IROUND(matrix
[14]);
4948 params
[12] = IROUND(matrix
[3]);
4949 params
[13] = IROUND(matrix
[7]);
4950 params
[14] = IROUND(matrix
[11]);
4951 params
[15] = IROUND(matrix
[15]);
4954 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4956 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
4957 params
[0] = IROUND(matrix
[0]);
4958 params
[1] = IROUND(matrix
[4]);
4959 params
[2] = IROUND(matrix
[8]);
4960 params
[3] = IROUND(matrix
[12]);
4961 params
[4] = IROUND(matrix
[1]);
4962 params
[5] = IROUND(matrix
[5]);
4963 params
[6] = IROUND(matrix
[9]);
4964 params
[7] = IROUND(matrix
[13]);
4965 params
[8] = IROUND(matrix
[2]);
4966 params
[9] = IROUND(matrix
[6]);
4967 params
[10] = IROUND(matrix
[10]);
4968 params
[11] = IROUND(matrix
[14]);
4969 params
[12] = IROUND(matrix
[3]);
4970 params
[13] = IROUND(matrix
[7]);
4971 params
[14] = IROUND(matrix
[11]);
4972 params
[15] = IROUND(matrix
[15]);
4975 case GL_COLOR_MATRIX_SGI
:
4977 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
4978 params
[0] = IROUND(matrix
[0]);
4979 params
[1] = IROUND(matrix
[1]);
4980 params
[2] = IROUND(matrix
[2]);
4981 params
[3] = IROUND(matrix
[3]);
4982 params
[4] = IROUND(matrix
[4]);
4983 params
[5] = IROUND(matrix
[5]);
4984 params
[6] = IROUND(matrix
[6]);
4985 params
[7] = IROUND(matrix
[7]);
4986 params
[8] = IROUND(matrix
[8]);
4987 params
[9] = IROUND(matrix
[9]);
4988 params
[10] = IROUND(matrix
[10]);
4989 params
[11] = IROUND(matrix
[11]);
4990 params
[12] = IROUND(matrix
[12]);
4991 params
[13] = IROUND(matrix
[13]);
4992 params
[14] = IROUND(matrix
[14]);
4993 params
[15] = IROUND(matrix
[15]);
4996 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4997 params
[0] = ctx
->ColorMatrixStack
.Depth
+ 1;
4999 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
5000 params
[0] = MAX_COLOR_STACK_DEPTH
;
5002 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
5003 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[0]);
5005 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
5006 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[1]);
5008 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
5009 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[2]);
5011 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
5012 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixScale
[3]);
5014 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
5015 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[0]);
5017 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
5018 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[1]);
5020 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
5021 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[2]);
5023 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
5024 params
[0] = IROUND(ctx
->Pixel
.PostColorMatrixBias
[3]);
5026 case GL_CONVOLUTION_1D_EXT
:
5027 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5028 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution1DEnabled
);
5030 case GL_CONVOLUTION_2D_EXT
:
5031 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5032 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Convolution2DEnabled
);
5034 case GL_SEPARABLE_2D_EXT
:
5035 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5036 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.Separable2DEnabled
);
5038 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
5039 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5040 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[0]);
5042 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
5043 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5044 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[1]);
5046 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
5047 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5048 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[2]);
5050 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
5051 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5052 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionScale
[3]);
5054 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
5055 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5056 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[0]);
5058 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
5059 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5060 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[1]);
5062 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
5063 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5064 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[2]);
5066 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
5067 CHECK_EXT1(EXT_convolution
, "GetIntegerv");
5068 params
[0] = IROUND(ctx
->Pixel
.PostConvolutionBias
[3]);
5071 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
5072 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.HistogramEnabled
);
5075 CHECK_EXT1(EXT_histogram
, "GetIntegerv");
5076 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.MinMaxEnabled
);
5078 case GL_COLOR_TABLE_SGI
:
5079 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5080 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
]);
5082 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
5083 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5084 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
]);
5086 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
5087 CHECK_EXT1(SGI_color_table
, "GetIntegerv");
5088 params
[0] = BOOLEAN_TO_INT(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
]);
5090 case GL_TEXTURE_COLOR_TABLE_SGI
:
5091 CHECK_EXT1(SGI_texture_color_table
, "GetIntegerv");
5092 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
5094 case GL_COLOR_SUM_EXT
:
5095 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetIntegerv");
5096 params
[0] = BOOLEAN_TO_INT(ctx
->Fog
.ColorSumEnabled
);
5098 case GL_CURRENT_SECONDARY_COLOR_EXT
:
5099 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5101 FLUSH_CURRENT(ctx
, 0);
5102 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
5103 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
5104 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
5105 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
5108 case GL_SECONDARY_COLOR_ARRAY_EXT
:
5109 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5110 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
5112 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
5113 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5114 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
5116 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
5117 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5118 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
;
5120 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
5121 CHECK_EXT1(EXT_secondary_color
, "GetIntegerv");
5122 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.Size
;
5124 case GL_CURRENT_FOG_COORDINATE_EXT
:
5125 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5127 FLUSH_CURRENT(ctx
, 0);
5128 params
[0] = IROUND(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
5131 case GL_FOG_COORDINATE_ARRAY_EXT
:
5132 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5133 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
5135 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
5136 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5137 params
[0] = ENUM_TO_INT(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
5139 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
5140 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5141 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.Stride
;
5143 case GL_FOG_COORDINATE_SOURCE_EXT
:
5144 CHECK_EXT1(EXT_fog_coord
, "GetIntegerv");
5145 params
[0] = ENUM_TO_INT(ctx
->Fog
.FogCoordinateSource
);
5147 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
5148 CHECK_EXT1(EXT_texture_lod_bias
, "GetIntegerv");
5149 params
[0] = IROUND(ctx
->Const
.MaxTextureLodBias
);
5151 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
5152 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetIntegerv");
5153 params
[0] = IROUND(ctx
->Const
.MaxTextureMaxAnisotropy
);
5155 case GL_MULTISAMPLE_ARB
:
5156 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.Enabled
);
5158 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
5159 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToCoverage
);
5161 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
5162 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleAlphaToOne
);
5164 case GL_SAMPLE_COVERAGE_ARB
:
5165 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverage
);
5167 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
5168 params
[0] = IROUND(ctx
->Multisample
.SampleCoverageValue
);
5170 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
5171 params
[0] = BOOLEAN_TO_INT(ctx
->Multisample
.SampleCoverageInvert
);
5173 case GL_SAMPLE_BUFFERS_ARB
:
5174 params
[0] = ctx
->DrawBuffer
->Visual
.sampleBuffers
;
5176 case GL_SAMPLES_ARB
:
5177 params
[0] = ctx
->DrawBuffer
->Visual
.samples
;
5179 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
5180 CHECK_EXT1(IBM_rasterpos_clip
, "GetIntegerv");
5181 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.RasterPositionUnclipped
);
5183 case GL_POINT_SPRITE_NV
:
5184 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5185 params
[0] = BOOLEAN_TO_INT(ctx
->Point
.PointSprite
);
5187 case GL_POINT_SPRITE_R_MODE_NV
:
5188 CHECK_EXT1(NV_point_sprite
, "GetIntegerv");
5189 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteRMode
);
5191 case GL_POINT_SPRITE_COORD_ORIGIN
:
5192 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetIntegerv");
5193 params
[0] = ENUM_TO_INT(ctx
->Point
.SpriteOrigin
);
5195 case GL_GENERATE_MIPMAP_HINT_SGIS
:
5196 CHECK_EXT1(SGIS_generate_mipmap
, "GetIntegerv");
5197 params
[0] = ENUM_TO_INT(ctx
->Hint
.GenerateMipmap
);
5199 case GL_VERTEX_PROGRAM_BINDING_NV
:
5200 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5201 params
[0] = (ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0);
5203 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
5204 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5205 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
5207 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
5208 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5209 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
5211 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
5212 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5213 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
5215 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
5216 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5217 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
5219 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
5220 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5221 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
5223 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
5224 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5225 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
5227 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
5228 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5229 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
5231 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
5232 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5233 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
5235 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
5236 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5237 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
5239 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
5240 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5241 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
5243 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
5244 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5245 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
5247 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
5248 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5249 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
5251 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
5252 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5253 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
5255 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
5256 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5257 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
5259 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
5260 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5261 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
5263 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
5264 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5265 params
[0] = BOOLEAN_TO_INT(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
5267 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
5268 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5269 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[0]);
5271 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
5272 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5273 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[1]);
5275 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
5276 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5277 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[2]);
5279 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
5280 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5281 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[3]);
5283 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
5284 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5285 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[4]);
5287 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
5288 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5289 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[5]);
5291 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
5292 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5293 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[6]);
5295 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
5296 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5297 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[7]);
5299 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
5300 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5301 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[8]);
5303 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
5304 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5305 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[9]);
5307 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
5308 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5309 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[10]);
5311 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
5312 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5313 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[11]);
5315 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
5316 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5317 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[12]);
5319 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
5320 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5321 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[13]);
5323 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
5324 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5325 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[14]);
5327 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
5328 CHECK_EXT1(NV_vertex_program
, "GetIntegerv");
5329 params
[0] = BOOLEAN_TO_INT(ctx
->Eval
.Map1Attrib
[15]);
5331 case GL_FRAGMENT_PROGRAM_NV
:
5332 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5333 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5335 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
5336 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5337 params
[0] = ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0;
5339 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
5340 CHECK_EXT1(NV_fragment_program
, "GetIntegerv");
5341 params
[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
5343 case GL_TEXTURE_RECTANGLE_NV
:
5344 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5345 params
[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
5347 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
5348 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5349 params
[0] = ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_RECT_INDEX
]->Name
;
5351 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
5352 CHECK_EXT1(NV_texture_rectangle
, "GetIntegerv");
5353 params
[0] = ctx
->Const
.MaxTextureRectSize
;
5355 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
5356 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5357 params
[0] = BOOLEAN_TO_INT(ctx
->Stencil
.TestTwoSide
);
5359 case GL_ACTIVE_STENCIL_FACE_EXT
:
5360 CHECK_EXT1(EXT_stencil_two_side
, "GetIntegerv");
5361 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
5363 case GL_MAX_SHININESS_NV
:
5364 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5365 params
[0] = IROUND(ctx
->Const
.MaxShininess
);
5367 case GL_MAX_SPOT_EXPONENT_NV
:
5368 CHECK_EXT1(NV_light_max_exponent
, "GetIntegerv");
5369 params
[0] = IROUND(ctx
->Const
.MaxSpotExponent
);
5371 case GL_ARRAY_BUFFER_BINDING_ARB
:
5372 params
[0] = ctx
->Array
.ArrayBufferObj
->Name
;
5374 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
5375 params
[0] = ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
;
5377 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
5378 params
[0] = ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
;
5380 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5381 params
[0] = ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
;
5383 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
5384 params
[0] = ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
;
5386 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
5387 params
[0] = ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
;
5389 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
5390 params
[0] = ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
;
5392 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
5393 params
[0] = ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
;
5395 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
5396 params
[0] = ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
;
5398 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
5399 params
[0] = ctx
->Array
.ElementArrayBufferObj
->Name
;
5401 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
5402 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5403 params
[0] = ctx
->Pack
.BufferObj
->Name
;
5405 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
5406 CHECK_EXT1(EXT_pixel_buffer_object
, "GetIntegerv");
5407 params
[0] = ctx
->Unpack
.BufferObj
->Name
;
5409 case GL_VERTEX_PROGRAM_ARB
:
5410 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5411 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.Enabled
);
5413 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
5414 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5415 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.PointSizeEnabled
);
5417 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
5418 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetIntegerv");
5419 params
[0] = BOOLEAN_TO_INT(ctx
->VertexProgram
.TwoSideEnabled
);
5421 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
5422 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5423 params
[0] = ctx
->Const
.MaxProgramMatrixStackDepth
;
5425 case GL_MAX_PROGRAM_MATRICES_ARB
:
5426 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5427 params
[0] = ctx
->Const
.MaxProgramMatrices
;
5429 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
5430 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetIntegerv");
5431 params
[0] = BOOLEAN_TO_INT(ctx
->CurrentStack
->Depth
+ 1);
5433 case GL_CURRENT_MATRIX_ARB
:
5434 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5436 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5437 params
[0] = IROUND(matrix
[0]);
5438 params
[1] = IROUND(matrix
[1]);
5439 params
[2] = IROUND(matrix
[2]);
5440 params
[3] = IROUND(matrix
[3]);
5441 params
[4] = IROUND(matrix
[4]);
5442 params
[5] = IROUND(matrix
[5]);
5443 params
[6] = IROUND(matrix
[6]);
5444 params
[7] = IROUND(matrix
[7]);
5445 params
[8] = IROUND(matrix
[8]);
5446 params
[9] = IROUND(matrix
[9]);
5447 params
[10] = IROUND(matrix
[10]);
5448 params
[11] = IROUND(matrix
[11]);
5449 params
[12] = IROUND(matrix
[12]);
5450 params
[13] = IROUND(matrix
[13]);
5451 params
[14] = IROUND(matrix
[14]);
5452 params
[15] = IROUND(matrix
[15]);
5455 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
5456 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetIntegerv");
5458 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
5459 params
[0] = IROUND(matrix
[0]);
5460 params
[1] = IROUND(matrix
[4]);
5461 params
[2] = IROUND(matrix
[8]);
5462 params
[3] = IROUND(matrix
[12]);
5463 params
[4] = IROUND(matrix
[1]);
5464 params
[5] = IROUND(matrix
[5]);
5465 params
[6] = IROUND(matrix
[9]);
5466 params
[7] = IROUND(matrix
[13]);
5467 params
[8] = IROUND(matrix
[2]);
5468 params
[9] = IROUND(matrix
[6]);
5469 params
[10] = IROUND(matrix
[10]);
5470 params
[11] = IROUND(matrix
[14]);
5471 params
[12] = IROUND(matrix
[3]);
5472 params
[13] = IROUND(matrix
[7]);
5473 params
[14] = IROUND(matrix
[11]);
5474 params
[15] = IROUND(matrix
[15]);
5477 case GL_MAX_VERTEX_ATTRIBS_ARB
:
5478 CHECK_EXT1(ARB_vertex_program
, "GetIntegerv");
5479 params
[0] = ctx
->Const
.VertexProgram
.MaxAttribs
;
5481 case GL_PROGRAM_ERROR_POSITION_ARB
:
5482 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetIntegerv");
5483 params
[0] = ctx
->Program
.ErrorPos
;
5485 case GL_FRAGMENT_PROGRAM_ARB
:
5486 CHECK_EXT1(ARB_fragment_program
, "GetIntegerv");
5487 params
[0] = BOOLEAN_TO_INT(ctx
->FragmentProgram
.Enabled
);
5489 case GL_MAX_TEXTURE_COORDS_ARB
:
5490 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5491 params
[0] = ctx
->Const
.MaxTextureCoordUnits
;
5493 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
5494 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetIntegerv");
5495 params
[0] = ctx
->Const
.MaxTextureImageUnits
;
5497 case GL_DEPTH_BOUNDS_TEST_EXT
:
5498 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5499 params
[0] = BOOLEAN_TO_INT(ctx
->Depth
.BoundsTest
);
5501 case GL_DEPTH_BOUNDS_EXT
:
5502 CHECK_EXT1(EXT_depth_bounds_test
, "GetIntegerv");
5503 params
[0] = IROUND(ctx
->Depth
.BoundsMin
);
5504 params
[1] = IROUND(ctx
->Depth
.BoundsMax
);
5506 case GL_DEPTH_CLAMP
:
5507 CHECK_EXT1(ARB_depth_clamp
, "GetIntegerv");
5508 params
[0] = BOOLEAN_TO_INT(ctx
->Transform
.DepthClamp
);
5510 case GL_MAX_DRAW_BUFFERS_ARB
:
5511 params
[0] = ctx
->Const
.MaxDrawBuffers
;
5513 case GL_DRAW_BUFFER0_ARB
:
5514 params
[0] = ENUM_TO_INT(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
5516 case GL_DRAW_BUFFER1_ARB
:
5519 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5520 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5523 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
5524 params
[0] = ENUM_TO_INT(buffer
);
5527 case GL_DRAW_BUFFER2_ARB
:
5530 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5531 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5534 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
5535 params
[0] = ENUM_TO_INT(buffer
);
5538 case GL_DRAW_BUFFER3_ARB
:
5541 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
5542 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
5545 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
5546 params
[0] = ENUM_TO_INT(buffer
);
5549 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
5550 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5551 params
[0] = _mesa_get_color_read_type(ctx
);
5553 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
5554 CHECK_EXT1(OES_read_format
, "GetIntegerv");
5555 params
[0] = _mesa_get_color_read_format(ctx
);
5557 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
5558 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5561 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
5562 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5565 case GL_NUM_PASSES_ATI
:
5566 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5569 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
5570 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5573 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
5574 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5577 case GL_COLOR_ALPHA_PAIRING_ATI
:
5578 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5579 params
[0] = BOOLEAN_TO_INT(GL_TRUE
);
5581 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
5582 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5585 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
5586 CHECK_EXT1(ATI_fragment_shader
, "GetIntegerv");
5589 case GL_STENCIL_BACK_FUNC
:
5590 params
[0] = ENUM_TO_INT(ctx
->Stencil
.Function
[1]);
5592 case GL_STENCIL_BACK_VALUE_MASK
:
5593 params
[0] = ctx
->Stencil
.ValueMask
[1];
5595 case GL_STENCIL_BACK_WRITEMASK
:
5596 params
[0] = ctx
->Stencil
.WriteMask
[1];
5598 case GL_STENCIL_BACK_REF
:
5599 params
[0] = ctx
->Stencil
.Ref
[1];
5601 case GL_STENCIL_BACK_FAIL
:
5602 params
[0] = ENUM_TO_INT(ctx
->Stencil
.FailFunc
[1]);
5604 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
5605 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZFailFunc
[1]);
5607 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
5608 params
[0] = ENUM_TO_INT(ctx
->Stencil
.ZPassFunc
[1]);
5610 case GL_FRAMEBUFFER_BINDING_EXT
:
5611 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5612 params
[0] = ctx
->DrawBuffer
->Name
;
5614 case GL_RENDERBUFFER_BINDING_EXT
:
5615 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5616 params
[0] = ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0;
5618 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
5619 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5620 params
[0] = ctx
->Const
.MaxColorAttachments
;
5622 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
5623 CHECK_EXT1(EXT_framebuffer_object
, "GetIntegerv");
5624 params
[0] = ctx
->Const
.MaxRenderbufferSize
;
5626 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
5627 CHECK_EXT1(EXT_framebuffer_blit
, "GetIntegerv");
5628 params
[0] = ctx
->ReadBuffer
->Name
;
5630 case GL_PROVOKING_VERTEX_EXT
:
5631 CHECK_EXT1(EXT_provoking_vertex
, "GetIntegerv");
5632 params
[0] = BOOLEAN_TO_INT(ctx
->Light
.ProvokingVertex
);
5634 case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT
:
5635 CHECK_EXT1(EXT_provoking_vertex
, "GetIntegerv");
5636 params
[0] = BOOLEAN_TO_INT(ctx
->Const
.QuadsFollowProvokingVertexConvention
);
5638 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
5639 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5640 params
[0] = ctx
->Const
.FragmentProgram
.MaxUniformComponents
;
5642 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
5643 CHECK_EXT1(ARB_fragment_shader
, "GetIntegerv");
5644 params
[0] = ENUM_TO_INT(ctx
->Hint
.FragmentShaderDerivative
);
5646 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
5647 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5648 params
[0] = ctx
->Const
.VertexProgram
.MaxUniformComponents
;
5650 case GL_MAX_VARYING_FLOATS_ARB
:
5651 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5652 params
[0] = ctx
->Const
.MaxVarying
* 4;
5654 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
5655 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5656 params
[0] = ctx
->Const
.MaxVertexTextureImageUnits
;
5658 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
5659 CHECK_EXT1(ARB_vertex_shader
, "GetIntegerv");
5660 params
[0] = ctx
->Const
.MaxCombinedTextureImageUnits
;
5662 case GL_CURRENT_PROGRAM
:
5663 CHECK_EXT1(ARB_shader_objects
, "GetIntegerv");
5664 params
[0] = ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0;
5666 case GL_MAX_SAMPLES
:
5667 CHECK_EXT1(ARB_framebuffer_object
, "GetIntegerv");
5668 params
[0] = ctx
->Const
.MaxSamples
;
5670 case GL_VERTEX_ARRAY_BINDING_APPLE
:
5671 CHECK_EXT1(APPLE_vertex_array_object
, "GetIntegerv");
5672 params
[0] = ctx
->Array
.ArrayObj
->Name
;
5674 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
5675 CHECK_EXT1(ARB_seamless_cube_map
, "GetIntegerv");
5676 params
[0] = BOOLEAN_TO_INT(ctx
->Texture
.CubeMapSeamless
);
5678 case GL_MAX_SERVER_WAIT_TIMEOUT
:
5679 CHECK_EXT1(ARB_sync
, "GetIntegerv");
5680 params
[0] = INT64_TO_INT(ctx
->Const
.MaxServerWaitTimeout
);
5682 case GL_NUM_EXTENSIONS
:
5683 params
[0] = _mesa_get_extension_count(ctx
);
5685 case GL_MAJOR_VERSION
:
5686 params
[0] = ctx
->VersionMajor
;
5688 case GL_MINOR_VERSION
:
5689 params
[0] = ctx
->VersionMinor
;
5691 case GL_CONTEXT_FLAGS
:
5692 params
[0] = ctx
->Const
.ContextFlags
;
5695 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv(pname=0x%x)", pname
);
5699 #if FEATURE_ARB_sync
5701 _mesa_GetInteger64v( GLenum pname
, GLint64
*params
)
5703 GET_CURRENT_CONTEXT(ctx
);
5704 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5710 _mesa_update_state(ctx
);
5712 if (ctx
->Driver
.GetInteger64v
&&
5713 ctx
->Driver
.GetInteger64v(ctx
, pname
, params
))
5717 case GL_ACCUM_RED_BITS
:
5718 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.accumRedBits
);
5720 case GL_ACCUM_GREEN_BITS
:
5721 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.accumGreenBits
);
5723 case GL_ACCUM_BLUE_BITS
:
5724 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.accumBlueBits
);
5726 case GL_ACCUM_ALPHA_BITS
:
5727 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.accumAlphaBits
);
5729 case GL_ACCUM_CLEAR_VALUE
:
5730 params
[0] = FLOAT_TO_INT64(ctx
->Accum
.ClearColor
[0]);
5731 params
[1] = FLOAT_TO_INT64(ctx
->Accum
.ClearColor
[1]);
5732 params
[2] = FLOAT_TO_INT64(ctx
->Accum
.ClearColor
[2]);
5733 params
[3] = FLOAT_TO_INT64(ctx
->Accum
.ClearColor
[3]);
5736 params
[0] = IROUND64(ctx
->Pixel
.AlphaBias
);
5739 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.alphaBits
);
5741 case GL_ALPHA_SCALE
:
5742 params
[0] = IROUND64(ctx
->Pixel
.AlphaScale
);
5745 params
[0] = BOOLEAN_TO_INT64(ctx
->Color
.AlphaEnabled
);
5747 case GL_ALPHA_TEST_FUNC
:
5748 params
[0] = ENUM_TO_INT64(ctx
->Color
.AlphaFunc
);
5750 case GL_ALPHA_TEST_REF
:
5751 params
[0] = FLOAT_TO_INT64(ctx
->Color
.AlphaRef
);
5753 case GL_ATTRIB_STACK_DEPTH
:
5754 params
[0] = (GLint64
)(ctx
->AttribStackDepth
);
5756 case GL_AUTO_NORMAL
:
5757 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.AutoNormal
);
5759 case GL_AUX_BUFFERS
:
5760 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.numAuxBuffers
);
5763 params
[0] = BOOLEAN_TO_INT64((ctx
->Color
.BlendEnabled
& 1));
5766 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendDstRGB
);
5769 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendSrcRGB
);
5771 case GL_BLEND_SRC_RGB_EXT
:
5772 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendSrcRGB
);
5774 case GL_BLEND_DST_RGB_EXT
:
5775 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendDstRGB
);
5777 case GL_BLEND_SRC_ALPHA_EXT
:
5778 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendSrcA
);
5780 case GL_BLEND_DST_ALPHA_EXT
:
5781 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendDstA
);
5783 case GL_BLEND_EQUATION
:
5784 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendEquationRGB
);
5786 case GL_BLEND_EQUATION_ALPHA_EXT
:
5787 params
[0] = ENUM_TO_INT64(ctx
->Color
.BlendEquationA
);
5789 case GL_BLEND_COLOR_EXT
:
5790 params
[0] = FLOAT_TO_INT64(ctx
->Color
.BlendColor
[0]);
5791 params
[1] = FLOAT_TO_INT64(ctx
->Color
.BlendColor
[1]);
5792 params
[2] = FLOAT_TO_INT64(ctx
->Color
.BlendColor
[2]);
5793 params
[3] = FLOAT_TO_INT64(ctx
->Color
.BlendColor
[3]);
5796 params
[0] = IROUND64(ctx
->Pixel
.BlueBias
);
5799 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.blueBits
);
5802 params
[0] = IROUND64(ctx
->Pixel
.BlueScale
);
5804 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
5805 params
[0] = (GLint64
)(ctx
->ClientAttribStackDepth
);
5807 case GL_CLIP_PLANE0
:
5808 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 0) & 1);
5810 case GL_CLIP_PLANE1
:
5811 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 1) & 1);
5813 case GL_CLIP_PLANE2
:
5814 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 2) & 1);
5816 case GL_CLIP_PLANE3
:
5817 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 3) & 1);
5819 case GL_CLIP_PLANE4
:
5820 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 4) & 1);
5822 case GL_CLIP_PLANE5
:
5823 params
[0] = BOOLEAN_TO_INT64((ctx
->Transform
.ClipPlanesEnabled
>> 5) & 1);
5825 case GL_COLOR_CLEAR_VALUE
:
5826 params
[0] = FLOAT_TO_INT64(ctx
->Color
.ClearColor
[0]);
5827 params
[1] = FLOAT_TO_INT64(ctx
->Color
.ClearColor
[1]);
5828 params
[2] = FLOAT_TO_INT64(ctx
->Color
.ClearColor
[2]);
5829 params
[3] = FLOAT_TO_INT64(ctx
->Color
.ClearColor
[3]);
5831 case GL_COLOR_MATERIAL
:
5832 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.ColorMaterialEnabled
);
5834 case GL_COLOR_MATERIAL_FACE
:
5835 params
[0] = ENUM_TO_INT64(ctx
->Light
.ColorMaterialFace
);
5837 case GL_COLOR_MATERIAL_PARAMETER
:
5838 params
[0] = ENUM_TO_INT64(ctx
->Light
.ColorMaterialMode
);
5840 case GL_COLOR_WRITEMASK
:
5841 params
[0] = (GLint64
)(ctx
->Color
.ColorMask
[0][RCOMP
] ? 1 : 0);
5842 params
[1] = (GLint64
)(ctx
->Color
.ColorMask
[0][GCOMP
] ? 1 : 0);
5843 params
[2] = (GLint64
)(ctx
->Color
.ColorMask
[0][BCOMP
] ? 1 : 0);
5844 params
[3] = (GLint64
)(ctx
->Color
.ColorMask
[0][ACOMP
] ? 1 : 0);
5847 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.CullFlag
);
5849 case GL_CULL_FACE_MODE
:
5850 params
[0] = ENUM_TO_INT64(ctx
->Polygon
.CullFaceMode
);
5852 case GL_CURRENT_COLOR
:
5854 FLUSH_CURRENT(ctx
, 0);
5855 params
[0] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
5856 params
[1] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
5857 params
[2] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
5858 params
[3] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
5861 case GL_CURRENT_INDEX
:
5863 FLUSH_CURRENT(ctx
, 0);
5864 params
[0] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR_INDEX
][0]);
5867 case GL_CURRENT_NORMAL
:
5869 FLUSH_CURRENT(ctx
, 0);
5870 params
[0] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
5871 params
[1] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
5872 params
[2] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
5875 case GL_CURRENT_RASTER_COLOR
:
5876 params
[0] = FLOAT_TO_INT64(ctx
->Current
.RasterColor
[0]);
5877 params
[1] = FLOAT_TO_INT64(ctx
->Current
.RasterColor
[1]);
5878 params
[2] = FLOAT_TO_INT64(ctx
->Current
.RasterColor
[2]);
5879 params
[3] = FLOAT_TO_INT64(ctx
->Current
.RasterColor
[3]);
5881 case GL_CURRENT_RASTER_DISTANCE
:
5882 params
[0] = IROUND64(ctx
->Current
.RasterDistance
);
5884 case GL_CURRENT_RASTER_INDEX
:
5885 params
[0] = IROUND64(1.0);
5887 case GL_CURRENT_RASTER_POSITION
:
5888 params
[0] = IROUND64(ctx
->Current
.RasterPos
[0]);
5889 params
[1] = IROUND64(ctx
->Current
.RasterPos
[1]);
5890 params
[2] = IROUND64(ctx
->Current
.RasterPos
[2]);
5891 params
[3] = IROUND64(ctx
->Current
.RasterPos
[3]);
5893 case GL_CURRENT_RASTER_SECONDARY_COLOR
:
5894 params
[0] = FLOAT_TO_INT64(ctx
->Current
.RasterSecondaryColor
[0]);
5895 params
[1] = FLOAT_TO_INT64(ctx
->Current
.RasterSecondaryColor
[1]);
5896 params
[2] = FLOAT_TO_INT64(ctx
->Current
.RasterSecondaryColor
[2]);
5897 params
[3] = FLOAT_TO_INT64(ctx
->Current
.RasterSecondaryColor
[3]);
5899 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
5901 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
5902 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
5903 _mesa_error(ctx
, GL_INVALID_OPERATION
,
5904 "glGet(raster tex coords, unit %u)", unit
);
5907 params
[0] = IROUND64(ctx
->Current
.RasterTexCoords
[unit
][0]);
5908 params
[1] = IROUND64(ctx
->Current
.RasterTexCoords
[unit
][1]);
5909 params
[2] = IROUND64(ctx
->Current
.RasterTexCoords
[unit
][2]);
5910 params
[3] = IROUND64(ctx
->Current
.RasterTexCoords
[unit
][3]);
5913 case GL_CURRENT_RASTER_POSITION_VALID
:
5914 params
[0] = BOOLEAN_TO_INT64(ctx
->Current
.RasterPosValid
);
5916 case GL_CURRENT_TEXTURE_COORDS
:
5918 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
5919 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
5920 _mesa_error(ctx
, GL_INVALID_OPERATION
,
5921 "glGet(current tex coords, unit %u)", unit
);
5924 FLUSH_CURRENT(ctx
, 0);
5925 params
[0] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][0]);
5926 params
[1] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][1]);
5927 params
[2] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][2]);
5928 params
[3] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
][3]);
5932 params
[0] = IROUND64(ctx
->Pixel
.DepthBias
);
5935 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.depthBits
);
5937 case GL_DEPTH_CLEAR_VALUE
:
5938 params
[0] = FLOAT_TO_INT64(((GLfloat
) ctx
->Depth
.Clear
));
5941 params
[0] = ENUM_TO_INT64(ctx
->Depth
.Func
);
5943 case GL_DEPTH_RANGE
:
5944 params
[0] = FLOAT_TO_INT64(ctx
->Viewport
.Near
);
5945 params
[1] = FLOAT_TO_INT64(ctx
->Viewport
.Far
);
5947 case GL_DEPTH_SCALE
:
5948 params
[0] = IROUND64(ctx
->Pixel
.DepthScale
);
5951 params
[0] = BOOLEAN_TO_INT64(ctx
->Depth
.Test
);
5953 case GL_DEPTH_WRITEMASK
:
5954 params
[0] = BOOLEAN_TO_INT64(ctx
->Depth
.Mask
);
5957 params
[0] = BOOLEAN_TO_INT64(ctx
->Color
.DitherFlag
);
5959 case GL_DOUBLEBUFFER
:
5960 params
[0] = BOOLEAN_TO_INT64(ctx
->DrawBuffer
->Visual
.doubleBufferMode
);
5962 case GL_DRAW_BUFFER
:
5963 params
[0] = ENUM_TO_INT64(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
5967 FLUSH_CURRENT(ctx
, 0);
5968 params
[0] = BOOLEAN_TO_INT64((ctx
->Current
.Attrib
[VERT_ATTRIB_EDGEFLAG
][0] == 1.0));
5971 case GL_FEEDBACK_BUFFER_SIZE
:
5972 params
[0] = (GLint64
)(ctx
->Feedback
.BufferSize
);
5974 case GL_FEEDBACK_BUFFER_TYPE
:
5975 params
[0] = ENUM_TO_INT64(ctx
->Feedback
.Type
);
5978 params
[0] = BOOLEAN_TO_INT64(ctx
->Fog
.Enabled
);
5981 params
[0] = FLOAT_TO_INT64(ctx
->Fog
.Color
[0]);
5982 params
[1] = FLOAT_TO_INT64(ctx
->Fog
.Color
[1]);
5983 params
[2] = FLOAT_TO_INT64(ctx
->Fog
.Color
[2]);
5984 params
[3] = FLOAT_TO_INT64(ctx
->Fog
.Color
[3]);
5986 case GL_FOG_DENSITY
:
5987 params
[0] = IROUND64(ctx
->Fog
.Density
);
5990 params
[0] = IROUND64(ctx
->Fog
.End
);
5993 params
[0] = ENUM_TO_INT64(ctx
->Hint
.Fog
);
5996 params
[0] = IROUND64(ctx
->Fog
.Index
);
5999 params
[0] = ENUM_TO_INT64(ctx
->Fog
.Mode
);
6002 params
[0] = IROUND64(ctx
->Fog
.Start
);
6005 params
[0] = ENUM_TO_INT64(ctx
->Polygon
.FrontFace
);
6008 params
[0] = IROUND64(ctx
->Pixel
.GreenBias
);
6011 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.greenBits
);
6013 case GL_GREEN_SCALE
:
6014 params
[0] = IROUND64(ctx
->Pixel
.GreenScale
);
6017 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.indexBits
);
6019 case GL_INDEX_CLEAR_VALUE
:
6020 params
[0] = (GLint64
)(ctx
->Color
.ClearIndex
);
6023 params
[0] = BOOLEAN_TO_INT64(GL_FALSE
);
6025 case GL_INDEX_OFFSET
:
6026 params
[0] = (GLint64
)(ctx
->Pixel
.IndexOffset
);
6028 case GL_INDEX_SHIFT
:
6029 params
[0] = (GLint64
)(ctx
->Pixel
.IndexShift
);
6031 case GL_INDEX_WRITEMASK
:
6032 params
[0] = (GLint64
)(ctx
->Color
.IndexMask
);
6035 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[0].Enabled
);
6038 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[1].Enabled
);
6041 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[2].Enabled
);
6044 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[3].Enabled
);
6047 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[4].Enabled
);
6050 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[5].Enabled
);
6053 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[6].Enabled
);
6056 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Light
[7].Enabled
);
6059 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Enabled
);
6061 case GL_LIGHT_MODEL_AMBIENT
:
6062 params
[0] = FLOAT_TO_INT64(ctx
->Light
.Model
.Ambient
[0]);
6063 params
[1] = FLOAT_TO_INT64(ctx
->Light
.Model
.Ambient
[1]);
6064 params
[2] = FLOAT_TO_INT64(ctx
->Light
.Model
.Ambient
[2]);
6065 params
[3] = FLOAT_TO_INT64(ctx
->Light
.Model
.Ambient
[3]);
6067 case GL_LIGHT_MODEL_COLOR_CONTROL
:
6068 params
[0] = ENUM_TO_INT64(ctx
->Light
.Model
.ColorControl
);
6070 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
6071 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Model
.LocalViewer
);
6073 case GL_LIGHT_MODEL_TWO_SIDE
:
6074 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.Model
.TwoSide
);
6076 case GL_LINE_SMOOTH
:
6077 params
[0] = BOOLEAN_TO_INT64(ctx
->Line
.SmoothFlag
);
6079 case GL_LINE_SMOOTH_HINT
:
6080 params
[0] = ENUM_TO_INT64(ctx
->Hint
.LineSmooth
);
6082 case GL_LINE_STIPPLE
:
6083 params
[0] = BOOLEAN_TO_INT64(ctx
->Line
.StippleFlag
);
6085 case GL_LINE_STIPPLE_PATTERN
:
6086 params
[0] = (GLint64
)(ctx
->Line
.StipplePattern
);
6088 case GL_LINE_STIPPLE_REPEAT
:
6089 params
[0] = (GLint64
)(ctx
->Line
.StippleFactor
);
6092 params
[0] = IROUND64(ctx
->Line
.Width
);
6094 case GL_LINE_WIDTH_GRANULARITY
:
6095 params
[0] = IROUND64(ctx
->Const
.LineWidthGranularity
);
6097 case GL_LINE_WIDTH_RANGE
:
6098 params
[0] = IROUND64(ctx
->Const
.MinLineWidthAA
);
6099 params
[1] = IROUND64(ctx
->Const
.MaxLineWidthAA
);
6101 case GL_ALIASED_LINE_WIDTH_RANGE
:
6102 params
[0] = IROUND64(ctx
->Const
.MinLineWidth
);
6103 params
[1] = IROUND64(ctx
->Const
.MaxLineWidth
);
6106 params
[0] = (GLint64
)(ctx
->List
.ListBase
);
6109 params
[0] = (GLint64
)((ctx
->ListState
.CurrentList
? ctx
->ListState
.CurrentList
->Name
: 0));
6114 if (!ctx
->CompileFlag
)
6116 else if (ctx
->ExecuteFlag
)
6117 mode
= GL_COMPILE_AND_EXECUTE
;
6120 params
[0] = ENUM_TO_INT64(mode
);
6123 case GL_INDEX_LOGIC_OP
:
6124 params
[0] = BOOLEAN_TO_INT64(ctx
->Color
.IndexLogicOpEnabled
);
6126 case GL_COLOR_LOGIC_OP
:
6127 params
[0] = BOOLEAN_TO_INT64(ctx
->Color
.ColorLogicOpEnabled
);
6129 case GL_LOGIC_OP_MODE
:
6130 params
[0] = ENUM_TO_INT64(ctx
->Color
.LogicOp
);
6132 case GL_MAP1_COLOR_4
:
6133 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Color4
);
6135 case GL_MAP1_GRID_DOMAIN
:
6136 params
[0] = IROUND64(ctx
->Eval
.MapGrid1u1
);
6137 params
[1] = IROUND64(ctx
->Eval
.MapGrid1u2
);
6139 case GL_MAP1_GRID_SEGMENTS
:
6140 params
[0] = (GLint64
)(ctx
->Eval
.MapGrid1un
);
6143 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Index
);
6145 case GL_MAP1_NORMAL
:
6146 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Normal
);
6148 case GL_MAP1_TEXTURE_COORD_1
:
6149 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1TextureCoord1
);
6151 case GL_MAP1_TEXTURE_COORD_2
:
6152 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1TextureCoord2
);
6154 case GL_MAP1_TEXTURE_COORD_3
:
6155 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1TextureCoord3
);
6157 case GL_MAP1_TEXTURE_COORD_4
:
6158 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1TextureCoord4
);
6160 case GL_MAP1_VERTEX_3
:
6161 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Vertex3
);
6163 case GL_MAP1_VERTEX_4
:
6164 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Vertex4
);
6166 case GL_MAP2_COLOR_4
:
6167 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2Color4
);
6169 case GL_MAP2_GRID_DOMAIN
:
6170 params
[0] = IROUND64(ctx
->Eval
.MapGrid2u1
);
6171 params
[1] = IROUND64(ctx
->Eval
.MapGrid2u2
);
6172 params
[2] = IROUND64(ctx
->Eval
.MapGrid2v1
);
6173 params
[3] = IROUND64(ctx
->Eval
.MapGrid2v2
);
6175 case GL_MAP2_GRID_SEGMENTS
:
6176 params
[0] = (GLint64
)(ctx
->Eval
.MapGrid2un
);
6177 params
[1] = (GLint64
)(ctx
->Eval
.MapGrid2vn
);
6180 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2Index
);
6182 case GL_MAP2_NORMAL
:
6183 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2Normal
);
6185 case GL_MAP2_TEXTURE_COORD_1
:
6186 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2TextureCoord1
);
6188 case GL_MAP2_TEXTURE_COORD_2
:
6189 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2TextureCoord2
);
6191 case GL_MAP2_TEXTURE_COORD_3
:
6192 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2TextureCoord3
);
6194 case GL_MAP2_TEXTURE_COORD_4
:
6195 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2TextureCoord4
);
6197 case GL_MAP2_VERTEX_3
:
6198 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2Vertex3
);
6200 case GL_MAP2_VERTEX_4
:
6201 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map2Vertex4
);
6204 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.MapColorFlag
);
6206 case GL_MAP_STENCIL
:
6207 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.MapStencilFlag
);
6209 case GL_MATRIX_MODE
:
6210 params
[0] = ENUM_TO_INT64(ctx
->Transform
.MatrixMode
);
6212 case GL_MAX_ATTRIB_STACK_DEPTH
:
6213 params
[0] = (GLint64
)(MAX_ATTRIB_STACK_DEPTH
);
6215 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
6216 params
[0] = (GLint64
)(MAX_CLIENT_ATTRIB_STACK_DEPTH
);
6218 case GL_MAX_CLIP_PLANES
:
6219 params
[0] = (GLint64
)(ctx
->Const
.MaxClipPlanes
);
6221 case GL_MAX_ELEMENTS_VERTICES
:
6222 params
[0] = (GLint64
)(ctx
->Const
.MaxArrayLockSize
);
6224 case GL_MAX_ELEMENTS_INDICES
:
6225 params
[0] = (GLint64
)(ctx
->Const
.MaxArrayLockSize
);
6227 case GL_MAX_EVAL_ORDER
:
6228 params
[0] = (GLint64
)(MAX_EVAL_ORDER
);
6231 params
[0] = (GLint64
)(ctx
->Const
.MaxLights
);
6233 case GL_MAX_LIST_NESTING
:
6234 params
[0] = (GLint64
)(MAX_LIST_NESTING
);
6236 case GL_MAX_MODELVIEW_STACK_DEPTH
:
6237 params
[0] = (GLint64
)(MAX_MODELVIEW_STACK_DEPTH
);
6239 case GL_MAX_NAME_STACK_DEPTH
:
6240 params
[0] = (GLint64
)(MAX_NAME_STACK_DEPTH
);
6242 case GL_MAX_PIXEL_MAP_TABLE
:
6243 params
[0] = (GLint64
)(MAX_PIXEL_MAP_TABLE
);
6245 case GL_MAX_PROJECTION_STACK_DEPTH
:
6246 params
[0] = (GLint64
)(MAX_PROJECTION_STACK_DEPTH
);
6248 case GL_MAX_TEXTURE_SIZE
:
6249 params
[0] = (GLint64
)(1 << (ctx
->Const
.MaxTextureLevels
- 1));
6251 case GL_MAX_3D_TEXTURE_SIZE
:
6252 params
[0] = (GLint64
)(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
6254 case GL_MAX_TEXTURE_STACK_DEPTH
:
6255 params
[0] = (GLint64
)(MAX_TEXTURE_STACK_DEPTH
);
6257 case GL_MAX_VIEWPORT_DIMS
:
6258 params
[0] = (GLint64
)(ctx
->Const
.MaxViewportWidth
);
6259 params
[1] = (GLint64
)(ctx
->Const
.MaxViewportHeight
);
6261 case GL_MODELVIEW_MATRIX
:
6263 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
6264 params
[0] = IROUND64(matrix
[0]);
6265 params
[1] = IROUND64(matrix
[1]);
6266 params
[2] = IROUND64(matrix
[2]);
6267 params
[3] = IROUND64(matrix
[3]);
6268 params
[4] = IROUND64(matrix
[4]);
6269 params
[5] = IROUND64(matrix
[5]);
6270 params
[6] = IROUND64(matrix
[6]);
6271 params
[7] = IROUND64(matrix
[7]);
6272 params
[8] = IROUND64(matrix
[8]);
6273 params
[9] = IROUND64(matrix
[9]);
6274 params
[10] = IROUND64(matrix
[10]);
6275 params
[11] = IROUND64(matrix
[11]);
6276 params
[12] = IROUND64(matrix
[12]);
6277 params
[13] = IROUND64(matrix
[13]);
6278 params
[14] = IROUND64(matrix
[14]);
6279 params
[15] = IROUND64(matrix
[15]);
6282 case GL_MODELVIEW_STACK_DEPTH
:
6283 params
[0] = (GLint64
)(ctx
->ModelviewMatrixStack
.Depth
+ 1);
6285 case GL_NAME_STACK_DEPTH
:
6286 params
[0] = (GLint64
)(ctx
->Select
.NameStackDepth
);
6289 params
[0] = BOOLEAN_TO_INT64(ctx
->Transform
.Normalize
);
6291 case GL_PACK_ALIGNMENT
:
6292 params
[0] = (GLint64
)(ctx
->Pack
.Alignment
);
6294 case GL_PACK_LSB_FIRST
:
6295 params
[0] = BOOLEAN_TO_INT64(ctx
->Pack
.LsbFirst
);
6297 case GL_PACK_ROW_LENGTH
:
6298 params
[0] = (GLint64
)(ctx
->Pack
.RowLength
);
6300 case GL_PACK_SKIP_PIXELS
:
6301 params
[0] = (GLint64
)(ctx
->Pack
.SkipPixels
);
6303 case GL_PACK_SKIP_ROWS
:
6304 params
[0] = (GLint64
)(ctx
->Pack
.SkipRows
);
6306 case GL_PACK_SWAP_BYTES
:
6307 params
[0] = BOOLEAN_TO_INT64(ctx
->Pack
.SwapBytes
);
6309 case GL_PACK_SKIP_IMAGES_EXT
:
6310 params
[0] = (GLint64
)(ctx
->Pack
.SkipImages
);
6312 case GL_PACK_IMAGE_HEIGHT_EXT
:
6313 params
[0] = (GLint64
)(ctx
->Pack
.ImageHeight
);
6315 case GL_PACK_INVERT_MESA
:
6316 params
[0] = BOOLEAN_TO_INT64(ctx
->Pack
.Invert
);
6318 case GL_PERSPECTIVE_CORRECTION_HINT
:
6319 params
[0] = ENUM_TO_INT64(ctx
->Hint
.PerspectiveCorrection
);
6321 case GL_PIXEL_MAP_A_TO_A_SIZE
:
6322 params
[0] = (GLint64
)(ctx
->PixelMaps
.AtoA
.Size
);
6324 case GL_PIXEL_MAP_B_TO_B_SIZE
:
6325 params
[0] = (GLint64
)(ctx
->PixelMaps
.BtoB
.Size
);
6327 case GL_PIXEL_MAP_G_TO_G_SIZE
:
6328 params
[0] = (GLint64
)(ctx
->PixelMaps
.GtoG
.Size
);
6330 case GL_PIXEL_MAP_I_TO_A_SIZE
:
6331 params
[0] = (GLint64
)(ctx
->PixelMaps
.ItoA
.Size
);
6333 case GL_PIXEL_MAP_I_TO_B_SIZE
:
6334 params
[0] = (GLint64
)(ctx
->PixelMaps
.ItoB
.Size
);
6336 case GL_PIXEL_MAP_I_TO_G_SIZE
:
6337 params
[0] = (GLint64
)(ctx
->PixelMaps
.ItoG
.Size
);
6339 case GL_PIXEL_MAP_I_TO_I_SIZE
:
6340 params
[0] = (GLint64
)(ctx
->PixelMaps
.ItoI
.Size
);
6342 case GL_PIXEL_MAP_I_TO_R_SIZE
:
6343 params
[0] = (GLint64
)(ctx
->PixelMaps
.ItoR
.Size
);
6345 case GL_PIXEL_MAP_R_TO_R_SIZE
:
6346 params
[0] = (GLint64
)(ctx
->PixelMaps
.RtoR
.Size
);
6348 case GL_PIXEL_MAP_S_TO_S_SIZE
:
6349 params
[0] = (GLint64
)(ctx
->PixelMaps
.StoS
.Size
);
6352 params
[0] = IROUND64(ctx
->Point
.Size
);
6354 case GL_POINT_SIZE_GRANULARITY
:
6355 params
[0] = IROUND64(ctx
->Const
.PointSizeGranularity
);
6357 case GL_POINT_SIZE_RANGE
:
6358 params
[0] = IROUND64(ctx
->Const
.MinPointSizeAA
);
6359 params
[1] = IROUND64(ctx
->Const
.MaxPointSizeAA
);
6361 case GL_ALIASED_POINT_SIZE_RANGE
:
6362 params
[0] = IROUND64(ctx
->Const
.MinPointSize
);
6363 params
[1] = IROUND64(ctx
->Const
.MaxPointSize
);
6365 case GL_POINT_SMOOTH
:
6366 params
[0] = BOOLEAN_TO_INT64(ctx
->Point
.SmoothFlag
);
6368 case GL_POINT_SMOOTH_HINT
:
6369 params
[0] = ENUM_TO_INT64(ctx
->Hint
.PointSmooth
);
6371 case GL_POINT_SIZE_MIN_EXT
:
6372 params
[0] = IROUND64(ctx
->Point
.MinSize
);
6374 case GL_POINT_SIZE_MAX_EXT
:
6375 params
[0] = IROUND64(ctx
->Point
.MaxSize
);
6377 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
6378 params
[0] = IROUND64(ctx
->Point
.Threshold
);
6380 case GL_DISTANCE_ATTENUATION_EXT
:
6381 params
[0] = IROUND64(ctx
->Point
.Params
[0]);
6382 params
[1] = IROUND64(ctx
->Point
.Params
[1]);
6383 params
[2] = IROUND64(ctx
->Point
.Params
[2]);
6385 case GL_POLYGON_MODE
:
6386 params
[0] = ENUM_TO_INT64(ctx
->Polygon
.FrontMode
);
6387 params
[1] = ENUM_TO_INT64(ctx
->Polygon
.BackMode
);
6389 case GL_POLYGON_OFFSET_BIAS_EXT
:
6390 params
[0] = IROUND64(ctx
->Polygon
.OffsetUnits
);
6392 case GL_POLYGON_OFFSET_FACTOR
:
6393 params
[0] = IROUND64(ctx
->Polygon
.OffsetFactor
);
6395 case GL_POLYGON_OFFSET_UNITS
:
6396 params
[0] = IROUND64(ctx
->Polygon
.OffsetUnits
);
6398 case GL_POLYGON_OFFSET_POINT
:
6399 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.OffsetPoint
);
6401 case GL_POLYGON_OFFSET_LINE
:
6402 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.OffsetLine
);
6404 case GL_POLYGON_OFFSET_FILL
:
6405 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.OffsetFill
);
6407 case GL_POLYGON_SMOOTH
:
6408 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.SmoothFlag
);
6410 case GL_POLYGON_SMOOTH_HINT
:
6411 params
[0] = ENUM_TO_INT64(ctx
->Hint
.PolygonSmooth
);
6413 case GL_POLYGON_STIPPLE
:
6414 params
[0] = BOOLEAN_TO_INT64(ctx
->Polygon
.StippleFlag
);
6416 case GL_PROJECTION_MATRIX
:
6418 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
6419 params
[0] = IROUND64(matrix
[0]);
6420 params
[1] = IROUND64(matrix
[1]);
6421 params
[2] = IROUND64(matrix
[2]);
6422 params
[3] = IROUND64(matrix
[3]);
6423 params
[4] = IROUND64(matrix
[4]);
6424 params
[5] = IROUND64(matrix
[5]);
6425 params
[6] = IROUND64(matrix
[6]);
6426 params
[7] = IROUND64(matrix
[7]);
6427 params
[8] = IROUND64(matrix
[8]);
6428 params
[9] = IROUND64(matrix
[9]);
6429 params
[10] = IROUND64(matrix
[10]);
6430 params
[11] = IROUND64(matrix
[11]);
6431 params
[12] = IROUND64(matrix
[12]);
6432 params
[13] = IROUND64(matrix
[13]);
6433 params
[14] = IROUND64(matrix
[14]);
6434 params
[15] = IROUND64(matrix
[15]);
6437 case GL_PROJECTION_STACK_DEPTH
:
6438 params
[0] = (GLint64
)(ctx
->ProjectionMatrixStack
.Depth
+ 1);
6440 case GL_READ_BUFFER
:
6441 params
[0] = ENUM_TO_INT64(ctx
->ReadBuffer
->ColorReadBuffer
);
6444 params
[0] = IROUND64(ctx
->Pixel
.RedBias
);
6447 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.redBits
);
6450 params
[0] = IROUND64(ctx
->Pixel
.RedScale
);
6452 case GL_RENDER_MODE
:
6453 params
[0] = ENUM_TO_INT64(ctx
->RenderMode
);
6455 case GL_RESCALE_NORMAL
:
6456 params
[0] = BOOLEAN_TO_INT64(ctx
->Transform
.RescaleNormals
);
6459 params
[0] = BOOLEAN_TO_INT64(GL_TRUE
);
6461 case GL_SCISSOR_BOX
:
6462 params
[0] = (GLint64
)(ctx
->Scissor
.X
);
6463 params
[1] = (GLint64
)(ctx
->Scissor
.Y
);
6464 params
[2] = (GLint64
)(ctx
->Scissor
.Width
);
6465 params
[3] = (GLint64
)(ctx
->Scissor
.Height
);
6467 case GL_SCISSOR_TEST
:
6468 params
[0] = BOOLEAN_TO_INT64(ctx
->Scissor
.Enabled
);
6470 case GL_SELECTION_BUFFER_SIZE
:
6471 params
[0] = (GLint64
)(ctx
->Select
.BufferSize
);
6473 case GL_SHADE_MODEL
:
6474 params
[0] = ENUM_TO_INT64(ctx
->Light
.ShadeModel
);
6476 case GL_SHARED_TEXTURE_PALETTE_EXT
:
6477 params
[0] = BOOLEAN_TO_INT64(ctx
->Texture
.SharedPalette
);
6479 case GL_STENCIL_BITS
:
6480 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.stencilBits
);
6482 case GL_STENCIL_CLEAR_VALUE
:
6483 params
[0] = (GLint64
)(ctx
->Stencil
.Clear
);
6485 case GL_STENCIL_FAIL
:
6486 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
6488 case GL_STENCIL_FUNC
:
6489 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
6491 case GL_STENCIL_PASS_DEPTH_FAIL
:
6492 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
6494 case GL_STENCIL_PASS_DEPTH_PASS
:
6495 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
6497 case GL_STENCIL_REF
:
6498 params
[0] = (GLint64
)(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
6500 case GL_STENCIL_TEST
:
6501 params
[0] = BOOLEAN_TO_INT64(ctx
->Stencil
.Enabled
);
6503 case GL_STENCIL_VALUE_MASK
:
6504 params
[0] = (GLint64
)(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
6506 case GL_STENCIL_WRITEMASK
:
6507 params
[0] = (GLint64
)(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
6510 params
[0] = BOOLEAN_TO_INT64(ctx
->DrawBuffer
->Visual
.stereoMode
);
6512 case GL_SUBPIXEL_BITS
:
6513 params
[0] = (GLint64
)(ctx
->Const
.SubPixelBits
);
6516 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D
));
6519 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D
));
6522 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_3D
));
6524 case GL_TEXTURE_1D_ARRAY_EXT
:
6525 CHECK_EXT1(MESA_texture_array
, "GetInteger64v");
6526 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT
));
6528 case GL_TEXTURE_2D_ARRAY_EXT
:
6529 CHECK_EXT1(MESA_texture_array
, "GetInteger64v");
6530 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT
));
6532 case GL_TEXTURE_BINDING_1D
:
6533 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_INDEX
]->Name
);
6535 case GL_TEXTURE_BINDING_2D
:
6536 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_INDEX
]->Name
);
6538 case GL_TEXTURE_BINDING_3D
:
6539 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_3D_INDEX
]->Name
);
6541 case GL_TEXTURE_BINDING_1D_ARRAY_EXT
:
6542 CHECK_EXT1(MESA_texture_array
, "GetInteger64v");
6543 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_1D_ARRAY_INDEX
]->Name
);
6545 case GL_TEXTURE_BINDING_2D_ARRAY_EXT
:
6546 CHECK_EXT1(MESA_texture_array
, "GetInteger64v");
6547 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_2D_ARRAY_INDEX
]->Name
);
6549 case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT
:
6550 CHECK_EXT1(MESA_texture_array
, "GetInteger64v");
6551 params
[0] = (GLint64
)(ctx
->Const
.MaxArrayTextureLayers
);
6553 case GL_TEXTURE_GEN_S
:
6554 params
[0] = BOOLEAN_TO_INT64(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& S_BIT
) ? 1 : 0));
6556 case GL_TEXTURE_GEN_T
:
6557 params
[0] = BOOLEAN_TO_INT64(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& T_BIT
) ? 1 : 0));
6559 case GL_TEXTURE_GEN_R
:
6560 params
[0] = BOOLEAN_TO_INT64(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& R_BIT
) ? 1 : 0));
6562 case GL_TEXTURE_GEN_Q
:
6563 params
[0] = BOOLEAN_TO_INT64(((ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].TexGenEnabled
& Q_BIT
) ? 1 : 0));
6565 case GL_TEXTURE_MATRIX
:
6567 const GLfloat
*matrix
;
6568 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
6569 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
6570 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGet(texture matrix %u)",
6574 matrix
= ctx
->TextureMatrixStack
[unit
].Top
->m
;
6575 params
[0] = IROUND64(matrix
[0]);
6576 params
[1] = IROUND64(matrix
[1]);
6577 params
[2] = IROUND64(matrix
[2]);
6578 params
[3] = IROUND64(matrix
[3]);
6579 params
[4] = IROUND64(matrix
[4]);
6580 params
[5] = IROUND64(matrix
[5]);
6581 params
[6] = IROUND64(matrix
[6]);
6582 params
[7] = IROUND64(matrix
[7]);
6583 params
[8] = IROUND64(matrix
[8]);
6584 params
[9] = IROUND64(matrix
[9]);
6585 params
[10] = IROUND64(matrix
[10]);
6586 params
[11] = IROUND64(matrix
[11]);
6587 params
[12] = IROUND64(matrix
[12]);
6588 params
[13] = IROUND64(matrix
[13]);
6589 params
[14] = IROUND64(matrix
[14]);
6590 params
[15] = IROUND64(matrix
[15]);
6593 case GL_TEXTURE_STACK_DEPTH
:
6595 const GLuint unit
= ctx
->Texture
.CurrentUnit
;
6596 if (unit
>= ctx
->Const
.MaxTextureCoordUnits
) {
6597 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6598 "glGet(texture stack depth, unit %u)", unit
);
6601 params
[0] = (GLint64
)(ctx
->TextureMatrixStack
[unit
].Depth
+ 1);
6604 case GL_UNPACK_ALIGNMENT
:
6605 params
[0] = (GLint64
)(ctx
->Unpack
.Alignment
);
6607 case GL_UNPACK_LSB_FIRST
:
6608 params
[0] = BOOLEAN_TO_INT64(ctx
->Unpack
.LsbFirst
);
6610 case GL_UNPACK_ROW_LENGTH
:
6611 params
[0] = (GLint64
)(ctx
->Unpack
.RowLength
);
6613 case GL_UNPACK_SKIP_PIXELS
:
6614 params
[0] = (GLint64
)(ctx
->Unpack
.SkipPixels
);
6616 case GL_UNPACK_SKIP_ROWS
:
6617 params
[0] = (GLint64
)(ctx
->Unpack
.SkipRows
);
6619 case GL_UNPACK_SWAP_BYTES
:
6620 params
[0] = BOOLEAN_TO_INT64(ctx
->Unpack
.SwapBytes
);
6622 case GL_UNPACK_SKIP_IMAGES_EXT
:
6623 params
[0] = (GLint64
)(ctx
->Unpack
.SkipImages
);
6625 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
6626 params
[0] = (GLint64
)(ctx
->Unpack
.ImageHeight
);
6628 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
6629 params
[0] = BOOLEAN_TO_INT64(ctx
->Unpack
.ClientStorage
);
6632 params
[0] = (GLint64
)(ctx
->Viewport
.X
);
6633 params
[1] = (GLint64
)(ctx
->Viewport
.Y
);
6634 params
[2] = (GLint64
)(ctx
->Viewport
.Width
);
6635 params
[3] = (GLint64
)(ctx
->Viewport
.Height
);
6638 params
[0] = IROUND64(ctx
->Pixel
.ZoomX
);
6641 params
[0] = IROUND64(ctx
->Pixel
.ZoomY
);
6643 case GL_VERTEX_ARRAY
:
6644 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->Vertex
.Enabled
);
6646 case GL_VERTEX_ARRAY_SIZE
:
6647 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Vertex
.Size
);
6649 case GL_VERTEX_ARRAY_TYPE
:
6650 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->Vertex
.Type
);
6652 case GL_VERTEX_ARRAY_STRIDE
:
6653 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Vertex
.Stride
);
6655 case GL_VERTEX_ARRAY_COUNT_EXT
:
6656 params
[0] = (GLint64
)(0);
6658 case GL_NORMAL_ARRAY
:
6659 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->Normal
.Enabled
);
6661 case GL_NORMAL_ARRAY_TYPE
:
6662 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->Normal
.Type
);
6664 case GL_NORMAL_ARRAY_STRIDE
:
6665 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Normal
.Stride
);
6667 case GL_NORMAL_ARRAY_COUNT_EXT
:
6668 params
[0] = (GLint64
)(0);
6670 case GL_COLOR_ARRAY
:
6671 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->Color
.Enabled
);
6673 case GL_COLOR_ARRAY_SIZE
:
6674 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Color
.Size
);
6676 case GL_COLOR_ARRAY_TYPE
:
6677 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->Color
.Type
);
6679 case GL_COLOR_ARRAY_STRIDE
:
6680 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Color
.Stride
);
6682 case GL_COLOR_ARRAY_COUNT_EXT
:
6683 params
[0] = (GLint64
)(0);
6685 case GL_INDEX_ARRAY
:
6686 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->Index
.Enabled
);
6688 case GL_INDEX_ARRAY_TYPE
:
6689 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->Index
.Type
);
6691 case GL_INDEX_ARRAY_STRIDE
:
6692 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Index
.Stride
);
6694 case GL_INDEX_ARRAY_COUNT_EXT
:
6695 params
[0] = (GLint64
)(0);
6697 case GL_TEXTURE_COORD_ARRAY
:
6698 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
);
6700 case GL_TEXTURE_COORD_ARRAY_SIZE
:
6701 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Size
);
6703 case GL_TEXTURE_COORD_ARRAY_TYPE
:
6704 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Type
);
6706 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
6707 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].Stride
);
6709 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
6710 params
[0] = (GLint64
)(0);
6712 case GL_EDGE_FLAG_ARRAY
:
6713 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->EdgeFlag
.Enabled
);
6715 case GL_EDGE_FLAG_ARRAY_STRIDE
:
6716 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->EdgeFlag
.Stride
);
6718 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
6719 params
[0] = (GLint64
)(0);
6721 case GL_MAX_TEXTURE_UNITS_ARB
:
6722 CHECK_EXT1(ARB_multitexture
, "GetInteger64v");
6723 params
[0] = (GLint64
)(ctx
->Const
.MaxTextureUnits
);
6725 case GL_ACTIVE_TEXTURE_ARB
:
6726 CHECK_EXT1(ARB_multitexture
, "GetInteger64v");
6727 params
[0] = (GLint64
)(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
6729 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
6730 CHECK_EXT1(ARB_multitexture
, "GetInteger64v");
6731 params
[0] = (GLint64
)(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
6733 case GL_TEXTURE_CUBE_MAP_ARB
:
6734 CHECK_EXT1(ARB_texture_cube_map
, "GetInteger64v");
6735 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
));
6737 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
6738 CHECK_EXT1(ARB_texture_cube_map
, "GetInteger64v");
6739 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_CUBE_INDEX
]->Name
);
6741 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
6742 CHECK_EXT1(ARB_texture_cube_map
, "GetInteger64v");
6743 params
[0] = (GLint64
)((1 << (ctx
->Const
.MaxCubeTextureLevels
- 1)));
6745 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
6746 params
[0] = (GLint64
)(ctx
->Hint
.TextureCompression
);
6748 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
6749 params
[0] = (GLint64
)(_mesa_get_compressed_formats(ctx
, NULL
, GL_FALSE
));
6751 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
6754 GLuint i
, n
= _mesa_get_compressed_formats(ctx
, formats
, GL_FALSE
);
6756 for (i
= 0; i
< n
; i
++)
6757 params
[i
] = ENUM_TO_INT64(formats
[i
]);
6760 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
6761 CHECK_EXT1(EXT_compiled_vertex_array
, "GetInteger64v");
6762 params
[0] = (GLint64
)(ctx
->Array
.LockFirst
);
6764 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
6765 CHECK_EXT1(EXT_compiled_vertex_array
, "GetInteger64v");
6766 params
[0] = (GLint64
)(ctx
->Array
.LockCount
);
6768 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
6770 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
6771 params
[0] = IROUND64(matrix
[0]);
6772 params
[1] = IROUND64(matrix
[4]);
6773 params
[2] = IROUND64(matrix
[8]);
6774 params
[3] = IROUND64(matrix
[12]);
6775 params
[4] = IROUND64(matrix
[1]);
6776 params
[5] = IROUND64(matrix
[5]);
6777 params
[6] = IROUND64(matrix
[9]);
6778 params
[7] = IROUND64(matrix
[13]);
6779 params
[8] = IROUND64(matrix
[2]);
6780 params
[9] = IROUND64(matrix
[6]);
6781 params
[10] = IROUND64(matrix
[10]);
6782 params
[11] = IROUND64(matrix
[14]);
6783 params
[12] = IROUND64(matrix
[3]);
6784 params
[13] = IROUND64(matrix
[7]);
6785 params
[14] = IROUND64(matrix
[11]);
6786 params
[15] = IROUND64(matrix
[15]);
6789 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
6791 const GLfloat
*matrix
= ctx
->ModelviewMatrixStack
.Top
->m
;
6792 params
[0] = IROUND64(matrix
[0]);
6793 params
[1] = IROUND64(matrix
[4]);
6794 params
[2] = IROUND64(matrix
[8]);
6795 params
[3] = IROUND64(matrix
[12]);
6796 params
[4] = IROUND64(matrix
[1]);
6797 params
[5] = IROUND64(matrix
[5]);
6798 params
[6] = IROUND64(matrix
[9]);
6799 params
[7] = IROUND64(matrix
[13]);
6800 params
[8] = IROUND64(matrix
[2]);
6801 params
[9] = IROUND64(matrix
[6]);
6802 params
[10] = IROUND64(matrix
[10]);
6803 params
[11] = IROUND64(matrix
[14]);
6804 params
[12] = IROUND64(matrix
[3]);
6805 params
[13] = IROUND64(matrix
[7]);
6806 params
[14] = IROUND64(matrix
[11]);
6807 params
[15] = IROUND64(matrix
[15]);
6810 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
6812 const GLfloat
*matrix
= ctx
->ProjectionMatrixStack
.Top
->m
;
6813 params
[0] = IROUND64(matrix
[0]);
6814 params
[1] = IROUND64(matrix
[4]);
6815 params
[2] = IROUND64(matrix
[8]);
6816 params
[3] = IROUND64(matrix
[12]);
6817 params
[4] = IROUND64(matrix
[1]);
6818 params
[5] = IROUND64(matrix
[5]);
6819 params
[6] = IROUND64(matrix
[9]);
6820 params
[7] = IROUND64(matrix
[13]);
6821 params
[8] = IROUND64(matrix
[2]);
6822 params
[9] = IROUND64(matrix
[6]);
6823 params
[10] = IROUND64(matrix
[10]);
6824 params
[11] = IROUND64(matrix
[14]);
6825 params
[12] = IROUND64(matrix
[3]);
6826 params
[13] = IROUND64(matrix
[7]);
6827 params
[14] = IROUND64(matrix
[11]);
6828 params
[15] = IROUND64(matrix
[15]);
6831 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
6833 const GLfloat
*matrix
= ctx
->TextureMatrixStack
[ctx
->Texture
.CurrentUnit
].Top
->m
;
6834 params
[0] = IROUND64(matrix
[0]);
6835 params
[1] = IROUND64(matrix
[4]);
6836 params
[2] = IROUND64(matrix
[8]);
6837 params
[3] = IROUND64(matrix
[12]);
6838 params
[4] = IROUND64(matrix
[1]);
6839 params
[5] = IROUND64(matrix
[5]);
6840 params
[6] = IROUND64(matrix
[9]);
6841 params
[7] = IROUND64(matrix
[13]);
6842 params
[8] = IROUND64(matrix
[2]);
6843 params
[9] = IROUND64(matrix
[6]);
6844 params
[10] = IROUND64(matrix
[10]);
6845 params
[11] = IROUND64(matrix
[14]);
6846 params
[12] = IROUND64(matrix
[3]);
6847 params
[13] = IROUND64(matrix
[7]);
6848 params
[14] = IROUND64(matrix
[11]);
6849 params
[15] = IROUND64(matrix
[15]);
6852 case GL_COLOR_MATRIX_SGI
:
6854 const GLfloat
*matrix
= ctx
->ColorMatrixStack
.Top
->m
;
6855 params
[0] = IROUND64(matrix
[0]);
6856 params
[1] = IROUND64(matrix
[1]);
6857 params
[2] = IROUND64(matrix
[2]);
6858 params
[3] = IROUND64(matrix
[3]);
6859 params
[4] = IROUND64(matrix
[4]);
6860 params
[5] = IROUND64(matrix
[5]);
6861 params
[6] = IROUND64(matrix
[6]);
6862 params
[7] = IROUND64(matrix
[7]);
6863 params
[8] = IROUND64(matrix
[8]);
6864 params
[9] = IROUND64(matrix
[9]);
6865 params
[10] = IROUND64(matrix
[10]);
6866 params
[11] = IROUND64(matrix
[11]);
6867 params
[12] = IROUND64(matrix
[12]);
6868 params
[13] = IROUND64(matrix
[13]);
6869 params
[14] = IROUND64(matrix
[14]);
6870 params
[15] = IROUND64(matrix
[15]);
6873 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
6874 params
[0] = (GLint64
)(ctx
->ColorMatrixStack
.Depth
+ 1);
6876 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
6877 params
[0] = (GLint64
)(MAX_COLOR_STACK_DEPTH
);
6879 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
6880 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixScale
[0]);
6882 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
6883 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixScale
[1]);
6885 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
6886 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixScale
[2]);
6888 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
6889 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixScale
[3]);
6891 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
6892 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixBias
[0]);
6894 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
6895 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixBias
[1]);
6897 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
6898 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixBias
[2]);
6900 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
6901 params
[0] = IROUND64(ctx
->Pixel
.PostColorMatrixBias
[3]);
6903 case GL_CONVOLUTION_1D_EXT
:
6904 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6905 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.Convolution1DEnabled
);
6907 case GL_CONVOLUTION_2D_EXT
:
6908 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6909 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.Convolution2DEnabled
);
6911 case GL_SEPARABLE_2D_EXT
:
6912 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6913 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.Separable2DEnabled
);
6915 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
6916 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6917 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionScale
[0]);
6919 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
6920 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6921 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionScale
[1]);
6923 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
6924 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6925 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionScale
[2]);
6927 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
6928 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6929 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionScale
[3]);
6931 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
6932 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6933 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionBias
[0]);
6935 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
6936 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6937 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionBias
[1]);
6939 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
6940 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6941 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionBias
[2]);
6943 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
6944 CHECK_EXT1(EXT_convolution
, "GetInteger64v");
6945 params
[0] = IROUND64(ctx
->Pixel
.PostConvolutionBias
[3]);
6948 CHECK_EXT1(EXT_histogram
, "GetInteger64v");
6949 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.HistogramEnabled
);
6952 CHECK_EXT1(EXT_histogram
, "GetInteger64v");
6953 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.MinMaxEnabled
);
6955 case GL_COLOR_TABLE_SGI
:
6956 CHECK_EXT1(SGI_color_table
, "GetInteger64v");
6957 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_PRECONVOLUTION
]);
6959 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
6960 CHECK_EXT1(SGI_color_table
, "GetInteger64v");
6961 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCONVOLUTION
]);
6963 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
6964 CHECK_EXT1(SGI_color_table
, "GetInteger64v");
6965 params
[0] = BOOLEAN_TO_INT64(ctx
->Pixel
.ColorTableEnabled
[COLORTABLE_POSTCOLORMATRIX
]);
6967 case GL_TEXTURE_COLOR_TABLE_SGI
:
6968 CHECK_EXT1(SGI_texture_color_table
, "GetInteger64v");
6969 params
[0] = BOOLEAN_TO_INT64(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].ColorTableEnabled
);
6971 case GL_COLOR_SUM_EXT
:
6972 CHECK_EXT2(EXT_secondary_color
, ARB_vertex_program
, "GetInteger64v");
6973 params
[0] = BOOLEAN_TO_INT64(ctx
->Fog
.ColorSumEnabled
);
6975 case GL_CURRENT_SECONDARY_COLOR_EXT
:
6976 CHECK_EXT1(EXT_secondary_color
, "GetInteger64v");
6978 FLUSH_CURRENT(ctx
, 0);
6979 params
[0] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
6980 params
[1] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
6981 params
[2] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
6982 params
[3] = FLOAT_TO_INT64(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
6985 case GL_SECONDARY_COLOR_ARRAY_EXT
:
6986 CHECK_EXT1(EXT_secondary_color
, "GetInteger64v");
6987 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->SecondaryColor
.Enabled
);
6989 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
6990 CHECK_EXT1(EXT_secondary_color
, "GetInteger64v");
6991 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->SecondaryColor
.Type
);
6993 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
6994 CHECK_EXT1(EXT_secondary_color
, "GetInteger64v");
6995 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Stride
);
6997 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
6998 CHECK_EXT1(EXT_secondary_color
, "GetInteger64v");
6999 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->SecondaryColor
.Size
);
7001 case GL_CURRENT_FOG_COORDINATE_EXT
:
7002 CHECK_EXT1(EXT_fog_coord
, "GetInteger64v");
7004 FLUSH_CURRENT(ctx
, 0);
7005 params
[0] = IROUND64(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
7008 case GL_FOG_COORDINATE_ARRAY_EXT
:
7009 CHECK_EXT1(EXT_fog_coord
, "GetInteger64v");
7010 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->FogCoord
.Enabled
);
7012 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
7013 CHECK_EXT1(EXT_fog_coord
, "GetInteger64v");
7014 params
[0] = ENUM_TO_INT64(ctx
->Array
.ArrayObj
->FogCoord
.Type
);
7016 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
7017 CHECK_EXT1(EXT_fog_coord
, "GetInteger64v");
7018 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->FogCoord
.Stride
);
7020 case GL_FOG_COORDINATE_SOURCE_EXT
:
7021 CHECK_EXT1(EXT_fog_coord
, "GetInteger64v");
7022 params
[0] = ENUM_TO_INT64(ctx
->Fog
.FogCoordinateSource
);
7024 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
7025 CHECK_EXT1(EXT_texture_lod_bias
, "GetInteger64v");
7026 params
[0] = IROUND64(ctx
->Const
.MaxTextureLodBias
);
7028 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
7029 CHECK_EXT1(EXT_texture_filter_anisotropic
, "GetInteger64v");
7030 params
[0] = IROUND64(ctx
->Const
.MaxTextureMaxAnisotropy
);
7032 case GL_MULTISAMPLE_ARB
:
7033 params
[0] = BOOLEAN_TO_INT64(ctx
->Multisample
.Enabled
);
7035 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
7036 params
[0] = BOOLEAN_TO_INT64(ctx
->Multisample
.SampleAlphaToCoverage
);
7038 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
7039 params
[0] = BOOLEAN_TO_INT64(ctx
->Multisample
.SampleAlphaToOne
);
7041 case GL_SAMPLE_COVERAGE_ARB
:
7042 params
[0] = BOOLEAN_TO_INT64(ctx
->Multisample
.SampleCoverage
);
7044 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
7045 params
[0] = IROUND64(ctx
->Multisample
.SampleCoverageValue
);
7047 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
7048 params
[0] = BOOLEAN_TO_INT64(ctx
->Multisample
.SampleCoverageInvert
);
7050 case GL_SAMPLE_BUFFERS_ARB
:
7051 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.sampleBuffers
);
7053 case GL_SAMPLES_ARB
:
7054 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Visual
.samples
);
7056 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
7057 CHECK_EXT1(IBM_rasterpos_clip
, "GetInteger64v");
7058 params
[0] = BOOLEAN_TO_INT64(ctx
->Transform
.RasterPositionUnclipped
);
7060 case GL_POINT_SPRITE_NV
:
7061 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetInteger64v");
7062 params
[0] = BOOLEAN_TO_INT64(ctx
->Point
.PointSprite
);
7064 case GL_POINT_SPRITE_R_MODE_NV
:
7065 CHECK_EXT1(NV_point_sprite
, "GetInteger64v");
7066 params
[0] = ENUM_TO_INT64(ctx
->Point
.SpriteRMode
);
7068 case GL_POINT_SPRITE_COORD_ORIGIN
:
7069 CHECK_EXT2(NV_point_sprite
, ARB_point_sprite
, "GetInteger64v");
7070 params
[0] = ENUM_TO_INT64(ctx
->Point
.SpriteOrigin
);
7072 case GL_GENERATE_MIPMAP_HINT_SGIS
:
7073 CHECK_EXT1(SGIS_generate_mipmap
, "GetInteger64v");
7074 params
[0] = ENUM_TO_INT64(ctx
->Hint
.GenerateMipmap
);
7076 case GL_VERTEX_PROGRAM_BINDING_NV
:
7077 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7078 params
[0] = (GLint64
)((ctx
->VertexProgram
.Current
? ctx
->VertexProgram
.Current
->Base
.Id
: 0));
7080 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
7081 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7082 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[0].Enabled
);
7084 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
7085 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7086 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[1].Enabled
);
7088 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
7089 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7090 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[2].Enabled
);
7092 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
7093 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7094 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[3].Enabled
);
7096 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
7097 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7098 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[4].Enabled
);
7100 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
7101 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7102 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[5].Enabled
);
7104 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
7105 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7106 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[6].Enabled
);
7108 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
7109 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7110 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[7].Enabled
);
7112 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
7113 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7114 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[8].Enabled
);
7116 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
7117 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7118 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[9].Enabled
);
7120 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
7121 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7122 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[10].Enabled
);
7124 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
7125 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7126 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[11].Enabled
);
7128 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
7129 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7130 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[12].Enabled
);
7132 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
7133 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7134 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[13].Enabled
);
7136 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
7137 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7138 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[14].Enabled
);
7140 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
7141 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7142 params
[0] = BOOLEAN_TO_INT64(ctx
->Array
.ArrayObj
->VertexAttrib
[15].Enabled
);
7144 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
7145 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7146 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[0]);
7148 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
7149 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7150 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[1]);
7152 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
7153 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7154 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[2]);
7156 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
7157 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7158 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[3]);
7160 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
7161 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7162 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[4]);
7164 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
7165 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7166 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[5]);
7168 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
7169 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7170 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[6]);
7172 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
7173 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7174 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[7]);
7176 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
7177 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7178 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[8]);
7180 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
7181 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7182 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[9]);
7184 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
7185 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7186 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[10]);
7188 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
7189 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7190 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[11]);
7192 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
7193 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7194 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[12]);
7196 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
7197 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7198 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[13]);
7200 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
7201 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7202 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[14]);
7204 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
7205 CHECK_EXT1(NV_vertex_program
, "GetInteger64v");
7206 params
[0] = BOOLEAN_TO_INT64(ctx
->Eval
.Map1Attrib
[15]);
7208 case GL_FRAGMENT_PROGRAM_NV
:
7209 CHECK_EXT1(NV_fragment_program
, "GetInteger64v");
7210 params
[0] = BOOLEAN_TO_INT64(ctx
->FragmentProgram
.Enabled
);
7212 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
7213 CHECK_EXT1(NV_fragment_program
, "GetInteger64v");
7214 params
[0] = (GLint64
)(ctx
->FragmentProgram
.Current
? ctx
->FragmentProgram
.Current
->Base
.Id
: 0);
7216 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
7217 CHECK_EXT1(NV_fragment_program
, "GetInteger64v");
7218 params
[0] = (GLint64
)(MAX_NV_FRAGMENT_PROGRAM_PARAMS
);
7220 case GL_TEXTURE_RECTANGLE_NV
:
7221 CHECK_EXT1(NV_texture_rectangle
, "GetInteger64v");
7222 params
[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
));
7224 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
7225 CHECK_EXT1(NV_texture_rectangle
, "GetInteger64v");
7226 params
[0] = (GLint64
)(ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
].CurrentTex
[TEXTURE_RECT_INDEX
]->Name
);
7228 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
7229 CHECK_EXT1(NV_texture_rectangle
, "GetInteger64v");
7230 params
[0] = (GLint64
)(ctx
->Const
.MaxTextureRectSize
);
7232 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
7233 CHECK_EXT1(EXT_stencil_two_side
, "GetInteger64v");
7234 params
[0] = BOOLEAN_TO_INT64(ctx
->Stencil
.TestTwoSide
);
7236 case GL_ACTIVE_STENCIL_FACE_EXT
:
7237 CHECK_EXT1(EXT_stencil_two_side
, "GetInteger64v");
7238 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
7240 case GL_MAX_SHININESS_NV
:
7241 CHECK_EXT1(NV_light_max_exponent
, "GetInteger64v");
7242 params
[0] = IROUND64(ctx
->Const
.MaxShininess
);
7244 case GL_MAX_SPOT_EXPONENT_NV
:
7245 CHECK_EXT1(NV_light_max_exponent
, "GetInteger64v");
7246 params
[0] = IROUND64(ctx
->Const
.MaxSpotExponent
);
7248 case GL_ARRAY_BUFFER_BINDING_ARB
:
7249 params
[0] = (GLint64
)(ctx
->Array
.ArrayBufferObj
->Name
);
7251 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
7252 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Vertex
.BufferObj
->Name
);
7254 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
7255 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Normal
.BufferObj
->Name
);
7257 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
7258 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Color
.BufferObj
->Name
);
7260 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
7261 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Index
.BufferObj
->Name
);
7263 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
7264 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->TexCoord
[ctx
->Array
.ActiveTexture
].BufferObj
->Name
);
7266 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
7267 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->EdgeFlag
.BufferObj
->Name
);
7269 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
7270 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->SecondaryColor
.BufferObj
->Name
);
7272 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
7273 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->FogCoord
.BufferObj
->Name
);
7275 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
7276 params
[0] = (GLint64
)(ctx
->Array
.ElementArrayBufferObj
->Name
);
7278 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
7279 CHECK_EXT1(EXT_pixel_buffer_object
, "GetInteger64v");
7280 params
[0] = (GLint64
)(ctx
->Pack
.BufferObj
->Name
);
7282 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
7283 CHECK_EXT1(EXT_pixel_buffer_object
, "GetInteger64v");
7284 params
[0] = (GLint64
)(ctx
->Unpack
.BufferObj
->Name
);
7286 case GL_VERTEX_PROGRAM_ARB
:
7287 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetInteger64v");
7288 params
[0] = BOOLEAN_TO_INT64(ctx
->VertexProgram
.Enabled
);
7290 case GL_VERTEX_PROGRAM_POINT_SIZE_ARB
:
7291 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetInteger64v");
7292 params
[0] = BOOLEAN_TO_INT64(ctx
->VertexProgram
.PointSizeEnabled
);
7294 case GL_VERTEX_PROGRAM_TWO_SIDE_ARB
:
7295 CHECK_EXT2(ARB_vertex_program
, NV_vertex_program
, "GetInteger64v");
7296 params
[0] = BOOLEAN_TO_INT64(ctx
->VertexProgram
.TwoSideEnabled
);
7298 case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB
:
7299 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetInteger64v");
7300 params
[0] = (GLint64
)(ctx
->Const
.MaxProgramMatrixStackDepth
);
7302 case GL_MAX_PROGRAM_MATRICES_ARB
:
7303 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetInteger64v");
7304 params
[0] = (GLint64
)(ctx
->Const
.MaxProgramMatrices
);
7306 case GL_CURRENT_MATRIX_STACK_DEPTH_ARB
:
7307 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_vertex_program
, "GetInteger64v");
7308 params
[0] = BOOLEAN_TO_INT64(ctx
->CurrentStack
->Depth
+ 1);
7310 case GL_CURRENT_MATRIX_ARB
:
7311 CHECK_EXT3(ARB_vertex_program
, ARB_fragment_program
, NV_fragment_program
, "GetInteger64v");
7313 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
7314 params
[0] = IROUND64(matrix
[0]);
7315 params
[1] = IROUND64(matrix
[1]);
7316 params
[2] = IROUND64(matrix
[2]);
7317 params
[3] = IROUND64(matrix
[3]);
7318 params
[4] = IROUND64(matrix
[4]);
7319 params
[5] = IROUND64(matrix
[5]);
7320 params
[6] = IROUND64(matrix
[6]);
7321 params
[7] = IROUND64(matrix
[7]);
7322 params
[8] = IROUND64(matrix
[8]);
7323 params
[9] = IROUND64(matrix
[9]);
7324 params
[10] = IROUND64(matrix
[10]);
7325 params
[11] = IROUND64(matrix
[11]);
7326 params
[12] = IROUND64(matrix
[12]);
7327 params
[13] = IROUND64(matrix
[13]);
7328 params
[14] = IROUND64(matrix
[14]);
7329 params
[15] = IROUND64(matrix
[15]);
7332 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
7333 CHECK_EXT2(ARB_vertex_program
, ARB_fragment_program
, "GetInteger64v");
7335 const GLfloat
*matrix
= ctx
->CurrentStack
->Top
->m
;
7336 params
[0] = IROUND64(matrix
[0]);
7337 params
[1] = IROUND64(matrix
[4]);
7338 params
[2] = IROUND64(matrix
[8]);
7339 params
[3] = IROUND64(matrix
[12]);
7340 params
[4] = IROUND64(matrix
[1]);
7341 params
[5] = IROUND64(matrix
[5]);
7342 params
[6] = IROUND64(matrix
[9]);
7343 params
[7] = IROUND64(matrix
[13]);
7344 params
[8] = IROUND64(matrix
[2]);
7345 params
[9] = IROUND64(matrix
[6]);
7346 params
[10] = IROUND64(matrix
[10]);
7347 params
[11] = IROUND64(matrix
[14]);
7348 params
[12] = IROUND64(matrix
[3]);
7349 params
[13] = IROUND64(matrix
[7]);
7350 params
[14] = IROUND64(matrix
[11]);
7351 params
[15] = IROUND64(matrix
[15]);
7354 case GL_MAX_VERTEX_ATTRIBS_ARB
:
7355 CHECK_EXT1(ARB_vertex_program
, "GetInteger64v");
7356 params
[0] = (GLint64
)(ctx
->Const
.VertexProgram
.MaxAttribs
);
7358 case GL_PROGRAM_ERROR_POSITION_ARB
:
7359 CHECK_EXT4(NV_vertex_program
, ARB_vertex_program
, NV_fragment_program
, ARB_fragment_program
, "GetInteger64v");
7360 params
[0] = (GLint64
)(ctx
->Program
.ErrorPos
);
7362 case GL_FRAGMENT_PROGRAM_ARB
:
7363 CHECK_EXT1(ARB_fragment_program
, "GetInteger64v");
7364 params
[0] = BOOLEAN_TO_INT64(ctx
->FragmentProgram
.Enabled
);
7366 case GL_MAX_TEXTURE_COORDS_ARB
:
7367 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetInteger64v");
7368 params
[0] = (GLint64
)(ctx
->Const
.MaxTextureCoordUnits
);
7370 case GL_MAX_TEXTURE_IMAGE_UNITS_ARB
:
7371 CHECK_EXT2(ARB_fragment_program
, NV_fragment_program
, "GetInteger64v");
7372 params
[0] = (GLint64
)(ctx
->Const
.MaxTextureImageUnits
);
7374 case GL_DEPTH_BOUNDS_TEST_EXT
:
7375 CHECK_EXT1(EXT_depth_bounds_test
, "GetInteger64v");
7376 params
[0] = BOOLEAN_TO_INT64(ctx
->Depth
.BoundsTest
);
7378 case GL_DEPTH_BOUNDS_EXT
:
7379 CHECK_EXT1(EXT_depth_bounds_test
, "GetInteger64v");
7380 params
[0] = IROUND64(ctx
->Depth
.BoundsMin
);
7381 params
[1] = IROUND64(ctx
->Depth
.BoundsMax
);
7383 case GL_DEPTH_CLAMP
:
7384 CHECK_EXT1(ARB_depth_clamp
, "GetInteger64v");
7385 params
[0] = BOOLEAN_TO_INT64(ctx
->Transform
.DepthClamp
);
7387 case GL_MAX_DRAW_BUFFERS_ARB
:
7388 params
[0] = (GLint64
)(ctx
->Const
.MaxDrawBuffers
);
7390 case GL_DRAW_BUFFER0_ARB
:
7391 params
[0] = ENUM_TO_INT64(ctx
->DrawBuffer
->ColorDrawBuffer
[0]);
7393 case GL_DRAW_BUFFER1_ARB
:
7396 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
7397 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
7400 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[1];
7401 params
[0] = ENUM_TO_INT64(buffer
);
7404 case GL_DRAW_BUFFER2_ARB
:
7407 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
7408 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
7411 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[2];
7412 params
[0] = ENUM_TO_INT64(buffer
);
7415 case GL_DRAW_BUFFER3_ARB
:
7418 if (pname
- GL_DRAW_BUFFER0_ARB
>= ctx
->Const
.MaxDrawBuffers
) {
7419 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGet(GL_DRAW_BUFFERx_ARB)");
7422 buffer
= ctx
->DrawBuffer
->ColorDrawBuffer
[3];
7423 params
[0] = ENUM_TO_INT64(buffer
);
7426 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
:
7427 CHECK_EXT1(OES_read_format
, "GetInteger64v");
7428 params
[0] = (GLint64
)(_mesa_get_color_read_type(ctx
));
7430 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
:
7431 CHECK_EXT1(OES_read_format
, "GetInteger64v");
7432 params
[0] = (GLint64
)(_mesa_get_color_read_format(ctx
));
7434 case GL_NUM_FRAGMENT_REGISTERS_ATI
:
7435 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7436 params
[0] = (GLint64
)(6);
7438 case GL_NUM_FRAGMENT_CONSTANTS_ATI
:
7439 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7440 params
[0] = (GLint64
)(8);
7442 case GL_NUM_PASSES_ATI
:
7443 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7444 params
[0] = (GLint64
)(2);
7446 case GL_NUM_INSTRUCTIONS_PER_PASS_ATI
:
7447 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7448 params
[0] = (GLint64
)(8);
7450 case GL_NUM_INSTRUCTIONS_TOTAL_ATI
:
7451 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7452 params
[0] = (GLint64
)(16);
7454 case GL_COLOR_ALPHA_PAIRING_ATI
:
7455 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7456 params
[0] = BOOLEAN_TO_INT64(GL_TRUE
);
7458 case GL_NUM_LOOPBACK_COMPONENTS_ATI
:
7459 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7460 params
[0] = (GLint64
)(3);
7462 case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI
:
7463 CHECK_EXT1(ATI_fragment_shader
, "GetInteger64v");
7464 params
[0] = (GLint64
)(3);
7466 case GL_STENCIL_BACK_FUNC
:
7467 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.Function
[1]);
7469 case GL_STENCIL_BACK_VALUE_MASK
:
7470 params
[0] = (GLint64
)(ctx
->Stencil
.ValueMask
[1]);
7472 case GL_STENCIL_BACK_WRITEMASK
:
7473 params
[0] = (GLint64
)(ctx
->Stencil
.WriteMask
[1]);
7475 case GL_STENCIL_BACK_REF
:
7476 params
[0] = (GLint64
)(ctx
->Stencil
.Ref
[1]);
7478 case GL_STENCIL_BACK_FAIL
:
7479 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.FailFunc
[1]);
7481 case GL_STENCIL_BACK_PASS_DEPTH_FAIL
:
7482 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.ZFailFunc
[1]);
7484 case GL_STENCIL_BACK_PASS_DEPTH_PASS
:
7485 params
[0] = ENUM_TO_INT64(ctx
->Stencil
.ZPassFunc
[1]);
7487 case GL_FRAMEBUFFER_BINDING_EXT
:
7488 CHECK_EXT1(EXT_framebuffer_object
, "GetInteger64v");
7489 params
[0] = (GLint64
)(ctx
->DrawBuffer
->Name
);
7491 case GL_RENDERBUFFER_BINDING_EXT
:
7492 CHECK_EXT1(EXT_framebuffer_object
, "GetInteger64v");
7493 params
[0] = (GLint64
)(ctx
->CurrentRenderbuffer
? ctx
->CurrentRenderbuffer
->Name
: 0);
7495 case GL_MAX_COLOR_ATTACHMENTS_EXT
:
7496 CHECK_EXT1(EXT_framebuffer_object
, "GetInteger64v");
7497 params
[0] = (GLint64
)(ctx
->Const
.MaxColorAttachments
);
7499 case GL_MAX_RENDERBUFFER_SIZE_EXT
:
7500 CHECK_EXT1(EXT_framebuffer_object
, "GetInteger64v");
7501 params
[0] = (GLint64
)(ctx
->Const
.MaxRenderbufferSize
);
7503 case GL_READ_FRAMEBUFFER_BINDING_EXT
:
7504 CHECK_EXT1(EXT_framebuffer_blit
, "GetInteger64v");
7505 params
[0] = (GLint64
)(ctx
->ReadBuffer
->Name
);
7507 case GL_PROVOKING_VERTEX_EXT
:
7508 CHECK_EXT1(EXT_provoking_vertex
, "GetInteger64v");
7509 params
[0] = BOOLEAN_TO_INT64(ctx
->Light
.ProvokingVertex
);
7511 case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT
:
7512 CHECK_EXT1(EXT_provoking_vertex
, "GetInteger64v");
7513 params
[0] = BOOLEAN_TO_INT64(ctx
->Const
.QuadsFollowProvokingVertexConvention
);
7515 case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
:
7516 CHECK_EXT1(ARB_fragment_shader
, "GetInteger64v");
7517 params
[0] = (GLint64
)(ctx
->Const
.FragmentProgram
.MaxUniformComponents
);
7519 case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
:
7520 CHECK_EXT1(ARB_fragment_shader
, "GetInteger64v");
7521 params
[0] = ENUM_TO_INT64(ctx
->Hint
.FragmentShaderDerivative
);
7523 case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
:
7524 CHECK_EXT1(ARB_vertex_shader
, "GetInteger64v");
7525 params
[0] = (GLint64
)(ctx
->Const
.VertexProgram
.MaxUniformComponents
);
7527 case GL_MAX_VARYING_FLOATS_ARB
:
7528 CHECK_EXT1(ARB_vertex_shader
, "GetInteger64v");
7529 params
[0] = (GLint64
)(ctx
->Const
.MaxVarying
* 4);
7531 case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
:
7532 CHECK_EXT1(ARB_vertex_shader
, "GetInteger64v");
7533 params
[0] = (GLint64
)(ctx
->Const
.MaxVertexTextureImageUnits
);
7535 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
:
7536 CHECK_EXT1(ARB_vertex_shader
, "GetInteger64v");
7537 params
[0] = (GLint64
)(ctx
->Const
.MaxCombinedTextureImageUnits
);
7539 case GL_CURRENT_PROGRAM
:
7540 CHECK_EXT1(ARB_shader_objects
, "GetInteger64v");
7541 params
[0] = (GLint64
)(ctx
->Shader
.CurrentProgram
? ctx
->Shader
.CurrentProgram
->Name
: 0);
7543 case GL_MAX_SAMPLES
:
7544 CHECK_EXT1(ARB_framebuffer_object
, "GetInteger64v");
7545 params
[0] = (GLint64
)(ctx
->Const
.MaxSamples
);
7547 case GL_VERTEX_ARRAY_BINDING_APPLE
:
7548 CHECK_EXT1(APPLE_vertex_array_object
, "GetInteger64v");
7549 params
[0] = (GLint64
)(ctx
->Array
.ArrayObj
->Name
);
7551 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
7552 CHECK_EXT1(ARB_seamless_cube_map
, "GetInteger64v");
7553 params
[0] = BOOLEAN_TO_INT64(ctx
->Texture
.CubeMapSeamless
);
7555 case GL_MAX_SERVER_WAIT_TIMEOUT
:
7556 CHECK_EXT1(ARB_sync
, "GetInteger64v");
7557 params
[0] = ctx
->Const
.MaxServerWaitTimeout
;
7559 case GL_NUM_EXTENSIONS
:
7560 params
[0] = (GLint64
)(_mesa_get_extension_count(ctx
));
7562 case GL_MAJOR_VERSION
:
7563 params
[0] = (GLint64
)(ctx
->VersionMajor
);
7565 case GL_MINOR_VERSION
:
7566 params
[0] = (GLint64
)(ctx
->VersionMinor
);
7568 case GL_CONTEXT_FLAGS
:
7569 params
[0] = (GLint64
)(ctx
->Const
.ContextFlags
);
7572 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetInteger64v(pname=0x%x)", pname
);
7575 #endif /* FEATURE_ARB_sync */
7579 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
7581 const GLfloat magic
= -1234.5F
;
7588 /* Init temp array to magic numbers so we can figure out how many values
7589 * are returned by the GetFloatv() call.
7591 for (i
= 0; i
< 16; i
++)
7594 _mesa_GetFloatv(pname
, values
);
7596 for (i
= 0; i
< 16 && values
[i
] != magic
; i
++)
7597 params
[i
] = (GLdouble
) values
[i
];
7601 _mesa_GetBooleanIndexedv( GLenum pname
, GLuint index
, GLboolean
*params
)
7603 GET_CURRENT_CONTEXT(ctx
);
7604 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7610 _mesa_update_state(ctx
);
7614 CHECK_EXT1(EXT_draw_buffers2
, "GetBooleanIndexedv");
7615 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7616 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetBooleanIndexedv(index=%u), index", pname
);
7618 params
[0] = INT_TO_BOOLEAN(((ctx
->Color
.BlendEnabled
>> index
) & 1));
7620 case GL_COLOR_WRITEMASK
:
7621 CHECK_EXT1(EXT_draw_buffers2
, "GetBooleanIndexedv");
7622 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7623 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetBooleanIndexedv(index=%u), index", pname
);
7625 params
[0] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[index
][RCOMP
] ? 1 : 0);
7626 params
[1] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[index
][GCOMP
] ? 1 : 0);
7627 params
[2] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[index
][BCOMP
] ? 1 : 0);
7628 params
[3] = INT_TO_BOOLEAN(ctx
->Color
.ColorMask
[index
][ACOMP
] ? 1 : 0);
7631 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanIndexedv(pname=0x%x)", pname
);
7636 _mesa_GetIntegerIndexedv( GLenum pname
, GLuint index
, GLint
*params
)
7638 GET_CURRENT_CONTEXT(ctx
);
7639 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7645 _mesa_update_state(ctx
);
7649 CHECK_EXT1(EXT_draw_buffers2
, "GetIntegerIndexedv");
7650 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7651 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetIntegerIndexedv(index=%u), index", pname
);
7653 params
[0] = ((ctx
->Color
.BlendEnabled
>> index
) & 1);
7655 case GL_COLOR_WRITEMASK
:
7656 CHECK_EXT1(EXT_draw_buffers2
, "GetIntegerIndexedv");
7657 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7658 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetIntegerIndexedv(index=%u), index", pname
);
7660 params
[0] = ctx
->Color
.ColorMask
[index
][RCOMP
] ? 1 : 0;
7661 params
[1] = ctx
->Color
.ColorMask
[index
][GCOMP
] ? 1 : 0;
7662 params
[2] = ctx
->Color
.ColorMask
[index
][BCOMP
] ? 1 : 0;
7663 params
[3] = ctx
->Color
.ColorMask
[index
][ACOMP
] ? 1 : 0;
7666 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerIndexedv(pname=0x%x)", pname
);
7670 #if FEATURE_ARB_sync
7672 _mesa_GetInteger64Indexedv( GLenum pname
, GLuint index
, GLint64
*params
)
7674 GET_CURRENT_CONTEXT(ctx
);
7675 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7681 _mesa_update_state(ctx
);
7685 CHECK_EXT1(EXT_draw_buffers2
, "GetInteger64Indexedv");
7686 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7687 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetInteger64Indexedv(index=%u), index", pname
);
7689 params
[0] = (GLint64
)(((ctx
->Color
.BlendEnabled
>> index
) & 1));
7691 case GL_COLOR_WRITEMASK
:
7692 CHECK_EXT1(EXT_draw_buffers2
, "GetInteger64Indexedv");
7693 if (index
>= ctx
->Const
.MaxDrawBuffers
) {
7694 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetInteger64Indexedv(index=%u), index", pname
);
7696 params
[0] = (GLint64
)(ctx
->Color
.ColorMask
[index
][RCOMP
] ? 1 : 0);
7697 params
[1] = (GLint64
)(ctx
->Color
.ColorMask
[index
][GCOMP
] ? 1 : 0);
7698 params
[2] = (GLint64
)(ctx
->Color
.ColorMask
[index
][BCOMP
] ? 1 : 0);
7699 params
[3] = (GLint64
)(ctx
->Color
.ColorMask
[index
][ACOMP
] ? 1 : 0);
7702 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetInteger64Indexedv(pname=0x%x)", pname
);
7705 #endif /* FEATURE_ARB_sync */