Lines Matching refs:ctx
52 _mesa_update_derived_primitive_restart_state(struct gl_context *ctx)
54 if (ctx->Array.PrimitiveRestart ||
55 ctx->Array.PrimitiveRestartFixedIndex) {
57 _mesa_primitive_restart_index(ctx, 1),
58 _mesa_primitive_restart_index(ctx, 2),
59 _mesa_primitive_restart_index(ctx, 4),
62 ctx->Array._RestartIndex[0] = restart_index[0];
63 ctx->Array._RestartIndex[1] = restart_index[1];
64 ctx->Array._RestartIndex[2] = restart_index[2];
71 ctx->Array._PrimitiveRestart[0] = true && restart_index[0] <= UINT8_MAX;
72 ctx->Array._PrimitiveRestart[1] = true && restart_index[1] <= UINT16_MAX;
73 ctx->Array._PrimitiveRestart[2] = true;
75 ctx->Array._PrimitiveRestart[0] = false;
76 ctx->Array._PrimitiveRestart[1] = false;
77 ctx->Array._PrimitiveRestart[2] = false;
86 vao_state(struct gl_context *ctx, struct gl_vertex_array_object* vao,
90 _mesa_enable_vertex_array_attrib(ctx, vao, attr);
92 _mesa_disable_vertex_array_attrib(ctx, vao, attr);
100 client_state(struct gl_context *ctx, struct gl_vertex_array_object* vao,
105 vao_state(ctx, vao, VERT_ATTRIB_POS, state);
108 vao_state(ctx, vao, VERT_ATTRIB_NORMAL, state);
111 vao_state(ctx, vao, VERT_ATTRIB_COLOR0, state);
114 vao_state(ctx, vao, VERT_ATTRIB_COLOR_INDEX, state);
117 vao_state(ctx, vao, VERT_ATTRIB_TEX(ctx->Array.ActiveTexture), state);
120 vao_state(ctx, vao, VERT_ATTRIB_EDGEFLAG, state);
123 vao_state(ctx, vao, VERT_ATTRIB_FOG, state);
126 vao_state(ctx, vao, VERT_ATTRIB_COLOR1, state);
130 if (ctx->VertexProgram.PointSizeEnabled != state) {
131 FLUSH_VERTICES(ctx, _NEW_PROGRAM, 0);
132 ctx->VertexProgram.PointSizeEnabled = state;
134 vao_state(ctx, vao, VERT_ATTRIB_POINT_SIZE, state);
139 if (!_mesa_has_NV_primitive_restart(ctx))
141 if (ctx->Array.PrimitiveRestart == state)
144 ctx->Array.PrimitiveRestart = state;
145 _mesa_update_derived_primitive_restart_state(ctx);
154 _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(%s)",
166 client_state_i(struct gl_context *ctx, struct gl_vertex_array_object* vao,
172 _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientStateiEXT(cap=%s)",
178 if (index >= ctx->Const.MaxTextureCoordUnits) {
179 _mesa_error(ctx, GL_INVALID_VALUE, "gl%sClientStateiEXT(index=%d)",
185 saved_active = ctx->Array.ActiveTexture;
187 client_state(ctx, vao, cap, state);
202 GET_CURRENT_CONTEXT(ctx);
203 client_state( ctx, ctx->Array.VAO, cap, GL_TRUE );
210 GET_CURRENT_CONTEXT(ctx);
211 struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj,
227 if (GL_TEXTURE0 <= cap && cap < GL_TEXTURE0 + ctx->Const.MaxTextureCoordUnits) {
228 GLuint saved_active = ctx->Array.ActiveTexture;
230 client_state(ctx, vao, GL_TEXTURE_COORD_ARRAY, GL_TRUE);
233 client_state(ctx, vao, cap, GL_TRUE);
241 GET_CURRENT_CONTEXT(ctx);
242 client_state_i(ctx, ctx->Array.VAO, cap, index, GL_TRUE);
256 GET_CURRENT_CONTEXT(ctx);
257 client_state( ctx, ctx->Array.VAO, cap, GL_FALSE );
263 GET_CURRENT_CONTEXT(ctx);
264 struct gl_vertex_array_object* vao = _mesa_lookup_vao_err(ctx, vaobj,
280 if (GL_TEXTURE0 <= cap && cap < GL_TEXTURE0 + ctx->Const.MaxTextureCoordUnits) {
281 GLuint saved_active = ctx->Array.ActiveTexture;
283 client_state(ctx, vao, GL_TEXTURE_COORD_ARRAY, GL_FALSE);
286 client_state(ctx, vao, cap, GL_FALSE);
293 GET_CURRENT_CONTEXT(ctx);
294 client_state_i(ctx, ctx->Array.VAO, cap, index, GL_FALSE);
304 get_texcoord_unit(struct gl_context *ctx)
306 if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
307 _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)");
311 return &ctx->Texture.FixedFuncUnit[ctx->Texture.CurrentUnit];
322 enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
325 _mesa_get_fixedfunc_tex_unit(ctx, ctx->Texture.CurrentUnit);
335 FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE, GL_TEXTURE_BIT | GL_ENABLE_BIT);
346 _mesa_set_multisample(struct gl_context *ctx, GLboolean state)
348 if (ctx->Multisample.Enabled == state)
354 if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
355 FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
357 FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
360 ctx->NewDriverState |= ctx->DriverFlags.NewMultisampleEnable;
361 ctx->Multisample.Enabled = state;
369 _mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state)
371 if (ctx->Color.sRGBEnabled == state)
375 FLUSH_VERTICES(ctx, 0,
377 ctx->NewDriverState |= ST_NEW_FB_STATE;
378 ctx->Color.sRGBEnabled = state;
384 * \param ctx GL context.
394 _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
397 _mesa_debug(ctx, "%s %s (newstate is %x)\n",
400 ctx->NewState);
404 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
406 if (ctx->Color.AlphaEnabled == state)
409 FLUSH_VERTICES(ctx, _NEW_COLOR | _NEW_FF_FRAG_PROGRAM,
411 ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest;
412 ctx->Color.AlphaEnabled = state;
415 if (ctx->API != API_OPENGL_COMPAT)
417 if (ctx->Eval.AutoNormal == state)
419 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
420 vbo_exec_update_eval_maps(ctx);
421 ctx->Eval.AutoNormal = state;
426 state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
427 if (newEnabled != ctx->Color.BlendEnabled) {
428 _mesa_flush_vertices_for_blend_adv(ctx, newEnabled,
429 ctx->Color._AdvancedBlendMode);
430 ctx->PopAttribState |= GL_ENABLE_BIT;
431 ctx->Color.BlendEnabled = newEnabled;
432 _mesa_update_allow_draw_out_of_order(ctx);
433 _mesa_update_valid_to_render_state(ctx);
448 if (p >= ctx->Const.MaxClipPlanes)
451 if ((ctx->Transform.ClipPlanesEnabled & (1 << p))
458 if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
459 FLUSH_VERTICES(ctx, _NEW_TRANSFORM,
462 FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT);
464 ctx->NewDriverState |= ctx->DriverFlags.NewClipPlaneEnable;
467 ctx->Transform.ClipPlanesEnabled |= (1 << p);
471 if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
472 _mesa_update_clip_plane(ctx, p);
473 ctx->NewDriverState |= ST_NEW_CLIP_STATE;
477 ctx->Transform.ClipPlanesEnabled &= ~(1 << p);
482 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
484 if (ctx->Light.ColorMaterialEnabled == state)
486 FLUSH_VERTICES(ctx, _NEW_LIGHT_CONSTANTS | _NEW_FF_VERT_PROGRAM,
488 FLUSH_CURRENT(ctx, 0);
489 ctx->Light.ColorMaterialEnabled = state;
491 _mesa_update_color_material( ctx,
492 ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
496 if (ctx->Polygon.CullFlag == state)
498 FLUSH_VERTICES(ctx, 0,
500 ctx->NewDriverState |= ST_NEW_RASTERIZER;
501 ctx->Polygon.CullFlag = state;
504 if (ctx->Depth.Test == state)
506 FLUSH_VERTICES(ctx, 0,
508 ctx->NewDriverState |= ST_NEW_DSA;
509 ctx->Depth.Test = state;
510 _mesa_update_allow_draw_out_of_order(ctx);
514 _mesa_set_debug_state_int(ctx, cap, state);
515 _mesa_update_debug_callback(ctx);
518 if (ctx->Color.DitherFlag == state)
520 FLUSH_VERTICES(ctx, 0,
522 ctx->NewDriverState |= ST_NEW_BLEND;
523 ctx->Color.DitherFlag = state;
526 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
528 if (ctx->Fog.Enabled == state)
530 FLUSH_VERTICES(ctx, _NEW_FOG | _NEW_FF_FRAG_PROGRAM,
532 ctx->Fog.Enabled = state;
533 ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE;
543 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
545 if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
547 FLUSH_VERTICES(ctx, _NEW_LIGHT_CONSTANTS | _NEW_FF_VERT_PROGRAM,
549 ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
551 ctx->Light._EnabledLights |= 1u << (cap - GL_LIGHT0);
554 ctx->Light._EnabledLights &= ~(1u << (cap - GL_LIGHT0));
558 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
560 if (ctx->Light.Enabled == state)
562 FLUSH_VERTICES(ctx, _NEW_LIGHT_CONSTANTS | _NEW_FF_VERT_PROGRAM |
565 ctx->Light.Enabled = state;
568 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
570 if (ctx->Line.SmoothFlag == state)
572 FLUSH_VERTICES(ctx, 0,
574 ctx->NewDriverState |= ST_NEW_RASTERIZER;
575 ctx->Line.SmoothFlag = state;
578 if (ctx->API != API_OPENGL_COMPAT)
580 if (ctx->Line.StippleFlag == state)
582 FLUSH_VERTICES(ctx, 0,
584 ctx->NewDriverState |= ST_NEW_RASTERIZER;
585 ctx->Line.StippleFlag = state;
588 if (ctx->API != API_OPENGL_COMPAT)
590 if (ctx->Color.IndexLogicOpEnabled == state)
592 FLUSH_VERTICES(ctx, 0,
594 ctx->NewDriverState |= ST_NEW_BLEND;
595 ctx->Color.IndexLogicOpEnabled = state;
598 if (!_mesa_has_INTEL_conservative_rasterization(ctx))
600 if (ctx->IntelConservativeRasterization == state)
602 FLUSH_VERTICES(ctx, 0, 0);
603 ctx->NewDriverState |= ST_NEW_RASTERIZER;
604 ctx->IntelConservativeRasterization = state;
605 _mesa_update_valid_to_render_state(ctx);
608 if (!_mesa_has_NV_conservative_raster(ctx))
610 if (ctx->ConservativeRasterization == state)
612 FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
613 ctx->NewDriverState |= ST_NEW_RASTERIZER;
614 ctx->ConservativeRasterization = state;
617 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
619 if (ctx->Color.ColorLogicOpEnabled == state)
621 FLUSH_VERTICES(ctx, 0,
623 ctx->NewDriverState |= ST_NEW_BLEND;
624 ctx->Color.ColorLogicOpEnabled = state;
625 _mesa_update_allow_draw_out_of_order(ctx);
628 if (ctx->API != API_OPENGL_COMPAT)
630 if (ctx->Eval.Map1Color4 == state)
632 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
633 vbo_exec_update_eval_maps(ctx);
634 ctx->Eval.Map1Color4 = state;
637 if (ctx->API != API_OPENGL_COMPAT)
639 if (ctx->Eval.Map1Index == state)
641 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
642 vbo_exec_update_eval_maps(ctx);
643 ctx->Eval.Map1Index = state;
646 if (ctx->API != API_OPENGL_COMPAT)
648 if (ctx->Eval.Map1Normal == state)
650 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
651 vbo_exec_update_eval_maps(ctx);
652 ctx->Eval.Map1Normal = state;
655 if (ctx->API != API_OPENGL_COMPAT)
657 if (ctx->Eval.Map1TextureCoord1 == state)
659 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
660 vbo_exec_update_eval_maps(ctx);
661 ctx->Eval.Map1TextureCoord1 = state;
664 if (ctx->API != API_OPENGL_COMPAT)
666 if (ctx->Eval.Map1TextureCoord2 == state)
668 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
669 vbo_exec_update_eval_maps(ctx);
670 ctx->Eval.Map1TextureCoord2 = state;
673 if (ctx->API != API_OPENGL_COMPAT)
675 if (ctx->Eval.Map1TextureCoord3 == state)
677 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
678 vbo_exec_update_eval_maps(ctx);
679 ctx->Eval.Map1TextureCoord3 = state;
682 if (ctx->API != API_OPENGL_COMPAT)
684 if (ctx->Eval.Map1TextureCoord4 == state)
686 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
687 vbo_exec_update_eval_maps(ctx);
688 ctx->Eval.Map1TextureCoord4 = state;
691 if (ctx->API != API_OPENGL_COMPAT)
693 if (ctx->Eval.Map1Vertex3 == state)
695 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
696 vbo_exec_update_eval_maps(ctx);
697 ctx->Eval.Map1Vertex3 = state;
700 if (ctx->API != API_OPENGL_COMPAT)
702 if (ctx->Eval.Map1Vertex4 == state)
704 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
705 vbo_exec_update_eval_maps(ctx);
706 ctx->Eval.Map1Vertex4 = state;
709 if (ctx->API != API_OPENGL_COMPAT)
711 if (ctx->Eval.Map2Color4 == state)
713 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
714 vbo_exec_update_eval_maps(ctx);
715 ctx->Eval.Map2Color4 = state;
718 if (ctx->API != API_OPENGL_COMPAT)
720 if (ctx->Eval.Map2Index == state)
722 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
723 vbo_exec_update_eval_maps(ctx);
724 ctx->Eval.Map2Index = state;
727 if (ctx->API != API_OPENGL_COMPAT)
729 if (ctx->Eval.Map2Normal == state)
731 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
732 vbo_exec_update_eval_maps(ctx);
733 ctx->Eval.Map2Normal = state;
736 if (ctx->API != API_OPENGL_COMPAT)
738 if (ctx->Eval.Map2TextureCoord1 == state)
740 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
741 vbo_exec_update_eval_maps(ctx);
742 ctx->Eval.Map2TextureCoord1 = state;
745 if (ctx->API != API_OPENGL_COMPAT)
747 if (ctx->Eval.Map2TextureCoord2 == state)
749 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
750 vbo_exec_update_eval_maps(ctx);
751 ctx->Eval.Map2TextureCoord2 = state;
754 if (ctx->API != API_OPENGL_COMPAT)
756 if (ctx->Eval.Map2TextureCoord3 == state)
758 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
759 vbo_exec_update_eval_maps(ctx);
760 ctx->Eval.Map2TextureCoord3 = state;
763 if (ctx->API != API_OPENGL_COMPAT)
765 if (ctx->Eval.Map2TextureCoord4 == state)
767 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
768 vbo_exec_update_eval_maps(ctx);
769 ctx->Eval.Map2TextureCoord4 = state;
772 if (ctx->API != API_OPENGL_COMPAT)
774 if (ctx->Eval.Map2Vertex3 == state)
776 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
777 vbo_exec_update_eval_maps(ctx);
778 ctx->Eval.Map2Vertex3 = state;
781 if (ctx->API != API_OPENGL_COMPAT)
783 if (ctx->Eval.Map2Vertex4 == state)
785 FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT);
786 vbo_exec_update_eval_maps(ctx);
787 ctx->Eval.Map2Vertex4 = state;
790 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
792 if (ctx->Transform.Normalize == state)
794 FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_FF_VERT_PROGRAM,
796 ctx->Transform.Normalize = state;
799 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
801 if (ctx->Point.SmoothFlag == state)
803 FLUSH_VERTICES(ctx, _NEW_POINT, GL_POINT_BIT | GL_ENABLE_BIT);
804 ctx->Point.SmoothFlag = state;
807 if (!_mesa_is_desktop_gl(ctx))
809 if (ctx->Polygon.SmoothFlag == state)
811 FLUSH_VERTICES(ctx, 0,
813 ctx->NewDriverState |= ST_NEW_RASTERIZER;
814 ctx->Polygon.SmoothFlag = state;
817 if (ctx->API != API_OPENGL_COMPAT)
819 if (ctx->Polygon.StippleFlag == state)
821 FLUSH_VERTICES(ctx, 0,
823 ctx->NewDriverState |= ST_NEW_RASTERIZER;
824 ctx->Polygon.StippleFlag = state;
827 if (!_mesa_is_desktop_gl(ctx))
829 if (ctx->Polygon.OffsetPoint == state)
831 FLUSH_VERTICES(ctx, 0,
833 ctx->NewDriverState |= ST_NEW_RASTERIZER;
834 ctx->Polygon.OffsetPoint = state;
837 if (!_mesa_is_desktop_gl(ctx))
839 if (ctx->Polygon.OffsetLine == state)
841 FLUSH_VERTICES(ctx, 0,
843 ctx->NewDriverState |= ST_NEW_RASTERIZER;
844 ctx->Polygon.OffsetLine = state;
847 if (ctx->Polygon.OffsetFill == state)
849 FLUSH_VERTICES(ctx, 0,
851 ctx->NewDriverState |= ST_NEW_RASTERIZER;
852 ctx->Polygon.OffsetFill = state;
855 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
857 if (ctx->Transform.RescaleNormals == state)
859 FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_FF_VERT_PROGRAM,
861 ctx->Transform.RescaleNormals = state;
867 state * ((1 << ctx->Const.MaxViewports) - 1);
868 if (newEnabled != ctx->Scissor.EnableFlags) {
869 st_flush_bitmap_cache(st_context(ctx));
871 FLUSH_VERTICES(ctx, 0,
873 ctx->NewDriverState |= ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
874 ctx->Scissor.EnableFlags = newEnabled;
879 if (ctx->Stencil.Enabled == state)
881 FLUSH_VERTICES(ctx, 0,
883 ctx->NewDriverState |= ST_NEW_DSA;
884 ctx->Stencil.Enabled = state;
885 _mesa_update_allow_draw_out_of_order(ctx);
888 if (ctx->API != API_OPENGL_COMPAT)
890 if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
895 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
897 if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
902 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
904 if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
913 struct gl_fixedfunc_texture_unit *texUnit = get_texcoord_unit(ctx);
915 if (ctx->API != API_OPENGL_COMPAT)
925 FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE | _NEW_FF_VERT_PROGRAM |
936 struct gl_fixedfunc_texture_unit *texUnit = get_texcoord_unit(ctx);
938 if (ctx->API != API_OPENGLES)
948 FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE | _NEW_FF_VERT_PROGRAM |
960 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
962 client_state( ctx, ctx->Array.VAO, cap, state );
968 if (ctx->API != API_OPENGL_COMPAT)
970 client_state( ctx, ctx->Array.VAO, cap, state );
973 if (ctx->API != API_OPENGLES)
975 client_state( ctx, ctx->Array.VAO, cap, state );
980 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
982 if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
989 if (ctx->API != API_OPENGL_COMPAT)
991 if (ctx->Fog.ColorSumEnabled == state)
993 FLUSH_VERTICES(ctx, _NEW_FOG | _NEW_FF_FRAG_PROGRAM,
995 ctx->Fog.ColorSumEnabled = state;
1000 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1002 _mesa_set_multisample(ctx, state);
1005 if (ctx->Multisample.SampleAlphaToCoverage == state)
1007 FLUSH_VERTICES(ctx, 0,
1009 ctx->NewDriverState |= ST_NEW_BLEND;
1010 ctx->Multisample.SampleAlphaToCoverage = state;
1013 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1015 if (ctx->Multisample.SampleAlphaToOne == state)
1017 FLUSH_VERTICES(ctx, 0,
1019 ctx->NewDriverState |= ST_NEW_BLEND;
1020 ctx->Multisample.SampleAlphaToOne = state;
1023 if (ctx->Multisample.SampleCoverage == state)
1025 FLUSH_VERTICES(ctx, 0,
1027 ctx->NewDriverState |= ST_NEW_SAMPLE_STATE;
1028 ctx->Multisample.SampleCoverage = state;
1031 if (!_mesa_is_desktop_gl(ctx))
1033 if (ctx->Multisample.SampleCoverageInvert == state)
1035 FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT);
1036 ctx->NewDriverState |= ST_NEW_SAMPLE_STATE;
1037 ctx->Multisample.SampleCoverageInvert = state;
1042 if (!_mesa_has_ARB_sample_shading(ctx) && !_mesa_is_gles3(ctx))
1044 if (ctx->Multisample.SampleShading == state)
1046 FLUSH_VERTICES(ctx, 0,
1048 ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading;
1049 ctx->Multisample.SampleShading = state;
1054 if (ctx->API != API_OPENGL_COMPAT)
1056 if (ctx->Transform.RasterPositionUnclipped == state)
1058 FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT);
1059 ctx->Transform.RasterPositionUnclipped = state;
1064 if (!(ctx->API == API_OPENGL_COMPAT &&
1065 _mesa_has_ARB_point_sprite(ctx)) &&
1066 !_mesa_has_OES_point_sprite(ctx))
1068 if (ctx->Point.PointSprite == state)
1070 FLUSH_VERTICES(ctx, _NEW_POINT | _NEW_FF_VERT_PROGRAM |
1072 ctx->Point.PointSprite = state;
1076 if (!_mesa_has_ARB_vertex_program(ctx))
1078 if (ctx->VertexProgram.Enabled == state)
1080 FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT);
1081 ctx->VertexProgram.Enabled = state;
1082 _mesa_update_vertex_processing_mode(ctx);
1083 _mesa_update_valid_to_render_state(ctx);
1089 if (!_mesa_has_ARB_vertex_program(ctx) &&
1090 ctx->API != API_OPENGL_CORE)
1092 if (ctx->VertexProgram.PointSizeEnabled == state)
1094 FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT);
1095 ctx->VertexProgram.PointSizeEnabled = state;
1098 if (!_mesa_has_ARB_vertex_program(ctx))
1100 if (ctx->VertexProgram.TwoSideEnabled == state)
1102 FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT);
1103 ctx->VertexProgram.TwoSideEnabled = state;
1108 if (!_mesa_has_NV_texture_rectangle(ctx))
1110 if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
1117 if (!_mesa_has_EXT_stencil_two_side(ctx))
1119 if (ctx->Stencil.TestTwoSide == state)
1121 FLUSH_VERTICES(ctx, 0,
1123 ctx->NewDriverState |= ST_NEW_DSA;
1124 ctx->Stencil.TestTwoSide = state;
1126 ctx->Stencil._BackFace = 2;
1128 ctx->Stencil._BackFace = 1;
1133 if (!_mesa_has_ARB_fragment_program(ctx))
1135 if (ctx->FragmentProgram.Enabled == state)
1137 FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT);
1138 ctx->FragmentProgram.Enabled = state;
1139 _mesa_update_valid_to_render_state(ctx);
1144 if (!_mesa_has_EXT_depth_bounds_test(ctx))
1146 if (ctx->Depth.BoundsTest == state)
1148 FLUSH_VERTICES(ctx, 0, GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT);
1149 ctx->NewDriverState |= ST_NEW_DSA;
1150 ctx->Depth.BoundsTest = state;
1154 if (!_mesa_has_ARB_depth_clamp(ctx) &&
1155 !_mesa_has_EXT_depth_clamp(ctx))
1157 if (ctx->Transform.DepthClampNear == state &&
1158 ctx->Transform.DepthClampFar == state)
1160 FLUSH_VERTICES(ctx, 0,
1162 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1163 ctx->Transform.DepthClampNear = state;
1164 ctx->Transform.DepthClampFar = state;
1168 if (!_mesa_has_AMD_depth_clamp_separate(ctx))
1170 if (ctx->Transform.DepthClampNear == state)
1172 FLUSH_VERTICES(ctx, 0,
1174 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1175 ctx->Transform.DepthClampNear = state;
1179 if (!_mesa_has_AMD_depth_clamp_separate(ctx))
1181 if (ctx->Transform.DepthClampFar == state)
1183 FLUSH_VERTICES(ctx, 0,
1185 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1186 ctx->Transform.DepthClampFar = state;
1190 if (!_mesa_has_ATI_fragment_shader(ctx))
1192 if (ctx->ATIFragmentShader.Enabled == state)
1194 FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT);
1195 ctx->ATIFragmentShader.Enabled = state;
1199 if (!_mesa_has_ARB_seamless_cube_map(ctx))
1201 if (ctx->Texture.CubeMapSeamless != state) {
1202 FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT, 0);
1203 ctx->Texture.CubeMapSeamless = state;
1208 if (!(_mesa_has_EXT_transform_feedback(ctx) || _mesa_is_gles3(ctx)))
1210 if (ctx->RasterDiscard != state) {
1211 FLUSH_VERTICES(ctx, 0, 0);
1212 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1213 ctx->RasterDiscard = state;
1218 if (!_mesa_has_MESA_tile_raster_order(ctx))
1220 if (ctx->TileRasterOrderFixed != state) {
1221 FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
1222 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1223 ctx->TileRasterOrderFixed = state;
1228 if (!_mesa_has_MESA_tile_raster_order(ctx))
1230 if (ctx->TileRasterOrderIncreasingX != state) {
1231 FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
1232 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1233 ctx->TileRasterOrderIncreasingX = state;
1238 if (!_mesa_has_MESA_tile_raster_order(ctx))
1240 if (ctx->TileRasterOrderIncreasingY != state) {
1241 FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
1242 ctx->NewDriverState |= ST_NEW_RASTERIZER;
1243 ctx->TileRasterOrderIncreasingY = state;
1251 if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 31) {
1254 if (ctx->Array.PrimitiveRestart != state) {
1255 ctx->Array.PrimitiveRestart = state;
1256 _mesa_update_derived_primitive_restart_state(ctx);
1261 if (!_mesa_is_gles3(ctx) && !_mesa_has_ARB_ES3_compatibility(ctx))
1263 if (ctx->Array.PrimitiveRestartFixedIndex != state) {
1264 ctx->Array.PrimitiveRestartFixedIndex = state;
1265 _mesa_update_derived_primitive_restart_state(ctx);
1271 if (!_mesa_has_EXT_framebuffer_sRGB(ctx) &&
1272 !_mesa_has_EXT_sRGB_write_control(ctx))
1274 _mesa_set_framebuffer_srgb(ctx, state);
1279 if (!_mesa_has_OES_EGL_image_external(ctx))
1281 if (!enable_texture(ctx, state, TEXTURE_EXTERNAL_BIT)) {
1288 if (!_mesa_has_ARB_texture_multisample(ctx) && !_mesa_is_gles31(ctx))
1290 if (ctx->Multisample.SampleMask == state)
1292 FLUSH_VERTICES(ctx, 0, 0);
1293 ctx->NewDriverState |= ST_NEW_SAMPLE_STATE;
1294 ctx->Multisample.SampleMask = state;
1298 if (!_mesa_has_KHR_blend_equation_advanced_coherent(ctx))
1300 if (ctx->Color.BlendCoherent == state)
1302 FLUSH_VERTICES(ctx, 0, GL_COLOR_BUFFER_BIT);
1303 ctx->NewDriverState |= ST_NEW_BLEND;
1304 ctx->Color.BlendCoherent = state;
1308 if (!_mesa_has_INTEL_blackhole_render(ctx))
1310 if (ctx->IntelBlackholeRender == state)
1312 FLUSH_VERTICES(ctx, 0, 0);
1313 ctx->IntelBlackholeRender = state;
1314 ctx->pipe->set_frontend_noop(ctx->pipe, state);
1323 _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(%s)",
1335 GET_CURRENT_CONTEXT(ctx);
1337 _mesa_set_enable( ctx, cap, GL_TRUE );
1348 GET_CURRENT_CONTEXT(ctx);
1350 _mesa_set_enable( ctx, cap, GL_FALSE );
1359 _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
1365 if (!ctx->Extensions.EXT_draw_buffers2) {
1368 if (index >= ctx->Const.MaxDrawBuffers) {
1369 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
1373 if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
1374 GLbitfield enabled = ctx->Color.BlendEnabled;
1381 _mesa_flush_vertices_for_blend_adv(ctx, enabled,
1382 ctx->Color._AdvancedBlendMode);
1383 ctx->PopAttribState |= GL_ENABLE_BIT;
1384 ctx->Color.BlendEnabled = enabled;
1385 _mesa_update_allow_draw_out_of_order(ctx);
1386 _mesa_update_valid_to_render_state(ctx);
1390 if (index >= ctx->Const.MaxViewports) {
1391 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
1395 if (((ctx->Scissor.EnableFlags >> index) & 1) != state) {
1396 st_flush_bitmap_cache(st_context(ctx));
1398 FLUSH_VERTICES(ctx, 0,
1400 ctx->NewDriverState |= ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
1402 ctx->Scissor.EnableFlags |= (1 << index);
1404 ctx->Scissor.EnableFlags &= ~(1 << index);
1417 const GLuint curTexUnitSave = ctx->Texture.CurrentUnit;
1418 if (index >= MAX2(ctx->Const.MaxCombinedTextureImageUnits,
1419 ctx->Const.MaxTextureCoordUnits)) {
1420 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
1425 _mesa_set_enable( ctx, cap, state );
1435 _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
1444 GET_CURRENT_CONTEXT(ctx);
1445 _mesa_set_enablei(ctx, cap, index, GL_FALSE);
1452 GET_CURRENT_CONTEXT(ctx);
1453 _mesa_set_enablei(ctx, cap, index, GL_TRUE);
1460 GET_CURRENT_CONTEXT(ctx);
1461 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
1464 if (index >= ctx->Const.MaxDrawBuffers) {
1465 _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
1469 return (ctx->Color.BlendEnabled >> index) & 1;
1471 if (index >= ctx->Const.MaxViewports) {
1472 _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
1476 return (ctx->Scissor.EnableFlags >> index) & 1;
1488 const GLuint curTexUnitSave = ctx->Texture.CurrentUnit;
1489 if (index >= MAX2(ctx->Const.MaxCombinedTextureImageUnits,
1490 ctx->Const.MaxTextureCoordUnits)) {
1491 _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
1501 _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
1513 is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
1516 _mesa_get_fixedfunc_tex_unit(ctx, ctx->Texture.CurrentUnit);
1537 GET_CURRENT_CONTEXT(ctx);
1538 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
1542 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1544 return ctx->Color.AlphaEnabled;
1546 if (ctx->API != API_OPENGL_COMPAT)
1548 return ctx->Eval.AutoNormal;
1550 return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */
1561 if (p >= ctx->Const.MaxClipPlanes)
1564 return (ctx->Transform.ClipPlanesEnabled >> p) & 1;
1567 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1569 return ctx->Light.ColorMaterialEnabled;
1571 return ctx->Polygon.CullFlag;
1574 return (GLboolean) _mesa_get_debug_state_int(ctx, cap);
1576 return ctx->Depth.Test;
1578 return ctx->Color.DitherFlag;
1580 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1582 return ctx->Fog.Enabled;
1584 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1586 return ctx->Light.Enabled;
1595 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1597 return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
1599 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1601 return ctx->Line.SmoothFlag;
1603 if (ctx->API != API_OPENGL_COMPAT)
1605 return ctx->Line.StippleFlag;
1607 if (ctx->API != API_OPENGL_COMPAT)
1609 return ctx->Color.IndexLogicOpEnabled;
1611 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1613 return ctx->Color.ColorLogicOpEnabled;
1615 if (ctx->API != API_OPENGL_COMPAT)
1617 return ctx->Eval.Map1Color4;
1619 if (ctx->API != API_OPENGL_COMPAT)
1621 return ctx->Eval.Map1Index;
1623 if (ctx->API != API_OPENGL_COMPAT)
1625 return ctx->Eval.Map1Normal;
1627 if (ctx->API != API_OPENGL_COMPAT)
1629 return ctx->Eval.Map1TextureCoord1;
1631 if (ctx->API != API_OPENGL_COMPAT)
1633 return ctx->Eval.Map1TextureCoord2;
1635 if (ctx->API != API_OPENGL_COMPAT)
1637 return ctx->Eval.Map1TextureCoord3;
1639 if (ctx->API != API_OPENGL_COMPAT)
1641 return ctx->Eval.Map1TextureCoord4;
1643 if (ctx->API != API_OPENGL_COMPAT)
1645 return ctx->Eval.Map1Vertex3;
1647 if (ctx->API != API_OPENGL_COMPAT)
1649 return ctx->Eval.Map1Vertex4;
1651 if (ctx->API != API_OPENGL_COMPAT)
1653 return ctx->Eval.Map2Color4;
1655 if (ctx->API != API_OPENGL_COMPAT)
1657 return ctx->Eval.Map2Index;
1659 if (ctx->API != API_OPENGL_COMPAT)
1661 return ctx->Eval.Map2Normal;
1663 if (ctx->API != API_OPENGL_COMPAT)
1665 return ctx->Eval.Map2TextureCoord1;
1667 if (ctx->API != API_OPENGL_COMPAT)
1669 return ctx->Eval.Map2TextureCoord2;
1671 if (ctx->API != API_OPENGL_COMPAT)
1673 return ctx->Eval.Map2TextureCoord3;
1675 if (ctx->API != API_OPENGL_COMPAT)
1677 return ctx->Eval.Map2TextureCoord4;
1679 if (ctx->API != API_OPENGL_COMPAT)
1681 return ctx->Eval.Map2Vertex3;
1683 if (ctx->API != API_OPENGL_COMPAT)
1685 return ctx->Eval.Map2Vertex4;
1687 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1689 return ctx->Transform.Normalize;
1691 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1693 return ctx->Point.SmoothFlag;
1695 if (!_mesa_is_desktop_gl(ctx))
1697 return ctx->Polygon.SmoothFlag;
1699 if (ctx->API != API_OPENGL_COMPAT)
1701 return ctx->Polygon.StippleFlag;
1703 if (!_mesa_is_desktop_gl(ctx))
1705 return ctx->Polygon.OffsetPoint;
1707 if (!_mesa_is_desktop_gl(ctx))
1709 return ctx->Polygon.OffsetLine;
1711 return ctx->Polygon.OffsetFill;
1713 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1715 return ctx->Transform.RescaleNormals;
1717 return ctx->Scissor.EnableFlags & 1; /* return state for index 0 */
1719 return ctx->Stencil.Enabled;
1721 if (ctx->API != API_OPENGL_COMPAT)
1723 return is_texture_enabled(ctx, TEXTURE_1D_BIT);
1725 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1727 return is_texture_enabled(ctx, TEXTURE_2D_BIT);
1729 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1731 return is_texture_enabled(ctx, TEXTURE_3D_BIT);
1738 get_texcoord_unit(ctx);
1740 if (ctx->API != API_OPENGL_COMPAT)
1752 get_texcoord_unit(ctx);
1754 if (ctx->API != API_OPENGLES)
1767 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1769 return !!(ctx->Array.VAO->Enabled & VERT_BIT_POS);
1771 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1773 return !!(ctx->Array.VAO->Enabled & VERT_BIT_NORMAL);
1775 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1777 return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR0);
1779 if (ctx->API != API_OPENGL_COMPAT)
1781 return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR_INDEX);
1783 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1785 return !!(ctx->Array.VAO->Enabled &
1786 VERT_BIT_TEX(ctx->Array.ActiveTexture));
1788 if (ctx->API != API_OPENGL_COMPAT)
1790 return !!(ctx->Array.VAO->Enabled & VERT_BIT_EDGEFLAG);
1792 if (ctx->API != API_OPENGL_COMPAT)
1794 return !!(ctx->Array.VAO->Enabled & VERT_BIT_FOG);
1796 if (ctx->API != API_OPENGL_COMPAT)
1798 return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR1);
1800 if (ctx->API != API_OPENGLES)
1802 return !!(ctx->Array.VAO->Enabled & VERT_BIT_POINT_SIZE);
1806 if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
1808 return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
1812 if (ctx->API != API_OPENGL_COMPAT)
1814 return ctx->Fog.ColorSumEnabled;
1818 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1820 return ctx->Multisample.Enabled;
1822 return ctx->Multisample.SampleAlphaToCoverage;
1824 if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
1826 return ctx->Multisample.SampleAlphaToOne;
1828 return ctx->Multisample.SampleCoverage;
1830 if (!_mesa_is_desktop_gl(ctx))
1832 return ctx->Multisample.SampleCoverageInvert;
1836 if (ctx->API != API_OPENGL_COMPAT)
1838 return ctx->Transform.RasterPositionUnclipped;
1842 if (!(ctx->API == API_OPENGL_COMPAT &&
1843 _mesa_has_ARB_point_sprite(ctx)) &&
1844 !_mesa_has_OES_point_sprite(ctx))
1846 return ctx->Point.PointSprite;
1849 if (!_mesa_has_ARB_vertex_program(ctx))
1851 return ctx->VertexProgram.Enabled;
1856 if (!_mesa_has_ARB_vertex_program(ctx) &&
1857 ctx->API != API_OPENGL_CORE)
1859 return ctx->VertexProgram.PointSizeEnabled;
1861 if (!_mesa_has_ARB_vertex_program(ctx))
1863 return ctx->VertexProgram.TwoSideEnabled;
1867 if (!_mesa_has_NV_texture_rectangle(ctx))
1869 return is_texture_enabled(ctx, TEXTURE_RECT_BIT);
1873 if (!_mesa_has_EXT_stencil_two_side(ctx))
1875 return ctx->Stencil.TestTwoSide;
1878 if (!_mesa_has_ARB_fragment_program(ctx))
1880 return ctx->FragmentProgram.Enabled;
1884 if (!_mesa_has_EXT_depth_bounds_test(ctx))
1886 return ctx->Depth.BoundsTest;
1890 if (!_mesa_has_ARB_depth_clamp(ctx) &&
1891 !_mesa_has_EXT_depth_clamp(ctx))
1893 return ctx->Transform.DepthClampNear ||
1894 ctx->Transform.DepthClampFar;
1897 if (!_mesa_has_AMD_depth_clamp_separate(ctx))
1899 return ctx->Transform.DepthClampNear;
1902 if (!_mesa_has_AMD_depth_clamp_separate(ctx))
1904 return ctx->Transform.DepthClampFar;
1907 if (!_mesa_has_ATI_fragment_shader(ctx))
1909 return ctx->ATIFragmentShader.Enabled;
1912 if (!_mesa_has_ARB_seamless_cube_map(ctx))
1914 return ctx->Texture.CubeMapSeamless;
1917 if (!(_mesa_has_EXT_transform_feedback(ctx) || _mesa_is_gles3(ctx)))
1919 return ctx->RasterDiscard;
1923 if (!_mesa_has_NV_primitive_restart(ctx))
1925 return ctx->Array.PrimitiveRestart;
1929 if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 31) {
1932 return ctx->Array.PrimitiveRestart;
1935 if (!_mesa_is_gles3(ctx) && !_mesa_has_ARB_ES3_compatibility(ctx))
1937 return ctx->Array.PrimitiveRestartFixedIndex;
1941 if (!_mesa_has_EXT_framebuffer_sRGB(ctx) &&
1942 !_mesa_has_EXT_sRGB_write_control(ctx))
1944 return ctx->Color.sRGBEnabled;
1948 if (!_mesa_has_OES_EGL_image_external(ctx))
1950 return is_texture_enabled(ctx, TEXTURE_EXTERNAL_BIT);
1954 if (!_mesa_has_ARB_texture_multisample(ctx) && !_mesa_is_gles31(ctx))
1956 return ctx->Multisample.SampleMask;
1960 if (!_mesa_has_ARB_sample_shading(ctx) && !_mesa_is_gles3(ctx))
1962 return ctx->Multisample.SampleShading;
1965 if (!_mesa_has_KHR_blend_equation_advanced_coherent(ctx))
1967 return ctx->Color.BlendCoherent;
1970 if (!_mesa_has_INTEL_conservative_rasterization(ctx))
1972 return ctx->IntelConservativeRasterization;
1975 if (!_mesa_has_NV_conservative_raster(ctx))
1977 return ctx->ConservativeRasterization;
1980 if (!_mesa_has_MESA_tile_raster_order(ctx))
1982 return ctx->TileRasterOrderFixed;
1985 if (!_mesa_has_MESA_tile_raster_order(ctx))
1987 return ctx->TileRasterOrderIncreasingX;
1990 if (!_mesa_has_MESA_tile_raster_order(ctx))
1992 return ctx->TileRasterOrderIncreasingY;
1995 if (!_mesa_has_INTEL_blackhole_render(ctx))
1997 return ctx->IntelBlackholeRender;
2006 _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(%s)",