nir: avoid generating conflicting output variables
authorantonino <antonino.maniscalco@collabora.com>
Mon, 20 Feb 2023 18:26:20 +0000 (19:26 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 29 Mar 2023 19:18:39 +0000 (19:18 +0000)
commitedecb66b01849effdf859f3cfaeebb9af5e1c1da
tree93cd08bfa1a2bdf8d04f1ecfa21b08cad4be5095
parentea14579f3dc3144541c6e5944d14e0e257115b15
nir: avoid generating conflicting output variables

Because not all vertex outputs can have corresponding fragment inputs
(eg. edgeflags) some logic is needed to correctly generate variables in
a passthough gs.

Before this change some output variables ened up with the same location.

Fixes: d0342e28b32 ("nir: Add helper to create passthrough GS shader")

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
src/compiler/nir/nir_passthrough_gs.c