glsl: record number of components used in each slot for varying packing
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 5 Nov 2016 13:31:21 +0000 (09:31 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Nov 2016 01:26:48 +0000 (20:26 -0500)
commit73f53c097a6bbd07572d5e46af4893d17ff8af93
treec224c022da56f96956f2c898ece75d2fc66f0c2f
parent885c78801785701fdca0217a7b0f992f26115ee4
glsl: record number of components used in each slot for varying packing

Instead of packing varyings into vec4's, keep track of how many
components each slot uses and create varyings with matching types. This
ensures that we don't end up using more components than the orginal
shader, which is especially important for geometry shader output limits.

This comes up for NVIDIA hw, where the limit is 1024 output components
for a GS, and the hardware complains *loudly* if you even think about
going over.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/ir_optimization.h
src/compiler/glsl/link_varyings.cpp
src/compiler/glsl/lower_packed_varyings.cpp