Lines Matching refs:save

494    struct save_state *save;  in _mesa_meta_begin()  local
499 save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth++]; in _mesa_meta_begin()
500 memset(save, 0, sizeof(*save)); in _mesa_meta_begin()
501 save->SavedState = state; in _mesa_meta_begin()
507 save->TransformFeedbackNeedsResume = in _mesa_meta_begin()
510 if (save->TransformFeedbackNeedsResume) in _mesa_meta_begin()
515 save->AlphaEnabled = ctx->Color.AlphaEnabled; in _mesa_meta_begin()
516 save->AlphaFunc = ctx->Color.AlphaFunc; in _mesa_meta_begin()
517 save->AlphaRef = ctx->Color.AlphaRef; in _mesa_meta_begin()
523 save->BlendEnabled = ctx->Color.BlendEnabled; in _mesa_meta_begin()
535 save->ColorLogicOpEnabled = ctx->Color.ColorLogicOpEnabled; in _mesa_meta_begin()
541 memcpy(save->ColorMask, ctx->Color.ColorMask, in _mesa_meta_begin()
551 save->Depth = ctx->Depth; /* struct copy */ in _mesa_meta_begin()
559 save->Fog = ctx->Fog.Enabled; in _mesa_meta_begin()
565 save->Pack = ctx->Pack; in _mesa_meta_begin()
566 save->Unpack = ctx->Unpack; in _mesa_meta_begin()
572 save->RedScale = ctx->Pixel.RedScale; in _mesa_meta_begin()
573 save->RedBias = ctx->Pixel.RedBias; in _mesa_meta_begin()
574 save->GreenScale = ctx->Pixel.GreenScale; in _mesa_meta_begin()
575 save->GreenBias = ctx->Pixel.GreenBias; in _mesa_meta_begin()
576 save->BlueScale = ctx->Pixel.BlueScale; in _mesa_meta_begin()
577 save->BlueBias = ctx->Pixel.BlueBias; in _mesa_meta_begin()
578 save->AlphaScale = ctx->Pixel.AlphaScale; in _mesa_meta_begin()
579 save->AlphaBias = ctx->Pixel.AlphaBias; in _mesa_meta_begin()
580 save->MapColorFlag = ctx->Pixel.MapColorFlag; in _mesa_meta_begin()
595 save->FrontPolygonMode = ctx->Polygon.FrontMode; in _mesa_meta_begin()
596 save->BackPolygonMode = ctx->Polygon.BackMode; in _mesa_meta_begin()
597 save->PolygonOffset = ctx->Polygon.OffsetFill; in _mesa_meta_begin()
598 save->PolygonSmooth = ctx->Polygon.SmoothFlag; in _mesa_meta_begin()
599 save->PolygonStipple = ctx->Polygon.StippleFlag; in _mesa_meta_begin()
600 save->PolygonCull = ctx->Polygon.CullFlag; in _mesa_meta_begin()
611 save->Scissor = ctx->Scissor; /* struct copy */ in _mesa_meta_begin()
617 save->VertexProgramEnabled = ctx->VertexProgram.Enabled; in _mesa_meta_begin()
618 _mesa_reference_vertprog(ctx, &save->VertexProgram, in _mesa_meta_begin()
624 save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled; in _mesa_meta_begin()
625 _mesa_reference_fragprog(ctx, &save->FragmentProgram, in _mesa_meta_begin()
631 save->ATIFragmentShaderEnabled = ctx->ATIFragmentShader.Enabled; in _mesa_meta_begin()
636 _mesa_reference_shader_program(ctx, &save->VertexShader, in _mesa_meta_begin()
638 _mesa_reference_shader_program(ctx, &save->GeometryShader, in _mesa_meta_begin()
640 _mesa_reference_shader_program(ctx, &save->FragmentShader, in _mesa_meta_begin()
642 _mesa_reference_shader_program(ctx, &save->ActiveShader, in _mesa_meta_begin()
650 save->Stencil = ctx->Stencil; /* struct copy */ in _mesa_meta_begin()
659 save->ActiveUnit = ctx->Texture.CurrentUnit; in _mesa_meta_begin()
660 save->ClientActiveUnit = ctx->Array.ActiveTexture; in _mesa_meta_begin()
661 save->EnvMode = ctx->Texture.Unit[0].EnvMode; in _mesa_meta_begin()
666 save->TexEnabled[u] = ctx->Texture.Unit[u].Enabled; in _mesa_meta_begin()
667 save->TexGenEnabled[u] = ctx->Texture.Unit[u].TexGenEnabled; in _mesa_meta_begin()
695 _mesa_reference_texobj(&save->CurrentTexture[tgt], in _mesa_meta_begin()
709 memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, in _mesa_meta_begin()
711 memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, in _mesa_meta_begin()
713 memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, in _mesa_meta_begin()
715 save->MatrixMode = ctx->Transform.MatrixMode; in _mesa_meta_begin()
731 save->ClipPlanesEnabled = ctx->Transform.ClipPlanesEnabled; in _mesa_meta_begin()
742 _mesa_reference_array_object(ctx, &save->ArrayObj, in _mesa_meta_begin()
744 _mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, in _mesa_meta_begin()
751 save->ViewportX = ctx->Viewport.X; in _mesa_meta_begin()
752 save->ViewportY = ctx->Viewport.Y; in _mesa_meta_begin()
753 save->ViewportW = ctx->Viewport.Width; in _mesa_meta_begin()
754 save->ViewportH = ctx->Viewport.Height; in _mesa_meta_begin()
764 save->DepthNear = ctx->Viewport.Near; in _mesa_meta_begin()
765 save->DepthFar = ctx->Viewport.Far; in _mesa_meta_begin()
771 save->ClampFragmentColor = ctx->Color.ClampFragmentColor; in _mesa_meta_begin()
782 save->ClampVertexColor = ctx->Light.ClampVertexColor; in _mesa_meta_begin()
791 save->CondRenderQuery = ctx->Query.CondRenderQuery; in _mesa_meta_begin()
792 save->CondRenderMode = ctx->Query.CondRenderMode; in _mesa_meta_begin()
800 save->RenderMode = ctx->RenderMode; in _mesa_meta_begin()
802 save->Select = ctx->Select; /* struct copy */ in _mesa_meta_begin()
805 save->Feedback = ctx->Feedback; /* struct copy */ in _mesa_meta_begin()
812 save->MultisampleEnabled = ctx->Multisample.Enabled; in _mesa_meta_begin()
819 save->Lighting = ctx->Light.Enabled; in _mesa_meta_begin()
822 save->RasterDiscard = ctx->RasterDiscard; in _mesa_meta_begin()
835 struct save_state *save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth - 1]; in _mesa_meta_end() local
836 const GLbitfield state = save->SavedState; in _mesa_meta_end()
839 if (ctx->Color.AlphaEnabled != save->AlphaEnabled) in _mesa_meta_end()
840 _mesa_set_enable(ctx, GL_ALPHA_TEST, save->AlphaEnabled); in _mesa_meta_end()
841 _mesa_AlphaFunc(save->AlphaFunc, save->AlphaRef); in _mesa_meta_end()
845 if (ctx->Color.BlendEnabled != save->BlendEnabled) { in _mesa_meta_end()
849 _mesa_set_enablei(ctx, GL_BLEND, i, (save->BlendEnabled >> i) & 1); in _mesa_meta_end()
853 _mesa_set_enable(ctx, GL_BLEND, (save->BlendEnabled & 1)); in _mesa_meta_end()
856 if (ctx->Color.ColorLogicOpEnabled != save->ColorLogicOpEnabled) in _mesa_meta_end()
857 _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, save->ColorLogicOpEnabled); in _mesa_meta_end()
863 if (!TEST_EQ_4V(ctx->Color.ColorMask[i], save->ColorMask[i])) { in _mesa_meta_end()
865 _mesa_ColorMask(save->ColorMask[i][0], save->ColorMask[i][1], in _mesa_meta_end()
866 save->ColorMask[i][2], save->ColorMask[i][3]); in _mesa_meta_end()
870 save->ColorMask[i][0], in _mesa_meta_end()
871 save->ColorMask[i][1], in _mesa_meta_end()
872 save->ColorMask[i][2], in _mesa_meta_end()
873 save->ColorMask[i][3]); in _mesa_meta_end()
880 if (ctx->Depth.Test != save->Depth.Test) in _mesa_meta_end()
881 _mesa_set_enable(ctx, GL_DEPTH_TEST, save->Depth.Test); in _mesa_meta_end()
882 _mesa_DepthFunc(save->Depth.Func); in _mesa_meta_end()
883 _mesa_DepthMask(save->Depth.Mask); in _mesa_meta_end()
889 _mesa_set_enable(ctx, GL_FOG, save->Fog); in _mesa_meta_end()
893 ctx->Pack = save->Pack; in _mesa_meta_end()
894 ctx->Unpack = save->Unpack; in _mesa_meta_end()
898 ctx->Pixel.RedScale = save->RedScale; in _mesa_meta_end()
899 ctx->Pixel.RedBias = save->RedBias; in _mesa_meta_end()
900 ctx->Pixel.GreenScale = save->GreenScale; in _mesa_meta_end()
901 ctx->Pixel.GreenBias = save->GreenBias; in _mesa_meta_end()
902 ctx->Pixel.BlueScale = save->BlueScale; in _mesa_meta_end()
903 ctx->Pixel.BlueBias = save->BlueBias; in _mesa_meta_end()
904 ctx->Pixel.AlphaScale = save->AlphaScale; in _mesa_meta_end()
905 ctx->Pixel.AlphaBias = save->AlphaBias; in _mesa_meta_end()
906 ctx->Pixel.MapColorFlag = save->MapColorFlag; in _mesa_meta_end()
915 _mesa_PolygonMode(GL_FRONT_AND_BACK, save->FrontPolygonMode); in _mesa_meta_end()
917 _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode); in _mesa_meta_end()
918 _mesa_PolygonMode(GL_BACK, save->BackPolygonMode); in _mesa_meta_end()
921 _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple); in _mesa_meta_end()
922 _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth); in _mesa_meta_end()
924 _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, save->PolygonOffset); in _mesa_meta_end()
925 _mesa_set_enable(ctx, GL_CULL_FACE, save->PolygonCull); in _mesa_meta_end()
929 _mesa_set_enable(ctx, GL_SCISSOR_TEST, save->Scissor.Enabled); in _mesa_meta_end()
930 _mesa_Scissor(save->Scissor.X, save->Scissor.Y, in _mesa_meta_end()
931 save->Scissor.Width, save->Scissor.Height); in _mesa_meta_end()
937 save->VertexProgramEnabled); in _mesa_meta_end()
939 save->VertexProgram); in _mesa_meta_end()
940 _mesa_reference_vertprog(ctx, &save->VertexProgram, NULL); in _mesa_meta_end()
945 save->FragmentProgramEnabled); in _mesa_meta_end()
947 save->FragmentProgram); in _mesa_meta_end()
948 _mesa_reference_fragprog(ctx, &save->FragmentProgram, NULL); in _mesa_meta_end()
953 save->ATIFragmentShaderEnabled); in _mesa_meta_end()
957 _mesa_use_shader_program(ctx, GL_VERTEX_SHADER, save->VertexShader); in _mesa_meta_end()
961 save->GeometryShader); in _mesa_meta_end()
965 save->FragmentShader); in _mesa_meta_end()
968 save->ActiveShader); in _mesa_meta_end()
970 _mesa_reference_shader_program(ctx, &save->VertexShader, NULL); in _mesa_meta_end()
971 _mesa_reference_shader_program(ctx, &save->GeometryShader, NULL); in _mesa_meta_end()
972 _mesa_reference_shader_program(ctx, &save->FragmentShader, NULL); in _mesa_meta_end()
973 _mesa_reference_shader_program(ctx, &save->ActiveShader, NULL); in _mesa_meta_end()
977 const struct gl_stencil_attrib *stencil = &save->Stencil; in _mesa_meta_end()
1014 _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode); in _mesa_meta_end()
1019 if (ctx->Texture.Unit[0].CurrentTex[tgt] != save->CurrentTexture[tgt]) { in _mesa_meta_end()
1022 save->CurrentTexture[tgt]); in _mesa_meta_end()
1024 _mesa_reference_texobj(&save->CurrentTexture[tgt], NULL); in _mesa_meta_end()
1030 if (ctx->Texture.Unit[u].Enabled != save->TexEnabled[u]) { in _mesa_meta_end()
1032 ctx->Texture.Unit[u].Enabled = save->TexEnabled[u]; in _mesa_meta_end()
1035 if (ctx->Texture.Unit[u].TexGenEnabled != save->TexGenEnabled[u]) { in _mesa_meta_end()
1037 ctx->Texture.Unit[u].TexGenEnabled = save->TexGenEnabled[u]; in _mesa_meta_end()
1043 _mesa_ActiveTextureARB(GL_TEXTURE0 + save->ActiveUnit); in _mesa_meta_end()
1044 _mesa_ClientActiveTextureARB(GL_TEXTURE0 + save->ClientActiveUnit); in _mesa_meta_end()
1051 _mesa_LoadMatrixf(save->TextureMatrix); in _mesa_meta_end()
1055 _mesa_LoadMatrixf(save->ModelviewMatrix); in _mesa_meta_end()
1058 _mesa_LoadMatrixf(save->ProjectionMatrix); in _mesa_meta_end()
1060 _mesa_MatrixMode(save->MatrixMode); in _mesa_meta_end()
1064 if (save->ClipPlanesEnabled) { in _mesa_meta_end()
1067 if (save->ClipPlanesEnabled & (1 << i)) { in _mesa_meta_end()
1076 _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, save->ArrayBufferObj->Name); in _mesa_meta_end()
1077 _mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, NULL); in _mesa_meta_end()
1080 _mesa_BindVertexArray(save->ArrayObj->Name); in _mesa_meta_end()
1081 _mesa_reference_array_object(ctx, &save->ArrayObj, NULL); in _mesa_meta_end()
1085 if (save->ViewportX != ctx->Viewport.X || in _mesa_meta_end()
1086 save->ViewportY != ctx->Viewport.Y || in _mesa_meta_end()
1087 save->ViewportW != ctx->Viewport.Width || in _mesa_meta_end()
1088 save->ViewportH != ctx->Viewport.Height) { in _mesa_meta_end()
1089 _mesa_set_viewport(ctx, save->ViewportX, save->ViewportY, in _mesa_meta_end()
1090 save->ViewportW, save->ViewportH); in _mesa_meta_end()
1092 _mesa_DepthRange(save->DepthNear, save->DepthFar); in _mesa_meta_end()
1096 _mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR, save->ClampFragmentColor); in _mesa_meta_end()
1100 _mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR, save->ClampVertexColor); in _mesa_meta_end()
1104 if (save->CondRenderQuery) in _mesa_meta_end()
1105 _mesa_BeginConditionalRender(save->CondRenderQuery->Id, in _mesa_meta_end()
1106 save->CondRenderMode); in _mesa_meta_end()
1111 if (save->RenderMode == GL_SELECT) { in _mesa_meta_end()
1113 ctx->Select = save->Select; in _mesa_meta_end()
1114 } else if (save->RenderMode == GL_FEEDBACK) { in _mesa_meta_end()
1116 ctx->Feedback = save->Feedback; in _mesa_meta_end()
1122 if (ctx->Multisample.Enabled != save->MultisampleEnabled) in _mesa_meta_end()
1123 meta_set_enable(ctx, GL_MULTISAMPLE, save->MultisampleEnabled); in _mesa_meta_end()
1127 if (save->Lighting) { in _mesa_meta_end()
1130 if (save->RasterDiscard) { in _mesa_meta_end()
1134 if (save->TransformFeedbackNeedsResume) in _mesa_meta_end()