glsl: optimise inputs/outputs with explicit locations
authorTimothy Arceri <timothy.arceri@collabora.com>
Sat, 21 Nov 2015 01:47:25 +0000 (12:47 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Tue, 1 Dec 2015 01:45:03 +0000 (12:45 +1100)
commit12ba6cfba7974cdf4609b146303a5988447d30c2
tree9f3c004317ca9cee410a1a8b4954b88079d3f564
parent4d64459a92a4c1a64fb7051fd1320c14c1854dcb
glsl: optimise inputs/outputs with explicit locations

This change allows used defined inputs/outputs with explicit locations
to be removed if they are detected to not be used between shaders
at link time.

To enable this we change the is_unmatched_generic_inout field to be
flagged when we have a user defined varying. Previously
explicit_location was assumed to be set only in builtins however SSO
allows the user to set an explicit location.

We then add a function to match explicit locations between shaders.

V2: call match_explicit_outputs_to_inputs() after
is_unmatched_generic_inout has been initialised.

Cc: Gregory Hainaut <gregory.hainaut@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/link_varyings.cpp
src/glsl/linker.cpp