Mesa (master): mesa: Move seperate_specular into the lighting section.

Brian Paul brianp at kemper.freedesktop.org
Tue Jan 30 16:11:23 UTC 2018


Module: Mesa
Branch: master
Commit: 63e845d3cc4ce46a983f1f38c096b6091d998e1f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=63e845d3cc4ce46a983f1f38c096b6091d998e1f

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Sat Jan 27 12:09:00 2018 -0700

mesa: Move seperate_specular into the lighting section.

For the state key for hashing fixed function
vertex shaders, the information is only evaluated
if lighting is generally switched on.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/ffvertex_prog.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 605c501b24..e8a5eff625 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -166,9 +166,6 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
       key->fragprog_inputs_read |= (VARYING_BIT_COL0 | VARYING_BIT_TEX0);
    }
 
-   key->separate_specular = (ctx->Light.Model.ColorControl ==
-			     GL_SEPARATE_SPECULAR_COLOR);
-
    if (ctx->Light.Enabled) {
       key->light_global_enabled = 1;
 
@@ -178,6 +175,9 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
       if (ctx->Light.Model.TwoSide)
 	 key->light_twoside = 1;
 
+      if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
+         key->separate_specular = 1;
+
       if (ctx->Light.ColorMaterialEnabled) {
 	 key->light_color_material_mask = ctx->Light._ColorMaterialBitmask;
       }




More information about the mesa-commit mailing list