glsl: Update lower_packed_varyings to handle varying structs.
authorPaul Berry <stereotype441@gmail.com>
Fri, 11 Jan 2013 20:56:03 +0000 (12:56 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 25 Jan 2013 00:30:43 +0000 (16:30 -0800)
commit1ecd23dea944dbf4cdd2c6bfa8ce0e0e09de8239
tree7748f7f6118ee549a097fe9b2c8f950181ec32f1
parent88e4bfde2639568fabde6f5342e305e5689c6a27
glsl: Update lower_packed_varyings to handle varying structs.

This patch adds code to lower_packed_varyings to handle varyings of
type struct.  Varying structs are currently packed in the most naive
possible way (in declaration order, with no gaps), so there is a
potential loss of runtime efficiency.  In a later patch it would be
nice to replace this with a "flattening" approach (wherein a varying
struct is flattened to individual varyings corresponding to each of
its structure elements), so that the linker can align each structure
element independently.  However, that would require a significantly
more complex implementation.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/lower_packed_varyings.cpp