lima/ppir: move alu vec to scalar lowering into NIR

Utgard PP is vec4, but some operations are scalar, utilize
NIR vec to scalar lowering pass and indicate operations that we
want to lower.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
Vasily Khoruzhick
2019-08-03 09:59:27 -07:00
parent aebca3961b
commit c780af7771
2 changed files with 14 additions and 107 deletions

View File

@@ -139,8 +139,17 @@ lima_program_optimize_vs_nir(struct nir_shader *s)
void
lima_program_optimize_fs_nir(struct nir_shader *s)
{
BITSET_DECLARE(alu_lower, nir_num_opcodes) = {0};
bool progress;
BITSET_SET(alu_lower, nir_op_frcp);
BITSET_SET(alu_lower, nir_op_frsq);
BITSET_SET(alu_lower, nir_op_flog2);
BITSET_SET(alu_lower, nir_op_fexp2);
BITSET_SET(alu_lower, nir_op_fsqrt);
BITSET_SET(alu_lower, nir_op_fsin);
BITSET_SET(alu_lower, nir_op_fcos);
NIR_PASS_V(s, nir_lower_fragcoord_wtrans);
NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0);
NIR_PASS_V(s, nir_lower_regs_to_ssa);
@@ -150,7 +159,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
progress = false;
NIR_PASS_V(s, nir_lower_vars_to_ssa);
//NIR_PASS(progress, s, nir_lower_alu_to_scalar, NULL);
NIR_PASS(progress, s, nir_lower_alu_to_scalar, alu_lower);
NIR_PASS(progress, s, nir_lower_phis_to_scalar);
NIR_PASS(progress, s, nir_copy_prop);
NIR_PASS(progress, s, nir_opt_remove_phis);