glsl: overhaul 'return' statement handling