radv: Run algebraic optimizations before NGG lowering.

This makes culling shaders more efficient because they split the
shader in two parts. It is better to optimize before this split
happens.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>
This commit is contained in:
Timur Kristóf 2021-07-06 08:45:33 +02:00 committed by Marge Bot
parent f30e4351de
commit d18920e03a

View file

@ -1001,6 +1001,9 @@ void radv_lower_ngg(struct radv_device *device, struct nir_shader *nir,
nir->info.stage == MESA_SHADER_TESS_EVAL) {
assert(key->vs_common_out.as_ngg);
if (consider_culling)
radv_optimize_nir_algebraic(nir, false);
out_conf =
ac_nir_lower_ngg_nogs(
nir,