zink: compute correct location for line-smooth gs
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 26 May 2023 07:48:56 +0000 (09:48 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 May 2023 14:24:25 +0000 (14:24 +0000)
commitffc77d52629dead73dcdb45306834d55210512c6
treeec25ec7f3cfb3c79ca92aa23240d52001f35301c
parent955a6ffa6e4e585c9de7d294bfd1bb2f6d4303e5
zink: compute correct location for line-smooth gs

The GS and the FS needs to agree on the driver_location. But we just
used the num_outputs variable for the GS instead of matching the logic
from lower_aaline_instr in nir_draw_helpers.c.

This does that, but cleans up our copy slightly to avoid computing the
needless location, as well as using unsigned values.

This used to *mostly* work before, but only because we were lucky and
not too much crazy stuff went on with the inputs / outputs in
smooth-line cases.

Fixes: edecb66b018 ("nir: avoid generating conflicting output variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23316>
src/gallium/drivers/zink/zink_compiler.c