zink: rework input/output location emission
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 10 Jun 2020 19:26:07 +0000 (15:26 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 15 Jun 2020 15:36:06 +0000 (15:36 +0000)
commit828c767113f557e2a6098342a3dfbfa3e393aa91
treead4f9daf6a76654aa712613161624f68e7c1226b
parentf90bc6daa973b3d762d87254bf4cbe2a71475fda
zink: rework input/output location emission

glsl builtins that have no analog in spirv are emitted as regular varyings,
which means they take up a slot.

we need to ensure that there's no conflict between these regular varying
slots (from user-defined varyings) and the glsl translated builtins, so
we do that by "reserving" the max number of varying slots that can be used
by a given stage, then remapping all glsl builtins with no spirv builtin
to a packed layout location that can be consistent across stages

sort of addresses mesa/mesa#3113 except now there's 10 fewer varying slots

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5432>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c