summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-02-01 15:46:25 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-26 23:38:02 +0000
commit8e56ad6faefb851601c302049b411680924d6343 (patch)
tree621ef71452eb1c4c85cb40a45fe5aace3aece4fd /src/mesa/tnl
parent2060e952eccaa2862096514bfa83b60c41493119 (diff)
mesa: don't update derived material values in _mesa_update_state and elsewhere
To my great surprise, many drivers don't use these values at all. Move the update to the places where they are used. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_context.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index cd79e968ef1..0c5ce824bc6 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -134,6 +134,9 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
const struct gl_program *fp = ctx->FragmentProgram._Current;
GLuint i;
+ if (new_state & (_NEW_LIGHT_CONSTANTS | _NEW_MATERIAL))
+ _mesa_update_light_materials(ctx);
+
if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
assert(tnl->AllowVertexFog || tnl->AllowPixelFog);
tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))