get.c revision cdc920a0
17117f1b4Smrg
27117f1b4Smrg/***
37117f1b4Smrg ***  NOTE!!!  DO NOT EDIT THIS FILE!!!  IT IS GENERATED BY get_gen.py
47117f1b4Smrg ***/
57117f1b4Smrg
67117f1b4Smrg#include "glheader.h"
77117f1b4Smrg#include "context.h"
87117f1b4Smrg#include "enable.h"
97117f1b4Smrg#include "extensions.h"
107117f1b4Smrg#include "get.h"
117117f1b4Smrg#include "macros.h"
127117f1b4Smrg#include "mtypes.h"
137117f1b4Smrg#include "state.h"
147117f1b4Smrg#include "texcompress.h"
154a49301eSmrg#include "framebuffer.h"
167117f1b4Smrg
177117f1b4Smrg
187117f1b4Smrg#define FLOAT_TO_BOOLEAN(X)   ( (X) ? GL_TRUE : GL_FALSE )
197117f1b4Smrg
207117f1b4Smrg#define INT_TO_BOOLEAN(I)     ( (I) ? GL_TRUE : GL_FALSE )
217117f1b4Smrg
224a49301eSmrg#define INT64_TO_BOOLEAN(I)   ( (I) ? GL_TRUE : GL_FALSE )
234a49301eSmrg#define INT64_TO_INT(I)       ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) )
244a49301eSmrg
257117f1b4Smrg#define BOOLEAN_TO_INT(B)     ( (GLint) (B) )
264a49301eSmrg#define BOOLEAN_TO_INT64(B)   ( (GLint64) (B) )
277117f1b4Smrg#define BOOLEAN_TO_FLOAT(B)   ( (B) ? 1.0F : 0.0F )
287117f1b4Smrg
294a49301eSmrg#define ENUM_TO_INT64(E)      ( (GLint64) (E) )
304a49301eSmrg
317117f1b4Smrg
327117f1b4Smrg/*
337117f1b4Smrg * Check if named extension is enabled, if not generate error and return.
347117f1b4Smrg */
357117f1b4Smrg#define CHECK_EXT1(EXT1, FUNC)                                         \
367117f1b4Smrg   if (!ctx->Extensions.EXT1) {                                        \
377117f1b4Smrg      _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname);  \
387117f1b4Smrg      return;                                                          \
397117f1b4Smrg   }
407117f1b4Smrg
417117f1b4Smrg/*
427117f1b4Smrg * Check if either of two extensions is enabled.
437117f1b4Smrg */
447117f1b4Smrg#define CHECK_EXT2(EXT1, EXT2, FUNC)                                   \
457117f1b4Smrg   if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) {               \
467117f1b4Smrg      _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname);  \
477117f1b4Smrg      return;                                                          \
487117f1b4Smrg   }
497117f1b4Smrg
507117f1b4Smrg/*
517117f1b4Smrg * Check if either of three extensions is enabled.
527117f1b4Smrg */
537117f1b4Smrg#define CHECK_EXT3(EXT1, EXT2, EXT3, FUNC)                             \
547117f1b4Smrg   if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 &&               \
557117f1b4Smrg       !ctx->Extensions.EXT3) {                                        \
567117f1b4Smrg      _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname);  \
577117f1b4Smrg      return;                                                          \
587117f1b4Smrg   }
597117f1b4Smrg
607117f1b4Smrg/*
617117f1b4Smrg * Check if either of four extensions is enabled.
627117f1b4Smrg */
637117f1b4Smrg#define CHECK_EXT4(EXT1, EXT2, EXT3, EXT4, FUNC)                       \
647117f1b4Smrg   if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2 &&               \
657117f1b4Smrg       !ctx->Extensions.EXT3 && !ctx->Extensions.EXT4) {               \
667117f1b4Smrg      _mesa_error(ctx, GL_INVALID_ENUM, FUNC "(0x%x)", (int) pname);  \
677117f1b4Smrg      return;                                                          \
687117f1b4Smrg   }
697117f1b4Smrg
707117f1b4Smrg
717117f1b4Smrgvoid GLAPIENTRY
727117f1b4Smrg_mesa_GetBooleanv( GLenum pname, GLboolean *params )
737117f1b4Smrg{
747117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
757117f1b4Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
767117f1b4Smrg
777117f1b4Smrg   if (!params)
787117f1b4Smrg      return;
797117f1b4Smrg
807117f1b4Smrg   if (ctx->NewState)
817117f1b4Smrg      _mesa_update_state(ctx);
827117f1b4Smrg
837117f1b4Smrg   if (ctx->Driver.GetBooleanv &&
847117f1b4Smrg       ctx->Driver.GetBooleanv(ctx, pname, params))
857117f1b4Smrg      return;
867117f1b4Smrg
877117f1b4Smrg   switch (pname) {
887117f1b4Smrg      case GL_ACCUM_RED_BITS:
897117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumRedBits);
907117f1b4Smrg         break;
917117f1b4Smrg      case GL_ACCUM_GREEN_BITS:
927117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumGreenBits);
937117f1b4Smrg         break;
947117f1b4Smrg      case GL_ACCUM_BLUE_BITS:
957117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumBlueBits);
967117f1b4Smrg         break;
977117f1b4Smrg      case GL_ACCUM_ALPHA_BITS:
987117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumAlphaBits);
997117f1b4Smrg         break;
1007117f1b4Smrg      case GL_ACCUM_CLEAR_VALUE:
1017117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[0]);
1027117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[1]);
1037117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[2]);
1047117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[3]);
1057117f1b4Smrg         break;
1067117f1b4Smrg      case GL_ALPHA_BIAS:
1077117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaBias);
1087117f1b4Smrg         break;
1097117f1b4Smrg      case GL_ALPHA_BITS:
1107117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.alphaBits);
1117117f1b4Smrg         break;
1127117f1b4Smrg      case GL_ALPHA_SCALE:
1137117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaScale);
1147117f1b4Smrg         break;
1157117f1b4Smrg      case GL_ALPHA_TEST:
1167117f1b4Smrg         params[0] = ctx->Color.AlphaEnabled;
1177117f1b4Smrg         break;
1187117f1b4Smrg      case GL_ALPHA_TEST_FUNC:
1197117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.AlphaFunc);
1207117f1b4Smrg         break;
1217117f1b4Smrg      case GL_ALPHA_TEST_REF:
1227117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Color.AlphaRef);
1237117f1b4Smrg         break;
1247117f1b4Smrg      case GL_ATTRIB_STACK_DEPTH:
1257117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->AttribStackDepth);
1267117f1b4Smrg         break;
1277117f1b4Smrg      case GL_AUTO_NORMAL:
1287117f1b4Smrg         params[0] = ctx->Eval.AutoNormal;
1297117f1b4Smrg         break;
1307117f1b4Smrg      case GL_AUX_BUFFERS:
1317117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.numAuxBuffers);
1327117f1b4Smrg         break;
1337117f1b4Smrg      case GL_BLEND:
134cdc920a0Smrg         params[0] = (ctx->Color.BlendEnabled & 1);
1357117f1b4Smrg         break;
1367117f1b4Smrg      case GL_BLEND_DST:
1377117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB);
1387117f1b4Smrg         break;
1397117f1b4Smrg      case GL_BLEND_SRC:
1407117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB);
1417117f1b4Smrg         break;
1427117f1b4Smrg      case GL_BLEND_SRC_RGB_EXT:
1437117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcRGB);
1447117f1b4Smrg         break;
1457117f1b4Smrg      case GL_BLEND_DST_RGB_EXT:
1467117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB);
1477117f1b4Smrg         break;
1487117f1b4Smrg      case GL_BLEND_SRC_ALPHA_EXT:
1497117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendSrcA);
1507117f1b4Smrg         break;
1517117f1b4Smrg      case GL_BLEND_DST_ALPHA_EXT:
1527117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstA);
1537117f1b4Smrg         break;
1547117f1b4Smrg      case GL_BLEND_EQUATION:
1557117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationRGB );
1567117f1b4Smrg         break;
1577117f1b4Smrg      case GL_BLEND_EQUATION_ALPHA_EXT:
1587117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendEquationA );
1597117f1b4Smrg         break;
1607117f1b4Smrg      case GL_BLEND_COLOR_EXT:
1617117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[0]);
1627117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[1]);
1637117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[2]);
1647117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Color.BlendColor[3]);
1657117f1b4Smrg         break;
1667117f1b4Smrg      case GL_BLUE_BIAS:
1677117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueBias);
1687117f1b4Smrg         break;
1697117f1b4Smrg      case GL_BLUE_BITS:
1707117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.blueBits);
1717117f1b4Smrg         break;
1727117f1b4Smrg      case GL_BLUE_SCALE:
1737117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueScale);
1747117f1b4Smrg         break;
1757117f1b4Smrg      case GL_CLIENT_ATTRIB_STACK_DEPTH:
1767117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->ClientAttribStackDepth);
1777117f1b4Smrg         break;
1787117f1b4Smrg      case GL_CLIP_PLANE0:
1797117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 0) & 1;
1807117f1b4Smrg         break;
1817117f1b4Smrg      case GL_CLIP_PLANE1:
1827117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 1) & 1;
1837117f1b4Smrg         break;
1847117f1b4Smrg      case GL_CLIP_PLANE2:
1857117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 2) & 1;
1867117f1b4Smrg         break;
1877117f1b4Smrg      case GL_CLIP_PLANE3:
1887117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 3) & 1;
1897117f1b4Smrg         break;
1907117f1b4Smrg      case GL_CLIP_PLANE4:
1917117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 4) & 1;
1927117f1b4Smrg         break;
1937117f1b4Smrg      case GL_CLIP_PLANE5:
1947117f1b4Smrg         params[0] = (ctx->Transform.ClipPlanesEnabled >> 5) & 1;
1957117f1b4Smrg         break;
1967117f1b4Smrg      case GL_COLOR_CLEAR_VALUE:
1977117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[0]);
1987117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[1]);
1997117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[2]);
2007117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Color.ClearColor[3]);
2017117f1b4Smrg         break;
2027117f1b4Smrg      case GL_COLOR_MATERIAL:
2037117f1b4Smrg         params[0] = ctx->Light.ColorMaterialEnabled;
2047117f1b4Smrg         break;
2057117f1b4Smrg      case GL_COLOR_MATERIAL_FACE:
2067117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialFace);
2077117f1b4Smrg         break;
2087117f1b4Smrg      case GL_COLOR_MATERIAL_PARAMETER:
2097117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Light.ColorMaterialMode);
2107117f1b4Smrg         break;
2117117f1b4Smrg      case GL_COLOR_WRITEMASK:
212cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->Color.ColorMask[0][RCOMP] ? 1 : 0);
213cdc920a0Smrg         params[1] = INT_TO_BOOLEAN(ctx->Color.ColorMask[0][GCOMP] ? 1 : 0);
214cdc920a0Smrg         params[2] = INT_TO_BOOLEAN(ctx->Color.ColorMask[0][BCOMP] ? 1 : 0);
215cdc920a0Smrg         params[3] = INT_TO_BOOLEAN(ctx->Color.ColorMask[0][ACOMP] ? 1 : 0);
2167117f1b4Smrg         break;
2177117f1b4Smrg      case GL_CULL_FACE:
2187117f1b4Smrg         params[0] = ctx->Polygon.CullFlag;
2197117f1b4Smrg         break;
2207117f1b4Smrg      case GL_CULL_FACE_MODE:
2217117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.CullFaceMode);
2227117f1b4Smrg         break;
2237117f1b4Smrg      case GL_CURRENT_COLOR:
2247117f1b4Smrg         {
2257117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
2267117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
2277117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
2287117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
2297117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
2307117f1b4Smrg         }
2317117f1b4Smrg         break;
2327117f1b4Smrg      case GL_CURRENT_INDEX:
2337117f1b4Smrg         {
2347117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
2357117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]);
2367117f1b4Smrg         }
2377117f1b4Smrg         break;
2387117f1b4Smrg      case GL_CURRENT_NORMAL:
2397117f1b4Smrg         {
2407117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
2417117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
2427117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
2437117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
2447117f1b4Smrg         }
2457117f1b4Smrg         break;
2467117f1b4Smrg      case GL_CURRENT_RASTER_COLOR:
2477117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[0]);
2487117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[1]);
2497117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[2]);
2507117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterColor[3]);
2517117f1b4Smrg         break;
2527117f1b4Smrg      case GL_CURRENT_RASTER_DISTANCE:
2537117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterDistance);
2547117f1b4Smrg         break;
2557117f1b4Smrg      case GL_CURRENT_RASTER_INDEX:
256cdc920a0Smrg         params[0] = FLOAT_TO_BOOLEAN(1.0);
2577117f1b4Smrg         break;
2587117f1b4Smrg      case GL_CURRENT_RASTER_POSITION:
2597117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[0]);
2607117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[1]);
2617117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[2]);
2627117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[3]);
2637117f1b4Smrg         break;
2647117f1b4Smrg      case GL_CURRENT_RASTER_SECONDARY_COLOR:
2657117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[0]);
2667117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[1]);
2677117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[2]);
2687117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterSecondaryColor[3]);
2697117f1b4Smrg         break;
2707117f1b4Smrg      case GL_CURRENT_RASTER_TEXTURE_COORDS:
2717117f1b4Smrg         {
272cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
273cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
274cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
275cdc920a0Smrg                        "glGet(raster tex coords, unit %u)", unit);
276cdc920a0Smrg            return;
277cdc920a0Smrg         }
278cdc920a0Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[unit][0]);
279cdc920a0Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[unit][1]);
280cdc920a0Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[unit][2]);
281cdc920a0Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.RasterTexCoords[unit][3]);
2827117f1b4Smrg         }
2837117f1b4Smrg         break;
2847117f1b4Smrg      case GL_CURRENT_RASTER_POSITION_VALID:
2857117f1b4Smrg         params[0] = ctx->Current.RasterPosValid;
2867117f1b4Smrg         break;
2877117f1b4Smrg      case GL_CURRENT_TEXTURE_COORDS:
2887117f1b4Smrg         {
289cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
290cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
291cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
292cdc920a0Smrg                        "glGet(current tex coords, unit %u)", unit);
293cdc920a0Smrg            return;
294cdc920a0Smrg         }
2954a49301eSmrg         FLUSH_CURRENT(ctx, 0);
296cdc920a0Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0]);
297cdc920a0Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1]);
298cdc920a0Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2]);
299cdc920a0Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3]);
3007117f1b4Smrg         }
3017117f1b4Smrg         break;
3027117f1b4Smrg      case GL_DEPTH_BIAS:
3037117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthBias);
3047117f1b4Smrg         break;
3057117f1b4Smrg      case GL_DEPTH_BITS:
3067117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.depthBits);
3077117f1b4Smrg         break;
3087117f1b4Smrg      case GL_DEPTH_CLEAR_VALUE:
309c1f859d4Smrg         params[0] = FLOAT_TO_BOOLEAN(((GLfloat) ctx->Depth.Clear));
3107117f1b4Smrg         break;
3117117f1b4Smrg      case GL_DEPTH_FUNC:
3127117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Depth.Func);
3137117f1b4Smrg         break;
3147117f1b4Smrg      case GL_DEPTH_RANGE:
3157117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Viewport.Near);
3167117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Viewport.Far);
3177117f1b4Smrg         break;
3187117f1b4Smrg      case GL_DEPTH_SCALE:
3197117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthScale);
3207117f1b4Smrg         break;
3217117f1b4Smrg      case GL_DEPTH_TEST:
3227117f1b4Smrg         params[0] = ctx->Depth.Test;
3237117f1b4Smrg         break;
3247117f1b4Smrg      case GL_DEPTH_WRITEMASK:
3257117f1b4Smrg         params[0] = ctx->Depth.Mask;
3267117f1b4Smrg         break;
3277117f1b4Smrg      case GL_DITHER:
3287117f1b4Smrg         params[0] = ctx->Color.DitherFlag;
3297117f1b4Smrg         break;
3307117f1b4Smrg      case GL_DOUBLEBUFFER:
3317117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.doubleBufferMode;
3327117f1b4Smrg         break;
3337117f1b4Smrg      case GL_DRAW_BUFFER:
3347117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]);
3357117f1b4Smrg         break;
3367117f1b4Smrg      case GL_EDGE_FLAG:
3377117f1b4Smrg         {
3387117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
3397117f1b4Smrg         params[0] = (ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0);
3407117f1b4Smrg         }
3417117f1b4Smrg         break;
3427117f1b4Smrg      case GL_FEEDBACK_BUFFER_SIZE:
3437117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Feedback.BufferSize);
3447117f1b4Smrg         break;
3457117f1b4Smrg      case GL_FEEDBACK_BUFFER_TYPE:
3467117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Feedback.Type);
3477117f1b4Smrg         break;
3487117f1b4Smrg      case GL_FOG:
3497117f1b4Smrg         params[0] = ctx->Fog.Enabled;
3507117f1b4Smrg         break;
3517117f1b4Smrg      case GL_FOG_COLOR:
3527117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[0]);
3537117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[1]);
3547117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[2]);
3557117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Fog.Color[3]);
3567117f1b4Smrg         break;
3577117f1b4Smrg      case GL_FOG_DENSITY:
3587117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Density);
3597117f1b4Smrg         break;
3607117f1b4Smrg      case GL_FOG_END:
3617117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.End);
3627117f1b4Smrg         break;
3637117f1b4Smrg      case GL_FOG_HINT:
3647117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.Fog);
3657117f1b4Smrg         break;
3667117f1b4Smrg      case GL_FOG_INDEX:
3677117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Index);
3687117f1b4Smrg         break;
3697117f1b4Smrg      case GL_FOG_MODE:
3707117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Fog.Mode);
3717117f1b4Smrg         break;
3727117f1b4Smrg      case GL_FOG_START:
3737117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Fog.Start);
3747117f1b4Smrg         break;
3757117f1b4Smrg      case GL_FRONT_FACE:
3767117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontFace);
3777117f1b4Smrg         break;
3787117f1b4Smrg      case GL_GREEN_BIAS:
3797117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenBias);
3807117f1b4Smrg         break;
3817117f1b4Smrg      case GL_GREEN_BITS:
3827117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.greenBits);
3837117f1b4Smrg         break;
3847117f1b4Smrg      case GL_GREEN_SCALE:
3857117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenScale);
3867117f1b4Smrg         break;
3877117f1b4Smrg      case GL_INDEX_BITS:
3887117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.indexBits);
3897117f1b4Smrg         break;
3907117f1b4Smrg      case GL_INDEX_CLEAR_VALUE:
3917117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Color.ClearIndex);
3927117f1b4Smrg         break;
3937117f1b4Smrg      case GL_INDEX_MODE:
394cdc920a0Smrg         params[0] = GL_FALSE;
3957117f1b4Smrg         break;
3967117f1b4Smrg      case GL_INDEX_OFFSET:
3977117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexOffset);
3987117f1b4Smrg         break;
3997117f1b4Smrg      case GL_INDEX_SHIFT:
4007117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexShift);
4017117f1b4Smrg         break;
4027117f1b4Smrg      case GL_INDEX_WRITEMASK:
4037117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Color.IndexMask);
4047117f1b4Smrg         break;
4057117f1b4Smrg      case GL_LIGHT0:
4067117f1b4Smrg         params[0] = ctx->Light.Light[0].Enabled;
4077117f1b4Smrg         break;
4087117f1b4Smrg      case GL_LIGHT1:
4097117f1b4Smrg         params[0] = ctx->Light.Light[1].Enabled;
4107117f1b4Smrg         break;
4117117f1b4Smrg      case GL_LIGHT2:
4127117f1b4Smrg         params[0] = ctx->Light.Light[2].Enabled;
4137117f1b4Smrg         break;
4147117f1b4Smrg      case GL_LIGHT3:
4157117f1b4Smrg         params[0] = ctx->Light.Light[3].Enabled;
4167117f1b4Smrg         break;
4177117f1b4Smrg      case GL_LIGHT4:
4187117f1b4Smrg         params[0] = ctx->Light.Light[4].Enabled;
4197117f1b4Smrg         break;
4207117f1b4Smrg      case GL_LIGHT5:
4217117f1b4Smrg         params[0] = ctx->Light.Light[5].Enabled;
4227117f1b4Smrg         break;
4237117f1b4Smrg      case GL_LIGHT6:
4247117f1b4Smrg         params[0] = ctx->Light.Light[6].Enabled;
4257117f1b4Smrg         break;
4267117f1b4Smrg      case GL_LIGHT7:
4277117f1b4Smrg         params[0] = ctx->Light.Light[7].Enabled;
4287117f1b4Smrg         break;
4297117f1b4Smrg      case GL_LIGHTING:
4307117f1b4Smrg         params[0] = ctx->Light.Enabled;
4317117f1b4Smrg         break;
4327117f1b4Smrg      case GL_LIGHT_MODEL_AMBIENT:
4337117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[0]);
4347117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[1]);
4357117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[2]);
4367117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Light.Model.Ambient[3]);
4377117f1b4Smrg         break;
4387117f1b4Smrg      case GL_LIGHT_MODEL_COLOR_CONTROL:
4397117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Light.Model.ColorControl);
4407117f1b4Smrg         break;
4417117f1b4Smrg      case GL_LIGHT_MODEL_LOCAL_VIEWER:
4427117f1b4Smrg         params[0] = ctx->Light.Model.LocalViewer;
4437117f1b4Smrg         break;
4447117f1b4Smrg      case GL_LIGHT_MODEL_TWO_SIDE:
4457117f1b4Smrg         params[0] = ctx->Light.Model.TwoSide;
4467117f1b4Smrg         break;
4477117f1b4Smrg      case GL_LINE_SMOOTH:
4487117f1b4Smrg         params[0] = ctx->Line.SmoothFlag;
4497117f1b4Smrg         break;
4507117f1b4Smrg      case GL_LINE_SMOOTH_HINT:
4517117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.LineSmooth);
4527117f1b4Smrg         break;
4537117f1b4Smrg      case GL_LINE_STIPPLE:
4547117f1b4Smrg         params[0] = ctx->Line.StippleFlag;
4557117f1b4Smrg         break;
4567117f1b4Smrg      case GL_LINE_STIPPLE_PATTERN:
4577117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Line.StipplePattern);
4587117f1b4Smrg         break;
4597117f1b4Smrg      case GL_LINE_STIPPLE_REPEAT:
4607117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Line.StippleFactor);
4617117f1b4Smrg         break;
4627117f1b4Smrg      case GL_LINE_WIDTH:
4637117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Line.Width);
4647117f1b4Smrg         break;
4657117f1b4Smrg      case GL_LINE_WIDTH_GRANULARITY:
4667117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.LineWidthGranularity);
4677117f1b4Smrg         break;
4687117f1b4Smrg      case GL_LINE_WIDTH_RANGE:
4697117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidthAA);
4707117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidthAA);
4717117f1b4Smrg         break;
4727117f1b4Smrg      case GL_ALIASED_LINE_WIDTH_RANGE:
4737117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinLineWidth);
4747117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxLineWidth);
4757117f1b4Smrg         break;
4767117f1b4Smrg      case GL_LIST_BASE:
4777117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->List.ListBase);
4787117f1b4Smrg         break;
4797117f1b4Smrg      case GL_LIST_INDEX:
4804a49301eSmrg         params[0] = INT_TO_BOOLEAN((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
4817117f1b4Smrg         break;
4827117f1b4Smrg      case GL_LIST_MODE:
4837117f1b4Smrg         {
4847117f1b4Smrg         GLenum mode;
4857117f1b4Smrg         if (!ctx->CompileFlag)
4867117f1b4Smrg            mode = 0;
4877117f1b4Smrg         else if (ctx->ExecuteFlag)
4887117f1b4Smrg            mode = GL_COMPILE_AND_EXECUTE;
4897117f1b4Smrg         else
4907117f1b4Smrg            mode = GL_COMPILE;
4917117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(mode);
4927117f1b4Smrg         }
4937117f1b4Smrg         break;
4947117f1b4Smrg      case GL_INDEX_LOGIC_OP:
4957117f1b4Smrg         params[0] = ctx->Color.IndexLogicOpEnabled;
4967117f1b4Smrg         break;
4977117f1b4Smrg      case GL_COLOR_LOGIC_OP:
4987117f1b4Smrg         params[0] = ctx->Color.ColorLogicOpEnabled;
4997117f1b4Smrg         break;
5007117f1b4Smrg      case GL_LOGIC_OP_MODE:
5017117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Color.LogicOp);
5027117f1b4Smrg         break;
5037117f1b4Smrg      case GL_MAP1_COLOR_4:
5047117f1b4Smrg         params[0] = ctx->Eval.Map1Color4;
5057117f1b4Smrg         break;
5067117f1b4Smrg      case GL_MAP1_GRID_DOMAIN:
5077117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u1);
5087117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid1u2);
5097117f1b4Smrg         break;
5107117f1b4Smrg      case GL_MAP1_GRID_SEGMENTS:
5117117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid1un);
5127117f1b4Smrg         break;
5137117f1b4Smrg      case GL_MAP1_INDEX:
5147117f1b4Smrg         params[0] = ctx->Eval.Map1Index;
5157117f1b4Smrg         break;
5167117f1b4Smrg      case GL_MAP1_NORMAL:
5177117f1b4Smrg         params[0] = ctx->Eval.Map1Normal;
5187117f1b4Smrg         break;
5197117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_1:
5207117f1b4Smrg         params[0] = ctx->Eval.Map1TextureCoord1;
5217117f1b4Smrg         break;
5227117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_2:
5237117f1b4Smrg         params[0] = ctx->Eval.Map1TextureCoord2;
5247117f1b4Smrg         break;
5257117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_3:
5267117f1b4Smrg         params[0] = ctx->Eval.Map1TextureCoord3;
5277117f1b4Smrg         break;
5287117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_4:
5297117f1b4Smrg         params[0] = ctx->Eval.Map1TextureCoord4;
5307117f1b4Smrg         break;
5317117f1b4Smrg      case GL_MAP1_VERTEX_3:
5327117f1b4Smrg         params[0] = ctx->Eval.Map1Vertex3;
5337117f1b4Smrg         break;
5347117f1b4Smrg      case GL_MAP1_VERTEX_4:
5357117f1b4Smrg         params[0] = ctx->Eval.Map1Vertex4;
5367117f1b4Smrg         break;
5377117f1b4Smrg      case GL_MAP2_COLOR_4:
5387117f1b4Smrg         params[0] = ctx->Eval.Map2Color4;
5397117f1b4Smrg         break;
5407117f1b4Smrg      case GL_MAP2_GRID_DOMAIN:
5417117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u1);
5427117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2u2);
5437117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v1);
5447117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Eval.MapGrid2v2);
5457117f1b4Smrg         break;
5467117f1b4Smrg      case GL_MAP2_GRID_SEGMENTS:
5477117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2un);
5487117f1b4Smrg         params[1] = INT_TO_BOOLEAN(ctx->Eval.MapGrid2vn);
5497117f1b4Smrg         break;
5507117f1b4Smrg      case GL_MAP2_INDEX:
5517117f1b4Smrg         params[0] = ctx->Eval.Map2Index;
5527117f1b4Smrg         break;
5537117f1b4Smrg      case GL_MAP2_NORMAL:
5547117f1b4Smrg         params[0] = ctx->Eval.Map2Normal;
5557117f1b4Smrg         break;
5567117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_1:
5577117f1b4Smrg         params[0] = ctx->Eval.Map2TextureCoord1;
5587117f1b4Smrg         break;
5597117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_2:
5607117f1b4Smrg         params[0] = ctx->Eval.Map2TextureCoord2;
5617117f1b4Smrg         break;
5627117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_3:
5637117f1b4Smrg         params[0] = ctx->Eval.Map2TextureCoord3;
5647117f1b4Smrg         break;
5657117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_4:
5667117f1b4Smrg         params[0] = ctx->Eval.Map2TextureCoord4;
5677117f1b4Smrg         break;
5687117f1b4Smrg      case GL_MAP2_VERTEX_3:
5697117f1b4Smrg         params[0] = ctx->Eval.Map2Vertex3;
5707117f1b4Smrg         break;
5717117f1b4Smrg      case GL_MAP2_VERTEX_4:
5727117f1b4Smrg         params[0] = ctx->Eval.Map2Vertex4;
5737117f1b4Smrg         break;
5747117f1b4Smrg      case GL_MAP_COLOR:
5757117f1b4Smrg         params[0] = ctx->Pixel.MapColorFlag;
5767117f1b4Smrg         break;
5777117f1b4Smrg      case GL_MAP_STENCIL:
5787117f1b4Smrg         params[0] = ctx->Pixel.MapStencilFlag;
5797117f1b4Smrg         break;
5807117f1b4Smrg      case GL_MATRIX_MODE:
5817117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Transform.MatrixMode);
5827117f1b4Smrg         break;
5837117f1b4Smrg      case GL_MAX_ATTRIB_STACK_DEPTH:
5847117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_ATTRIB_STACK_DEPTH);
5857117f1b4Smrg         break;
5867117f1b4Smrg      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
5877117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_CLIENT_ATTRIB_STACK_DEPTH);
5887117f1b4Smrg         break;
5897117f1b4Smrg      case GL_MAX_CLIP_PLANES:
5907117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxClipPlanes);
5917117f1b4Smrg         break;
5927117f1b4Smrg      case GL_MAX_ELEMENTS_VERTICES:
5937117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize);
5947117f1b4Smrg         break;
5957117f1b4Smrg      case GL_MAX_ELEMENTS_INDICES:
5967117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxArrayLockSize);
5977117f1b4Smrg         break;
5987117f1b4Smrg      case GL_MAX_EVAL_ORDER:
5997117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_EVAL_ORDER);
6007117f1b4Smrg         break;
6017117f1b4Smrg      case GL_MAX_LIGHTS:
6027117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxLights);
6037117f1b4Smrg         break;
6047117f1b4Smrg      case GL_MAX_LIST_NESTING:
6057117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_LIST_NESTING);
6067117f1b4Smrg         break;
6077117f1b4Smrg      case GL_MAX_MODELVIEW_STACK_DEPTH:
6087117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_MODELVIEW_STACK_DEPTH);
6097117f1b4Smrg         break;
6107117f1b4Smrg      case GL_MAX_NAME_STACK_DEPTH:
6117117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_NAME_STACK_DEPTH);
6127117f1b4Smrg         break;
6137117f1b4Smrg      case GL_MAX_PIXEL_MAP_TABLE:
6147117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_PIXEL_MAP_TABLE);
6157117f1b4Smrg         break;
6167117f1b4Smrg      case GL_MAX_PROJECTION_STACK_DEPTH:
6177117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_PROJECTION_STACK_DEPTH);
6187117f1b4Smrg         break;
6197117f1b4Smrg      case GL_MAX_TEXTURE_SIZE:
6207117f1b4Smrg         params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.MaxTextureLevels - 1));
6217117f1b4Smrg         break;
6227117f1b4Smrg      case GL_MAX_3D_TEXTURE_SIZE:
6237117f1b4Smrg         params[0] = INT_TO_BOOLEAN(1 << (ctx->Const.Max3DTextureLevels - 1));
6247117f1b4Smrg         break;
6257117f1b4Smrg      case GL_MAX_TEXTURE_STACK_DEPTH:
6267117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_TEXTURE_STACK_DEPTH);
6277117f1b4Smrg         break;
6287117f1b4Smrg      case GL_MAX_VIEWPORT_DIMS:
6297117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxViewportWidth);
6307117f1b4Smrg         params[1] = INT_TO_BOOLEAN(ctx->Const.MaxViewportHeight);
6317117f1b4Smrg         break;
6327117f1b4Smrg      case GL_MODELVIEW_MATRIX:
6337117f1b4Smrg         {
6347117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
6357117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
6367117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[1]);
6377117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[2]);
6387117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[3]);
6397117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[4]);
6407117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
6417117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[6]);
6427117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[7]);
6437117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[8]);
6447117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[9]);
6457117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
6467117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[11]);
6477117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[12]);
6487117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[13]);
6497117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[14]);
6507117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
6517117f1b4Smrg         }
6527117f1b4Smrg         break;
6537117f1b4Smrg      case GL_MODELVIEW_STACK_DEPTH:
6547117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->ModelviewMatrixStack.Depth + 1);
6557117f1b4Smrg         break;
6567117f1b4Smrg      case GL_NAME_STACK_DEPTH:
6577117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Select.NameStackDepth);
6587117f1b4Smrg         break;
6597117f1b4Smrg      case GL_NORMALIZE:
6607117f1b4Smrg         params[0] = ctx->Transform.Normalize;
6617117f1b4Smrg         break;
6627117f1b4Smrg      case GL_PACK_ALIGNMENT:
6637117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.Alignment);
6647117f1b4Smrg         break;
6657117f1b4Smrg      case GL_PACK_LSB_FIRST:
6667117f1b4Smrg         params[0] = ctx->Pack.LsbFirst;
6677117f1b4Smrg         break;
6687117f1b4Smrg      case GL_PACK_ROW_LENGTH:
6697117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.RowLength);
6707117f1b4Smrg         break;
6717117f1b4Smrg      case GL_PACK_SKIP_PIXELS:
6727117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipPixels);
6737117f1b4Smrg         break;
6747117f1b4Smrg      case GL_PACK_SKIP_ROWS:
6757117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipRows);
6767117f1b4Smrg         break;
6777117f1b4Smrg      case GL_PACK_SWAP_BYTES:
6787117f1b4Smrg         params[0] = ctx->Pack.SwapBytes;
6797117f1b4Smrg         break;
6807117f1b4Smrg      case GL_PACK_SKIP_IMAGES_EXT:
6817117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.SkipImages);
6827117f1b4Smrg         break;
6837117f1b4Smrg      case GL_PACK_IMAGE_HEIGHT_EXT:
6847117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.ImageHeight);
6857117f1b4Smrg         break;
6867117f1b4Smrg      case GL_PACK_INVERT_MESA:
6877117f1b4Smrg         params[0] = ctx->Pack.Invert;
6887117f1b4Smrg         break;
6897117f1b4Smrg      case GL_PERSPECTIVE_CORRECTION_HINT:
6907117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PerspectiveCorrection);
6917117f1b4Smrg         break;
6927117f1b4Smrg      case GL_PIXEL_MAP_A_TO_A_SIZE:
6937117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.AtoA.Size);
6947117f1b4Smrg         break;
6957117f1b4Smrg      case GL_PIXEL_MAP_B_TO_B_SIZE:
6967117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.BtoB.Size);
6977117f1b4Smrg         break;
6987117f1b4Smrg      case GL_PIXEL_MAP_G_TO_G_SIZE:
6997117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.GtoG.Size);
7007117f1b4Smrg         break;
7017117f1b4Smrg      case GL_PIXEL_MAP_I_TO_A_SIZE:
7027117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoA.Size);
7037117f1b4Smrg         break;
7047117f1b4Smrg      case GL_PIXEL_MAP_I_TO_B_SIZE:
7057117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoB.Size);
7067117f1b4Smrg         break;
7077117f1b4Smrg      case GL_PIXEL_MAP_I_TO_G_SIZE:
7087117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoG.Size);
7097117f1b4Smrg         break;
7107117f1b4Smrg      case GL_PIXEL_MAP_I_TO_I_SIZE:
7117117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoI.Size);
7127117f1b4Smrg         break;
7137117f1b4Smrg      case GL_PIXEL_MAP_I_TO_R_SIZE:
7147117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.ItoR.Size);
7157117f1b4Smrg         break;
7167117f1b4Smrg      case GL_PIXEL_MAP_R_TO_R_SIZE:
7177117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.RtoR.Size);
7187117f1b4Smrg         break;
7197117f1b4Smrg      case GL_PIXEL_MAP_S_TO_S_SIZE:
7207117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->PixelMaps.StoS.Size);
7217117f1b4Smrg         break;
7227117f1b4Smrg      case GL_POINT_SIZE:
7237117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Size);
7247117f1b4Smrg         break;
7257117f1b4Smrg      case GL_POINT_SIZE_GRANULARITY:
7267117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.PointSizeGranularity);
7277117f1b4Smrg         break;
7287117f1b4Smrg      case GL_POINT_SIZE_RANGE:
7297117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSizeAA);
7307117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSizeAA);
7317117f1b4Smrg         break;
7327117f1b4Smrg      case GL_ALIASED_POINT_SIZE_RANGE:
7337117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MinPointSize);
7347117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Const.MaxPointSize);
7357117f1b4Smrg         break;
7367117f1b4Smrg      case GL_POINT_SMOOTH:
7377117f1b4Smrg         params[0] = ctx->Point.SmoothFlag;
7387117f1b4Smrg         break;
7397117f1b4Smrg      case GL_POINT_SMOOTH_HINT:
7407117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PointSmooth);
7417117f1b4Smrg         break;
7427117f1b4Smrg      case GL_POINT_SIZE_MIN_EXT:
7437117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MinSize);
7447117f1b4Smrg         break;
7457117f1b4Smrg      case GL_POINT_SIZE_MAX_EXT:
7467117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Point.MaxSize);
7477117f1b4Smrg         break;
7487117f1b4Smrg      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
7497117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Threshold);
7507117f1b4Smrg         break;
7517117f1b4Smrg      case GL_DISTANCE_ATTENUATION_EXT:
7527117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Point.Params[0]);
7537117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Point.Params[1]);
7547117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Point.Params[2]);
7557117f1b4Smrg         break;
7567117f1b4Smrg      case GL_POLYGON_MODE:
7577117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Polygon.FrontMode);
7587117f1b4Smrg         params[1] = ENUM_TO_BOOLEAN(ctx->Polygon.BackMode);
7597117f1b4Smrg         break;
7607117f1b4Smrg      case GL_POLYGON_OFFSET_BIAS_EXT:
7617117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits);
7627117f1b4Smrg         break;
7637117f1b4Smrg      case GL_POLYGON_OFFSET_FACTOR:
7647117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetFactor );
7657117f1b4Smrg         break;
7667117f1b4Smrg      case GL_POLYGON_OFFSET_UNITS:
7677117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Polygon.OffsetUnits );
7687117f1b4Smrg         break;
769c1f859d4Smrg      case GL_POLYGON_OFFSET_POINT:
770c1f859d4Smrg         params[0] = ctx->Polygon.OffsetPoint;
771c1f859d4Smrg         break;
772c1f859d4Smrg      case GL_POLYGON_OFFSET_LINE:
773c1f859d4Smrg         params[0] = ctx->Polygon.OffsetLine;
774c1f859d4Smrg         break;
775c1f859d4Smrg      case GL_POLYGON_OFFSET_FILL:
776c1f859d4Smrg         params[0] = ctx->Polygon.OffsetFill;
777c1f859d4Smrg         break;
7787117f1b4Smrg      case GL_POLYGON_SMOOTH:
7797117f1b4Smrg         params[0] = ctx->Polygon.SmoothFlag;
7807117f1b4Smrg         break;
7817117f1b4Smrg      case GL_POLYGON_SMOOTH_HINT:
7827117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.PolygonSmooth);
7837117f1b4Smrg         break;
7847117f1b4Smrg      case GL_POLYGON_STIPPLE:
7857117f1b4Smrg         params[0] = ctx->Polygon.StippleFlag;
7867117f1b4Smrg         break;
7877117f1b4Smrg      case GL_PROJECTION_MATRIX:
7887117f1b4Smrg         {
7897117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
7907117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
7917117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[1]);
7927117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[2]);
7937117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[3]);
7947117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[4]);
7957117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
7967117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[6]);
7977117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[7]);
7987117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[8]);
7997117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[9]);
8007117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
8017117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[11]);
8027117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[12]);
8037117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[13]);
8047117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[14]);
8057117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
8067117f1b4Smrg         }
8077117f1b4Smrg         break;
8087117f1b4Smrg      case GL_PROJECTION_STACK_DEPTH:
8097117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->ProjectionMatrixStack.Depth + 1);
8107117f1b4Smrg         break;
8117117f1b4Smrg      case GL_READ_BUFFER:
8127117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->ReadBuffer->ColorReadBuffer);
8137117f1b4Smrg         break;
8147117f1b4Smrg      case GL_RED_BIAS:
8157117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias);
8167117f1b4Smrg         break;
8177117f1b4Smrg      case GL_RED_BITS:
8187117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.redBits);
8197117f1b4Smrg         break;
8207117f1b4Smrg      case GL_RED_SCALE:
8217117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale);
8227117f1b4Smrg         break;
8237117f1b4Smrg      case GL_RENDER_MODE:
8247117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->RenderMode);
8257117f1b4Smrg         break;
8267117f1b4Smrg      case GL_RESCALE_NORMAL:
8277117f1b4Smrg         params[0] = ctx->Transform.RescaleNormals;
8287117f1b4Smrg         break;
8297117f1b4Smrg      case GL_RGBA_MODE:
830cdc920a0Smrg         params[0] = GL_TRUE;
8317117f1b4Smrg         break;
8327117f1b4Smrg      case GL_SCISSOR_BOX:
8337117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Scissor.X);
8347117f1b4Smrg         params[1] = INT_TO_BOOLEAN(ctx->Scissor.Y);
8357117f1b4Smrg         params[2] = INT_TO_BOOLEAN(ctx->Scissor.Width);
8367117f1b4Smrg         params[3] = INT_TO_BOOLEAN(ctx->Scissor.Height);
8377117f1b4Smrg         break;
8387117f1b4Smrg      case GL_SCISSOR_TEST:
8397117f1b4Smrg         params[0] = ctx->Scissor.Enabled;
8407117f1b4Smrg         break;
8417117f1b4Smrg      case GL_SELECTION_BUFFER_SIZE:
8427117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Select.BufferSize);
8437117f1b4Smrg         break;
8447117f1b4Smrg      case GL_SHADE_MODEL:
8457117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Light.ShadeModel);
8467117f1b4Smrg         break;
8477117f1b4Smrg      case GL_SHARED_TEXTURE_PALETTE_EXT:
8487117f1b4Smrg         params[0] = ctx->Texture.SharedPalette;
8497117f1b4Smrg         break;
8507117f1b4Smrg      case GL_STENCIL_BITS:
8517117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.stencilBits);
8527117f1b4Smrg         break;
8537117f1b4Smrg      case GL_STENCIL_CLEAR_VALUE:
8547117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.Clear);
8557117f1b4Smrg         break;
8567117f1b4Smrg      case GL_STENCIL_FAIL:
8577117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
8587117f1b4Smrg         break;
8597117f1b4Smrg      case GL_STENCIL_FUNC:
8607117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
8617117f1b4Smrg         break;
8627117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_FAIL:
8637117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
8647117f1b4Smrg         break;
8657117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_PASS:
8667117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
8677117f1b4Smrg         break;
8687117f1b4Smrg      case GL_STENCIL_REF:
8697117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
8707117f1b4Smrg         break;
8717117f1b4Smrg      case GL_STENCIL_TEST:
8727117f1b4Smrg         params[0] = ctx->Stencil.Enabled;
8737117f1b4Smrg         break;
8747117f1b4Smrg      case GL_STENCIL_VALUE_MASK:
8757117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
8767117f1b4Smrg         break;
8777117f1b4Smrg      case GL_STENCIL_WRITEMASK:
8787117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
8797117f1b4Smrg         break;
8807117f1b4Smrg      case GL_STEREO:
8817117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.stereoMode;
8827117f1b4Smrg         break;
8837117f1b4Smrg      case GL_SUBPIXEL_BITS:
8847117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.SubPixelBits);
8857117f1b4Smrg         break;
8867117f1b4Smrg      case GL_TEXTURE_1D:
8877117f1b4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_1D);
8887117f1b4Smrg         break;
8897117f1b4Smrg      case GL_TEXTURE_2D:
8907117f1b4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_2D);
8917117f1b4Smrg         break;
8927117f1b4Smrg      case GL_TEXTURE_3D:
8937117f1b4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_3D);
8947117f1b4Smrg         break;
895c1f859d4Smrg      case GL_TEXTURE_1D_ARRAY_EXT:
896c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetBooleanv");
897c1f859d4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT);
898c1f859d4Smrg         break;
899c1f859d4Smrg      case GL_TEXTURE_2D_ARRAY_EXT:
900c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetBooleanv");
901c1f859d4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT);
902c1f859d4Smrg         break;
9037117f1b4Smrg      case GL_TEXTURE_BINDING_1D:
904c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name);
9057117f1b4Smrg         break;
9067117f1b4Smrg      case GL_TEXTURE_BINDING_2D:
907c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name);
9087117f1b4Smrg         break;
9097117f1b4Smrg      case GL_TEXTURE_BINDING_3D:
910c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name);
9117117f1b4Smrg         break;
912c1f859d4Smrg      case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
913c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetBooleanv");
914c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name);
9157117f1b4Smrg         break;
916c1f859d4Smrg      case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
917c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetBooleanv");
918c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name);
9197117f1b4Smrg         break;
9207117f1b4Smrg      case GL_TEXTURE_GEN_S:
9217117f1b4Smrg         params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0);
9227117f1b4Smrg         break;
9237117f1b4Smrg      case GL_TEXTURE_GEN_T:
9247117f1b4Smrg         params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0);
9257117f1b4Smrg         break;
9267117f1b4Smrg      case GL_TEXTURE_GEN_R:
9277117f1b4Smrg         params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0);
9287117f1b4Smrg         break;
9297117f1b4Smrg      case GL_TEXTURE_GEN_Q:
9307117f1b4Smrg         params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0);
9317117f1b4Smrg         break;
9327117f1b4Smrg      case GL_TEXTURE_MATRIX:
9337117f1b4Smrg         {
934cdc920a0Smrg         const GLfloat *matrix;
935cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
936cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
937cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION, "glGet(texture matrix %u)",
938cdc920a0Smrg                        unit);
939cdc920a0Smrg            return;
940cdc920a0Smrg         }
941cdc920a0Smrg         matrix = ctx->TextureMatrixStack[unit].Top->m;
9427117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
9437117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[1]);
9447117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[2]);
9457117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[3]);
9467117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[4]);
9477117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
9487117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[6]);
9497117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[7]);
9507117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[8]);
9517117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[9]);
9527117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
9537117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[11]);
9547117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[12]);
9557117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[13]);
9567117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[14]);
9577117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
9587117f1b4Smrg         }
9597117f1b4Smrg         break;
9607117f1b4Smrg      case GL_TEXTURE_STACK_DEPTH:
961cdc920a0Smrg         {
962cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
963cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
964cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
965cdc920a0Smrg                        "glGet(texture stack depth, unit %u)", unit);
966cdc920a0Smrg            return;
967cdc920a0Smrg         }
968cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->TextureMatrixStack[unit].Depth + 1);
969cdc920a0Smrg         }
9707117f1b4Smrg         break;
9717117f1b4Smrg      case GL_UNPACK_ALIGNMENT:
9727117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.Alignment);
9737117f1b4Smrg         break;
9747117f1b4Smrg      case GL_UNPACK_LSB_FIRST:
9757117f1b4Smrg         params[0] = ctx->Unpack.LsbFirst;
9767117f1b4Smrg         break;
9777117f1b4Smrg      case GL_UNPACK_ROW_LENGTH:
9787117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.RowLength);
9797117f1b4Smrg         break;
9807117f1b4Smrg      case GL_UNPACK_SKIP_PIXELS:
9817117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipPixels);
9827117f1b4Smrg         break;
9837117f1b4Smrg      case GL_UNPACK_SKIP_ROWS:
9847117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipRows);
9857117f1b4Smrg         break;
9867117f1b4Smrg      case GL_UNPACK_SWAP_BYTES:
9877117f1b4Smrg         params[0] = ctx->Unpack.SwapBytes;
9887117f1b4Smrg         break;
9897117f1b4Smrg      case GL_UNPACK_SKIP_IMAGES_EXT:
9907117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.SkipImages);
9917117f1b4Smrg         break;
9927117f1b4Smrg      case GL_UNPACK_IMAGE_HEIGHT_EXT:
9937117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.ImageHeight);
9947117f1b4Smrg         break;
9957117f1b4Smrg      case GL_UNPACK_CLIENT_STORAGE_APPLE:
9967117f1b4Smrg         params[0] = ctx->Unpack.ClientStorage;
9977117f1b4Smrg         break;
9987117f1b4Smrg      case GL_VIEWPORT:
9997117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Viewport.X);
10007117f1b4Smrg         params[1] = INT_TO_BOOLEAN(ctx->Viewport.Y);
10017117f1b4Smrg         params[2] = INT_TO_BOOLEAN(ctx->Viewport.Width);
10027117f1b4Smrg         params[3] = INT_TO_BOOLEAN(ctx->Viewport.Height);
10037117f1b4Smrg         break;
10047117f1b4Smrg      case GL_ZOOM_X:
10057117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomX);
10067117f1b4Smrg         break;
10077117f1b4Smrg      case GL_ZOOM_Y:
10087117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.ZoomY);
10097117f1b4Smrg         break;
10107117f1b4Smrg      case GL_VERTEX_ARRAY:
10117117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Vertex.Enabled;
10127117f1b4Smrg         break;
10137117f1b4Smrg      case GL_VERTEX_ARRAY_SIZE:
10147117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Size);
10157117f1b4Smrg         break;
10167117f1b4Smrg      case GL_VERTEX_ARRAY_TYPE:
10177117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Type);
10187117f1b4Smrg         break;
10197117f1b4Smrg      case GL_VERTEX_ARRAY_STRIDE:
10207117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.Stride);
10217117f1b4Smrg         break;
10227117f1b4Smrg      case GL_VERTEX_ARRAY_COUNT_EXT:
10237117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10247117f1b4Smrg         break;
10257117f1b4Smrg      case GL_NORMAL_ARRAY:
10267117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Enabled);
10277117f1b4Smrg         break;
10287117f1b4Smrg      case GL_NORMAL_ARRAY_TYPE:
10297117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Type);
10307117f1b4Smrg         break;
10317117f1b4Smrg      case GL_NORMAL_ARRAY_STRIDE:
10327117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.Stride);
10337117f1b4Smrg         break;
10347117f1b4Smrg      case GL_NORMAL_ARRAY_COUNT_EXT:
10357117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10367117f1b4Smrg         break;
10377117f1b4Smrg      case GL_COLOR_ARRAY:
10387117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Color.Enabled;
10397117f1b4Smrg         break;
10407117f1b4Smrg      case GL_COLOR_ARRAY_SIZE:
10417117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Size);
10427117f1b4Smrg         break;
10437117f1b4Smrg      case GL_COLOR_ARRAY_TYPE:
10447117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Type);
10457117f1b4Smrg         break;
10467117f1b4Smrg      case GL_COLOR_ARRAY_STRIDE:
10477117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.Stride);
10487117f1b4Smrg         break;
10497117f1b4Smrg      case GL_COLOR_ARRAY_COUNT_EXT:
10507117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10517117f1b4Smrg         break;
10527117f1b4Smrg      case GL_INDEX_ARRAY:
10537117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Index.Enabled;
10547117f1b4Smrg         break;
10557117f1b4Smrg      case GL_INDEX_ARRAY_TYPE:
10567117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Type);
10577117f1b4Smrg         break;
10587117f1b4Smrg      case GL_INDEX_ARRAY_STRIDE:
10597117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.Stride);
10607117f1b4Smrg         break;
10617117f1b4Smrg      case GL_INDEX_ARRAY_COUNT_EXT:
10627117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10637117f1b4Smrg         break;
10647117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY:
10657117f1b4Smrg         params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled;
10667117f1b4Smrg         break;
10677117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_SIZE:
10687117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size);
10697117f1b4Smrg         break;
10707117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_TYPE:
10717117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type);
10727117f1b4Smrg         break;
10737117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_STRIDE:
10747117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride);
10757117f1b4Smrg         break;
10767117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
10777117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10787117f1b4Smrg         break;
10797117f1b4Smrg      case GL_EDGE_FLAG_ARRAY:
10807117f1b4Smrg         params[0] = ctx->Array.ArrayObj->EdgeFlag.Enabled;
10817117f1b4Smrg         break;
10827117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_STRIDE:
10837117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.Stride);
10847117f1b4Smrg         break;
10857117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
10867117f1b4Smrg         params[0] = INT_TO_BOOLEAN(0);
10877117f1b4Smrg         break;
10887117f1b4Smrg      case GL_MAX_TEXTURE_UNITS_ARB:
10897117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetBooleanv");
10907117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureUnits);
10917117f1b4Smrg         break;
10927117f1b4Smrg      case GL_ACTIVE_TEXTURE_ARB:
10937117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetBooleanv");
10947117f1b4Smrg         params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
10957117f1b4Smrg         break;
10967117f1b4Smrg      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
10977117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetBooleanv");
10987117f1b4Smrg         params[0] = INT_TO_BOOLEAN(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
10997117f1b4Smrg         break;
11007117f1b4Smrg      case GL_TEXTURE_CUBE_MAP_ARB:
11017117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv");
11027117f1b4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
11037117f1b4Smrg         break;
11047117f1b4Smrg      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
11057117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv");
1106c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name);
11077117f1b4Smrg         break;
11087117f1b4Smrg      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
11097117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv");
11107117f1b4Smrg         params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
11117117f1b4Smrg         break;
11127117f1b4Smrg      case GL_TEXTURE_COMPRESSION_HINT_ARB:
11137117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression);
11147117f1b4Smrg         break;
11157117f1b4Smrg      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
11167117f1b4Smrg         params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
11177117f1b4Smrg         break;
11187117f1b4Smrg      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
11197117f1b4Smrg         {
11207117f1b4Smrg         GLint formats[100];
11217117f1b4Smrg         GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
11227117f1b4Smrg         ASSERT(n <= 100);
11237117f1b4Smrg         for (i = 0; i < n; i++)
1124c1f859d4Smrg            params[i] = ENUM_TO_BOOLEAN(formats[i]);
11257117f1b4Smrg         }
11267117f1b4Smrg         break;
11277117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
11287117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv");
11297117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.LockFirst);
11307117f1b4Smrg         break;
11317117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
11327117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetBooleanv");
11337117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.LockCount);
11347117f1b4Smrg         break;
11357117f1b4Smrg      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
11367117f1b4Smrg         {
11377117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
11387117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
11397117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[4]);
11407117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[8]);
11417117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[12]);
11427117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[1]);
11437117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
11447117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[9]);
11457117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[13]);
11467117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[2]);
11477117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[6]);
11487117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
11497117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[14]);
11507117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[3]);
11517117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[7]);
11527117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[11]);
11537117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
11547117f1b4Smrg         }
11557117f1b4Smrg         break;
11567117f1b4Smrg      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
11577117f1b4Smrg         {
11587117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
11597117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
11607117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[4]);
11617117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[8]);
11627117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[12]);
11637117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[1]);
11647117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
11657117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[9]);
11667117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[13]);
11677117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[2]);
11687117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[6]);
11697117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
11707117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[14]);
11717117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[3]);
11727117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[7]);
11737117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[11]);
11747117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
11757117f1b4Smrg         }
11767117f1b4Smrg         break;
11777117f1b4Smrg      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
11787117f1b4Smrg         {
11797117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
11807117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
11817117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[4]);
11827117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[8]);
11837117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[12]);
11847117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[1]);
11857117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
11867117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[9]);
11877117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[13]);
11887117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[2]);
11897117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[6]);
11907117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
11917117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[14]);
11927117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[3]);
11937117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[7]);
11947117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[11]);
11957117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
11967117f1b4Smrg         }
11977117f1b4Smrg         break;
11987117f1b4Smrg      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
11997117f1b4Smrg         {
12007117f1b4Smrg         const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;
12017117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
12027117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[4]);
12037117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[8]);
12047117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[12]);
12057117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[1]);
12067117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
12077117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[9]);
12087117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[13]);
12097117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[2]);
12107117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[6]);
12117117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
12127117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[14]);
12137117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[3]);
12147117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[7]);
12157117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[11]);
12167117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
12177117f1b4Smrg         }
12187117f1b4Smrg         break;
12197117f1b4Smrg      case GL_COLOR_MATRIX_SGI:
12207117f1b4Smrg         {
12217117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
12227117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
12237117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[1]);
12247117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[2]);
12257117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[3]);
12267117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[4]);
12277117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
12287117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[6]);
12297117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[7]);
12307117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[8]);
12317117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[9]);
12327117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
12337117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[11]);
12347117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[12]);
12357117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[13]);
12367117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[14]);
12377117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
12387117f1b4Smrg         }
12397117f1b4Smrg         break;
12407117f1b4Smrg      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
12417117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->ColorMatrixStack.Depth + 1);
12427117f1b4Smrg         break;
12437117f1b4Smrg      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
12447117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_COLOR_STACK_DEPTH);
12457117f1b4Smrg         break;
12467117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
12477117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[0]);
12487117f1b4Smrg         break;
12497117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
12507117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[1]);
12517117f1b4Smrg         break;
12527117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
12537117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[2]);
12547117f1b4Smrg         break;
12557117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
12567117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixScale[3]);
12577117f1b4Smrg         break;
12587117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
12597117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[0]);
12607117f1b4Smrg         break;
12617117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
12627117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[1]);
12637117f1b4Smrg         break;
12647117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
12657117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[2]);
12667117f1b4Smrg         break;
12677117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
12687117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostColorMatrixBias[3]);
12697117f1b4Smrg         break;
12707117f1b4Smrg      case GL_CONVOLUTION_1D_EXT:
12717117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12727117f1b4Smrg         params[0] = ctx->Pixel.Convolution1DEnabled;
12737117f1b4Smrg         break;
12747117f1b4Smrg      case GL_CONVOLUTION_2D_EXT:
12757117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12767117f1b4Smrg         params[0] = ctx->Pixel.Convolution2DEnabled;
12777117f1b4Smrg         break;
12787117f1b4Smrg      case GL_SEPARABLE_2D_EXT:
12797117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12807117f1b4Smrg         params[0] = ctx->Pixel.Separable2DEnabled;
12817117f1b4Smrg         break;
12827117f1b4Smrg      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
12837117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12847117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[0]);
12857117f1b4Smrg         break;
12867117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
12877117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12887117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[1]);
12897117f1b4Smrg         break;
12907117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
12917117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12927117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[2]);
12937117f1b4Smrg         break;
12947117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
12957117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
12967117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionScale[3]);
12977117f1b4Smrg         break;
12987117f1b4Smrg      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
12997117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
13007117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[0]);
13017117f1b4Smrg         break;
13027117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
13037117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
13047117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[1]);
13057117f1b4Smrg         break;
13067117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
13077117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
13087117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[2]);
13097117f1b4Smrg         break;
13107117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
13117117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetBooleanv");
13127117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.PostConvolutionBias[3]);
13137117f1b4Smrg         break;
13147117f1b4Smrg      case GL_HISTOGRAM:
13157117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetBooleanv");
13167117f1b4Smrg         params[0] = ctx->Pixel.HistogramEnabled;
13177117f1b4Smrg         break;
13187117f1b4Smrg      case GL_MINMAX:
13197117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetBooleanv");
13207117f1b4Smrg         params[0] = ctx->Pixel.MinMaxEnabled;
13217117f1b4Smrg         break;
13227117f1b4Smrg      case GL_COLOR_TABLE_SGI:
13237117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetBooleanv");
13247117f1b4Smrg         params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION];
13257117f1b4Smrg         break;
13267117f1b4Smrg      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
13277117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetBooleanv");
13287117f1b4Smrg         params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION];
13297117f1b4Smrg         break;
13307117f1b4Smrg      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
13317117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetBooleanv");
13327117f1b4Smrg         params[0] = ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX];
13337117f1b4Smrg         break;
13347117f1b4Smrg      case GL_TEXTURE_COLOR_TABLE_SGI:
13357117f1b4Smrg         CHECK_EXT1(SGI_texture_color_table, "GetBooleanv");
13367117f1b4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled;
13377117f1b4Smrg         break;
13387117f1b4Smrg      case GL_COLOR_SUM_EXT:
13397117f1b4Smrg         CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetBooleanv");
13407117f1b4Smrg         params[0] = ctx->Fog.ColorSumEnabled;
13417117f1b4Smrg         break;
13427117f1b4Smrg      case GL_CURRENT_SECONDARY_COLOR_EXT:
13437117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
13447117f1b4Smrg         {
13457117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
13467117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
13477117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
13487117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
13497117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]);
13507117f1b4Smrg         }
13517117f1b4Smrg         break;
13527117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_EXT:
13537117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
13547117f1b4Smrg         params[0] = ctx->Array.ArrayObj->SecondaryColor.Enabled;
13557117f1b4Smrg         break;
13567117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
13577117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
13587117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Type);
13597117f1b4Smrg         break;
13607117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
13617117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
13627117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Stride);
13637117f1b4Smrg         break;
13647117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
13657117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetBooleanv");
13667117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.Size);
13677117f1b4Smrg         break;
13687117f1b4Smrg      case GL_CURRENT_FOG_COORDINATE_EXT:
13697117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetBooleanv");
13707117f1b4Smrg         {
13717117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
13727117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
13737117f1b4Smrg         }
13747117f1b4Smrg         break;
13757117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_EXT:
13767117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetBooleanv");
13777117f1b4Smrg         params[0] = ctx->Array.ArrayObj->FogCoord.Enabled;
13787117f1b4Smrg         break;
13797117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
13807117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetBooleanv");
13817117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Type);
13827117f1b4Smrg         break;
13837117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
13847117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetBooleanv");
13857117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.Stride);
13867117f1b4Smrg         break;
13877117f1b4Smrg      case GL_FOG_COORDINATE_SOURCE_EXT:
13887117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetBooleanv");
13897117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Fog.FogCoordinateSource);
13907117f1b4Smrg         break;
13917117f1b4Smrg      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
13927117f1b4Smrg         CHECK_EXT1(EXT_texture_lod_bias, "GetBooleanv");
13937117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureLodBias);
13947117f1b4Smrg         break;
13957117f1b4Smrg      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
13967117f1b4Smrg         CHECK_EXT1(EXT_texture_filter_anisotropic, "GetBooleanv");
13977117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy);
13987117f1b4Smrg         break;
13997117f1b4Smrg      case GL_MULTISAMPLE_ARB:
14007117f1b4Smrg         params[0] = ctx->Multisample.Enabled;
14017117f1b4Smrg         break;
14027117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
14037117f1b4Smrg         params[0] = ctx->Multisample.SampleAlphaToCoverage;
14047117f1b4Smrg         break;
14057117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
14067117f1b4Smrg         params[0] = ctx->Multisample.SampleAlphaToOne;
14077117f1b4Smrg         break;
14087117f1b4Smrg      case GL_SAMPLE_COVERAGE_ARB:
14097117f1b4Smrg         params[0] = ctx->Multisample.SampleCoverage;
14107117f1b4Smrg         break;
14117117f1b4Smrg      case GL_SAMPLE_COVERAGE_VALUE_ARB:
14127117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue);
14137117f1b4Smrg         break;
14147117f1b4Smrg      case GL_SAMPLE_COVERAGE_INVERT_ARB:
14157117f1b4Smrg         params[0] = ctx->Multisample.SampleCoverageInvert;
14167117f1b4Smrg         break;
14177117f1b4Smrg      case GL_SAMPLE_BUFFERS_ARB:
14187117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers);
14197117f1b4Smrg         break;
14207117f1b4Smrg      case GL_SAMPLES_ARB:
14217117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples);
14227117f1b4Smrg         break;
14237117f1b4Smrg      case GL_RASTER_POSITION_UNCLIPPED_IBM:
14247117f1b4Smrg         CHECK_EXT1(IBM_rasterpos_clip, "GetBooleanv");
14257117f1b4Smrg         params[0] = ctx->Transform.RasterPositionUnclipped;
14267117f1b4Smrg         break;
14277117f1b4Smrg      case GL_POINT_SPRITE_NV:
14287117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv");
14297117f1b4Smrg         params[0] = ctx->Point.PointSprite;
14307117f1b4Smrg         break;
14317117f1b4Smrg      case GL_POINT_SPRITE_R_MODE_NV:
14327117f1b4Smrg         CHECK_EXT1(NV_point_sprite, "GetBooleanv");
14337117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteRMode);
14347117f1b4Smrg         break;
14357117f1b4Smrg      case GL_POINT_SPRITE_COORD_ORIGIN:
14367117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetBooleanv");
14377117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Point.SpriteOrigin);
14387117f1b4Smrg         break;
14397117f1b4Smrg      case GL_GENERATE_MIPMAP_HINT_SGIS:
14407117f1b4Smrg         CHECK_EXT1(SGIS_generate_mipmap, "GetBooleanv");
14417117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.GenerateMipmap);
14427117f1b4Smrg         break;
14437117f1b4Smrg      case GL_VERTEX_PROGRAM_BINDING_NV:
14447117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14457117f1b4Smrg         params[0] = INT_TO_BOOLEAN((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0));
14467117f1b4Smrg         break;
14477117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY0_NV:
14487117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14497117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[0].Enabled;
14507117f1b4Smrg         break;
14517117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY1_NV:
14527117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14537117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[1].Enabled;
14547117f1b4Smrg         break;
14557117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY2_NV:
14567117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14577117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[2].Enabled;
14587117f1b4Smrg         break;
14597117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY3_NV:
14607117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14617117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[3].Enabled;
14627117f1b4Smrg         break;
14637117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY4_NV:
14647117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14657117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[4].Enabled;
14667117f1b4Smrg         break;
14677117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY5_NV:
14687117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14697117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[5].Enabled;
14707117f1b4Smrg         break;
14717117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY6_NV:
14727117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14737117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[6].Enabled;
14747117f1b4Smrg         break;
14757117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY7_NV:
14767117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14777117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[7].Enabled;
14787117f1b4Smrg         break;
14797117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY8_NV:
14807117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14817117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[8].Enabled;
14827117f1b4Smrg         break;
14837117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY9_NV:
14847117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14857117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[9].Enabled;
14867117f1b4Smrg         break;
14877117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY10_NV:
14887117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14897117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[10].Enabled;
14907117f1b4Smrg         break;
14917117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY11_NV:
14927117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14937117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[11].Enabled;
14947117f1b4Smrg         break;
14957117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY12_NV:
14967117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
14977117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[12].Enabled;
14987117f1b4Smrg         break;
14997117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY13_NV:
15007117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15017117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[13].Enabled;
15027117f1b4Smrg         break;
15037117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY14_NV:
15047117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15057117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[14].Enabled;
15067117f1b4Smrg         break;
15077117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY15_NV:
15087117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15097117f1b4Smrg         params[0] = ctx->Array.ArrayObj->VertexAttrib[15].Enabled;
15107117f1b4Smrg         break;
15117117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
15127117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15137117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[0];
15147117f1b4Smrg         break;
15157117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
15167117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15177117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[1];
15187117f1b4Smrg         break;
15197117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
15207117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15217117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[2];
15227117f1b4Smrg         break;
15237117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
15247117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15257117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[3];
15267117f1b4Smrg         break;
15277117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
15287117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15297117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[4];
15307117f1b4Smrg         break;
15317117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
15327117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15337117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[5];
15347117f1b4Smrg         break;
15357117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
15367117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15377117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[6];
15387117f1b4Smrg         break;
15397117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
15407117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15417117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[7];
15427117f1b4Smrg         break;
15437117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
15447117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15457117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[8];
15467117f1b4Smrg         break;
15477117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
15487117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15497117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[9];
15507117f1b4Smrg         break;
15517117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
15527117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15537117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[10];
15547117f1b4Smrg         break;
15557117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
15567117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15577117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[11];
15587117f1b4Smrg         break;
15597117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
15607117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15617117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[12];
15627117f1b4Smrg         break;
15637117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
15647117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15657117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[13];
15667117f1b4Smrg         break;
15677117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
15687117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15697117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[14];
15707117f1b4Smrg         break;
15717117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
15727117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetBooleanv");
15737117f1b4Smrg         params[0] = ctx->Eval.Map1Attrib[15];
15747117f1b4Smrg         break;
15757117f1b4Smrg      case GL_FRAGMENT_PROGRAM_NV:
15767117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetBooleanv");
15777117f1b4Smrg         params[0] = ctx->FragmentProgram.Enabled;
15787117f1b4Smrg         break;
15797117f1b4Smrg      case GL_FRAGMENT_PROGRAM_BINDING_NV:
15807117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetBooleanv");
15817117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0);
15827117f1b4Smrg         break;
15837117f1b4Smrg      case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
15847117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetBooleanv");
15857117f1b4Smrg         params[0] = INT_TO_BOOLEAN(MAX_NV_FRAGMENT_PROGRAM_PARAMS);
15867117f1b4Smrg         break;
15877117f1b4Smrg      case GL_TEXTURE_RECTANGLE_NV:
15887117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetBooleanv");
15897117f1b4Smrg         params[0] = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
15907117f1b4Smrg         break;
15917117f1b4Smrg      case GL_TEXTURE_BINDING_RECTANGLE_NV:
15927117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetBooleanv");
1593c1f859d4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name);
15947117f1b4Smrg         break;
15957117f1b4Smrg      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
15967117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetBooleanv");
15977117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureRectSize);
15987117f1b4Smrg         break;
15997117f1b4Smrg      case GL_STENCIL_TEST_TWO_SIDE_EXT:
16007117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv");
16017117f1b4Smrg         params[0] = ctx->Stencil.TestTwoSide;
16027117f1b4Smrg         break;
16037117f1b4Smrg      case GL_ACTIVE_STENCIL_FACE_EXT:
16047117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetBooleanv");
16057117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
16067117f1b4Smrg         break;
16077117f1b4Smrg      case GL_MAX_SHININESS_NV:
16087117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetBooleanv");
16097117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxShininess);
16107117f1b4Smrg         break;
16117117f1b4Smrg      case GL_MAX_SPOT_EXPONENT_NV:
16127117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetBooleanv");
16137117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent);
16147117f1b4Smrg         break;
16157117f1b4Smrg      case GL_ARRAY_BUFFER_BINDING_ARB:
16167117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name);
16177117f1b4Smrg         break;
16187117f1b4Smrg      case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
16197117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
16207117f1b4Smrg         break;
16217117f1b4Smrg      case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
16227117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name);
16237117f1b4Smrg         break;
16247117f1b4Smrg      case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
16257117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name);
16267117f1b4Smrg         break;
16277117f1b4Smrg      case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
16287117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name);
16297117f1b4Smrg         break;
16307117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
16317117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
16327117f1b4Smrg         break;
16337117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
16347117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
16357117f1b4Smrg         break;
16367117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
16377117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
16387117f1b4Smrg         break;
16397117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
16407117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
16417117f1b4Smrg         break;
16427117f1b4Smrg      case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
16437117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name);
16447117f1b4Smrg         break;
16457117f1b4Smrg      case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
16467117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv");
16477117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Pack.BufferObj->Name);
16487117f1b4Smrg         break;
16497117f1b4Smrg      case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
16507117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv");
16517117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Unpack.BufferObj->Name);
16527117f1b4Smrg         break;
16537117f1b4Smrg      case GL_VERTEX_PROGRAM_ARB:
16547117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv");
16557117f1b4Smrg         params[0] = ctx->VertexProgram.Enabled;
16567117f1b4Smrg         break;
16577117f1b4Smrg      case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
16587117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv");
16597117f1b4Smrg         params[0] = ctx->VertexProgram.PointSizeEnabled;
16607117f1b4Smrg         break;
16617117f1b4Smrg      case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
16627117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv");
16637117f1b4Smrg         params[0] = ctx->VertexProgram.TwoSideEnabled;
16647117f1b4Smrg         break;
16657117f1b4Smrg      case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
16667117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv");
16677117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrixStackDepth);
16687117f1b4Smrg         break;
16697117f1b4Smrg      case GL_MAX_PROGRAM_MATRICES_ARB:
16707117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv");
16717117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrices);
16727117f1b4Smrg         break;
16737117f1b4Smrg      case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
16747117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv");
16757117f1b4Smrg         params[0] = ctx->CurrentStack->Depth + 1;
16767117f1b4Smrg         break;
16777117f1b4Smrg      case GL_CURRENT_MATRIX_ARB:
16787117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetBooleanv");
16797117f1b4Smrg         {
16807117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
16817117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
16827117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[1]);
16837117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[2]);
16847117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[3]);
16857117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[4]);
16867117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
16877117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[6]);
16887117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[7]);
16897117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[8]);
16907117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[9]);
16917117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
16927117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[11]);
16937117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[12]);
16947117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[13]);
16957117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[14]);
16967117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
16977117f1b4Smrg         }
16987117f1b4Smrg         break;
16997117f1b4Smrg      case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
17007117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetBooleanv");
17017117f1b4Smrg         {
17027117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
17037117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(matrix[0]);
17047117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(matrix[4]);
17057117f1b4Smrg         params[2] = FLOAT_TO_BOOLEAN(matrix[8]);
17067117f1b4Smrg         params[3] = FLOAT_TO_BOOLEAN(matrix[12]);
17077117f1b4Smrg         params[4] = FLOAT_TO_BOOLEAN(matrix[1]);
17087117f1b4Smrg         params[5] = FLOAT_TO_BOOLEAN(matrix[5]);
17097117f1b4Smrg         params[6] = FLOAT_TO_BOOLEAN(matrix[9]);
17107117f1b4Smrg         params[7] = FLOAT_TO_BOOLEAN(matrix[13]);
17117117f1b4Smrg         params[8] = FLOAT_TO_BOOLEAN(matrix[2]);
17127117f1b4Smrg         params[9] = FLOAT_TO_BOOLEAN(matrix[6]);
17137117f1b4Smrg         params[10] = FLOAT_TO_BOOLEAN(matrix[10]);
17147117f1b4Smrg         params[11] = FLOAT_TO_BOOLEAN(matrix[14]);
17157117f1b4Smrg         params[12] = FLOAT_TO_BOOLEAN(matrix[3]);
17167117f1b4Smrg         params[13] = FLOAT_TO_BOOLEAN(matrix[7]);
17177117f1b4Smrg         params[14] = FLOAT_TO_BOOLEAN(matrix[11]);
17187117f1b4Smrg         params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
17197117f1b4Smrg         }
17207117f1b4Smrg         break;
17217117f1b4Smrg      case GL_MAX_VERTEX_ATTRIBS_ARB:
17227117f1b4Smrg         CHECK_EXT1(ARB_vertex_program, "GetBooleanv");
17237117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs);
17247117f1b4Smrg         break;
17257117f1b4Smrg      case GL_PROGRAM_ERROR_POSITION_ARB:
17267117f1b4Smrg         CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetBooleanv");
17277117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Program.ErrorPos);
17287117f1b4Smrg         break;
17297117f1b4Smrg      case GL_FRAGMENT_PROGRAM_ARB:
17307117f1b4Smrg         CHECK_EXT1(ARB_fragment_program, "GetBooleanv");
17317117f1b4Smrg         params[0] = ctx->FragmentProgram.Enabled;
17327117f1b4Smrg         break;
17337117f1b4Smrg      case GL_MAX_TEXTURE_COORDS_ARB:
17347117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv");
17357117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureCoordUnits);
17367117f1b4Smrg         break;
17377117f1b4Smrg      case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
17387117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv");
17397117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureImageUnits);
17407117f1b4Smrg         break;
17417117f1b4Smrg      case GL_DEPTH_BOUNDS_TEST_EXT:
17427117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv");
17437117f1b4Smrg         params[0] = ctx->Depth.BoundsTest;
17447117f1b4Smrg         break;
17457117f1b4Smrg      case GL_DEPTH_BOUNDS_EXT:
17467117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv");
17477117f1b4Smrg         params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin);
17487117f1b4Smrg         params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax);
17497117f1b4Smrg         break;
17504a49301eSmrg      case GL_DEPTH_CLAMP:
17514a49301eSmrg         CHECK_EXT1(ARB_depth_clamp, "GetBooleanv");
17524a49301eSmrg         params[0] = ctx->Transform.DepthClamp;
17537117f1b4Smrg         break;
17547117f1b4Smrg      case GL_MAX_DRAW_BUFFERS_ARB:
17557117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers);
17567117f1b4Smrg         break;
17577117f1b4Smrg      case GL_DRAW_BUFFER0_ARB:
17587117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]);
17597117f1b4Smrg         break;
17607117f1b4Smrg      case GL_DRAW_BUFFER1_ARB:
17617117f1b4Smrg         {
17627117f1b4Smrg         GLenum buffer;
17637117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
17647117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
17657117f1b4Smrg            return;
17667117f1b4Smrg         }
17677117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
17687117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(buffer);
17697117f1b4Smrg         }
17707117f1b4Smrg         break;
17717117f1b4Smrg      case GL_DRAW_BUFFER2_ARB:
17727117f1b4Smrg         {
17737117f1b4Smrg         GLenum buffer;
17747117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
17757117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
17767117f1b4Smrg            return;
17777117f1b4Smrg         }
17787117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
17797117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(buffer);
17807117f1b4Smrg         }
17817117f1b4Smrg         break;
17827117f1b4Smrg      case GL_DRAW_BUFFER3_ARB:
17837117f1b4Smrg         {
17847117f1b4Smrg         GLenum buffer;
17857117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
17867117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
17877117f1b4Smrg            return;
17887117f1b4Smrg         }
17897117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
17907117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(buffer);
17917117f1b4Smrg         }
17927117f1b4Smrg         break;
17937117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
17947117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetBooleanv");
17954a49301eSmrg         params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_type(ctx));
17967117f1b4Smrg         break;
17977117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
17987117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetBooleanv");
17994a49301eSmrg         params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_format(ctx));
18007117f1b4Smrg         break;
18017117f1b4Smrg      case GL_NUM_FRAGMENT_REGISTERS_ATI:
18027117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18037117f1b4Smrg         params[0] = INT_TO_BOOLEAN(6);
18047117f1b4Smrg         break;
18057117f1b4Smrg      case GL_NUM_FRAGMENT_CONSTANTS_ATI:
18067117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18077117f1b4Smrg         params[0] = INT_TO_BOOLEAN(8);
18087117f1b4Smrg         break;
18097117f1b4Smrg      case GL_NUM_PASSES_ATI:
18107117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18117117f1b4Smrg         params[0] = INT_TO_BOOLEAN(2);
18127117f1b4Smrg         break;
18137117f1b4Smrg      case GL_NUM_INSTRUCTIONS_PER_PASS_ATI:
18147117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18157117f1b4Smrg         params[0] = INT_TO_BOOLEAN(8);
18167117f1b4Smrg         break;
18177117f1b4Smrg      case GL_NUM_INSTRUCTIONS_TOTAL_ATI:
18187117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18197117f1b4Smrg         params[0] = INT_TO_BOOLEAN(16);
18207117f1b4Smrg         break;
18217117f1b4Smrg      case GL_COLOR_ALPHA_PAIRING_ATI:
18227117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18237117f1b4Smrg         params[0] = GL_TRUE;
18247117f1b4Smrg         break;
18257117f1b4Smrg      case GL_NUM_LOOPBACK_COMPONENTS_ATI:
18267117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18277117f1b4Smrg         params[0] = INT_TO_BOOLEAN(3);
18287117f1b4Smrg         break;
18297117f1b4Smrg      case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI:
18307117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetBooleanv");
18317117f1b4Smrg         params[0] = INT_TO_BOOLEAN(3);
18327117f1b4Smrg         break;
18337117f1b4Smrg      case GL_STENCIL_BACK_FUNC:
18347117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.Function[1]);
18357117f1b4Smrg         break;
18367117f1b4Smrg      case GL_STENCIL_BACK_VALUE_MASK:
18377117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.ValueMask[1]);
18387117f1b4Smrg         break;
18397117f1b4Smrg      case GL_STENCIL_BACK_WRITEMASK:
18407117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[1]);
18417117f1b4Smrg         break;
18427117f1b4Smrg      case GL_STENCIL_BACK_REF:
18437117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Stencil.Ref[1]);
18447117f1b4Smrg         break;
18457117f1b4Smrg      case GL_STENCIL_BACK_FAIL:
18467117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.FailFunc[1]);
18477117f1b4Smrg         break;
18487117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
18497117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZFailFunc[1]);
18507117f1b4Smrg         break;
18517117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_PASS:
18527117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Stencil.ZPassFunc[1]);
18537117f1b4Smrg         break;
18547117f1b4Smrg      case GL_FRAMEBUFFER_BINDING_EXT:
18557117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv");
18567117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Name);
18577117f1b4Smrg         break;
18587117f1b4Smrg      case GL_RENDERBUFFER_BINDING_EXT:
18597117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv");
18607117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0);
18617117f1b4Smrg         break;
18627117f1b4Smrg      case GL_MAX_COLOR_ATTACHMENTS_EXT:
18637117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv");
18647117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxColorAttachments);
18657117f1b4Smrg         break;
18667117f1b4Smrg      case GL_MAX_RENDERBUFFER_SIZE_EXT:
18677117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetBooleanv");
18687117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxRenderbufferSize);
18697117f1b4Smrg         break;
18707117f1b4Smrg      case GL_READ_FRAMEBUFFER_BINDING_EXT:
18717117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_blit, "GetBooleanv");
18727117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->ReadBuffer->Name);
18737117f1b4Smrg         break;
18744a49301eSmrg      case GL_PROVOKING_VERTEX_EXT:
18754a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetBooleanv");
18764a49301eSmrg         params[0] = ctx->Light.ProvokingVertex;
18774a49301eSmrg         break;
18784a49301eSmrg      case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT:
18794a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetBooleanv");
18804a49301eSmrg         params[0] = ctx->Const.QuadsFollowProvokingVertexConvention;
18814a49301eSmrg         break;
18827117f1b4Smrg      case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
18837117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetBooleanv");
18847117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.FragmentProgram.MaxUniformComponents);
18857117f1b4Smrg         break;
18867117f1b4Smrg      case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
18877117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetBooleanv");
18887117f1b4Smrg         params[0] = ENUM_TO_BOOLEAN(ctx->Hint.FragmentShaderDerivative);
18897117f1b4Smrg         break;
18907117f1b4Smrg      case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
18917117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
18927117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxUniformComponents);
18937117f1b4Smrg         break;
18947117f1b4Smrg      case GL_MAX_VARYING_FLOATS_ARB:
18957117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
18967117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVarying * 4);
18977117f1b4Smrg         break;
18987117f1b4Smrg      case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
18997117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
19007117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxVertexTextureImageUnits);
19017117f1b4Smrg         break;
19027117f1b4Smrg      case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
19037117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
1904cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxCombinedTextureImageUnits);
19057117f1b4Smrg         break;
19067117f1b4Smrg      case GL_CURRENT_PROGRAM:
19077117f1b4Smrg         CHECK_EXT1(ARB_shader_objects, "GetBooleanv");
19087117f1b4Smrg         params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
19097117f1b4Smrg         break;
19104a49301eSmrg      case GL_MAX_SAMPLES:
19114a49301eSmrg         CHECK_EXT1(ARB_framebuffer_object, "GetBooleanv");
19124a49301eSmrg         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxSamples);
19134a49301eSmrg         break;
1914c7037ccdSmrg      case GL_VERTEX_ARRAY_BINDING_APPLE:
1915c7037ccdSmrg         CHECK_EXT1(APPLE_vertex_array_object, "GetBooleanv");
1916c7037ccdSmrg         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Name);
1917c7037ccdSmrg         break;
19184a49301eSmrg      case GL_TEXTURE_CUBE_MAP_SEAMLESS:
19194a49301eSmrg         CHECK_EXT1(ARB_seamless_cube_map, "GetBooleanv");
19204a49301eSmrg         params[0] = ctx->Texture.CubeMapSeamless;
19214a49301eSmrg         break;
19224a49301eSmrg      case GL_MAX_SERVER_WAIT_TIMEOUT:
19234a49301eSmrg         CHECK_EXT1(ARB_sync, "GetBooleanv");
19244a49301eSmrg         params[0] = INT64_TO_BOOLEAN(ctx->Const.MaxServerWaitTimeout);
19254a49301eSmrg         break;
1926cdc920a0Smrg      case GL_NUM_EXTENSIONS:
1927cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(_mesa_get_extension_count(ctx));
1928cdc920a0Smrg         break;
1929cdc920a0Smrg      case GL_MAJOR_VERSION:
1930cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->VersionMajor);
1931cdc920a0Smrg         break;
1932cdc920a0Smrg      case GL_MINOR_VERSION:
1933cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->VersionMinor);
1934cdc920a0Smrg         break;
19357117f1b4Smrg      default:
19367117f1b4Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
19377117f1b4Smrg   }
19387117f1b4Smrg}
19397117f1b4Smrg
19407117f1b4Smrgvoid GLAPIENTRY
19417117f1b4Smrg_mesa_GetFloatv( GLenum pname, GLfloat *params )
19427117f1b4Smrg{
19437117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
19447117f1b4Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
19457117f1b4Smrg
19467117f1b4Smrg   if (!params)
19477117f1b4Smrg      return;
19487117f1b4Smrg
19497117f1b4Smrg   if (ctx->NewState)
19507117f1b4Smrg      _mesa_update_state(ctx);
19517117f1b4Smrg
19527117f1b4Smrg   if (ctx->Driver.GetFloatv &&
19537117f1b4Smrg       ctx->Driver.GetFloatv(ctx, pname, params))
19547117f1b4Smrg      return;
19557117f1b4Smrg
19567117f1b4Smrg   switch (pname) {
19577117f1b4Smrg      case GL_ACCUM_RED_BITS:
19587117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumRedBits);
19597117f1b4Smrg         break;
19607117f1b4Smrg      case GL_ACCUM_GREEN_BITS:
19617117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumGreenBits);
19627117f1b4Smrg         break;
19637117f1b4Smrg      case GL_ACCUM_BLUE_BITS:
19647117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumBlueBits);
19657117f1b4Smrg         break;
19667117f1b4Smrg      case GL_ACCUM_ALPHA_BITS:
19677117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumAlphaBits);
19687117f1b4Smrg         break;
19697117f1b4Smrg      case GL_ACCUM_CLEAR_VALUE:
19707117f1b4Smrg         params[0] = ctx->Accum.ClearColor[0];
19717117f1b4Smrg         params[1] = ctx->Accum.ClearColor[1];
19727117f1b4Smrg         params[2] = ctx->Accum.ClearColor[2];
19737117f1b4Smrg         params[3] = ctx->Accum.ClearColor[3];
19747117f1b4Smrg         break;
19757117f1b4Smrg      case GL_ALPHA_BIAS:
19767117f1b4Smrg         params[0] = ctx->Pixel.AlphaBias;
19777117f1b4Smrg         break;
19787117f1b4Smrg      case GL_ALPHA_BITS:
19797117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.alphaBits);
19807117f1b4Smrg         break;
19817117f1b4Smrg      case GL_ALPHA_SCALE:
19827117f1b4Smrg         params[0] = ctx->Pixel.AlphaScale;
19837117f1b4Smrg         break;
19847117f1b4Smrg      case GL_ALPHA_TEST:
19857117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Color.AlphaEnabled);
19867117f1b4Smrg         break;
19877117f1b4Smrg      case GL_ALPHA_TEST_FUNC:
19887117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
19897117f1b4Smrg         break;
19907117f1b4Smrg      case GL_ALPHA_TEST_REF:
19917117f1b4Smrg         params[0] = ctx->Color.AlphaRef;
19927117f1b4Smrg         break;
19937117f1b4Smrg      case GL_ATTRIB_STACK_DEPTH:
19947117f1b4Smrg         params[0] = (GLfloat)(ctx->AttribStackDepth);
19957117f1b4Smrg         break;
19967117f1b4Smrg      case GL_AUTO_NORMAL:
19977117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.AutoNormal);
19987117f1b4Smrg         break;
19997117f1b4Smrg      case GL_AUX_BUFFERS:
20007117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.numAuxBuffers);
20017117f1b4Smrg         break;
20027117f1b4Smrg      case GL_BLEND:
2003cdc920a0Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Color.BlendEnabled & 1));
20047117f1b4Smrg         break;
20057117f1b4Smrg      case GL_BLEND_DST:
20067117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB);
20077117f1b4Smrg         break;
20087117f1b4Smrg      case GL_BLEND_SRC:
20097117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
20107117f1b4Smrg         break;
20117117f1b4Smrg      case GL_BLEND_SRC_RGB_EXT:
20127117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
20137117f1b4Smrg         break;
20147117f1b4Smrg      case GL_BLEND_DST_RGB_EXT:
20157117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB);
20167117f1b4Smrg         break;
20177117f1b4Smrg      case GL_BLEND_SRC_ALPHA_EXT:
20187117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendSrcA);
20197117f1b4Smrg         break;
20207117f1b4Smrg      case GL_BLEND_DST_ALPHA_EXT:
20217117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstA);
20227117f1b4Smrg         break;
20237117f1b4Smrg      case GL_BLEND_EQUATION:
20247117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationRGB );
20257117f1b4Smrg         break;
20267117f1b4Smrg      case GL_BLEND_EQUATION_ALPHA_EXT:
20277117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.BlendEquationA );
20287117f1b4Smrg         break;
20297117f1b4Smrg      case GL_BLEND_COLOR_EXT:
20307117f1b4Smrg         params[0] = ctx->Color.BlendColor[0];
20317117f1b4Smrg         params[1] = ctx->Color.BlendColor[1];
20327117f1b4Smrg         params[2] = ctx->Color.BlendColor[2];
20337117f1b4Smrg         params[3] = ctx->Color.BlendColor[3];
20347117f1b4Smrg         break;
20357117f1b4Smrg      case GL_BLUE_BIAS:
20367117f1b4Smrg         params[0] = ctx->Pixel.BlueBias;
20377117f1b4Smrg         break;
20387117f1b4Smrg      case GL_BLUE_BITS:
20397117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.blueBits);
20407117f1b4Smrg         break;
20417117f1b4Smrg      case GL_BLUE_SCALE:
20427117f1b4Smrg         params[0] = ctx->Pixel.BlueScale;
20437117f1b4Smrg         break;
20447117f1b4Smrg      case GL_CLIENT_ATTRIB_STACK_DEPTH:
20457117f1b4Smrg         params[0] = (GLfloat)(ctx->ClientAttribStackDepth);
20467117f1b4Smrg         break;
20477117f1b4Smrg      case GL_CLIP_PLANE0:
20487117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 0) & 1);
20497117f1b4Smrg         break;
20507117f1b4Smrg      case GL_CLIP_PLANE1:
20517117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 1) & 1);
20527117f1b4Smrg         break;
20537117f1b4Smrg      case GL_CLIP_PLANE2:
20547117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 2) & 1);
20557117f1b4Smrg         break;
20567117f1b4Smrg      case GL_CLIP_PLANE3:
20577117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 3) & 1);
20587117f1b4Smrg         break;
20597117f1b4Smrg      case GL_CLIP_PLANE4:
20607117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 4) & 1);
20617117f1b4Smrg         break;
20627117f1b4Smrg      case GL_CLIP_PLANE5:
20637117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Transform.ClipPlanesEnabled >> 5) & 1);
20647117f1b4Smrg         break;
20657117f1b4Smrg      case GL_COLOR_CLEAR_VALUE:
20667117f1b4Smrg         params[0] = ctx->Color.ClearColor[0];
20677117f1b4Smrg         params[1] = ctx->Color.ClearColor[1];
20687117f1b4Smrg         params[2] = ctx->Color.ClearColor[2];
20697117f1b4Smrg         params[3] = ctx->Color.ClearColor[3];
20707117f1b4Smrg         break;
20717117f1b4Smrg      case GL_COLOR_MATERIAL:
20727117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.ColorMaterialEnabled);
20737117f1b4Smrg         break;
20747117f1b4Smrg      case GL_COLOR_MATERIAL_FACE:
20757117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialFace);
20767117f1b4Smrg         break;
20777117f1b4Smrg      case GL_COLOR_MATERIAL_PARAMETER:
20787117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Light.ColorMaterialMode);
20797117f1b4Smrg         break;
20807117f1b4Smrg      case GL_COLOR_WRITEMASK:
2081cdc920a0Smrg         params[0] = (GLfloat)(ctx->Color.ColorMask[0][RCOMP] ? 1 : 0);
2082cdc920a0Smrg         params[1] = (GLfloat)(ctx->Color.ColorMask[0][GCOMP] ? 1 : 0);
2083cdc920a0Smrg         params[2] = (GLfloat)(ctx->Color.ColorMask[0][BCOMP] ? 1 : 0);
2084cdc920a0Smrg         params[3] = (GLfloat)(ctx->Color.ColorMask[0][ACOMP] ? 1 : 0);
20857117f1b4Smrg         break;
20867117f1b4Smrg      case GL_CULL_FACE:
20877117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.CullFlag);
20887117f1b4Smrg         break;
20897117f1b4Smrg      case GL_CULL_FACE_MODE:
20907117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Polygon.CullFaceMode);
20917117f1b4Smrg         break;
20927117f1b4Smrg      case GL_CURRENT_COLOR:
20937117f1b4Smrg         {
20947117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
20957117f1b4Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
20967117f1b4Smrg         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
20977117f1b4Smrg         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
20987117f1b4Smrg         params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
20997117f1b4Smrg         }
21007117f1b4Smrg         break;
21017117f1b4Smrg      case GL_CURRENT_INDEX:
21027117f1b4Smrg         {
21037117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
21047117f1b4Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0];
21057117f1b4Smrg         }
21067117f1b4Smrg         break;
21077117f1b4Smrg      case GL_CURRENT_NORMAL:
21087117f1b4Smrg         {
21097117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
21107117f1b4Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
21117117f1b4Smrg         params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
21127117f1b4Smrg         params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
21137117f1b4Smrg         }
21147117f1b4Smrg         break;
21157117f1b4Smrg      case GL_CURRENT_RASTER_COLOR:
21167117f1b4Smrg         params[0] = ctx->Current.RasterColor[0];
21177117f1b4Smrg         params[1] = ctx->Current.RasterColor[1];
21187117f1b4Smrg         params[2] = ctx->Current.RasterColor[2];
21197117f1b4Smrg         params[3] = ctx->Current.RasterColor[3];
21207117f1b4Smrg         break;
21217117f1b4Smrg      case GL_CURRENT_RASTER_DISTANCE:
21227117f1b4Smrg         params[0] = ctx->Current.RasterDistance;
21237117f1b4Smrg         break;
21247117f1b4Smrg      case GL_CURRENT_RASTER_INDEX:
2125cdc920a0Smrg         params[0] = 1.0;
21267117f1b4Smrg         break;
21277117f1b4Smrg      case GL_CURRENT_RASTER_POSITION:
21287117f1b4Smrg         params[0] = ctx->Current.RasterPos[0];
21297117f1b4Smrg         params[1] = ctx->Current.RasterPos[1];
21307117f1b4Smrg         params[2] = ctx->Current.RasterPos[2];
21317117f1b4Smrg         params[3] = ctx->Current.RasterPos[3];
21327117f1b4Smrg         break;
21337117f1b4Smrg      case GL_CURRENT_RASTER_SECONDARY_COLOR:
21347117f1b4Smrg         params[0] = ctx->Current.RasterSecondaryColor[0];
21357117f1b4Smrg         params[1] = ctx->Current.RasterSecondaryColor[1];
21367117f1b4Smrg         params[2] = ctx->Current.RasterSecondaryColor[2];
21377117f1b4Smrg         params[3] = ctx->Current.RasterSecondaryColor[3];
21387117f1b4Smrg         break;
21397117f1b4Smrg      case GL_CURRENT_RASTER_TEXTURE_COORDS:
21407117f1b4Smrg         {
2141cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
2142cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
2143cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
2144cdc920a0Smrg                        "glGet(raster tex coords, unit %u)", unit);
2145cdc920a0Smrg            return;
2146cdc920a0Smrg         }
2147cdc920a0Smrg         params[0] = ctx->Current.RasterTexCoords[unit][0];
2148cdc920a0Smrg         params[1] = ctx->Current.RasterTexCoords[unit][1];
2149cdc920a0Smrg         params[2] = ctx->Current.RasterTexCoords[unit][2];
2150cdc920a0Smrg         params[3] = ctx->Current.RasterTexCoords[unit][3];
21517117f1b4Smrg         }
21527117f1b4Smrg         break;
21537117f1b4Smrg      case GL_CURRENT_RASTER_POSITION_VALID:
21547117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Current.RasterPosValid);
21557117f1b4Smrg         break;
21567117f1b4Smrg      case GL_CURRENT_TEXTURE_COORDS:
21577117f1b4Smrg         {
2158cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
2159cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
2160cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
2161cdc920a0Smrg                        "glGet(current tex coords, unit %u)", unit);
2162cdc920a0Smrg            return;
2163cdc920a0Smrg         }
21644a49301eSmrg         FLUSH_CURRENT(ctx, 0);
2165cdc920a0Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0];
2166cdc920a0Smrg         params[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1];
2167cdc920a0Smrg         params[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2];
2168cdc920a0Smrg         params[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3];
21697117f1b4Smrg         }
21707117f1b4Smrg         break;
21717117f1b4Smrg      case GL_DEPTH_BIAS:
21727117f1b4Smrg         params[0] = ctx->Pixel.DepthBias;
21737117f1b4Smrg         break;
21747117f1b4Smrg      case GL_DEPTH_BITS:
21757117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.depthBits);
21767117f1b4Smrg         break;
21777117f1b4Smrg      case GL_DEPTH_CLEAR_VALUE:
2178c1f859d4Smrg         params[0] = ((GLfloat) ctx->Depth.Clear);
21797117f1b4Smrg         break;
21807117f1b4Smrg      case GL_DEPTH_FUNC:
21817117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Depth.Func);
21827117f1b4Smrg         break;
21837117f1b4Smrg      case GL_DEPTH_RANGE:
21847117f1b4Smrg         params[0] = ctx->Viewport.Near;
21857117f1b4Smrg         params[1] = ctx->Viewport.Far;
21867117f1b4Smrg         break;
21877117f1b4Smrg      case GL_DEPTH_SCALE:
21887117f1b4Smrg         params[0] = ctx->Pixel.DepthScale;
21897117f1b4Smrg         break;
21907117f1b4Smrg      case GL_DEPTH_TEST:
21917117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Test);
21927117f1b4Smrg         break;
21937117f1b4Smrg      case GL_DEPTH_WRITEMASK:
21947117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.Mask);
21957117f1b4Smrg         break;
21967117f1b4Smrg      case GL_DITHER:
21977117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Color.DitherFlag);
21987117f1b4Smrg         break;
21997117f1b4Smrg      case GL_DOUBLEBUFFER:
22007117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.doubleBufferMode);
22017117f1b4Smrg         break;
22027117f1b4Smrg      case GL_DRAW_BUFFER:
22037117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]);
22047117f1b4Smrg         break;
22057117f1b4Smrg      case GL_EDGE_FLAG:
22067117f1b4Smrg         {
22077117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
22087117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT((ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0));
22097117f1b4Smrg         }
22107117f1b4Smrg         break;
22117117f1b4Smrg      case GL_FEEDBACK_BUFFER_SIZE:
22127117f1b4Smrg         params[0] = (GLfloat)(ctx->Feedback.BufferSize);
22137117f1b4Smrg         break;
22147117f1b4Smrg      case GL_FEEDBACK_BUFFER_TYPE:
22157117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Feedback.Type);
22167117f1b4Smrg         break;
22177117f1b4Smrg      case GL_FOG:
22187117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.Enabled);
22197117f1b4Smrg         break;
22207117f1b4Smrg      case GL_FOG_COLOR:
22217117f1b4Smrg         params[0] = ctx->Fog.Color[0];
22227117f1b4Smrg         params[1] = ctx->Fog.Color[1];
22237117f1b4Smrg         params[2] = ctx->Fog.Color[2];
22247117f1b4Smrg         params[3] = ctx->Fog.Color[3];
22257117f1b4Smrg         break;
22267117f1b4Smrg      case GL_FOG_DENSITY:
22277117f1b4Smrg         params[0] = ctx->Fog.Density;
22287117f1b4Smrg         break;
22297117f1b4Smrg      case GL_FOG_END:
22307117f1b4Smrg         params[0] = ctx->Fog.End;
22317117f1b4Smrg         break;
22327117f1b4Smrg      case GL_FOG_HINT:
22337117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.Fog);
22347117f1b4Smrg         break;
22357117f1b4Smrg      case GL_FOG_INDEX:
22367117f1b4Smrg         params[0] = ctx->Fog.Index;
22377117f1b4Smrg         break;
22387117f1b4Smrg      case GL_FOG_MODE:
22397117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Fog.Mode);
22407117f1b4Smrg         break;
22417117f1b4Smrg      case GL_FOG_START:
22427117f1b4Smrg         params[0] = ctx->Fog.Start;
22437117f1b4Smrg         break;
22447117f1b4Smrg      case GL_FRONT_FACE:
22457117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontFace);
22467117f1b4Smrg         break;
22477117f1b4Smrg      case GL_GREEN_BIAS:
22487117f1b4Smrg         params[0] = ctx->Pixel.GreenBias;
22497117f1b4Smrg         break;
22507117f1b4Smrg      case GL_GREEN_BITS:
22517117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.greenBits);
22527117f1b4Smrg         break;
22537117f1b4Smrg      case GL_GREEN_SCALE:
22547117f1b4Smrg         params[0] = ctx->Pixel.GreenScale;
22557117f1b4Smrg         break;
22567117f1b4Smrg      case GL_INDEX_BITS:
22577117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.indexBits);
22587117f1b4Smrg         break;
22597117f1b4Smrg      case GL_INDEX_CLEAR_VALUE:
22607117f1b4Smrg         params[0] = (GLfloat)(ctx->Color.ClearIndex);
22617117f1b4Smrg         break;
22627117f1b4Smrg      case GL_INDEX_MODE:
2263cdc920a0Smrg         params[0] = BOOLEAN_TO_FLOAT(GL_FALSE);
22647117f1b4Smrg         break;
22657117f1b4Smrg      case GL_INDEX_OFFSET:
22667117f1b4Smrg         params[0] = (GLfloat)(ctx->Pixel.IndexOffset);
22677117f1b4Smrg         break;
22687117f1b4Smrg      case GL_INDEX_SHIFT:
22697117f1b4Smrg         params[0] = (GLfloat)(ctx->Pixel.IndexShift);
22707117f1b4Smrg         break;
22717117f1b4Smrg      case GL_INDEX_WRITEMASK:
22727117f1b4Smrg         params[0] = (GLfloat)(ctx->Color.IndexMask);
22737117f1b4Smrg         break;
22747117f1b4Smrg      case GL_LIGHT0:
22757117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[0].Enabled);
22767117f1b4Smrg         break;
22777117f1b4Smrg      case GL_LIGHT1:
22787117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[1].Enabled);
22797117f1b4Smrg         break;
22807117f1b4Smrg      case GL_LIGHT2:
22817117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[2].Enabled);
22827117f1b4Smrg         break;
22837117f1b4Smrg      case GL_LIGHT3:
22847117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[3].Enabled);
22857117f1b4Smrg         break;
22867117f1b4Smrg      case GL_LIGHT4:
22877117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[4].Enabled);
22887117f1b4Smrg         break;
22897117f1b4Smrg      case GL_LIGHT5:
22907117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[5].Enabled);
22917117f1b4Smrg         break;
22927117f1b4Smrg      case GL_LIGHT6:
22937117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[6].Enabled);
22947117f1b4Smrg         break;
22957117f1b4Smrg      case GL_LIGHT7:
22967117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Light[7].Enabled);
22977117f1b4Smrg         break;
22987117f1b4Smrg      case GL_LIGHTING:
22997117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Enabled);
23007117f1b4Smrg         break;
23017117f1b4Smrg      case GL_LIGHT_MODEL_AMBIENT:
23027117f1b4Smrg         params[0] = ctx->Light.Model.Ambient[0];
23037117f1b4Smrg         params[1] = ctx->Light.Model.Ambient[1];
23047117f1b4Smrg         params[2] = ctx->Light.Model.Ambient[2];
23057117f1b4Smrg         params[3] = ctx->Light.Model.Ambient[3];
23067117f1b4Smrg         break;
23077117f1b4Smrg      case GL_LIGHT_MODEL_COLOR_CONTROL:
23087117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Light.Model.ColorControl);
23097117f1b4Smrg         break;
23107117f1b4Smrg      case GL_LIGHT_MODEL_LOCAL_VIEWER:
23117117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.LocalViewer);
23127117f1b4Smrg         break;
23137117f1b4Smrg      case GL_LIGHT_MODEL_TWO_SIDE:
23147117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.Model.TwoSide);
23157117f1b4Smrg         break;
23167117f1b4Smrg      case GL_LINE_SMOOTH:
23177117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Line.SmoothFlag);
23187117f1b4Smrg         break;
23197117f1b4Smrg      case GL_LINE_SMOOTH_HINT:
23207117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.LineSmooth);
23217117f1b4Smrg         break;
23227117f1b4Smrg      case GL_LINE_STIPPLE:
23237117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Line.StippleFlag);
23247117f1b4Smrg         break;
23257117f1b4Smrg      case GL_LINE_STIPPLE_PATTERN:
23267117f1b4Smrg         params[0] = (GLfloat)(ctx->Line.StipplePattern);
23277117f1b4Smrg         break;
23287117f1b4Smrg      case GL_LINE_STIPPLE_REPEAT:
23297117f1b4Smrg         params[0] = (GLfloat)(ctx->Line.StippleFactor);
23307117f1b4Smrg         break;
23317117f1b4Smrg      case GL_LINE_WIDTH:
23327117f1b4Smrg         params[0] = ctx->Line.Width;
23337117f1b4Smrg         break;
23347117f1b4Smrg      case GL_LINE_WIDTH_GRANULARITY:
23357117f1b4Smrg         params[0] = ctx->Const.LineWidthGranularity;
23367117f1b4Smrg         break;
23377117f1b4Smrg      case GL_LINE_WIDTH_RANGE:
23387117f1b4Smrg         params[0] = ctx->Const.MinLineWidthAA;
23397117f1b4Smrg         params[1] = ctx->Const.MaxLineWidthAA;
23407117f1b4Smrg         break;
23417117f1b4Smrg      case GL_ALIASED_LINE_WIDTH_RANGE:
23427117f1b4Smrg         params[0] = ctx->Const.MinLineWidth;
23437117f1b4Smrg         params[1] = ctx->Const.MaxLineWidth;
23447117f1b4Smrg         break;
23457117f1b4Smrg      case GL_LIST_BASE:
23467117f1b4Smrg         params[0] = (GLfloat)(ctx->List.ListBase);
23477117f1b4Smrg         break;
23487117f1b4Smrg      case GL_LIST_INDEX:
23494a49301eSmrg         params[0] = (GLfloat)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
23507117f1b4Smrg         break;
23517117f1b4Smrg      case GL_LIST_MODE:
23527117f1b4Smrg         {
23537117f1b4Smrg         GLenum mode;
23547117f1b4Smrg         if (!ctx->CompileFlag)
23557117f1b4Smrg            mode = 0;
23567117f1b4Smrg         else if (ctx->ExecuteFlag)
23577117f1b4Smrg            mode = GL_COMPILE_AND_EXECUTE;
23587117f1b4Smrg         else
23597117f1b4Smrg            mode = GL_COMPILE;
23607117f1b4Smrg         params[0] = ENUM_TO_FLOAT(mode);
23617117f1b4Smrg         }
23627117f1b4Smrg         break;
23637117f1b4Smrg      case GL_INDEX_LOGIC_OP:
23647117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Color.IndexLogicOpEnabled);
23657117f1b4Smrg         break;
23667117f1b4Smrg      case GL_COLOR_LOGIC_OP:
23677117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Color.ColorLogicOpEnabled);
23687117f1b4Smrg         break;
23697117f1b4Smrg      case GL_LOGIC_OP_MODE:
23707117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Color.LogicOp);
23717117f1b4Smrg         break;
23727117f1b4Smrg      case GL_MAP1_COLOR_4:
23737117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Color4);
23747117f1b4Smrg         break;
23757117f1b4Smrg      case GL_MAP1_GRID_DOMAIN:
23767117f1b4Smrg         params[0] = ctx->Eval.MapGrid1u1;
23777117f1b4Smrg         params[1] = ctx->Eval.MapGrid1u2;
23787117f1b4Smrg         break;
23797117f1b4Smrg      case GL_MAP1_GRID_SEGMENTS:
23807117f1b4Smrg         params[0] = (GLfloat)(ctx->Eval.MapGrid1un);
23817117f1b4Smrg         break;
23827117f1b4Smrg      case GL_MAP1_INDEX:
23837117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Index);
23847117f1b4Smrg         break;
23857117f1b4Smrg      case GL_MAP1_NORMAL:
23867117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Normal);
23877117f1b4Smrg         break;
23887117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_1:
23897117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord1);
23907117f1b4Smrg         break;
23917117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_2:
23927117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord2);
23937117f1b4Smrg         break;
23947117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_3:
23957117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord3);
23967117f1b4Smrg         break;
23977117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_4:
23987117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1TextureCoord4);
23997117f1b4Smrg         break;
24007117f1b4Smrg      case GL_MAP1_VERTEX_3:
24017117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex3);
24027117f1b4Smrg         break;
24037117f1b4Smrg      case GL_MAP1_VERTEX_4:
24047117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Vertex4);
24057117f1b4Smrg         break;
24067117f1b4Smrg      case GL_MAP2_COLOR_4:
24077117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Color4);
24087117f1b4Smrg         break;
24097117f1b4Smrg      case GL_MAP2_GRID_DOMAIN:
24107117f1b4Smrg         params[0] = ctx->Eval.MapGrid2u1;
24117117f1b4Smrg         params[1] = ctx->Eval.MapGrid2u2;
24127117f1b4Smrg         params[2] = ctx->Eval.MapGrid2v1;
24137117f1b4Smrg         params[3] = ctx->Eval.MapGrid2v2;
24147117f1b4Smrg         break;
24157117f1b4Smrg      case GL_MAP2_GRID_SEGMENTS:
24167117f1b4Smrg         params[0] = (GLfloat)(ctx->Eval.MapGrid2un);
24177117f1b4Smrg         params[1] = (GLfloat)(ctx->Eval.MapGrid2vn);
24187117f1b4Smrg         break;
24197117f1b4Smrg      case GL_MAP2_INDEX:
24207117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Index);
24217117f1b4Smrg         break;
24227117f1b4Smrg      case GL_MAP2_NORMAL:
24237117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Normal);
24247117f1b4Smrg         break;
24257117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_1:
24267117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord1);
24277117f1b4Smrg         break;
24287117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_2:
24297117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord2);
24307117f1b4Smrg         break;
24317117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_3:
24327117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord3);
24337117f1b4Smrg         break;
24347117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_4:
24357117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2TextureCoord4);
24367117f1b4Smrg         break;
24377117f1b4Smrg      case GL_MAP2_VERTEX_3:
24387117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex3);
24397117f1b4Smrg         break;
24407117f1b4Smrg      case GL_MAP2_VERTEX_4:
24417117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map2Vertex4);
24427117f1b4Smrg         break;
24437117f1b4Smrg      case GL_MAP_COLOR:
24447117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapColorFlag);
24457117f1b4Smrg         break;
24467117f1b4Smrg      case GL_MAP_STENCIL:
24477117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MapStencilFlag);
24487117f1b4Smrg         break;
24497117f1b4Smrg      case GL_MATRIX_MODE:
24507117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Transform.MatrixMode);
24517117f1b4Smrg         break;
24527117f1b4Smrg      case GL_MAX_ATTRIB_STACK_DEPTH:
24537117f1b4Smrg         params[0] = (GLfloat)(MAX_ATTRIB_STACK_DEPTH);
24547117f1b4Smrg         break;
24557117f1b4Smrg      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
24567117f1b4Smrg         params[0] = (GLfloat)(MAX_CLIENT_ATTRIB_STACK_DEPTH);
24577117f1b4Smrg         break;
24587117f1b4Smrg      case GL_MAX_CLIP_PLANES:
24597117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxClipPlanes);
24607117f1b4Smrg         break;
24617117f1b4Smrg      case GL_MAX_ELEMENTS_VERTICES:
24627117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize);
24637117f1b4Smrg         break;
24647117f1b4Smrg      case GL_MAX_ELEMENTS_INDICES:
24657117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxArrayLockSize);
24667117f1b4Smrg         break;
24677117f1b4Smrg      case GL_MAX_EVAL_ORDER:
24687117f1b4Smrg         params[0] = (GLfloat)(MAX_EVAL_ORDER);
24697117f1b4Smrg         break;
24707117f1b4Smrg      case GL_MAX_LIGHTS:
24717117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxLights);
24727117f1b4Smrg         break;
24737117f1b4Smrg      case GL_MAX_LIST_NESTING:
24747117f1b4Smrg         params[0] = (GLfloat)(MAX_LIST_NESTING);
24757117f1b4Smrg         break;
24767117f1b4Smrg      case GL_MAX_MODELVIEW_STACK_DEPTH:
24777117f1b4Smrg         params[0] = (GLfloat)(MAX_MODELVIEW_STACK_DEPTH);
24787117f1b4Smrg         break;
24797117f1b4Smrg      case GL_MAX_NAME_STACK_DEPTH:
24807117f1b4Smrg         params[0] = (GLfloat)(MAX_NAME_STACK_DEPTH);
24817117f1b4Smrg         break;
24827117f1b4Smrg      case GL_MAX_PIXEL_MAP_TABLE:
24837117f1b4Smrg         params[0] = (GLfloat)(MAX_PIXEL_MAP_TABLE);
24847117f1b4Smrg         break;
24857117f1b4Smrg      case GL_MAX_PROJECTION_STACK_DEPTH:
24867117f1b4Smrg         params[0] = (GLfloat)(MAX_PROJECTION_STACK_DEPTH);
24877117f1b4Smrg         break;
24887117f1b4Smrg      case GL_MAX_TEXTURE_SIZE:
24897117f1b4Smrg         params[0] = (GLfloat)(1 << (ctx->Const.MaxTextureLevels - 1));
24907117f1b4Smrg         break;
24917117f1b4Smrg      case GL_MAX_3D_TEXTURE_SIZE:
24927117f1b4Smrg         params[0] = (GLfloat)(1 << (ctx->Const.Max3DTextureLevels - 1));
24937117f1b4Smrg         break;
24947117f1b4Smrg      case GL_MAX_TEXTURE_STACK_DEPTH:
24957117f1b4Smrg         params[0] = (GLfloat)(MAX_TEXTURE_STACK_DEPTH);
24967117f1b4Smrg         break;
24977117f1b4Smrg      case GL_MAX_VIEWPORT_DIMS:
24987117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxViewportWidth);
24997117f1b4Smrg         params[1] = (GLfloat)(ctx->Const.MaxViewportHeight);
25007117f1b4Smrg         break;
25017117f1b4Smrg      case GL_MODELVIEW_MATRIX:
25027117f1b4Smrg         {
25037117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
25047117f1b4Smrg         params[0] = matrix[0];
25057117f1b4Smrg         params[1] = matrix[1];
25067117f1b4Smrg         params[2] = matrix[2];
25077117f1b4Smrg         params[3] = matrix[3];
25087117f1b4Smrg         params[4] = matrix[4];
25097117f1b4Smrg         params[5] = matrix[5];
25107117f1b4Smrg         params[6] = matrix[6];
25117117f1b4Smrg         params[7] = matrix[7];
25127117f1b4Smrg         params[8] = matrix[8];
25137117f1b4Smrg         params[9] = matrix[9];
25147117f1b4Smrg         params[10] = matrix[10];
25157117f1b4Smrg         params[11] = matrix[11];
25167117f1b4Smrg         params[12] = matrix[12];
25177117f1b4Smrg         params[13] = matrix[13];
25187117f1b4Smrg         params[14] = matrix[14];
25197117f1b4Smrg         params[15] = matrix[15];
25207117f1b4Smrg         }
25217117f1b4Smrg         break;
25227117f1b4Smrg      case GL_MODELVIEW_STACK_DEPTH:
25237117f1b4Smrg         params[0] = (GLfloat)(ctx->ModelviewMatrixStack.Depth + 1);
25247117f1b4Smrg         break;
25257117f1b4Smrg      case GL_NAME_STACK_DEPTH:
25267117f1b4Smrg         params[0] = (GLfloat)(ctx->Select.NameStackDepth);
25277117f1b4Smrg         break;
25287117f1b4Smrg      case GL_NORMALIZE:
25297117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.Normalize);
25307117f1b4Smrg         break;
25317117f1b4Smrg      case GL_PACK_ALIGNMENT:
25327117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.Alignment);
25337117f1b4Smrg         break;
25347117f1b4Smrg      case GL_PACK_LSB_FIRST:
25357117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.LsbFirst);
25367117f1b4Smrg         break;
25377117f1b4Smrg      case GL_PACK_ROW_LENGTH:
25387117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.RowLength);
25397117f1b4Smrg         break;
25407117f1b4Smrg      case GL_PACK_SKIP_PIXELS:
25417117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.SkipPixels);
25427117f1b4Smrg         break;
25437117f1b4Smrg      case GL_PACK_SKIP_ROWS:
25447117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.SkipRows);
25457117f1b4Smrg         break;
25467117f1b4Smrg      case GL_PACK_SWAP_BYTES:
25477117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.SwapBytes);
25487117f1b4Smrg         break;
25497117f1b4Smrg      case GL_PACK_SKIP_IMAGES_EXT:
25507117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.SkipImages);
25517117f1b4Smrg         break;
25527117f1b4Smrg      case GL_PACK_IMAGE_HEIGHT_EXT:
25537117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.ImageHeight);
25547117f1b4Smrg         break;
25557117f1b4Smrg      case GL_PACK_INVERT_MESA:
25567117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pack.Invert);
25577117f1b4Smrg         break;
25587117f1b4Smrg      case GL_PERSPECTIVE_CORRECTION_HINT:
25597117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection);
25607117f1b4Smrg         break;
25617117f1b4Smrg      case GL_PIXEL_MAP_A_TO_A_SIZE:
25627117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.AtoA.Size);
25637117f1b4Smrg         break;
25647117f1b4Smrg      case GL_PIXEL_MAP_B_TO_B_SIZE:
25657117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.BtoB.Size);
25667117f1b4Smrg         break;
25677117f1b4Smrg      case GL_PIXEL_MAP_G_TO_G_SIZE:
25687117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.GtoG.Size);
25697117f1b4Smrg         break;
25707117f1b4Smrg      case GL_PIXEL_MAP_I_TO_A_SIZE:
25717117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.ItoA.Size);
25727117f1b4Smrg         break;
25737117f1b4Smrg      case GL_PIXEL_MAP_I_TO_B_SIZE:
25747117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.ItoB.Size);
25757117f1b4Smrg         break;
25767117f1b4Smrg      case GL_PIXEL_MAP_I_TO_G_SIZE:
25777117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.ItoG.Size);
25787117f1b4Smrg         break;
25797117f1b4Smrg      case GL_PIXEL_MAP_I_TO_I_SIZE:
25807117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.ItoI.Size);
25817117f1b4Smrg         break;
25827117f1b4Smrg      case GL_PIXEL_MAP_I_TO_R_SIZE:
25837117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.ItoR.Size);
25847117f1b4Smrg         break;
25857117f1b4Smrg      case GL_PIXEL_MAP_R_TO_R_SIZE:
25867117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.RtoR.Size);
25877117f1b4Smrg         break;
25887117f1b4Smrg      case GL_PIXEL_MAP_S_TO_S_SIZE:
25897117f1b4Smrg         params[0] = (GLfloat)(ctx->PixelMaps.StoS.Size);
25907117f1b4Smrg         break;
25917117f1b4Smrg      case GL_POINT_SIZE:
25927117f1b4Smrg         params[0] = ctx->Point.Size;
25937117f1b4Smrg         break;
25947117f1b4Smrg      case GL_POINT_SIZE_GRANULARITY:
25957117f1b4Smrg         params[0] = ctx->Const.PointSizeGranularity;
25967117f1b4Smrg         break;
25977117f1b4Smrg      case GL_POINT_SIZE_RANGE:
25987117f1b4Smrg         params[0] = ctx->Const.MinPointSizeAA;
25997117f1b4Smrg         params[1] = ctx->Const.MaxPointSizeAA;
26007117f1b4Smrg         break;
26017117f1b4Smrg      case GL_ALIASED_POINT_SIZE_RANGE:
26027117f1b4Smrg         params[0] = ctx->Const.MinPointSize;
26037117f1b4Smrg         params[1] = ctx->Const.MaxPointSize;
26047117f1b4Smrg         break;
26057117f1b4Smrg      case GL_POINT_SMOOTH:
26067117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Point.SmoothFlag);
26077117f1b4Smrg         break;
26087117f1b4Smrg      case GL_POINT_SMOOTH_HINT:
26097117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.PointSmooth);
26107117f1b4Smrg         break;
26117117f1b4Smrg      case GL_POINT_SIZE_MIN_EXT:
26127117f1b4Smrg         params[0] = ctx->Point.MinSize;
26137117f1b4Smrg         break;
26147117f1b4Smrg      case GL_POINT_SIZE_MAX_EXT:
26157117f1b4Smrg         params[0] = ctx->Point.MaxSize;
26167117f1b4Smrg         break;
26177117f1b4Smrg      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
26187117f1b4Smrg         params[0] = ctx->Point.Threshold;
26197117f1b4Smrg         break;
26207117f1b4Smrg      case GL_DISTANCE_ATTENUATION_EXT:
26217117f1b4Smrg         params[0] = ctx->Point.Params[0];
26227117f1b4Smrg         params[1] = ctx->Point.Params[1];
26237117f1b4Smrg         params[2] = ctx->Point.Params[2];
26247117f1b4Smrg         break;
26257117f1b4Smrg      case GL_POLYGON_MODE:
26267117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontMode);
26277117f1b4Smrg         params[1] = ENUM_TO_FLOAT(ctx->Polygon.BackMode);
26287117f1b4Smrg         break;
26297117f1b4Smrg      case GL_POLYGON_OFFSET_BIAS_EXT:
26307117f1b4Smrg         params[0] = ctx->Polygon.OffsetUnits;
26317117f1b4Smrg         break;
26327117f1b4Smrg      case GL_POLYGON_OFFSET_FACTOR:
26337117f1b4Smrg         params[0] = ctx->Polygon.OffsetFactor ;
26347117f1b4Smrg         break;
26357117f1b4Smrg      case GL_POLYGON_OFFSET_UNITS:
26367117f1b4Smrg         params[0] = ctx->Polygon.OffsetUnits ;
26377117f1b4Smrg         break;
2638c1f859d4Smrg      case GL_POLYGON_OFFSET_POINT:
2639c1f859d4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetPoint);
2640c1f859d4Smrg         break;
2641c1f859d4Smrg      case GL_POLYGON_OFFSET_LINE:
2642c1f859d4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetLine);
2643c1f859d4Smrg         break;
2644c1f859d4Smrg      case GL_POLYGON_OFFSET_FILL:
2645c1f859d4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.OffsetFill);
2646c1f859d4Smrg         break;
26477117f1b4Smrg      case GL_POLYGON_SMOOTH:
26487117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.SmoothFlag);
26497117f1b4Smrg         break;
26507117f1b4Smrg      case GL_POLYGON_SMOOTH_HINT:
26517117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.PolygonSmooth);
26527117f1b4Smrg         break;
26537117f1b4Smrg      case GL_POLYGON_STIPPLE:
26547117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Polygon.StippleFlag);
26557117f1b4Smrg         break;
26567117f1b4Smrg      case GL_PROJECTION_MATRIX:
26577117f1b4Smrg         {
26587117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
26597117f1b4Smrg         params[0] = matrix[0];
26607117f1b4Smrg         params[1] = matrix[1];
26617117f1b4Smrg         params[2] = matrix[2];
26627117f1b4Smrg         params[3] = matrix[3];
26637117f1b4Smrg         params[4] = matrix[4];
26647117f1b4Smrg         params[5] = matrix[5];
26657117f1b4Smrg         params[6] = matrix[6];
26667117f1b4Smrg         params[7] = matrix[7];
26677117f1b4Smrg         params[8] = matrix[8];
26687117f1b4Smrg         params[9] = matrix[9];
26697117f1b4Smrg         params[10] = matrix[10];
26707117f1b4Smrg         params[11] = matrix[11];
26717117f1b4Smrg         params[12] = matrix[12];
26727117f1b4Smrg         params[13] = matrix[13];
26737117f1b4Smrg         params[14] = matrix[14];
26747117f1b4Smrg         params[15] = matrix[15];
26757117f1b4Smrg         }
26767117f1b4Smrg         break;
26777117f1b4Smrg      case GL_PROJECTION_STACK_DEPTH:
26787117f1b4Smrg         params[0] = (GLfloat)(ctx->ProjectionMatrixStack.Depth + 1);
26797117f1b4Smrg         break;
26807117f1b4Smrg      case GL_READ_BUFFER:
26817117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->ReadBuffer->ColorReadBuffer);
26827117f1b4Smrg         break;
26837117f1b4Smrg      case GL_RED_BIAS:
26847117f1b4Smrg         params[0] = ctx->Pixel.RedBias;
26857117f1b4Smrg         break;
26867117f1b4Smrg      case GL_RED_BITS:
26877117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.redBits);
26887117f1b4Smrg         break;
26897117f1b4Smrg      case GL_RED_SCALE:
26907117f1b4Smrg         params[0] = ctx->Pixel.RedScale;
26917117f1b4Smrg         break;
26927117f1b4Smrg      case GL_RENDER_MODE:
26937117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->RenderMode);
26947117f1b4Smrg         break;
26957117f1b4Smrg      case GL_RESCALE_NORMAL:
26967117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RescaleNormals);
26977117f1b4Smrg         break;
26987117f1b4Smrg      case GL_RGBA_MODE:
2699cdc920a0Smrg         params[0] = BOOLEAN_TO_FLOAT(GL_TRUE);
27007117f1b4Smrg         break;
27017117f1b4Smrg      case GL_SCISSOR_BOX:
27027117f1b4Smrg         params[0] = (GLfloat)(ctx->Scissor.X);
27037117f1b4Smrg         params[1] = (GLfloat)(ctx->Scissor.Y);
27047117f1b4Smrg         params[2] = (GLfloat)(ctx->Scissor.Width);
27057117f1b4Smrg         params[3] = (GLfloat)(ctx->Scissor.Height);
27067117f1b4Smrg         break;
27077117f1b4Smrg      case GL_SCISSOR_TEST:
27087117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Scissor.Enabled);
27097117f1b4Smrg         break;
27107117f1b4Smrg      case GL_SELECTION_BUFFER_SIZE:
27117117f1b4Smrg         params[0] = (GLfloat)(ctx->Select.BufferSize);
27127117f1b4Smrg         break;
27137117f1b4Smrg      case GL_SHADE_MODEL:
27147117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Light.ShadeModel);
27157117f1b4Smrg         break;
27167117f1b4Smrg      case GL_SHARED_TEXTURE_PALETTE_EXT:
27177117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.SharedPalette);
27187117f1b4Smrg         break;
27197117f1b4Smrg      case GL_STENCIL_BITS:
27207117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.stencilBits);
27217117f1b4Smrg         break;
27227117f1b4Smrg      case GL_STENCIL_CLEAR_VALUE:
27237117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.Clear);
27247117f1b4Smrg         break;
27257117f1b4Smrg      case GL_STENCIL_FAIL:
27267117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
27277117f1b4Smrg         break;
27287117f1b4Smrg      case GL_STENCIL_FUNC:
27297117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
27307117f1b4Smrg         break;
27317117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_FAIL:
27327117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
27337117f1b4Smrg         break;
27347117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_PASS:
27357117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
27367117f1b4Smrg         break;
27377117f1b4Smrg      case GL_STENCIL_REF:
27387117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
27397117f1b4Smrg         break;
27407117f1b4Smrg      case GL_STENCIL_TEST:
27417117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.Enabled);
27427117f1b4Smrg         break;
27437117f1b4Smrg      case GL_STENCIL_VALUE_MASK:
27447117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
27457117f1b4Smrg         break;
27467117f1b4Smrg      case GL_STENCIL_WRITEMASK:
27477117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
27487117f1b4Smrg         break;
27497117f1b4Smrg      case GL_STEREO:
27507117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.stereoMode);
27517117f1b4Smrg         break;
27527117f1b4Smrg      case GL_SUBPIXEL_BITS:
27537117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.SubPixelBits);
27547117f1b4Smrg         break;
27557117f1b4Smrg      case GL_TEXTURE_1D:
27567117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D));
27577117f1b4Smrg         break;
27587117f1b4Smrg      case GL_TEXTURE_2D:
27597117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D));
27607117f1b4Smrg         break;
27617117f1b4Smrg      case GL_TEXTURE_3D:
27627117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_3D));
27637117f1b4Smrg         break;
2764c1f859d4Smrg      case GL_TEXTURE_1D_ARRAY_EXT:
2765c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetFloatv");
2766c1f859d4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT));
2767c1f859d4Smrg         break;
2768c1f859d4Smrg      case GL_TEXTURE_2D_ARRAY_EXT:
2769c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetFloatv");
2770c1f859d4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT));
2771c1f859d4Smrg         break;
27727117f1b4Smrg      case GL_TEXTURE_BINDING_1D:
2773c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name);
27747117f1b4Smrg         break;
27757117f1b4Smrg      case GL_TEXTURE_BINDING_2D:
2776c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name);
27777117f1b4Smrg         break;
27787117f1b4Smrg      case GL_TEXTURE_BINDING_3D:
2779c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name);
27807117f1b4Smrg         break;
2781c1f859d4Smrg      case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
2782c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetFloatv");
2783c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name);
27847117f1b4Smrg         break;
2785c1f859d4Smrg      case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
2786c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetFloatv");
2787c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name);
27887117f1b4Smrg         break;
27897117f1b4Smrg      case GL_TEXTURE_GEN_S:
27907117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0));
27917117f1b4Smrg         break;
27927117f1b4Smrg      case GL_TEXTURE_GEN_T:
27937117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0));
27947117f1b4Smrg         break;
27957117f1b4Smrg      case GL_TEXTURE_GEN_R:
27967117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0));
27977117f1b4Smrg         break;
27987117f1b4Smrg      case GL_TEXTURE_GEN_Q:
27997117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0));
28007117f1b4Smrg         break;
28017117f1b4Smrg      case GL_TEXTURE_MATRIX:
28027117f1b4Smrg         {
2803cdc920a0Smrg         const GLfloat *matrix;
2804cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
2805cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
2806cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION, "glGet(texture matrix %u)",
2807cdc920a0Smrg                        unit);
2808cdc920a0Smrg            return;
2809cdc920a0Smrg         }
2810cdc920a0Smrg         matrix = ctx->TextureMatrixStack[unit].Top->m;
28117117f1b4Smrg         params[0] = matrix[0];
28127117f1b4Smrg         params[1] = matrix[1];
28137117f1b4Smrg         params[2] = matrix[2];
28147117f1b4Smrg         params[3] = matrix[3];
28157117f1b4Smrg         params[4] = matrix[4];
28167117f1b4Smrg         params[5] = matrix[5];
28177117f1b4Smrg         params[6] = matrix[6];
28187117f1b4Smrg         params[7] = matrix[7];
28197117f1b4Smrg         params[8] = matrix[8];
28207117f1b4Smrg         params[9] = matrix[9];
28217117f1b4Smrg         params[10] = matrix[10];
28227117f1b4Smrg         params[11] = matrix[11];
28237117f1b4Smrg         params[12] = matrix[12];
28247117f1b4Smrg         params[13] = matrix[13];
28257117f1b4Smrg         params[14] = matrix[14];
28267117f1b4Smrg         params[15] = matrix[15];
28277117f1b4Smrg         }
28287117f1b4Smrg         break;
28297117f1b4Smrg      case GL_TEXTURE_STACK_DEPTH:
2830cdc920a0Smrg         {
2831cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
2832cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
2833cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
2834cdc920a0Smrg                        "glGet(texture stack depth, unit %u)", unit);
2835cdc920a0Smrg            return;
2836cdc920a0Smrg         }
2837cdc920a0Smrg         params[0] = (GLfloat)(ctx->TextureMatrixStack[unit].Depth + 1);
2838cdc920a0Smrg         }
28397117f1b4Smrg         break;
28407117f1b4Smrg      case GL_UNPACK_ALIGNMENT:
28417117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.Alignment);
28427117f1b4Smrg         break;
28437117f1b4Smrg      case GL_UNPACK_LSB_FIRST:
28447117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.LsbFirst);
28457117f1b4Smrg         break;
28467117f1b4Smrg      case GL_UNPACK_ROW_LENGTH:
28477117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.RowLength);
28487117f1b4Smrg         break;
28497117f1b4Smrg      case GL_UNPACK_SKIP_PIXELS:
28507117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.SkipPixels);
28517117f1b4Smrg         break;
28527117f1b4Smrg      case GL_UNPACK_SKIP_ROWS:
28537117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.SkipRows);
28547117f1b4Smrg         break;
28557117f1b4Smrg      case GL_UNPACK_SWAP_BYTES:
28567117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.SwapBytes);
28577117f1b4Smrg         break;
28587117f1b4Smrg      case GL_UNPACK_SKIP_IMAGES_EXT:
28597117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.SkipImages);
28607117f1b4Smrg         break;
28617117f1b4Smrg      case GL_UNPACK_IMAGE_HEIGHT_EXT:
28627117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.ImageHeight);
28637117f1b4Smrg         break;
28647117f1b4Smrg      case GL_UNPACK_CLIENT_STORAGE_APPLE:
28657117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Unpack.ClientStorage);
28667117f1b4Smrg         break;
28677117f1b4Smrg      case GL_VIEWPORT:
28687117f1b4Smrg         params[0] = (GLfloat)(ctx->Viewport.X);
28697117f1b4Smrg         params[1] = (GLfloat)(ctx->Viewport.Y);
28707117f1b4Smrg         params[2] = (GLfloat)(ctx->Viewport.Width);
28717117f1b4Smrg         params[3] = (GLfloat)(ctx->Viewport.Height);
28727117f1b4Smrg         break;
28737117f1b4Smrg      case GL_ZOOM_X:
28747117f1b4Smrg         params[0] = ctx->Pixel.ZoomX;
28757117f1b4Smrg         break;
28767117f1b4Smrg      case GL_ZOOM_Y:
28777117f1b4Smrg         params[0] = ctx->Pixel.ZoomY;
28787117f1b4Smrg         break;
28797117f1b4Smrg      case GL_VERTEX_ARRAY:
28807117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Enabled);
28817117f1b4Smrg         break;
28827117f1b4Smrg      case GL_VERTEX_ARRAY_SIZE:
28837117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Size);
28847117f1b4Smrg         break;
28857117f1b4Smrg      case GL_VERTEX_ARRAY_TYPE:
28867117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Vertex.Type);
28877117f1b4Smrg         break;
28887117f1b4Smrg      case GL_VERTEX_ARRAY_STRIDE:
28897117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.Stride);
28907117f1b4Smrg         break;
28917117f1b4Smrg      case GL_VERTEX_ARRAY_COUNT_EXT:
28927117f1b4Smrg         params[0] = (GLfloat)(0);
28937117f1b4Smrg         break;
28947117f1b4Smrg      case GL_NORMAL_ARRAY:
28957117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Enabled);
28967117f1b4Smrg         break;
28977117f1b4Smrg      case GL_NORMAL_ARRAY_TYPE:
28987117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Normal.Type);
28997117f1b4Smrg         break;
29007117f1b4Smrg      case GL_NORMAL_ARRAY_STRIDE:
29017117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.Stride);
29027117f1b4Smrg         break;
29037117f1b4Smrg      case GL_NORMAL_ARRAY_COUNT_EXT:
29047117f1b4Smrg         params[0] = (GLfloat)(0);
29057117f1b4Smrg         break;
29067117f1b4Smrg      case GL_COLOR_ARRAY:
29077117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Color.Enabled);
29087117f1b4Smrg         break;
29097117f1b4Smrg      case GL_COLOR_ARRAY_SIZE:
29107117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Size);
29117117f1b4Smrg         break;
29127117f1b4Smrg      case GL_COLOR_ARRAY_TYPE:
29137117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Color.Type);
29147117f1b4Smrg         break;
29157117f1b4Smrg      case GL_COLOR_ARRAY_STRIDE:
29167117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.Stride);
29177117f1b4Smrg         break;
29187117f1b4Smrg      case GL_COLOR_ARRAY_COUNT_EXT:
29197117f1b4Smrg         params[0] = (GLfloat)(0);
29207117f1b4Smrg         break;
29217117f1b4Smrg      case GL_INDEX_ARRAY:
29227117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->Index.Enabled);
29237117f1b4Smrg         break;
29247117f1b4Smrg      case GL_INDEX_ARRAY_TYPE:
29257117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->Index.Type);
29267117f1b4Smrg         break;
29277117f1b4Smrg      case GL_INDEX_ARRAY_STRIDE:
29287117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.Stride);
29297117f1b4Smrg         break;
29307117f1b4Smrg      case GL_INDEX_ARRAY_COUNT_EXT:
29317117f1b4Smrg         params[0] = (GLfloat)(0);
29327117f1b4Smrg         break;
29337117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY:
29347117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled);
29357117f1b4Smrg         break;
29367117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_SIZE:
29377117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size);
29387117f1b4Smrg         break;
29397117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_TYPE:
29407117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type);
29417117f1b4Smrg         break;
29427117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_STRIDE:
29437117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride);
29447117f1b4Smrg         break;
29457117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
29467117f1b4Smrg         params[0] = (GLfloat)(0);
29477117f1b4Smrg         break;
29487117f1b4Smrg      case GL_EDGE_FLAG_ARRAY:
29497117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->EdgeFlag.Enabled);
29507117f1b4Smrg         break;
29517117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_STRIDE:
29527117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.Stride);
29537117f1b4Smrg         break;
29547117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
29557117f1b4Smrg         params[0] = (GLfloat)(0);
29567117f1b4Smrg         break;
29577117f1b4Smrg      case GL_MAX_TEXTURE_UNITS_ARB:
29587117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetFloatv");
29597117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxTextureUnits);
29607117f1b4Smrg         break;
29617117f1b4Smrg      case GL_ACTIVE_TEXTURE_ARB:
29627117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetFloatv");
29637117f1b4Smrg         params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
29647117f1b4Smrg         break;
29657117f1b4Smrg      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
29667117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetFloatv");
29677117f1b4Smrg         params[0] = (GLfloat)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
29687117f1b4Smrg         break;
29697117f1b4Smrg      case GL_TEXTURE_CUBE_MAP_ARB:
29707117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetFloatv");
29717117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB));
29727117f1b4Smrg         break;
29737117f1b4Smrg      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
29747117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetFloatv");
2975c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name);
29767117f1b4Smrg         break;
29777117f1b4Smrg      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
29787117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetFloatv");
29797117f1b4Smrg         params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
29807117f1b4Smrg         break;
29817117f1b4Smrg      case GL_TEXTURE_COMPRESSION_HINT_ARB:
29827117f1b4Smrg         params[0] = (GLfloat)(ctx->Hint.TextureCompression);
29837117f1b4Smrg         break;
29847117f1b4Smrg      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
29857117f1b4Smrg         params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
29867117f1b4Smrg         break;
29877117f1b4Smrg      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
29887117f1b4Smrg         {
29897117f1b4Smrg         GLint formats[100];
29907117f1b4Smrg         GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
29917117f1b4Smrg         ASSERT(n <= 100);
29927117f1b4Smrg         for (i = 0; i < n; i++)
2993c1f859d4Smrg            params[i] = ENUM_TO_FLOAT(formats[i]);
29947117f1b4Smrg         }
29957117f1b4Smrg         break;
29967117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
29977117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv");
29987117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.LockFirst);
29997117f1b4Smrg         break;
30007117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
30017117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetFloatv");
30027117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.LockCount);
30037117f1b4Smrg         break;
30047117f1b4Smrg      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
30057117f1b4Smrg         {
30067117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
30077117f1b4Smrg         params[0] = matrix[0];
30087117f1b4Smrg         params[1] = matrix[4];
30097117f1b4Smrg         params[2] = matrix[8];
30107117f1b4Smrg         params[3] = matrix[12];
30117117f1b4Smrg         params[4] = matrix[1];
30127117f1b4Smrg         params[5] = matrix[5];
30137117f1b4Smrg         params[6] = matrix[9];
30147117f1b4Smrg         params[7] = matrix[13];
30157117f1b4Smrg         params[8] = matrix[2];
30167117f1b4Smrg         params[9] = matrix[6];
30177117f1b4Smrg         params[10] = matrix[10];
30187117f1b4Smrg         params[11] = matrix[14];
30197117f1b4Smrg         params[12] = matrix[3];
30207117f1b4Smrg         params[13] = matrix[7];
30217117f1b4Smrg         params[14] = matrix[11];
30227117f1b4Smrg         params[15] = matrix[15];
30237117f1b4Smrg         }
30247117f1b4Smrg         break;
30257117f1b4Smrg      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
30267117f1b4Smrg         {
30277117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
30287117f1b4Smrg         params[0] = matrix[0];
30297117f1b4Smrg         params[1] = matrix[4];
30307117f1b4Smrg         params[2] = matrix[8];
30317117f1b4Smrg         params[3] = matrix[12];
30327117f1b4Smrg         params[4] = matrix[1];
30337117f1b4Smrg         params[5] = matrix[5];
30347117f1b4Smrg         params[6] = matrix[9];
30357117f1b4Smrg         params[7] = matrix[13];
30367117f1b4Smrg         params[8] = matrix[2];
30377117f1b4Smrg         params[9] = matrix[6];
30387117f1b4Smrg         params[10] = matrix[10];
30397117f1b4Smrg         params[11] = matrix[14];
30407117f1b4Smrg         params[12] = matrix[3];
30417117f1b4Smrg         params[13] = matrix[7];
30427117f1b4Smrg         params[14] = matrix[11];
30437117f1b4Smrg         params[15] = matrix[15];
30447117f1b4Smrg         }
30457117f1b4Smrg         break;
30467117f1b4Smrg      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
30477117f1b4Smrg         {
30487117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
30497117f1b4Smrg         params[0] = matrix[0];
30507117f1b4Smrg         params[1] = matrix[4];
30517117f1b4Smrg         params[2] = matrix[8];
30527117f1b4Smrg         params[3] = matrix[12];
30537117f1b4Smrg         params[4] = matrix[1];
30547117f1b4Smrg         params[5] = matrix[5];
30557117f1b4Smrg         params[6] = matrix[9];
30567117f1b4Smrg         params[7] = matrix[13];
30577117f1b4Smrg         params[8] = matrix[2];
30587117f1b4Smrg         params[9] = matrix[6];
30597117f1b4Smrg         params[10] = matrix[10];
30607117f1b4Smrg         params[11] = matrix[14];
30617117f1b4Smrg         params[12] = matrix[3];
30627117f1b4Smrg         params[13] = matrix[7];
30637117f1b4Smrg         params[14] = matrix[11];
30647117f1b4Smrg         params[15] = matrix[15];
30657117f1b4Smrg         }
30667117f1b4Smrg         break;
30677117f1b4Smrg      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
30687117f1b4Smrg         {
30697117f1b4Smrg         const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;
30707117f1b4Smrg         params[0] = matrix[0];
30717117f1b4Smrg         params[1] = matrix[4];
30727117f1b4Smrg         params[2] = matrix[8];
30737117f1b4Smrg         params[3] = matrix[12];
30747117f1b4Smrg         params[4] = matrix[1];
30757117f1b4Smrg         params[5] = matrix[5];
30767117f1b4Smrg         params[6] = matrix[9];
30777117f1b4Smrg         params[7] = matrix[13];
30787117f1b4Smrg         params[8] = matrix[2];
30797117f1b4Smrg         params[9] = matrix[6];
30807117f1b4Smrg         params[10] = matrix[10];
30817117f1b4Smrg         params[11] = matrix[14];
30827117f1b4Smrg         params[12] = matrix[3];
30837117f1b4Smrg         params[13] = matrix[7];
30847117f1b4Smrg         params[14] = matrix[11];
30857117f1b4Smrg         params[15] = matrix[15];
30867117f1b4Smrg         }
30877117f1b4Smrg         break;
30887117f1b4Smrg      case GL_COLOR_MATRIX_SGI:
30897117f1b4Smrg         {
30907117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
30917117f1b4Smrg         params[0] = matrix[0];
30927117f1b4Smrg         params[1] = matrix[1];
30937117f1b4Smrg         params[2] = matrix[2];
30947117f1b4Smrg         params[3] = matrix[3];
30957117f1b4Smrg         params[4] = matrix[4];
30967117f1b4Smrg         params[5] = matrix[5];
30977117f1b4Smrg         params[6] = matrix[6];
30987117f1b4Smrg         params[7] = matrix[7];
30997117f1b4Smrg         params[8] = matrix[8];
31007117f1b4Smrg         params[9] = matrix[9];
31017117f1b4Smrg         params[10] = matrix[10];
31027117f1b4Smrg         params[11] = matrix[11];
31037117f1b4Smrg         params[12] = matrix[12];
31047117f1b4Smrg         params[13] = matrix[13];
31057117f1b4Smrg         params[14] = matrix[14];
31067117f1b4Smrg         params[15] = matrix[15];
31077117f1b4Smrg         }
31087117f1b4Smrg         break;
31097117f1b4Smrg      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
31107117f1b4Smrg         params[0] = (GLfloat)(ctx->ColorMatrixStack.Depth + 1);
31117117f1b4Smrg         break;
31127117f1b4Smrg      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
31137117f1b4Smrg         params[0] = (GLfloat)(MAX_COLOR_STACK_DEPTH);
31147117f1b4Smrg         break;
31157117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
31167117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixScale[0];
31177117f1b4Smrg         break;
31187117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
31197117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixScale[1];
31207117f1b4Smrg         break;
31217117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
31227117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixScale[2];
31237117f1b4Smrg         break;
31247117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
31257117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixScale[3];
31267117f1b4Smrg         break;
31277117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
31287117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixBias[0];
31297117f1b4Smrg         break;
31307117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
31317117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixBias[1];
31327117f1b4Smrg         break;
31337117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
31347117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixBias[2];
31357117f1b4Smrg         break;
31367117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
31377117f1b4Smrg         params[0] = ctx->Pixel.PostColorMatrixBias[3];
31387117f1b4Smrg         break;
31397117f1b4Smrg      case GL_CONVOLUTION_1D_EXT:
31407117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31417117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution1DEnabled);
31427117f1b4Smrg         break;
31437117f1b4Smrg      case GL_CONVOLUTION_2D_EXT:
31447117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31457117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Convolution2DEnabled);
31467117f1b4Smrg         break;
31477117f1b4Smrg      case GL_SEPARABLE_2D_EXT:
31487117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31497117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.Separable2DEnabled);
31507117f1b4Smrg         break;
31517117f1b4Smrg      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
31527117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31537117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionScale[0];
31547117f1b4Smrg         break;
31557117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
31567117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31577117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionScale[1];
31587117f1b4Smrg         break;
31597117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
31607117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31617117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionScale[2];
31627117f1b4Smrg         break;
31637117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
31647117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31657117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionScale[3];
31667117f1b4Smrg         break;
31677117f1b4Smrg      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
31687117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31697117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionBias[0];
31707117f1b4Smrg         break;
31717117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
31727117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31737117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionBias[1];
31747117f1b4Smrg         break;
31757117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
31767117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31777117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionBias[2];
31787117f1b4Smrg         break;
31797117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
31807117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetFloatv");
31817117f1b4Smrg         params[0] = ctx->Pixel.PostConvolutionBias[3];
31827117f1b4Smrg         break;
31837117f1b4Smrg      case GL_HISTOGRAM:
31847117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetFloatv");
31857117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.HistogramEnabled);
31867117f1b4Smrg         break;
31877117f1b4Smrg      case GL_MINMAX:
31887117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetFloatv");
31897117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.MinMaxEnabled);
31907117f1b4Smrg         break;
31917117f1b4Smrg      case GL_COLOR_TABLE_SGI:
31927117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetFloatv");
31937117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]);
31947117f1b4Smrg         break;
31957117f1b4Smrg      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
31967117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetFloatv");
31977117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]);
31987117f1b4Smrg         break;
31997117f1b4Smrg      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
32007117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetFloatv");
32017117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]);
32027117f1b4Smrg         break;
32037117f1b4Smrg      case GL_TEXTURE_COLOR_TABLE_SGI:
32047117f1b4Smrg         CHECK_EXT1(SGI_texture_color_table, "GetFloatv");
32057117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled);
32067117f1b4Smrg         break;
32077117f1b4Smrg      case GL_COLOR_SUM_EXT:
32087117f1b4Smrg         CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetFloatv");
32097117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Fog.ColorSumEnabled);
32107117f1b4Smrg         break;
32117117f1b4Smrg      case GL_CURRENT_SECONDARY_COLOR_EXT:
32127117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetFloatv");
32137117f1b4Smrg         {
32147117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
32157117f1b4Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
32167117f1b4Smrg         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
32177117f1b4Smrg         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
32187117f1b4Smrg         params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3];
32197117f1b4Smrg         }
32207117f1b4Smrg         break;
32217117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_EXT:
32227117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetFloatv");
32237117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Enabled);
32247117f1b4Smrg         break;
32257117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
32267117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetFloatv");
32277117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->SecondaryColor.Type);
32287117f1b4Smrg         break;
32297117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
32307117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetFloatv");
32317117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Stride);
32327117f1b4Smrg         break;
32337117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
32347117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetFloatv");
32357117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.Size);
32367117f1b4Smrg         break;
32377117f1b4Smrg      case GL_CURRENT_FOG_COORDINATE_EXT:
32387117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetFloatv");
32397117f1b4Smrg         {
32407117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
32417117f1b4Smrg         params[0] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
32427117f1b4Smrg         }
32437117f1b4Smrg         break;
32447117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_EXT:
32457117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetFloatv");
32467117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Enabled);
32477117f1b4Smrg         break;
32487117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
32497117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetFloatv");
32507117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Array.ArrayObj->FogCoord.Type);
32517117f1b4Smrg         break;
32527117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
32537117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetFloatv");
32547117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.Stride);
32557117f1b4Smrg         break;
32567117f1b4Smrg      case GL_FOG_COORDINATE_SOURCE_EXT:
32577117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetFloatv");
32587117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Fog.FogCoordinateSource);
32597117f1b4Smrg         break;
32607117f1b4Smrg      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
32617117f1b4Smrg         CHECK_EXT1(EXT_texture_lod_bias, "GetFloatv");
32627117f1b4Smrg         params[0] = ctx->Const.MaxTextureLodBias;
32637117f1b4Smrg         break;
32647117f1b4Smrg      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
32657117f1b4Smrg         CHECK_EXT1(EXT_texture_filter_anisotropic, "GetFloatv");
32667117f1b4Smrg         params[0] = ctx->Const.MaxTextureMaxAnisotropy;
32677117f1b4Smrg         break;
32687117f1b4Smrg      case GL_MULTISAMPLE_ARB:
32697117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled);
32707117f1b4Smrg         break;
32717117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
32727117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage);
32737117f1b4Smrg         break;
32747117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
32757117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne);
32767117f1b4Smrg         break;
32777117f1b4Smrg      case GL_SAMPLE_COVERAGE_ARB:
32787117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage);
32797117f1b4Smrg         break;
32807117f1b4Smrg      case GL_SAMPLE_COVERAGE_VALUE_ARB:
32817117f1b4Smrg         params[0] = ctx->Multisample.SampleCoverageValue;
32827117f1b4Smrg         break;
32837117f1b4Smrg      case GL_SAMPLE_COVERAGE_INVERT_ARB:
32847117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert);
32857117f1b4Smrg         break;
32867117f1b4Smrg      case GL_SAMPLE_BUFFERS_ARB:
32877117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers);
32887117f1b4Smrg         break;
32897117f1b4Smrg      case GL_SAMPLES_ARB:
32907117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples);
32917117f1b4Smrg         break;
32927117f1b4Smrg      case GL_RASTER_POSITION_UNCLIPPED_IBM:
32937117f1b4Smrg         CHECK_EXT1(IBM_rasterpos_clip, "GetFloatv");
32947117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RasterPositionUnclipped);
32957117f1b4Smrg         break;
32967117f1b4Smrg      case GL_POINT_SPRITE_NV:
32977117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv");
32987117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Point.PointSprite);
32997117f1b4Smrg         break;
33007117f1b4Smrg      case GL_POINT_SPRITE_R_MODE_NV:
33017117f1b4Smrg         CHECK_EXT1(NV_point_sprite, "GetFloatv");
33027117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteRMode);
33037117f1b4Smrg         break;
33047117f1b4Smrg      case GL_POINT_SPRITE_COORD_ORIGIN:
33057117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetFloatv");
33067117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Point.SpriteOrigin);
33077117f1b4Smrg         break;
33087117f1b4Smrg      case GL_GENERATE_MIPMAP_HINT_SGIS:
33097117f1b4Smrg         CHECK_EXT1(SGIS_generate_mipmap, "GetFloatv");
33107117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.GenerateMipmap);
33117117f1b4Smrg         break;
33127117f1b4Smrg      case GL_VERTEX_PROGRAM_BINDING_NV:
33137117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33147117f1b4Smrg         params[0] = (GLfloat)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0));
33157117f1b4Smrg         break;
33167117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY0_NV:
33177117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33187117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled);
33197117f1b4Smrg         break;
33207117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY1_NV:
33217117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33227117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled);
33237117f1b4Smrg         break;
33247117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY2_NV:
33257117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33267117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled);
33277117f1b4Smrg         break;
33287117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY3_NV:
33297117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33307117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled);
33317117f1b4Smrg         break;
33327117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY4_NV:
33337117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33347117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled);
33357117f1b4Smrg         break;
33367117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY5_NV:
33377117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33387117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled);
33397117f1b4Smrg         break;
33407117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY6_NV:
33417117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33427117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled);
33437117f1b4Smrg         break;
33447117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY7_NV:
33457117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33467117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled);
33477117f1b4Smrg         break;
33487117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY8_NV:
33497117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33507117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled);
33517117f1b4Smrg         break;
33527117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY9_NV:
33537117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33547117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled);
33557117f1b4Smrg         break;
33567117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY10_NV:
33577117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33587117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled);
33597117f1b4Smrg         break;
33607117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY11_NV:
33617117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33627117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled);
33637117f1b4Smrg         break;
33647117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY12_NV:
33657117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33667117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled);
33677117f1b4Smrg         break;
33687117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY13_NV:
33697117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33707117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled);
33717117f1b4Smrg         break;
33727117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY14_NV:
33737117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33747117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled);
33757117f1b4Smrg         break;
33767117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY15_NV:
33777117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33787117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled);
33797117f1b4Smrg         break;
33807117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
33817117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33827117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[0]);
33837117f1b4Smrg         break;
33847117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
33857117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33867117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[1]);
33877117f1b4Smrg         break;
33887117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
33897117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33907117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[2]);
33917117f1b4Smrg         break;
33927117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
33937117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33947117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[3]);
33957117f1b4Smrg         break;
33967117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
33977117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
33987117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[4]);
33997117f1b4Smrg         break;
34007117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
34017117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34027117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[5]);
34037117f1b4Smrg         break;
34047117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
34057117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34067117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[6]);
34077117f1b4Smrg         break;
34087117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
34097117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34107117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[7]);
34117117f1b4Smrg         break;
34127117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
34137117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34147117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[8]);
34157117f1b4Smrg         break;
34167117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
34177117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34187117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[9]);
34197117f1b4Smrg         break;
34207117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
34217117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34227117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[10]);
34237117f1b4Smrg         break;
34247117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
34257117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34267117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[11]);
34277117f1b4Smrg         break;
34287117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
34297117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34307117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[12]);
34317117f1b4Smrg         break;
34327117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
34337117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34347117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[13]);
34357117f1b4Smrg         break;
34367117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
34377117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34387117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[14]);
34397117f1b4Smrg         break;
34407117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
34417117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetFloatv");
34427117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.Map1Attrib[15]);
34437117f1b4Smrg         break;
34447117f1b4Smrg      case GL_FRAGMENT_PROGRAM_NV:
34457117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetFloatv");
34467117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled);
34477117f1b4Smrg         break;
34487117f1b4Smrg      case GL_FRAGMENT_PROGRAM_BINDING_NV:
34497117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetFloatv");
34507117f1b4Smrg         params[0] = (GLfloat)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0);
34517117f1b4Smrg         break;
34527117f1b4Smrg      case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
34537117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetFloatv");
34547117f1b4Smrg         params[0] = (GLfloat)(MAX_NV_FRAGMENT_PROGRAM_PARAMS);
34557117f1b4Smrg         break;
34567117f1b4Smrg      case GL_TEXTURE_RECTANGLE_NV:
34577117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetFloatv");
34587117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV));
34597117f1b4Smrg         break;
34607117f1b4Smrg      case GL_TEXTURE_BINDING_RECTANGLE_NV:
34617117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetFloatv");
3462c1f859d4Smrg         params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name);
34637117f1b4Smrg         break;
34647117f1b4Smrg      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
34657117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetFloatv");
34667117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxTextureRectSize);
34677117f1b4Smrg         break;
34687117f1b4Smrg      case GL_STENCIL_TEST_TWO_SIDE_EXT:
34697117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetFloatv");
34707117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Stencil.TestTwoSide);
34717117f1b4Smrg         break;
34727117f1b4Smrg      case GL_ACTIVE_STENCIL_FACE_EXT:
34737117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetFloatv");
34747117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
34757117f1b4Smrg         break;
34767117f1b4Smrg      case GL_MAX_SHININESS_NV:
34777117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetFloatv");
34787117f1b4Smrg         params[0] = ctx->Const.MaxShininess;
34797117f1b4Smrg         break;
34807117f1b4Smrg      case GL_MAX_SPOT_EXPONENT_NV:
34817117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetFloatv");
34827117f1b4Smrg         params[0] = ctx->Const.MaxSpotExponent;
34837117f1b4Smrg         break;
34847117f1b4Smrg      case GL_ARRAY_BUFFER_BINDING_ARB:
34857117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name);
34867117f1b4Smrg         break;
34877117f1b4Smrg      case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
34887117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
34897117f1b4Smrg         break;
34907117f1b4Smrg      case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
34917117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name);
34927117f1b4Smrg         break;
34937117f1b4Smrg      case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
34947117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name);
34957117f1b4Smrg         break;
34967117f1b4Smrg      case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
34977117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name);
34987117f1b4Smrg         break;
34997117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
35007117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
35017117f1b4Smrg         break;
35027117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
35037117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
35047117f1b4Smrg         break;
35057117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
35067117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
35077117f1b4Smrg         break;
35087117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
35097117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
35107117f1b4Smrg         break;
35117117f1b4Smrg      case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
35127117f1b4Smrg         params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name);
35137117f1b4Smrg         break;
35147117f1b4Smrg      case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
35157117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv");
35167117f1b4Smrg         params[0] = (GLfloat)(ctx->Pack.BufferObj->Name);
35177117f1b4Smrg         break;
35187117f1b4Smrg      case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
35197117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv");
35207117f1b4Smrg         params[0] = (GLfloat)(ctx->Unpack.BufferObj->Name);
35217117f1b4Smrg         break;
35227117f1b4Smrg      case GL_VERTEX_PROGRAM_ARB:
35237117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv");
35247117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.Enabled);
35257117f1b4Smrg         break;
35267117f1b4Smrg      case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
35277117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv");
35287117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.PointSizeEnabled);
35297117f1b4Smrg         break;
35307117f1b4Smrg      case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
35317117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv");
35327117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.TwoSideEnabled);
35337117f1b4Smrg         break;
35347117f1b4Smrg      case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
35357117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv");
35367117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxProgramMatrixStackDepth);
35377117f1b4Smrg         break;
35387117f1b4Smrg      case GL_MAX_PROGRAM_MATRICES_ARB:
35397117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv");
35407117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxProgramMatrices);
35417117f1b4Smrg         break;
35427117f1b4Smrg      case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
35437117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv");
35447117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->CurrentStack->Depth + 1);
35457117f1b4Smrg         break;
35467117f1b4Smrg      case GL_CURRENT_MATRIX_ARB:
35477117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetFloatv");
35487117f1b4Smrg         {
35497117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
35507117f1b4Smrg         params[0] = matrix[0];
35517117f1b4Smrg         params[1] = matrix[1];
35527117f1b4Smrg         params[2] = matrix[2];
35537117f1b4Smrg         params[3] = matrix[3];
35547117f1b4Smrg         params[4] = matrix[4];
35557117f1b4Smrg         params[5] = matrix[5];
35567117f1b4Smrg         params[6] = matrix[6];
35577117f1b4Smrg         params[7] = matrix[7];
35587117f1b4Smrg         params[8] = matrix[8];
35597117f1b4Smrg         params[9] = matrix[9];
35607117f1b4Smrg         params[10] = matrix[10];
35617117f1b4Smrg         params[11] = matrix[11];
35627117f1b4Smrg         params[12] = matrix[12];
35637117f1b4Smrg         params[13] = matrix[13];
35647117f1b4Smrg         params[14] = matrix[14];
35657117f1b4Smrg         params[15] = matrix[15];
35667117f1b4Smrg         }
35677117f1b4Smrg         break;
35687117f1b4Smrg      case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
35697117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetFloatv");
35707117f1b4Smrg         {
35717117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
35727117f1b4Smrg         params[0] = matrix[0];
35737117f1b4Smrg         params[1] = matrix[4];
35747117f1b4Smrg         params[2] = matrix[8];
35757117f1b4Smrg         params[3] = matrix[12];
35767117f1b4Smrg         params[4] = matrix[1];
35777117f1b4Smrg         params[5] = matrix[5];
35787117f1b4Smrg         params[6] = matrix[9];
35797117f1b4Smrg         params[7] = matrix[13];
35807117f1b4Smrg         params[8] = matrix[2];
35817117f1b4Smrg         params[9] = matrix[6];
35827117f1b4Smrg         params[10] = matrix[10];
35837117f1b4Smrg         params[11] = matrix[14];
35847117f1b4Smrg         params[12] = matrix[3];
35857117f1b4Smrg         params[13] = matrix[7];
35867117f1b4Smrg         params[14] = matrix[11];
35877117f1b4Smrg         params[15] = matrix[15];
35887117f1b4Smrg         }
35897117f1b4Smrg         break;
35907117f1b4Smrg      case GL_MAX_VERTEX_ATTRIBS_ARB:
35917117f1b4Smrg         CHECK_EXT1(ARB_vertex_program, "GetFloatv");
35927117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs);
35937117f1b4Smrg         break;
35947117f1b4Smrg      case GL_PROGRAM_ERROR_POSITION_ARB:
35957117f1b4Smrg         CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetFloatv");
35967117f1b4Smrg         params[0] = (GLfloat)(ctx->Program.ErrorPos);
35977117f1b4Smrg         break;
35987117f1b4Smrg      case GL_FRAGMENT_PROGRAM_ARB:
35997117f1b4Smrg         CHECK_EXT1(ARB_fragment_program, "GetFloatv");
36007117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled);
36017117f1b4Smrg         break;
36027117f1b4Smrg      case GL_MAX_TEXTURE_COORDS_ARB:
36037117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv");
36047117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxTextureCoordUnits);
36057117f1b4Smrg         break;
36067117f1b4Smrg      case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
36077117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv");
36087117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxTextureImageUnits);
36097117f1b4Smrg         break;
36107117f1b4Smrg      case GL_DEPTH_BOUNDS_TEST_EXT:
36117117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv");
36127117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.BoundsTest);
36137117f1b4Smrg         break;
36147117f1b4Smrg      case GL_DEPTH_BOUNDS_EXT:
36157117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv");
36167117f1b4Smrg         params[0] = ctx->Depth.BoundsMin;
36177117f1b4Smrg         params[1] = ctx->Depth.BoundsMax;
36187117f1b4Smrg         break;
36194a49301eSmrg      case GL_DEPTH_CLAMP:
36204a49301eSmrg         CHECK_EXT1(ARB_depth_clamp, "GetFloatv");
36214a49301eSmrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.DepthClamp);
36227117f1b4Smrg         break;
36237117f1b4Smrg      case GL_MAX_DRAW_BUFFERS_ARB:
36247117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers);
36257117f1b4Smrg         break;
36267117f1b4Smrg      case GL_DRAW_BUFFER0_ARB:
36277117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]);
36287117f1b4Smrg         break;
36297117f1b4Smrg      case GL_DRAW_BUFFER1_ARB:
36307117f1b4Smrg         {
36317117f1b4Smrg         GLenum buffer;
36327117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
36337117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
36347117f1b4Smrg            return;
36357117f1b4Smrg         }
36367117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
36377117f1b4Smrg         params[0] = ENUM_TO_FLOAT(buffer);
36387117f1b4Smrg         }
36397117f1b4Smrg         break;
36407117f1b4Smrg      case GL_DRAW_BUFFER2_ARB:
36417117f1b4Smrg         {
36427117f1b4Smrg         GLenum buffer;
36437117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
36447117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
36457117f1b4Smrg            return;
36467117f1b4Smrg         }
36477117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
36487117f1b4Smrg         params[0] = ENUM_TO_FLOAT(buffer);
36497117f1b4Smrg         }
36507117f1b4Smrg         break;
36517117f1b4Smrg      case GL_DRAW_BUFFER3_ARB:
36527117f1b4Smrg         {
36537117f1b4Smrg         GLenum buffer;
36547117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
36557117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
36567117f1b4Smrg            return;
36577117f1b4Smrg         }
36587117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
36597117f1b4Smrg         params[0] = ENUM_TO_FLOAT(buffer);
36607117f1b4Smrg         }
36617117f1b4Smrg         break;
36627117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
36637117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetFloatv");
36644a49301eSmrg         params[0] = (GLfloat)(_mesa_get_color_read_type(ctx));
36657117f1b4Smrg         break;
36667117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
36677117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetFloatv");
36684a49301eSmrg         params[0] = (GLfloat)(_mesa_get_color_read_format(ctx));
36697117f1b4Smrg         break;
36707117f1b4Smrg      case GL_NUM_FRAGMENT_REGISTERS_ATI:
36717117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36727117f1b4Smrg         params[0] = (GLfloat)(6);
36737117f1b4Smrg         break;
36747117f1b4Smrg      case GL_NUM_FRAGMENT_CONSTANTS_ATI:
36757117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36767117f1b4Smrg         params[0] = (GLfloat)(8);
36777117f1b4Smrg         break;
36787117f1b4Smrg      case GL_NUM_PASSES_ATI:
36797117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36807117f1b4Smrg         params[0] = (GLfloat)(2);
36817117f1b4Smrg         break;
36827117f1b4Smrg      case GL_NUM_INSTRUCTIONS_PER_PASS_ATI:
36837117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36847117f1b4Smrg         params[0] = (GLfloat)(8);
36857117f1b4Smrg         break;
36867117f1b4Smrg      case GL_NUM_INSTRUCTIONS_TOTAL_ATI:
36877117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36887117f1b4Smrg         params[0] = (GLfloat)(16);
36897117f1b4Smrg         break;
36907117f1b4Smrg      case GL_COLOR_ALPHA_PAIRING_ATI:
36917117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36927117f1b4Smrg         params[0] = BOOLEAN_TO_FLOAT(GL_TRUE);
36937117f1b4Smrg         break;
36947117f1b4Smrg      case GL_NUM_LOOPBACK_COMPONENTS_ATI:
36957117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
36967117f1b4Smrg         params[0] = (GLfloat)(3);
36977117f1b4Smrg         break;
36987117f1b4Smrg      case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI:
36997117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetFloatv");
37007117f1b4Smrg         params[0] = (GLfloat)(3);
37017117f1b4Smrg         break;
37027117f1b4Smrg      case GL_STENCIL_BACK_FUNC:
37037117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.Function[1]);
37047117f1b4Smrg         break;
37057117f1b4Smrg      case GL_STENCIL_BACK_VALUE_MASK:
37067117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.ValueMask[1]);
37077117f1b4Smrg         break;
37087117f1b4Smrg      case GL_STENCIL_BACK_WRITEMASK:
37097117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.WriteMask[1]);
37107117f1b4Smrg         break;
37117117f1b4Smrg      case GL_STENCIL_BACK_REF:
37127117f1b4Smrg         params[0] = (GLfloat)(ctx->Stencil.Ref[1]);
37137117f1b4Smrg         break;
37147117f1b4Smrg      case GL_STENCIL_BACK_FAIL:
37157117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[1]);
37167117f1b4Smrg         break;
37177117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
37187117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[1]);
37197117f1b4Smrg         break;
37207117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_PASS:
37217117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[1]);
37227117f1b4Smrg         break;
37237117f1b4Smrg      case GL_FRAMEBUFFER_BINDING_EXT:
37247117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetFloatv");
37257117f1b4Smrg         params[0] = (GLfloat)(ctx->DrawBuffer->Name);
37267117f1b4Smrg         break;
37277117f1b4Smrg      case GL_RENDERBUFFER_BINDING_EXT:
37287117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetFloatv");
37297117f1b4Smrg         params[0] = (GLfloat)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0);
37307117f1b4Smrg         break;
37317117f1b4Smrg      case GL_MAX_COLOR_ATTACHMENTS_EXT:
37327117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetFloatv");
37337117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxColorAttachments);
37347117f1b4Smrg         break;
37357117f1b4Smrg      case GL_MAX_RENDERBUFFER_SIZE_EXT:
37367117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetFloatv");
37377117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxRenderbufferSize);
37387117f1b4Smrg         break;
37397117f1b4Smrg      case GL_READ_FRAMEBUFFER_BINDING_EXT:
37407117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_blit, "GetFloatv");
37417117f1b4Smrg         params[0] = (GLfloat)(ctx->ReadBuffer->Name);
37427117f1b4Smrg         break;
37434a49301eSmrg      case GL_PROVOKING_VERTEX_EXT:
37444a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetFloatv");
37454a49301eSmrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Light.ProvokingVertex);
37464a49301eSmrg         break;
37474a49301eSmrg      case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT:
37484a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetFloatv");
37494a49301eSmrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Const.QuadsFollowProvokingVertexConvention);
37504a49301eSmrg         break;
37517117f1b4Smrg      case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
37527117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetFloatv");
37537117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.FragmentProgram.MaxUniformComponents);
37547117f1b4Smrg         break;
37557117f1b4Smrg      case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
37567117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetFloatv");
37577117f1b4Smrg         params[0] = ENUM_TO_FLOAT(ctx->Hint.FragmentShaderDerivative);
37587117f1b4Smrg         break;
37597117f1b4Smrg      case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
37607117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
37617117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxUniformComponents);
37627117f1b4Smrg         break;
37637117f1b4Smrg      case GL_MAX_VARYING_FLOATS_ARB:
37647117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
37657117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxVarying * 4);
37667117f1b4Smrg         break;
37677117f1b4Smrg      case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
37687117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
37697117f1b4Smrg         params[0] = (GLfloat)(ctx->Const.MaxVertexTextureImageUnits);
37707117f1b4Smrg         break;
37717117f1b4Smrg      case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
37727117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
3773cdc920a0Smrg         params[0] = (GLfloat)(ctx->Const.MaxCombinedTextureImageUnits);
37747117f1b4Smrg         break;
37757117f1b4Smrg      case GL_CURRENT_PROGRAM:
37767117f1b4Smrg         CHECK_EXT1(ARB_shader_objects, "GetFloatv");
37777117f1b4Smrg         params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
37787117f1b4Smrg         break;
37794a49301eSmrg      case GL_MAX_SAMPLES:
37804a49301eSmrg         CHECK_EXT1(ARB_framebuffer_object, "GetFloatv");
37814a49301eSmrg         params[0] = (GLfloat)(ctx->Const.MaxSamples);
37824a49301eSmrg         break;
3783c7037ccdSmrg      case GL_VERTEX_ARRAY_BINDING_APPLE:
3784c7037ccdSmrg         CHECK_EXT1(APPLE_vertex_array_object, "GetFloatv");
3785c7037ccdSmrg         params[0] = (GLfloat)(ctx->Array.ArrayObj->Name);
3786c7037ccdSmrg         break;
37874a49301eSmrg      case GL_TEXTURE_CUBE_MAP_SEAMLESS:
37884a49301eSmrg         CHECK_EXT1(ARB_seamless_cube_map, "GetFloatv");
37894a49301eSmrg         params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.CubeMapSeamless);
37904a49301eSmrg         break;
37914a49301eSmrg      case GL_MAX_SERVER_WAIT_TIMEOUT:
37924a49301eSmrg         CHECK_EXT1(ARB_sync, "GetFloatv");
37934a49301eSmrg         params[0] = (GLfloat)(ctx->Const.MaxServerWaitTimeout);
37944a49301eSmrg         break;
3795cdc920a0Smrg      case GL_NUM_EXTENSIONS:
3796cdc920a0Smrg         params[0] = (GLfloat)(_mesa_get_extension_count(ctx));
3797cdc920a0Smrg         break;
3798cdc920a0Smrg      case GL_MAJOR_VERSION:
3799cdc920a0Smrg         params[0] = (GLfloat)(ctx->VersionMajor);
3800cdc920a0Smrg         break;
3801cdc920a0Smrg      case GL_MINOR_VERSION:
3802cdc920a0Smrg         params[0] = (GLfloat)(ctx->VersionMinor);
3803cdc920a0Smrg         break;
38047117f1b4Smrg      default:
38057117f1b4Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname);
38067117f1b4Smrg   }
38077117f1b4Smrg}
38087117f1b4Smrg
38097117f1b4Smrgvoid GLAPIENTRY
38107117f1b4Smrg_mesa_GetIntegerv( GLenum pname, GLint *params )
38117117f1b4Smrg{
38127117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
38137117f1b4Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
38147117f1b4Smrg
38157117f1b4Smrg   if (!params)
38167117f1b4Smrg      return;
38177117f1b4Smrg
38187117f1b4Smrg   if (ctx->NewState)
38197117f1b4Smrg      _mesa_update_state(ctx);
38207117f1b4Smrg
38217117f1b4Smrg   if (ctx->Driver.GetIntegerv &&
38227117f1b4Smrg       ctx->Driver.GetIntegerv(ctx, pname, params))
38237117f1b4Smrg      return;
38247117f1b4Smrg
38257117f1b4Smrg   switch (pname) {
38267117f1b4Smrg      case GL_ACCUM_RED_BITS:
38277117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.accumRedBits;
38287117f1b4Smrg         break;
38297117f1b4Smrg      case GL_ACCUM_GREEN_BITS:
38307117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.accumGreenBits;
38317117f1b4Smrg         break;
38327117f1b4Smrg      case GL_ACCUM_BLUE_BITS:
38337117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.accumBlueBits;
38347117f1b4Smrg         break;
38357117f1b4Smrg      case GL_ACCUM_ALPHA_BITS:
38367117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.accumAlphaBits;
38377117f1b4Smrg         break;
38387117f1b4Smrg      case GL_ACCUM_CLEAR_VALUE:
38397117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Accum.ClearColor[0]);
38407117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Accum.ClearColor[1]);
38417117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Accum.ClearColor[2]);
38427117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Accum.ClearColor[3]);
38437117f1b4Smrg         break;
38447117f1b4Smrg      case GL_ALPHA_BIAS:
38457117f1b4Smrg         params[0] = IROUND(ctx->Pixel.AlphaBias);
38467117f1b4Smrg         break;
38477117f1b4Smrg      case GL_ALPHA_BITS:
38487117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.alphaBits;
38497117f1b4Smrg         break;
38507117f1b4Smrg      case GL_ALPHA_SCALE:
38517117f1b4Smrg         params[0] = IROUND(ctx->Pixel.AlphaScale);
38527117f1b4Smrg         break;
38537117f1b4Smrg      case GL_ALPHA_TEST:
38547117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Color.AlphaEnabled);
38557117f1b4Smrg         break;
38567117f1b4Smrg      case GL_ALPHA_TEST_FUNC:
38577117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.AlphaFunc);
38587117f1b4Smrg         break;
38597117f1b4Smrg      case GL_ALPHA_TEST_REF:
38607117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Color.AlphaRef);
38617117f1b4Smrg         break;
38627117f1b4Smrg      case GL_ATTRIB_STACK_DEPTH:
38637117f1b4Smrg         params[0] = ctx->AttribStackDepth;
38647117f1b4Smrg         break;
38657117f1b4Smrg      case GL_AUTO_NORMAL:
38667117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.AutoNormal);
38677117f1b4Smrg         break;
38687117f1b4Smrg      case GL_AUX_BUFFERS:
38697117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.numAuxBuffers;
38707117f1b4Smrg         break;
38717117f1b4Smrg      case GL_BLEND:
3872cdc920a0Smrg         params[0] = BOOLEAN_TO_INT((ctx->Color.BlendEnabled & 1));
38737117f1b4Smrg         break;
38747117f1b4Smrg      case GL_BLEND_DST:
38757117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB);
38767117f1b4Smrg         break;
38777117f1b4Smrg      case GL_BLEND_SRC:
38787117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB);
38797117f1b4Smrg         break;
38807117f1b4Smrg      case GL_BLEND_SRC_RGB_EXT:
38817117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendSrcRGB);
38827117f1b4Smrg         break;
38837117f1b4Smrg      case GL_BLEND_DST_RGB_EXT:
38847117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB);
38857117f1b4Smrg         break;
38867117f1b4Smrg      case GL_BLEND_SRC_ALPHA_EXT:
38877117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendSrcA);
38887117f1b4Smrg         break;
38897117f1b4Smrg      case GL_BLEND_DST_ALPHA_EXT:
38907117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendDstA);
38917117f1b4Smrg         break;
38927117f1b4Smrg      case GL_BLEND_EQUATION:
38937117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendEquationRGB );
38947117f1b4Smrg         break;
38957117f1b4Smrg      case GL_BLEND_EQUATION_ALPHA_EXT:
38967117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.BlendEquationA );
38977117f1b4Smrg         break;
38987117f1b4Smrg      case GL_BLEND_COLOR_EXT:
38997117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Color.BlendColor[0]);
39007117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Color.BlendColor[1]);
39017117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Color.BlendColor[2]);
39027117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Color.BlendColor[3]);
39037117f1b4Smrg         break;
39047117f1b4Smrg      case GL_BLUE_BIAS:
39057117f1b4Smrg         params[0] = IROUND(ctx->Pixel.BlueBias);
39067117f1b4Smrg         break;
39077117f1b4Smrg      case GL_BLUE_BITS:
39087117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.blueBits;
39097117f1b4Smrg         break;
39107117f1b4Smrg      case GL_BLUE_SCALE:
39117117f1b4Smrg         params[0] = IROUND(ctx->Pixel.BlueScale);
39127117f1b4Smrg         break;
39137117f1b4Smrg      case GL_CLIENT_ATTRIB_STACK_DEPTH:
39147117f1b4Smrg         params[0] = ctx->ClientAttribStackDepth;
39157117f1b4Smrg         break;
39167117f1b4Smrg      case GL_CLIP_PLANE0:
39177117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 0) & 1);
39187117f1b4Smrg         break;
39197117f1b4Smrg      case GL_CLIP_PLANE1:
39207117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 1) & 1);
39217117f1b4Smrg         break;
39227117f1b4Smrg      case GL_CLIP_PLANE2:
39237117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 2) & 1);
39247117f1b4Smrg         break;
39257117f1b4Smrg      case GL_CLIP_PLANE3:
39267117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 3) & 1);
39277117f1b4Smrg         break;
39287117f1b4Smrg      case GL_CLIP_PLANE4:
39297117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 4) & 1);
39307117f1b4Smrg         break;
39317117f1b4Smrg      case GL_CLIP_PLANE5:
39327117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Transform.ClipPlanesEnabled >> 5) & 1);
39337117f1b4Smrg         break;
39347117f1b4Smrg      case GL_COLOR_CLEAR_VALUE:
39357117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Color.ClearColor[0]);
39367117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Color.ClearColor[1]);
39377117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Color.ClearColor[2]);
39387117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Color.ClearColor[3]);
39397117f1b4Smrg         break;
39407117f1b4Smrg      case GL_COLOR_MATERIAL:
39417117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.ColorMaterialEnabled);
39427117f1b4Smrg         break;
39437117f1b4Smrg      case GL_COLOR_MATERIAL_FACE:
39447117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialFace);
39457117f1b4Smrg         break;
39467117f1b4Smrg      case GL_COLOR_MATERIAL_PARAMETER:
39477117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Light.ColorMaterialMode);
39487117f1b4Smrg         break;
39497117f1b4Smrg      case GL_COLOR_WRITEMASK:
3950cdc920a0Smrg         params[0] = ctx->Color.ColorMask[0][RCOMP] ? 1 : 0;
3951cdc920a0Smrg         params[1] = ctx->Color.ColorMask[0][GCOMP] ? 1 : 0;
3952cdc920a0Smrg         params[2] = ctx->Color.ColorMask[0][BCOMP] ? 1 : 0;
3953cdc920a0Smrg         params[3] = ctx->Color.ColorMask[0][ACOMP] ? 1 : 0;
39547117f1b4Smrg         break;
39557117f1b4Smrg      case GL_CULL_FACE:
39567117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.CullFlag);
39577117f1b4Smrg         break;
39587117f1b4Smrg      case GL_CULL_FACE_MODE:
39597117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Polygon.CullFaceMode);
39607117f1b4Smrg         break;
39617117f1b4Smrg      case GL_CURRENT_COLOR:
39627117f1b4Smrg         {
39637117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
39647117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
39657117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
39667117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
39677117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
39687117f1b4Smrg         }
39697117f1b4Smrg         break;
39707117f1b4Smrg      case GL_CURRENT_INDEX:
39717117f1b4Smrg         {
39727117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
39737117f1b4Smrg         params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]);
39747117f1b4Smrg         }
39757117f1b4Smrg         break;
39767117f1b4Smrg      case GL_CURRENT_NORMAL:
39777117f1b4Smrg         {
39787117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
39797117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
39807117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
39817117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
39827117f1b4Smrg         }
39837117f1b4Smrg         break;
39847117f1b4Smrg      case GL_CURRENT_RASTER_COLOR:
39857117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Current.RasterColor[0]);
39867117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Current.RasterColor[1]);
39877117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Current.RasterColor[2]);
39887117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Current.RasterColor[3]);
39897117f1b4Smrg         break;
39907117f1b4Smrg      case GL_CURRENT_RASTER_DISTANCE:
39917117f1b4Smrg         params[0] = IROUND(ctx->Current.RasterDistance);
39927117f1b4Smrg         break;
39937117f1b4Smrg      case GL_CURRENT_RASTER_INDEX:
3994cdc920a0Smrg         params[0] = IROUND(1.0);
39957117f1b4Smrg         break;
39967117f1b4Smrg      case GL_CURRENT_RASTER_POSITION:
39977117f1b4Smrg         params[0] = IROUND(ctx->Current.RasterPos[0]);
39987117f1b4Smrg         params[1] = IROUND(ctx->Current.RasterPos[1]);
39997117f1b4Smrg         params[2] = IROUND(ctx->Current.RasterPos[2]);
40007117f1b4Smrg         params[3] = IROUND(ctx->Current.RasterPos[3]);
40017117f1b4Smrg         break;
40027117f1b4Smrg      case GL_CURRENT_RASTER_SECONDARY_COLOR:
40037117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[0]);
40047117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[1]);
40057117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[2]);
40067117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Current.RasterSecondaryColor[3]);
40077117f1b4Smrg         break;
40087117f1b4Smrg      case GL_CURRENT_RASTER_TEXTURE_COORDS:
40097117f1b4Smrg         {
4010cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
4011cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
4012cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
4013cdc920a0Smrg                        "glGet(raster tex coords, unit %u)", unit);
4014cdc920a0Smrg            return;
4015cdc920a0Smrg         }
4016cdc920a0Smrg         params[0] = IROUND(ctx->Current.RasterTexCoords[unit][0]);
4017cdc920a0Smrg         params[1] = IROUND(ctx->Current.RasterTexCoords[unit][1]);
4018cdc920a0Smrg         params[2] = IROUND(ctx->Current.RasterTexCoords[unit][2]);
4019cdc920a0Smrg         params[3] = IROUND(ctx->Current.RasterTexCoords[unit][3]);
40207117f1b4Smrg         }
40217117f1b4Smrg         break;
40227117f1b4Smrg      case GL_CURRENT_RASTER_POSITION_VALID:
40237117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Current.RasterPosValid);
40247117f1b4Smrg         break;
40257117f1b4Smrg      case GL_CURRENT_TEXTURE_COORDS:
40267117f1b4Smrg         {
4027cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
4028cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
4029cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
4030cdc920a0Smrg                        "glGet(current tex coords, unit %u)", unit);
4031cdc920a0Smrg            return;
4032cdc920a0Smrg         }
40334a49301eSmrg         FLUSH_CURRENT(ctx, 0);
4034cdc920a0Smrg         params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0]);
4035cdc920a0Smrg         params[1] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1]);
4036cdc920a0Smrg         params[2] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2]);
4037cdc920a0Smrg         params[3] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3]);
40387117f1b4Smrg         }
40397117f1b4Smrg         break;
40407117f1b4Smrg      case GL_DEPTH_BIAS:
40417117f1b4Smrg         params[0] = IROUND(ctx->Pixel.DepthBias);
40427117f1b4Smrg         break;
40437117f1b4Smrg      case GL_DEPTH_BITS:
40447117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.depthBits;
40457117f1b4Smrg         break;
40467117f1b4Smrg      case GL_DEPTH_CLEAR_VALUE:
4047c1f859d4Smrg         params[0] = FLOAT_TO_INT(((GLfloat) ctx->Depth.Clear));
40487117f1b4Smrg         break;
40497117f1b4Smrg      case GL_DEPTH_FUNC:
40507117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Depth.Func);
40517117f1b4Smrg         break;
40527117f1b4Smrg      case GL_DEPTH_RANGE:
40537117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Viewport.Near);
40547117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Viewport.Far);
40557117f1b4Smrg         break;
40567117f1b4Smrg      case GL_DEPTH_SCALE:
40577117f1b4Smrg         params[0] = IROUND(ctx->Pixel.DepthScale);
40587117f1b4Smrg         break;
40597117f1b4Smrg      case GL_DEPTH_TEST:
40607117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Depth.Test);
40617117f1b4Smrg         break;
40627117f1b4Smrg      case GL_DEPTH_WRITEMASK:
40637117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Depth.Mask);
40647117f1b4Smrg         break;
40657117f1b4Smrg      case GL_DITHER:
40667117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Color.DitherFlag);
40677117f1b4Smrg         break;
40687117f1b4Smrg      case GL_DOUBLEBUFFER:
40697117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.doubleBufferMode);
40707117f1b4Smrg         break;
40717117f1b4Smrg      case GL_DRAW_BUFFER:
40727117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]);
40737117f1b4Smrg         break;
40747117f1b4Smrg      case GL_EDGE_FLAG:
40757117f1b4Smrg         {
40767117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
40777117f1b4Smrg         params[0] = BOOLEAN_TO_INT((ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0));
40787117f1b4Smrg         }
40797117f1b4Smrg         break;
40807117f1b4Smrg      case GL_FEEDBACK_BUFFER_SIZE:
40817117f1b4Smrg         params[0] = ctx->Feedback.BufferSize;
40827117f1b4Smrg         break;
40837117f1b4Smrg      case GL_FEEDBACK_BUFFER_TYPE:
40847117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Feedback.Type);
40857117f1b4Smrg         break;
40867117f1b4Smrg      case GL_FOG:
40877117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Fog.Enabled);
40887117f1b4Smrg         break;
40897117f1b4Smrg      case GL_FOG_COLOR:
40907117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Fog.Color[0]);
40917117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Fog.Color[1]);
40927117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Fog.Color[2]);
40937117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Fog.Color[3]);
40947117f1b4Smrg         break;
40957117f1b4Smrg      case GL_FOG_DENSITY:
40967117f1b4Smrg         params[0] = IROUND(ctx->Fog.Density);
40977117f1b4Smrg         break;
40987117f1b4Smrg      case GL_FOG_END:
40997117f1b4Smrg         params[0] = IROUND(ctx->Fog.End);
41007117f1b4Smrg         break;
41017117f1b4Smrg      case GL_FOG_HINT:
41027117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.Fog);
41037117f1b4Smrg         break;
41047117f1b4Smrg      case GL_FOG_INDEX:
41057117f1b4Smrg         params[0] = IROUND(ctx->Fog.Index);
41067117f1b4Smrg         break;
41077117f1b4Smrg      case GL_FOG_MODE:
41087117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Fog.Mode);
41097117f1b4Smrg         break;
41107117f1b4Smrg      case GL_FOG_START:
41117117f1b4Smrg         params[0] = IROUND(ctx->Fog.Start);
41127117f1b4Smrg         break;
41137117f1b4Smrg      case GL_FRONT_FACE:
41147117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Polygon.FrontFace);
41157117f1b4Smrg         break;
41167117f1b4Smrg      case GL_GREEN_BIAS:
41177117f1b4Smrg         params[0] = IROUND(ctx->Pixel.GreenBias);
41187117f1b4Smrg         break;
41197117f1b4Smrg      case GL_GREEN_BITS:
41207117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.greenBits;
41217117f1b4Smrg         break;
41227117f1b4Smrg      case GL_GREEN_SCALE:
41237117f1b4Smrg         params[0] = IROUND(ctx->Pixel.GreenScale);
41247117f1b4Smrg         break;
41257117f1b4Smrg      case GL_INDEX_BITS:
41267117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.indexBits;
41277117f1b4Smrg         break;
41287117f1b4Smrg      case GL_INDEX_CLEAR_VALUE:
41297117f1b4Smrg         params[0] = ctx->Color.ClearIndex;
41307117f1b4Smrg         break;
41317117f1b4Smrg      case GL_INDEX_MODE:
4132cdc920a0Smrg         params[0] = BOOLEAN_TO_INT(GL_FALSE);
41337117f1b4Smrg         break;
41347117f1b4Smrg      case GL_INDEX_OFFSET:
41357117f1b4Smrg         params[0] = ctx->Pixel.IndexOffset;
41367117f1b4Smrg         break;
41377117f1b4Smrg      case GL_INDEX_SHIFT:
41387117f1b4Smrg         params[0] = ctx->Pixel.IndexShift;
41397117f1b4Smrg         break;
41407117f1b4Smrg      case GL_INDEX_WRITEMASK:
41417117f1b4Smrg         params[0] = ctx->Color.IndexMask;
41427117f1b4Smrg         break;
41437117f1b4Smrg      case GL_LIGHT0:
41447117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[0].Enabled);
41457117f1b4Smrg         break;
41467117f1b4Smrg      case GL_LIGHT1:
41477117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[1].Enabled);
41487117f1b4Smrg         break;
41497117f1b4Smrg      case GL_LIGHT2:
41507117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[2].Enabled);
41517117f1b4Smrg         break;
41527117f1b4Smrg      case GL_LIGHT3:
41537117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[3].Enabled);
41547117f1b4Smrg         break;
41557117f1b4Smrg      case GL_LIGHT4:
41567117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[4].Enabled);
41577117f1b4Smrg         break;
41587117f1b4Smrg      case GL_LIGHT5:
41597117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[5].Enabled);
41607117f1b4Smrg         break;
41617117f1b4Smrg      case GL_LIGHT6:
41627117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[6].Enabled);
41637117f1b4Smrg         break;
41647117f1b4Smrg      case GL_LIGHT7:
41657117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Light[7].Enabled);
41667117f1b4Smrg         break;
41677117f1b4Smrg      case GL_LIGHTING:
41687117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Enabled);
41697117f1b4Smrg         break;
41707117f1b4Smrg      case GL_LIGHT_MODEL_AMBIENT:
41717117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Light.Model.Ambient[0]);
41727117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Light.Model.Ambient[1]);
41737117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Light.Model.Ambient[2]);
41747117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Light.Model.Ambient[3]);
41757117f1b4Smrg         break;
41767117f1b4Smrg      case GL_LIGHT_MODEL_COLOR_CONTROL:
41777117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Light.Model.ColorControl);
41787117f1b4Smrg         break;
41797117f1b4Smrg      case GL_LIGHT_MODEL_LOCAL_VIEWER:
41807117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Model.LocalViewer);
41817117f1b4Smrg         break;
41827117f1b4Smrg      case GL_LIGHT_MODEL_TWO_SIDE:
41837117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Light.Model.TwoSide);
41847117f1b4Smrg         break;
41857117f1b4Smrg      case GL_LINE_SMOOTH:
41867117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Line.SmoothFlag);
41877117f1b4Smrg         break;
41887117f1b4Smrg      case GL_LINE_SMOOTH_HINT:
41897117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.LineSmooth);
41907117f1b4Smrg         break;
41917117f1b4Smrg      case GL_LINE_STIPPLE:
41927117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Line.StippleFlag);
41937117f1b4Smrg         break;
41947117f1b4Smrg      case GL_LINE_STIPPLE_PATTERN:
41957117f1b4Smrg         params[0] = ctx->Line.StipplePattern;
41967117f1b4Smrg         break;
41977117f1b4Smrg      case GL_LINE_STIPPLE_REPEAT:
41987117f1b4Smrg         params[0] = ctx->Line.StippleFactor;
41997117f1b4Smrg         break;
42007117f1b4Smrg      case GL_LINE_WIDTH:
42017117f1b4Smrg         params[0] = IROUND(ctx->Line.Width);
42027117f1b4Smrg         break;
42037117f1b4Smrg      case GL_LINE_WIDTH_GRANULARITY:
42047117f1b4Smrg         params[0] = IROUND(ctx->Const.LineWidthGranularity);
42057117f1b4Smrg         break;
42067117f1b4Smrg      case GL_LINE_WIDTH_RANGE:
42077117f1b4Smrg         params[0] = IROUND(ctx->Const.MinLineWidthAA);
42087117f1b4Smrg         params[1] = IROUND(ctx->Const.MaxLineWidthAA);
42097117f1b4Smrg         break;
42107117f1b4Smrg      case GL_ALIASED_LINE_WIDTH_RANGE:
42117117f1b4Smrg         params[0] = IROUND(ctx->Const.MinLineWidth);
42127117f1b4Smrg         params[1] = IROUND(ctx->Const.MaxLineWidth);
42137117f1b4Smrg         break;
42147117f1b4Smrg      case GL_LIST_BASE:
42157117f1b4Smrg         params[0] = ctx->List.ListBase;
42167117f1b4Smrg         break;
42177117f1b4Smrg      case GL_LIST_INDEX:
42184a49301eSmrg         params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0);
42197117f1b4Smrg         break;
42207117f1b4Smrg      case GL_LIST_MODE:
42217117f1b4Smrg         {
42227117f1b4Smrg         GLenum mode;
42237117f1b4Smrg         if (!ctx->CompileFlag)
42247117f1b4Smrg            mode = 0;
42257117f1b4Smrg         else if (ctx->ExecuteFlag)
42267117f1b4Smrg            mode = GL_COMPILE_AND_EXECUTE;
42277117f1b4Smrg         else
42287117f1b4Smrg            mode = GL_COMPILE;
42297117f1b4Smrg         params[0] = ENUM_TO_INT(mode);
42307117f1b4Smrg         }
42317117f1b4Smrg         break;
42327117f1b4Smrg      case GL_INDEX_LOGIC_OP:
42337117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Color.IndexLogicOpEnabled);
42347117f1b4Smrg         break;
42357117f1b4Smrg      case GL_COLOR_LOGIC_OP:
42367117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Color.ColorLogicOpEnabled);
42377117f1b4Smrg         break;
42387117f1b4Smrg      case GL_LOGIC_OP_MODE:
42397117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Color.LogicOp);
42407117f1b4Smrg         break;
42417117f1b4Smrg      case GL_MAP1_COLOR_4:
42427117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Color4);
42437117f1b4Smrg         break;
42447117f1b4Smrg      case GL_MAP1_GRID_DOMAIN:
42457117f1b4Smrg         params[0] = IROUND(ctx->Eval.MapGrid1u1);
42467117f1b4Smrg         params[1] = IROUND(ctx->Eval.MapGrid1u2);
42477117f1b4Smrg         break;
42487117f1b4Smrg      case GL_MAP1_GRID_SEGMENTS:
42497117f1b4Smrg         params[0] = ctx->Eval.MapGrid1un;
42507117f1b4Smrg         break;
42517117f1b4Smrg      case GL_MAP1_INDEX:
42527117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Index);
42537117f1b4Smrg         break;
42547117f1b4Smrg      case GL_MAP1_NORMAL:
42557117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Normal);
42567117f1b4Smrg         break;
42577117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_1:
42587117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord1);
42597117f1b4Smrg         break;
42607117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_2:
42617117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord2);
42627117f1b4Smrg         break;
42637117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_3:
42647117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord3);
42657117f1b4Smrg         break;
42667117f1b4Smrg      case GL_MAP1_TEXTURE_COORD_4:
42677117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1TextureCoord4);
42687117f1b4Smrg         break;
42697117f1b4Smrg      case GL_MAP1_VERTEX_3:
42707117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex3);
42717117f1b4Smrg         break;
42727117f1b4Smrg      case GL_MAP1_VERTEX_4:
42737117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Vertex4);
42747117f1b4Smrg         break;
42757117f1b4Smrg      case GL_MAP2_COLOR_4:
42767117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Color4);
42777117f1b4Smrg         break;
42787117f1b4Smrg      case GL_MAP2_GRID_DOMAIN:
42797117f1b4Smrg         params[0] = IROUND(ctx->Eval.MapGrid2u1);
42807117f1b4Smrg         params[1] = IROUND(ctx->Eval.MapGrid2u2);
42817117f1b4Smrg         params[2] = IROUND(ctx->Eval.MapGrid2v1);
42827117f1b4Smrg         params[3] = IROUND(ctx->Eval.MapGrid2v2);
42837117f1b4Smrg         break;
42847117f1b4Smrg      case GL_MAP2_GRID_SEGMENTS:
42857117f1b4Smrg         params[0] = ctx->Eval.MapGrid2un;
42867117f1b4Smrg         params[1] = ctx->Eval.MapGrid2vn;
42877117f1b4Smrg         break;
42887117f1b4Smrg      case GL_MAP2_INDEX:
42897117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Index);
42907117f1b4Smrg         break;
42917117f1b4Smrg      case GL_MAP2_NORMAL:
42927117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Normal);
42937117f1b4Smrg         break;
42947117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_1:
42957117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord1);
42967117f1b4Smrg         break;
42977117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_2:
42987117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord2);
42997117f1b4Smrg         break;
43007117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_3:
43017117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord3);
43027117f1b4Smrg         break;
43037117f1b4Smrg      case GL_MAP2_TEXTURE_COORD_4:
43047117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2TextureCoord4);
43057117f1b4Smrg         break;
43067117f1b4Smrg      case GL_MAP2_VERTEX_3:
43077117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex3);
43087117f1b4Smrg         break;
43097117f1b4Smrg      case GL_MAP2_VERTEX_4:
43107117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map2Vertex4);
43117117f1b4Smrg         break;
43127117f1b4Smrg      case GL_MAP_COLOR:
43137117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapColorFlag);
43147117f1b4Smrg         break;
43157117f1b4Smrg      case GL_MAP_STENCIL:
43167117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.MapStencilFlag);
43177117f1b4Smrg         break;
43187117f1b4Smrg      case GL_MATRIX_MODE:
43197117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Transform.MatrixMode);
43207117f1b4Smrg         break;
43217117f1b4Smrg      case GL_MAX_ATTRIB_STACK_DEPTH:
43227117f1b4Smrg         params[0] = MAX_ATTRIB_STACK_DEPTH;
43237117f1b4Smrg         break;
43247117f1b4Smrg      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
43257117f1b4Smrg         params[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH;
43267117f1b4Smrg         break;
43277117f1b4Smrg      case GL_MAX_CLIP_PLANES:
43287117f1b4Smrg         params[0] = ctx->Const.MaxClipPlanes;
43297117f1b4Smrg         break;
43307117f1b4Smrg      case GL_MAX_ELEMENTS_VERTICES:
43317117f1b4Smrg         params[0] = ctx->Const.MaxArrayLockSize;
43327117f1b4Smrg         break;
43337117f1b4Smrg      case GL_MAX_ELEMENTS_INDICES:
43347117f1b4Smrg         params[0] = ctx->Const.MaxArrayLockSize;
43357117f1b4Smrg         break;
43367117f1b4Smrg      case GL_MAX_EVAL_ORDER:
43377117f1b4Smrg         params[0] = MAX_EVAL_ORDER;
43387117f1b4Smrg         break;
43397117f1b4Smrg      case GL_MAX_LIGHTS:
43407117f1b4Smrg         params[0] = ctx->Const.MaxLights;
43417117f1b4Smrg         break;
43427117f1b4Smrg      case GL_MAX_LIST_NESTING:
43437117f1b4Smrg         params[0] = MAX_LIST_NESTING;
43447117f1b4Smrg         break;
43457117f1b4Smrg      case GL_MAX_MODELVIEW_STACK_DEPTH:
43467117f1b4Smrg         params[0] = MAX_MODELVIEW_STACK_DEPTH;
43477117f1b4Smrg         break;
43487117f1b4Smrg      case GL_MAX_NAME_STACK_DEPTH:
43497117f1b4Smrg         params[0] = MAX_NAME_STACK_DEPTH;
43507117f1b4Smrg         break;
43517117f1b4Smrg      case GL_MAX_PIXEL_MAP_TABLE:
43527117f1b4Smrg         params[0] = MAX_PIXEL_MAP_TABLE;
43537117f1b4Smrg         break;
43547117f1b4Smrg      case GL_MAX_PROJECTION_STACK_DEPTH:
43557117f1b4Smrg         params[0] = MAX_PROJECTION_STACK_DEPTH;
43567117f1b4Smrg         break;
43577117f1b4Smrg      case GL_MAX_TEXTURE_SIZE:
43587117f1b4Smrg         params[0] = 1 << (ctx->Const.MaxTextureLevels - 1);
43597117f1b4Smrg         break;
43607117f1b4Smrg      case GL_MAX_3D_TEXTURE_SIZE:
43617117f1b4Smrg         params[0] = 1 << (ctx->Const.Max3DTextureLevels - 1);
43627117f1b4Smrg         break;
43637117f1b4Smrg      case GL_MAX_TEXTURE_STACK_DEPTH:
43647117f1b4Smrg         params[0] = MAX_TEXTURE_STACK_DEPTH;
43657117f1b4Smrg         break;
43667117f1b4Smrg      case GL_MAX_VIEWPORT_DIMS:
43677117f1b4Smrg         params[0] = ctx->Const.MaxViewportWidth;
43687117f1b4Smrg         params[1] = ctx->Const.MaxViewportHeight;
43697117f1b4Smrg         break;
43707117f1b4Smrg      case GL_MODELVIEW_MATRIX:
43717117f1b4Smrg         {
43727117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
43737117f1b4Smrg         params[0] = IROUND(matrix[0]);
43747117f1b4Smrg         params[1] = IROUND(matrix[1]);
43757117f1b4Smrg         params[2] = IROUND(matrix[2]);
43767117f1b4Smrg         params[3] = IROUND(matrix[3]);
43777117f1b4Smrg         params[4] = IROUND(matrix[4]);
43787117f1b4Smrg         params[5] = IROUND(matrix[5]);
43797117f1b4Smrg         params[6] = IROUND(matrix[6]);
43807117f1b4Smrg         params[7] = IROUND(matrix[7]);
43817117f1b4Smrg         params[8] = IROUND(matrix[8]);
43827117f1b4Smrg         params[9] = IROUND(matrix[9]);
43837117f1b4Smrg         params[10] = IROUND(matrix[10]);
43847117f1b4Smrg         params[11] = IROUND(matrix[11]);
43857117f1b4Smrg         params[12] = IROUND(matrix[12]);
43867117f1b4Smrg         params[13] = IROUND(matrix[13]);
43877117f1b4Smrg         params[14] = IROUND(matrix[14]);
43887117f1b4Smrg         params[15] = IROUND(matrix[15]);
43897117f1b4Smrg         }
43907117f1b4Smrg         break;
43917117f1b4Smrg      case GL_MODELVIEW_STACK_DEPTH:
43927117f1b4Smrg         params[0] = ctx->ModelviewMatrixStack.Depth + 1;
43937117f1b4Smrg         break;
43947117f1b4Smrg      case GL_NAME_STACK_DEPTH:
43957117f1b4Smrg         params[0] = ctx->Select.NameStackDepth;
43967117f1b4Smrg         break;
43977117f1b4Smrg      case GL_NORMALIZE:
43987117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Transform.Normalize);
43997117f1b4Smrg         break;
44007117f1b4Smrg      case GL_PACK_ALIGNMENT:
44017117f1b4Smrg         params[0] = ctx->Pack.Alignment;
44027117f1b4Smrg         break;
44037117f1b4Smrg      case GL_PACK_LSB_FIRST:
44047117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pack.LsbFirst);
44057117f1b4Smrg         break;
44067117f1b4Smrg      case GL_PACK_ROW_LENGTH:
44077117f1b4Smrg         params[0] = ctx->Pack.RowLength;
44087117f1b4Smrg         break;
44097117f1b4Smrg      case GL_PACK_SKIP_PIXELS:
44107117f1b4Smrg         params[0] = ctx->Pack.SkipPixels;
44117117f1b4Smrg         break;
44127117f1b4Smrg      case GL_PACK_SKIP_ROWS:
44137117f1b4Smrg         params[0] = ctx->Pack.SkipRows;
44147117f1b4Smrg         break;
44157117f1b4Smrg      case GL_PACK_SWAP_BYTES:
44167117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pack.SwapBytes);
44177117f1b4Smrg         break;
44187117f1b4Smrg      case GL_PACK_SKIP_IMAGES_EXT:
44197117f1b4Smrg         params[0] = ctx->Pack.SkipImages;
44207117f1b4Smrg         break;
44217117f1b4Smrg      case GL_PACK_IMAGE_HEIGHT_EXT:
44227117f1b4Smrg         params[0] = ctx->Pack.ImageHeight;
44237117f1b4Smrg         break;
44247117f1b4Smrg      case GL_PACK_INVERT_MESA:
44257117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pack.Invert);
44267117f1b4Smrg         break;
44277117f1b4Smrg      case GL_PERSPECTIVE_CORRECTION_HINT:
44287117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.PerspectiveCorrection);
44297117f1b4Smrg         break;
44307117f1b4Smrg      case GL_PIXEL_MAP_A_TO_A_SIZE:
44317117f1b4Smrg         params[0] = ctx->PixelMaps.AtoA.Size;
44327117f1b4Smrg         break;
44337117f1b4Smrg      case GL_PIXEL_MAP_B_TO_B_SIZE:
44347117f1b4Smrg         params[0] = ctx->PixelMaps.BtoB.Size;
44357117f1b4Smrg         break;
44367117f1b4Smrg      case GL_PIXEL_MAP_G_TO_G_SIZE:
44377117f1b4Smrg         params[0] = ctx->PixelMaps.GtoG.Size;
44387117f1b4Smrg         break;
44397117f1b4Smrg      case GL_PIXEL_MAP_I_TO_A_SIZE:
44407117f1b4Smrg         params[0] = ctx->PixelMaps.ItoA.Size;
44417117f1b4Smrg         break;
44427117f1b4Smrg      case GL_PIXEL_MAP_I_TO_B_SIZE:
44437117f1b4Smrg         params[0] = ctx->PixelMaps.ItoB.Size;
44447117f1b4Smrg         break;
44457117f1b4Smrg      case GL_PIXEL_MAP_I_TO_G_SIZE:
44467117f1b4Smrg         params[0] = ctx->PixelMaps.ItoG.Size;
44477117f1b4Smrg         break;
44487117f1b4Smrg      case GL_PIXEL_MAP_I_TO_I_SIZE:
44497117f1b4Smrg         params[0] = ctx->PixelMaps.ItoI.Size;
44507117f1b4Smrg         break;
44517117f1b4Smrg      case GL_PIXEL_MAP_I_TO_R_SIZE:
44527117f1b4Smrg         params[0] = ctx->PixelMaps.ItoR.Size;
44537117f1b4Smrg         break;
44547117f1b4Smrg      case GL_PIXEL_MAP_R_TO_R_SIZE:
44557117f1b4Smrg         params[0] = ctx->PixelMaps.RtoR.Size;
44567117f1b4Smrg         break;
44577117f1b4Smrg      case GL_PIXEL_MAP_S_TO_S_SIZE:
44587117f1b4Smrg         params[0] = ctx->PixelMaps.StoS.Size;
44597117f1b4Smrg         break;
44607117f1b4Smrg      case GL_POINT_SIZE:
44617117f1b4Smrg         params[0] = IROUND(ctx->Point.Size);
44627117f1b4Smrg         break;
44637117f1b4Smrg      case GL_POINT_SIZE_GRANULARITY:
44647117f1b4Smrg         params[0] = IROUND(ctx->Const.PointSizeGranularity);
44657117f1b4Smrg         break;
44667117f1b4Smrg      case GL_POINT_SIZE_RANGE:
44677117f1b4Smrg         params[0] = IROUND(ctx->Const.MinPointSizeAA);
44687117f1b4Smrg         params[1] = IROUND(ctx->Const.MaxPointSizeAA);
44697117f1b4Smrg         break;
44707117f1b4Smrg      case GL_ALIASED_POINT_SIZE_RANGE:
44717117f1b4Smrg         params[0] = IROUND(ctx->Const.MinPointSize);
44727117f1b4Smrg         params[1] = IROUND(ctx->Const.MaxPointSize);
44737117f1b4Smrg         break;
44747117f1b4Smrg      case GL_POINT_SMOOTH:
44757117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Point.SmoothFlag);
44767117f1b4Smrg         break;
44777117f1b4Smrg      case GL_POINT_SMOOTH_HINT:
44787117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.PointSmooth);
44797117f1b4Smrg         break;
44807117f1b4Smrg      case GL_POINT_SIZE_MIN_EXT:
44817117f1b4Smrg         params[0] = IROUND(ctx->Point.MinSize);
44827117f1b4Smrg         break;
44837117f1b4Smrg      case GL_POINT_SIZE_MAX_EXT:
44847117f1b4Smrg         params[0] = IROUND(ctx->Point.MaxSize);
44857117f1b4Smrg         break;
44867117f1b4Smrg      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
44877117f1b4Smrg         params[0] = IROUND(ctx->Point.Threshold);
44887117f1b4Smrg         break;
44897117f1b4Smrg      case GL_DISTANCE_ATTENUATION_EXT:
44907117f1b4Smrg         params[0] = IROUND(ctx->Point.Params[0]);
44917117f1b4Smrg         params[1] = IROUND(ctx->Point.Params[1]);
44927117f1b4Smrg         params[2] = IROUND(ctx->Point.Params[2]);
44937117f1b4Smrg         break;
44947117f1b4Smrg      case GL_POLYGON_MODE:
44957117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Polygon.FrontMode);
44967117f1b4Smrg         params[1] = ENUM_TO_INT(ctx->Polygon.BackMode);
44977117f1b4Smrg         break;
44987117f1b4Smrg      case GL_POLYGON_OFFSET_BIAS_EXT:
44997117f1b4Smrg         params[0] = IROUND(ctx->Polygon.OffsetUnits);
45007117f1b4Smrg         break;
45017117f1b4Smrg      case GL_POLYGON_OFFSET_FACTOR:
45027117f1b4Smrg         params[0] = IROUND(ctx->Polygon.OffsetFactor );
45037117f1b4Smrg         break;
45047117f1b4Smrg      case GL_POLYGON_OFFSET_UNITS:
45057117f1b4Smrg         params[0] = IROUND(ctx->Polygon.OffsetUnits );
45067117f1b4Smrg         break;
4507c1f859d4Smrg      case GL_POLYGON_OFFSET_POINT:
4508c1f859d4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetPoint);
4509c1f859d4Smrg         break;
4510c1f859d4Smrg      case GL_POLYGON_OFFSET_LINE:
4511c1f859d4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetLine);
4512c1f859d4Smrg         break;
4513c1f859d4Smrg      case GL_POLYGON_OFFSET_FILL:
4514c1f859d4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.OffsetFill);
4515c1f859d4Smrg         break;
45167117f1b4Smrg      case GL_POLYGON_SMOOTH:
45177117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.SmoothFlag);
45187117f1b4Smrg         break;
45197117f1b4Smrg      case GL_POLYGON_SMOOTH_HINT:
45207117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.PolygonSmooth);
45217117f1b4Smrg         break;
45227117f1b4Smrg      case GL_POLYGON_STIPPLE:
45237117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Polygon.StippleFlag);
45247117f1b4Smrg         break;
45257117f1b4Smrg      case GL_PROJECTION_MATRIX:
45267117f1b4Smrg         {
45277117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
45287117f1b4Smrg         params[0] = IROUND(matrix[0]);
45297117f1b4Smrg         params[1] = IROUND(matrix[1]);
45307117f1b4Smrg         params[2] = IROUND(matrix[2]);
45317117f1b4Smrg         params[3] = IROUND(matrix[3]);
45327117f1b4Smrg         params[4] = IROUND(matrix[4]);
45337117f1b4Smrg         params[5] = IROUND(matrix[5]);
45347117f1b4Smrg         params[6] = IROUND(matrix[6]);
45357117f1b4Smrg         params[7] = IROUND(matrix[7]);
45367117f1b4Smrg         params[8] = IROUND(matrix[8]);
45377117f1b4Smrg         params[9] = IROUND(matrix[9]);
45387117f1b4Smrg         params[10] = IROUND(matrix[10]);
45397117f1b4Smrg         params[11] = IROUND(matrix[11]);
45407117f1b4Smrg         params[12] = IROUND(matrix[12]);
45417117f1b4Smrg         params[13] = IROUND(matrix[13]);
45427117f1b4Smrg         params[14] = IROUND(matrix[14]);
45437117f1b4Smrg         params[15] = IROUND(matrix[15]);
45447117f1b4Smrg         }
45457117f1b4Smrg         break;
45467117f1b4Smrg      case GL_PROJECTION_STACK_DEPTH:
45477117f1b4Smrg         params[0] = ctx->ProjectionMatrixStack.Depth + 1;
45487117f1b4Smrg         break;
45497117f1b4Smrg      case GL_READ_BUFFER:
45507117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->ReadBuffer->ColorReadBuffer);
45517117f1b4Smrg         break;
45527117f1b4Smrg      case GL_RED_BIAS:
45537117f1b4Smrg         params[0] = IROUND(ctx->Pixel.RedBias);
45547117f1b4Smrg         break;
45557117f1b4Smrg      case GL_RED_BITS:
45567117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.redBits;
45577117f1b4Smrg         break;
45587117f1b4Smrg      case GL_RED_SCALE:
45597117f1b4Smrg         params[0] = IROUND(ctx->Pixel.RedScale);
45607117f1b4Smrg         break;
45617117f1b4Smrg      case GL_RENDER_MODE:
45627117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->RenderMode);
45637117f1b4Smrg         break;
45647117f1b4Smrg      case GL_RESCALE_NORMAL:
45657117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Transform.RescaleNormals);
45667117f1b4Smrg         break;
45677117f1b4Smrg      case GL_RGBA_MODE:
4568cdc920a0Smrg         params[0] = BOOLEAN_TO_INT(GL_TRUE);
45697117f1b4Smrg         break;
45707117f1b4Smrg      case GL_SCISSOR_BOX:
45717117f1b4Smrg         params[0] = ctx->Scissor.X;
45727117f1b4Smrg         params[1] = ctx->Scissor.Y;
45737117f1b4Smrg         params[2] = ctx->Scissor.Width;
45747117f1b4Smrg         params[3] = ctx->Scissor.Height;
45757117f1b4Smrg         break;
45767117f1b4Smrg      case GL_SCISSOR_TEST:
45777117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Scissor.Enabled);
45787117f1b4Smrg         break;
45797117f1b4Smrg      case GL_SELECTION_BUFFER_SIZE:
45807117f1b4Smrg         params[0] = ctx->Select.BufferSize;
45817117f1b4Smrg         break;
45827117f1b4Smrg      case GL_SHADE_MODEL:
45837117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Light.ShadeModel);
45847117f1b4Smrg         break;
45857117f1b4Smrg      case GL_SHARED_TEXTURE_PALETTE_EXT:
45867117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Texture.SharedPalette);
45877117f1b4Smrg         break;
45887117f1b4Smrg      case GL_STENCIL_BITS:
45897117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.stencilBits;
45907117f1b4Smrg         break;
45917117f1b4Smrg      case GL_STENCIL_CLEAR_VALUE:
45927117f1b4Smrg         params[0] = ctx->Stencil.Clear;
45937117f1b4Smrg         break;
45947117f1b4Smrg      case GL_STENCIL_FAIL:
45957117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
45967117f1b4Smrg         break;
45977117f1b4Smrg      case GL_STENCIL_FUNC:
45987117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
45997117f1b4Smrg         break;
46007117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_FAIL:
46017117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
46027117f1b4Smrg         break;
46037117f1b4Smrg      case GL_STENCIL_PASS_DEPTH_PASS:
46047117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
46057117f1b4Smrg         break;
46067117f1b4Smrg      case GL_STENCIL_REF:
46077117f1b4Smrg         params[0] = ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
46087117f1b4Smrg         break;
46097117f1b4Smrg      case GL_STENCIL_TEST:
46107117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Stencil.Enabled);
46117117f1b4Smrg         break;
46127117f1b4Smrg      case GL_STENCIL_VALUE_MASK:
46137117f1b4Smrg         params[0] = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
46147117f1b4Smrg         break;
46157117f1b4Smrg      case GL_STENCIL_WRITEMASK:
46167117f1b4Smrg         params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
46177117f1b4Smrg         break;
46187117f1b4Smrg      case GL_STEREO:
46197117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.stereoMode);
46207117f1b4Smrg         break;
46217117f1b4Smrg      case GL_SUBPIXEL_BITS:
46227117f1b4Smrg         params[0] = ctx->Const.SubPixelBits;
46237117f1b4Smrg         break;
46247117f1b4Smrg      case GL_TEXTURE_1D:
46257117f1b4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D));
46267117f1b4Smrg         break;
46277117f1b4Smrg      case GL_TEXTURE_2D:
46287117f1b4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D));
46297117f1b4Smrg         break;
46307117f1b4Smrg      case GL_TEXTURE_3D:
46317117f1b4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_3D));
46327117f1b4Smrg         break;
4633c1f859d4Smrg      case GL_TEXTURE_1D_ARRAY_EXT:
4634c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetIntegerv");
4635c1f859d4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT));
4636c1f859d4Smrg         break;
4637c1f859d4Smrg      case GL_TEXTURE_2D_ARRAY_EXT:
4638c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetIntegerv");
4639c1f859d4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT));
4640c1f859d4Smrg         break;
46417117f1b4Smrg      case GL_TEXTURE_BINDING_1D:
4642c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name;
46437117f1b4Smrg         break;
46447117f1b4Smrg      case GL_TEXTURE_BINDING_2D:
4645c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name;
46467117f1b4Smrg         break;
46477117f1b4Smrg      case GL_TEXTURE_BINDING_3D:
4648c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name;
46497117f1b4Smrg         break;
4650c1f859d4Smrg      case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
4651c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetIntegerv");
4652c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name;
46537117f1b4Smrg         break;
4654c1f859d4Smrg      case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
4655c1f859d4Smrg         CHECK_EXT1(MESA_texture_array, "GetIntegerv");
4656c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name;
46577117f1b4Smrg         break;
46587117f1b4Smrg      case GL_TEXTURE_GEN_S:
46597117f1b4Smrg         params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0));
46607117f1b4Smrg         break;
46617117f1b4Smrg      case GL_TEXTURE_GEN_T:
46627117f1b4Smrg         params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0));
46637117f1b4Smrg         break;
46647117f1b4Smrg      case GL_TEXTURE_GEN_R:
46657117f1b4Smrg         params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0));
46667117f1b4Smrg         break;
46677117f1b4Smrg      case GL_TEXTURE_GEN_Q:
46687117f1b4Smrg         params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0));
46697117f1b4Smrg         break;
46707117f1b4Smrg      case GL_TEXTURE_MATRIX:
46717117f1b4Smrg         {
4672cdc920a0Smrg         const GLfloat *matrix;
4673cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
4674cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
4675cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION, "glGet(texture matrix %u)",
4676cdc920a0Smrg                        unit);
4677cdc920a0Smrg            return;
4678cdc920a0Smrg         }
4679cdc920a0Smrg         matrix = ctx->TextureMatrixStack[unit].Top->m;
46807117f1b4Smrg         params[0] = IROUND(matrix[0]);
46817117f1b4Smrg         params[1] = IROUND(matrix[1]);
46827117f1b4Smrg         params[2] = IROUND(matrix[2]);
46837117f1b4Smrg         params[3] = IROUND(matrix[3]);
46847117f1b4Smrg         params[4] = IROUND(matrix[4]);
46857117f1b4Smrg         params[5] = IROUND(matrix[5]);
46867117f1b4Smrg         params[6] = IROUND(matrix[6]);
46877117f1b4Smrg         params[7] = IROUND(matrix[7]);
46887117f1b4Smrg         params[8] = IROUND(matrix[8]);
46897117f1b4Smrg         params[9] = IROUND(matrix[9]);
46907117f1b4Smrg         params[10] = IROUND(matrix[10]);
46917117f1b4Smrg         params[11] = IROUND(matrix[11]);
46927117f1b4Smrg         params[12] = IROUND(matrix[12]);
46937117f1b4Smrg         params[13] = IROUND(matrix[13]);
46947117f1b4Smrg         params[14] = IROUND(matrix[14]);
46957117f1b4Smrg         params[15] = IROUND(matrix[15]);
46967117f1b4Smrg         }
46977117f1b4Smrg         break;
46987117f1b4Smrg      case GL_TEXTURE_STACK_DEPTH:
4699cdc920a0Smrg         {
4700cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
4701cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
4702cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
4703cdc920a0Smrg                        "glGet(texture stack depth, unit %u)", unit);
4704cdc920a0Smrg            return;
4705cdc920a0Smrg         }
4706cdc920a0Smrg         params[0] = ctx->TextureMatrixStack[unit].Depth + 1;
4707cdc920a0Smrg         }
47087117f1b4Smrg         break;
47097117f1b4Smrg      case GL_UNPACK_ALIGNMENT:
47107117f1b4Smrg         params[0] = ctx->Unpack.Alignment;
47117117f1b4Smrg         break;
47127117f1b4Smrg      case GL_UNPACK_LSB_FIRST:
47137117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Unpack.LsbFirst);
47147117f1b4Smrg         break;
47157117f1b4Smrg      case GL_UNPACK_ROW_LENGTH:
47167117f1b4Smrg         params[0] = ctx->Unpack.RowLength;
47177117f1b4Smrg         break;
47187117f1b4Smrg      case GL_UNPACK_SKIP_PIXELS:
47197117f1b4Smrg         params[0] = ctx->Unpack.SkipPixels;
47207117f1b4Smrg         break;
47217117f1b4Smrg      case GL_UNPACK_SKIP_ROWS:
47227117f1b4Smrg         params[0] = ctx->Unpack.SkipRows;
47237117f1b4Smrg         break;
47247117f1b4Smrg      case GL_UNPACK_SWAP_BYTES:
47257117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Unpack.SwapBytes);
47267117f1b4Smrg         break;
47277117f1b4Smrg      case GL_UNPACK_SKIP_IMAGES_EXT:
47287117f1b4Smrg         params[0] = ctx->Unpack.SkipImages;
47297117f1b4Smrg         break;
47307117f1b4Smrg      case GL_UNPACK_IMAGE_HEIGHT_EXT:
47317117f1b4Smrg         params[0] = ctx->Unpack.ImageHeight;
47327117f1b4Smrg         break;
47337117f1b4Smrg      case GL_UNPACK_CLIENT_STORAGE_APPLE:
47347117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Unpack.ClientStorage);
47357117f1b4Smrg         break;
47367117f1b4Smrg      case GL_VIEWPORT:
47377117f1b4Smrg         params[0] = ctx->Viewport.X;
47387117f1b4Smrg         params[1] = ctx->Viewport.Y;
47397117f1b4Smrg         params[2] = ctx->Viewport.Width;
47407117f1b4Smrg         params[3] = ctx->Viewport.Height;
47417117f1b4Smrg         break;
47427117f1b4Smrg      case GL_ZOOM_X:
47437117f1b4Smrg         params[0] = IROUND(ctx->Pixel.ZoomX);
47447117f1b4Smrg         break;
47457117f1b4Smrg      case GL_ZOOM_Y:
47467117f1b4Smrg         params[0] = IROUND(ctx->Pixel.ZoomY);
47477117f1b4Smrg         break;
47487117f1b4Smrg      case GL_VERTEX_ARRAY:
47497117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Vertex.Enabled);
47507117f1b4Smrg         break;
47517117f1b4Smrg      case GL_VERTEX_ARRAY_SIZE:
47527117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Vertex.Size;
47537117f1b4Smrg         break;
47547117f1b4Smrg      case GL_VERTEX_ARRAY_TYPE:
47557117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Vertex.Type);
47567117f1b4Smrg         break;
47577117f1b4Smrg      case GL_VERTEX_ARRAY_STRIDE:
47587117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Vertex.Stride;
47597117f1b4Smrg         break;
47607117f1b4Smrg      case GL_VERTEX_ARRAY_COUNT_EXT:
47617117f1b4Smrg         params[0] = 0;
47627117f1b4Smrg         break;
47637117f1b4Smrg      case GL_NORMAL_ARRAY:
47647117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Enabled);
47657117f1b4Smrg         break;
47667117f1b4Smrg      case GL_NORMAL_ARRAY_TYPE:
47677117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Normal.Type);
47687117f1b4Smrg         break;
47697117f1b4Smrg      case GL_NORMAL_ARRAY_STRIDE:
47707117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Normal.Stride;
47717117f1b4Smrg         break;
47727117f1b4Smrg      case GL_NORMAL_ARRAY_COUNT_EXT:
47737117f1b4Smrg         params[0] = 0;
47747117f1b4Smrg         break;
47757117f1b4Smrg      case GL_COLOR_ARRAY:
47767117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Color.Enabled);
47777117f1b4Smrg         break;
47787117f1b4Smrg      case GL_COLOR_ARRAY_SIZE:
47797117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Color.Size;
47807117f1b4Smrg         break;
47817117f1b4Smrg      case GL_COLOR_ARRAY_TYPE:
47827117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Color.Type);
47837117f1b4Smrg         break;
47847117f1b4Smrg      case GL_COLOR_ARRAY_STRIDE:
47857117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Color.Stride;
47867117f1b4Smrg         break;
47877117f1b4Smrg      case GL_COLOR_ARRAY_COUNT_EXT:
47887117f1b4Smrg         params[0] = 0;
47897117f1b4Smrg         break;
47907117f1b4Smrg      case GL_INDEX_ARRAY:
47917117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->Index.Enabled);
47927117f1b4Smrg         break;
47937117f1b4Smrg      case GL_INDEX_ARRAY_TYPE:
47947117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->Index.Type);
47957117f1b4Smrg         break;
47967117f1b4Smrg      case GL_INDEX_ARRAY_STRIDE:
47977117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Index.Stride;
47987117f1b4Smrg         break;
47997117f1b4Smrg      case GL_INDEX_ARRAY_COUNT_EXT:
48007117f1b4Smrg         params[0] = 0;
48017117f1b4Smrg         break;
48027117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY:
48037117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled);
48047117f1b4Smrg         break;
48057117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_SIZE:
48067117f1b4Smrg         params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size;
48077117f1b4Smrg         break;
48087117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_TYPE:
48097117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type);
48107117f1b4Smrg         break;
48117117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_STRIDE:
48127117f1b4Smrg         params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride;
48137117f1b4Smrg         break;
48147117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
48157117f1b4Smrg         params[0] = 0;
48167117f1b4Smrg         break;
48177117f1b4Smrg      case GL_EDGE_FLAG_ARRAY:
48187117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->EdgeFlag.Enabled);
48197117f1b4Smrg         break;
48207117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_STRIDE:
48217117f1b4Smrg         params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride;
48227117f1b4Smrg         break;
48237117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
48247117f1b4Smrg         params[0] = 0;
48257117f1b4Smrg         break;
48267117f1b4Smrg      case GL_MAX_TEXTURE_UNITS_ARB:
48277117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetIntegerv");
48287117f1b4Smrg         params[0] = ctx->Const.MaxTextureUnits;
48297117f1b4Smrg         break;
48307117f1b4Smrg      case GL_ACTIVE_TEXTURE_ARB:
48317117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetIntegerv");
48327117f1b4Smrg         params[0] = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
48337117f1b4Smrg         break;
48347117f1b4Smrg      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
48357117f1b4Smrg         CHECK_EXT1(ARB_multitexture, "GetIntegerv");
48367117f1b4Smrg         params[0] = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
48377117f1b4Smrg         break;
48387117f1b4Smrg      case GL_TEXTURE_CUBE_MAP_ARB:
48397117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv");
48407117f1b4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB));
48417117f1b4Smrg         break;
48427117f1b4Smrg      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
48437117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv");
4844c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name;
48457117f1b4Smrg         break;
48467117f1b4Smrg      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
48477117f1b4Smrg         CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv");
48487117f1b4Smrg         params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
48497117f1b4Smrg         break;
48507117f1b4Smrg      case GL_TEXTURE_COMPRESSION_HINT_ARB:
48517117f1b4Smrg         params[0] = ctx->Hint.TextureCompression;
48527117f1b4Smrg         break;
48537117f1b4Smrg      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
48547117f1b4Smrg         params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
48557117f1b4Smrg         break;
48567117f1b4Smrg      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
48577117f1b4Smrg         {
48587117f1b4Smrg         GLint formats[100];
48597117f1b4Smrg         GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
48607117f1b4Smrg         ASSERT(n <= 100);
48617117f1b4Smrg         for (i = 0; i < n; i++)
48627117f1b4Smrg            params[i] = ENUM_TO_INT(formats[i]);
48637117f1b4Smrg         }
48647117f1b4Smrg         break;
48657117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
48667117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv");
48677117f1b4Smrg         params[0] = ctx->Array.LockFirst;
48687117f1b4Smrg         break;
48697117f1b4Smrg      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
48707117f1b4Smrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetIntegerv");
48717117f1b4Smrg         params[0] = ctx->Array.LockCount;
48727117f1b4Smrg         break;
48737117f1b4Smrg      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
48747117f1b4Smrg         {
48757117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
48767117f1b4Smrg         params[0] = IROUND(matrix[0]);
48777117f1b4Smrg         params[1] = IROUND(matrix[4]);
48787117f1b4Smrg         params[2] = IROUND(matrix[8]);
48797117f1b4Smrg         params[3] = IROUND(matrix[12]);
48807117f1b4Smrg         params[4] = IROUND(matrix[1]);
48817117f1b4Smrg         params[5] = IROUND(matrix[5]);
48827117f1b4Smrg         params[6] = IROUND(matrix[9]);
48837117f1b4Smrg         params[7] = IROUND(matrix[13]);
48847117f1b4Smrg         params[8] = IROUND(matrix[2]);
48857117f1b4Smrg         params[9] = IROUND(matrix[6]);
48867117f1b4Smrg         params[10] = IROUND(matrix[10]);
48877117f1b4Smrg         params[11] = IROUND(matrix[14]);
48887117f1b4Smrg         params[12] = IROUND(matrix[3]);
48897117f1b4Smrg         params[13] = IROUND(matrix[7]);
48907117f1b4Smrg         params[14] = IROUND(matrix[11]);
48917117f1b4Smrg         params[15] = IROUND(matrix[15]);
48927117f1b4Smrg         }
48937117f1b4Smrg         break;
48947117f1b4Smrg      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
48957117f1b4Smrg         {
48967117f1b4Smrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
48977117f1b4Smrg         params[0] = IROUND(matrix[0]);
48987117f1b4Smrg         params[1] = IROUND(matrix[4]);
48997117f1b4Smrg         params[2] = IROUND(matrix[8]);
49007117f1b4Smrg         params[3] = IROUND(matrix[12]);
49017117f1b4Smrg         params[4] = IROUND(matrix[1]);
49027117f1b4Smrg         params[5] = IROUND(matrix[5]);
49037117f1b4Smrg         params[6] = IROUND(matrix[9]);
49047117f1b4Smrg         params[7] = IROUND(matrix[13]);
49057117f1b4Smrg         params[8] = IROUND(matrix[2]);
49067117f1b4Smrg         params[9] = IROUND(matrix[6]);
49077117f1b4Smrg         params[10] = IROUND(matrix[10]);
49087117f1b4Smrg         params[11] = IROUND(matrix[14]);
49097117f1b4Smrg         params[12] = IROUND(matrix[3]);
49107117f1b4Smrg         params[13] = IROUND(matrix[7]);
49117117f1b4Smrg         params[14] = IROUND(matrix[11]);
49127117f1b4Smrg         params[15] = IROUND(matrix[15]);
49137117f1b4Smrg         }
49147117f1b4Smrg         break;
49157117f1b4Smrg      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
49167117f1b4Smrg         {
49177117f1b4Smrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
49187117f1b4Smrg         params[0] = IROUND(matrix[0]);
49197117f1b4Smrg         params[1] = IROUND(matrix[4]);
49207117f1b4Smrg         params[2] = IROUND(matrix[8]);
49217117f1b4Smrg         params[3] = IROUND(matrix[12]);
49227117f1b4Smrg         params[4] = IROUND(matrix[1]);
49237117f1b4Smrg         params[5] = IROUND(matrix[5]);
49247117f1b4Smrg         params[6] = IROUND(matrix[9]);
49257117f1b4Smrg         params[7] = IROUND(matrix[13]);
49267117f1b4Smrg         params[8] = IROUND(matrix[2]);
49277117f1b4Smrg         params[9] = IROUND(matrix[6]);
49287117f1b4Smrg         params[10] = IROUND(matrix[10]);
49297117f1b4Smrg         params[11] = IROUND(matrix[14]);
49307117f1b4Smrg         params[12] = IROUND(matrix[3]);
49317117f1b4Smrg         params[13] = IROUND(matrix[7]);
49327117f1b4Smrg         params[14] = IROUND(matrix[11]);
49337117f1b4Smrg         params[15] = IROUND(matrix[15]);
49347117f1b4Smrg         }
49357117f1b4Smrg         break;
49367117f1b4Smrg      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
49377117f1b4Smrg         {
49387117f1b4Smrg         const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;
49397117f1b4Smrg         params[0] = IROUND(matrix[0]);
49407117f1b4Smrg         params[1] = IROUND(matrix[4]);
49417117f1b4Smrg         params[2] = IROUND(matrix[8]);
49427117f1b4Smrg         params[3] = IROUND(matrix[12]);
49437117f1b4Smrg         params[4] = IROUND(matrix[1]);
49447117f1b4Smrg         params[5] = IROUND(matrix[5]);
49457117f1b4Smrg         params[6] = IROUND(matrix[9]);
49467117f1b4Smrg         params[7] = IROUND(matrix[13]);
49477117f1b4Smrg         params[8] = IROUND(matrix[2]);
49487117f1b4Smrg         params[9] = IROUND(matrix[6]);
49497117f1b4Smrg         params[10] = IROUND(matrix[10]);
49507117f1b4Smrg         params[11] = IROUND(matrix[14]);
49517117f1b4Smrg         params[12] = IROUND(matrix[3]);
49527117f1b4Smrg         params[13] = IROUND(matrix[7]);
49537117f1b4Smrg         params[14] = IROUND(matrix[11]);
49547117f1b4Smrg         params[15] = IROUND(matrix[15]);
49557117f1b4Smrg         }
49567117f1b4Smrg         break;
49577117f1b4Smrg      case GL_COLOR_MATRIX_SGI:
49587117f1b4Smrg         {
49597117f1b4Smrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
49607117f1b4Smrg         params[0] = IROUND(matrix[0]);
49617117f1b4Smrg         params[1] = IROUND(matrix[1]);
49627117f1b4Smrg         params[2] = IROUND(matrix[2]);
49637117f1b4Smrg         params[3] = IROUND(matrix[3]);
49647117f1b4Smrg         params[4] = IROUND(matrix[4]);
49657117f1b4Smrg         params[5] = IROUND(matrix[5]);
49667117f1b4Smrg         params[6] = IROUND(matrix[6]);
49677117f1b4Smrg         params[7] = IROUND(matrix[7]);
49687117f1b4Smrg         params[8] = IROUND(matrix[8]);
49697117f1b4Smrg         params[9] = IROUND(matrix[9]);
49707117f1b4Smrg         params[10] = IROUND(matrix[10]);
49717117f1b4Smrg         params[11] = IROUND(matrix[11]);
49727117f1b4Smrg         params[12] = IROUND(matrix[12]);
49737117f1b4Smrg         params[13] = IROUND(matrix[13]);
49747117f1b4Smrg         params[14] = IROUND(matrix[14]);
49757117f1b4Smrg         params[15] = IROUND(matrix[15]);
49767117f1b4Smrg         }
49777117f1b4Smrg         break;
49787117f1b4Smrg      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
49797117f1b4Smrg         params[0] = ctx->ColorMatrixStack.Depth + 1;
49807117f1b4Smrg         break;
49817117f1b4Smrg      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
49827117f1b4Smrg         params[0] = MAX_COLOR_STACK_DEPTH;
49837117f1b4Smrg         break;
49847117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
49857117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[0]);
49867117f1b4Smrg         break;
49877117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
49887117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[1]);
49897117f1b4Smrg         break;
49907117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
49917117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[2]);
49927117f1b4Smrg         break;
49937117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
49947117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixScale[3]);
49957117f1b4Smrg         break;
49967117f1b4Smrg      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
49977117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[0]);
49987117f1b4Smrg         break;
49997117f1b4Smrg      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
50007117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[1]);
50017117f1b4Smrg         break;
50027117f1b4Smrg      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
50037117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[2]);
50047117f1b4Smrg         break;
50057117f1b4Smrg      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
50067117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostColorMatrixBias[3]);
50077117f1b4Smrg         break;
50087117f1b4Smrg      case GL_CONVOLUTION_1D_EXT:
50097117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50107117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution1DEnabled);
50117117f1b4Smrg         break;
50127117f1b4Smrg      case GL_CONVOLUTION_2D_EXT:
50137117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50147117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.Convolution2DEnabled);
50157117f1b4Smrg         break;
50167117f1b4Smrg      case GL_SEPARABLE_2D_EXT:
50177117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50187117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.Separable2DEnabled);
50197117f1b4Smrg         break;
50207117f1b4Smrg      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
50217117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50227117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionScale[0]);
50237117f1b4Smrg         break;
50247117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
50257117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50267117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionScale[1]);
50277117f1b4Smrg         break;
50287117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
50297117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50307117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionScale[2]);
50317117f1b4Smrg         break;
50327117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
50337117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50347117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionScale[3]);
50357117f1b4Smrg         break;
50367117f1b4Smrg      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
50377117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50387117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionBias[0]);
50397117f1b4Smrg         break;
50407117f1b4Smrg      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
50417117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50427117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionBias[1]);
50437117f1b4Smrg         break;
50447117f1b4Smrg      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
50457117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50467117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionBias[2]);
50477117f1b4Smrg         break;
50487117f1b4Smrg      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
50497117f1b4Smrg         CHECK_EXT1(EXT_convolution, "GetIntegerv");
50507117f1b4Smrg         params[0] = IROUND(ctx->Pixel.PostConvolutionBias[3]);
50517117f1b4Smrg         break;
50527117f1b4Smrg      case GL_HISTOGRAM:
50537117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetIntegerv");
50547117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.HistogramEnabled);
50557117f1b4Smrg         break;
50567117f1b4Smrg      case GL_MINMAX:
50577117f1b4Smrg         CHECK_EXT1(EXT_histogram, "GetIntegerv");
50587117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.MinMaxEnabled);
50597117f1b4Smrg         break;
50607117f1b4Smrg      case GL_COLOR_TABLE_SGI:
50617117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetIntegerv");
50627117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]);
50637117f1b4Smrg         break;
50647117f1b4Smrg      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
50657117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetIntegerv");
50667117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]);
50677117f1b4Smrg         break;
50687117f1b4Smrg      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
50697117f1b4Smrg         CHECK_EXT1(SGI_color_table, "GetIntegerv");
50707117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]);
50717117f1b4Smrg         break;
50727117f1b4Smrg      case GL_TEXTURE_COLOR_TABLE_SGI:
50737117f1b4Smrg         CHECK_EXT1(SGI_texture_color_table, "GetIntegerv");
50747117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled);
50757117f1b4Smrg         break;
50767117f1b4Smrg      case GL_COLOR_SUM_EXT:
50777117f1b4Smrg         CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetIntegerv");
50787117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Fog.ColorSumEnabled);
50797117f1b4Smrg         break;
50807117f1b4Smrg      case GL_CURRENT_SECONDARY_COLOR_EXT:
50817117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
50827117f1b4Smrg         {
50837117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
50847117f1b4Smrg         params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
50857117f1b4Smrg         params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
50867117f1b4Smrg         params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
50877117f1b4Smrg         params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]);
50887117f1b4Smrg         }
50897117f1b4Smrg         break;
50907117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_EXT:
50917117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
50927117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Enabled);
50937117f1b4Smrg         break;
50947117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
50957117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
50967117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->SecondaryColor.Type);
50977117f1b4Smrg         break;
50987117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
50997117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
51007117f1b4Smrg         params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride;
51017117f1b4Smrg         break;
51027117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
51037117f1b4Smrg         CHECK_EXT1(EXT_secondary_color, "GetIntegerv");
51047117f1b4Smrg         params[0] = ctx->Array.ArrayObj->SecondaryColor.Size;
51057117f1b4Smrg         break;
51067117f1b4Smrg      case GL_CURRENT_FOG_COORDINATE_EXT:
51077117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetIntegerv");
51087117f1b4Smrg         {
51097117f1b4Smrg         FLUSH_CURRENT(ctx, 0);
51107117f1b4Smrg         params[0] = IROUND(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
51117117f1b4Smrg         }
51127117f1b4Smrg         break;
51137117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_EXT:
51147117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetIntegerv");
51157117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->FogCoord.Enabled);
51167117f1b4Smrg         break;
51177117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
51187117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetIntegerv");
51197117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Array.ArrayObj->FogCoord.Type);
51207117f1b4Smrg         break;
51217117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
51227117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetIntegerv");
51237117f1b4Smrg         params[0] = ctx->Array.ArrayObj->FogCoord.Stride;
51247117f1b4Smrg         break;
51257117f1b4Smrg      case GL_FOG_COORDINATE_SOURCE_EXT:
51267117f1b4Smrg         CHECK_EXT1(EXT_fog_coord, "GetIntegerv");
51277117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Fog.FogCoordinateSource);
51287117f1b4Smrg         break;
51297117f1b4Smrg      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
51307117f1b4Smrg         CHECK_EXT1(EXT_texture_lod_bias, "GetIntegerv");
51317117f1b4Smrg         params[0] = IROUND(ctx->Const.MaxTextureLodBias);
51327117f1b4Smrg         break;
51337117f1b4Smrg      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
51347117f1b4Smrg         CHECK_EXT1(EXT_texture_filter_anisotropic, "GetIntegerv");
51357117f1b4Smrg         params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy);
51367117f1b4Smrg         break;
51377117f1b4Smrg      case GL_MULTISAMPLE_ARB:
51387117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled);
51397117f1b4Smrg         break;
51407117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
51417117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage);
51427117f1b4Smrg         break;
51437117f1b4Smrg      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
51447117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne);
51457117f1b4Smrg         break;
51467117f1b4Smrg      case GL_SAMPLE_COVERAGE_ARB:
51477117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage);
51487117f1b4Smrg         break;
51497117f1b4Smrg      case GL_SAMPLE_COVERAGE_VALUE_ARB:
51507117f1b4Smrg         params[0] = IROUND(ctx->Multisample.SampleCoverageValue);
51517117f1b4Smrg         break;
51527117f1b4Smrg      case GL_SAMPLE_COVERAGE_INVERT_ARB:
51537117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert);
51547117f1b4Smrg         break;
51557117f1b4Smrg      case GL_SAMPLE_BUFFERS_ARB:
51567117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.sampleBuffers;
51577117f1b4Smrg         break;
51587117f1b4Smrg      case GL_SAMPLES_ARB:
51597117f1b4Smrg         params[0] = ctx->DrawBuffer->Visual.samples;
51607117f1b4Smrg         break;
51617117f1b4Smrg      case GL_RASTER_POSITION_UNCLIPPED_IBM:
51627117f1b4Smrg         CHECK_EXT1(IBM_rasterpos_clip, "GetIntegerv");
51637117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Transform.RasterPositionUnclipped);
51647117f1b4Smrg         break;
51657117f1b4Smrg      case GL_POINT_SPRITE_NV:
51667117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv");
51677117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Point.PointSprite);
51687117f1b4Smrg         break;
51697117f1b4Smrg      case GL_POINT_SPRITE_R_MODE_NV:
51707117f1b4Smrg         CHECK_EXT1(NV_point_sprite, "GetIntegerv");
51717117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Point.SpriteRMode);
51727117f1b4Smrg         break;
51737117f1b4Smrg      case GL_POINT_SPRITE_COORD_ORIGIN:
51747117f1b4Smrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetIntegerv");
51757117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Point.SpriteOrigin);
51767117f1b4Smrg         break;
51777117f1b4Smrg      case GL_GENERATE_MIPMAP_HINT_SGIS:
51787117f1b4Smrg         CHECK_EXT1(SGIS_generate_mipmap, "GetIntegerv");
51797117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.GenerateMipmap);
51807117f1b4Smrg         break;
51817117f1b4Smrg      case GL_VERTEX_PROGRAM_BINDING_NV:
51827117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
51837117f1b4Smrg         params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0);
51847117f1b4Smrg         break;
51857117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY0_NV:
51867117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
51877117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[0].Enabled);
51887117f1b4Smrg         break;
51897117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY1_NV:
51907117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
51917117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[1].Enabled);
51927117f1b4Smrg         break;
51937117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY2_NV:
51947117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
51957117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[2].Enabled);
51967117f1b4Smrg         break;
51977117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY3_NV:
51987117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
51997117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[3].Enabled);
52007117f1b4Smrg         break;
52017117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY4_NV:
52027117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52037117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[4].Enabled);
52047117f1b4Smrg         break;
52057117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY5_NV:
52067117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52077117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[5].Enabled);
52087117f1b4Smrg         break;
52097117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY6_NV:
52107117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52117117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[6].Enabled);
52127117f1b4Smrg         break;
52137117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY7_NV:
52147117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52157117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[7].Enabled);
52167117f1b4Smrg         break;
52177117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY8_NV:
52187117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52197117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[8].Enabled);
52207117f1b4Smrg         break;
52217117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY9_NV:
52227117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52237117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[9].Enabled);
52247117f1b4Smrg         break;
52257117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY10_NV:
52267117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52277117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[10].Enabled);
52287117f1b4Smrg         break;
52297117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY11_NV:
52307117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52317117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[11].Enabled);
52327117f1b4Smrg         break;
52337117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY12_NV:
52347117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52357117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[12].Enabled);
52367117f1b4Smrg         break;
52377117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY13_NV:
52387117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52397117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[13].Enabled);
52407117f1b4Smrg         break;
52417117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY14_NV:
52427117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52437117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[14].Enabled);
52447117f1b4Smrg         break;
52457117f1b4Smrg      case GL_VERTEX_ATTRIB_ARRAY15_NV:
52467117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52477117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Array.ArrayObj->VertexAttrib[15].Enabled);
52487117f1b4Smrg         break;
52497117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
52507117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52517117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[0]);
52527117f1b4Smrg         break;
52537117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
52547117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52557117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[1]);
52567117f1b4Smrg         break;
52577117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
52587117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52597117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[2]);
52607117f1b4Smrg         break;
52617117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
52627117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52637117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[3]);
52647117f1b4Smrg         break;
52657117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
52667117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52677117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[4]);
52687117f1b4Smrg         break;
52697117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
52707117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52717117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[5]);
52727117f1b4Smrg         break;
52737117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
52747117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52757117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[6]);
52767117f1b4Smrg         break;
52777117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
52787117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52797117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[7]);
52807117f1b4Smrg         break;
52817117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
52827117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52837117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[8]);
52847117f1b4Smrg         break;
52857117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
52867117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52877117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[9]);
52887117f1b4Smrg         break;
52897117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
52907117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52917117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[10]);
52927117f1b4Smrg         break;
52937117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
52947117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52957117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[11]);
52967117f1b4Smrg         break;
52977117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
52987117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
52997117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[12]);
53007117f1b4Smrg         break;
53017117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
53027117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
53037117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[13]);
53047117f1b4Smrg         break;
53057117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
53067117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
53077117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[14]);
53087117f1b4Smrg         break;
53097117f1b4Smrg      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
53107117f1b4Smrg         CHECK_EXT1(NV_vertex_program, "GetIntegerv");
53117117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Eval.Map1Attrib[15]);
53127117f1b4Smrg         break;
53137117f1b4Smrg      case GL_FRAGMENT_PROGRAM_NV:
53147117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetIntegerv");
53157117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled);
53167117f1b4Smrg         break;
53177117f1b4Smrg      case GL_FRAGMENT_PROGRAM_BINDING_NV:
53187117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetIntegerv");
53197117f1b4Smrg         params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0;
53207117f1b4Smrg         break;
53217117f1b4Smrg      case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
53227117f1b4Smrg         CHECK_EXT1(NV_fragment_program, "GetIntegerv");
53237117f1b4Smrg         params[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
53247117f1b4Smrg         break;
53257117f1b4Smrg      case GL_TEXTURE_RECTANGLE_NV:
53267117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetIntegerv");
53277117f1b4Smrg         params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV));
53287117f1b4Smrg         break;
53297117f1b4Smrg      case GL_TEXTURE_BINDING_RECTANGLE_NV:
53307117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetIntegerv");
5331c1f859d4Smrg         params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name;
53327117f1b4Smrg         break;
53337117f1b4Smrg      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
53347117f1b4Smrg         CHECK_EXT1(NV_texture_rectangle, "GetIntegerv");
53357117f1b4Smrg         params[0] = ctx->Const.MaxTextureRectSize;
53367117f1b4Smrg         break;
53377117f1b4Smrg      case GL_STENCIL_TEST_TWO_SIDE_EXT:
53387117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv");
53397117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Stencil.TestTwoSide);
53407117f1b4Smrg         break;
53417117f1b4Smrg      case GL_ACTIVE_STENCIL_FACE_EXT:
53427117f1b4Smrg         CHECK_EXT1(EXT_stencil_two_side, "GetIntegerv");
53437117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
53447117f1b4Smrg         break;
53457117f1b4Smrg      case GL_MAX_SHININESS_NV:
53467117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetIntegerv");
53477117f1b4Smrg         params[0] = IROUND(ctx->Const.MaxShininess);
53487117f1b4Smrg         break;
53497117f1b4Smrg      case GL_MAX_SPOT_EXPONENT_NV:
53507117f1b4Smrg         CHECK_EXT1(NV_light_max_exponent, "GetIntegerv");
53517117f1b4Smrg         params[0] = IROUND(ctx->Const.MaxSpotExponent);
53527117f1b4Smrg         break;
53537117f1b4Smrg      case GL_ARRAY_BUFFER_BINDING_ARB:
53547117f1b4Smrg         params[0] = ctx->Array.ArrayBufferObj->Name;
53557117f1b4Smrg         break;
53567117f1b4Smrg      case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
53577117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name;
53587117f1b4Smrg         break;
53597117f1b4Smrg      case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
53607117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name;
53617117f1b4Smrg         break;
53627117f1b4Smrg      case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
53637117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name;
53647117f1b4Smrg         break;
53657117f1b4Smrg      case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
53667117f1b4Smrg         params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name;
53677117f1b4Smrg         break;
53687117f1b4Smrg      case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
53697117f1b4Smrg         params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name;
53707117f1b4Smrg         break;
53717117f1b4Smrg      case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
53727117f1b4Smrg         params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name;
53737117f1b4Smrg         break;
53747117f1b4Smrg      case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
53757117f1b4Smrg         params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name;
53767117f1b4Smrg         break;
53777117f1b4Smrg      case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
53787117f1b4Smrg         params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name;
53797117f1b4Smrg         break;
53807117f1b4Smrg      case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
53817117f1b4Smrg         params[0] = ctx->Array.ElementArrayBufferObj->Name;
53827117f1b4Smrg         break;
53837117f1b4Smrg      case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
53847117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv");
53857117f1b4Smrg         params[0] = ctx->Pack.BufferObj->Name;
53867117f1b4Smrg         break;
53877117f1b4Smrg      case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
53887117f1b4Smrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv");
53897117f1b4Smrg         params[0] = ctx->Unpack.BufferObj->Name;
53907117f1b4Smrg         break;
53917117f1b4Smrg      case GL_VERTEX_PROGRAM_ARB:
53927117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv");
53937117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.Enabled);
53947117f1b4Smrg         break;
53957117f1b4Smrg      case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
53967117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv");
53977117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.PointSizeEnabled);
53987117f1b4Smrg         break;
53997117f1b4Smrg      case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
54007117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv");
54017117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.TwoSideEnabled);
54027117f1b4Smrg         break;
54037117f1b4Smrg      case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
54047117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv");
54057117f1b4Smrg         params[0] = ctx->Const.MaxProgramMatrixStackDepth;
54067117f1b4Smrg         break;
54077117f1b4Smrg      case GL_MAX_PROGRAM_MATRICES_ARB:
54087117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv");
54097117f1b4Smrg         params[0] = ctx->Const.MaxProgramMatrices;
54107117f1b4Smrg         break;
54117117f1b4Smrg      case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
54127117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv");
54137117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->CurrentStack->Depth + 1);
54147117f1b4Smrg         break;
54157117f1b4Smrg      case GL_CURRENT_MATRIX_ARB:
54167117f1b4Smrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetIntegerv");
54177117f1b4Smrg         {
54187117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
54197117f1b4Smrg         params[0] = IROUND(matrix[0]);
54207117f1b4Smrg         params[1] = IROUND(matrix[1]);
54217117f1b4Smrg         params[2] = IROUND(matrix[2]);
54227117f1b4Smrg         params[3] = IROUND(matrix[3]);
54237117f1b4Smrg         params[4] = IROUND(matrix[4]);
54247117f1b4Smrg         params[5] = IROUND(matrix[5]);
54257117f1b4Smrg         params[6] = IROUND(matrix[6]);
54267117f1b4Smrg         params[7] = IROUND(matrix[7]);
54277117f1b4Smrg         params[8] = IROUND(matrix[8]);
54287117f1b4Smrg         params[9] = IROUND(matrix[9]);
54297117f1b4Smrg         params[10] = IROUND(matrix[10]);
54307117f1b4Smrg         params[11] = IROUND(matrix[11]);
54317117f1b4Smrg         params[12] = IROUND(matrix[12]);
54327117f1b4Smrg         params[13] = IROUND(matrix[13]);
54337117f1b4Smrg         params[14] = IROUND(matrix[14]);
54347117f1b4Smrg         params[15] = IROUND(matrix[15]);
54357117f1b4Smrg         }
54367117f1b4Smrg         break;
54377117f1b4Smrg      case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
54387117f1b4Smrg         CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetIntegerv");
54397117f1b4Smrg         {
54407117f1b4Smrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
54417117f1b4Smrg         params[0] = IROUND(matrix[0]);
54427117f1b4Smrg         params[1] = IROUND(matrix[4]);
54437117f1b4Smrg         params[2] = IROUND(matrix[8]);
54447117f1b4Smrg         params[3] = IROUND(matrix[12]);
54457117f1b4Smrg         params[4] = IROUND(matrix[1]);
54467117f1b4Smrg         params[5] = IROUND(matrix[5]);
54477117f1b4Smrg         params[6] = IROUND(matrix[9]);
54487117f1b4Smrg         params[7] = IROUND(matrix[13]);
54497117f1b4Smrg         params[8] = IROUND(matrix[2]);
54507117f1b4Smrg         params[9] = IROUND(matrix[6]);
54517117f1b4Smrg         params[10] = IROUND(matrix[10]);
54527117f1b4Smrg         params[11] = IROUND(matrix[14]);
54537117f1b4Smrg         params[12] = IROUND(matrix[3]);
54547117f1b4Smrg         params[13] = IROUND(matrix[7]);
54557117f1b4Smrg         params[14] = IROUND(matrix[11]);
54567117f1b4Smrg         params[15] = IROUND(matrix[15]);
54577117f1b4Smrg         }
54587117f1b4Smrg         break;
54597117f1b4Smrg      case GL_MAX_VERTEX_ATTRIBS_ARB:
54607117f1b4Smrg         CHECK_EXT1(ARB_vertex_program, "GetIntegerv");
54617117f1b4Smrg         params[0] = ctx->Const.VertexProgram.MaxAttribs;
54627117f1b4Smrg         break;
54637117f1b4Smrg      case GL_PROGRAM_ERROR_POSITION_ARB:
54647117f1b4Smrg         CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetIntegerv");
54657117f1b4Smrg         params[0] = ctx->Program.ErrorPos;
54667117f1b4Smrg         break;
54677117f1b4Smrg      case GL_FRAGMENT_PROGRAM_ARB:
54687117f1b4Smrg         CHECK_EXT1(ARB_fragment_program, "GetIntegerv");
54697117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled);
54707117f1b4Smrg         break;
54717117f1b4Smrg      case GL_MAX_TEXTURE_COORDS_ARB:
54727117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv");
54737117f1b4Smrg         params[0] = ctx->Const.MaxTextureCoordUnits;
54747117f1b4Smrg         break;
54757117f1b4Smrg      case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
54767117f1b4Smrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv");
54777117f1b4Smrg         params[0] = ctx->Const.MaxTextureImageUnits;
54787117f1b4Smrg         break;
54797117f1b4Smrg      case GL_DEPTH_BOUNDS_TEST_EXT:
54807117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv");
54817117f1b4Smrg         params[0] = BOOLEAN_TO_INT(ctx->Depth.BoundsTest);
54827117f1b4Smrg         break;
54837117f1b4Smrg      case GL_DEPTH_BOUNDS_EXT:
54847117f1b4Smrg         CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv");
54857117f1b4Smrg         params[0] = IROUND(ctx->Depth.BoundsMin);
54867117f1b4Smrg         params[1] = IROUND(ctx->Depth.BoundsMax);
54877117f1b4Smrg         break;
54884a49301eSmrg      case GL_DEPTH_CLAMP:
54894a49301eSmrg         CHECK_EXT1(ARB_depth_clamp, "GetIntegerv");
54904a49301eSmrg         params[0] = BOOLEAN_TO_INT(ctx->Transform.DepthClamp);
54917117f1b4Smrg         break;
54927117f1b4Smrg      case GL_MAX_DRAW_BUFFERS_ARB:
54937117f1b4Smrg         params[0] = ctx->Const.MaxDrawBuffers;
54947117f1b4Smrg         break;
54957117f1b4Smrg      case GL_DRAW_BUFFER0_ARB:
54967117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]);
54977117f1b4Smrg         break;
54987117f1b4Smrg      case GL_DRAW_BUFFER1_ARB:
54997117f1b4Smrg         {
55007117f1b4Smrg         GLenum buffer;
55017117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
55027117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
55037117f1b4Smrg            return;
55047117f1b4Smrg         }
55057117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
55067117f1b4Smrg         params[0] = ENUM_TO_INT(buffer);
55077117f1b4Smrg         }
55087117f1b4Smrg         break;
55097117f1b4Smrg      case GL_DRAW_BUFFER2_ARB:
55107117f1b4Smrg         {
55117117f1b4Smrg         GLenum buffer;
55127117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
55137117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
55147117f1b4Smrg            return;
55157117f1b4Smrg         }
55167117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
55177117f1b4Smrg         params[0] = ENUM_TO_INT(buffer);
55187117f1b4Smrg         }
55197117f1b4Smrg         break;
55207117f1b4Smrg      case GL_DRAW_BUFFER3_ARB:
55217117f1b4Smrg         {
55227117f1b4Smrg         GLenum buffer;
55237117f1b4Smrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
55247117f1b4Smrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
55257117f1b4Smrg            return;
55267117f1b4Smrg         }
55277117f1b4Smrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
55287117f1b4Smrg         params[0] = ENUM_TO_INT(buffer);
55297117f1b4Smrg         }
55307117f1b4Smrg         break;
55317117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
55327117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetIntegerv");
55334a49301eSmrg         params[0] = _mesa_get_color_read_type(ctx);
55347117f1b4Smrg         break;
55357117f1b4Smrg      case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
55367117f1b4Smrg         CHECK_EXT1(OES_read_format, "GetIntegerv");
55374a49301eSmrg         params[0] = _mesa_get_color_read_format(ctx);
55387117f1b4Smrg         break;
55397117f1b4Smrg      case GL_NUM_FRAGMENT_REGISTERS_ATI:
55407117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55417117f1b4Smrg         params[0] = 6;
55427117f1b4Smrg         break;
55437117f1b4Smrg      case GL_NUM_FRAGMENT_CONSTANTS_ATI:
55447117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55457117f1b4Smrg         params[0] = 8;
55467117f1b4Smrg         break;
55477117f1b4Smrg      case GL_NUM_PASSES_ATI:
55487117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55497117f1b4Smrg         params[0] = 2;
55507117f1b4Smrg         break;
55517117f1b4Smrg      case GL_NUM_INSTRUCTIONS_PER_PASS_ATI:
55527117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55537117f1b4Smrg         params[0] = 8;
55547117f1b4Smrg         break;
55557117f1b4Smrg      case GL_NUM_INSTRUCTIONS_TOTAL_ATI:
55567117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55577117f1b4Smrg         params[0] = 16;
55587117f1b4Smrg         break;
55597117f1b4Smrg      case GL_COLOR_ALPHA_PAIRING_ATI:
55607117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55617117f1b4Smrg         params[0] = BOOLEAN_TO_INT(GL_TRUE);
55627117f1b4Smrg         break;
55637117f1b4Smrg      case GL_NUM_LOOPBACK_COMPONENTS_ATI:
55647117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55657117f1b4Smrg         params[0] = 3;
55667117f1b4Smrg         break;
55677117f1b4Smrg      case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI:
55687117f1b4Smrg         CHECK_EXT1(ATI_fragment_shader, "GetIntegerv");
55697117f1b4Smrg         params[0] = 3;
55707117f1b4Smrg         break;
55717117f1b4Smrg      case GL_STENCIL_BACK_FUNC:
55727117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.Function[1]);
55737117f1b4Smrg         break;
55747117f1b4Smrg      case GL_STENCIL_BACK_VALUE_MASK:
55757117f1b4Smrg         params[0] = ctx->Stencil.ValueMask[1];
55767117f1b4Smrg         break;
55777117f1b4Smrg      case GL_STENCIL_BACK_WRITEMASK:
55787117f1b4Smrg         params[0] = ctx->Stencil.WriteMask[1];
55797117f1b4Smrg         break;
55807117f1b4Smrg      case GL_STENCIL_BACK_REF:
55817117f1b4Smrg         params[0] = ctx->Stencil.Ref[1];
55827117f1b4Smrg         break;
55837117f1b4Smrg      case GL_STENCIL_BACK_FAIL:
55847117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.FailFunc[1]);
55857117f1b4Smrg         break;
55867117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
55877117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.ZFailFunc[1]);
55887117f1b4Smrg         break;
55897117f1b4Smrg      case GL_STENCIL_BACK_PASS_DEPTH_PASS:
55907117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Stencil.ZPassFunc[1]);
55917117f1b4Smrg         break;
55927117f1b4Smrg      case GL_FRAMEBUFFER_BINDING_EXT:
55937117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv");
55947117f1b4Smrg         params[0] = ctx->DrawBuffer->Name;
55957117f1b4Smrg         break;
55967117f1b4Smrg      case GL_RENDERBUFFER_BINDING_EXT:
55977117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv");
55987117f1b4Smrg         params[0] = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
55997117f1b4Smrg         break;
56007117f1b4Smrg      case GL_MAX_COLOR_ATTACHMENTS_EXT:
56017117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv");
56027117f1b4Smrg         params[0] = ctx->Const.MaxColorAttachments;
56037117f1b4Smrg         break;
56047117f1b4Smrg      case GL_MAX_RENDERBUFFER_SIZE_EXT:
56057117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_object, "GetIntegerv");
56067117f1b4Smrg         params[0] = ctx->Const.MaxRenderbufferSize;
56077117f1b4Smrg         break;
56087117f1b4Smrg      case GL_READ_FRAMEBUFFER_BINDING_EXT:
56097117f1b4Smrg         CHECK_EXT1(EXT_framebuffer_blit, "GetIntegerv");
56107117f1b4Smrg         params[0] = ctx->ReadBuffer->Name;
56117117f1b4Smrg         break;
56124a49301eSmrg      case GL_PROVOKING_VERTEX_EXT:
56134a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetIntegerv");
56144a49301eSmrg         params[0] = BOOLEAN_TO_INT(ctx->Light.ProvokingVertex);
56154a49301eSmrg         break;
56164a49301eSmrg      case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT:
56174a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetIntegerv");
56184a49301eSmrg         params[0] = BOOLEAN_TO_INT(ctx->Const.QuadsFollowProvokingVertexConvention);
56194a49301eSmrg         break;
56207117f1b4Smrg      case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
56217117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetIntegerv");
56227117f1b4Smrg         params[0] = ctx->Const.FragmentProgram.MaxUniformComponents;
56237117f1b4Smrg         break;
56247117f1b4Smrg      case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
56257117f1b4Smrg         CHECK_EXT1(ARB_fragment_shader, "GetIntegerv");
56267117f1b4Smrg         params[0] = ENUM_TO_INT(ctx->Hint.FragmentShaderDerivative);
56277117f1b4Smrg         break;
56287117f1b4Smrg      case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
56297117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
56307117f1b4Smrg         params[0] = ctx->Const.VertexProgram.MaxUniformComponents;
56317117f1b4Smrg         break;
56327117f1b4Smrg      case GL_MAX_VARYING_FLOATS_ARB:
56337117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
56347117f1b4Smrg         params[0] = ctx->Const.MaxVarying * 4;
56357117f1b4Smrg         break;
56367117f1b4Smrg      case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
56377117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
56387117f1b4Smrg         params[0] = ctx->Const.MaxVertexTextureImageUnits;
56397117f1b4Smrg         break;
56407117f1b4Smrg      case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
56417117f1b4Smrg         CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
5642cdc920a0Smrg         params[0] = ctx->Const.MaxCombinedTextureImageUnits;
56437117f1b4Smrg         break;
56447117f1b4Smrg      case GL_CURRENT_PROGRAM:
56457117f1b4Smrg         CHECK_EXT1(ARB_shader_objects, "GetIntegerv");
56467117f1b4Smrg         params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0;
56477117f1b4Smrg         break;
56484a49301eSmrg      case GL_MAX_SAMPLES:
56494a49301eSmrg         CHECK_EXT1(ARB_framebuffer_object, "GetIntegerv");
56504a49301eSmrg         params[0] = ctx->Const.MaxSamples;
56514a49301eSmrg         break;
5652c7037ccdSmrg      case GL_VERTEX_ARRAY_BINDING_APPLE:
5653c7037ccdSmrg         CHECK_EXT1(APPLE_vertex_array_object, "GetIntegerv");
5654c7037ccdSmrg         params[0] = ctx->Array.ArrayObj->Name;
5655c7037ccdSmrg         break;
56564a49301eSmrg      case GL_TEXTURE_CUBE_MAP_SEAMLESS:
56574a49301eSmrg         CHECK_EXT1(ARB_seamless_cube_map, "GetIntegerv");
56584a49301eSmrg         params[0] = BOOLEAN_TO_INT(ctx->Texture.CubeMapSeamless);
56594a49301eSmrg         break;
56604a49301eSmrg      case GL_MAX_SERVER_WAIT_TIMEOUT:
56614a49301eSmrg         CHECK_EXT1(ARB_sync, "GetIntegerv");
56624a49301eSmrg         params[0] = INT64_TO_INT(ctx->Const.MaxServerWaitTimeout);
56634a49301eSmrg         break;
5664cdc920a0Smrg      case GL_NUM_EXTENSIONS:
5665cdc920a0Smrg         params[0] = _mesa_get_extension_count(ctx);
5666cdc920a0Smrg         break;
5667cdc920a0Smrg      case GL_MAJOR_VERSION:
5668cdc920a0Smrg         params[0] = ctx->VersionMajor;
5669cdc920a0Smrg         break;
5670cdc920a0Smrg      case GL_MINOR_VERSION:
5671cdc920a0Smrg         params[0] = ctx->VersionMinor;
5672cdc920a0Smrg         break;
56737117f1b4Smrg      default:
56747117f1b4Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
56757117f1b4Smrg   }
56767117f1b4Smrg}
56777117f1b4Smrg
56784a49301eSmrg#if FEATURE_ARB_sync
56794a49301eSmrgvoid GLAPIENTRY
56804a49301eSmrg_mesa_GetInteger64v( GLenum pname, GLint64 *params )
56814a49301eSmrg{
56824a49301eSmrg   GET_CURRENT_CONTEXT(ctx);
56834a49301eSmrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
56844a49301eSmrg
56854a49301eSmrg   if (!params)
56864a49301eSmrg      return;
56874a49301eSmrg
56884a49301eSmrg   if (ctx->NewState)
56894a49301eSmrg      _mesa_update_state(ctx);
56904a49301eSmrg
56914a49301eSmrg   if (ctx->Driver.GetInteger64v &&
56924a49301eSmrg       ctx->Driver.GetInteger64v(ctx, pname, params))
56934a49301eSmrg      return;
56944a49301eSmrg
56954a49301eSmrg   switch (pname) {
56964a49301eSmrg      case GL_ACCUM_RED_BITS:
56974a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumRedBits);
56984a49301eSmrg         break;
56994a49301eSmrg      case GL_ACCUM_GREEN_BITS:
57004a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumGreenBits);
57014a49301eSmrg         break;
57024a49301eSmrg      case GL_ACCUM_BLUE_BITS:
57034a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumBlueBits);
57044a49301eSmrg         break;
57054a49301eSmrg      case GL_ACCUM_ALPHA_BITS:
57064a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumAlphaBits);
57074a49301eSmrg         break;
57084a49301eSmrg      case GL_ACCUM_CLEAR_VALUE:
57094a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Accum.ClearColor[0]);
57104a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Accum.ClearColor[1]);
57114a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Accum.ClearColor[2]);
57124a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Accum.ClearColor[3]);
57134a49301eSmrg         break;
57144a49301eSmrg      case GL_ALPHA_BIAS:
57154a49301eSmrg         params[0] = IROUND64(ctx->Pixel.AlphaBias);
57164a49301eSmrg         break;
57174a49301eSmrg      case GL_ALPHA_BITS:
57184a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.alphaBits);
57194a49301eSmrg         break;
57204a49301eSmrg      case GL_ALPHA_SCALE:
57214a49301eSmrg         params[0] = IROUND64(ctx->Pixel.AlphaScale);
57224a49301eSmrg         break;
57234a49301eSmrg      case GL_ALPHA_TEST:
57244a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Color.AlphaEnabled);
57254a49301eSmrg         break;
57264a49301eSmrg      case GL_ALPHA_TEST_FUNC:
57274a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.AlphaFunc);
57284a49301eSmrg         break;
57294a49301eSmrg      case GL_ALPHA_TEST_REF:
57304a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Color.AlphaRef);
57314a49301eSmrg         break;
57324a49301eSmrg      case GL_ATTRIB_STACK_DEPTH:
57334a49301eSmrg         params[0] = (GLint64)(ctx->AttribStackDepth);
57344a49301eSmrg         break;
57354a49301eSmrg      case GL_AUTO_NORMAL:
57364a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.AutoNormal);
57374a49301eSmrg         break;
57384a49301eSmrg      case GL_AUX_BUFFERS:
57394a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.numAuxBuffers);
57404a49301eSmrg         break;
57414a49301eSmrg      case GL_BLEND:
5742cdc920a0Smrg         params[0] = BOOLEAN_TO_INT64((ctx->Color.BlendEnabled & 1));
57434a49301eSmrg         break;
57444a49301eSmrg      case GL_BLEND_DST:
57454a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendDstRGB);
57464a49301eSmrg         break;
57474a49301eSmrg      case GL_BLEND_SRC:
57484a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendSrcRGB);
57494a49301eSmrg         break;
57504a49301eSmrg      case GL_BLEND_SRC_RGB_EXT:
57514a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendSrcRGB);
57524a49301eSmrg         break;
57534a49301eSmrg      case GL_BLEND_DST_RGB_EXT:
57544a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendDstRGB);
57554a49301eSmrg         break;
57564a49301eSmrg      case GL_BLEND_SRC_ALPHA_EXT:
57574a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendSrcA);
57584a49301eSmrg         break;
57594a49301eSmrg      case GL_BLEND_DST_ALPHA_EXT:
57604a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendDstA);
57614a49301eSmrg         break;
57624a49301eSmrg      case GL_BLEND_EQUATION:
57634a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendEquationRGB );
57644a49301eSmrg         break;
57654a49301eSmrg      case GL_BLEND_EQUATION_ALPHA_EXT:
57664a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.BlendEquationA );
57674a49301eSmrg         break;
57684a49301eSmrg      case GL_BLEND_COLOR_EXT:
57694a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Color.BlendColor[0]);
57704a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Color.BlendColor[1]);
57714a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Color.BlendColor[2]);
57724a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Color.BlendColor[3]);
57734a49301eSmrg         break;
57744a49301eSmrg      case GL_BLUE_BIAS:
57754a49301eSmrg         params[0] = IROUND64(ctx->Pixel.BlueBias);
57764a49301eSmrg         break;
57774a49301eSmrg      case GL_BLUE_BITS:
57784a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.blueBits);
57794a49301eSmrg         break;
57804a49301eSmrg      case GL_BLUE_SCALE:
57814a49301eSmrg         params[0] = IROUND64(ctx->Pixel.BlueScale);
57824a49301eSmrg         break;
57834a49301eSmrg      case GL_CLIENT_ATTRIB_STACK_DEPTH:
57844a49301eSmrg         params[0] = (GLint64)(ctx->ClientAttribStackDepth);
57854a49301eSmrg         break;
57864a49301eSmrg      case GL_CLIP_PLANE0:
57874a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 0) & 1);
57884a49301eSmrg         break;
57894a49301eSmrg      case GL_CLIP_PLANE1:
57904a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 1) & 1);
57914a49301eSmrg         break;
57924a49301eSmrg      case GL_CLIP_PLANE2:
57934a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 2) & 1);
57944a49301eSmrg         break;
57954a49301eSmrg      case GL_CLIP_PLANE3:
57964a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 3) & 1);
57974a49301eSmrg         break;
57984a49301eSmrg      case GL_CLIP_PLANE4:
57994a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 4) & 1);
58004a49301eSmrg         break;
58014a49301eSmrg      case GL_CLIP_PLANE5:
58024a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 5) & 1);
58034a49301eSmrg         break;
58044a49301eSmrg      case GL_COLOR_CLEAR_VALUE:
58054a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Color.ClearColor[0]);
58064a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Color.ClearColor[1]);
58074a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Color.ClearColor[2]);
58084a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Color.ClearColor[3]);
58094a49301eSmrg         break;
58104a49301eSmrg      case GL_COLOR_MATERIAL:
58114a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.ColorMaterialEnabled);
58124a49301eSmrg         break;
58134a49301eSmrg      case GL_COLOR_MATERIAL_FACE:
58144a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Light.ColorMaterialFace);
58154a49301eSmrg         break;
58164a49301eSmrg      case GL_COLOR_MATERIAL_PARAMETER:
58174a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Light.ColorMaterialMode);
58184a49301eSmrg         break;
58194a49301eSmrg      case GL_COLOR_WRITEMASK:
5820cdc920a0Smrg         params[0] = (GLint64)(ctx->Color.ColorMask[0][RCOMP] ? 1 : 0);
5821cdc920a0Smrg         params[1] = (GLint64)(ctx->Color.ColorMask[0][GCOMP] ? 1 : 0);
5822cdc920a0Smrg         params[2] = (GLint64)(ctx->Color.ColorMask[0][BCOMP] ? 1 : 0);
5823cdc920a0Smrg         params[3] = (GLint64)(ctx->Color.ColorMask[0][ACOMP] ? 1 : 0);
58244a49301eSmrg         break;
58254a49301eSmrg      case GL_CULL_FACE:
58264a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.CullFlag);
58274a49301eSmrg         break;
58284a49301eSmrg      case GL_CULL_FACE_MODE:
58294a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Polygon.CullFaceMode);
58304a49301eSmrg         break;
58314a49301eSmrg      case GL_CURRENT_COLOR:
58324a49301eSmrg         {
58334a49301eSmrg         FLUSH_CURRENT(ctx, 0);
58344a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
58354a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
58364a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
58374a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
58384a49301eSmrg         }
58394a49301eSmrg         break;
58404a49301eSmrg      case GL_CURRENT_INDEX:
58414a49301eSmrg         {
58424a49301eSmrg         FLUSH_CURRENT(ctx, 0);
58434a49301eSmrg         params[0] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]);
58444a49301eSmrg         }
58454a49301eSmrg         break;
58464a49301eSmrg      case GL_CURRENT_NORMAL:
58474a49301eSmrg         {
58484a49301eSmrg         FLUSH_CURRENT(ctx, 0);
58494a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
58504a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
58514a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
58524a49301eSmrg         }
58534a49301eSmrg         break;
58544a49301eSmrg      case GL_CURRENT_RASTER_COLOR:
58554a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Current.RasterColor[0]);
58564a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Current.RasterColor[1]);
58574a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Current.RasterColor[2]);
58584a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Current.RasterColor[3]);
58594a49301eSmrg         break;
58604a49301eSmrg      case GL_CURRENT_RASTER_DISTANCE:
58614a49301eSmrg         params[0] = IROUND64(ctx->Current.RasterDistance);
58624a49301eSmrg         break;
58634a49301eSmrg      case GL_CURRENT_RASTER_INDEX:
5864cdc920a0Smrg         params[0] = IROUND64(1.0);
58654a49301eSmrg         break;
58664a49301eSmrg      case GL_CURRENT_RASTER_POSITION:
58674a49301eSmrg         params[0] = IROUND64(ctx->Current.RasterPos[0]);
58684a49301eSmrg         params[1] = IROUND64(ctx->Current.RasterPos[1]);
58694a49301eSmrg         params[2] = IROUND64(ctx->Current.RasterPos[2]);
58704a49301eSmrg         params[3] = IROUND64(ctx->Current.RasterPos[3]);
58714a49301eSmrg         break;
58724a49301eSmrg      case GL_CURRENT_RASTER_SECONDARY_COLOR:
58734a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Current.RasterSecondaryColor[0]);
58744a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Current.RasterSecondaryColor[1]);
58754a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Current.RasterSecondaryColor[2]);
58764a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Current.RasterSecondaryColor[3]);
58774a49301eSmrg         break;
58784a49301eSmrg      case GL_CURRENT_RASTER_TEXTURE_COORDS:
58794a49301eSmrg         {
5880cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
5881cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
5882cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
5883cdc920a0Smrg                        "glGet(raster tex coords, unit %u)", unit);
5884cdc920a0Smrg            return;
5885cdc920a0Smrg         }
5886cdc920a0Smrg         params[0] = IROUND64(ctx->Current.RasterTexCoords[unit][0]);
5887cdc920a0Smrg         params[1] = IROUND64(ctx->Current.RasterTexCoords[unit][1]);
5888cdc920a0Smrg         params[2] = IROUND64(ctx->Current.RasterTexCoords[unit][2]);
5889cdc920a0Smrg         params[3] = IROUND64(ctx->Current.RasterTexCoords[unit][3]);
58904a49301eSmrg         }
58914a49301eSmrg         break;
58924a49301eSmrg      case GL_CURRENT_RASTER_POSITION_VALID:
58934a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Current.RasterPosValid);
58944a49301eSmrg         break;
58954a49301eSmrg      case GL_CURRENT_TEXTURE_COORDS:
58964a49301eSmrg         {
5897cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
5898cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
5899cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
5900cdc920a0Smrg                        "glGet(current tex coords, unit %u)", unit);
5901cdc920a0Smrg            return;
5902cdc920a0Smrg         }
59034a49301eSmrg         FLUSH_CURRENT(ctx, 0);
5904cdc920a0Smrg         params[0] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0]);
5905cdc920a0Smrg         params[1] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1]);
5906cdc920a0Smrg         params[2] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2]);
5907cdc920a0Smrg         params[3] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3]);
59084a49301eSmrg         }
59094a49301eSmrg         break;
59104a49301eSmrg      case GL_DEPTH_BIAS:
59114a49301eSmrg         params[0] = IROUND64(ctx->Pixel.DepthBias);
59124a49301eSmrg         break;
59134a49301eSmrg      case GL_DEPTH_BITS:
59144a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.depthBits);
59154a49301eSmrg         break;
59164a49301eSmrg      case GL_DEPTH_CLEAR_VALUE:
59174a49301eSmrg         params[0] = FLOAT_TO_INT64(((GLfloat) ctx->Depth.Clear));
59184a49301eSmrg         break;
59194a49301eSmrg      case GL_DEPTH_FUNC:
59204a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Depth.Func);
59214a49301eSmrg         break;
59224a49301eSmrg      case GL_DEPTH_RANGE:
59234a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Viewport.Near);
59244a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Viewport.Far);
59254a49301eSmrg         break;
59264a49301eSmrg      case GL_DEPTH_SCALE:
59274a49301eSmrg         params[0] = IROUND64(ctx->Pixel.DepthScale);
59284a49301eSmrg         break;
59294a49301eSmrg      case GL_DEPTH_TEST:
59304a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Depth.Test);
59314a49301eSmrg         break;
59324a49301eSmrg      case GL_DEPTH_WRITEMASK:
59334a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Depth.Mask);
59344a49301eSmrg         break;
59354a49301eSmrg      case GL_DITHER:
59364a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Color.DitherFlag);
59374a49301eSmrg         break;
59384a49301eSmrg      case GL_DOUBLEBUFFER:
59394a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.doubleBufferMode);
59404a49301eSmrg         break;
59414a49301eSmrg      case GL_DRAW_BUFFER:
59424a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->DrawBuffer->ColorDrawBuffer[0]);
59434a49301eSmrg         break;
59444a49301eSmrg      case GL_EDGE_FLAG:
59454a49301eSmrg         {
59464a49301eSmrg         FLUSH_CURRENT(ctx, 0);
59474a49301eSmrg         params[0] = BOOLEAN_TO_INT64((ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0));
59484a49301eSmrg         }
59494a49301eSmrg         break;
59504a49301eSmrg      case GL_FEEDBACK_BUFFER_SIZE:
59514a49301eSmrg         params[0] = (GLint64)(ctx->Feedback.BufferSize);
59524a49301eSmrg         break;
59534a49301eSmrg      case GL_FEEDBACK_BUFFER_TYPE:
59544a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Feedback.Type);
59554a49301eSmrg         break;
59564a49301eSmrg      case GL_FOG:
59574a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Fog.Enabled);
59584a49301eSmrg         break;
59594a49301eSmrg      case GL_FOG_COLOR:
59604a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Fog.Color[0]);
59614a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Fog.Color[1]);
59624a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Fog.Color[2]);
59634a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Fog.Color[3]);
59644a49301eSmrg         break;
59654a49301eSmrg      case GL_FOG_DENSITY:
59664a49301eSmrg         params[0] = IROUND64(ctx->Fog.Density);
59674a49301eSmrg         break;
59684a49301eSmrg      case GL_FOG_END:
59694a49301eSmrg         params[0] = IROUND64(ctx->Fog.End);
59704a49301eSmrg         break;
59714a49301eSmrg      case GL_FOG_HINT:
59724a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.Fog);
59734a49301eSmrg         break;
59744a49301eSmrg      case GL_FOG_INDEX:
59754a49301eSmrg         params[0] = IROUND64(ctx->Fog.Index);
59764a49301eSmrg         break;
59774a49301eSmrg      case GL_FOG_MODE:
59784a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Fog.Mode);
59794a49301eSmrg         break;
59804a49301eSmrg      case GL_FOG_START:
59814a49301eSmrg         params[0] = IROUND64(ctx->Fog.Start);
59824a49301eSmrg         break;
59834a49301eSmrg      case GL_FRONT_FACE:
59844a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Polygon.FrontFace);
59854a49301eSmrg         break;
59864a49301eSmrg      case GL_GREEN_BIAS:
59874a49301eSmrg         params[0] = IROUND64(ctx->Pixel.GreenBias);
59884a49301eSmrg         break;
59894a49301eSmrg      case GL_GREEN_BITS:
59904a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.greenBits);
59914a49301eSmrg         break;
59924a49301eSmrg      case GL_GREEN_SCALE:
59934a49301eSmrg         params[0] = IROUND64(ctx->Pixel.GreenScale);
59944a49301eSmrg         break;
59954a49301eSmrg      case GL_INDEX_BITS:
59964a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.indexBits);
59974a49301eSmrg         break;
59984a49301eSmrg      case GL_INDEX_CLEAR_VALUE:
59994a49301eSmrg         params[0] = (GLint64)(ctx->Color.ClearIndex);
60004a49301eSmrg         break;
60014a49301eSmrg      case GL_INDEX_MODE:
6002cdc920a0Smrg         params[0] = BOOLEAN_TO_INT64(GL_FALSE);
60034a49301eSmrg         break;
60044a49301eSmrg      case GL_INDEX_OFFSET:
60054a49301eSmrg         params[0] = (GLint64)(ctx->Pixel.IndexOffset);
60064a49301eSmrg         break;
60074a49301eSmrg      case GL_INDEX_SHIFT:
60084a49301eSmrg         params[0] = (GLint64)(ctx->Pixel.IndexShift);
60094a49301eSmrg         break;
60104a49301eSmrg      case GL_INDEX_WRITEMASK:
60114a49301eSmrg         params[0] = (GLint64)(ctx->Color.IndexMask);
60124a49301eSmrg         break;
60134a49301eSmrg      case GL_LIGHT0:
60144a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[0].Enabled);
60154a49301eSmrg         break;
60164a49301eSmrg      case GL_LIGHT1:
60174a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[1].Enabled);
60184a49301eSmrg         break;
60194a49301eSmrg      case GL_LIGHT2:
60204a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[2].Enabled);
60214a49301eSmrg         break;
60224a49301eSmrg      case GL_LIGHT3:
60234a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[3].Enabled);
60244a49301eSmrg         break;
60254a49301eSmrg      case GL_LIGHT4:
60264a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[4].Enabled);
60274a49301eSmrg         break;
60284a49301eSmrg      case GL_LIGHT5:
60294a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[5].Enabled);
60304a49301eSmrg         break;
60314a49301eSmrg      case GL_LIGHT6:
60324a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[6].Enabled);
60334a49301eSmrg         break;
60344a49301eSmrg      case GL_LIGHT7:
60354a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[7].Enabled);
60364a49301eSmrg         break;
60374a49301eSmrg      case GL_LIGHTING:
60384a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Enabled);
60394a49301eSmrg         break;
60404a49301eSmrg      case GL_LIGHT_MODEL_AMBIENT:
60414a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Light.Model.Ambient[0]);
60424a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Light.Model.Ambient[1]);
60434a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Light.Model.Ambient[2]);
60444a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Light.Model.Ambient[3]);
60454a49301eSmrg         break;
60464a49301eSmrg      case GL_LIGHT_MODEL_COLOR_CONTROL:
60474a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Light.Model.ColorControl);
60484a49301eSmrg         break;
60494a49301eSmrg      case GL_LIGHT_MODEL_LOCAL_VIEWER:
60504a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Model.LocalViewer);
60514a49301eSmrg         break;
60524a49301eSmrg      case GL_LIGHT_MODEL_TWO_SIDE:
60534a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.Model.TwoSide);
60544a49301eSmrg         break;
60554a49301eSmrg      case GL_LINE_SMOOTH:
60564a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Line.SmoothFlag);
60574a49301eSmrg         break;
60584a49301eSmrg      case GL_LINE_SMOOTH_HINT:
60594a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.LineSmooth);
60604a49301eSmrg         break;
60614a49301eSmrg      case GL_LINE_STIPPLE:
60624a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Line.StippleFlag);
60634a49301eSmrg         break;
60644a49301eSmrg      case GL_LINE_STIPPLE_PATTERN:
60654a49301eSmrg         params[0] = (GLint64)(ctx->Line.StipplePattern);
60664a49301eSmrg         break;
60674a49301eSmrg      case GL_LINE_STIPPLE_REPEAT:
60684a49301eSmrg         params[0] = (GLint64)(ctx->Line.StippleFactor);
60694a49301eSmrg         break;
60704a49301eSmrg      case GL_LINE_WIDTH:
60714a49301eSmrg         params[0] = IROUND64(ctx->Line.Width);
60724a49301eSmrg         break;
60734a49301eSmrg      case GL_LINE_WIDTH_GRANULARITY:
60744a49301eSmrg         params[0] = IROUND64(ctx->Const.LineWidthGranularity);
60754a49301eSmrg         break;
60764a49301eSmrg      case GL_LINE_WIDTH_RANGE:
60774a49301eSmrg         params[0] = IROUND64(ctx->Const.MinLineWidthAA);
60784a49301eSmrg         params[1] = IROUND64(ctx->Const.MaxLineWidthAA);
60794a49301eSmrg         break;
60804a49301eSmrg      case GL_ALIASED_LINE_WIDTH_RANGE:
60814a49301eSmrg         params[0] = IROUND64(ctx->Const.MinLineWidth);
60824a49301eSmrg         params[1] = IROUND64(ctx->Const.MaxLineWidth);
60834a49301eSmrg         break;
60844a49301eSmrg      case GL_LIST_BASE:
60854a49301eSmrg         params[0] = (GLint64)(ctx->List.ListBase);
60864a49301eSmrg         break;
60874a49301eSmrg      case GL_LIST_INDEX:
60884a49301eSmrg         params[0] = (GLint64)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0));
60894a49301eSmrg         break;
60904a49301eSmrg      case GL_LIST_MODE:
60914a49301eSmrg         {
60924a49301eSmrg         GLenum mode;
60934a49301eSmrg         if (!ctx->CompileFlag)
60944a49301eSmrg            mode = 0;
60954a49301eSmrg         else if (ctx->ExecuteFlag)
60964a49301eSmrg            mode = GL_COMPILE_AND_EXECUTE;
60974a49301eSmrg         else
60984a49301eSmrg            mode = GL_COMPILE;
60994a49301eSmrg         params[0] = ENUM_TO_INT64(mode);
61004a49301eSmrg         }
61014a49301eSmrg         break;
61024a49301eSmrg      case GL_INDEX_LOGIC_OP:
61034a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Color.IndexLogicOpEnabled);
61044a49301eSmrg         break;
61054a49301eSmrg      case GL_COLOR_LOGIC_OP:
61064a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Color.ColorLogicOpEnabled);
61074a49301eSmrg         break;
61084a49301eSmrg      case GL_LOGIC_OP_MODE:
61094a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Color.LogicOp);
61104a49301eSmrg         break;
61114a49301eSmrg      case GL_MAP1_COLOR_4:
61124a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Color4);
61134a49301eSmrg         break;
61144a49301eSmrg      case GL_MAP1_GRID_DOMAIN:
61154a49301eSmrg         params[0] = IROUND64(ctx->Eval.MapGrid1u1);
61164a49301eSmrg         params[1] = IROUND64(ctx->Eval.MapGrid1u2);
61174a49301eSmrg         break;
61184a49301eSmrg      case GL_MAP1_GRID_SEGMENTS:
61194a49301eSmrg         params[0] = (GLint64)(ctx->Eval.MapGrid1un);
61204a49301eSmrg         break;
61214a49301eSmrg      case GL_MAP1_INDEX:
61224a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Index);
61234a49301eSmrg         break;
61244a49301eSmrg      case GL_MAP1_NORMAL:
61254a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Normal);
61264a49301eSmrg         break;
61274a49301eSmrg      case GL_MAP1_TEXTURE_COORD_1:
61284a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1TextureCoord1);
61294a49301eSmrg         break;
61304a49301eSmrg      case GL_MAP1_TEXTURE_COORD_2:
61314a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1TextureCoord2);
61324a49301eSmrg         break;
61334a49301eSmrg      case GL_MAP1_TEXTURE_COORD_3:
61344a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1TextureCoord3);
61354a49301eSmrg         break;
61364a49301eSmrg      case GL_MAP1_TEXTURE_COORD_4:
61374a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1TextureCoord4);
61384a49301eSmrg         break;
61394a49301eSmrg      case GL_MAP1_VERTEX_3:
61404a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Vertex3);
61414a49301eSmrg         break;
61424a49301eSmrg      case GL_MAP1_VERTEX_4:
61434a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Vertex4);
61444a49301eSmrg         break;
61454a49301eSmrg      case GL_MAP2_COLOR_4:
61464a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Color4);
61474a49301eSmrg         break;
61484a49301eSmrg      case GL_MAP2_GRID_DOMAIN:
61494a49301eSmrg         params[0] = IROUND64(ctx->Eval.MapGrid2u1);
61504a49301eSmrg         params[1] = IROUND64(ctx->Eval.MapGrid2u2);
61514a49301eSmrg         params[2] = IROUND64(ctx->Eval.MapGrid2v1);
61524a49301eSmrg         params[3] = IROUND64(ctx->Eval.MapGrid2v2);
61534a49301eSmrg         break;
61544a49301eSmrg      case GL_MAP2_GRID_SEGMENTS:
61554a49301eSmrg         params[0] = (GLint64)(ctx->Eval.MapGrid2un);
61564a49301eSmrg         params[1] = (GLint64)(ctx->Eval.MapGrid2vn);
61574a49301eSmrg         break;
61584a49301eSmrg      case GL_MAP2_INDEX:
61594a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Index);
61604a49301eSmrg         break;
61614a49301eSmrg      case GL_MAP2_NORMAL:
61624a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Normal);
61634a49301eSmrg         break;
61644a49301eSmrg      case GL_MAP2_TEXTURE_COORD_1:
61654a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2TextureCoord1);
61664a49301eSmrg         break;
61674a49301eSmrg      case GL_MAP2_TEXTURE_COORD_2:
61684a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2TextureCoord2);
61694a49301eSmrg         break;
61704a49301eSmrg      case GL_MAP2_TEXTURE_COORD_3:
61714a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2TextureCoord3);
61724a49301eSmrg         break;
61734a49301eSmrg      case GL_MAP2_TEXTURE_COORD_4:
61744a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2TextureCoord4);
61754a49301eSmrg         break;
61764a49301eSmrg      case GL_MAP2_VERTEX_3:
61774a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Vertex3);
61784a49301eSmrg         break;
61794a49301eSmrg      case GL_MAP2_VERTEX_4:
61804a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Vertex4);
61814a49301eSmrg         break;
61824a49301eSmrg      case GL_MAP_COLOR:
61834a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.MapColorFlag);
61844a49301eSmrg         break;
61854a49301eSmrg      case GL_MAP_STENCIL:
61864a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.MapStencilFlag);
61874a49301eSmrg         break;
61884a49301eSmrg      case GL_MATRIX_MODE:
61894a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Transform.MatrixMode);
61904a49301eSmrg         break;
61914a49301eSmrg      case GL_MAX_ATTRIB_STACK_DEPTH:
61924a49301eSmrg         params[0] = (GLint64)(MAX_ATTRIB_STACK_DEPTH);
61934a49301eSmrg         break;
61944a49301eSmrg      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
61954a49301eSmrg         params[0] = (GLint64)(MAX_CLIENT_ATTRIB_STACK_DEPTH);
61964a49301eSmrg         break;
61974a49301eSmrg      case GL_MAX_CLIP_PLANES:
61984a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxClipPlanes);
61994a49301eSmrg         break;
62004a49301eSmrg      case GL_MAX_ELEMENTS_VERTICES:
62014a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxArrayLockSize);
62024a49301eSmrg         break;
62034a49301eSmrg      case GL_MAX_ELEMENTS_INDICES:
62044a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxArrayLockSize);
62054a49301eSmrg         break;
62064a49301eSmrg      case GL_MAX_EVAL_ORDER:
62074a49301eSmrg         params[0] = (GLint64)(MAX_EVAL_ORDER);
62084a49301eSmrg         break;
62094a49301eSmrg      case GL_MAX_LIGHTS:
62104a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxLights);
62114a49301eSmrg         break;
62124a49301eSmrg      case GL_MAX_LIST_NESTING:
62134a49301eSmrg         params[0] = (GLint64)(MAX_LIST_NESTING);
62144a49301eSmrg         break;
62154a49301eSmrg      case GL_MAX_MODELVIEW_STACK_DEPTH:
62164a49301eSmrg         params[0] = (GLint64)(MAX_MODELVIEW_STACK_DEPTH);
62174a49301eSmrg         break;
62184a49301eSmrg      case GL_MAX_NAME_STACK_DEPTH:
62194a49301eSmrg         params[0] = (GLint64)(MAX_NAME_STACK_DEPTH);
62204a49301eSmrg         break;
62214a49301eSmrg      case GL_MAX_PIXEL_MAP_TABLE:
62224a49301eSmrg         params[0] = (GLint64)(MAX_PIXEL_MAP_TABLE);
62234a49301eSmrg         break;
62244a49301eSmrg      case GL_MAX_PROJECTION_STACK_DEPTH:
62254a49301eSmrg         params[0] = (GLint64)(MAX_PROJECTION_STACK_DEPTH);
62264a49301eSmrg         break;
62274a49301eSmrg      case GL_MAX_TEXTURE_SIZE:
62284a49301eSmrg         params[0] = (GLint64)(1 << (ctx->Const.MaxTextureLevels - 1));
62294a49301eSmrg         break;
62304a49301eSmrg      case GL_MAX_3D_TEXTURE_SIZE:
62314a49301eSmrg         params[0] = (GLint64)(1 << (ctx->Const.Max3DTextureLevels - 1));
62324a49301eSmrg         break;
62334a49301eSmrg      case GL_MAX_TEXTURE_STACK_DEPTH:
62344a49301eSmrg         params[0] = (GLint64)(MAX_TEXTURE_STACK_DEPTH);
62354a49301eSmrg         break;
62364a49301eSmrg      case GL_MAX_VIEWPORT_DIMS:
62374a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxViewportWidth);
62384a49301eSmrg         params[1] = (GLint64)(ctx->Const.MaxViewportHeight);
62394a49301eSmrg         break;
62404a49301eSmrg      case GL_MODELVIEW_MATRIX:
62414a49301eSmrg         {
62424a49301eSmrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
62434a49301eSmrg         params[0] = IROUND64(matrix[0]);
62444a49301eSmrg         params[1] = IROUND64(matrix[1]);
62454a49301eSmrg         params[2] = IROUND64(matrix[2]);
62464a49301eSmrg         params[3] = IROUND64(matrix[3]);
62474a49301eSmrg         params[4] = IROUND64(matrix[4]);
62484a49301eSmrg         params[5] = IROUND64(matrix[5]);
62494a49301eSmrg         params[6] = IROUND64(matrix[6]);
62504a49301eSmrg         params[7] = IROUND64(matrix[7]);
62514a49301eSmrg         params[8] = IROUND64(matrix[8]);
62524a49301eSmrg         params[9] = IROUND64(matrix[9]);
62534a49301eSmrg         params[10] = IROUND64(matrix[10]);
62544a49301eSmrg         params[11] = IROUND64(matrix[11]);
62554a49301eSmrg         params[12] = IROUND64(matrix[12]);
62564a49301eSmrg         params[13] = IROUND64(matrix[13]);
62574a49301eSmrg         params[14] = IROUND64(matrix[14]);
62584a49301eSmrg         params[15] = IROUND64(matrix[15]);
62594a49301eSmrg         }
62604a49301eSmrg         break;
62614a49301eSmrg      case GL_MODELVIEW_STACK_DEPTH:
62624a49301eSmrg         params[0] = (GLint64)(ctx->ModelviewMatrixStack.Depth + 1);
62634a49301eSmrg         break;
62644a49301eSmrg      case GL_NAME_STACK_DEPTH:
62654a49301eSmrg         params[0] = (GLint64)(ctx->Select.NameStackDepth);
62664a49301eSmrg         break;
62674a49301eSmrg      case GL_NORMALIZE:
62684a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Transform.Normalize);
62694a49301eSmrg         break;
62704a49301eSmrg      case GL_PACK_ALIGNMENT:
62714a49301eSmrg         params[0] = (GLint64)(ctx->Pack.Alignment);
62724a49301eSmrg         break;
62734a49301eSmrg      case GL_PACK_LSB_FIRST:
62744a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pack.LsbFirst);
62754a49301eSmrg         break;
62764a49301eSmrg      case GL_PACK_ROW_LENGTH:
62774a49301eSmrg         params[0] = (GLint64)(ctx->Pack.RowLength);
62784a49301eSmrg         break;
62794a49301eSmrg      case GL_PACK_SKIP_PIXELS:
62804a49301eSmrg         params[0] = (GLint64)(ctx->Pack.SkipPixels);
62814a49301eSmrg         break;
62824a49301eSmrg      case GL_PACK_SKIP_ROWS:
62834a49301eSmrg         params[0] = (GLint64)(ctx->Pack.SkipRows);
62844a49301eSmrg         break;
62854a49301eSmrg      case GL_PACK_SWAP_BYTES:
62864a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pack.SwapBytes);
62874a49301eSmrg         break;
62884a49301eSmrg      case GL_PACK_SKIP_IMAGES_EXT:
62894a49301eSmrg         params[0] = (GLint64)(ctx->Pack.SkipImages);
62904a49301eSmrg         break;
62914a49301eSmrg      case GL_PACK_IMAGE_HEIGHT_EXT:
62924a49301eSmrg         params[0] = (GLint64)(ctx->Pack.ImageHeight);
62934a49301eSmrg         break;
62944a49301eSmrg      case GL_PACK_INVERT_MESA:
62954a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pack.Invert);
62964a49301eSmrg         break;
62974a49301eSmrg      case GL_PERSPECTIVE_CORRECTION_HINT:
62984a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.PerspectiveCorrection);
62994a49301eSmrg         break;
63004a49301eSmrg      case GL_PIXEL_MAP_A_TO_A_SIZE:
63014a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.AtoA.Size);
63024a49301eSmrg         break;
63034a49301eSmrg      case GL_PIXEL_MAP_B_TO_B_SIZE:
63044a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.BtoB.Size);
63054a49301eSmrg         break;
63064a49301eSmrg      case GL_PIXEL_MAP_G_TO_G_SIZE:
63074a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.GtoG.Size);
63084a49301eSmrg         break;
63094a49301eSmrg      case GL_PIXEL_MAP_I_TO_A_SIZE:
63104a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.ItoA.Size);
63114a49301eSmrg         break;
63124a49301eSmrg      case GL_PIXEL_MAP_I_TO_B_SIZE:
63134a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.ItoB.Size);
63144a49301eSmrg         break;
63154a49301eSmrg      case GL_PIXEL_MAP_I_TO_G_SIZE:
63164a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.ItoG.Size);
63174a49301eSmrg         break;
63184a49301eSmrg      case GL_PIXEL_MAP_I_TO_I_SIZE:
63194a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.ItoI.Size);
63204a49301eSmrg         break;
63214a49301eSmrg      case GL_PIXEL_MAP_I_TO_R_SIZE:
63224a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.ItoR.Size);
63234a49301eSmrg         break;
63244a49301eSmrg      case GL_PIXEL_MAP_R_TO_R_SIZE:
63254a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.RtoR.Size);
63264a49301eSmrg         break;
63274a49301eSmrg      case GL_PIXEL_MAP_S_TO_S_SIZE:
63284a49301eSmrg         params[0] = (GLint64)(ctx->PixelMaps.StoS.Size);
63294a49301eSmrg         break;
63304a49301eSmrg      case GL_POINT_SIZE:
63314a49301eSmrg         params[0] = IROUND64(ctx->Point.Size);
63324a49301eSmrg         break;
63334a49301eSmrg      case GL_POINT_SIZE_GRANULARITY:
63344a49301eSmrg         params[0] = IROUND64(ctx->Const.PointSizeGranularity);
63354a49301eSmrg         break;
63364a49301eSmrg      case GL_POINT_SIZE_RANGE:
63374a49301eSmrg         params[0] = IROUND64(ctx->Const.MinPointSizeAA);
63384a49301eSmrg         params[1] = IROUND64(ctx->Const.MaxPointSizeAA);
63394a49301eSmrg         break;
63404a49301eSmrg      case GL_ALIASED_POINT_SIZE_RANGE:
63414a49301eSmrg         params[0] = IROUND64(ctx->Const.MinPointSize);
63424a49301eSmrg         params[1] = IROUND64(ctx->Const.MaxPointSize);
63434a49301eSmrg         break;
63444a49301eSmrg      case GL_POINT_SMOOTH:
63454a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Point.SmoothFlag);
63464a49301eSmrg         break;
63474a49301eSmrg      case GL_POINT_SMOOTH_HINT:
63484a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.PointSmooth);
63494a49301eSmrg         break;
63504a49301eSmrg      case GL_POINT_SIZE_MIN_EXT:
63514a49301eSmrg         params[0] = IROUND64(ctx->Point.MinSize);
63524a49301eSmrg         break;
63534a49301eSmrg      case GL_POINT_SIZE_MAX_EXT:
63544a49301eSmrg         params[0] = IROUND64(ctx->Point.MaxSize);
63554a49301eSmrg         break;
63564a49301eSmrg      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
63574a49301eSmrg         params[0] = IROUND64(ctx->Point.Threshold);
63584a49301eSmrg         break;
63594a49301eSmrg      case GL_DISTANCE_ATTENUATION_EXT:
63604a49301eSmrg         params[0] = IROUND64(ctx->Point.Params[0]);
63614a49301eSmrg         params[1] = IROUND64(ctx->Point.Params[1]);
63624a49301eSmrg         params[2] = IROUND64(ctx->Point.Params[2]);
63634a49301eSmrg         break;
63644a49301eSmrg      case GL_POLYGON_MODE:
63654a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Polygon.FrontMode);
63664a49301eSmrg         params[1] = ENUM_TO_INT64(ctx->Polygon.BackMode);
63674a49301eSmrg         break;
63684a49301eSmrg      case GL_POLYGON_OFFSET_BIAS_EXT:
63694a49301eSmrg         params[0] = IROUND64(ctx->Polygon.OffsetUnits);
63704a49301eSmrg         break;
63714a49301eSmrg      case GL_POLYGON_OFFSET_FACTOR:
63724a49301eSmrg         params[0] = IROUND64(ctx->Polygon.OffsetFactor );
63734a49301eSmrg         break;
63744a49301eSmrg      case GL_POLYGON_OFFSET_UNITS:
63754a49301eSmrg         params[0] = IROUND64(ctx->Polygon.OffsetUnits );
63764a49301eSmrg         break;
63774a49301eSmrg      case GL_POLYGON_OFFSET_POINT:
63784a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.OffsetPoint);
63794a49301eSmrg         break;
63804a49301eSmrg      case GL_POLYGON_OFFSET_LINE:
63814a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.OffsetLine);
63824a49301eSmrg         break;
63834a49301eSmrg      case GL_POLYGON_OFFSET_FILL:
63844a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.OffsetFill);
63854a49301eSmrg         break;
63864a49301eSmrg      case GL_POLYGON_SMOOTH:
63874a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.SmoothFlag);
63884a49301eSmrg         break;
63894a49301eSmrg      case GL_POLYGON_SMOOTH_HINT:
63904a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.PolygonSmooth);
63914a49301eSmrg         break;
63924a49301eSmrg      case GL_POLYGON_STIPPLE:
63934a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Polygon.StippleFlag);
63944a49301eSmrg         break;
63954a49301eSmrg      case GL_PROJECTION_MATRIX:
63964a49301eSmrg         {
63974a49301eSmrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
63984a49301eSmrg         params[0] = IROUND64(matrix[0]);
63994a49301eSmrg         params[1] = IROUND64(matrix[1]);
64004a49301eSmrg         params[2] = IROUND64(matrix[2]);
64014a49301eSmrg         params[3] = IROUND64(matrix[3]);
64024a49301eSmrg         params[4] = IROUND64(matrix[4]);
64034a49301eSmrg         params[5] = IROUND64(matrix[5]);
64044a49301eSmrg         params[6] = IROUND64(matrix[6]);
64054a49301eSmrg         params[7] = IROUND64(matrix[7]);
64064a49301eSmrg         params[8] = IROUND64(matrix[8]);
64074a49301eSmrg         params[9] = IROUND64(matrix[9]);
64084a49301eSmrg         params[10] = IROUND64(matrix[10]);
64094a49301eSmrg         params[11] = IROUND64(matrix[11]);
64104a49301eSmrg         params[12] = IROUND64(matrix[12]);
64114a49301eSmrg         params[13] = IROUND64(matrix[13]);
64124a49301eSmrg         params[14] = IROUND64(matrix[14]);
64134a49301eSmrg         params[15] = IROUND64(matrix[15]);
64144a49301eSmrg         }
64154a49301eSmrg         break;
64164a49301eSmrg      case GL_PROJECTION_STACK_DEPTH:
64174a49301eSmrg         params[0] = (GLint64)(ctx->ProjectionMatrixStack.Depth + 1);
64184a49301eSmrg         break;
64194a49301eSmrg      case GL_READ_BUFFER:
64204a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->ReadBuffer->ColorReadBuffer);
64214a49301eSmrg         break;
64224a49301eSmrg      case GL_RED_BIAS:
64234a49301eSmrg         params[0] = IROUND64(ctx->Pixel.RedBias);
64244a49301eSmrg         break;
64254a49301eSmrg      case GL_RED_BITS:
64264a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.redBits);
64274a49301eSmrg         break;
64284a49301eSmrg      case GL_RED_SCALE:
64294a49301eSmrg         params[0] = IROUND64(ctx->Pixel.RedScale);
64304a49301eSmrg         break;
64314a49301eSmrg      case GL_RENDER_MODE:
64324a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->RenderMode);
64334a49301eSmrg         break;
64344a49301eSmrg      case GL_RESCALE_NORMAL:
64354a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Transform.RescaleNormals);
64364a49301eSmrg         break;
64374a49301eSmrg      case GL_RGBA_MODE:
6438cdc920a0Smrg         params[0] = BOOLEAN_TO_INT64(GL_TRUE);
64394a49301eSmrg         break;
64404a49301eSmrg      case GL_SCISSOR_BOX:
64414a49301eSmrg         params[0] = (GLint64)(ctx->Scissor.X);
64424a49301eSmrg         params[1] = (GLint64)(ctx->Scissor.Y);
64434a49301eSmrg         params[2] = (GLint64)(ctx->Scissor.Width);
64444a49301eSmrg         params[3] = (GLint64)(ctx->Scissor.Height);
64454a49301eSmrg         break;
64464a49301eSmrg      case GL_SCISSOR_TEST:
64474a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Scissor.Enabled);
64484a49301eSmrg         break;
64494a49301eSmrg      case GL_SELECTION_BUFFER_SIZE:
64504a49301eSmrg         params[0] = (GLint64)(ctx->Select.BufferSize);
64514a49301eSmrg         break;
64524a49301eSmrg      case GL_SHADE_MODEL:
64534a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Light.ShadeModel);
64544a49301eSmrg         break;
64554a49301eSmrg      case GL_SHARED_TEXTURE_PALETTE_EXT:
64564a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Texture.SharedPalette);
64574a49301eSmrg         break;
64584a49301eSmrg      case GL_STENCIL_BITS:
64594a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.stencilBits);
64604a49301eSmrg         break;
64614a49301eSmrg      case GL_STENCIL_CLEAR_VALUE:
64624a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.Clear);
64634a49301eSmrg         break;
64644a49301eSmrg      case GL_STENCIL_FAIL:
64654a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
64664a49301eSmrg         break;
64674a49301eSmrg      case GL_STENCIL_FUNC:
64684a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
64694a49301eSmrg         break;
64704a49301eSmrg      case GL_STENCIL_PASS_DEPTH_FAIL:
64714a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
64724a49301eSmrg         break;
64734a49301eSmrg      case GL_STENCIL_PASS_DEPTH_PASS:
64744a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
64754a49301eSmrg         break;
64764a49301eSmrg      case GL_STENCIL_REF:
64774a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
64784a49301eSmrg         break;
64794a49301eSmrg      case GL_STENCIL_TEST:
64804a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Stencil.Enabled);
64814a49301eSmrg         break;
64824a49301eSmrg      case GL_STENCIL_VALUE_MASK:
64834a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
64844a49301eSmrg         break;
64854a49301eSmrg      case GL_STENCIL_WRITEMASK:
64864a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
64874a49301eSmrg         break;
64884a49301eSmrg      case GL_STEREO:
64894a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.stereoMode);
64904a49301eSmrg         break;
64914a49301eSmrg      case GL_SUBPIXEL_BITS:
64924a49301eSmrg         params[0] = (GLint64)(ctx->Const.SubPixelBits);
64934a49301eSmrg         break;
64944a49301eSmrg      case GL_TEXTURE_1D:
64954a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D));
64964a49301eSmrg         break;
64974a49301eSmrg      case GL_TEXTURE_2D:
64984a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D));
64994a49301eSmrg         break;
65004a49301eSmrg      case GL_TEXTURE_3D:
65014a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_3D));
65024a49301eSmrg         break;
65034a49301eSmrg      case GL_TEXTURE_1D_ARRAY_EXT:
65044a49301eSmrg         CHECK_EXT1(MESA_texture_array, "GetInteger64v");
65054a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT));
65064a49301eSmrg         break;
65074a49301eSmrg      case GL_TEXTURE_2D_ARRAY_EXT:
65084a49301eSmrg         CHECK_EXT1(MESA_texture_array, "GetInteger64v");
65094a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT));
65104a49301eSmrg         break;
65114a49301eSmrg      case GL_TEXTURE_BINDING_1D:
65124a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name);
65134a49301eSmrg         break;
65144a49301eSmrg      case GL_TEXTURE_BINDING_2D:
65154a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name);
65164a49301eSmrg         break;
65174a49301eSmrg      case GL_TEXTURE_BINDING_3D:
65184a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name);
65194a49301eSmrg         break;
65204a49301eSmrg      case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
65214a49301eSmrg         CHECK_EXT1(MESA_texture_array, "GetInteger64v");
65224a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name);
65234a49301eSmrg         break;
65244a49301eSmrg      case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
65254a49301eSmrg         CHECK_EXT1(MESA_texture_array, "GetInteger64v");
65264a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name);
65274a49301eSmrg         break;
65284a49301eSmrg      case GL_TEXTURE_GEN_S:
65294a49301eSmrg         params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0));
65304a49301eSmrg         break;
65314a49301eSmrg      case GL_TEXTURE_GEN_T:
65324a49301eSmrg         params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & T_BIT) ? 1 : 0));
65334a49301eSmrg         break;
65344a49301eSmrg      case GL_TEXTURE_GEN_R:
65354a49301eSmrg         params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & R_BIT) ? 1 : 0));
65364a49301eSmrg         break;
65374a49301eSmrg      case GL_TEXTURE_GEN_Q:
65384a49301eSmrg         params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & Q_BIT) ? 1 : 0));
65394a49301eSmrg         break;
65404a49301eSmrg      case GL_TEXTURE_MATRIX:
65414a49301eSmrg         {
6542cdc920a0Smrg         const GLfloat *matrix;
6543cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
6544cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
6545cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION, "glGet(texture matrix %u)",
6546cdc920a0Smrg                        unit);
6547cdc920a0Smrg            return;
6548cdc920a0Smrg         }
6549cdc920a0Smrg         matrix = ctx->TextureMatrixStack[unit].Top->m;
65504a49301eSmrg         params[0] = IROUND64(matrix[0]);
65514a49301eSmrg         params[1] = IROUND64(matrix[1]);
65524a49301eSmrg         params[2] = IROUND64(matrix[2]);
65534a49301eSmrg         params[3] = IROUND64(matrix[3]);
65544a49301eSmrg         params[4] = IROUND64(matrix[4]);
65554a49301eSmrg         params[5] = IROUND64(matrix[5]);
65564a49301eSmrg         params[6] = IROUND64(matrix[6]);
65574a49301eSmrg         params[7] = IROUND64(matrix[7]);
65584a49301eSmrg         params[8] = IROUND64(matrix[8]);
65594a49301eSmrg         params[9] = IROUND64(matrix[9]);
65604a49301eSmrg         params[10] = IROUND64(matrix[10]);
65614a49301eSmrg         params[11] = IROUND64(matrix[11]);
65624a49301eSmrg         params[12] = IROUND64(matrix[12]);
65634a49301eSmrg         params[13] = IROUND64(matrix[13]);
65644a49301eSmrg         params[14] = IROUND64(matrix[14]);
65654a49301eSmrg         params[15] = IROUND64(matrix[15]);
65664a49301eSmrg         }
65674a49301eSmrg         break;
65684a49301eSmrg      case GL_TEXTURE_STACK_DEPTH:
6569cdc920a0Smrg         {
6570cdc920a0Smrg         const GLuint unit = ctx->Texture.CurrentUnit;
6571cdc920a0Smrg         if (unit >= ctx->Const.MaxTextureCoordUnits) {
6572cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_OPERATION,
6573cdc920a0Smrg                        "glGet(texture stack depth, unit %u)", unit);
6574cdc920a0Smrg            return;
6575cdc920a0Smrg         }
6576cdc920a0Smrg         params[0] = (GLint64)(ctx->TextureMatrixStack[unit].Depth + 1);
6577cdc920a0Smrg         }
65784a49301eSmrg         break;
65794a49301eSmrg      case GL_UNPACK_ALIGNMENT:
65804a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.Alignment);
65814a49301eSmrg         break;
65824a49301eSmrg      case GL_UNPACK_LSB_FIRST:
65834a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Unpack.LsbFirst);
65844a49301eSmrg         break;
65854a49301eSmrg      case GL_UNPACK_ROW_LENGTH:
65864a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.RowLength);
65874a49301eSmrg         break;
65884a49301eSmrg      case GL_UNPACK_SKIP_PIXELS:
65894a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.SkipPixels);
65904a49301eSmrg         break;
65914a49301eSmrg      case GL_UNPACK_SKIP_ROWS:
65924a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.SkipRows);
65934a49301eSmrg         break;
65944a49301eSmrg      case GL_UNPACK_SWAP_BYTES:
65954a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Unpack.SwapBytes);
65964a49301eSmrg         break;
65974a49301eSmrg      case GL_UNPACK_SKIP_IMAGES_EXT:
65984a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.SkipImages);
65994a49301eSmrg         break;
66004a49301eSmrg      case GL_UNPACK_IMAGE_HEIGHT_EXT:
66014a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.ImageHeight);
66024a49301eSmrg         break;
66034a49301eSmrg      case GL_UNPACK_CLIENT_STORAGE_APPLE:
66044a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Unpack.ClientStorage);
66054a49301eSmrg         break;
66064a49301eSmrg      case GL_VIEWPORT:
66074a49301eSmrg         params[0] = (GLint64)(ctx->Viewport.X);
66084a49301eSmrg         params[1] = (GLint64)(ctx->Viewport.Y);
66094a49301eSmrg         params[2] = (GLint64)(ctx->Viewport.Width);
66104a49301eSmrg         params[3] = (GLint64)(ctx->Viewport.Height);
66114a49301eSmrg         break;
66124a49301eSmrg      case GL_ZOOM_X:
66134a49301eSmrg         params[0] = IROUND64(ctx->Pixel.ZoomX);
66144a49301eSmrg         break;
66154a49301eSmrg      case GL_ZOOM_Y:
66164a49301eSmrg         params[0] = IROUND64(ctx->Pixel.ZoomY);
66174a49301eSmrg         break;
66184a49301eSmrg      case GL_VERTEX_ARRAY:
66194a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Vertex.Enabled);
66204a49301eSmrg         break;
66214a49301eSmrg      case GL_VERTEX_ARRAY_SIZE:
66224a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Size);
66234a49301eSmrg         break;
66244a49301eSmrg      case GL_VERTEX_ARRAY_TYPE:
66254a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Vertex.Type);
66264a49301eSmrg         break;
66274a49301eSmrg      case GL_VERTEX_ARRAY_STRIDE:
66284a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Stride);
66294a49301eSmrg         break;
66304a49301eSmrg      case GL_VERTEX_ARRAY_COUNT_EXT:
66314a49301eSmrg         params[0] = (GLint64)(0);
66324a49301eSmrg         break;
66334a49301eSmrg      case GL_NORMAL_ARRAY:
66344a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Enabled);
66354a49301eSmrg         break;
66364a49301eSmrg      case GL_NORMAL_ARRAY_TYPE:
66374a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Type);
66384a49301eSmrg         break;
66394a49301eSmrg      case GL_NORMAL_ARRAY_STRIDE:
66404a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.Stride);
66414a49301eSmrg         break;
66424a49301eSmrg      case GL_NORMAL_ARRAY_COUNT_EXT:
66434a49301eSmrg         params[0] = (GLint64)(0);
66444a49301eSmrg         break;
66454a49301eSmrg      case GL_COLOR_ARRAY:
66464a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Color.Enabled);
66474a49301eSmrg         break;
66484a49301eSmrg      case GL_COLOR_ARRAY_SIZE:
66494a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Size);
66504a49301eSmrg         break;
66514a49301eSmrg      case GL_COLOR_ARRAY_TYPE:
66524a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Color.Type);
66534a49301eSmrg         break;
66544a49301eSmrg      case GL_COLOR_ARRAY_STRIDE:
66554a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Stride);
66564a49301eSmrg         break;
66574a49301eSmrg      case GL_COLOR_ARRAY_COUNT_EXT:
66584a49301eSmrg         params[0] = (GLint64)(0);
66594a49301eSmrg         break;
66604a49301eSmrg      case GL_INDEX_ARRAY:
66614a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Index.Enabled);
66624a49301eSmrg         break;
66634a49301eSmrg      case GL_INDEX_ARRAY_TYPE:
66644a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Index.Type);
66654a49301eSmrg         break;
66664a49301eSmrg      case GL_INDEX_ARRAY_STRIDE:
66674a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Index.Stride);
66684a49301eSmrg         break;
66694a49301eSmrg      case GL_INDEX_ARRAY_COUNT_EXT:
66704a49301eSmrg         params[0] = (GLint64)(0);
66714a49301eSmrg         break;
66724a49301eSmrg      case GL_TEXTURE_COORD_ARRAY:
66734a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled);
66744a49301eSmrg         break;
66754a49301eSmrg      case GL_TEXTURE_COORD_ARRAY_SIZE:
66764a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size);
66774a49301eSmrg         break;
66784a49301eSmrg      case GL_TEXTURE_COORD_ARRAY_TYPE:
66794a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type);
66804a49301eSmrg         break;
66814a49301eSmrg      case GL_TEXTURE_COORD_ARRAY_STRIDE:
66824a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride);
66834a49301eSmrg         break;
66844a49301eSmrg      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
66854a49301eSmrg         params[0] = (GLint64)(0);
66864a49301eSmrg         break;
66874a49301eSmrg      case GL_EDGE_FLAG_ARRAY:
66884a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->EdgeFlag.Enabled);
66894a49301eSmrg         break;
66904a49301eSmrg      case GL_EDGE_FLAG_ARRAY_STRIDE:
66914a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.Stride);
66924a49301eSmrg         break;
66934a49301eSmrg      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
66944a49301eSmrg         params[0] = (GLint64)(0);
66954a49301eSmrg         break;
66964a49301eSmrg      case GL_MAX_TEXTURE_UNITS_ARB:
66974a49301eSmrg         CHECK_EXT1(ARB_multitexture, "GetInteger64v");
66984a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxTextureUnits);
66994a49301eSmrg         break;
67004a49301eSmrg      case GL_ACTIVE_TEXTURE_ARB:
67014a49301eSmrg         CHECK_EXT1(ARB_multitexture, "GetInteger64v");
67024a49301eSmrg         params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
67034a49301eSmrg         break;
67044a49301eSmrg      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
67054a49301eSmrg         CHECK_EXT1(ARB_multitexture, "GetInteger64v");
67064a49301eSmrg         params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
67074a49301eSmrg         break;
67084a49301eSmrg      case GL_TEXTURE_CUBE_MAP_ARB:
67094a49301eSmrg         CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
67104a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB));
67114a49301eSmrg         break;
67124a49301eSmrg      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
67134a49301eSmrg         CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
67144a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name);
67154a49301eSmrg         break;
67164a49301eSmrg      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
67174a49301eSmrg         CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v");
67184a49301eSmrg         params[0] = (GLint64)((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
67194a49301eSmrg         break;
67204a49301eSmrg      case GL_TEXTURE_COMPRESSION_HINT_ARB:
67214a49301eSmrg         params[0] = (GLint64)(ctx->Hint.TextureCompression);
67224a49301eSmrg         break;
67234a49301eSmrg      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
67244a49301eSmrg         params[0] = (GLint64)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
67254a49301eSmrg         break;
67264a49301eSmrg      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
67274a49301eSmrg         {
67284a49301eSmrg         GLint formats[100];
67294a49301eSmrg         GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
67304a49301eSmrg         ASSERT(n <= 100);
67314a49301eSmrg         for (i = 0; i < n; i++)
67324a49301eSmrg            params[i] = ENUM_TO_INT64(formats[i]);
67334a49301eSmrg         }
67344a49301eSmrg         break;
67354a49301eSmrg      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
67364a49301eSmrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v");
67374a49301eSmrg         params[0] = (GLint64)(ctx->Array.LockFirst);
67384a49301eSmrg         break;
67394a49301eSmrg      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
67404a49301eSmrg         CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v");
67414a49301eSmrg         params[0] = (GLint64)(ctx->Array.LockCount);
67424a49301eSmrg         break;
67434a49301eSmrg      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
67444a49301eSmrg         {
67454a49301eSmrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
67464a49301eSmrg         params[0] = IROUND64(matrix[0]);
67474a49301eSmrg         params[1] = IROUND64(matrix[4]);
67484a49301eSmrg         params[2] = IROUND64(matrix[8]);
67494a49301eSmrg         params[3] = IROUND64(matrix[12]);
67504a49301eSmrg         params[4] = IROUND64(matrix[1]);
67514a49301eSmrg         params[5] = IROUND64(matrix[5]);
67524a49301eSmrg         params[6] = IROUND64(matrix[9]);
67534a49301eSmrg         params[7] = IROUND64(matrix[13]);
67544a49301eSmrg         params[8] = IROUND64(matrix[2]);
67554a49301eSmrg         params[9] = IROUND64(matrix[6]);
67564a49301eSmrg         params[10] = IROUND64(matrix[10]);
67574a49301eSmrg         params[11] = IROUND64(matrix[14]);
67584a49301eSmrg         params[12] = IROUND64(matrix[3]);
67594a49301eSmrg         params[13] = IROUND64(matrix[7]);
67604a49301eSmrg         params[14] = IROUND64(matrix[11]);
67614a49301eSmrg         params[15] = IROUND64(matrix[15]);
67624a49301eSmrg         }
67634a49301eSmrg         break;
67644a49301eSmrg      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
67654a49301eSmrg         {
67664a49301eSmrg         const GLfloat *matrix = ctx->ModelviewMatrixStack.Top->m;
67674a49301eSmrg         params[0] = IROUND64(matrix[0]);
67684a49301eSmrg         params[1] = IROUND64(matrix[4]);
67694a49301eSmrg         params[2] = IROUND64(matrix[8]);
67704a49301eSmrg         params[3] = IROUND64(matrix[12]);
67714a49301eSmrg         params[4] = IROUND64(matrix[1]);
67724a49301eSmrg         params[5] = IROUND64(matrix[5]);
67734a49301eSmrg         params[6] = IROUND64(matrix[9]);
67744a49301eSmrg         params[7] = IROUND64(matrix[13]);
67754a49301eSmrg         params[8] = IROUND64(matrix[2]);
67764a49301eSmrg         params[9] = IROUND64(matrix[6]);
67774a49301eSmrg         params[10] = IROUND64(matrix[10]);
67784a49301eSmrg         params[11] = IROUND64(matrix[14]);
67794a49301eSmrg         params[12] = IROUND64(matrix[3]);
67804a49301eSmrg         params[13] = IROUND64(matrix[7]);
67814a49301eSmrg         params[14] = IROUND64(matrix[11]);
67824a49301eSmrg         params[15] = IROUND64(matrix[15]);
67834a49301eSmrg         }
67844a49301eSmrg         break;
67854a49301eSmrg      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
67864a49301eSmrg         {
67874a49301eSmrg         const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;
67884a49301eSmrg         params[0] = IROUND64(matrix[0]);
67894a49301eSmrg         params[1] = IROUND64(matrix[4]);
67904a49301eSmrg         params[2] = IROUND64(matrix[8]);
67914a49301eSmrg         params[3] = IROUND64(matrix[12]);
67924a49301eSmrg         params[4] = IROUND64(matrix[1]);
67934a49301eSmrg         params[5] = IROUND64(matrix[5]);
67944a49301eSmrg         params[6] = IROUND64(matrix[9]);
67954a49301eSmrg         params[7] = IROUND64(matrix[13]);
67964a49301eSmrg         params[8] = IROUND64(matrix[2]);
67974a49301eSmrg         params[9] = IROUND64(matrix[6]);
67984a49301eSmrg         params[10] = IROUND64(matrix[10]);
67994a49301eSmrg         params[11] = IROUND64(matrix[14]);
68004a49301eSmrg         params[12] = IROUND64(matrix[3]);
68014a49301eSmrg         params[13] = IROUND64(matrix[7]);
68024a49301eSmrg         params[14] = IROUND64(matrix[11]);
68034a49301eSmrg         params[15] = IROUND64(matrix[15]);
68044a49301eSmrg         }
68054a49301eSmrg         break;
68064a49301eSmrg      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
68074a49301eSmrg         {
68084a49301eSmrg         const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;
68094a49301eSmrg         params[0] = IROUND64(matrix[0]);
68104a49301eSmrg         params[1] = IROUND64(matrix[4]);
68114a49301eSmrg         params[2] = IROUND64(matrix[8]);
68124a49301eSmrg         params[3] = IROUND64(matrix[12]);
68134a49301eSmrg         params[4] = IROUND64(matrix[1]);
68144a49301eSmrg         params[5] = IROUND64(matrix[5]);
68154a49301eSmrg         params[6] = IROUND64(matrix[9]);
68164a49301eSmrg         params[7] = IROUND64(matrix[13]);
68174a49301eSmrg         params[8] = IROUND64(matrix[2]);
68184a49301eSmrg         params[9] = IROUND64(matrix[6]);
68194a49301eSmrg         params[10] = IROUND64(matrix[10]);
68204a49301eSmrg         params[11] = IROUND64(matrix[14]);
68214a49301eSmrg         params[12] = IROUND64(matrix[3]);
68224a49301eSmrg         params[13] = IROUND64(matrix[7]);
68234a49301eSmrg         params[14] = IROUND64(matrix[11]);
68244a49301eSmrg         params[15] = IROUND64(matrix[15]);
68254a49301eSmrg         }
68264a49301eSmrg         break;
68274a49301eSmrg      case GL_COLOR_MATRIX_SGI:
68284a49301eSmrg         {
68294a49301eSmrg         const GLfloat *matrix = ctx->ColorMatrixStack.Top->m;
68304a49301eSmrg         params[0] = IROUND64(matrix[0]);
68314a49301eSmrg         params[1] = IROUND64(matrix[1]);
68324a49301eSmrg         params[2] = IROUND64(matrix[2]);
68334a49301eSmrg         params[3] = IROUND64(matrix[3]);
68344a49301eSmrg         params[4] = IROUND64(matrix[4]);
68354a49301eSmrg         params[5] = IROUND64(matrix[5]);
68364a49301eSmrg         params[6] = IROUND64(matrix[6]);
68374a49301eSmrg         params[7] = IROUND64(matrix[7]);
68384a49301eSmrg         params[8] = IROUND64(matrix[8]);
68394a49301eSmrg         params[9] = IROUND64(matrix[9]);
68404a49301eSmrg         params[10] = IROUND64(matrix[10]);
68414a49301eSmrg         params[11] = IROUND64(matrix[11]);
68424a49301eSmrg         params[12] = IROUND64(matrix[12]);
68434a49301eSmrg         params[13] = IROUND64(matrix[13]);
68444a49301eSmrg         params[14] = IROUND64(matrix[14]);
68454a49301eSmrg         params[15] = IROUND64(matrix[15]);
68464a49301eSmrg         }
68474a49301eSmrg         break;
68484a49301eSmrg      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
68494a49301eSmrg         params[0] = (GLint64)(ctx->ColorMatrixStack.Depth + 1);
68504a49301eSmrg         break;
68514a49301eSmrg      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
68524a49301eSmrg         params[0] = (GLint64)(MAX_COLOR_STACK_DEPTH);
68534a49301eSmrg         break;
68544a49301eSmrg      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
68554a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[0]);
68564a49301eSmrg         break;
68574a49301eSmrg      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
68584a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[1]);
68594a49301eSmrg         break;
68604a49301eSmrg      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
68614a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[2]);
68624a49301eSmrg         break;
68634a49301eSmrg      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
68644a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[3]);
68654a49301eSmrg         break;
68664a49301eSmrg      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
68674a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixBias[0]);
68684a49301eSmrg         break;
68694a49301eSmrg      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
68704a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixBias[1]);
68714a49301eSmrg         break;
68724a49301eSmrg      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
68734a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixBias[2]);
68744a49301eSmrg         break;
68754a49301eSmrg      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
68764a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostColorMatrixBias[3]);
68774a49301eSmrg         break;
68784a49301eSmrg      case GL_CONVOLUTION_1D_EXT:
68794a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
68804a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.Convolution1DEnabled);
68814a49301eSmrg         break;
68824a49301eSmrg      case GL_CONVOLUTION_2D_EXT:
68834a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
68844a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.Convolution2DEnabled);
68854a49301eSmrg         break;
68864a49301eSmrg      case GL_SEPARABLE_2D_EXT:
68874a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
68884a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.Separable2DEnabled);
68894a49301eSmrg         break;
68904a49301eSmrg      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
68914a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
68924a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionScale[0]);
68934a49301eSmrg         break;
68944a49301eSmrg      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
68954a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
68964a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionScale[1]);
68974a49301eSmrg         break;
68984a49301eSmrg      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
68994a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69004a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionScale[2]);
69014a49301eSmrg         break;
69024a49301eSmrg      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
69034a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69044a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionScale[3]);
69054a49301eSmrg         break;
69064a49301eSmrg      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
69074a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69084a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionBias[0]);
69094a49301eSmrg         break;
69104a49301eSmrg      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
69114a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69124a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionBias[1]);
69134a49301eSmrg         break;
69144a49301eSmrg      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
69154a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69164a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionBias[2]);
69174a49301eSmrg         break;
69184a49301eSmrg      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
69194a49301eSmrg         CHECK_EXT1(EXT_convolution, "GetInteger64v");
69204a49301eSmrg         params[0] = IROUND64(ctx->Pixel.PostConvolutionBias[3]);
69214a49301eSmrg         break;
69224a49301eSmrg      case GL_HISTOGRAM:
69234a49301eSmrg         CHECK_EXT1(EXT_histogram, "GetInteger64v");
69244a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.HistogramEnabled);
69254a49301eSmrg         break;
69264a49301eSmrg      case GL_MINMAX:
69274a49301eSmrg         CHECK_EXT1(EXT_histogram, "GetInteger64v");
69284a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.MinMaxEnabled);
69294a49301eSmrg         break;
69304a49301eSmrg      case GL_COLOR_TABLE_SGI:
69314a49301eSmrg         CHECK_EXT1(SGI_color_table, "GetInteger64v");
69324a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION]);
69334a49301eSmrg         break;
69344a49301eSmrg      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
69354a49301eSmrg         CHECK_EXT1(SGI_color_table, "GetInteger64v");
69364a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION]);
69374a49301eSmrg         break;
69384a49301eSmrg      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
69394a49301eSmrg         CHECK_EXT1(SGI_color_table, "GetInteger64v");
69404a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX]);
69414a49301eSmrg         break;
69424a49301eSmrg      case GL_TEXTURE_COLOR_TABLE_SGI:
69434a49301eSmrg         CHECK_EXT1(SGI_texture_color_table, "GetInteger64v");
69444a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled);
69454a49301eSmrg         break;
69464a49301eSmrg      case GL_COLOR_SUM_EXT:
69474a49301eSmrg         CHECK_EXT2(EXT_secondary_color, ARB_vertex_program, "GetInteger64v");
69484a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Fog.ColorSumEnabled);
69494a49301eSmrg         break;
69504a49301eSmrg      case GL_CURRENT_SECONDARY_COLOR_EXT:
69514a49301eSmrg         CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
69524a49301eSmrg         {
69534a49301eSmrg         FLUSH_CURRENT(ctx, 0);
69544a49301eSmrg         params[0] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
69554a49301eSmrg         params[1] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
69564a49301eSmrg         params[2] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
69574a49301eSmrg         params[3] = FLOAT_TO_INT64(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]);
69584a49301eSmrg         }
69594a49301eSmrg         break;
69604a49301eSmrg      case GL_SECONDARY_COLOR_ARRAY_EXT:
69614a49301eSmrg         CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
69624a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->SecondaryColor.Enabled);
69634a49301eSmrg         break;
69644a49301eSmrg      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
69654a49301eSmrg         CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
69664a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->SecondaryColor.Type);
69674a49301eSmrg         break;
69684a49301eSmrg      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
69694a49301eSmrg         CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
69704a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Stride);
69714a49301eSmrg         break;
69724a49301eSmrg      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
69734a49301eSmrg         CHECK_EXT1(EXT_secondary_color, "GetInteger64v");
69744a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Size);
69754a49301eSmrg         break;
69764a49301eSmrg      case GL_CURRENT_FOG_COORDINATE_EXT:
69774a49301eSmrg         CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
69784a49301eSmrg         {
69794a49301eSmrg         FLUSH_CURRENT(ctx, 0);
69804a49301eSmrg         params[0] = IROUND64(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
69814a49301eSmrg         }
69824a49301eSmrg         break;
69834a49301eSmrg      case GL_FOG_COORDINATE_ARRAY_EXT:
69844a49301eSmrg         CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
69854a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->FogCoord.Enabled);
69864a49301eSmrg         break;
69874a49301eSmrg      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
69884a49301eSmrg         CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
69894a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->FogCoord.Type);
69904a49301eSmrg         break;
69914a49301eSmrg      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
69924a49301eSmrg         CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
69934a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.Stride);
69944a49301eSmrg         break;
69954a49301eSmrg      case GL_FOG_COORDINATE_SOURCE_EXT:
69964a49301eSmrg         CHECK_EXT1(EXT_fog_coord, "GetInteger64v");
69974a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Fog.FogCoordinateSource);
69984a49301eSmrg         break;
69994a49301eSmrg      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
70004a49301eSmrg         CHECK_EXT1(EXT_texture_lod_bias, "GetInteger64v");
70014a49301eSmrg         params[0] = IROUND64(ctx->Const.MaxTextureLodBias);
70024a49301eSmrg         break;
70034a49301eSmrg      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
70044a49301eSmrg         CHECK_EXT1(EXT_texture_filter_anisotropic, "GetInteger64v");
70054a49301eSmrg         params[0] = IROUND64(ctx->Const.MaxTextureMaxAnisotropy);
70064a49301eSmrg         break;
70074a49301eSmrg      case GL_MULTISAMPLE_ARB:
70084a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Multisample.Enabled);
70094a49301eSmrg         break;
70104a49301eSmrg      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
70114a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleAlphaToCoverage);
70124a49301eSmrg         break;
70134a49301eSmrg      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
70144a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleAlphaToOne);
70154a49301eSmrg         break;
70164a49301eSmrg      case GL_SAMPLE_COVERAGE_ARB:
70174a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleCoverage);
70184a49301eSmrg         break;
70194a49301eSmrg      case GL_SAMPLE_COVERAGE_VALUE_ARB:
70204a49301eSmrg         params[0] = IROUND64(ctx->Multisample.SampleCoverageValue);
70214a49301eSmrg         break;
70224a49301eSmrg      case GL_SAMPLE_COVERAGE_INVERT_ARB:
70234a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleCoverageInvert);
70244a49301eSmrg         break;
70254a49301eSmrg      case GL_SAMPLE_BUFFERS_ARB:
70264a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.sampleBuffers);
70274a49301eSmrg         break;
70284a49301eSmrg      case GL_SAMPLES_ARB:
70294a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Visual.samples);
70304a49301eSmrg         break;
70314a49301eSmrg      case GL_RASTER_POSITION_UNCLIPPED_IBM:
70324a49301eSmrg         CHECK_EXT1(IBM_rasterpos_clip, "GetInteger64v");
70334a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Transform.RasterPositionUnclipped);
70344a49301eSmrg         break;
70354a49301eSmrg      case GL_POINT_SPRITE_NV:
70364a49301eSmrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetInteger64v");
70374a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Point.PointSprite);
70384a49301eSmrg         break;
70394a49301eSmrg      case GL_POINT_SPRITE_R_MODE_NV:
70404a49301eSmrg         CHECK_EXT1(NV_point_sprite, "GetInteger64v");
70414a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Point.SpriteRMode);
70424a49301eSmrg         break;
70434a49301eSmrg      case GL_POINT_SPRITE_COORD_ORIGIN:
70444a49301eSmrg         CHECK_EXT2(NV_point_sprite, ARB_point_sprite, "GetInteger64v");
70454a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Point.SpriteOrigin);
70464a49301eSmrg         break;
70474a49301eSmrg      case GL_GENERATE_MIPMAP_HINT_SGIS:
70484a49301eSmrg         CHECK_EXT1(SGIS_generate_mipmap, "GetInteger64v");
70494a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.GenerateMipmap);
70504a49301eSmrg         break;
70514a49301eSmrg      case GL_VERTEX_PROGRAM_BINDING_NV:
70524a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70534a49301eSmrg         params[0] = (GLint64)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0));
70544a49301eSmrg         break;
70554a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY0_NV:
70564a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70574a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[0].Enabled);
70584a49301eSmrg         break;
70594a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY1_NV:
70604a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70614a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[1].Enabled);
70624a49301eSmrg         break;
70634a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY2_NV:
70644a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70654a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[2].Enabled);
70664a49301eSmrg         break;
70674a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY3_NV:
70684a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70694a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[3].Enabled);
70704a49301eSmrg         break;
70714a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY4_NV:
70724a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70734a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[4].Enabled);
70744a49301eSmrg         break;
70754a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY5_NV:
70764a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70774a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[5].Enabled);
70784a49301eSmrg         break;
70794a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY6_NV:
70804a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70814a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[6].Enabled);
70824a49301eSmrg         break;
70834a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY7_NV:
70844a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70854a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[7].Enabled);
70864a49301eSmrg         break;
70874a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY8_NV:
70884a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70894a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[8].Enabled);
70904a49301eSmrg         break;
70914a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY9_NV:
70924a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70934a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[9].Enabled);
70944a49301eSmrg         break;
70954a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY10_NV:
70964a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
70974a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[10].Enabled);
70984a49301eSmrg         break;
70994a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY11_NV:
71004a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71014a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[11].Enabled);
71024a49301eSmrg         break;
71034a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY12_NV:
71044a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71054a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[12].Enabled);
71064a49301eSmrg         break;
71074a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY13_NV:
71084a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71094a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[13].Enabled);
71104a49301eSmrg         break;
71114a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY14_NV:
71124a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71134a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[14].Enabled);
71144a49301eSmrg         break;
71154a49301eSmrg      case GL_VERTEX_ATTRIB_ARRAY15_NV:
71164a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71174a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->VertexAttrib[15].Enabled);
71184a49301eSmrg         break;
71194a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
71204a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71214a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[0]);
71224a49301eSmrg         break;
71234a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
71244a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71254a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[1]);
71264a49301eSmrg         break;
71274a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
71284a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71294a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[2]);
71304a49301eSmrg         break;
71314a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
71324a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71334a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[3]);
71344a49301eSmrg         break;
71354a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
71364a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71374a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[4]);
71384a49301eSmrg         break;
71394a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
71404a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71414a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[5]);
71424a49301eSmrg         break;
71434a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
71444a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71454a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[6]);
71464a49301eSmrg         break;
71474a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
71484a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71494a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[7]);
71504a49301eSmrg         break;
71514a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
71524a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71534a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[8]);
71544a49301eSmrg         break;
71554a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
71564a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71574a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[9]);
71584a49301eSmrg         break;
71594a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
71604a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71614a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[10]);
71624a49301eSmrg         break;
71634a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
71644a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71654a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[11]);
71664a49301eSmrg         break;
71674a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
71684a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71694a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[12]);
71704a49301eSmrg         break;
71714a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
71724a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71734a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[13]);
71744a49301eSmrg         break;
71754a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
71764a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71774a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[14]);
71784a49301eSmrg         break;
71794a49301eSmrg      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
71804a49301eSmrg         CHECK_EXT1(NV_vertex_program, "GetInteger64v");
71814a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Attrib[15]);
71824a49301eSmrg         break;
71834a49301eSmrg      case GL_FRAGMENT_PROGRAM_NV:
71844a49301eSmrg         CHECK_EXT1(NV_fragment_program, "GetInteger64v");
71854a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->FragmentProgram.Enabled);
71864a49301eSmrg         break;
71874a49301eSmrg      case GL_FRAGMENT_PROGRAM_BINDING_NV:
71884a49301eSmrg         CHECK_EXT1(NV_fragment_program, "GetInteger64v");
71894a49301eSmrg         params[0] = (GLint64)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0);
71904a49301eSmrg         break;
71914a49301eSmrg      case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
71924a49301eSmrg         CHECK_EXT1(NV_fragment_program, "GetInteger64v");
71934a49301eSmrg         params[0] = (GLint64)(MAX_NV_FRAGMENT_PROGRAM_PARAMS);
71944a49301eSmrg         break;
71954a49301eSmrg      case GL_TEXTURE_RECTANGLE_NV:
71964a49301eSmrg         CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
71974a49301eSmrg         params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV));
71984a49301eSmrg         break;
71994a49301eSmrg      case GL_TEXTURE_BINDING_RECTANGLE_NV:
72004a49301eSmrg         CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
72014a49301eSmrg         params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name);
72024a49301eSmrg         break;
72034a49301eSmrg      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
72044a49301eSmrg         CHECK_EXT1(NV_texture_rectangle, "GetInteger64v");
72054a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxTextureRectSize);
72064a49301eSmrg         break;
72074a49301eSmrg      case GL_STENCIL_TEST_TWO_SIDE_EXT:
72084a49301eSmrg         CHECK_EXT1(EXT_stencil_two_side, "GetInteger64v");
72094a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Stencil.TestTwoSide);
72104a49301eSmrg         break;
72114a49301eSmrg      case GL_ACTIVE_STENCIL_FACE_EXT:
72124a49301eSmrg         CHECK_EXT1(EXT_stencil_two_side, "GetInteger64v");
72134a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
72144a49301eSmrg         break;
72154a49301eSmrg      case GL_MAX_SHININESS_NV:
72164a49301eSmrg         CHECK_EXT1(NV_light_max_exponent, "GetInteger64v");
72174a49301eSmrg         params[0] = IROUND64(ctx->Const.MaxShininess);
72184a49301eSmrg         break;
72194a49301eSmrg      case GL_MAX_SPOT_EXPONENT_NV:
72204a49301eSmrg         CHECK_EXT1(NV_light_max_exponent, "GetInteger64v");
72214a49301eSmrg         params[0] = IROUND64(ctx->Const.MaxSpotExponent);
72224a49301eSmrg         break;
72234a49301eSmrg      case GL_ARRAY_BUFFER_BINDING_ARB:
72244a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayBufferObj->Name);
72254a49301eSmrg         break;
72264a49301eSmrg      case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
72274a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.BufferObj->Name);
72284a49301eSmrg         break;
72294a49301eSmrg      case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
72304a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.BufferObj->Name);
72314a49301eSmrg         break;
72324a49301eSmrg      case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
72334a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Color.BufferObj->Name);
72344a49301eSmrg         break;
72354a49301eSmrg      case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
72364a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Index.BufferObj->Name);
72374a49301eSmrg         break;
72384a49301eSmrg      case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
72394a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name);
72404a49301eSmrg         break;
72414a49301eSmrg      case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
72424a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name);
72434a49301eSmrg         break;
72444a49301eSmrg      case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
72454a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name);
72464a49301eSmrg         break;
72474a49301eSmrg      case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
72484a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name);
72494a49301eSmrg         break;
72504a49301eSmrg      case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
72514a49301eSmrg         params[0] = (GLint64)(ctx->Array.ElementArrayBufferObj->Name);
72524a49301eSmrg         break;
72534a49301eSmrg      case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
72544a49301eSmrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v");
72554a49301eSmrg         params[0] = (GLint64)(ctx->Pack.BufferObj->Name);
72564a49301eSmrg         break;
72574a49301eSmrg      case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
72584a49301eSmrg         CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v");
72594a49301eSmrg         params[0] = (GLint64)(ctx->Unpack.BufferObj->Name);
72604a49301eSmrg         break;
72614a49301eSmrg      case GL_VERTEX_PROGRAM_ARB:
72624a49301eSmrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetInteger64v");
72634a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->VertexProgram.Enabled);
72644a49301eSmrg         break;
72654a49301eSmrg      case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
72664a49301eSmrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetInteger64v");
72674a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->VertexProgram.PointSizeEnabled);
72684a49301eSmrg         break;
72694a49301eSmrg      case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
72704a49301eSmrg         CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetInteger64v");
72714a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->VertexProgram.TwoSideEnabled);
72724a49301eSmrg         break;
72734a49301eSmrg      case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
72744a49301eSmrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
72754a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxProgramMatrixStackDepth);
72764a49301eSmrg         break;
72774a49301eSmrg      case GL_MAX_PROGRAM_MATRICES_ARB:
72784a49301eSmrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
72794a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxProgramMatrices);
72804a49301eSmrg         break;
72814a49301eSmrg      case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
72824a49301eSmrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v");
72834a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->CurrentStack->Depth + 1);
72844a49301eSmrg         break;
72854a49301eSmrg      case GL_CURRENT_MATRIX_ARB:
72864a49301eSmrg         CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetInteger64v");
72874a49301eSmrg         {
72884a49301eSmrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
72894a49301eSmrg         params[0] = IROUND64(matrix[0]);
72904a49301eSmrg         params[1] = IROUND64(matrix[1]);
72914a49301eSmrg         params[2] = IROUND64(matrix[2]);
72924a49301eSmrg         params[3] = IROUND64(matrix[3]);
72934a49301eSmrg         params[4] = IROUND64(matrix[4]);
72944a49301eSmrg         params[5] = IROUND64(matrix[5]);
72954a49301eSmrg         params[6] = IROUND64(matrix[6]);
72964a49301eSmrg         params[7] = IROUND64(matrix[7]);
72974a49301eSmrg         params[8] = IROUND64(matrix[8]);
72984a49301eSmrg         params[9] = IROUND64(matrix[9]);
72994a49301eSmrg         params[10] = IROUND64(matrix[10]);
73004a49301eSmrg         params[11] = IROUND64(matrix[11]);
73014a49301eSmrg         params[12] = IROUND64(matrix[12]);
73024a49301eSmrg         params[13] = IROUND64(matrix[13]);
73034a49301eSmrg         params[14] = IROUND64(matrix[14]);
73044a49301eSmrg         params[15] = IROUND64(matrix[15]);
73054a49301eSmrg         }
73064a49301eSmrg         break;
73074a49301eSmrg      case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
73084a49301eSmrg         CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetInteger64v");
73094a49301eSmrg         {
73104a49301eSmrg         const GLfloat *matrix = ctx->CurrentStack->Top->m;
73114a49301eSmrg         params[0] = IROUND64(matrix[0]);
73124a49301eSmrg         params[1] = IROUND64(matrix[4]);
73134a49301eSmrg         params[2] = IROUND64(matrix[8]);
73144a49301eSmrg         params[3] = IROUND64(matrix[12]);
73154a49301eSmrg         params[4] = IROUND64(matrix[1]);
73164a49301eSmrg         params[5] = IROUND64(matrix[5]);
73174a49301eSmrg         params[6] = IROUND64(matrix[9]);
73184a49301eSmrg         params[7] = IROUND64(matrix[13]);
73194a49301eSmrg         params[8] = IROUND64(matrix[2]);
73204a49301eSmrg         params[9] = IROUND64(matrix[6]);
73214a49301eSmrg         params[10] = IROUND64(matrix[10]);
73224a49301eSmrg         params[11] = IROUND64(matrix[14]);
73234a49301eSmrg         params[12] = IROUND64(matrix[3]);
73244a49301eSmrg         params[13] = IROUND64(matrix[7]);
73254a49301eSmrg         params[14] = IROUND64(matrix[11]);
73264a49301eSmrg         params[15] = IROUND64(matrix[15]);
73274a49301eSmrg         }
73284a49301eSmrg         break;
73294a49301eSmrg      case GL_MAX_VERTEX_ATTRIBS_ARB:
73304a49301eSmrg         CHECK_EXT1(ARB_vertex_program, "GetInteger64v");
73314a49301eSmrg         params[0] = (GLint64)(ctx->Const.VertexProgram.MaxAttribs);
73324a49301eSmrg         break;
73334a49301eSmrg      case GL_PROGRAM_ERROR_POSITION_ARB:
73344a49301eSmrg         CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetInteger64v");
73354a49301eSmrg         params[0] = (GLint64)(ctx->Program.ErrorPos);
73364a49301eSmrg         break;
73374a49301eSmrg      case GL_FRAGMENT_PROGRAM_ARB:
73384a49301eSmrg         CHECK_EXT1(ARB_fragment_program, "GetInteger64v");
73394a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->FragmentProgram.Enabled);
73404a49301eSmrg         break;
73414a49301eSmrg      case GL_MAX_TEXTURE_COORDS_ARB:
73424a49301eSmrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v");
73434a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxTextureCoordUnits);
73444a49301eSmrg         break;
73454a49301eSmrg      case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
73464a49301eSmrg         CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v");
73474a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxTextureImageUnits);
73484a49301eSmrg         break;
73494a49301eSmrg      case GL_DEPTH_BOUNDS_TEST_EXT:
73504a49301eSmrg         CHECK_EXT1(EXT_depth_bounds_test, "GetInteger64v");
73514a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Depth.BoundsTest);
73524a49301eSmrg         break;
73534a49301eSmrg      case GL_DEPTH_BOUNDS_EXT:
73544a49301eSmrg         CHECK_EXT1(EXT_depth_bounds_test, "GetInteger64v");
73554a49301eSmrg         params[0] = IROUND64(ctx->Depth.BoundsMin);
73564a49301eSmrg         params[1] = IROUND64(ctx->Depth.BoundsMax);
73574a49301eSmrg         break;
73584a49301eSmrg      case GL_DEPTH_CLAMP:
73594a49301eSmrg         CHECK_EXT1(ARB_depth_clamp, "GetInteger64v");
73604a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Transform.DepthClamp);
73614a49301eSmrg         break;
73624a49301eSmrg      case GL_MAX_DRAW_BUFFERS_ARB:
73634a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxDrawBuffers);
73644a49301eSmrg         break;
73654a49301eSmrg      case GL_DRAW_BUFFER0_ARB:
73664a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->DrawBuffer->ColorDrawBuffer[0]);
73674a49301eSmrg         break;
73684a49301eSmrg      case GL_DRAW_BUFFER1_ARB:
73694a49301eSmrg         {
73704a49301eSmrg         GLenum buffer;
73714a49301eSmrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
73724a49301eSmrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
73734a49301eSmrg            return;
73744a49301eSmrg         }
73754a49301eSmrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
73764a49301eSmrg         params[0] = ENUM_TO_INT64(buffer);
73774a49301eSmrg         }
73784a49301eSmrg         break;
73794a49301eSmrg      case GL_DRAW_BUFFER2_ARB:
73804a49301eSmrg         {
73814a49301eSmrg         GLenum buffer;
73824a49301eSmrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
73834a49301eSmrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
73844a49301eSmrg            return;
73854a49301eSmrg         }
73864a49301eSmrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
73874a49301eSmrg         params[0] = ENUM_TO_INT64(buffer);
73884a49301eSmrg         }
73894a49301eSmrg         break;
73904a49301eSmrg      case GL_DRAW_BUFFER3_ARB:
73914a49301eSmrg         {
73924a49301eSmrg         GLenum buffer;
73934a49301eSmrg         if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
73944a49301eSmrg            _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
73954a49301eSmrg            return;
73964a49301eSmrg         }
73974a49301eSmrg         buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
73984a49301eSmrg         params[0] = ENUM_TO_INT64(buffer);
73994a49301eSmrg         }
74004a49301eSmrg         break;
74014a49301eSmrg      case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
74024a49301eSmrg         CHECK_EXT1(OES_read_format, "GetInteger64v");
74034a49301eSmrg         params[0] = (GLint64)(_mesa_get_color_read_type(ctx));
74044a49301eSmrg         break;
74054a49301eSmrg      case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
74064a49301eSmrg         CHECK_EXT1(OES_read_format, "GetInteger64v");
74074a49301eSmrg         params[0] = (GLint64)(_mesa_get_color_read_format(ctx));
74084a49301eSmrg         break;
74094a49301eSmrg      case GL_NUM_FRAGMENT_REGISTERS_ATI:
74104a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74114a49301eSmrg         params[0] = (GLint64)(6);
74124a49301eSmrg         break;
74134a49301eSmrg      case GL_NUM_FRAGMENT_CONSTANTS_ATI:
74144a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74154a49301eSmrg         params[0] = (GLint64)(8);
74164a49301eSmrg         break;
74174a49301eSmrg      case GL_NUM_PASSES_ATI:
74184a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74194a49301eSmrg         params[0] = (GLint64)(2);
74204a49301eSmrg         break;
74214a49301eSmrg      case GL_NUM_INSTRUCTIONS_PER_PASS_ATI:
74224a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74234a49301eSmrg         params[0] = (GLint64)(8);
74244a49301eSmrg         break;
74254a49301eSmrg      case GL_NUM_INSTRUCTIONS_TOTAL_ATI:
74264a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74274a49301eSmrg         params[0] = (GLint64)(16);
74284a49301eSmrg         break;
74294a49301eSmrg      case GL_COLOR_ALPHA_PAIRING_ATI:
74304a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74314a49301eSmrg         params[0] = BOOLEAN_TO_INT64(GL_TRUE);
74324a49301eSmrg         break;
74334a49301eSmrg      case GL_NUM_LOOPBACK_COMPONENTS_ATI:
74344a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74354a49301eSmrg         params[0] = (GLint64)(3);
74364a49301eSmrg         break;
74374a49301eSmrg      case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI:
74384a49301eSmrg         CHECK_EXT1(ATI_fragment_shader, "GetInteger64v");
74394a49301eSmrg         params[0] = (GLint64)(3);
74404a49301eSmrg         break;
74414a49301eSmrg      case GL_STENCIL_BACK_FUNC:
74424a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.Function[1]);
74434a49301eSmrg         break;
74444a49301eSmrg      case GL_STENCIL_BACK_VALUE_MASK:
74454a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.ValueMask[1]);
74464a49301eSmrg         break;
74474a49301eSmrg      case GL_STENCIL_BACK_WRITEMASK:
74484a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.WriteMask[1]);
74494a49301eSmrg         break;
74504a49301eSmrg      case GL_STENCIL_BACK_REF:
74514a49301eSmrg         params[0] = (GLint64)(ctx->Stencil.Ref[1]);
74524a49301eSmrg         break;
74534a49301eSmrg      case GL_STENCIL_BACK_FAIL:
74544a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[1]);
74554a49301eSmrg         break;
74564a49301eSmrg      case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
74574a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.ZFailFunc[1]);
74584a49301eSmrg         break;
74594a49301eSmrg      case GL_STENCIL_BACK_PASS_DEPTH_PASS:
74604a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Stencil.ZPassFunc[1]);
74614a49301eSmrg         break;
74624a49301eSmrg      case GL_FRAMEBUFFER_BINDING_EXT:
74634a49301eSmrg         CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
74644a49301eSmrg         params[0] = (GLint64)(ctx->DrawBuffer->Name);
74654a49301eSmrg         break;
74664a49301eSmrg      case GL_RENDERBUFFER_BINDING_EXT:
74674a49301eSmrg         CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
74684a49301eSmrg         params[0] = (GLint64)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0);
74694a49301eSmrg         break;
74704a49301eSmrg      case GL_MAX_COLOR_ATTACHMENTS_EXT:
74714a49301eSmrg         CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
74724a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxColorAttachments);
74734a49301eSmrg         break;
74744a49301eSmrg      case GL_MAX_RENDERBUFFER_SIZE_EXT:
74754a49301eSmrg         CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v");
74764a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxRenderbufferSize);
74774a49301eSmrg         break;
74784a49301eSmrg      case GL_READ_FRAMEBUFFER_BINDING_EXT:
74794a49301eSmrg         CHECK_EXT1(EXT_framebuffer_blit, "GetInteger64v");
74804a49301eSmrg         params[0] = (GLint64)(ctx->ReadBuffer->Name);
74814a49301eSmrg         break;
74824a49301eSmrg      case GL_PROVOKING_VERTEX_EXT:
74834a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetInteger64v");
74844a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Light.ProvokingVertex);
74854a49301eSmrg         break;
74864a49301eSmrg      case GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT:
74874a49301eSmrg         CHECK_EXT1(EXT_provoking_vertex, "GetInteger64v");
74884a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Const.QuadsFollowProvokingVertexConvention);
74894a49301eSmrg         break;
74904a49301eSmrg      case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB:
74914a49301eSmrg         CHECK_EXT1(ARB_fragment_shader, "GetInteger64v");
74924a49301eSmrg         params[0] = (GLint64)(ctx->Const.FragmentProgram.MaxUniformComponents);
74934a49301eSmrg         break;
74944a49301eSmrg      case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
74954a49301eSmrg         CHECK_EXT1(ARB_fragment_shader, "GetInteger64v");
74964a49301eSmrg         params[0] = ENUM_TO_INT64(ctx->Hint.FragmentShaderDerivative);
74974a49301eSmrg         break;
74984a49301eSmrg      case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB:
74994a49301eSmrg         CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
75004a49301eSmrg         params[0] = (GLint64)(ctx->Const.VertexProgram.MaxUniformComponents);
75014a49301eSmrg         break;
75024a49301eSmrg      case GL_MAX_VARYING_FLOATS_ARB:
75034a49301eSmrg         CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
75044a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxVarying * 4);
75054a49301eSmrg         break;
75064a49301eSmrg      case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB:
75074a49301eSmrg         CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
75084a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxVertexTextureImageUnits);
75094a49301eSmrg         break;
75104a49301eSmrg      case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB:
75114a49301eSmrg         CHECK_EXT1(ARB_vertex_shader, "GetInteger64v");
7512cdc920a0Smrg         params[0] = (GLint64)(ctx->Const.MaxCombinedTextureImageUnits);
75134a49301eSmrg         break;
75144a49301eSmrg      case GL_CURRENT_PROGRAM:
75154a49301eSmrg         CHECK_EXT1(ARB_shader_objects, "GetInteger64v");
75164a49301eSmrg         params[0] = (GLint64)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
75174a49301eSmrg         break;
75184a49301eSmrg      case GL_MAX_SAMPLES:
75194a49301eSmrg         CHECK_EXT1(ARB_framebuffer_object, "GetInteger64v");
75204a49301eSmrg         params[0] = (GLint64)(ctx->Const.MaxSamples);
75214a49301eSmrg         break;
75224a49301eSmrg      case GL_VERTEX_ARRAY_BINDING_APPLE:
75234a49301eSmrg         CHECK_EXT1(APPLE_vertex_array_object, "GetInteger64v");
75244a49301eSmrg         params[0] = (GLint64)(ctx->Array.ArrayObj->Name);
75254a49301eSmrg         break;
75264a49301eSmrg      case GL_TEXTURE_CUBE_MAP_SEAMLESS:
75274a49301eSmrg         CHECK_EXT1(ARB_seamless_cube_map, "GetInteger64v");
75284a49301eSmrg         params[0] = BOOLEAN_TO_INT64(ctx->Texture.CubeMapSeamless);
75294a49301eSmrg         break;
75304a49301eSmrg      case GL_MAX_SERVER_WAIT_TIMEOUT:
75314a49301eSmrg         CHECK_EXT1(ARB_sync, "GetInteger64v");
75324a49301eSmrg         params[0] = ctx->Const.MaxServerWaitTimeout;
75334a49301eSmrg         break;
7534cdc920a0Smrg      case GL_NUM_EXTENSIONS:
7535cdc920a0Smrg         params[0] = (GLint64)(_mesa_get_extension_count(ctx));
7536cdc920a0Smrg         break;
7537cdc920a0Smrg      case GL_MAJOR_VERSION:
7538cdc920a0Smrg         params[0] = (GLint64)(ctx->VersionMajor);
7539cdc920a0Smrg         break;
7540cdc920a0Smrg      case GL_MINOR_VERSION:
7541cdc920a0Smrg         params[0] = (GLint64)(ctx->VersionMinor);
7542cdc920a0Smrg         break;
75434a49301eSmrg      default:
75444a49301eSmrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetInteger64v(pname=0x%x)", pname);
75454a49301eSmrg   }
75464a49301eSmrg}
75474a49301eSmrg#endif /* FEATURE_ARB_sync */
75484a49301eSmrg
75497117f1b4Smrg
75507117f1b4Smrgvoid GLAPIENTRY
75517117f1b4Smrg_mesa_GetDoublev( GLenum pname, GLdouble *params )
75527117f1b4Smrg{
75537117f1b4Smrg   const GLfloat magic = -1234.5F;
75547117f1b4Smrg   GLfloat values[16];
75557117f1b4Smrg   GLuint i;
75567117f1b4Smrg
75577117f1b4Smrg   if (!params)
75587117f1b4Smrg      return;
75597117f1b4Smrg
75607117f1b4Smrg   /* Init temp array to magic numbers so we can figure out how many values
75617117f1b4Smrg    * are returned by the GetFloatv() call.
75627117f1b4Smrg    */
75637117f1b4Smrg   for (i = 0; i < 16; i++)
75647117f1b4Smrg      values[i] = magic;
75657117f1b4Smrg
75667117f1b4Smrg   _mesa_GetFloatv(pname, values);
75677117f1b4Smrg
75687117f1b4Smrg   for (i = 0; i < 16 && values[i] != magic; i++)
75697117f1b4Smrg      params[i] = (GLdouble) values[i];
75707117f1b4Smrg}
75717117f1b4Smrg
7572cdc920a0Smrgvoid GLAPIENTRY
7573cdc920a0Smrg_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
7574cdc920a0Smrg{
7575cdc920a0Smrg   GET_CURRENT_CONTEXT(ctx);
7576cdc920a0Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
7577cdc920a0Smrg
7578cdc920a0Smrg   if (!params)
7579cdc920a0Smrg      return;
7580cdc920a0Smrg
7581cdc920a0Smrg   if (ctx->NewState)
7582cdc920a0Smrg      _mesa_update_state(ctx);
7583cdc920a0Smrg
7584cdc920a0Smrg   switch (pname) {
7585cdc920a0Smrg      case GL_BLEND:
7586cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetBooleanIndexedv");
7587cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7588cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
7589cdc920a0Smrg         }
7590cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(((ctx->Color.BlendEnabled >> index) & 1));
7591cdc920a0Smrg         break;
7592cdc920a0Smrg      case GL_COLOR_WRITEMASK:
7593cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetBooleanIndexedv");
7594cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7595cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
7596cdc920a0Smrg         }
7597cdc920a0Smrg         params[0] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][RCOMP] ? 1 : 0);
7598cdc920a0Smrg         params[1] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][GCOMP] ? 1 : 0);
7599cdc920a0Smrg         params[2] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][BCOMP] ? 1 : 0);
7600cdc920a0Smrg         params[3] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][ACOMP] ? 1 : 0);
7601cdc920a0Smrg         break;
7602cdc920a0Smrg      default:
7603cdc920a0Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanIndexedv(pname=0x%x)", pname);
7604cdc920a0Smrg   }
7605cdc920a0Smrg}
7606cdc920a0Smrg
7607cdc920a0Smrgvoid GLAPIENTRY
7608cdc920a0Smrg_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
7609cdc920a0Smrg{
7610cdc920a0Smrg   GET_CURRENT_CONTEXT(ctx);
7611cdc920a0Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
7612cdc920a0Smrg
7613cdc920a0Smrg   if (!params)
7614cdc920a0Smrg      return;
7615cdc920a0Smrg
7616cdc920a0Smrg   if (ctx->NewState)
7617cdc920a0Smrg      _mesa_update_state(ctx);
7618cdc920a0Smrg
7619cdc920a0Smrg   switch (pname) {
7620cdc920a0Smrg      case GL_BLEND:
7621cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetIntegerIndexedv");
7622cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7623cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
7624cdc920a0Smrg         }
7625cdc920a0Smrg         params[0] = ((ctx->Color.BlendEnabled >> index) & 1);
7626cdc920a0Smrg         break;
7627cdc920a0Smrg      case GL_COLOR_WRITEMASK:
7628cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetIntegerIndexedv");
7629cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7630cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
7631cdc920a0Smrg         }
7632cdc920a0Smrg         params[0] = ctx->Color.ColorMask[index][RCOMP] ? 1 : 0;
7633cdc920a0Smrg         params[1] = ctx->Color.ColorMask[index][GCOMP] ? 1 : 0;
7634cdc920a0Smrg         params[2] = ctx->Color.ColorMask[index][BCOMP] ? 1 : 0;
7635cdc920a0Smrg         params[3] = ctx->Color.ColorMask[index][ACOMP] ? 1 : 0;
7636cdc920a0Smrg         break;
7637cdc920a0Smrg      default:
7638cdc920a0Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerIndexedv(pname=0x%x)", pname);
7639cdc920a0Smrg   }
7640cdc920a0Smrg}
7641cdc920a0Smrg
7642cdc920a0Smrg#if FEATURE_ARB_sync
7643cdc920a0Smrgvoid GLAPIENTRY
7644cdc920a0Smrg_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
7645cdc920a0Smrg{
7646cdc920a0Smrg   GET_CURRENT_CONTEXT(ctx);
7647cdc920a0Smrg   ASSERT_OUTSIDE_BEGIN_END(ctx);
7648cdc920a0Smrg
7649cdc920a0Smrg   if (!params)
7650cdc920a0Smrg      return;
7651cdc920a0Smrg
7652cdc920a0Smrg   if (ctx->NewState)
7653cdc920a0Smrg      _mesa_update_state(ctx);
7654cdc920a0Smrg
7655cdc920a0Smrg   switch (pname) {
7656cdc920a0Smrg      case GL_BLEND:
7657cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetInteger64Indexedv");
7658cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7659cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
7660cdc920a0Smrg         }
7661cdc920a0Smrg         params[0] = (GLint64)(((ctx->Color.BlendEnabled >> index) & 1));
7662cdc920a0Smrg         break;
7663cdc920a0Smrg      case GL_COLOR_WRITEMASK:
7664cdc920a0Smrg         CHECK_EXT1(EXT_draw_buffers2, "GetInteger64Indexedv");
7665cdc920a0Smrg         if (index >= ctx->Const.MaxDrawBuffers) {
7666cdc920a0Smrg            _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
7667cdc920a0Smrg         }
7668cdc920a0Smrg         params[0] = (GLint64)(ctx->Color.ColorMask[index][RCOMP] ? 1 : 0);
7669cdc920a0Smrg         params[1] = (GLint64)(ctx->Color.ColorMask[index][GCOMP] ? 1 : 0);
7670cdc920a0Smrg         params[2] = (GLint64)(ctx->Color.ColorMask[index][BCOMP] ? 1 : 0);
7671cdc920a0Smrg         params[3] = (GLint64)(ctx->Color.ColorMask[index][ACOMP] ? 1 : 0);
7672cdc920a0Smrg         break;
7673cdc920a0Smrg      default:
7674cdc920a0Smrg         _mesa_error(ctx, GL_INVALID_ENUM, "glGetInteger64Indexedv(pname=0x%x)", pname);
7675cdc920a0Smrg   }
7676cdc920a0Smrg}
7677cdc920a0Smrg#endif /* FEATURE_ARB_sync */
7678cdc920a0Smrg
7679