ir3: do not move varying inputs that depend on unmovable instrs
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Tue, 27 Apr 2021 11:51:26 +0000 (14:51 +0300)
committerMarge Bot <eric+marge@anholt.net>
Fri, 30 Apr 2021 14:49:18 +0000 (14:49 +0000)
commit1201aa9332a9b74c231bd7733b0aef5af42dc6fe
treef22ad1abeffff83aac087efd24d1ee13bc1fa451
parent5d5f7c79a58a8c1e93d9b6060d4a3cd0d6591ea5
ir3: do not move varying inputs that depend on unmovable instrs

Not all varying fetches could be pulled into the start block.
If there are fetches we couldn't pull, like load_interpolated_input
with offset which depends on a non-reorderable ssbo load or on a
phi node, this pass is skipped since it would be hard to find a place
to set (ei) flag (beside at the very end).

We also don't have to manually set (ei) in such cases since a5xx and
a6xx do automatically release varying storage at the end.
Earlier gens need further testing, however they do not support
interpolateAt* functions at moment, so unless we would like to support
sample shading on them - they are fine.

Fixes crash in GTA V.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10483>
src/freedreno/ir3/ir3_legalize.c
src/freedreno/ir3/ir3_nir_move_varying_inputs.c