etnaviv: nir: switch to etna_nir_lower_to_source_mods(..)
nir's source modifiers are going away soon and with it also the lowering
pass. Lets switch to our own lowering pass. We need to run our own
lowering pass almost at the end else opc_cse(..) etc. might do some
wrong needed opts as nir does not see our modifiers.
Also we need to remove the last nir_opt_dce(..) as it will remove not dead
code caused by the used load_const hack.
32 %15 = load_const (0x00000000 = 0.000000)
32 %4 = fabs %15 (0.000000)
nir_opt_dce is correct when it removes the two instructions. But in reality
the load_const is a uniform that should not be removed.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>