lima: Add a NIR load duplicating pass
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 16 Sep 2019 08:37:27 +0000 (15:37 +0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Sep 2021 08:30:57 +0000 (08:30 +0000)
commit3d957b40cc167a97bb9dfc1b16f0d4fff149c15b
treedfe920d18c691e1905c625e3842d801e07f92d5a
parentef190b9e153bc93d8f127175c3960eafecb0d589
lima: Add a NIR load duplicating pass

and use it with vertex shaders.

Note:
The commit was originally authored by Connor Abbott <cwabbott@gmail.com>
and was cherry-picked from <mesa/mesa!2315>.
Apart from some changes, which were necessary due to rebasing, the following
changes have been added:
clone_intrinsic() was changed to use nir_instr_clone() instead of
doing it manually.
Tests against `src->parent_instr->type != nir_instr_type_phi` have been
inserted, otherwise we may run into a nir validation error.
Intrinsic load_input and load_uniform  are not duplicated, if their source
type is nir_instr_type_load_const.
The above changes are

Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7682>
src/gallium/drivers/lima/ir/lima_ir.h
src/gallium/drivers/lima/ir/lima_nir_split_loads.c [new file with mode: 0644]
src/gallium/drivers/lima/lima_program.c
src/gallium/drivers/lima/meson.build