glsl: Pack flat "varyings" of mixed types together.
authorPaul Berry <stereotype441@gmail.com>
Wed, 19 Dec 2012 00:37:52 +0000 (16:37 -0800)
committerPaul Berry <stereotype441@gmail.com>
Tue, 8 Jan 2013 17:18:14 +0000 (09:18 -0800)
commitc35abcd1b0d0e0059c60781bd21558872020553d
tree6d6b0dde5c04f96ee075a75e4a7819dbdf0580f6
parent18720555dd2da779ad6907e8f6aa083e7b4d1841
glsl: Pack flat "varyings" of mixed types together.

This patch enhances the varying packing code so that flat varyings of
uint, int, and float types can be packed together.

We accomplish this in lower_packed_varyings.cpp by making the type of
all flat varyings ivec4, and then using information-preserving type
conversions (e.g. ir_unop_bitcast_f2i) to convert all other types to
ints.

The varying_matches::compute_packing_class() function is updated to
reflect the fact that varying packing no longer needs to segregate
varyings of different base types.

Fixes piglit test varying-packing-mixed-types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Split lower_packed_varyings_visitor::bitwise_assign into
pack/unpack variants.
src/glsl/link_varyings.cpp
src/glsl/lower_packed_varyings.cpp