From edbbf4537bf3a8b54afa5f0d73b04a8fa418154b Mon Sep 17 00:00:00 2001 From: Neha Bhende Date: Tue, 16 Mar 2021 15:48:31 -0700 Subject: [PATCH] mesa: set states in fast path for restoring light attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since states were not updated in fast path for restoring light attributes, seen darker images in solidworks2012_viewprt.trace Fixes regression seen with solidworks2012_viewport.trace Fixes: 7fa9d9d06c4 ("mesa: add a fast path for restoring light attributes") Reviewed-by: Brian Paul Reviewed-by: Marek Olšák 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 2661af360ca..4412ba3c97f 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -999,10 +999,16 @@ _mesa_PopAttrib(void) memcpy(ctx->Light.LightSource, attr->Light.LightSource, sizeof(attr->Light.LightSource)); - memcpy(&ctx->Light.Light, &attr->Light.Light, - sizeof(attr->Light.Light)); memcpy(&ctx->Light.Model, &attr->Light.Model, sizeof(attr->Light.Model)); + + for (i = 0; i < ctx->Const.MaxLights; i++) { + TEST_AND_UPDATE(ctx->Light.Light[i].Enabled, + attr->Light.Light[i].Enabled, + GL_LIGHT0 + i); + memcpy(&ctx->Light.Light[i], &attr->Light.Light[i], + sizeof(struct gl_light)); + } } /* shade model */ TEST_AND_CALL1(Light.ShadeModel, ShadeModel);