glsl/linker: Optimize swizzles again after linking
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 1 Nov 2017 05:18:10 +0000 (22:18 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 9 Nov 2017 02:37:29 +0000 (18:37 -0800)
commit88f5588f777d76fe48fded8add745b4da2024ebc
treed8355a5d35434972b905e2ad133cf8bf24707f47
parentef1ca06ce89cba03fcb30f34c47808569517957d
glsl/linker: Optimize swizzles again after linking

Without this, the SPIR-V generator has to deal with a bunch of junk
like:

    (swiz z (swiz xxx (swiz x (var_ref packed:binormal.z,light_dir))))

It seems better to cull that stuff out than to add code to deal with
it.  The problem is the way swizzles to and from scalars have to be
handled in SPIR-V.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
src/compiler/glsl/linker.cpp