summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-08-22 14:23:17 -0700
committerKenneth Graunke <[email protected]>2017-08-23 11:55:17 -0700
commiteaf5b8722bfaa8f8612c2cae14f61be4874c6406 (patch)
tree79652e3e766f7ce3776bb761d58ed044eb69b9e0 /src
parent348929015ba8166495195ccff4f9bb80d057b6d7 (diff)
i965: Only set key->flat_shade if COL0/COL1 are written.
This may reduce some recompiles. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index c9c45045902..e1555d60c56 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -531,7 +531,9 @@ brw_wm_populate_key(struct brw_context *brw, struct brw_wm_prog_key *key)
key->stats_wm = brw->stats_wm;
/* _NEW_LIGHT */
- key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT);
+ key->flat_shade =
+ (prog->info.inputs_read & (VARYING_BIT_COL0 | VARYING_BIT_COL1)) &&
+ (ctx->Light.ShadeModel == GL_FLAT);
/* _NEW_FRAG_CLAMP | _NEW_BUFFERS */
key->clamp_fragment_color = ctx->Color._ClampFragmentColor;