Lines Matching refs:save
463 struct save_state *save; in _mesa_meta_begin() local
468 save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth++]; in _mesa_meta_begin()
469 memset(save, 0, sizeof(*save)); in _mesa_meta_begin()
470 save->SavedState = state; in _mesa_meta_begin()
476 save->API = ctx->API; in _mesa_meta_begin()
486 save->ExtensionsVersion = ctx->Extensions.Version; in _mesa_meta_begin()
492 save->TransformFeedbackNeedsResume = in _mesa_meta_begin()
494 if (save->TransformFeedbackNeedsResume) in _mesa_meta_begin()
501 save->CurrentOcclusionObject = ctx->Query.CurrentOcclusionObject; in _mesa_meta_begin()
502 if (save->CurrentOcclusionObject) in _mesa_meta_begin()
503 _mesa_EndQuery(save->CurrentOcclusionObject->Target); in _mesa_meta_begin()
507 save->AlphaEnabled = ctx->Color.AlphaEnabled; in _mesa_meta_begin()
508 save->AlphaFunc = ctx->Color.AlphaFunc; in _mesa_meta_begin()
509 save->AlphaRef = ctx->Color.AlphaRef; in _mesa_meta_begin()
515 save->BlendEnabled = ctx->Color.BlendEnabled; in _mesa_meta_begin()
527 save->ColorLogicOpEnabled = ctx->Color.ColorLogicOpEnabled; in _mesa_meta_begin()
533 save->DitherFlag = ctx->Color.DitherFlag; in _mesa_meta_begin()
538 save->ColorMask = ctx->Color.ColorMask; in _mesa_meta_begin()
541 save->Depth = ctx->Depth; /* struct copy */ in _mesa_meta_begin()
547 save->Fog = ctx->Fog.Enabled; in _mesa_meta_begin()
553 save->Pack = ctx->Pack; in _mesa_meta_begin()
554 save->Unpack = ctx->Unpack; in _mesa_meta_begin()
560 save->RedScale = ctx->Pixel.RedScale; in _mesa_meta_begin()
561 save->RedBias = ctx->Pixel.RedBias; in _mesa_meta_begin()
562 save->GreenScale = ctx->Pixel.GreenScale; in _mesa_meta_begin()
563 save->GreenBias = ctx->Pixel.GreenBias; in _mesa_meta_begin()
564 save->BlueScale = ctx->Pixel.BlueScale; in _mesa_meta_begin()
565 save->BlueBias = ctx->Pixel.BlueBias; in _mesa_meta_begin()
566 save->AlphaScale = ctx->Pixel.AlphaScale; in _mesa_meta_begin()
567 save->AlphaBias = ctx->Pixel.AlphaBias; in _mesa_meta_begin()
568 save->MapColorFlag = ctx->Pixel.MapColorFlag; in _mesa_meta_begin()
583 save->FrontPolygonMode = ctx->Polygon.FrontMode; in _mesa_meta_begin()
584 save->BackPolygonMode = ctx->Polygon.BackMode; in _mesa_meta_begin()
585 save->PolygonOffset = ctx->Polygon.OffsetFill; in _mesa_meta_begin()
586 save->PolygonSmooth = ctx->Polygon.SmoothFlag; in _mesa_meta_begin()
587 save->PolygonStipple = ctx->Polygon.StippleFlag; in _mesa_meta_begin()
588 save->PolygonCull = ctx->Polygon.CullFlag; in _mesa_meta_begin()
597 save->Scissor = ctx->Scissor; /* struct copy */ in _mesa_meta_begin()
605 save->VertexProgramEnabled = ctx->VertexProgram.Enabled; in _mesa_meta_begin()
606 _mesa_reference_program(ctx, &save->VertexProgram, in _mesa_meta_begin()
612 save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled; in _mesa_meta_begin()
613 _mesa_reference_program(ctx, &save->FragmentProgram, in _mesa_meta_begin()
619 save->ATIFragmentShaderEnabled = ctx->ATIFragmentShader.Enabled; in _mesa_meta_begin()
624 _mesa_reference_pipeline_object(ctx, &save->Pipeline, in _mesa_meta_begin()
633 _mesa_reference_program(ctx, &save->Program[i], in _mesa_meta_begin()
636 _mesa_reference_shader_program(ctx, &save->ActiveShader, in _mesa_meta_begin()
643 save->Stencil = ctx->Stencil; /* struct copy */ in _mesa_meta_begin()
652 save->ActiveUnit = ctx->Texture.CurrentUnit; in _mesa_meta_begin()
653 save->EnvMode = ctx->Texture.FixedFuncUnit[0].EnvMode; in _mesa_meta_begin()
657 save->TexEnabled[u] = ctx->Texture.FixedFuncUnit[u].Enabled; in _mesa_meta_begin()
658 save->TexGenEnabled[u] = ctx->Texture.FixedFuncUnit[u].TexGenEnabled; in _mesa_meta_begin()
679 _mesa_reference_texobj(&save->CurrentTexture[tgt], in _mesa_meta_begin()
689 memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, in _mesa_meta_begin()
691 memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, in _mesa_meta_begin()
693 memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, in _mesa_meta_begin()
716 save->ClipOrigin = ctx->Transform.ClipOrigin; in _mesa_meta_begin()
717 save->ClipDepthMode = ctx->Transform.ClipDepthMode; in _mesa_meta_begin()
724 save->ClipPlanesEnabled = ctx->Transform.ClipPlanesEnabled; in _mesa_meta_begin()
734 _mesa_reference_vao(ctx, &save->VAO, in _mesa_meta_begin()
741 save->ViewportX = ctx->ViewportArray[0].X; in _mesa_meta_begin()
742 save->ViewportY = ctx->ViewportArray[0].Y; in _mesa_meta_begin()
743 save->ViewportW = ctx->ViewportArray[0].Width; in _mesa_meta_begin()
744 save->ViewportH = ctx->ViewportArray[0].Height; in _mesa_meta_begin()
754 save->DepthNear = ctx->ViewportArray[0].Near; in _mesa_meta_begin()
755 save->DepthFar = ctx->ViewportArray[0].Far; in _mesa_meta_begin()
761 save->ClampFragmentColor = ctx->Color.ClampFragmentColor; in _mesa_meta_begin()
773 save->ClampVertexColor = ctx->Light.ClampVertexColor; in _mesa_meta_begin()
783 save->CondRenderQuery = ctx->Query.CondRenderQuery; in _mesa_meta_begin()
784 save->CondRenderMode = ctx->Query.CondRenderMode; in _mesa_meta_begin()
791 save->RenderMode = ctx->RenderMode; in _mesa_meta_begin()
793 save->Select = ctx->Select; /* struct copy */ in _mesa_meta_begin()
796 save->Feedback = ctx->Feedback; /* struct copy */ in _mesa_meta_begin()
802 save->Multisample = ctx->Multisample; /* struct copy */ in _mesa_meta_begin()
819 save->sRGBEnabled = ctx->Color.sRGBEnabled; in _mesa_meta_begin()
826 memcpy(save->ColorDrawBuffers, fb->ColorDrawBuffer, in _mesa_meta_begin()
827 sizeof(save->ColorDrawBuffers)); in _mesa_meta_begin()
832 save->Lighting = ctx->Light.Enabled; in _mesa_meta_begin()
835 save->RasterDiscard = ctx->RasterDiscard; in _mesa_meta_begin()
839 _mesa_reference_framebuffer(&save->DrawBuffer, ctx->DrawBuffer); in _mesa_meta_begin()
840 _mesa_reference_framebuffer(&save->ReadBuffer, ctx->ReadBuffer); in _mesa_meta_begin()
853 struct save_state *save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth - 1]; in _mesa_meta_end() local
854 const GLbitfield state = save->SavedState; in _mesa_meta_end()
861 if (save->CurrentOcclusionObject) { in _mesa_meta_end()
862 struct gl_query_object *q = save->CurrentOcclusionObject; in _mesa_meta_end()
873 if (ctx->Color.AlphaEnabled != save->AlphaEnabled) in _mesa_meta_end()
874 _mesa_set_enable(ctx, GL_ALPHA_TEST, save->AlphaEnabled); in _mesa_meta_end()
875 _mesa_AlphaFunc(save->AlphaFunc, save->AlphaRef); in _mesa_meta_end()
879 if (ctx->Color.BlendEnabled != save->BlendEnabled) { in _mesa_meta_end()
883 _mesa_set_enablei(ctx, GL_BLEND, i, (save->BlendEnabled >> i) & 1); in _mesa_meta_end()
887 _mesa_set_enable(ctx, GL_BLEND, (save->BlendEnabled & 1)); in _mesa_meta_end()
890 if (ctx->Color.ColorLogicOpEnabled != save->ColorLogicOpEnabled) in _mesa_meta_end()
891 _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, save->ColorLogicOpEnabled); in _mesa_meta_end()
895 _mesa_set_enable(ctx, GL_DITHER, save->DitherFlag); in _mesa_meta_end()
901 GET_COLORMASK(save->ColorMask, i)) { in _mesa_meta_end()
903 _mesa_ColorMask(GET_COLORMASK_BIT(save->ColorMask, i, 0), in _mesa_meta_end()
904 GET_COLORMASK_BIT(save->ColorMask, i, 1), in _mesa_meta_end()
905 GET_COLORMASK_BIT(save->ColorMask, i, 2), in _mesa_meta_end()
906 GET_COLORMASK_BIT(save->ColorMask, i, 3)); in _mesa_meta_end()
910 GET_COLORMASK_BIT(save->ColorMask, i, 0), in _mesa_meta_end()
911 GET_COLORMASK_BIT(save->ColorMask, i, 1), in _mesa_meta_end()
912 GET_COLORMASK_BIT(save->ColorMask, i, 2), in _mesa_meta_end()
913 GET_COLORMASK_BIT(save->ColorMask, i, 3)); in _mesa_meta_end()
920 if (ctx->Depth.Test != save->Depth.Test) in _mesa_meta_end()
921 _mesa_set_enable(ctx, GL_DEPTH_TEST, save->Depth.Test); in _mesa_meta_end()
922 _mesa_DepthFunc(save->Depth.Func); in _mesa_meta_end()
923 _mesa_DepthMask(save->Depth.Mask); in _mesa_meta_end()
927 _mesa_set_enable(ctx, GL_FOG, save->Fog); in _mesa_meta_end()
931 ctx->Pack = save->Pack; in _mesa_meta_end()
932 ctx->Unpack = save->Unpack; in _mesa_meta_end()
936 ctx->Pixel.RedScale = save->RedScale; in _mesa_meta_end()
937 ctx->Pixel.RedBias = save->RedBias; in _mesa_meta_end()
938 ctx->Pixel.GreenScale = save->GreenScale; in _mesa_meta_end()
939 ctx->Pixel.GreenBias = save->GreenBias; in _mesa_meta_end()
940 ctx->Pixel.BlueScale = save->BlueScale; in _mesa_meta_end()
941 ctx->Pixel.BlueBias = save->BlueBias; in _mesa_meta_end()
942 ctx->Pixel.AlphaScale = save->AlphaScale; in _mesa_meta_end()
943 ctx->Pixel.AlphaBias = save->AlphaBias; in _mesa_meta_end()
944 ctx->Pixel.MapColorFlag = save->MapColorFlag; in _mesa_meta_end()
950 _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode); in _mesa_meta_end()
951 _mesa_PolygonMode(GL_BACK, save->BackPolygonMode); in _mesa_meta_end()
952 _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple); in _mesa_meta_end()
953 _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth); in _mesa_meta_end()
954 _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, save->PolygonOffset); in _mesa_meta_end()
955 _mesa_set_enable(ctx, GL_CULL_FACE, save->PolygonCull); in _mesa_meta_end()
963 save->Scissor.ScissorArray[i].X, in _mesa_meta_end()
964 save->Scissor.ScissorArray[i].Y, in _mesa_meta_end()
965 save->Scissor.ScissorArray[i].Width, in _mesa_meta_end()
966 save->Scissor.ScissorArray[i].Height); in _mesa_meta_end()
968 (save->Scissor.EnableFlags >> i) & 1); in _mesa_meta_end()
977 save->VertexProgramEnabled); in _mesa_meta_end()
979 save->VertexProgram); in _mesa_meta_end()
980 _mesa_reference_program(ctx, &save->VertexProgram, NULL); in _mesa_meta_end()
985 save->FragmentProgramEnabled); in _mesa_meta_end()
987 save->FragmentProgram); in _mesa_meta_end()
988 _mesa_reference_program(ctx, &save->FragmentProgram, NULL); in _mesa_meta_end()
993 save->ATIFragmentShaderEnabled); in _mesa_meta_end()
1004 _mesa_use_program(ctx, i, NULL, save->Program[i], &ctx->Shader); in _mesa_meta_end()
1008 if (save->Program[i] != NULL) in _mesa_meta_end()
1011 _mesa_reference_program(ctx, &save->Program[i], NULL); in _mesa_meta_end()
1015 save->ActiveShader); in _mesa_meta_end()
1016 _mesa_reference_shader_program(ctx, &save->ActiveShader, NULL); in _mesa_meta_end()
1029 if (save->Pipeline) { in _mesa_meta_end()
1030 _mesa_bind_pipeline(ctx, save->Pipeline); in _mesa_meta_end()
1032 _mesa_reference_pipeline_object(ctx, &save->Pipeline, NULL); in _mesa_meta_end()
1039 const struct gl_stencil_attrib *stencil = &save->Stencil; in _mesa_meta_end()
1075 _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode); in _mesa_meta_end()
1079 if (ctx->Texture.Unit[0].CurrentTex[tgt] != save->CurrentTexture[tgt]) { in _mesa_meta_end()
1082 save->CurrentTexture[tgt]); in _mesa_meta_end()
1084 _mesa_reference_texobj(&save->CurrentTexture[tgt], NULL); in _mesa_meta_end()
1089 if (ctx->Texture.FixedFuncUnit[u].Enabled != save->TexEnabled[u]) { in _mesa_meta_end()
1091 ctx->Texture.FixedFuncUnit[u].Enabled = save->TexEnabled[u]; in _mesa_meta_end()
1094 if (ctx->Texture.FixedFuncUnit[u].TexGenEnabled != save->TexGenEnabled[u]) { in _mesa_meta_end()
1096 ctx->Texture.FixedFuncUnit[u].TexGenEnabled = save->TexGenEnabled[u]; in _mesa_meta_end()
1101 _mesa_ActiveTexture(GL_TEXTURE0 + save->ActiveUnit); in _mesa_meta_end()
1105 _mesa_load_matrix(ctx, &ctx->ModelviewMatrixStack, save->ModelviewMatrix); in _mesa_meta_end()
1106 _mesa_load_matrix(ctx, &ctx->ProjectionMatrixStack, save->ProjectionMatrix); in _mesa_meta_end()
1107 _mesa_load_matrix(ctx, &ctx->TextureMatrixStack[0], save->TextureMatrix); in _mesa_meta_end()
1110 _mesa_ClipControl(save->ClipOrigin, save->ClipDepthMode); in _mesa_meta_end()
1114 GLbitfield mask = save->ClipPlanesEnabled; in _mesa_meta_end()
1123 _mesa_BindVertexArray(save->VAO->Name); in _mesa_meta_end()
1124 _mesa_reference_vao(ctx, &save->VAO, NULL); in _mesa_meta_end()
1128 if (save->ViewportX != ctx->ViewportArray[0].X || in _mesa_meta_end()
1129 save->ViewportY != ctx->ViewportArray[0].Y || in _mesa_meta_end()
1130 save->ViewportW != ctx->ViewportArray[0].Width || in _mesa_meta_end()
1131 save->ViewportH != ctx->ViewportArray[0].Height) { in _mesa_meta_end()
1132 _mesa_set_viewport(ctx, 0, save->ViewportX, save->ViewportY, in _mesa_meta_end()
1133 save->ViewportW, save->ViewportH); in _mesa_meta_end()
1135 _mesa_set_depth_range(ctx, 0, save->DepthNear, save->DepthFar); in _mesa_meta_end()
1140 _mesa_ClampColor(GL_CLAMP_FRAGMENT_COLOR, save->ClampFragmentColor); in _mesa_meta_end()
1145 _mesa_ClampColor(GL_CLAMP_VERTEX_COLOR, save->ClampVertexColor); in _mesa_meta_end()
1149 if (save->CondRenderQuery) in _mesa_meta_end()
1150 _mesa_BeginConditionalRender(save->CondRenderQuery->Id, in _mesa_meta_end()
1151 save->CondRenderMode); in _mesa_meta_end()
1155 if (save->RenderMode == GL_SELECT) { in _mesa_meta_end()
1157 ctx->Select = save->Select; in _mesa_meta_end()
1158 } else if (save->RenderMode == GL_FEEDBACK) { in _mesa_meta_end()
1160 ctx->Feedback = save->Feedback; in _mesa_meta_end()
1166 struct gl_multisample_attrib *save_ms = &save->Multisample; in _mesa_meta_end()
1192 if (ctx->Color.sRGBEnabled != save->sRGBEnabled) in _mesa_meta_end()
1193 _mesa_set_framebuffer_srgb(ctx, save->sRGBEnabled); in _mesa_meta_end()
1197 if (save->Lighting) { in _mesa_meta_end()
1200 if (save->RasterDiscard) { in _mesa_meta_end()
1203 if (save->TransformFeedbackNeedsResume) in _mesa_meta_end()
1206 _mesa_bind_framebuffers(ctx, save->DrawBuffer, save->ReadBuffer); in _mesa_meta_end()
1207 _mesa_reference_framebuffer(&save->DrawBuffer, NULL); in _mesa_meta_end()
1208 _mesa_reference_framebuffer(&save->ReadBuffer, NULL); in _mesa_meta_end()
1212 save->ColorDrawBuffers, NULL); in _mesa_meta_end()
1217 ctx->API = save->API; in _mesa_meta_end()
1218 ctx->Extensions.Version = save->ExtensionsVersion; in _mesa_meta_end()