diff options
author | Kenneth Graunke <[email protected]> | 2019-07-07 16:32:09 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-07-11 00:12:50 -0700 |
commit | c58f52f0ef39db7ca6574381931203f435b03280 (patch) | |
tree | de7f3525fa4956e0c986548510aca3aa9547a02b /src/gallium/drivers/iris/iris_state.c | |
parent | cb82d534a0c3ea65c0f24586fcb877d912eec130 (diff) |
iris: Only set key->flat_shade if COL0/COL1 are written.
This was just laziness on my part, we already added similar checks in
the VS key handling. Just need to do it here too. Should improve cache
hits.
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 99f006e8dfa..6fe3e04d92a 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -3442,6 +3442,7 @@ iris_populate_gs_key(const struct iris_context *ice, */ static void iris_populate_fs_key(const struct iris_context *ice, + const struct shader_info *info, struct brw_wm_prog_key *key) { struct iris_screen *screen = (void *) ice->ctx.screen; @@ -3458,8 +3459,8 @@ iris_populate_fs_key(const struct iris_context *ice, key->alpha_test_replicate_alpha = fb->nr_cbufs > 1 && zsa->alpha.enabled; - /* XXX: only bother if COL0/1 are read */ - key->flat_shade = rast->flatshade; + key->flat_shade = rast->flatshade && + (info->inputs_read & (VARYING_BIT_COL0 | VARYING_BIT_COL1)); key->persample_interp = rast->force_persample_interp; key->multisample_fbo = rast->multisample && fb->samples > 1; |