freedreno/ir3: fix gpu hang with pre-fs-tex-fetch
authorRob Clark <robdclark@chromium.org>
Fri, 8 Nov 2019 20:55:27 +0000 (12:55 -0800)
committerRob Clark <robdclark@chromium.org>
Tue, 12 Nov 2019 21:57:52 +0000 (13:57 -0800)
commitb22617fb57be54a859a8d62a5e545afcb38266e9
tree65f1307aa332c1730c7fc05a264280ee23408e46
parent4bb697d938d17bbdd5124db0102d97fb9ead2229
freedreno/ir3: fix gpu hang with pre-fs-tex-fetch

For pre-fs-dispatch texture fetch, we need to assign bary_ij to r0.x,
even if it is not used in the shader (ie. only varying use is for tex
coords).  But if, for example, gl_FragCoord is used, it could get
assigned on top of bary_ij, resulting in a GPU hang.

The solution to this is two-fold: (1) the inputs/outputs rework has the
benefit of making RA realize bary_ij is a vec2, even if there are no
split/collect instructions (due to no varying fetches in the shader
itself).  And (2) extend the live ranges of meta:input instructions to
the first non-input, to prevent RA from assigning the same register to
multiple inputs.

Backport note: because of (1) above, a better solution for 19.3 would be
to revert f30c256ec05.

Fixes: f30c256ec05 ("freedreno/ir3: enable pre-fs texture fetch for a6xx")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/freedreno/ir3/ir3_ra.c
src/freedreno/ir3/ir3_sched.c