glsl: correctly track cross slot component packing
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 22 Jul 2022 01:59:49 +0000 (11:59 +1000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Jul 2022 10:43:18 +0000 (10:43 +0000)
commit7c484b0c1c9b126e5573cbe4a7fd718437b36eeb
tree97f1dfdf51d2100b56464cb5e14f723c54220582
parent00955a644e558deb69d332d0c68d8dad602cf23d
glsl: correctly track cross slot component packing

Otherwise we will mix and match mesa's custom cross slot packing
with arb_enhanced_layouts style packing and we won't correctly
handle the size of the vars needed for the mesa custom packing.

The code was working correctly if the shader interface had both
a matching input and output but when we only had one side of
the interface we were only marking a single slot location as
packed.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Fixes: e5122a55435d ("glsl: add a NIR based varying linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6853
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17550>
src/compiler/glsl/gl_nir_link_varyings.c