v3dv: Only lower local arrays of size up to 2 to if-chains

Larger arrays get lowered to scratch access later, as that turns out
to be faster, while the if-chain is actually faster for arrays of
2 elements.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7726>
This commit is contained in:
Arcady Goldmints-Orlov 2020-11-20 01:12:51 -06:00 committed by Marge Bot
parent 8f583df7b6
commit e47a9938d3

View file

@ -400,8 +400,10 @@ preprocess_nir(nir_shader *nir,
NIR_PASS_V(nir, nir_lower_var_copies);
NIR_PASS_V(nir, nir_lower_indirect_derefs, nir_var_shader_in |
nir_var_shader_out |
nir_var_function_temp, UINT32_MAX);
nir_var_shader_out, UINT32_MAX);
NIR_PASS_V(nir, nir_lower_indirect_derefs,
nir_var_function_temp, 2);
NIR_PASS_V(nir, nir_lower_array_deref_of_vec,
nir_var_mem_ubo | nir_var_mem_ssbo,