spirv: Fix structure splitting with per-vertex interface arrays.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 13 Mar 2016 08:08:56 +0000 (00:08 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 7 May 2016 22:44:41 +0000 (15:44 -0700)
commit742bc53d040632fd98fac8930e4e8749f5c430e2
tree3c06ff6686a825782b97eee2eda64981aba4b720
parent1896682d272c762b4dd5643a27d98b87a966b792
spirv: Fix structure splitting with per-vertex interface arrays.

We want to use interface_type, not vtn_var->type.  They're normally
equivalent, but for geometry/tessellation per-vertex interface arrays,
we need to unwrap a level.

Otherwise, we tried to iterate a structure members but instead used
an array length.  If the array length was longer than the number of
fields in the structure, we'd crash.

Fixes the CreatePipelineGeometryInputBlockPositive layer validation
test.

v2: Just use glsl_without_array() on the vtn_var type
    (requested by Jason Ekstrand).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
src/compiler/spirv/vtn_variables.c