nir: fix packing of TCS varyings not read by the TES
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 26 Mar 2020 01:23:23 +0000 (12:23 +1100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Mar 2020 07:26:39 +0000 (07:26 +0000)
commitb5e00f5c2bd35920a1aaf9bb676c784d5d18b6fd
treeb61c6b9a0d4bf4851c9a7d568e79a4f716171044
parent8b9ebbcb546816f525298dc24711c1922751e312
nir: fix packing of TCS varyings not read by the TES

Unlike other stages TCS outputs not read by the TES cannot always
be demoted to globals e.g. when they are read by other TCS
invocations.

We were not taking these outputs into account when packing which
could result in other outputs being assigned to the same location.

Here we make sure to gather information on these outputs and group
them together when packing.

This fixes rendering issues in QUBE 2 via Proton.

Closes: #2653
Fixes: 26aa460940f6 ("nir: rewrite varying component packing")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4328>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4328>
src/compiler/nir/nir_linking_helpers.c