etnaviv: use nir_lower_idiv(..) before opt loop

nir_lower_idiv(..) creates during its lowering isub instructions.
Move nir_lower_idiv(..) before the opt loop to have a chance to
optimize/lower isub away. Also drop the drop the halti dependency to
make it easier to follow.

This fixes the following assert on GC3000:
  Unhandled ALU op: isub

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9447>
This commit is contained in:
Christian Gmeiner
2021-03-07 11:05:52 +01:00
committed by Marge Bot
parent 279ef45db5
commit f532202f2d

View File

@@ -1104,6 +1104,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v)
NIR_PASS_V(s, nir_lower_indirect_derefs, nir_var_all, UINT32_MAX);
NIR_PASS_V(s, nir_lower_tex, &(struct nir_lower_tex_options) { .lower_txp = ~0u });
NIR_PASS_V(s, nir_lower_alu_to_scalar, etna_alu_to_scalar_filter_cb, specs);
NIR_PASS_V(s, nir_lower_idiv, nir_lower_idiv_fast);
etna_optimize_loop(s);
@@ -1125,7 +1126,6 @@ etna_compile_shader_nir(struct etna_shader_variant *v)
NIR_PASS_V(s, nir_opt_algebraic);
NIR_PASS_V(s, nir_lower_bool_to_float);
} else {
NIR_PASS_V(s, nir_lower_idiv, nir_lower_idiv_fast);
NIR_PASS_V(s, nir_lower_bool_to_int32);
}