mesa: glsl: fix/simplify array element handling