nir/linker: disable varying from uniform lowering by default

This fixes performance regression for Specviewperf/Energy
on AMD GPU. Other GPUs passing varying by memory may choose
to re-enable it as need.

Fixes: 2604625043 ("nir/linker: support uniform when optimizing varying")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15341>
This commit is contained in:
Qiang Yu
2022-03-11 13:55:02 +08:00
committed by Marge Bot
parent b219e9a96e
commit 2617e6c028
2 changed files with 11 additions and 1 deletions

View File

@@ -1377,7 +1377,8 @@ nir_link_opt_varyings(nir_shader *producer, nir_shader *consumer)
nir_ssa_def *ssa = intr->src[1].ssa;
if (ssa->parent_instr->type == nir_instr_type_load_const) {
progress |= replace_varying_input_by_constant_load(consumer, intr);
} else if (is_direct_uniform_load(ssa, &uni_scalar)) {
} else if (consumer->options->lower_varying_from_uniform &&
is_direct_uniform_load(ssa, &uni_scalar)) {
progress |= replace_varying_input_by_uniform_load(consumer, intr,
&uni_scalar);
} else {