glsl: Create a field to store fractional varying locations.
authorPaul Berry <stereotype441@gmail.com>
Wed, 5 Dec 2012 18:47:55 +0000 (10:47 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 14 Dec 2012 18:48:52 +0000 (10:48 -0800)
commit3e81c666db6940675eca623044e5b372dc6b7756
treeba0d5e4cbf1f967d5ac0b600a471f21f52340905
parent3c9c17db4a02ab5b1b2f60b9655c20319d9a9093
glsl: Create a field to store fractional varying locations.

Currently, the location of each varying is recorded in ir_variable as
a multiple of the size of a vec4.  In order to pack varyings, we need
to be able to record, e.g. that a vec2 is stored in the second half of
a varying slot rather than the first half.

This patch introduces a field ir_variable::location_frac, which
represents the offset within a vec4 where a varying's value is stored.
Varyings that are not subject to packing will always have a
location_frac value of zero.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/linker.cpp