diff options
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r-- | src/mesa/main/enable.c | 189 |
1 files changed, 110 insertions, 79 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 0c5579b0dd0..67a112d490c 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -124,7 +124,7 @@ client_state(struct gl_context *ctx, struct gl_vertex_array_object* vao, case GL_POINT_SIZE_ARRAY_OES: if (ctx->VertexProgram.PointSizeEnabled != state) { - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, 0); ctx->VertexProgram.PointSizeEnabled = state; } vao_state(ctx, vao, VERT_ATTRIB_POINT_SIZE, state); @@ -333,7 +333,7 @@ enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit) if (texUnit->Enabled == newenabled) return GL_FALSE; - FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE); + FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE, GL_TEXTURE_BIT | GL_ENABLE_BIT); texUnit->Enabled = newenabled; return GL_TRUE; } @@ -354,9 +354,9 @@ _mesa_set_multisample(struct gl_context *ctx, GLboolean state) */ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES || !ctx->DriverFlags.NewMultisampleEnable) { - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); } else { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); } ctx->NewDriverState |= ctx->DriverFlags.NewMultisampleEnable; @@ -378,7 +378,8 @@ _mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state) return; /* TODO: Switch i965 to the new flag and remove the conditional */ - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewFramebufferSRGB ? 0 : _NEW_BUFFERS); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewFramebufferSRGB ? 0 : _NEW_BUFFERS, + GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewFramebufferSRGB; ctx->Color.sRGBEnabled = state; @@ -415,7 +416,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Color.AlphaEnabled == state) return; /* AlphaEnabled is used by the fixed-func fragment program */ - FLUSH_VERTICES(ctx, _NEW_COLOR); + FLUSH_VERTICES(ctx, _NEW_COLOR, GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest; ctx->Color.AlphaEnabled = state; break; @@ -424,7 +425,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.AutoNormal == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.AutoNormal = state; break; @@ -435,6 +436,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (newEnabled != ctx->Color.BlendEnabled) { _mesa_flush_vertices_for_blend_adv(ctx, newEnabled, ctx->Color._AdvancedBlendMode); + ctx->PopAttribState |= GL_ENABLE_BIT; ctx->Color.BlendEnabled = newEnabled; _mesa_update_allow_draw_out_of_order(ctx); } @@ -463,9 +465,10 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) */ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES || !ctx->DriverFlags.NewClipPlaneEnable) { - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + FLUSH_VERTICES(ctx, _NEW_TRANSFORM, + GL_TRANSFORM_BIT | GL_ENABLE_BIT); } else { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT); } ctx->NewDriverState |= ctx->DriverFlags.NewClipPlaneEnable; @@ -489,7 +492,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Light.ColorMaterialEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); + FLUSH_VERTICES(ctx, _NEW_LIGHT, GL_LIGHTING_BIT | GL_ENABLE_BIT); FLUSH_CURRENT(ctx, 0); ctx->Light.ColorMaterialEnabled = state; if (state) { @@ -501,14 +504,16 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.CullFlag == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.CullFlag = state; break; case GL_DEPTH_TEST: if (ctx->Depth.Test == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH, + GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.Test = state; _mesa_update_allow_draw_out_of_order(ctx); @@ -520,7 +525,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_DITHER: if (ctx->Color.DitherFlag == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR, + GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewBlend; ctx->Color.DitherFlag = state; break; @@ -529,7 +535,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Fog.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_FOG); + FLUSH_VERTICES(ctx, _NEW_FOG, GL_FOG_BIT | GL_ENABLE_BIT); ctx->Fog.Enabled = state; ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE; break; @@ -545,7 +551,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); + FLUSH_VERTICES(ctx, _NEW_LIGHT, GL_LIGHTING_BIT | GL_ENABLE_BIT); ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; if (state) { ctx->Light._EnabledLights |= 1u << (cap - GL_LIGHT0); @@ -559,7 +565,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Light.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); + FLUSH_VERTICES(ctx, _NEW_LIGHT, GL_LIGHTING_BIT | GL_ENABLE_BIT); ctx->Light.Enabled = state; break; case GL_LINE_SMOOTH: @@ -567,7 +573,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Line.SmoothFlag == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE, + GL_LINE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewLineState; ctx->Line.SmoothFlag = state; break; @@ -576,7 +583,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Line.StippleFlag == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE, + GL_LINE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewLineState; ctx->Line.StippleFlag = state; break; @@ -585,7 +593,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Color.IndexLogicOpEnabled == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR, + GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp; ctx->Color.IndexLogicOpEnabled = state; break; @@ -594,7 +603,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->IntelConservativeRasterization == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, 0); ctx->NewDriverState |= ctx->DriverFlags.NewIntelConservativeRasterization; ctx->IntelConservativeRasterization = state; @@ -604,7 +613,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->ConservativeRasterization == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewNvConservativeRasterization; ctx->ConservativeRasterization = state; @@ -614,7 +623,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Color.ColorLogicOpEnabled == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR, + GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp; ctx->Color.ColorLogicOpEnabled = state; _mesa_update_allow_draw_out_of_order(ctx); @@ -624,7 +634,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1Color4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1Color4 = state; break; @@ -633,7 +643,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1Index == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1Index = state; break; @@ -642,7 +652,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1Normal == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1Normal = state; break; @@ -651,7 +661,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord1 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1TextureCoord1 = state; break; @@ -660,7 +670,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord2 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1TextureCoord2 = state; break; @@ -669,7 +679,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord3 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1TextureCoord3 = state; break; @@ -678,7 +688,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1TextureCoord4 = state; break; @@ -687,7 +697,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1Vertex3 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1Vertex3 = state; break; @@ -696,7 +706,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map1Vertex4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map1Vertex4 = state; break; @@ -705,7 +715,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2Color4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2Color4 = state; break; @@ -714,7 +724,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2Index == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2Index = state; break; @@ -723,7 +733,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2Normal == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2Normal = state; break; @@ -732,7 +742,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord1 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2TextureCoord1 = state; break; @@ -741,7 +751,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord2 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2TextureCoord2 = state; break; @@ -750,7 +760,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord3 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2TextureCoord3 = state; break; @@ -759,7 +769,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2TextureCoord4 = state; break; @@ -768,7 +778,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2Vertex3 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2Vertex3 = state; break; @@ -777,7 +787,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Eval.Map2Vertex4 == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_EVAL_BIT | GL_ENABLE_BIT); vbo_exec_update_eval_maps(ctx); ctx->Eval.Map2Vertex4 = state; break; @@ -786,7 +796,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Transform.Normalize == state) return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + FLUSH_VERTICES(ctx, _NEW_TRANSFORM, GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->Transform.Normalize = state; break; case GL_POINT_SMOOTH: @@ -794,7 +804,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Point.SmoothFlag == state) return; - FLUSH_VERTICES(ctx, _NEW_POINT); + FLUSH_VERTICES(ctx, _NEW_POINT, GL_POINT_BIT | GL_ENABLE_BIT); ctx->Point.SmoothFlag = state; break; case GL_POLYGON_SMOOTH: @@ -803,7 +813,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.SmoothFlag == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.SmoothFlag = state; break; @@ -813,7 +824,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.StippleFlag == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.StippleFlag = state; break; @@ -823,7 +835,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.OffsetPoint == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.OffsetPoint = state; break; @@ -833,7 +846,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.OffsetLine == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.OffsetLine = state; break; @@ -841,7 +855,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Polygon.OffsetFill == state) return; FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON); + ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, + GL_POLYGON_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; ctx->Polygon.OffsetFill = state; break; @@ -850,7 +865,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Transform.RescaleNormals == state) return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + FLUSH_VERTICES(ctx, _NEW_TRANSFORM, GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->Transform.RescaleNormals = state; break; case GL_SCISSOR_TEST: @@ -860,7 +875,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) state * ((1 << ctx->Const.MaxViewports) - 1); if (newEnabled != ctx->Scissor.EnableFlags) { FLUSH_VERTICES(ctx, ctx->DriverFlags.NewScissorTest ? 0 : - _NEW_SCISSOR); + _NEW_SCISSOR, + GL_SCISSOR_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; ctx->Scissor.EnableFlags = newEnabled; } @@ -869,7 +885,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_STENCIL_TEST: if (ctx->Stencil.Enabled == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL, + GL_STENCIL_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.Enabled = state; _mesa_update_allow_draw_out_of_order(ctx); @@ -912,7 +929,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) newenabled |= coordBit; if (texUnit->TexGenEnabled == newenabled) return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE); + FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE, + GL_TEXTURE_BIT | GL_ENABLE_BIT); texUnit->TexGenEnabled = newenabled; } } @@ -933,7 +951,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) newenabled |= STR_BITS; if (texUnit->TexGenEnabled == newenabled) return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE); + FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE, 0); texUnit->TexGenEnabled = newenabled; } } @@ -978,7 +996,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Fog.ColorSumEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_FOG); + FLUSH_VERTICES(ctx, _NEW_FOG, GL_FOG_BIT | GL_ENABLE_BIT); ctx->Fog.ColorSumEnabled = state; break; @@ -992,7 +1010,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleAlphaToCoverage == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleAlphaToXEnable ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, + GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewSampleAlphaToXEnable; ctx->Multisample.SampleAlphaToCoverage = state; break; @@ -1002,7 +1021,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleAlphaToOne == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleAlphaToXEnable ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, + GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewSampleAlphaToXEnable; ctx->Multisample.SampleAlphaToOne = state; break; @@ -1010,7 +1030,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleCoverage == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleMask ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, + GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewSampleMask; ctx->Multisample.SampleCoverage = state; break; @@ -1020,7 +1041,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleCoverageInvert == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleMask ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, + GL_MULTISAMPLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewSampleMask; ctx->Multisample.SampleCoverageInvert = state; break; @@ -1032,7 +1054,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleShading == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleShading ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, + GL_MULTISAMPLE_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading; ctx->Multisample.SampleShading = state; break; @@ -1043,7 +1066,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Transform.RasterPositionUnclipped == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->Transform.RasterPositionUnclipped = state; break; @@ -1055,7 +1078,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Point.PointSprite == state) return; - FLUSH_VERTICES(ctx, _NEW_POINT); + FLUSH_VERTICES(ctx, _NEW_POINT, GL_POINT_BIT | GL_ENABLE_BIT); ctx->Point.PointSprite = state; break; @@ -1064,7 +1087,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->VertexProgram.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT); ctx->VertexProgram.Enabled = state; _mesa_update_vertex_processing_mode(ctx); break; @@ -1077,7 +1100,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->VertexProgram.PointSizeEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT); ctx->VertexProgram.PointSizeEnabled = state; break; case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: @@ -1085,7 +1108,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->VertexProgram.TwoSideEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT); ctx->VertexProgram.TwoSideEnabled = state; break; @@ -1104,7 +1127,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Stencil.TestTwoSide == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL, + GL_STENCIL_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.TestTwoSide = state; if (state) { @@ -1119,7 +1143,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->FragmentProgram.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT); ctx->FragmentProgram.Enabled = state; break; @@ -1129,7 +1153,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Depth.BoundsTest == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH, + GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.BoundsTest = state; break; @@ -1142,7 +1167,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Transform.DepthClampFar == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM); + _NEW_TRANSFORM, + GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; ctx->Transform.DepthClampNear = state; ctx->Transform.DepthClampFar = state; @@ -1154,7 +1180,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Transform.DepthClampNear == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM); + _NEW_TRANSFORM, + GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; ctx->Transform.DepthClampNear = state; break; @@ -1165,7 +1192,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Transform.DepthClampFar == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM); + _NEW_TRANSFORM, + GL_TRANSFORM_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; ctx->Transform.DepthClampFar = state; break; @@ -1175,7 +1203,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->ATIFragmentShader.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM, GL_ENABLE_BIT); ctx->ATIFragmentShader.Enabled = state; break; @@ -1183,7 +1211,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (!_mesa_has_ARB_seamless_cube_map(ctx)) goto invalid_enum_error; if (ctx->Texture.CubeMapSeamless != state) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT); + FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT, 0); ctx->Texture.CubeMapSeamless = state; } break; @@ -1192,7 +1220,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (!(_mesa_has_EXT_transform_feedback(ctx) || _mesa_is_gles3(ctx))) goto invalid_enum_error; if (ctx->RasterDiscard != state) { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, 0); ctx->NewDriverState |= ctx->DriverFlags.NewRasterizerDiscard; ctx->RasterDiscard = state; } @@ -1202,7 +1230,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (!_mesa_has_MESA_tile_raster_order(ctx)) goto invalid_enum_error; if (ctx->TileRasterOrderFixed != state) { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder; ctx->TileRasterOrderFixed = state; } @@ -1212,7 +1240,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (!_mesa_has_MESA_tile_raster_order(ctx)) goto invalid_enum_error; if (ctx->TileRasterOrderIncreasingX != state) { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder; ctx->TileRasterOrderIncreasingX = state; } @@ -1222,7 +1250,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (!_mesa_has_MESA_tile_raster_order(ctx)) goto invalid_enum_error; if (ctx->TileRasterOrderIncreasingY != state) { - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder; ctx->TileRasterOrderIncreasingY = state; } @@ -1274,7 +1302,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Multisample.SampleMask == state) return; FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleMask ? 0 : - _NEW_MULTISAMPLE); + _NEW_MULTISAMPLE, 0); ctx->NewDriverState |= ctx->DriverFlags.NewSampleMask; ctx->Multisample.SampleMask = state; break; @@ -1284,7 +1312,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Color.BlendCoherent == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR, + GL_COLOR_BUFFER_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewBlend; ctx->Color.BlendCoherent = state; break; @@ -1294,7 +1323,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->IntelBlackholeRender == state) return; - FLUSH_VERTICES(ctx, 0); + FLUSH_VERTICES(ctx, 0, 0); ctx->IntelBlackholeRender = state; break; @@ -1369,6 +1398,7 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, _mesa_flush_vertices_for_blend_adv(ctx, enabled, ctx->Color._AdvancedBlendMode); + ctx->PopAttribState |= GL_ENABLE_BIT; ctx->Color.BlendEnabled = enabled; _mesa_update_allow_draw_out_of_order(ctx); } @@ -1381,7 +1411,8 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, } if (((ctx->Scissor.EnableFlags >> index) & 1) != state) { FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewScissorTest ? 0 : _NEW_SCISSOR); + ctx->DriverFlags.NewScissorTest ? 0 : _NEW_SCISSOR, + GL_SCISSOR_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; if (state) ctx->Scissor.EnableFlags |= (1 << index); |