From cd0148dd38989a749ab7ddb7e437e4fb3674df5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 19 Dec 2020 02:40:15 -0500 Subject: [PATCH] mesa: fix trivial bugs in glPopAttrib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were quite a few. Hopefully the comments make it clear. Reviewed-by: Zoltán Böszörményi Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/main/attrib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index ff11ae245bd..4c945c2444c 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -808,6 +808,8 @@ _mesa_PopAttrib(void) FLUSH_CURRENT(ctx, 0); memcpy(&ctx->Current, &attr->Current, sizeof(struct gl_current_attrib)); + /* Set _NEW_LIGHT because current attribs may reference materials. */ + ctx->NewState |= _NEW_CURRENT_ATTRIB | _NEW_LIGHT; } if (mask & GL_DEPTH_BUFFER_BIT) { @@ -830,6 +832,7 @@ _mesa_PopAttrib(void) ctx->DriverFlags.NewClipPlaneEnable | ctx->DriverFlags.NewDepth | ctx->DriverFlags.NewDepthClamp | + ctx->DriverFlags.NewFragClamp | ctx->DriverFlags.NewFramebufferSRGB | ctx->DriverFlags.NewLineState | ctx->DriverFlags.NewLogicOp | @@ -837,9 +840,11 @@ _mesa_PopAttrib(void) ctx->DriverFlags.NewPolygonState | ctx->DriverFlags.NewSampleAlphaToXEnable | ctx->DriverFlags.NewSampleMask | + ctx->DriverFlags.NewSampleShading | ctx->DriverFlags.NewScissorTest | ctx->DriverFlags.NewStencil | - ctx->DriverFlags.NewNvConservativeRasterization; + ctx->DriverFlags.NewNvConservativeRasterization | + ctx->DriverFlags.NewTileRasterOrder; } if (mask & GL_EVAL_BIT) { @@ -939,7 +944,8 @@ _mesa_PopAttrib(void) ColorMaterial); TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, attr->Light.ColorMaterialEnabled, GL_COLOR_MATERIAL); - /* materials */ + /* Materials - they might be used by current attribs. */ + ctx->NewState |= _NEW_CURRENT_ATTRIB; memcpy(&ctx->Light.Material, &attr->Light.Material, sizeof(struct gl_material)); if (ctx->Extensions.ARB_color_buffer_float) {