glsl: Lower vector_extracts to swizzles after lower_vector_derefs.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 28 Apr 2016 04:07:07 +0000 (21:07 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 29 Apr 2016 23:03:36 +0000 (16:03 -0700)
commit750c38fad1f19e2403b4960674006c5f932075ad
tree0902afe16cb16366a01ae928463f526b0608a4d9
parent1cd600dbb975cce616da376a680692afb2da47f9
glsl: Lower vector_extracts to swizzles after lower_vector_derefs.

lower_vector_derefs can produce new vector_extract operations.
Neither i965 nor st_glsl_to_tgsi can handle them, so we'd best
convert them to swizzles.

Together with the previous patch, this fixes assertion failures in
GLideN64, as well as a new Piglit test which reproduces the issue:
spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/linker.cpp