Lines Matching defs:state

43 #include "state.h"
83 * Helper to enable/disable VAO client-side state.
87 gl_vert_attrib attr, GLboolean state)
89 if (state)
97 * Helper to enable/disable client-side state.
101 GLenum cap, GLboolean state)
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) {
132 ctx->VertexProgram.PointSizeEnabled = state;
134 vao_state(ctx, vao, VERT_ATTRIB_POINT_SIZE, state);
141 if (ctx->Array.PrimitiveRestart == state)
144 ctx->Array.PrimitiveRestart = state;
155 state ? "Enable" : "Disable", _mesa_enum_to_string(cap));
167 GLenum cap, GLuint index, GLboolean state)
173 state ? "Enable" : "Disable",
180 state ? "Enable" : "Disable",
187 client_state(ctx, vao, cap, state);
194 * \param cap state to enable/disable.
248 * \param cap state to enable/disable.
299 * state.
319 * \return GL_TRUE if state is changing or GL_FALSE if no change
322 enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
329 const GLbitfield newenabled = state
346 _mesa_set_multisample(struct gl_context *ctx, GLboolean state)
348 if (ctx->Multisample.Enabled == state)
351 /* GL compatibility needs Multisample.Enable to determine program state
361 ctx->Multisample.Enabled = state;
369 _mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state)
371 if (ctx->Color.sRGBEnabled == state)
378 ctx->Color.sRGBEnabled = state;
382 * Helper function to enable or disable state.
385 * \param cap the state to enable/disable
386 * \param state whether to enable or disable the specified capability.
394 _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
398 state ? "glEnable" : "glDisable",
406 if (ctx->Color.AlphaEnabled == state)
412 ctx->Color.AlphaEnabled = state;
417 if (ctx->Eval.AutoNormal == state)
421 ctx->Eval.AutoNormal = state;
426 state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
452 == ((GLuint) state << p))
466 if (state) {
484 if (ctx->Light.ColorMaterialEnabled == state)
489 ctx->Light.ColorMaterialEnabled = state;
490 if (state) {
496 if (ctx->Polygon.CullFlag == state)
501 ctx->Polygon.CullFlag = state;
504 if (ctx->Depth.Test == state)
509 ctx->Depth.Test = state;
514 _mesa_set_debug_state_int(ctx, cap, state);
518 if (ctx->Color.DitherFlag == state)
523 ctx->Color.DitherFlag = state;
528 if (ctx->Fog.Enabled == state)
532 ctx->Fog.Enabled = state;
533 ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE;
545 if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
549 ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
550 if (state) {
560 if (ctx->Light.Enabled == state)
565 ctx->Light.Enabled = state;
570 if (ctx->Line.SmoothFlag == state)
575 ctx->Line.SmoothFlag = state;
580 if (ctx->Line.StippleFlag == state)
585 ctx->Line.StippleFlag = state;
590 if (ctx->Color.IndexLogicOpEnabled == state)
595 ctx->Color.IndexLogicOpEnabled = state;
600 if (ctx->IntelConservativeRasterization == state)
604 ctx->IntelConservativeRasterization = state;
610 if (ctx->ConservativeRasterization == state)
614 ctx->ConservativeRasterization = state;
619 if (ctx->Color.ColorLogicOpEnabled == state)
624 ctx->Color.ColorLogicOpEnabled = state;
630 if (ctx->Eval.Map1Color4 == state)
634 ctx->Eval.Map1Color4 = state;
639 if (ctx->Eval.Map1Index == state)
643 ctx->Eval.Map1Index = state;
648 if (ctx->Eval.Map1Normal == state)
652 ctx->Eval.Map1Normal = state;
657 if (ctx->Eval.Map1TextureCoord1 == state)
661 ctx->Eval.Map1TextureCoord1 = state;
666 if (ctx->Eval.Map1TextureCoord2 == state)
670 ctx->Eval.Map1TextureCoord2 = state;
675 if (ctx->Eval.Map1TextureCoord3 == state)
679 ctx->Eval.Map1TextureCoord3 = state;
684 if (ctx->Eval.Map1TextureCoord4 == state)
688 ctx->Eval.Map1TextureCoord4 = state;
693 if (ctx->Eval.Map1Vertex3 == state)
697 ctx->Eval.Map1Vertex3 = state;
702 if (ctx->Eval.Map1Vertex4 == state)
706 ctx->Eval.Map1Vertex4 = state;
711 if (ctx->Eval.Map2Color4 == state)
715 ctx->Eval.Map2Color4 = state;
720 if (ctx->Eval.Map2Index == state)
724 ctx->Eval.Map2Index = state;
729 if (ctx->Eval.Map2Normal == state)
733 ctx->Eval.Map2Normal = state;
738 if (ctx->Eval.Map2TextureCoord1 == state)
742 ctx->Eval.Map2TextureCoord1 = state;
747 if (ctx->Eval.Map2TextureCoord2 == state)
751 ctx->Eval.Map2TextureCoord2 = state;
756 if (ctx->Eval.Map2TextureCoord3 == state)
760 ctx->Eval.Map2TextureCoord3 = state;
765 if (ctx->Eval.Map2TextureCoord4 == state)
769 ctx->Eval.Map2TextureCoord4 = state;
774 if (ctx->Eval.Map2Vertex3 == state)
778 ctx->Eval.Map2Vertex3 = state;
783 if (ctx->Eval.Map2Vertex4 == state)
787 ctx->Eval.Map2Vertex4 = state;
792 if (ctx->Transform.Normalize == state)
796 ctx->Transform.Normalize = state;
801 if (ctx->Point.SmoothFlag == state)
804 ctx->Point.SmoothFlag = state;
809 if (ctx->Polygon.SmoothFlag == state)
814 ctx->Polygon.SmoothFlag = state;
819 if (ctx->Polygon.StippleFlag == state)
824 ctx->Polygon.StippleFlag = state;
829 if (ctx->Polygon.OffsetPoint == state)
834 ctx->Polygon.OffsetPoint = state;
839 if (ctx->Polygon.OffsetLine == state)
844 ctx->Polygon.OffsetLine = state;
847 if (ctx->Polygon.OffsetFill == state)
852 ctx->Polygon.OffsetFill = state;
857 if (ctx->Transform.RescaleNormals == state)
861 ctx->Transform.RescaleNormals = state;
867 state * ((1 << ctx->Const.MaxViewports) - 1);
879 if (ctx->Stencil.Enabled == state)
884 ctx->Stencil.Enabled = state;
890 if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
897 if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
904 if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
921 if (state)
944 if (state)
955 /* client-side state */
962 client_state( ctx, ctx->Array.VAO, cap, state );
970 client_state( ctx, ctx->Array.VAO, cap, state );
975 client_state( ctx, ctx->Array.VAO, cap, state );
982 if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
991 if (ctx->Fog.ColorSumEnabled == state)
995 ctx->Fog.ColorSumEnabled = state;
1002 _mesa_set_multisample(ctx, state);
1005 if (ctx->Multisample.SampleAlphaToCoverage == state)
1010 ctx->Multisample.SampleAlphaToCoverage = state;
1015 if (ctx->Multisample.SampleAlphaToOne == state)
1020 ctx->Multisample.SampleAlphaToOne = state;
1023 if (ctx->Multisample.SampleCoverage == state)
1028 ctx->Multisample.SampleCoverage = state;
1033 if (ctx->Multisample.SampleCoverageInvert == state)
1037 ctx->Multisample.SampleCoverageInvert = state;
1044 if (ctx->Multisample.SampleShading == state)
1049 ctx->Multisample.SampleShading = state;
1056 if (ctx->Transform.RasterPositionUnclipped == state)
1059 ctx->Transform.RasterPositionUnclipped = state;
1068 if (ctx->Point.PointSprite == state)
1072 ctx->Point.PointSprite = state;
1078 if (ctx->VertexProgram.Enabled == state)
1081 ctx->VertexProgram.Enabled = state;
1092 if (ctx->VertexProgram.PointSizeEnabled == state)
1095 ctx->VertexProgram.PointSizeEnabled = state;
1100 if (ctx->VertexProgram.TwoSideEnabled == state)
1103 ctx->VertexProgram.TwoSideEnabled = state;
1110 if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
1119 if (ctx->Stencil.TestTwoSide == state)
1124 ctx->Stencil.TestTwoSide = state;
1125 if (state) {
1135 if (ctx->FragmentProgram.Enabled == state)
1138 ctx->FragmentProgram.Enabled = state;
1146 if (ctx->Depth.BoundsTest == state)
1150 ctx->Depth.BoundsTest = state;
1157 if (ctx->Transform.DepthClampNear == state &&
1158 ctx->Transform.DepthClampFar == state)
1163 ctx->Transform.DepthClampNear = state;
1164 ctx->Transform.DepthClampFar = state;
1170 if (ctx->Transform.DepthClampNear == state)
1175 ctx->Transform.DepthClampNear = state;
1181 if (ctx->Transform.DepthClampFar == state)
1186 ctx->Transform.DepthClampFar = state;
1192 if (ctx->ATIFragmentShader.Enabled == state)
1195 ctx->ATIFragmentShader.Enabled = state;
1201 if (ctx->Texture.CubeMapSeamless != state) {
1203 ctx->Texture.CubeMapSeamless = state;
1210 if (ctx->RasterDiscard != state) {
1213 ctx->RasterDiscard = state;
1220 if (ctx->TileRasterOrderFixed != state) {
1223 ctx->TileRasterOrderFixed = state;
1230 if (ctx->TileRasterOrderIncreasingX != state) {
1233 ctx->TileRasterOrderIncreasingX = state;
1240 if (ctx->TileRasterOrderIncreasingY != state) {
1243 ctx->TileRasterOrderIncreasingY = state;
1248 * GL_PRIMITIVE_RESTART_NV (which is client state).
1254 if (ctx->Array.PrimitiveRestart != state) {
1255 ctx->Array.PrimitiveRestart = state;
1263 if (ctx->Array.PrimitiveRestartFixedIndex != state) {
1264 ctx->Array.PrimitiveRestartFixedIndex = state;
1274 _mesa_set_framebuffer_srgb(ctx, state);
1281 if (!enable_texture(ctx, state, TEXTURE_EXTERNAL_BIT)) {
1290 if (ctx->Multisample.SampleMask == state)
1294 ctx->Multisample.SampleMask = state;
1300 if (ctx->Color.BlendCoherent == state)
1304 ctx->Color.BlendCoherent = state;
1310 if (ctx->IntelBlackholeRender == state)
1313 ctx->IntelBlackholeRender = state;
1314 ctx->pipe->set_frontend_noop(ctx->pipe, state);
1324 state ? "Enable" : "Disable", _mesa_enum_to_string(cap));
1330 * \param cap state to enable.
1343 * \param cap state to disable.
1356 * Enable/disable an indexed state var.
1360 GLuint index, GLboolean state)
1362 assert(state == 0 || state == 1);
1370 state ? "glEnableIndexed" : "glDisableIndexed", index);
1373 if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
1376 if (state)
1392 state ? "glEnablei" : "glDisablei", index);
1395 if (((ctx->Scissor.EnableFlags >> index) & 1) != state) {
1401 if (state)
1421 state ? "glEnablei" : "glDisablei", index);
1425 _mesa_set_enable( ctx, cap, state );
1436 state ? "glEnablei" : "glDisablei",
1487 GLboolean state;
1496 state = _mesa_IsEnabled(cap);
1498 return state;
1526 * Return simple enable/disable state.
1528 * \param cap state variable to query.
1530 * Returns the state of the specified capability from the current GL context.
1550 return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */
1717 return ctx->Scissor.EnableFlags & 1; /* return state for index 0 */
1765 /* client-side state */