Home | History | Annotate | Download | only in main

Lines Matching full:ctx

46    if (!ctx->Extensions.EXTNAME) {					\
55 client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
57 struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
79 var = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].Enabled;
80 flag = VERT_BIT_TEX(ctx->Array.ActiveTexture);
131 if (!ctx->Extensions.NV_primitive_restart) {
134 var = &ctx->Array.PrimitiveRestart;
145 FLUSH_VERTICES(ctx, _NEW_ARRAY);
147 _ae_invalidate_state(ctx, _NEW_ARRAY);
158 if (ctx->Driver.Enable) {
159 ctx->Driver.Enable( ctx, cap, state );
165 _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(%s)",
180 GET_CURRENT_CONTEXT(ctx);
181 ASSERT_OUTSIDE_BEGIN_END(ctx);
182 client_state( ctx, cap, GL_TRUE );
196 GET_CURRENT_CONTEXT(ctx);
197 ASSERT_OUTSIDE_BEGIN_END(ctx);
198 client_state( ctx, cap, GL_FALSE );
204 if (!ctx->Extensions.EXTNAME) { \
209 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
220 get_texcoord_unit(struct gl_context *ctx)
222 if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
223 _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)");
227 return &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
238 enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
240 struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
247 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
256 * \param ctx GL context.
266 _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
269 _mesa_debug(ctx, "%s %s (newstate is %x)\n",
272 ctx->NewState);
276 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
278 if (ctx->Color.AlphaEnabled == state)
280 FLUSH_VERTICES(ctx, _NEW_COLOR);
281 ctx->Color.AlphaEnabled = state;
284 if (ctx->API != API_OPENGL)
286 if (ctx->Eval.AutoNormal == state)
288 FLUSH_VERTICES(ctx, _NEW_EVAL);
289 ctx->Eval.AutoNormal = state;
294 state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
295 if (newEnabled != ctx->Color.BlendEnabled) {
296 FLUSH_VERTICES(ctx, _NEW_COLOR);
297 ctx->Color.BlendEnabled = newEnabled;
313 if (p >= ctx->Const.MaxClipPlanes)
316 if ((ctx->Transform.ClipPlanesEnabled & (1 << p))
320 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
323 ctx->Transform.ClipPlanesEnabled |= (1 << p);
324 _mesa_update_clip_plane(ctx, p);
327 ctx->Transform.ClipPlanesEnabled &= ~(1 << p);
333 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
335 if (ctx->Light.ColorMaterialEnabled == state)
337 FLUSH_VERTICES(ctx, _NEW_LIGHT);
338 FLUSH_CURRENT(ctx, 0);
339 ctx->Light.ColorMaterialEnabled = state;
341 _mesa_update_color_material( ctx,
342 ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
346 if (ctx->Polygon.CullFlag == state)
348 FLUSH_VERTICES(ctx, _NEW_POLYGON);
349 ctx->Polygon.CullFlag = state;
352 if (ctx->Depth.Test == state)
354 FLUSH_VERTICES(ctx, _NEW_DEPTH);
355 ctx->Depth.Test = state;
358 if (!_mesa_is_desktop_gl(ctx))
360 ctx->Debug.SyncOutput = state;
363 if (ctx->Color.DitherFlag == state)
365 FLUSH_VERTICES(ctx, _NEW_COLOR);
366 ctx->Color.DitherFlag = state;
369 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
371 if (ctx->Fog.Enabled == state)
373 FLUSH_VERTICES(ctx, _NEW_FOG);
374 ctx->Fog.Enabled = state;
384 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
386 if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
388 FLUSH_VERTICES(ctx, _NEW_LIGHT);
389 ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
391 insert_at_tail(&ctx->Light.EnabledList,
392 &ctx->Light.Light[cap-GL_LIGHT0]);
395 remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
399 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
401 if (ctx->Light.Enabled == state)
403 FLUSH_VERTICES(ctx, _NEW_LIGHT);
404 ctx->Light.Enabled = state;
405 if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
406 ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
408 ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
411 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
413 if (ctx->Line.SmoothFlag == state)
415 FLUSH_VERTICES(ctx, _NEW_LINE);
416 ctx->Line.SmoothFlag = state;
417 ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
420 if (ctx->API != API_OPENGL)
422 if (ctx->Line.StippleFlag == state)
424 FLUSH_VERTICES(ctx, _NEW_LINE);
425 ctx->Line.StippleFlag = state;
426 ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
429 if (ctx->API != API_OPENGL)
431 if (ctx->Color.IndexLogicOpEnabled == state)
433 FLUSH_VERTICES(ctx, _NEW_COLOR);
434 ctx->Color.IndexLogicOpEnabled = state;
437 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
439 if (ctx->Color.ColorLogicOpEnabled == state)
441 FLUSH_VERTICES(ctx, _NEW_COLOR);
442 ctx->Color.ColorLogicOpEnabled = state;
445 if (ctx->API != API_OPENGL)
447 if (ctx->Eval.Map1Color4 == state)
449 FLUSH_VERTICES(ctx, _NEW_EVAL);
450 ctx->Eval.Map1Color4 = state;
453 if (ctx->API != API_OPENGL)
455 if (ctx->Eval.Map1Index == state)
457 FLUSH_VERTICES(ctx, _NEW_EVAL);
458 ctx->Eval.Map1Index = state;
461 if (ctx->API != API_OPENGL)
463 if (ctx->Eval.Map1Normal == state)
465 FLUSH_VERTICES(ctx, _NEW_EVAL);
466 ctx->Eval.Map1Normal = state;
469 if (ctx->API != API_OPENGL)
471 if (ctx->Eval.Map1TextureCoord1 == state)
473 FLUSH_VERTICES(ctx, _NEW_EVAL);
474 ctx->Eval.Map1TextureCoord1 = state;
477 if (ctx->API != API_OPENGL)
479 if (ctx->Eval.Map1TextureCoord2 == state)
481 FLUSH_VERTICES(ctx, _NEW_EVAL);
482 ctx->Eval.Map1TextureCoord2 = state;
485 if (ctx->API != API_OPENGL)
487 if (ctx->Eval.Map1TextureCoord3 == state)
489 FLUSH_VERTICES(ctx, _NEW_EVAL);
490 ctx->Eval.Map1TextureCoord3 = state;
493 if (ctx->API != API_OPENGL)
495 if (ctx->Eval.Map1TextureCoord4 == state)
497 FLUSH_VERTICES(ctx, _NEW_EVAL);
498 ctx->Eval.Map1TextureCoord4 = state;
501 if (ctx->API != API_OPENGL)
503 if (ctx->Eval.Map1Vertex3 == state)
505 FLUSH_VERTICES(ctx, _NEW_EVAL);
506 ctx->Eval.Map1Vertex3 = state;
509 if (ctx->API != API_OPENGL)
511 if (ctx->Eval.Map1Vertex4 == state)
513 FLUSH_VERTICES(ctx, _NEW_EVAL);
514 ctx->Eval.Map1Vertex4 = state;
517 if (ctx->API != API_OPENGL)
519 if (ctx
521 FLUSH_VERTICES(ctx, _NEW_EVAL);
522 ctx->Eval.Map2Color4 = state;
525 if (ctx->API != API_OPENGL)
527 if (ctx->Eval.Map2Index == state)
529 FLUSH_VERTICES(ctx, _NEW_EVAL);
530 ctx->Eval.Map2Index = state;
533 if (ctx->API != API_OPENGL)
535 if (ctx->Eval.Map2Normal == state)
537 FLUSH_VERTICES(ctx, _NEW_EVAL);
538 ctx->Eval.Map2Normal = state;
541 if (ctx->API != API_OPENGL)
543 if (ctx->Eval.Map2TextureCoord1 == state)
545 FLUSH_VERTICES(ctx, _NEW_EVAL);
546 ctx->Eval.Map2TextureCoord1 = state;
549 if (ctx->API != API_OPENGL)
551 if (ctx->Eval.Map2TextureCoord2 == state)
553 FLUSH_VERTICES(ctx, _NEW_EVAL);
554 ctx->Eval.Map2TextureCoord2 = state;
557 if (ctx->API != API_OPENGL)
559 if (ctx->Eval.Map2TextureCoord3 == state)
561 FLUSH_VERTICES(ctx, _NEW_EVAL);
562 ctx->Eval.Map2TextureCoord3 = state;
565 if (ctx->API != API_OPENGL)
567 if (ctx->Eval.Map2TextureCoord4 == state)
569 FLUSH_VERTICES(ctx, _NEW_EVAL);
570 ctx->Eval.Map2TextureCoord4 = state;
573 if (ctx->API != API_OPENGL)
575 if (ctx->Eval.Map2Vertex3 == state)
577 FLUSH_VERTICES(ctx, _NEW_EVAL);
578 ctx->Eval.Map2Vertex3 = state;
581 if (ctx->API != API_OPENGL)
583 if (ctx->Eval.Map2Vertex4 == state)
585 FLUSH_VERTICES(ctx, _NEW_EVAL);
586 ctx->Eval.Map2Vertex4 = state;
589 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
591 if (ctx->Transform.Normalize == state)
593 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
594 ctx->Transform.Normalize = state;
597 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
599 if (ctx->Point.SmoothFlag == state)
601 FLUSH_VERTICES(ctx, _NEW_POINT);
602 ctx->Point.SmoothFlag = state;
603 ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
606 if (!_mesa_is_desktop_gl(ctx))
608 if (ctx->Polygon.SmoothFlag == state)
610 FLUSH_VERTICES(ctx, _NEW_POLYGON);
611 ctx->Polygon.SmoothFlag = state;
612 ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
615 if (ctx->API != API_OPENGL)
617 if (ctx->Polygon.StippleFlag == state)
619 FLUSH_VERTICES(ctx, _NEW_POLYGON);
620 ctx->Polygon.StippleFlag = state;
621 ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
624 if (!_mesa_is_desktop_gl(ctx))
626 if (ctx->Polygon.OffsetPoint == state)
628 FLUSH_VERTICES(ctx, _NEW_POLYGON);
629 ctx->Polygon.OffsetPoint = state;
632 if (!_mesa_is_desktop_gl(ctx))
634 if (ctx->Polygon.OffsetLine == state)
636 FLUSH_VERTICES(ctx, _NEW_POLYGON);
637 ctx->Polygon.OffsetLine = state;
640 if (ctx->Polygon.OffsetFill == state)
642 FLUSH_VERTICES(ctx, _NEW_POLYGON);
643 ctx->Polygon.OffsetFill = state;
646 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
648 if (ctx->Transform.RescaleNormals == state)
650 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
651 ctx->Transform.RescaleNormals = state;
654 if (ctx->Scissor.Enabled == state)
656 FLUSH_VERTICES(ctx, _NEW_SCISSOR);
657 ctx->Scissor.Enabled = state;
660 if (ctx->Stencil.Enabled == state)
662 FLUSH_VERTICES(ctx, _NEW_STENCIL);
663 ctx->Stencil.Enabled = state;
666 if (ctx->API != API_OPENGL)
668 if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
673 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
675 if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
680 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
682 if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
691 struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
693 if (ctx->API != API_OPENGL)
703 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
713 struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
715 if (ctx->API != API_OPENGLES)
725 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
742 client_state( ctx, cap, state );
747 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
750 if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
757 if (ctx->API != API_OPENGL)
760 if (ctx->Fog.ColorSumEnabled == state)
762 FLUSH_VERTICES(ctx, _NEW_FOG);
763 ctx->Fog.ColorSumEnabled = state;
768 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
770 if (ctx->Multisample.Enabled == state)
772 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
773 ctx->Multisample.Enabled = state;
776 if (ctx->Multisample.SampleAlphaToCoverage == state)
778 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
779 ctx->Multisample.SampleAlphaToCoverage = state;
782 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
784 if (ctx->Multisample.SampleAlphaToOne == state)
786 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
787 ctx->Multisample.SampleAlphaToOne = state;
790 if (ctx->Multisample.SampleCoverage == state)
792 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
793 ctx->Multisample.SampleCoverage = state;
796 if (!_mesa_is_desktop_gl(ctx))
798 if (ctx->Multisample.SampleCoverageInvert == state)
800 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
801 ctx->Multisample.SampleCoverageInvert = state;
806 if (ctx->API != API_OPENGL)
809 if (ctx->Transform.RasterPositionUnclipped == state)
811 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
812 ctx->Transform.RasterPositionUnclipped = state;
817 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
820 if (ctx->Point.PointSprite == state)
822 FLUSH_VERTICES(ctx, _NEW_POINT);
823 ctx->Point.PointSprite = state;
828 if (ctx->API != API_OPENGL)
831 if (ctx->VertexProgram.Enabled == state)
833 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
834 ctx->VertexProgram.Enabled = state;
840 if (!_mesa_is_desktop_gl(ctx))
843 if (ctx->VertexProgram.PointSizeEnabled == state)
845 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
846 ctx->VertexProgram.PointSizeEnabled = state;
849 if (ctx->API != API_OPENGL)
852 if (ctx->VertexProgram.TwoSideEnabled == state)
854 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
855 ctx->VertexProgram.TwoSideEnabled = state;
875 if (ctx->API != API_OPENGL)
880 FLUSH_VERTICES(ctx, _NEW_EVAL);
881 ctx->Eval.Map1Attrib[map] = state;
900 if (ctx->API != API_OPENGL)
905 FLUSH_VERTICES(ctx, _NEW_EVAL);
906 ctx->Eval.Map2Attrib[map] = state;
913 if (ctx->API != API_OPENGL)
916 if (ctx->FragmentProgram.Enabled == state)
918 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
919 ctx->FragmentProgram.Enabled = state;
925 if (ctx->API != API_OPENGL)
928 if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
935 if (ctx->API != API_OPENGL)
938 if (ctx->Stencil.TestTwoSide == state)
940 FLUSH_VERTICES(ctx, _NEW_STENCIL);
941 ctx->Stencil.TestTwoSide = state;
943 ctx->Stencil._BackFace = 2;
945 ctx->Stencil._BackFace = 1;
951 if (ctx->API != API_OPENGL)
954 if (ctx->FragmentProgram.Enabled == state)
956 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
957 ctx->FragmentProgram.Enabled = state;
963 if (!_mesa_is_desktop_gl(ctx))
966 if (ctx->Depth.BoundsTest == state)
968 FLUSH_VERTICES(ctx, _NEW_DEPTH);
969 ctx->Depth.BoundsTest = state;
973 if (!_mesa_is_desktop_gl(ctx))
976 if (ctx->Transform.DepthClamp == state)
978 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
979 ctx->Transform.DepthClamp = state;
984 if (ctx->API != API_OPENGL)
987 if (ctx->ATIFragmentShader.Enabled == state)
989 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
990 ctx->ATIFragmentShader.Enabled = state;
996 if (ctx->API != API_OPENGL)
999 if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) {
1005 if (ctx->API != API_OPENGL)
1008 if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) {
1014 if (!_mesa_is_desktop_gl(ctx))
1017 if (ctx->Texture.CubeMapSeamless != state) {
1018 FLUSH_VERTICES(ctx, _NEW_TEXTURE);
1019 ctx->Texture.CubeMapSeamless = state;
1025 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1028 if (ctx->RasterDiscard != state) {
1029 FLUSH_VERTICES(ctx, _NEW_RASTERIZER_DISCARD);
1030 ctx->RasterDiscard = state;
1039 if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 31) {
1042 if (ctx->Array.PrimitiveRestart != state) {
1043 FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
1044 ctx->Array.PrimitiveRestart = state;
1050 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1053 FLUSH_VERTICES(ctx, _NEW_BUFFERS);
1054 ctx->Color.sRGBEnabled = state;
1059 if (!_mesa_is_gles(ctx))
1062 if (!enable_texture(ctx, state, TEXTURE_EXTERNAL_BIT)) {
1071 if (ctx->Driver.Enable) {
1072 ctx->Driver.Enable( ctx, cap, state );
1078 _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(%s)",
1090 GET_CURRENT_CONTEXT(ctx);
1091 ASSERT_OUTSIDE_BEGIN_END(ctx);
1093 _mesa_set_enable( ctx, cap, GL_TRUE );
1104 GET_CURRENT_CONTEXT(ctx);
1105 ASSERT_OUTSIDE_BEGIN_END(ctx);
1107 _mesa_set_enable( ctx, cap, GL_FALSE );
1116 _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
1122 if (!ctx->Extensions.EXT_draw_buffers2) {
1125 if (index >= ctx->Const.MaxDrawBuffers) {
1126 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
1130 if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
1131 FLUSH_VERTICES(ctx, _NEW_COLOR);
1133 ctx->Color.BlendEnabled |= (1 << index);
1135 ctx->Color.BlendEnabled &= ~(1 << index);
1144 _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
1153 GET_CURRENT_CONTEXT(ctx);
1154 ASSERT_OUTSIDE_BEGIN_END(ctx);
1155 _mesa_set_enablei(ctx, cap, index, GL_FALSE);
1162 GET_CURRENT_CONTEXT(ctx);
1163 ASSERT_OUTSIDE_BEGIN_END(ctx);
1164 _mesa_set_enablei(ctx, cap, index, GL_TRUE);
1171 GET_CURRENT_CONTEXT(ctx);
1172 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
1175 if (index >= ctx->Const.MaxDrawBuffers) {
1176 _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
1180 return (ctx->Color.BlendEnabled >> index) & 1;
1182 _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
1193 if (!ctx->Extensions.EXTNAME) { \
1199 if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
1208 is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
1211 &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
1228 GET_CURRENT_CONTEXT(ctx);
1229 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
1233 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1235 return ctx->Color.AlphaEnabled;
1237 if (ctx->API != API_OPENGL)
1239 return ctx->Eval.AutoNormal;
1241 return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */
1252 if (p >= ctx->Const.MaxClipPlanes)
1255 return (ctx->Transform.ClipPlanesEnabled >> p) & 1;
1258 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1260 return ctx->Light.ColorMaterialEnabled;
1262 return ctx->Polygon.CullFlag;
1264 if (!_mesa_is_desktop_gl(ctx))
1266 return ctx->Debug.SyncOutput;
1268 return ctx->Depth.Test;
1270 return ctx->Color.DitherFlag;
1272 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1274 return ctx->Fog.Enabled;
1276 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1278 return ctx->Light.Enabled;
1287 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1289 return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
1291 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1293 return ctx->Line.SmoothFlag;
1295 if (ctx->API != API_OPENGL)
1297 return ctx->Line.StippleFlag;
1299 if (ctx->API != API_OPENGL)
1301 return ctx->Color.IndexLogicOpEnabled;
1303 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1305 return ctx->Color.ColorLogicOpEnabled;
1307 if (ctx->API != API_OPENGL)
1309 return ctx->Eval.Map1Color4;
1311 if (ctx->API != API_OPENGL)
1313 return ctx->Eval.Map1Index;
1315 if (ctx->API != API_OPENGL)
1317 return ctx->Eval.Map1Normal;
1319 if (ctx->API != API_OPENGL)
1321 return ctx->Eval.Map1TextureCoord1;
1323 if (ctx->API != API_OPENGL)
1325 return ctx->Eval.Map1TextureCoord2;
1327 if (ctx->API != API_OPENGL)
1329 return ctx->Eval.Map1TextureCoord3;
1331 if (ctx->API != API_OPENGL)
1333 return ctx->Eval.Map1TextureCoord4;
1335 if (ctx->API != API_OPENGL)
1337 return ctx->Eval.Map1Vertex3;
1339 if (ctx->API != API_OPENGL)
1341 return ctx->Eval.Map1Vertex4;
1343 if (ctx->API != API_OPENGL)
1345 return ctx->Eval.Map2Color4;
1347 if (ctx->API != API_OPENGL)
1349 return ctx->Eval.Map2Index;
1351 if (ctx->API != API_OPENGL)
1353 return ctx->Eval.Map2Normal;
1355 if (ctx->API != API_OPENGL)
1357 return ctx->Eval.Map2TextureCoord1;
1359 if (ctx->API != API_OPENGL)
1361 return ctx->Eval.Map2TextureCoord2;
1363 if (ctx->API != API_OPENGL)
1365 return ctx->Eval.Map2TextureCoord3;
1367 if (ctx->API != API_OPENGL)
1369 return ctx->Eval.Map2TextureCoord4;
1371 if (ctx->API != API_OPENGL)
1373 return ctx->Eval.Map2Vertex3;
1375 if (ctx->API != API_OPENGL)
1377 return ctx->Eval.Map2Vertex4;
1379 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1381 return ctx->Transform.Normalize;
1383 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1385 return ctx->Point.SmoothFlag;
1387 if (!_mesa_is_desktop_gl(ctx))
1389 return ctx->Polygon.SmoothFlag;
1391 if (ctx->API != API_OPENGL)
1393 return ctx->Polygon.StippleFlag;
1395 if (!_mesa_is_desktop_gl(ctx))
1397 return ctx->Polygon.OffsetPoint;
1399 if (!_mesa_is_desktop_gl(ctx))
1401 return ctx->Polygon.OffsetLine;
1403 return ctx->Polygon.OffsetFill;
1405 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1407 return ctx->Transform.RescaleNormals;
1409 return ctx->Scissor.Enabled;
1411 return ctx->Stencil.Enabled;
1413 if (ctx->API != API_OPENGL)
1415 return is_texture_enabled(ctx, TEXTURE_1D_BIT);
1417 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1419 return is_texture_enabled(ctx, TEXTURE_2D_BIT);
1421 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1423 return is_texture_enabled(ctx, TEXTURE_3D_BIT);
1429 const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
1431 if (ctx->API != API_OPENGL)
1443 const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
1445 if (ctx->API != API_OPENGLES)
1457 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1459 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled != 0);
1461 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1463 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0);
1465 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1467 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0);
1469 if (ctx->API != API_OPENGL)
1471 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0);
1473 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1475 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)]
1478 if (ctx->API != API_OPENGL)
1480 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0);
1482 if (ctx->API != API_OPENGL)
1485 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0);
1487 if (ctx->API != API_OPENGL)
1490 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
1493 if (ctx->API != API_OPENGLES)
1495 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0);
1501 return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
1505 if (ctx->API != API_OPENGL)
1508 return ctx->Fog.ColorSumEnabled;
1512 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1514 return ctx->Multisample.Enabled;
1516 return ctx->Multisample.SampleAlphaToCoverage;
1518 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1520 return ctx->Multisample.SampleAlphaToOne;
1522 return ctx->Multisample.SampleCoverage;
1524 if (!_mesa_is_desktop_gl(ctx))
1526 return ctx->Multisample.SampleCoverageInvert;
1530 if (ctx->API != API_OPENGL)
1533 return ctx->Transform.RasterPositionUnclipped;
1537 if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
1540 return ctx->Point.PointSprite;
1544 if (ctx->API != API_OPENGL)
1547 return ctx->VertexProgram.Enabled;
1552 if (!_mesa_is_desktop_gl(ctx))
1555 return ctx->VertexProgram.PointSizeEnabled;
1557 if (ctx->API != API_OPENGL)
1560 return ctx->VertexProgram.TwoSideEnabled;
1579 if (ctx->API != API_OPENGL)
1584 ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(ctx->Array.ArrayObj->VertexAttrib));
1585 return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled != 0);
1603 if (ctx->API != API_OPENGL)
1608 return ctx->Eval.Map1Attrib[map];
1626 if (ctx->API != API_OPENGL)
1631 return ctx->Eval.Map2Attrib[map];
1637 if (ctx->API != API_OPENGL)
1640 return ctx->FragmentProgram.Enabled;
1645 if (ctx->API != API_OPENGL)
1648 return is_texture_enabled(ctx, TEXTURE_RECT_BIT);
1652 if (ctx->API != API_OPENGL)
1655 return ctx->Stencil.TestTwoSide;
1659 if (ctx->API != API_OPENGL)
1661 return ctx->FragmentProgram.Enabled;
1666 if (!_mesa_is_desktop_gl(ctx))
1669 return ctx->Depth.BoundsTest;
1673 if (!_mesa_is_desktop_gl(ctx))
1676 return ctx->Transform.DepthClamp;
1680 if (ctx->API != API_OPENGL)
1683 return ctx->ATIFragmentShader.Enabled;
1687 if (!_mesa_is_desktop_gl(ctx))
1690 return ctx->Texture.CubeMapSeamless;
1694 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1697 return ctx->RasterDiscard;
1702 if (ctx->API != API_OPENGL || !ctx->Extensions.NV_primitive_restart) {
1705 return ctx->Array.PrimitiveRestart;
1709 if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 31) {
1712 return ctx->Array.PrimitiveRestart;
1716 if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
1719 return ctx->Color.sRGBEnabled;
1723 if (!_mesa_is_gles(ctx))
1726 return is_texture_enabled(ctx, TEXTURE_EXTERNAL_BIT);
1735 _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(%s)",