glsl: fix interpolateAtXxx(some_vec[idx], ...) with dynamic idx
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 1 Aug 2017 10:44:34 +0000 (12:44 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 3 Nov 2017 13:30:08 +0000 (14:30 +0100)
commitca63a5ed3e9efb2bd645b425f7393089f4e132a6
treed088b1dfc76ec62ee3d2fffbe181cecf7e05c743
parent4f42450b86ea30f9228309e02ca68755c389866f
glsl: fix interpolateAtXxx(some_vec[idx], ...) with dynamic idx

The dynamic index of a vector (not array!) is lowered to a sequence of
conditional assignments. However, the interpolate_at_* expressions
require that the interpolant is an l-value of a shader input.

So instead of doing conditional assignments of parts of the shader input
and then interpolating that (which is nonsensical), we interpolate the
entire shader input and then do conditional assignments of the interpolated
result.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/lower_vec_index_to_cond_assign.cpp