glsl: use ir stored array dimension to know which dimension we are up to