glsl: fix overlapping of varying locations for arrays and structs
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 15 Dec 2015 05:40:26 +0000 (16:40 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 6 Jan 2016 22:06:20 +0000 (09:06 +1100)
commitac6e2c2056469226fdeefb96bee632546f45a0fb
treece353567f0be3cb2d5f917b34fb2514772bdf0a5
parent5907a02ab6fbe20b4ba58eb00bf93261129798d5
glsl: fix overlapping of varying locations for arrays and structs

Previously we were only reserving a single location for arrays and
structs.

We also didn't take into account implicit locations clashing with
explicit locations when assigning locations for their arrays or
structs.

This patch fixes both issues.

V5: fix regression for patch inputs/outputs in tessellation shaders
V4: just use count_attribute_slots() to get the number of slots,
also calculate the correct number of slots to reserve for gs and
tess stages by making use of the new get_varying_type() helper.
V3: handle arrays of structs
V2: also fix for arrays of arrays and structs.

Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/glsl/link_varyings.cpp