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.
This commit is contained in:
@@ -475,6 +475,7 @@ struct iris_vtable {
|
|||||||
void (*populate_gs_key)(const struct iris_context *ice,
|
void (*populate_gs_key)(const struct iris_context *ice,
|
||||||
struct brw_gs_prog_key *key);
|
struct brw_gs_prog_key *key);
|
||||||
void (*populate_fs_key)(const struct iris_context *ice,
|
void (*populate_fs_key)(const struct iris_context *ice,
|
||||||
|
const struct shader_info *info,
|
||||||
struct brw_wm_prog_key *key);
|
struct brw_wm_prog_key *key);
|
||||||
void (*populate_cs_key)(const struct iris_context *ice,
|
void (*populate_cs_key)(const struct iris_context *ice,
|
||||||
struct brw_cs_prog_key *key);
|
struct brw_cs_prog_key *key);
|
||||||
|
@@ -1494,7 +1494,7 @@ iris_update_compiled_fs(struct iris_context *ice)
|
|||||||
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
|
struct iris_screen *screen = (struct iris_screen *)ice->ctx.screen;
|
||||||
const struct gen_device_info *devinfo = &screen->devinfo;
|
const struct gen_device_info *devinfo = &screen->devinfo;
|
||||||
struct brw_wm_prog_key key = { KEY_INIT(devinfo->gen) };
|
struct brw_wm_prog_key key = { KEY_INIT(devinfo->gen) };
|
||||||
ice->vtbl.populate_fs_key(ice, &key);
|
ice->vtbl.populate_fs_key(ice, &ish->nir->info, &key);
|
||||||
|
|
||||||
if (ish->nos & (1ull << IRIS_NOS_LAST_VUE_MAP))
|
if (ish->nos & (1ull << IRIS_NOS_LAST_VUE_MAP))
|
||||||
key.input_slots_valid = ice->shaders.last_vue_map->slots_valid;
|
key.input_slots_valid = ice->shaders.last_vue_map->slots_valid;
|
||||||
|
@@ -3442,6 +3442,7 @@ iris_populate_gs_key(const struct iris_context *ice,
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_populate_fs_key(const struct iris_context *ice,
|
iris_populate_fs_key(const struct iris_context *ice,
|
||||||
|
const struct shader_info *info,
|
||||||
struct brw_wm_prog_key *key)
|
struct brw_wm_prog_key *key)
|
||||||
{
|
{
|
||||||
struct iris_screen *screen = (void *) ice->ctx.screen;
|
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;
|
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->persample_interp = rast->force_persample_interp;
|
||||||
key->multisample_fbo = rast->multisample && fb->samples > 1;
|
key->multisample_fbo = rast->multisample && fb->samples > 1;
|
||||||
|
Reference in New Issue
Block a user