lima/ppir: add NIR pass to split varying loads

NIR may emit a single instrinsic to load several packed varyings,
but that's suboptimal for Utgard PP for several reasons:
- varyings that are used as sampler inputs can be passed using
  pipeline register with increased precision
- we have small number of regs, so using a vec4 regs for storing
  two vec2 varyings increases reg pressure.

Add NIR pass to split a single load into several loads and utilize
it in lima.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
Vasily Khoruzhick
2019-09-22 22:03:22 -07:00
parent c372dc762d
commit 6dd0ad66de
5 changed files with 127 additions and 0 deletions

View File

@@ -224,6 +224,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
nir_var_shader_in |
nir_var_shader_out |
nir_var_function_temp);
NIR_PASS(progress, s, lima_nir_split_load_input);
} while (progress);
NIR_PASS_V(s, nir_lower_int_to_float);